diff options
author | Thorsten Behrens <thb@openoffice.org> | 2003-08-20 15:56:48 +0000 |
---|---|---|
committer | Thorsten Behrens <thb@openoffice.org> | 2003-08-20 15:56:48 +0000 |
commit | 32c0e6e8f891e97528f5e03a9577a811971fdb3a (patch) | |
tree | d429706792c8de9ac81ea23e8072863374aff4dc /basegfx/source | |
parent | 95e977c9d4e821a0dcf64d114b37d80bee611bd5 (diff) |
Some adaptions to coding guidelines. Method names are now lowercase, as well as namespaces. Enums are class members, if applicable, and all uppercase. Instead of sal_Bool, we're using builtin-bool, for non-API stuff
Diffstat (limited to 'basegfx/source')
-rw-r--r-- | basegfx/source/inc/PolygonPoint.hxx | 136 | ||||
-rw-r--r-- | basegfx/source/inc/hommatrixtemplate.hxx | 252 | ||||
-rw-r--r-- | basegfx/source/inc/polygontemplate.hxx | 138 |
3 files changed, 263 insertions, 263 deletions
diff --git a/basegfx/source/inc/PolygonPoint.hxx b/basegfx/source/inc/PolygonPoint.hxx index f6f053008384..37a228c1a2a6 100644 --- a/basegfx/source/inc/PolygonPoint.hxx +++ b/basegfx/source/inc/PolygonPoint.hxx @@ -2,9 +2,9 @@ * * $RCSfile: PolygonPoint.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2003-03-14 14:35:29 $ + * last change: $Author: thb $ $Date: 2003-08-20 16:56:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,7 +72,7 @@ template < class Point > class SimplePointEntry public: SimplePointEntry() - : maPoint(Point::GetEmptyPoint()) + : maPoint(Point::getEmptyPoint()) { } @@ -81,17 +81,17 @@ public: { } - const Point& GetPoint() const + const Point& getPoint() const { return maPoint; } - void SetPoint(const Point& rValue) + void setPoint(const Point& rValue) { maPoint = rValue; } - sal_Bool operator==(const SimplePointEntry& rEntry) const + bool operator==(const SimplePointEntry& rEntry) const { return (maPoint == rEntry.maPoint); } @@ -106,8 +106,8 @@ template < class Vector > class SimpleBezierEntry public: SimpleBezierEntry() - : maBackward(Vector::GetEmptyVector()), - maForward(Vector::GetEmptyVector()) + : maBackward(Vector::getEmptyVector()), + maForward(Vector::getEmptyVector()) { } @@ -117,39 +117,39 @@ public: { } - const Vector& GetBackwardVector() const + const Vector& getBackwardVector() const { return maBackward; } - void SetBackwardVector(const Vector& rValue) + void setBackwardVector(const Vector& rValue) { maBackward = rValue; } - const Vector& GetForwardVector() const + const Vector& getForwardVector() const { return maForward; } - void SetForwardVector(const Vector& rValue) + void setForwardVector(const Vector& rValue) { maForward = rValue; } - sal_Bool IsBezierNeeded() + bool isBezierNeeded() { - if(maBackward != Vector::GetEmptyVector() || maForward != Vector::GetEmptyVector()) - return sal_True; - return sal_False; + if(maBackward != Vector::getEmptyVector() || maForward != Vector::getEmptyVector()) + return true; + return false; } - sal_Bool operator==(const SimpleBezierEntry& rEntry) const + bool operator==(const SimpleBezierEntry& rEntry) const { return ((maBackward == rEntry.maBackward) && (maForward == rEntry.maForward)); } - void DoInvertForFlip() + void doInvertForFlip() { maBackward = -maBackward; maForward = -maForward; @@ -171,7 +171,7 @@ template < class Point, class Vector > class PolygonPointList unsigned mbIsClosed : 1; - void ImplTryToReduceToPointVector() + void implTryToReduceToPointVector() { if(!mnBezierCount && mpVectors) { @@ -181,22 +181,22 @@ template < class Point, class Vector > class PolygonPointList } public: - sal_Bool IsBezier() const + bool isBezier() const { - return sal_Bool(mnBezierCount); + return bool(mnBezierCount); } - sal_Bool IsClosed() const + bool isClosed() const { - return sal_Bool(mbIsClosed); + return bool(mbIsClosed); } - void SetClosed(sal_Bool bNew) + void setClosed(bool bNew) { mbIsClosed = bNew; } - sal_uInt32 Count() const + sal_uInt32 count() const { return maPoints.size(); } @@ -204,7 +204,7 @@ public: PolygonPointList() : mnBezierCount(0L), mpVectors(0L), - mbIsClosed(sal_False) + mbIsClosed(false) { // complete initialization with defaults } @@ -263,7 +263,7 @@ public: } // maybe vectors are not needed anymore, try to reduce memory footprint - ImplTryToReduceToPointVector(); + implTryToReduceToPointVector(); } } } @@ -276,27 +276,27 @@ public: } } - sal_Bool IsEqual(const PolygonPointList& rPointList) const + bool isEqual(const PolygonPointList& rPointList) const { // same point count? if(maPoints.size() != rPointList.maPoints.size()) - return sal_False; + return false; // if zero points the polys are equal if(!maPoints.size()) - return sal_True; + return true; // if bezier count used it needs to be equal if(mnBezierCount != rPointList.mnBezierCount) - return sal_False; + return false; // compare point content if(maPoints != rPointList.maPoints) - return sal_False; + return false; // beziercounts are equal: if it's zero, we are done if(!mnBezierCount) - return sal_True; + return true; // beziercounts are equal and not zero; compare them DBG_ASSERT(0L != mpVectors, "Error: Bezier list needs to exist here(!)"); @@ -305,32 +305,32 @@ public: return (*mpVectors == *rPointList.mpVectors); } - const Point& GetPoint(sal_uInt32 nIndex) const + const Point& getPoint(sal_uInt32 nIndex) const { - return maPoints[nIndex].GetPoint(); + return maPoints[nIndex].getPoint(); } - void SetPoint(sal_uInt32 nIndex, const Point& rValue) + void setPoint(sal_uInt32 nIndex, const Point& rValue) { - maPoints[nIndex].SetPoint(rValue); + maPoints[nIndex].setPoint(rValue); } - const Vector& GetBackwardVector(sal_uInt32 nIndex) const + const Vector& getBackwardVector(sal_uInt32 nIndex) const { if(mpVectors) - return ((*mpVectors)[nIndex]).GetBackwardVector(); + return ((*mpVectors)[nIndex]).getBackwardVector(); else - return Vector::GetEmptyVector(); + return Vector::getEmptyVector(); } - void SetBackwardVector(sal_uInt32 nIndex, const Vector& rValue) + void setBackwardVector(sal_uInt32 nIndex, const Vector& rValue) { if(mpVectors) { LocalSimpleBezierEntry& rDest = (*mpVectors)[nIndex]; - sal_Bool bBezierNeededBefore(rDest.IsBezierNeeded()); - ((*mpVectors)[nIndex]).SetBackwardVector(rValue); - sal_Bool bBezierNeededAfter(rDest.IsBezierNeeded()); + bool bBezierNeededBefore(rDest.isBezierNeeded()); + ((*mpVectors)[nIndex]).setBackwardVector(rValue); + bool bBezierNeededAfter(rDest.isBezierNeeded()); if(bBezierNeededBefore != bBezierNeededAfter) { @@ -342,33 +342,33 @@ public: } else { - sal_Bool bEmptyVector(rValue == Vector::GetEmptyVector()); + bool bEmptyVector(rValue == Vector::getEmptyVector()); if(bEmptyVector) return; mpVectors = new SimpleBezierVector(maPoints.size()); - ((*mpVectors)[nIndex]).SetBackwardVector(rValue); + ((*mpVectors)[nIndex]).setBackwardVector(rValue); mnBezierCount++; } } - const Vector& GetForwardVector(sal_uInt32 nIndex) const + const Vector& getForwardVector(sal_uInt32 nIndex) const { if(mpVectors) - return ((*mpVectors)[nIndex]).GetForwardVector(); + return ((*mpVectors)[nIndex]).getForwardVector(); else - return Vector::GetEmptyVector(); + return Vector::getEmptyVector(); } - void SetForwardVector(sal_uInt32 nIndex, const Vector& rValue) + void setForwardVector(sal_uInt32 nIndex, const Vector& rValue) { if(mpVectors) { LocalSimpleBezierEntry& rDest = (*mpVectors)[nIndex]; - sal_Bool bBezierNeededBefore(rDest.IsBezierNeeded()); - ((*mpVectors)[nIndex]).SetForwardVector(rValue); - sal_Bool bBezierNeededAfter(rDest.IsBezierNeeded()); + bool bBezierNeededBefore(rDest.isBezierNeeded()); + ((*mpVectors)[nIndex]).setForwardVector(rValue); + bool bBezierNeededAfter(rDest.isBezierNeeded()); if(bBezierNeededBefore != bBezierNeededAfter) { @@ -380,23 +380,23 @@ public: } else { - sal_Bool bEmptyVector(rValue == Vector::GetEmptyVector()); + bool bEmptyVector(rValue == Vector::getEmptyVector()); if(bEmptyVector) return; mpVectors = new SimpleBezierVector(maPoints.size()); - ((*mpVectors)[nIndex]).SetForwardVector(rValue); + ((*mpVectors)[nIndex]).setForwardVector(rValue); mnBezierCount++; } } - void Insert(sal_uInt32 nIndex, const Point& rPoint, sal_uInt32 nCount) + void insert(sal_uInt32 nIndex, const Point& rPoint, sal_uInt32 nCount) { if(nCount) { // maybe vectors are not needed anymore, try to reduce memory footprint - ImplTryToReduceToPointVector(); + implTryToReduceToPointVector(); // add nCount copies of rPoint { @@ -417,7 +417,7 @@ public: } } - void Insert(sal_uInt32 nIndex, const PolygonPointList& rSource) + void insert(sal_uInt32 nIndex, const PolygonPointList& rSource) { const sal_uInt32 nCount(rSource.maPoints.size()); @@ -455,7 +455,7 @@ public: else { // maybe vectors are not needed anymore, try to reduce memory footprint - ImplTryToReduceToPointVector(); + implTryToReduceToPointVector(); // add nCount empty entries to keep indices synchronized if(mpVectors) @@ -469,12 +469,12 @@ public: } } - void Remove(sal_uInt32 nIndex, sal_uInt32 nCount) + void remove(sal_uInt32 nIndex, sal_uInt32 nCount) { if(nCount) { // maybe vectors are not needed anymore, try to reduce memory footprint - ImplTryToReduceToPointVector(); + implTryToReduceToPointVector(); // remove point data { @@ -499,7 +499,7 @@ public: for( ; mnBezierCount && aTestIter != aEnd; ++aTestIter) { - if(aTestIter->IsBezierNeeded()) + if(aTestIter->isBezierNeeded()) mnBezierCount--; } } @@ -512,18 +512,18 @@ public: else { // try to reduce, maybe 0L == mnBezierCount - ImplTryToReduceToPointVector(); + implTryToReduceToPointVector(); } } } } - void Flip() + void flip() { if(maPoints.size() > 1) { // maybe vectors are not needed anymore, try to reduce memory footprint - ImplTryToReduceToPointVector(); + implTryToReduceToPointVector(); // calculate half size const sal_uInt32 nHalfSize(maPoints.size() >> 1L); @@ -550,9 +550,9 @@ public: for(sal_uInt32 a(0); a < nHalfSize; a++) { LocalSimpleBezierEntry aTemp = *aStart; - aTemp.DoInvertForFlip(); + aTemp.doInvertForFlip(); *aStart = *aEnd; - aStart->DoInvertForFlip(); + aStart->doInvertForFlip(); aStart++; *aEnd-- = aTemp; } @@ -560,7 +560,7 @@ public: // also flip vectors of middle point (if existing) if(maPoints.size() % 2) { - (*mpVectors)[nHalfSize].DoInvertForFlip(); + (*mpVectors)[nHalfSize].doInvertForFlip(); } } } diff --git a/basegfx/source/inc/hommatrixtemplate.hxx b/basegfx/source/inc/hommatrixtemplate.hxx index 5c7b2d7a9490..992d395dadfc 100644 --- a/basegfx/source/inc/hommatrixtemplate.hxx +++ b/basegfx/source/inc/hommatrixtemplate.hxx @@ -2,9 +2,9 @@ * * $RCSfile: hommatrixtemplate.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: thb $ $Date: 2003-08-20 13:54:18 $ + * last change: $Author: thb $ $Date: 2003-08-20 16:56:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -73,7 +73,7 @@ #include <math.h> #include <string.h> -inline double ImplGetDefaultValue(sal_uInt16 nRow, sal_uInt16 nColumn) +inline double implGetDefaultValue(sal_uInt16 nRow, sal_uInt16 nColumn) { if(nRow == nColumn) return 1.0; @@ -97,17 +97,17 @@ public: { for(sal_uInt16 a(0); a < RowSize; a++) { - mfValue[a] = ImplGetDefaultValue(nRow, a); + mfValue[a] = implGetDefaultValue(nRow, a); } } } - double Get(sal_uInt16 nColumn) const + double get(sal_uInt16 nColumn) const { return mfValue[nColumn]; } - void Set(sal_uInt16 nColumn, const double& rValue) + void set(sal_uInt16 nColumn, const double& rValue) { mfValue[nColumn] = rValue; } @@ -124,19 +124,19 @@ template < int _RowSize > class ImplHomMatrixTemplate public: // Is last line used? - sal_Bool IsLastLineDefault() const + bool isLastLineDefault() const { if(!mpLine) - return sal_True; + return true; for(sal_uInt16 a(0); a < RowSize; a++) { - const double fDefault(ImplGetDefaultValue((RowSize - 1), a)); - const double fLineValue(mpLine->Get(a)); + const double fDefault(implGetDefaultValue((RowSize - 1), a)); + const double fLineValue(mpLine->get(a)); - if(!fTools::Equal(fDefault, fLineValue)) + if(!fTools::equal(fDefault, fLineValue)) { - return sal_False; + return false; } } @@ -144,7 +144,7 @@ public: delete ((ImplHomMatrixTemplate< RowSize >*)this)->mpLine; ((ImplHomMatrixTemplate< RowSize >*)this)->mpLine = 0L; - return sal_True; + return true; } // This constructor is only used form the static identity matrix, thus @@ -157,8 +157,8 @@ public: // were initialized with a trailing 1 followed by 0's. for(sal_uInt16 a(1); a < (RowSize - 1); a++) { - maLine[a].Set(0, 0.0); - maLine[a].Set(a, 1.0); + maLine[a].set(0, 0.0); + maLine[a].set(a, 1.0); } } @@ -186,63 +186,63 @@ public: } } - const sal_uInt32 GetRefCount() const { return mnRefCount; } - void IncRefCount() { mnRefCount++; } - void DecRefCount() { mnRefCount--; } + const sal_uInt32 getRefCount() const { return mnRefCount; } + void incRefCount() { mnRefCount++; } + void decRefCount() { mnRefCount--; } - sal_uInt16 GetEdgeLength() const { return RowSize; } + sal_uInt16 getEdgeLength() const { return RowSize; } - double Get(sal_uInt16 nRow, sal_uInt16 nColumn) const + double get(sal_uInt16 nRow, sal_uInt16 nColumn) const { if(nRow < (RowSize - 1)) { - return maLine[nRow].Get(nColumn); + return maLine[nRow].get(nColumn); } if(mpLine) { - return mpLine->Get(nColumn); + return mpLine->get(nColumn); } - return ImplGetDefaultValue((RowSize - 1), nColumn); + return implGetDefaultValue((RowSize - 1), nColumn); } - void Set(sal_uInt16 nRow, sal_uInt16 nColumn, const double& rValue) + void set(sal_uInt16 nRow, sal_uInt16 nColumn, const double& rValue) { if(nRow < (RowSize - 1)) { - maLine[nRow].Set(nColumn, rValue); + maLine[nRow].set(nColumn, rValue); } else if(mpLine) { - mpLine->Set(nColumn, rValue); + mpLine->set(nColumn, rValue); } else { - const double fDefault(ImplGetDefaultValue((RowSize - 1), nColumn)); + const double fDefault(implGetDefaultValue((RowSize - 1), nColumn)); - if(!fTools::Equal(fDefault, rValue)) + if(!fTools::equal(fDefault, rValue)) { mpLine = new ImplMatLine< RowSize >((RowSize - 1), 0L); - mpLine->Set(nColumn, rValue); + mpLine->set(nColumn, rValue); } } } - void TestLastLine() + void testLastLine() { if(mpLine) { - sal_Bool bNecessary(sal_False); + bool bNecessary(false); for(sal_uInt16 a(0);!bNecessary && a < RowSize; a++) { - const double fDefault(ImplGetDefaultValue((RowSize - 1), a)); - const double fLineValue(mpLine->Get(a)); + const double fDefault(implGetDefaultValue((RowSize - 1), a)); + const double fLineValue(mpLine->get(a)); - if(!fTools::Equal(fDefault, fLineValue)) + if(!fTools::equal(fDefault, fLineValue)) { - bNecessary = sal_True; + bNecessary = true; } } @@ -255,7 +255,7 @@ public: } // Left-upper decompositon - sal_Bool Ludcmp(sal_uInt16 nIndex[], sal_Int16& nParity) + bool ludcmp(sal_uInt16 nIndex[], sal_Int16& nParity) { double fBig, fSum, fDum; double fStorage[RowSize]; @@ -271,17 +271,17 @@ public: for(b = 0; b < RowSize; b++) { - double fTemp(fabs(Get(a, b))); + double fTemp(fabs(get(a, b))); - if(fTools::More(fTemp, fBig)) + if(fTools::more(fTemp, fBig)) { fBig = fTemp; } } - if(fTools::EqualZero(fBig)) + if(fTools::equalZero(fBig)) { - return sal_False; + return false; } fStorage[a] = 1.0 / fBig; @@ -292,31 +292,31 @@ public: { for(a = 0; a < b; a++) { - fSum = Get(a, b); + fSum = get(a, b); for(c = 0; c < a; c++) { - fSum -= Get(a, c) * Get(c, b); + fSum -= get(a, c) * get(c, b); } - Set(a, b, fSum); + set(a, b, fSum); } fBig = 0.0; for(a = b; a < RowSize; a++) { - fSum = Get(a, b); + fSum = get(a, b); for(c = 0; c < b; c++) { - fSum -= Get(a, c) * Get(c, b); + fSum -= get(a, c) * get(c, b); } - Set(a, b, fSum); + set(a, b, fSum); fDum = fStorage[a] * fabs(fSum); - if(fTools::MoreOrEqual(fDum, fBig)) + if(fTools::moreOrEqual(fDum, fBig)) { fBig = fDum; nAMax = a; @@ -327,9 +327,9 @@ public: { for(c = 0; c < RowSize; c++) { - fDum = Get(nAMax, c); - Set(nAMax, c, Get(b, c)); - Set(b, c, fDum); + fDum = get(nAMax, c); + set(nAMax, c, get(b, c)); + set(b, c, fDum); } nParity = -nParity; @@ -339,28 +339,28 @@ public: nIndex[b] = nAMax; // here the failure of precision occurs - const double fValBB(fabs(Get(b, b))); + const double fValBB(fabs(get(b, b))); - if(fTools::EqualZero(fValBB)) + if(fTools::equalZero(fValBB)) { - return sal_False; + return false; } if(b != (RowSize - 1)) { - fDum = 1.0 / Get(b, b); + fDum = 1.0 / get(b, b); for(a = b + 1; a < RowSize; a++) { - Set(a, b, Get(a, b) * fDum); + set(a, b, get(a, b) * fDum); } } } - return sal_True; + return true; } - void Lubksb(const sal_uInt16 nIndex[], double fRow[]) const + void lubksb(const sal_uInt16 nIndex[], double fRow[]) const { sal_uInt16 b, ip; sal_Int16 a, a2 = -1; @@ -376,10 +376,10 @@ public: { for(b = a2; b < a; b++) { - fSum -= Get(a, b) * fRow[b]; + fSum -= get(a, b) * fRow[b]; } } - else if(!fTools::EqualZero(fSum)) + else if(!fTools::equalZero(fSum)) { a2 = a; } @@ -393,19 +393,19 @@ public: for(b = a + 1; b < RowSize; b++) { - fSum -= Get(a, b) * fRow[b]; + fSum -= get(a, b) * fRow[b]; } - const double fValueAA(Get(a, a)); + const double fValueAA(get(a, a)); - if(!fTools::EqualZero(fValueAA)) + if(!fTools::equalZero(fValueAA)) { - fRow[a] = fSum / Get(a, a); + fRow[a] = fSum / get(a, a); } } } - sal_Bool IsIdentity() const + bool isIdentity() const { // last line needs no testing if not existing const sal_uInt16 nMaxLine = (mpLine) ? RowSize : (RowSize - 1); @@ -414,51 +414,51 @@ public: { for(sal_uInt16 b(0); b < RowSize; b++) { - const double fDefault(ImplGetDefaultValue(a, b)); - const double fValueAB(Get(a, b)); + const double fDefault(implGetDefaultValue(a, b)); + const double fValueAB(get(a, b)); - if(!fTools::Equal(fDefault, fValueAB)) + if(!fTools::equal(fDefault, fValueAB)) { - return sal_False; + return false; } } } - return sal_True; + return true; } - sal_Bool IsInvertible() const + bool isInvertible() const { ImplHomMatrixTemplate aWork(*this); sal_uInt16 nIndex[RowSize]; sal_Int16 nParity; - return aWork.Ludcmp(nIndex, nParity); + return aWork.ludcmp(nIndex, nParity); } - sal_Bool IsNormalized() const + bool isNormalized() const { if(!mpLine) - return sal_True; + return true; - const double fHomValue(Get((RowSize - 1), (RowSize - 1))); + const double fHomValue(get((RowSize - 1), (RowSize - 1))); - if(fTools::EqualZero(fHomValue)) + if(fTools::equalZero(fHomValue)) { - return sal_True; + return true; } const double fOne(1.0); - if(fTools::Equal(fOne, fHomValue)) + if(fTools::equal(fOne, fHomValue)) { - return sal_True; + return true; } - return sal_False; + return false; } - void DoInvert(const ImplHomMatrixTemplate& rWork, const sal_uInt16 nIndex[]) + void doInvert(const ImplHomMatrixTemplate& rWork, const sal_uInt16 nIndex[]) { double fArray[RowSize]; @@ -467,50 +467,50 @@ public: // prepare line for(sal_uInt16 b(0); b < RowSize; b++) { - fArray[b] = ImplGetDefaultValue(a, b); + fArray[b] = implGetDefaultValue(a, b); } // expand line - rWork.Lubksb(nIndex, fArray); + rWork.lubksb(nIndex, fArray); // copy line transposed to this matrix for(b = 0; b < RowSize; b++) { - Set(b, a, fArray[b]); + set(b, a, fArray[b]); } } // evtl. get rid of last matrix line - TestLastLine(); + testLastLine(); } - void DoNormalize() + void doNormalize() { if(mpLine) { - const double fHomValue(Get((RowSize - 1), (RowSize - 1))); + const double fHomValue(get((RowSize - 1), (RowSize - 1))); for(sal_uInt16 a(0); a < RowSize; a++) { for(sal_uInt16 b(0); b < RowSize; b++) { - Set(a, b, Get(a, b) / fHomValue); + set(a, b, get(a, b) / fHomValue); } } // evtl. get rid of last matrix line - TestLastLine(); + testLastLine(); } } - double DoDeterminant() const + double doDeterminant() const { ImplHomMatrixTemplate aWork(*this); sal_uInt16 nIndex[RowSize]; sal_Int16 nParity; double fRetval(0.0); - if(aWork.Ludcmp(nIndex, nParity)) + if(aWork.ludcmp(nIndex, nParity)) { fRetval = (double)nParity; @@ -519,81 +519,81 @@ public: for(sal_uInt16 a(0); a < nMaxLine; a++) { - fRetval *= aWork.Get(a, a); + fRetval *= aWork.get(a, a); } } return fRetval; } - double DoTrace() const + double doTrace() const { double fTrace = (mpLine) ? 0.0 : 1.0; const sal_uInt16 nMaxLine = (mpLine) ? RowSize : (RowSize - 1); for(sal_uInt16 a(0); a < nMaxLine; a++) { - fTrace += Get(a, a); + fTrace += get(a, a); } return fTrace; } - void DoTranspose() + void doTranspose() { for(sal_uInt16 a(0); a < (RowSize - 1); a++) { for(sal_uInt16 b(a + 1); b < RowSize; b++) { - const double fTemp(Get(a, b)); - Set(a, b, Get(b, a)); - Set(b, a, fTemp); + const double fTemp(get(a, b)); + set(a, b, get(b, a)); + set(b, a, fTemp); } } - TestLastLine(); + testLastLine(); } - void DoAddMatrix(const ImplHomMatrixTemplate& rMat) + void doAddMatrix(const ImplHomMatrixTemplate& rMat) { for(sal_uInt16 a(0); a < RowSize; a++) { for(sal_uInt16 b(0); b < RowSize; b++) { - Set(a, b, Get(a, b) + rMat.Get(a, b)); + set(a, b, get(a, b) + rMat.get(a, b)); } } - TestLastLine(); + testLastLine(); } - void DoSubMatrix(const ImplHomMatrixTemplate& rMat) + void doSubMatrix(const ImplHomMatrixTemplate& rMat) { for(sal_uInt16 a(0); a < RowSize; a++) { for(sal_uInt16 b(0); b < RowSize; b++) { - Set(a, b, Get(a, b) - rMat.Get(a, b)); + set(a, b, get(a, b) - rMat.get(a, b)); } } - TestLastLine(); + testLastLine(); } - void DoMulMatrix(const double& rfValue) + void doMulMatrix(const double& rfValue) { for(sal_uInt16 a(0); a < RowSize; a++) { for(sal_uInt16 b(0); b < RowSize; b++) { - Set(a, b, Get(a, b) * rfValue); + set(a, b, get(a, b) * rfValue); } } - TestLastLine(); + testLastLine(); } - void DoMulMatrix(const ImplHomMatrixTemplate& rMat) + void doMulMatrix(const ImplHomMatrixTemplate& rMat) { // create a copy as source for the original values const ImplHomMatrixTemplate aCopy(*this); @@ -609,10 +609,10 @@ public: for(sal_uInt16 c(0); c < RowSize; c++) { - fValue += aCopy.Get(c, b) * rMat.Get(a, c); + fValue += aCopy.get(c, b) * rMat.get(a, c); } - Set(a, b, fValue); + set(a, b, fValue); } } @@ -625,13 +625,13 @@ public: for(sal_uInt16 c(0); c < RowSize; c++) { - fValue += aCopy.Get(c, b) * rMat.Get((RowSize - 1), c); + fValue += aCopy.get(c, b) * rMat.get((RowSize - 1), c); } - Set((RowSize - 1), b, fValue); + set((RowSize - 1), b, fValue); } - TestLastLine(); + testLastLine(); } else { @@ -650,15 +650,15 @@ public: for(sal_uInt16 c(0); c < (RowSize - 1); c++) { - fValue += aCopy.Get(c, b) * rMat.Get(a, c); + fValue += aCopy.get(c, b) * rMat.get(a, c); } if(b == (RowSize -1)) { - fValue += aCopy.Get(a, (RowSize - 1)); + fValue += aCopy.get(a, (RowSize - 1)); } - Set(a, b, fValue); + set(a, b, fValue); } } @@ -671,18 +671,18 @@ public: for(sal_uInt16 c(0); c < (RowSize - 1); c++) { - fValue += aCopy.Get(c, b) * rMat.Get((RowSize - 1), c); + fValue += aCopy.get(c, b) * rMat.get((RowSize - 1), c); } if(b == (RowSize -1)) { - fValue += aCopy.Get((RowSize - 1), (RowSize - 1)); + fValue += aCopy.get((RowSize - 1), (RowSize - 1)); } - Set((RowSize - 1), b, fValue); + set((RowSize - 1), b, fValue); } - TestLastLine(); + testLastLine(); } else { @@ -691,7 +691,7 @@ public: } } - sal_Bool IsEqual(const ImplHomMatrixTemplate& rMat) + bool isEqual(const ImplHomMatrixTemplate& rMat) { const sal_uInt16 nMaxLine = (mpLine || rMat.mpLine) ? RowSize : (RowSize - 1); @@ -699,17 +699,17 @@ public: { for(sal_uInt16 b(0); b < RowSize; b++) { - const double fValueA(Get(a, b)); - const double fValueB(rMat.Get(a, b)); + const double fValueA(get(a, b)); + const double fValueB(rMat.get(a, b)); - if(!fTools::Equal(fValueA, fValueB)) + if(!fTools::equal(fValueA, fValueB)) { - return sal_False; + return false; } } } - return sal_True; + return true; } }; diff --git a/basegfx/source/inc/polygontemplate.hxx b/basegfx/source/inc/polygontemplate.hxx index 4433d2c8cf1d..27203d952442 100644 --- a/basegfx/source/inc/polygontemplate.hxx +++ b/basegfx/source/inc/polygontemplate.hxx @@ -2,9 +2,9 @@ * * $RCSfile: polygontemplate.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2003-04-28 12:10:38 $ + * last change: $Author: thb $ $Date: 2003-08-20 16:56:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,7 +72,7 @@ template < class Point > class ImplSimplePointEntry public: ImplSimplePointEntry() - : maPoint(Point::GetEmptyPoint()) + : maPoint(Point::getEmptyPoint()) { } @@ -81,17 +81,17 @@ public: { } - const Point& GetPoint() const + const Point& getPoint() const { return maPoint; } - void SetPoint(const Point& rValue) + void setPoint(const Point& rValue) { maPoint = rValue; } - sal_Bool operator==(const ImplSimplePointEntry& rEntry) const + bool operator==(const ImplSimplePointEntry& rEntry) const { return (maPoint == rEntry.maPoint); } @@ -106,8 +106,8 @@ template < class Vector > class ImplSimpleBezierEntry public: ImplSimpleBezierEntry() - : maBackward(Vector::GetEmptyVector()), - maForward(Vector::GetEmptyVector()) + : maBackward(Vector::getEmptyVector()), + maForward(Vector::getEmptyVector()) { } @@ -117,39 +117,39 @@ public: { } - const Vector& GetBackwardVector() const + const Vector& getBackwardVector() const { return maBackward; } - void SetBackwardVector(const Vector& rValue) + void setBackwardVector(const Vector& rValue) { maBackward = rValue; } - const Vector& GetForwardVector() const + const Vector& getForwardVector() const { return maForward; } - void SetForwardVector(const Vector& rValue) + void setForwardVector(const Vector& rValue) { maForward = rValue; } - sal_Bool IsBezierNeeded() + bool isBezierNeeded() { - if(!maBackward.EqualZero() || !maForward.EqualZero()) - return sal_True; - return sal_False; + if(!maBackward.equalZero() || !maForward.equalZero()) + return true; + return false; } - sal_Bool operator==(const ImplSimpleBezierEntry& rEntry) const + bool operator==(const ImplSimpleBezierEntry& rEntry) const { return ((maBackward == rEntry.maBackward) && (maForward == rEntry.maForward)); } - void DoInvertForFlip() + void doInvertForFlip() { maBackward = -maBackward; maForward = -maForward; @@ -171,7 +171,7 @@ template < class Point, class Vector > class ImplPolygonTemplate unsigned mbIsClosed : 1; - void ImplTryToReduceToPointVector() + void implTryToReduceToPointVector() { if(!mnBezierCount && mpVectors) { @@ -181,22 +181,22 @@ template < class Point, class Vector > class ImplPolygonTemplate } public: - sal_Bool IsBezier() const + bool isBezier() const { - return sal_Bool(mnBezierCount); + return bool(mnBezierCount); } - sal_Bool IsClosed() const + bool isClosed() const { - return sal_Bool(mbIsClosed); + return bool(mbIsClosed); } - void SetClosed(sal_Bool bNew) + void setClosed(bool bNew) { mbIsClosed = bNew; } - sal_uInt32 Count() const + sal_uInt32 count() const { return maPoints.size(); } @@ -204,7 +204,7 @@ public: ImplPolygonTemplate() : mnBezierCount(0L), mpVectors(0L), - mbIsClosed(sal_False) + mbIsClosed(false) { // complete initialization with defaults } @@ -254,7 +254,7 @@ public: for( ; aStart != aEnd; ++aStart ) { - if(aStart->IsBezierNeeded()) + if(aStart->isBezierNeeded()) { mnBezierCount++; } @@ -263,7 +263,7 @@ public: } // maybe vectors are not needed anymore, try to reduce memory footprint - ImplTryToReduceToPointVector(); + implTryToReduceToPointVector(); } } } @@ -276,27 +276,27 @@ public: } } - sal_Bool IsEqual(const ImplPolygonTemplate& rPointList) const + bool isEqual(const ImplPolygonTemplate& rPointList) const { // same point count? if(maPoints.size() != rPointList.maPoints.size()) - return sal_False; + return false; // if zero points the polys are equal if(!maPoints.size()) - return sal_True; + return true; // if bezier count used it needs to be equal if(mnBezierCount != rPointList.mnBezierCount) - return sal_False; + return false; // compare point content if(maPoints != rPointList.maPoints) - return sal_False; + return false; // beziercounts are equal: if it's zero, we are done if(!mnBezierCount) - return sal_True; + return true; // beziercounts are equal and not zero; compare them DBG_ASSERT(0L != mpVectors, "Error: Bezier list needs to exist here(!)"); @@ -305,32 +305,32 @@ public: return (*mpVectors == *rPointList.mpVectors); } - const Point& GetPoint(sal_uInt32 nIndex) const + const Point& getPoint(sal_uInt32 nIndex) const { - return maPoints[nIndex].GetPoint(); + return maPoints[nIndex].getPoint(); } - void SetPoint(sal_uInt32 nIndex, const Point& rValue) + void setPoint(sal_uInt32 nIndex, const Point& rValue) { - maPoints[nIndex].SetPoint(rValue); + maPoints[nIndex].setPoint(rValue); } - const Vector& GetBackwardVector(sal_uInt32 nIndex) const + const Vector& getBackwardVector(sal_uInt32 nIndex) const { if(mpVectors) - return ((*mpVectors)[nIndex]).GetBackwardVector(); + return ((*mpVectors)[nIndex]).getBackwardVector(); else - return Vector::GetEmptyVector(); + return Vector::getEmptyVector(); } - void SetBackwardVector(sal_uInt32 nIndex, const Vector& rValue) + void setBackwardVector(sal_uInt32 nIndex, const Vector& rValue) { if(mpVectors) { LocalImplSimpleBezierEntry& rDest = (*mpVectors)[nIndex]; - sal_Bool bBezierNeededBefore(rDest.IsBezierNeeded()); - ((*mpVectors)[nIndex]).SetBackwardVector(rValue); - sal_Bool bBezierNeededAfter(rDest.IsBezierNeeded()); + bool bBezierNeededBefore(rDest.isBezierNeeded()); + ((*mpVectors)[nIndex]).setBackwardVector(rValue); + bool bBezierNeededAfter(rDest.isBezierNeeded()); if(bBezierNeededBefore != bBezierNeededAfter) { @@ -342,33 +342,33 @@ public: } else { - sal_Bool bEmptyVector(rValue.EqualZero()); + bool bEmptyVector(rValue.equalZero()); if(bEmptyVector) return; mpVectors = new SimpleBezierVector(maPoints.size()); - ((*mpVectors)[nIndex]).SetBackwardVector(rValue); + ((*mpVectors)[nIndex]).setBackwardVector(rValue); mnBezierCount++; } } - const Vector& GetForwardVector(sal_uInt32 nIndex) const + const Vector& getForwardVector(sal_uInt32 nIndex) const { if(mpVectors) - return ((*mpVectors)[nIndex]).GetForwardVector(); + return ((*mpVectors)[nIndex]).getForwardVector(); else - return Vector::GetEmptyVector(); + return Vector::getEmptyVector(); } - void SetForwardVector(sal_uInt32 nIndex, const Vector& rValue) + void setForwardVector(sal_uInt32 nIndex, const Vector& rValue) { if(mpVectors) { LocalImplSimpleBezierEntry& rDest = (*mpVectors)[nIndex]; - sal_Bool bBezierNeededBefore(rDest.IsBezierNeeded()); - ((*mpVectors)[nIndex]).SetForwardVector(rValue); - sal_Bool bBezierNeededAfter(rDest.IsBezierNeeded()); + bool bBezierNeededBefore(rDest.isBezierNeeded()); + ((*mpVectors)[nIndex]).setForwardVector(rValue); + bool bBezierNeededAfter(rDest.isBezierNeeded()); if(bBezierNeededBefore != bBezierNeededAfter) { @@ -380,23 +380,23 @@ public: } else { - sal_Bool bEmptyVector(rValue.EqualZero()); + bool bEmptyVector(rValue.equalZero()); if(bEmptyVector) return; mpVectors = new SimpleBezierVector(maPoints.size()); - ((*mpVectors)[nIndex]).SetForwardVector(rValue); + ((*mpVectors)[nIndex]).setForwardVector(rValue); mnBezierCount++; } } - void Insert(sal_uInt32 nIndex, const Point& rPoint, sal_uInt32 nCount) + void insert(sal_uInt32 nIndex, const Point& rPoint, sal_uInt32 nCount) { if(nCount) { // maybe vectors are not needed anymore, try to reduce memory footprint - ImplTryToReduceToPointVector(); + implTryToReduceToPointVector(); // add nCount copies of rPoint { @@ -417,7 +417,7 @@ public: } } - void Insert(sal_uInt32 nIndex, const ImplPolygonTemplate& rSource) + void insert(sal_uInt32 nIndex, const ImplPolygonTemplate& rSource) { const sal_uInt32 nCount(rSource.maPoints.size()); @@ -455,7 +455,7 @@ public: else { // maybe vectors are not needed anymore, try to reduce memory footprint - ImplTryToReduceToPointVector(); + implTryToReduceToPointVector(); // add nCount empty entries to keep indices synchronized if(mpVectors) @@ -469,12 +469,12 @@ public: } } - void Remove(sal_uInt32 nIndex, sal_uInt32 nCount) + void remove(sal_uInt32 nIndex, sal_uInt32 nCount) { if(nCount) { // maybe vectors are not needed anymore, try to reduce memory footprint - ImplTryToReduceToPointVector(); + implTryToReduceToPointVector(); // remove point data { @@ -499,7 +499,7 @@ public: for( ; mnBezierCount && aTestIter != aEnd; ++aTestIter) { - if(aTestIter->IsBezierNeeded()) + if(aTestIter->isBezierNeeded()) mnBezierCount--; } } @@ -512,18 +512,18 @@ public: else { // try to reduce, maybe 0L == mnBezierCount - ImplTryToReduceToPointVector(); + implTryToReduceToPointVector(); } } } } - void Flip() + void flip() { if(maPoints.size() > 1) { // maybe vectors are not needed anymore, try to reduce memory footprint - ImplTryToReduceToPointVector(); + implTryToReduceToPointVector(); // calculate half size const sal_uInt32 nHalfSize(maPoints.size() >> 1L); @@ -550,9 +550,9 @@ public: for(sal_uInt32 a(0); a < nHalfSize; a++) { LocalImplSimpleBezierEntry aTemp = *aStart; - aTemp.DoInvertForFlip(); + aTemp.doInvertForFlip(); *aStart = *aEnd; - aStart->DoInvertForFlip(); + aStart->doInvertForFlip(); aStart++; *aEnd-- = aTemp; } @@ -560,7 +560,7 @@ public: // also flip vectors of middle point (if existing) if(maPoints.size() % 2) { - (*mpVectors)[nHalfSize].DoInvertForFlip(); + (*mpVectors)[nHalfSize].doInvertForFlip(); } } } |