diff options
Diffstat (limited to 'drawinglayer/inc')
57 files changed, 4187 insertions, 782 deletions
diff --git a/drawinglayer/inc/drawinglayer/animation/animationtiming.hxx b/drawinglayer/inc/drawinglayer/animation/animationtiming.hxx index 4618fde632fe..48d89cbd060e 100644 --- a/drawinglayer/inc/drawinglayer/animation/animationtiming.hxx +++ b/drawinglayer/inc/drawinglayer/animation/animationtiming.hxx @@ -4,9 +4,9 @@ * * $RCSfile: animationtiming.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:39:25 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:30:10 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,8 +33,8 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_ANIMATION_ANIMATIONTIMING_HXX -#define _DRAWINGLAYER_ANIMATION_ANIMATIONTIMING_HXX +#ifndef INCLUDED_DRAWINGLAYER_ANIMATION_ANIMATIONTIMING_HXX +#define INCLUDED_DRAWINGLAYER_ANIMATION_ANIMATIONTIMING_HXX #ifndef _SAL_TYPES_H_ #include <sal/types.h> @@ -50,18 +50,18 @@ namespace drawinglayer { ////////////////////////////////////////////////////////////////////////////// - class animationEntry + class AnimationEntry { private: - animationEntry(const animationEntry&); - animationEntry& operator=(const animationEntry& rCandidate); + AnimationEntry(const AnimationEntry&); + AnimationEntry& operator=(const AnimationEntry& rCandidate); public: - animationEntry(); - virtual ~animationEntry(); - virtual animationEntry* clone() const = 0; + AnimationEntry(); + virtual ~AnimationEntry(); + virtual AnimationEntry* clone() const = 0; - virtual bool operator==(const animationEntry& rCandidate) const = 0; + virtual bool operator==(const AnimationEntry& rCandidate) const = 0; virtual double getDuration() const = 0; virtual double getStateAtTime(double fTime) const = 0; virtual double getNextEventTime(double fTime) const = 0; @@ -69,18 +69,18 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// - class animationEntryFixed : public animationEntry + class AnimationEntryFixed : public AnimationEntry { protected: double mfDuration; double mfState; public: - animationEntryFixed(double fDuration, double fState = 0.0); - virtual ~animationEntryFixed(); - virtual animationEntry* clone() const; + AnimationEntryFixed(double fDuration, double fState = 0.0); + virtual ~AnimationEntryFixed(); + virtual AnimationEntry* clone() const; - virtual bool operator==(const animationEntry& rCandidate) const; + virtual bool operator==(const AnimationEntry& rCandidate) const; virtual double getDuration() const; virtual double getStateAtTime(double fTime) const; virtual double getNextEventTime(double fTime) const; @@ -88,7 +88,7 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// - class animationEntryLinear : public animationEntry + class AnimationEntryLinear : public AnimationEntry { protected: double mfDuration; @@ -97,11 +97,11 @@ namespace drawinglayer double mfStop; public: - animationEntryLinear(double fDuration, double fFrequency = 250.0, double fStart = 0.0, double fStop = 1.0); - virtual ~animationEntryLinear(); - virtual animationEntry* clone() const; + AnimationEntryLinear(double fDuration, double fFrequency = 250.0, double fStart = 0.0, double fStop = 1.0); + virtual ~AnimationEntryLinear(); + virtual AnimationEntry* clone() const; - virtual bool operator==(const animationEntry& rCandidate) const; + virtual bool operator==(const AnimationEntry& rCandidate) const; virtual double getDuration() const; virtual double getStateAtTime(double fTime) const; virtual double getNextEventTime(double fTime) const; @@ -109,22 +109,22 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// - class animationEntryList : public animationEntry + class AnimationEntryList : public AnimationEntry { protected: double mfDuration; - ::std::vector< animationEntry* > maEntries; + ::std::vector< AnimationEntry* > maEntries; // helpers sal_uInt32 impGetIndexAtTime(double fTime, double &rfAddedTime) const; public: - animationEntryList(); - virtual ~animationEntryList(); - virtual animationEntry* clone() const; + AnimationEntryList(); + virtual ~AnimationEntryList(); + virtual AnimationEntry* clone() const; - virtual bool operator==(const animationEntry& rCandidate) const; - void append(const animationEntry& rCandidate); + virtual bool operator==(const AnimationEntry& rCandidate) const; + void append(const AnimationEntry& rCandidate); virtual double getDuration() const; virtual double getStateAtTime(double fTime) const; virtual double getNextEventTime(double fTime) const; @@ -132,17 +132,17 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// - class animationEntryLoop : public animationEntryList + class AnimationEntryLoop : public AnimationEntryList { protected: sal_uInt32 mnRepeat; public: - animationEntryLoop(sal_uInt32 nRepeat = 0xffffffff); - virtual ~animationEntryLoop(); - virtual animationEntry* clone() const; + AnimationEntryLoop(sal_uInt32 nRepeat = 0xffffffff); + virtual ~AnimationEntryLoop(); + virtual AnimationEntry* clone() const; - virtual bool operator==(const animationEntry& rCandidate) const; + virtual bool operator==(const AnimationEntry& rCandidate) const; virtual double getDuration() const; virtual double getStateAtTime(double fTime) const; virtual double getNextEventTime(double fTime) const; @@ -154,6 +154,6 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif //_DRAWINGLAYER_ANIMATION_ANIMATIONTIMING_HXX +#endif //INCLUDED_DRAWINGLAYER_ANIMATION_ANIMATIONTIMING_HXX // eof diff --git a/drawinglayer/inc/drawinglayer/attribute/fillattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fillattribute.hxx index e9705bb1daa3..92fd608cb324 100644 --- a/drawinglayer/inc/drawinglayer/attribute/fillattribute.hxx +++ b/drawinglayer/inc/drawinglayer/attribute/fillattribute.hxx @@ -4,9 +4,9 @@ * * $RCSfile: fillattribute.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:36:37 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:30:34 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,8 +33,8 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX -#define _DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX #ifndef _BGFX_COLOR_BCOLOR_HXX #include <basegfx/color/bcolor.hxx> @@ -73,10 +73,10 @@ namespace drawinglayer { namespace attribute { - class fillGradientAttribute + class FillGradientAttribute { - basegfx::BColor maStartColor; - basegfx::BColor maEndColor; + basegfx::BColor maStartColor; + basegfx::BColor maEndColor; double mfBorder; double mfOffsetX; double mfOffsetY; @@ -85,10 +85,10 @@ namespace drawinglayer sal_uInt16 mnSteps; public: - fillGradientAttribute( + FillGradientAttribute( GradientStyle eStyle, double fBorder, double fOffsetX, double fOffsetY, double fAngle, const basegfx::BColor& rStartColor, const basegfx::BColor& rEndColor, sal_uInt16 nSteps); - bool operator==(const fillGradientAttribute& rCandidate) const; + bool operator==(const FillGradientAttribute& rCandidate) const; // data access const basegfx::BColor& getStartColor() const { return maStartColor; } @@ -109,19 +109,19 @@ namespace drawinglayer { namespace attribute { - class fillHatchAttribute + class FillHatchAttribute { double mfDistance; double mfAngle; - basegfx::BColor maColor; + basegfx::BColor maColor; HatchStyle meStyle; // bitfield unsigned mbFillBackground : 1; public: - fillHatchAttribute(HatchStyle eStyle, double fDistance, double fAngle, const basegfx::BColor& rColor, bool bFillBackground); - bool operator==(const fillHatchAttribute& rCandidate) const; + FillHatchAttribute(HatchStyle eStyle, double fDistance, double fAngle, const basegfx::BColor& rColor, bool bFillBackground); + bool operator==(const FillHatchAttribute& rCandidate) const; // data access double getDistance() const { return mfDistance; } @@ -135,6 +135,6 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif //_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX // eof diff --git a/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx index 7fd4891a12c8..29cdff8b08c2 100644 --- a/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx +++ b/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx @@ -4,9 +4,9 @@ * * $RCSfile: fillbitmapattribute.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:36:39 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:30:35 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,8 +33,8 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX -#define _DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX #ifndef _SV_BITMAP_HXX #include <vcl/bitmap.hxx> @@ -50,7 +50,6 @@ ////////////////////////////////////////////////////////////////////////////// // predefines -class SfxItemSet; namespace basegfx { class B2DRange; @@ -63,18 +62,18 @@ namespace drawinglayer { namespace attribute { - class fillBitmapAttribute + class FillBitmapAttribute { Bitmap maBitmap; basegfx::B2DPoint maTopLeft; - basegfx::B2DVector maSize; + basegfx::B2DVector maSize; // bitfield unsigned mbTiling : 1; public: - fillBitmapAttribute(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize, bool bTiling); - bool operator==(const fillBitmapAttribute& rCandidate) const; + FillBitmapAttribute(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize, bool bTiling); + bool operator==(const FillBitmapAttribute& rCandidate) const; // data access const Bitmap& getBitmap() const { return maBitmap; } @@ -87,6 +86,6 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif //_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX // eof diff --git a/drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx index 21d46c4454cc..4696b449ed95 100644 --- a/drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx +++ b/drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: materialattribute3d.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:36:38 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:30:35 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,8 +33,8 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_ATTRIBUTE_MATERIALATTRIBUTE3D_HXX -#define _DRAWINGLAYER_ATTRIBUTE_MATERIALATTRIBUTE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_MATERIALATTRIBUTE3D_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_MATERIALATTRIBUTE3D_HXX #ifndef _SAL_TYPES_H_ #include <sal/types.h> @@ -44,7 +44,7 @@ // predefines namespace drawinglayer { namespace { - class impMaterialAttribute3D; + class ImpMaterialAttribute3D; }} namespace basegfx { @@ -57,25 +57,25 @@ namespace drawinglayer { namespace attribute { - class materialAttribute3D + class MaterialAttribute3D { private: - impMaterialAttribute3D* mpMaterialAttribute3D; + ImpMaterialAttribute3D* mpMaterialAttribute3D; public: // constructors/destructor - materialAttribute3D(const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity); - materialAttribute3D(const basegfx::BColor& rColor); - materialAttribute3D(); - materialAttribute3D(const materialAttribute3D& rCandidate); - ~materialAttribute3D(); + MaterialAttribute3D(const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity); + MaterialAttribute3D(const basegfx::BColor& rColor); + MaterialAttribute3D(); + MaterialAttribute3D(const MaterialAttribute3D& rCandidate); + ~MaterialAttribute3D(); // assignment operator - materialAttribute3D& operator=(const materialAttribute3D& rCandidate); + MaterialAttribute3D& operator=(const MaterialAttribute3D& rCandidate); // compare operator - bool operator==(const materialAttribute3D& rCandidate) const; - bool operator!=(const materialAttribute3D& rCandidate) const { return !operator==(rCandidate); } + bool operator==(const MaterialAttribute3D& rCandidate) const; + bool operator!=(const MaterialAttribute3D& rCandidate) const { return !operator==(rCandidate); } // data access const basegfx::BColor& getColor() const; @@ -88,6 +88,6 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif //_DRAWINGLAYER_ATTRIBUTE_MATERIALATTRIBUTE3D_HXX +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_MATERIALATTRIBUTE3D_HXX // eof diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx index ace244dd8beb..d5e4dbdf0e38 100644 --- a/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx +++ b/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: sdrallattribute3d.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:36:37 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:30:35 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,18 +33,18 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX -#define _DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX ////////////////////////////////////////////////////////////////////////////// // predefines namespace drawinglayer { namespace attribute { - class sdrLineAttribute; - class sdrFillAttribute; - class sdrLineStartEndAttribute; - class sdrShadowAttribute; - class fillGradientAttribute; + class SdrLineAttribute; + class SdrFillAttribute; + class SdrLineStartEndAttribute; + class SdrShadowAttribute; + class FillGradientAttribute; }} ////////////////////////////////////////////////////////////////////////////// @@ -53,46 +53,46 @@ namespace drawinglayer { namespace attribute { - class sdrLineFillShadowAttribute + class SdrLineFillShadowAttribute { // shadow, line, lineStartEnd, fill, transGradient and compound3D attributes - sdrShadowAttribute* mpShadow; // shadow attributes (if used) - sdrLineAttribute* mpLine; // line attributes (if used) - sdrLineStartEndAttribute* mpLineStartEnd; // line start end (if used) - sdrFillAttribute* mpFill; // fill attributes (if used) - fillGradientAttribute* mpFillFloatTransGradient; // fill float transparence gradient (if used) + SdrShadowAttribute* mpShadow; // shadow attributes (if used) + SdrLineAttribute* mpLine; // line attributes (if used) + SdrLineStartEndAttribute* mpLineStartEnd; // line start end (if used) + SdrFillAttribute* mpFill; // fill attributes (if used) + FillGradientAttribute* mpFillFloatTransGradient; // fill float transparence gradient (if used) public: - sdrLineFillShadowAttribute( - sdrLineAttribute* pLine = 0L, - sdrFillAttribute* pFill = 0L, - sdrLineStartEndAttribute* pLineStartEnd = 0L, - sdrShadowAttribute* pShadow = 0L, - fillGradientAttribute* pFillFloatTransGradient = 0L); - ~sdrLineFillShadowAttribute(); + SdrLineFillShadowAttribute( + SdrLineAttribute* pLine = 0L, + SdrFillAttribute* pFill = 0L, + SdrLineStartEndAttribute* pLineStartEnd = 0L, + SdrShadowAttribute* pShadow = 0L, + FillGradientAttribute* pFillFloatTransGradient = 0L); + ~SdrLineFillShadowAttribute(); // copy constructor and assigment operator - sdrLineFillShadowAttribute(const sdrLineFillShadowAttribute& rCandidate); - sdrLineFillShadowAttribute& operator=(const sdrLineFillShadowAttribute& rCandidate); + SdrLineFillShadowAttribute(const SdrLineFillShadowAttribute& rCandidate); + SdrLineFillShadowAttribute& operator=(const SdrLineFillShadowAttribute& rCandidate); // compare operator - bool operator==(const sdrLineFillShadowAttribute& rCandidate) const; + bool operator==(const SdrLineFillShadowAttribute& rCandidate) const; // bool access bool isVisible() const { return (mpFill || mpLine); } // data access - const sdrShadowAttribute* getShadow() const { return mpShadow; } - const sdrLineAttribute* getLine() const { return mpLine; } - const sdrLineStartEndAttribute* getLineStartEnd() const { return mpLineStartEnd; } - const sdrFillAttribute* getFill() const { return mpFill; } - const fillGradientAttribute* getFillFloatTransGradient() const { return mpFillFloatTransGradient; } + const SdrShadowAttribute* getShadow() const { return mpShadow; } + const SdrLineAttribute* getLine() const { return mpLine; } + const SdrLineStartEndAttribute* getLineStartEnd() const { return mpLineStartEnd; } + const SdrFillAttribute* getFill() const { return mpFill; } + const FillGradientAttribute* getFillFloatTransGradient() const { return mpFillFloatTransGradient; } }; } // end of namespace overlay } // end of namespace sdr ////////////////////////////////////////////////////////////////////////////// -#endif // _DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX +#endif // INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX // eof diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrattribute.hxx index b6d90c36439b..3c3229d5e3a9 100644 --- a/drawinglayer/inc/drawinglayer/attribute/sdrattribute.hxx +++ b/drawinglayer/inc/drawinglayer/attribute/sdrattribute.hxx @@ -4,9 +4,9 @@ * * $RCSfile: sdrattribute.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:36:38 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:30:35 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,8 +33,8 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX -#define _DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX #ifndef _BGFX_POLYGON_B2DLINEGEOMETRY_HXX #include <basegfx/polygon/b2dlinegeometry.hxx> @@ -55,9 +55,9 @@ class SdrTextObj; namespace drawinglayer { namespace attribute { - class sdrFillBitmapAttribute; - class fillHatchAttribute; - class fillGradientAttribute; + class SdrFillBitmapAttribute; + class FillHatchAttribute; + class FillGradientAttribute; }} ////////////////////////////////////////////////////////////////////////////// @@ -66,24 +66,24 @@ namespace drawinglayer { namespace attribute { - class sdrLineAttribute + class SdrLineAttribute { // line definitions - basegfx::tools::B2DLineJoin meJoin; // B2DLINEJOIN_* defines + basegfx::tools::B2DLineJoin meJoin; // B2DLINEJOIN_* defines double mfWidth; // 1/100th mm, 0.0==hair double mfTransparence; // [0.0 .. 1.0], 0.0==no transp. - basegfx::BColor maColor; // color of line + basegfx::BColor maColor; // color of line ::std::vector< double > maDotDashArray; // array of double which defines the dot-dash pattern double mfFullDotDashLen; // sum of maDotDashArray (for convenience) public: - sdrLineAttribute( + SdrLineAttribute( basegfx::tools::B2DLineJoin eJoin, double fWidth, double fTransparence, const basegfx::BColor& rColor, const ::std::vector< double >& rDotDashArray, double fFullDotDashLen); - ~sdrLineAttribute(); + ~SdrLineAttribute(); // compare operator - bool operator==(const sdrLineAttribute& rCandidate) const; + bool operator==(const SdrLineAttribute& rCandidate) const; // bool access bool isVisible() const { return (1.0 != mfTransparence); } @@ -106,11 +106,11 @@ namespace drawinglayer { namespace attribute { - class sdrLineStartEndAttribute + class SdrLineStartEndAttribute { // line arrow definitions - basegfx::B2DPolyPolygon maStartPolyPolygon; // start Line PolyPolygon - basegfx::B2DPolyPolygon maEndPolyPolygon; // end Line PolyPolygon + basegfx::B2DPolyPolygon maStartPolyPolygon; // start Line PolyPolygon + basegfx::B2DPolyPolygon maEndPolyPolygon; // end Line PolyPolygon double mfStartWidth; // 1/100th mm double mfEndWidth; // 1/100th mm @@ -121,13 +121,13 @@ namespace drawinglayer unsigned mbEndCentered : 1L; // Line is centered on line end point public: - sdrLineStartEndAttribute( + SdrLineStartEndAttribute( const basegfx::B2DPolyPolygon& rStartPolyPolygon, const basegfx::B2DPolyPolygon& rEndPolyPolygon, double fStartWidth, double fEndWidth, bool bStartActive, bool bEndActive, bool bStartCentered, bool bEndCentered); - ~sdrLineStartEndAttribute(); + ~SdrLineStartEndAttribute(); // compare operator - bool operator==(const sdrLineStartEndAttribute& rCandidate) const; + bool operator==(const SdrLineStartEndAttribute& rCandidate) const; // bool access bool isStartActive() const { return mbStartActive; } @@ -151,20 +151,20 @@ namespace drawinglayer { namespace attribute { - class sdrShadowAttribute + class SdrShadowAttribute { // shadow definitions basegfx::B2DVector maOffset; // shadow offset 1/100th mm - double mfTransparence; // [0.0 .. 1.0], 0.0==no transp. + double mfTransparence; // [0.0 .. 1.0], 0.0==no transp. basegfx::BColor maColor; // color of shadow public: - sdrShadowAttribute( + SdrShadowAttribute( const basegfx::B2DVector& rOffset, double fTransparence, const basegfx::BColor& rColor); - ~sdrShadowAttribute(); + ~SdrShadowAttribute(); // compare operator - bool operator==(const sdrShadowAttribute& rCandidate) const; + bool operator==(const SdrShadowAttribute& rCandidate) const; // bool access bool isVisible() const { return (1.0 != mfTransparence); } @@ -183,27 +183,27 @@ namespace drawinglayer { namespace attribute { - class sdrFillAttribute + class SdrFillAttribute { // fill definitions double mfTransparence; // [0.0 .. 1.0], 0.0==no transp. - basegfx::BColor maColor; // fill color - fillGradientAttribute* mpGradient; // fill gradient (if used) - fillHatchAttribute* mpHatch; // fill hatch (if used) - sdrFillBitmapAttribute* mpBitmap; // fill bitmap (if used) + basegfx::BColor maColor; // fill color + FillGradientAttribute* mpGradient; // fill gradient (if used) + FillHatchAttribute* mpHatch; // fill hatch (if used) + SdrFillBitmapAttribute* mpBitmap; // fill bitmap (if used) public: - sdrFillAttribute( - double fTransparence, const basegfx::BColor& rColor, fillGradientAttribute* pGradient = 0L, - fillHatchAttribute* pHatch = 0L, sdrFillBitmapAttribute* pBitmap = 0L); - ~sdrFillAttribute(); + SdrFillAttribute( + double fTransparence, const basegfx::BColor& rColor, FillGradientAttribute* pGradient = 0L, + FillHatchAttribute* pHatch = 0L, SdrFillBitmapAttribute* pBitmap = 0L); + ~SdrFillAttribute(); // copy constructor and assigment operator - sdrFillAttribute(const sdrFillAttribute& rCandidate); - sdrFillAttribute& operator=(const sdrFillAttribute& rCandidate); + SdrFillAttribute(const SdrFillAttribute& rCandidate); + SdrFillAttribute& operator=(const SdrFillAttribute& rCandidate); // compare operator - bool operator==(const sdrFillAttribute& rCandidate) const; + bool operator==(const SdrFillAttribute& rCandidate) const; // bool access bool isGradient() const { return (0L != mpGradient); } @@ -215,15 +215,15 @@ namespace drawinglayer // data access double getTransparence() const { return mfTransparence; } const basegfx::BColor& getColor() const { return maColor; } - const fillGradientAttribute* getGradient() const { return mpGradient; } - const fillHatchAttribute* getHatch() const { return mpHatch; } - const sdrFillBitmapAttribute* getBitmap() const { return mpBitmap; } + const FillGradientAttribute* getGradient() const { return mpGradient; } + const FillHatchAttribute* getHatch() const { return mpHatch; } + const SdrFillBitmapAttribute* getBitmap() const { return mpBitmap; } }; } // end of namespace attribute } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif //_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX // eof diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx index 9319421f712f..b0242b09e40e 100644 --- a/drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx +++ b/drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: sdrattribute3d.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:36:37 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:30:35 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,8 +33,8 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX -#define _DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX #ifndef _BGFX_VECTOR_B2DVECTOR_HXX #include <basegfx/vector/b2dvector.hxx> @@ -72,7 +72,7 @@ #include <basegfx/color/bcolor.hxx> #endif -#ifndef _DRAWINGLAYER_ATTRIBUTE_MATERIALATTRIBUTE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_MATERIALATTRIBUTE3D_HXX #include <drawinglayer/attribute/materialattribute3d.hxx> #endif @@ -87,7 +87,7 @@ namespace drawinglayer { namespace attribute { - class sdr3DObjectAttribute + class Sdr3DObjectAttribute { // 3D object attribute definitions ::com::sun::star::drawing::NormalsKind maNormalsKind; // normals type (0..2) @@ -95,7 +95,7 @@ namespace drawinglayer ::com::sun::star::drawing::TextureProjectionMode maTextureProjectionY; // texture projection type Y (0..2) ::com::sun::star::drawing::TextureKind2 maTextureKind; // texture kind (see uno API) ::com::sun::star::drawing::TextureMode maTextureMode; // texture kind (see uno API) - materialAttribute3D maMaterial; // object, specular and emissive colors, SpecularIntensity + MaterialAttribute3D maMaterial; // object, specular and emissive colors, SpecularIntensity // bitfield unsigned mbNormalsInvert : 1; // invert normals @@ -104,21 +104,20 @@ namespace drawinglayer unsigned mbTextureFilter : 1; // filter texture to make more smooth public: - sdr3DObjectAttribute( + Sdr3DObjectAttribute( ::com::sun::star::drawing::NormalsKind aNormalsKind, ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionX, ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionY, ::com::sun::star::drawing::TextureKind2 aTextureKind, ::com::sun::star::drawing::TextureMode aTextureMode, - const materialAttribute3D& rMaterial, + const MaterialAttribute3D& rMaterial, bool bNormalsInvert, bool bDoubleSided, bool bShadow3D, bool bTextureFilter); - ~sdr3DObjectAttribute(); // compare operator - bool operator==(const sdr3DObjectAttribute& rCandidate) const; + bool operator==(const Sdr3DObjectAttribute& rCandidate) const; // data access ::com::sun::star::drawing::NormalsKind getNormalsKind() const { return maNormalsKind; } @@ -126,7 +125,7 @@ namespace drawinglayer ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionY() const { return maTextureProjectionY; } ::com::sun::star::drawing::TextureKind2 getTextureKind() const { return maTextureKind; } ::com::sun::star::drawing::TextureMode getTextureMode() const { return maTextureMode; } - const materialAttribute3D& getMaterial() const { return maMaterial; } + const MaterialAttribute3D& getMaterial() const { return maMaterial; } bool getNormalsInvert() const { return mbNormalsInvert; } bool getDoubleSided() const { return mbDoubleSided; } bool getShadow3D() const { return mbShadow3D; } @@ -141,21 +140,23 @@ namespace drawinglayer { namespace attribute { - class sdr3DLightAttribute + class Sdr3DLightAttribute { // 3D light attribute definitions - basegfx::BColor maColor; - basegfx::B3DVector maDirection; + basegfx::BColor maColor; + basegfx::B3DVector maDirection; // bitfield unsigned mbSpecular : 1; public: - sdr3DLightAttribute(const basegfx::BColor& rColor, const basegfx::B3DVector& rDirection, bool bSpecular); - ~sdr3DLightAttribute(); + Sdr3DLightAttribute( + const basegfx::BColor& rColor, + const basegfx::B3DVector& rDirection, + bool bSpecular); // compare operator - bool operator==(const sdr3DLightAttribute& rCandidate) const; + bool operator==(const Sdr3DLightAttribute& rCandidate) const; // data access const basegfx::BColor& getColor() const { return maColor; } @@ -171,27 +172,27 @@ namespace drawinglayer { namespace attribute { - class sdrLightingAttribute + class SdrLightingAttribute { // 3D light attribute definitions - basegfx::BColor maAmbientLight; - ::std::vector< sdr3DLightAttribute > maLightVector; + basegfx::BColor maAmbientLight; + ::std::vector< Sdr3DLightAttribute > maLightVector; public: - sdrLightingAttribute( + SdrLightingAttribute( const basegfx::BColor& rAmbientLight, - const ::std::vector< sdr3DLightAttribute >& rLightVector); - ~sdrLightingAttribute(); + const ::std::vector< Sdr3DLightAttribute >& rLightVector); // compare operator - bool operator==(const sdrLightingAttribute& rCandidate) const; + bool operator==(const SdrLightingAttribute& rCandidate) const; // data access const basegfx::BColor& getAmbientLight() const { return maAmbientLight; } - const ::std::vector< sdr3DLightAttribute >& getLightVector() const { return maLightVector; } + const ::std::vector< Sdr3DLightAttribute >& getLightVector() const { return maLightVector; } // color model solver - basegfx::BColor solveColorModel(const basegfx::B3DVector& rNormalInEyeCoordinates, + basegfx::BColor solveColorModel( + const basegfx::B3DVector& rNormalInEyeCoordinates, const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity) const; }; @@ -204,7 +205,7 @@ namespace drawinglayer { namespace attribute { - class sdrSceneAttribute + class SdrSceneAttribute { // 3D scene attribute definitions double mfDistance; @@ -216,16 +217,15 @@ namespace drawinglayer unsigned mbTwoSidedLighting : 1; public: - sdrSceneAttribute( + SdrSceneAttribute( double fDistance, double fShadowSlant, ::com::sun::star::drawing::ProjectionMode aProjectionMode, ::com::sun::star::drawing::ShadeMode aShadeMode, bool bTwoSidedLighting); - ~sdrSceneAttribute(); // compare operator - bool operator==(const sdrSceneAttribute& rCandidate) const; + bool operator==(const SdrSceneAttribute& rCandidate) const; // data access double getDistance() const { return mfDistance; } @@ -239,6 +239,6 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif //_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX // eof diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx index 005753222ecc..658afb2e0be8 100644 --- a/drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx +++ b/drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx @@ -4,9 +4,9 @@ * * $RCSfile: sdrfillbitmapattribute.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:36:39 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:30:35 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,8 +33,8 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX -#define _DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX #ifndef _SV_BITMAP_HXX #include <vcl/bitmap.hxx> @@ -48,8 +48,8 @@ // predefines class SfxItemSet; -namespace drawinglayer { namespace attribute { - class fillBitmapAttribute; +namespace drawinglayer { namespace attribute { + class FillBitmapAttribute; }} namespace basegfx { @@ -62,7 +62,7 @@ namespace drawinglayer { namespace attribute { - class sdrFillBitmapAttribute + class SdrFillBitmapAttribute { Bitmap maBitmap; basegfx::B2DVector maSize; @@ -76,22 +76,22 @@ namespace drawinglayer unsigned mbLogSize : 1; public: - sdrFillBitmapAttribute( + SdrFillBitmapAttribute( const Bitmap& rBitmap, const basegfx::B2DVector& rSize, const basegfx::B2DVector& rOffset, const basegfx::B2DVector& rOffsetPosition, const basegfx::B2DVector& rRectPoint, bool bTiling, bool bStretch, bool bLogSize); - bool operator==(const sdrFillBitmapAttribute& rCandidate) const; + bool operator==(const SdrFillBitmapAttribute& rCandidate) const; // data access const Bitmap& getBitmap() const { return maBitmap; } bool getTiling() const { return mbTiling; } - fillBitmapAttribute getFillBitmapAttribute(const basegfx::B2DRange& rRange) const; + FillBitmapAttribute getFillBitmapAttribute(const basegfx::B2DRange& rRange) const; }; } // end of namespace attribute } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif //_DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX // eof diff --git a/drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx index 79460945094f..18463a00009a 100644 --- a/drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx +++ b/drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx @@ -4,9 +4,9 @@ * * $RCSfile: strokeattribute.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:36:38 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:30:35 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,8 +33,8 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX -#define _DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX #ifndef _BGFX_POLYGON_B2DLINEGEOMETRY_HXX #include <basegfx/polygon/b2dlinegeometry.hxx> @@ -55,16 +55,16 @@ namespace drawinglayer { namespace attribute { - class strokeAttribute + class StrokeAttribute { - basegfx::BColor maColor; // color + basegfx::BColor maColor; // color double mfWidth; // absolute line width - basegfx::tools::B2DLineJoin meLineJoin; // type of LineJoin + basegfx::tools::B2DLineJoin meLineJoin; // type of LineJoin ::std::vector< double > maDotDashArray; // array of double which defines the dot-dash pattern double mfFullDotDashLen; // sum of maDotDashArray (for convenience) public: - strokeAttribute( + StrokeAttribute( const basegfx::BColor& rColor, double fWidth, basegfx::tools::B2DLineJoin aB2DLineJoin, @@ -78,12 +78,12 @@ namespace drawinglayer { } - strokeAttribute(const strokeAttribute& rCandidate) + StrokeAttribute(const StrokeAttribute& rCandidate) { *this = rCandidate; } - strokeAttribute& operator=(const strokeAttribute& rCandidate) + StrokeAttribute& operator=(const StrokeAttribute& rCandidate) { maColor = rCandidate.maColor; mfWidth = rCandidate.mfWidth; @@ -94,12 +94,12 @@ namespace drawinglayer return *this; } - ~strokeAttribute() + ~StrokeAttribute() { } // compare operator - bool operator==(const strokeAttribute& rCandidate) const + bool operator==(const StrokeAttribute& rCandidate) const { return (maColor == rCandidate.maColor && mfWidth == rCandidate.mfWidth @@ -112,7 +112,7 @@ namespace drawinglayer const basegfx::BColor& getColor() const { return maColor; } double getWidth() const { return mfWidth; } basegfx::tools::B2DLineJoin getLineJoin() const { return meLineJoin; } - const ::std::vector< double >& getDotDashArray() { return maDotDashArray; } + const ::std::vector< double >& getDotDashArray() const { return maDotDashArray; } double getFullDotDashLen() const { return mfFullDotDashLen; } }; } // end of namespace attribute @@ -120,6 +120,6 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif //_DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX // eof diff --git a/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx b/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx new file mode 100644 index 000000000000..70dacb52bc1d --- /dev/null +++ b/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx @@ -0,0 +1,101 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: viewinformation2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:31:22 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX +#define INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// predefines + +namespace drawinglayer { namespace { + class ImpViewInformation2D; +}} + +namespace basegfx { + class B2DHomMatrix; + class B2DRange; +} + +namespace com { namespace sun { namespace star { namespace graphic { + struct Primitive2DParameters; +}}}} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace geometry + { + class ViewInformation2D + { + private: + ImpViewInformation2D* mpViewInformation2D; + + public: + // constructors/destructor + ViewInformation2D( + const ::basegfx::B2DHomMatrix& rViewTransformation, + const ::basegfx::B2DRange& rViewport, + double fViewTime); + ViewInformation2D( + const ::com::sun::star::graphic::Primitive2DParameters& rParams); + ViewInformation2D( + const ViewInformation2D& rCandidate); + ~ViewInformation2D(); + + // assignment operator + ViewInformation2D& operator=(const ViewInformation2D& rCandidate); + + // compare operator + bool operator==(const ViewInformation2D& rCandidate) const; + bool operator!=(const ViewInformation2D& rCandidate) const { return !operator==(rCandidate); } + + // data access + const ::basegfx::B2DHomMatrix& getViewTransformation() const; + const ::basegfx::B2DRange& getViewport() const; + double getViewTime() const; + + // data access with on-demand preparations + const ::basegfx::B2DHomMatrix& getInverseViewTransformation() const; + const ::basegfx::B2DRange& getDiscreteViewport() const; + }; + } // end of namespace geometry +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX + +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx new file mode 100644 index 000000000000..d451ed1f9721 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx @@ -0,0 +1,76 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: alphaprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:27:59 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_ALPHAPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_ALPHAPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GROUPPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/groupprimitive2d.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class AlphaPrimitive2D : public GroupPrimitive2D + { + private: + Primitive2DSequence maAlpha; // transparence sequence + + public: + AlphaPrimitive2D( + const Primitive2DSequence& rChildren, + const Primitive2DSequence& rAlpha); + + // get data + const Primitive2DSequence& getAlpha() const { return maAlpha; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_ALPHAPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx new file mode 100644 index 000000000000..a2f7f1e6e0ff --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx @@ -0,0 +1,185 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: animatedprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:00 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_ANIMATEDPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_ANIMATEDPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GROUPPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/groupprimitive2d.hxx> +#endif + +#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX +#include <basegfx/matrix/b2dhommatrix.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// predefines +namespace drawinglayer { namespace animation { + class AnimationEntry; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class AnimatedSwitchPrimitive2D : public GroupPrimitive2D + { + private: + // the animation definition which allows translation of a point in time + // to an animation state [0.0 .. 1.0]. This member contains a cloned + // definition and is owned by this implementation + animation::AnimationEntry* mpAnimationEntry; + + // the last remembered decompose time, created and used by getDecomposition() for + // buffering purposes + double mfDecomposeViewTime; + + // bitfield + // flag if this is a text or graphic animation. Necessary since SdrViews need to differentiate + // between both types if they are on/off + unsigned mbIsTextAnimation : 1; + + protected: + // create local decomposition + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + AnimatedSwitchPrimitive2D( + const animation::AnimationEntry& rAnimationEntry, + const Primitive2DSequence& rChildren, + bool bIsTextAnimation); + virtual ~AnimatedSwitchPrimitive2D(); + + // get data + const animation::AnimationEntry& getAnimationEntry() const { return *mpAnimationEntry; } + bool isTextAnimation() const { return mbIsTextAnimation; } + bool isGraphicAnimation() const { return !isTextAnimation(); } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + + // The getDecomposition is overloaded here since the decompose is dependent of the point in time, + // so the default implementation is nut useful here, it needs to be handled locally + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class AnimatedBlinkPrimitive2D : public AnimatedSwitchPrimitive2D + { + protected: + // create local decomposition + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + AnimatedBlinkPrimitive2D( + const animation::AnimationEntry& rAnimationEntry, + const Primitive2DSequence& rChildren, + bool bIsTextAnimation); + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class AnimatedInterpolatePrimitive2D : public AnimatedSwitchPrimitive2D + { + private: + // the start and stop transformations + basegfx::B2DHomMatrix maStart; + basegfx::B2DHomMatrix maStop; + + // locally buffered decompose of the matrices + basegfx::B2DVector maScaleA; + basegfx::B2DVector maTranslateA; + basegfx::B2DVector maScaleB; + basegfx::B2DVector maTranslateB; + double mfRotateA; + double mfShearXA; + double mfRotateB; + double mfShearXB; + + // bitfield + // flag to track if the matrices decomposition was already done + unsigned mbDecomposed : 1; + + // helpers + void implDecompose(); + + protected: + // create local decomposition + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + AnimatedInterpolatePrimitive2D( + const animation::AnimationEntry& rAnimationEntry, + const Primitive2DSequence& rChildren, + const basegfx::B2DHomMatrix& rStart, + const basegfx::B2DHomMatrix& rStop, + bool bIsTextAnimation); + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_ANIMATEDPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx new file mode 100644 index 000000000000..20d18e868c70 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: backgroundcolorprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:00 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BACKGROUNDCOLORPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BACKGROUNDCOLORPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#endif + +#ifndef _BGFX_COLOR_BCOLOR_HXX +#include <basegfx/color/bcolor.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// BackgroundColorPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class BackgroundColorPrimitive2D : public BasePrimitive2D + { + private: + basegfx::BColor maBColor; + + // the last used viewInformation, used from getDecomposition for buffering + basegfx::B2DRange maLastViewport; + + protected: + // create local decomposition + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + BackgroundColorPrimitive2D( + const basegfx::BColor& rBColor); + + // get data + const basegfx::BColor& getBColor() const { return maBColor; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // get 2d range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + + // Overload standard getDecomposition call to be view-dependent here + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BACKGROUNDCOLORPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx new file mode 100644 index 000000000000..2cf78882cfeb --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx @@ -0,0 +1,181 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: baseprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:00 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX + +#ifndef _CPPUHELPER_COMPBASE1_HXX_ +#include <cppuhelper/compbase1.hxx> +#endif + +#include <boost/utility.hpp> + +#ifndef _COM_SUN_STAR_GRAPHIC_XPRIMITIVE2D_HPP_ +#include <com/sun/star/graphic/XPrimitive2D.hpp> +#endif + +#ifndef _COMPHELPER_BROADCASTHELPER_HXX_ +#include <comphelper/broadcasthelper.hxx> +#endif + +#ifndef _BGFX_RANGE_B2DRANGE_HXX +#include <basegfx/range/b2drange.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// defines for Create2DPrimitiveID + +#define Create2DPrimitiveID(a, b, c, d) ((((((a << 8L)|b)<<8L)|c)<<8L)|d) + +////////////////////////////////////////////////////////////////////////////// +// predefines + +namespace drawinglayer { namespace geometry { + class ViewInformation2D; +}} + +////////////////////////////////////////////////////////////////////////////// +// basePrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + // typedefs for basePrimitive2DImplBase, Primitive2DSequence and Primitive2DReference + typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitive2D > BasePrimitive2DImplBase; + typedef ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > Primitive2DReference; + typedef ::com::sun::star::uno::Sequence< Primitive2DReference > Primitive2DSequence; + + // base class for all C++ implementations of com::sun::star::graphic::XPrimitive2D. This class + // is strongly virtual due to the lack of getPrimitiveID() implementation. This is by purpose, this + // base class shall not be incarnated and be used directly as a XPrimitive2D. + class BasePrimitive2D + : private boost::noncopyable, + protected comphelper::OBaseMutex, + public BasePrimitive2DImplBase + { + private: + // a sequence used for buffering the last createLocalDecomposition() result. Use + // the protected access methods to change. Only implementations of getDecomposition() + // should make use. + Primitive2DSequence maLocalDecomposition; + + protected: + // access methods to maLocalDecomposition. The usage of this methods may allow + // later thread-safe stuff to be added if needed. Only to be used by getDecomposition() + // implementations for buffering the last decomposition. + const Primitive2DSequence& getLocalDecomposition() const { return maLocalDecomposition; } + void setLocalDecomposition(const Primitive2DSequence& rNew) { maLocalDecomposition = rNew; } + + // method which is to be used to implement the local decomposition of a 2D primitive. The default + // implementation will just return an empty decomposition + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + // constructor + BasePrimitive2D(); + + // the ==operator is mainly needed to allow testing newly-created primitives against their last + // incarnation which buffers/holds the made decompositions. The default implementation + // uses getPrimitiveID()-calls to test if it's the same ID at last. Overloaded implementation are then + // based on this implementation + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + bool operator!=( const BasePrimitive2D& rPrimitive ) const { return !operator==(rPrimitive); } + + // The default implementation will use getDecomposition results to create the range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID for fast identifying of known primitive implementations in renderers. These use + // the Create2DPrimitiveID macro to define unique IDs. The same macro is used from the renderers + // in their typical switch/case loop + virtual sal_uInt32 getPrimitiveID() const = 0; + + // The getDecomposition default implementation will on demand use createLocalDecomposition() if maLocalDecomposition is empty. + // It will set maLocalDecomposition to this obtained decomposition to buffer it. + // If the decomposition is also ViewInformation2D-dependent, this method needs to be overloaded and the + // ViewInformation2D for the last decomposition need to be remembered, too, and be used in the next call to decide if + // the buffered decomposition may be reused or not. + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + // + // Methods from XPrimitive2D + // + + // The getDecomposition implementation for UNO API will use getDecomposition from this implementation. It + // will construct a ViewInformation2D from the Primitive2DParameters for that purpose + virtual Primitive2DSequence SAL_CALL getDecomposition( const ::com::sun::star::graphic::Primitive2DParameters& aPrimitive2DParameters ) throw ( ::com::sun::star::uno::RuntimeException ); + + // The getRange implementation for UNO API will use getRange from this implementation. It + // will construct a ViewInformation2D from the Primitive2DParameters for that purpose + virtual ::com::sun::star::geometry::RealRectangle2D SAL_CALL getRange( const ::com::sun::star::graphic::Primitive2DParameters& aPrimitive2DParameters ) throw ( ::com::sun::star::uno::RuntimeException ); + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// tooling + +namespace drawinglayer +{ + namespace primitive2d + { + // get B2DRange from a given Primitive2DReference + basegfx::B2DRange getB2DRangeFromPrimitive2DReference(const Primitive2DReference& rCandidate, const geometry::ViewInformation2D& aViewInformation); + + // get B2DRange from a given Primitive2DSequence + basegfx::B2DRange getB2DRangeFromPrimitive2DSequence(const Primitive2DSequence& rCandidate, const geometry::ViewInformation2D& aViewInformation); + + // compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D) + // and using compare operator + bool arePrimitive2DReferencesEqual(const Primitive2DReference& rA, const Primitive2DReference& rB); + + // compare two Primitive2DReferences for equality, uses arePrimitive2DReferencesEqual internally + bool arePrimitive2DSequencesEqual(const Primitive2DSequence& rA, const Primitive2DSequence& rB); + + // concatenate sequence + void appendPrimitive2DSequenceToPrimitive2DSequence(Primitive2DSequence& rDest, const Primitive2DSequence& rSource); + + // concatenate single Primitive2D + void appendPrimitive2DReferenceToPrimitive2DSequence(Primitive2DSequence& rDest, const Primitive2DReference& rSource); + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx new file mode 100644 index 000000000000..352b7cfcc3d8 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx @@ -0,0 +1,90 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: bitmapprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:00 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BITMAPPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BITMAPPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#endif + +#ifndef _SV_BITMAPEX_HXX +#include <vcl/bitmapex.hxx> +#endif + +#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX +#include <basegfx/matrix/b2dhommatrix.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// BitmapPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class BitmapPrimitive2D : public BasePrimitive2D + { + private: + BitmapEx maBitmapEx; + basegfx::B2DHomMatrix maTransform; + + public: + BitmapPrimitive2D( + const BitmapEx& rBitmapEx, + const basegfx::B2DHomMatrix& rTransform); + + // get data + const BitmapEx& getBitmapEx() const { return maBitmapEx; } + const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BITMAPPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx new file mode 100644 index 000000000000..92bec4566bc5 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx @@ -0,0 +1,94 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: embedded3dprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:00 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_EMBEDDED3DPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_EMBEDDED3DPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#endif + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_BASEPRIMITIVE3D_HXX +#include <drawinglayer/primitive3d/baseprimitive3d.hxx> +#endif + +#ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_TRANSFORMATION3D_HXX +#include <drawinglayer/geometry/transformation3d.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// BackgroundColorPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class Embedded3DPrimitive2D : public BasePrimitive2D + { + private: + primitive3d::Primitive3DSequence mxChildren3D; + geometry::Transformation3D maTransformation3D; + + protected: + // local decomposition. + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + Embedded3DPrimitive2D( + const primitive3d::Primitive3DSequence& rxChildren3D, + const geometry::Transformation3D& rTransformation3D); + + // get data + const primitive3d::Primitive3DSequence& getChildren3D() const { return mxChildren3D; } + const geometry::Transformation3D& getTransformation3D() const { return maTransformation3D; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_EMBEDDED3DPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx new file mode 100644 index 000000000000..f4243b2d4053 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx @@ -0,0 +1,94 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: fillbitmapprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:00 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLBITMAPPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLBITMAPPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#endif + +#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX +#include <basegfx/matrix/b2dhommatrix.hxx> +#endif + +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX +#include <drawinglayer/attribute/fillbitmapattribute.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// FillbitmapPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class FillBitmapPrimitive2D : public BasePrimitive2D + { + private: + basegfx::B2DHomMatrix maTransformation; + attribute::FillBitmapAttribute maFillBitmap; + + protected: + // local decomposition. + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + FillBitmapPrimitive2D( + const basegfx::B2DHomMatrix& rTransformation, + const attribute::FillBitmapAttribute& rFillBitmap); + + // get data + const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; } + const attribute::FillBitmapAttribute& getFillBitmap() const { return maFillBitmap; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + // get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLBITMAPPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx new file mode 100644 index 000000000000..4e70f9139990 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx @@ -0,0 +1,90 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: fillgradientprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:00 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLGRADIENTPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLGRADIENTPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#endif + +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX +#include <drawinglayer/attribute/fillattribute.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// FillbitmapPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class FillGradientPrimitive2D : public BasePrimitive2D + { + private: + basegfx::B2DRange maObjectRange; + attribute::FillGradientAttribute maFillGradient; + + protected: + // local decomposition. + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + FillGradientPrimitive2D( + const basegfx::B2DRange& rObjectRange, + const attribute::FillGradientAttribute& rFillGradient); + + // get data + const basegfx::B2DRange& getObjectRange() const { return maObjectRange; } + const attribute::FillGradientAttribute& getFillGradient() const { return maFillGradient; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLGRADIENTPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx new file mode 100644 index 000000000000..d612267908bc --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: fillhatchprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:01 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLHATCHPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLHATCHPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#endif + +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX +#include <drawinglayer/attribute/fillattribute.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// FillbitmapPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class FillHatchPrimitive2D : public BasePrimitive2D + { + private: + basegfx::B2DRange maObjectRange; + attribute::FillHatchAttribute maFillHatch; + basegfx::BColor maBColor; + + protected: + // local decomposition. + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + FillHatchPrimitive2D( + const basegfx::B2DRange& rObjectRange, + const basegfx::BColor& rBColor, + const attribute::FillHatchAttribute& rFillHatch); + + // get data + const basegfx::B2DRange& getObjectRange() const { return maObjectRange; } + const attribute::FillHatchAttribute& getFillHatch() const { return maFillHatch; } + const basegfx::BColor& getBColor() const { return maBColor; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLHATCHPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx new file mode 100644 index 000000000000..6aec6c6fb338 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx @@ -0,0 +1,119 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: gridprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:01 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GRIDPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GRIDPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#endif + +#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX +#include <basegfx/matrix/b2dhommatrix.hxx> +#endif + +#ifndef _BGFX_COLOR_BCOLOR_HXX +#include <basegfx/color/bcolor.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// GridPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class GridPrimitive2D : public BasePrimitive2D + { + private: + basegfx::B2DHomMatrix maTransform; + double mfWidth; + double mfHeight; + double mfSmallestViewDistance; + double mfSmallestSubdivisionViewDistance; + sal_uInt32 mnSubdivisionsX; + sal_uInt32 mnSubdivisionsY; + basegfx::BColor maBColor; + + // the last used viewInformation, used from getDecomposition for buffering + basegfx::B2DHomMatrix maLastViewTransformation; + basegfx::B2DRange maLastViewport; + + protected: + // create local decomposition + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + GridPrimitive2D( + const basegfx::B2DHomMatrix& rTransform, + double fWidth, + double fHeight, + double fSmallestViewDistance, + double fSmallestSubdivisionViewDistance, + sal_uInt32 nSubdivisionsX, + sal_uInt32 nSubdivisionsY, + const basegfx::BColor& rBColor); + + // get data + const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + double getWidth() const { return mfWidth; } + double getHeight() const { return mfHeight; } + double getSmallestViewDistance() const { return mfSmallestViewDistance; } + double getSmallestSubdivisionViewDistance() const { return mfSmallestSubdivisionViewDistance; } + sal_uInt32 getSubdivisionsX() const { return mnSubdivisionsX; } + sal_uInt32 getSubdivisionsY() const { return mnSubdivisionsY; } + const basegfx::BColor& getBColor() const { return maBColor; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // get 2d range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + + // Overload standard getDecomposition call to be view-dependent here + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GRIDPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx new file mode 100644 index 000000000000..b4ce7aca800b --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx @@ -0,0 +1,81 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: groupprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:01 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GROUPPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GROUPPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// GroupPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class GroupPrimitive2D : public BasePrimitive2D + { + private: + // the children. Declared private since this shall never be changed at all after construction + Primitive2DSequence maChildren; + + protected: + // local decomposition. Implementation will just return children + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + // constructor + GroupPrimitive2D(const Primitive2DSequence& rChildren); + + // data access + Primitive2DSequence getChildren() const { return maChildren; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GROUPPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx new file mode 100644 index 000000000000..cd9e0171811c --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx @@ -0,0 +1,116 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: helplineprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:01 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HELPLINEPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HELPLINEPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#endif + +#ifndef _BGFX_COLOR_BCOLOR_HXX +#include <basegfx/color/bcolor.hxx> +#endif + +#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX +#include <basegfx/matrix/b2dhommatrix.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// HelplinePrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + enum HelplineStyle2D + { + HELPLINESTYLE2D_POINT, + HELPLINESTYLE2D_LINE + }; + + class HelplinePrimitive2D : public BasePrimitive2D + { + private: + basegfx::B2DPoint maPosition; + basegfx::B2DVector maDirection; + HelplineStyle2D meStyle; + basegfx::BColor maRGBColA; + basegfx::BColor maRGBColB; + double mfViewDashLength; + + // the last used viewInformation, used from getDecomposition for buffering + basegfx::B2DHomMatrix maLastViewTransformation; + basegfx::B2DRange maLastViewport; + + protected: + // create local decomposition + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + HelplinePrimitive2D( + const basegfx::B2DPoint& rPosition, + const basegfx::B2DVector& rDirection, + HelplineStyle2D eStyle, + const basegfx::BColor& rRGBColA, + const basegfx::BColor& aRGBColB, + double fViewDashLength); + + // get data + const basegfx::B2DPoint getPosition() const { return maPosition; } + const basegfx::B2DVector getDirection() const { return maDirection; } + HelplineStyle2D getStyle() const { return meStyle; } + const basegfx::BColor& getRGBColA() const { return maRGBColA; } + const basegfx::BColor& getRGBColB() const { return maRGBColB; } + double getViewDashLength() const { return mfViewDashLength; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + + // Overload standard getDecomposition call to be view-dependent here + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HELPLINEPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx new file mode 100644 index 000000000000..776724a0e706 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx @@ -0,0 +1,80 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: maskprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:01 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MASKPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MASKPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GROUPPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/groupprimitive2d.hxx> +#endif + +#ifndef _BGFX_POLYGON_B2DPOLYPOLYGON_HXX +#include <basegfx/polygon/b2dpolypolygon.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class MaskPrimitive2D : public GroupPrimitive2D + { + private: + basegfx::B2DPolyPolygon maMask; + + public: + MaskPrimitive2D( + const basegfx::B2DPolyPolygon& rMask, + const Primitive2DSequence& rChildren); + + // get data + const basegfx::B2DPolyPolygon& getMask() const { return maMask; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MASKPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx new file mode 100644 index 000000000000..b66dc2904f77 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx @@ -0,0 +1,90 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: metafileprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:01 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_METAFILEPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_METAFILEPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#endif + +#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX +#include <basegfx/matrix/b2dhommatrix.hxx> +#endif + +#ifndef _SV_GDIMTF_HXX +#include <vcl/gdimtf.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// MetafilePrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class MetafilePrimitive2D : public BasePrimitive2D + { + private: + basegfx::B2DHomMatrix maMetaFileTransform; + GDIMetaFile maMetaFile; + + public: + MetafilePrimitive2D( + const GDIMetaFile& rMetaFile, + const basegfx::B2DHomMatrix& rMetaFileTransform); + + // get data + const basegfx::B2DHomMatrix& getTransform() const { return maMetaFileTransform; } + const GDIMetaFile& getMetaFile() const { return maMetaFile; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_METAFILEPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx new file mode 100644 index 000000000000..34bec1ac4868 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx @@ -0,0 +1,80 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: modifiedcolorprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:02 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GROUPPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/groupprimitive2d.hxx> +#endif + +#ifndef _BGFX_COLOR_BCOLORMODIFIER_HXX +#include <basegfx/color/bcolormodifier.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class ModifiedColorPrimitive2D : public GroupPrimitive2D + { + private: + basegfx::BColorModifier maColorModifier; + + public: + ModifiedColorPrimitive2D( + const Primitive2DSequence& rChildren, + const basegfx::BColorModifier& rColorModifier); + + // get data + const basegfx::BColorModifier& getColorModifier() const { return maColorModifier; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx new file mode 100644 index 000000000000..215e546f2b8a --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx @@ -0,0 +1,210 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: polygonprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:02 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYGONPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYGONPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#endif + +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX +#include <drawinglayer/attribute/strokeattribute.hxx> +#endif + +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_STROKEARROWATTRIBUTE_HXX +#include <drawinglayer/attribute/strokearrowattribute.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// PolygonHairlinePrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class PolygonHairlinePrimitive2D : public BasePrimitive2D + { + private: + basegfx::B2DPolygon maPolygon; + basegfx::BColor maBColor; + + public: + PolygonHairlinePrimitive2D(const basegfx::B2DPolygon& rPolygon, const basegfx::BColor& rBColor); + + // get data + const basegfx::B2DPolygon& getB2DPolygon() const { return maPolygon; } + const basegfx::BColor& getBColor() const { return maBColor; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// PolygonMarkerPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class PolygonMarkerPrimitive2D : public BasePrimitive2D + { + private: + basegfx::B2DPolygon maPolygon; + basegfx::BColor maRGBColorA; + basegfx::BColor maRGBColorB; + double mfDashLength; + + protected: + // local decomposition. + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + PolygonMarkerPrimitive2D( + const basegfx::B2DPolygon& rPolygon, + const basegfx::BColor& rRGBColorA, + const basegfx::BColor& rRGBColorB, + double fDashLength); + + // get data + const basegfx::B2DPolygon& getB2DPolygon() const { return maPolygon; } + const basegfx::BColor& getRGBColorA() const { return maRGBColorA; } + const basegfx::BColor& getRGBColorB() const { return maRGBColorB; } + double getDashLength() const { return mfDashLength; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// PolygonStrokePrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class PolygonStrokePrimitive2D : public BasePrimitive2D + { + private: + basegfx::B2DPolygon maPolygon; + attribute::StrokeAttribute maStrokeAttribute; + + protected: + // local decomposition. + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + PolygonStrokePrimitive2D( + const basegfx::B2DPolygon& rPolygon, + const attribute::StrokeAttribute& rStrokeAttribute); + + // get data + basegfx::B2DPolygon getB2DPolygon() const { return maPolygon; } + const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// PolygonStrokeArrowPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class PolygonStrokeArrowPrimitive2D : public PolygonStrokePrimitive2D + { + private: + attribute::StrokeArrowAttribute maStart; + attribute::StrokeArrowAttribute maEnd; + + protected: + // local decomposition. + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + PolygonStrokeArrowPrimitive2D( + const basegfx::B2DPolygon& rPolygon, + const attribute::StrokeAttribute& rStrokeAttribute, + const attribute::StrokeArrowAttribute& rStart, + const attribute::StrokeArrowAttribute& rEnd); + + // get data + const attribute::StrokeArrowAttribute& getStart() const { return maStart; } + const attribute::StrokeArrowAttribute& getEnd() const { return maEnd; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYGONPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx new file mode 100644 index 000000000000..cfaa9bb723b4 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx @@ -0,0 +1,196 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: polypolygonprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:02 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#endif + +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX +#include <drawinglayer/attribute/fillattribute.hxx> +#endif + +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX +#include <drawinglayer/attribute/fillbitmapattribute.hxx> +#endif + +#ifndef _BGFX_POLYGON_B2DPOLYPOLYGON_HXX +#include <basegfx/polygon/b2dpolypolygon.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// PolyPolygonColorPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class PolyPolygonColorPrimitive2D : public BasePrimitive2D + { + private: + basegfx::B2DPolyPolygon maPolyPolygon; + basegfx::BColor maBColor; + + public: + PolyPolygonColorPrimitive2D( + const basegfx::B2DPolyPolygon& rPolyPolygon, + const basegfx::BColor& rBColor); + + // get data + const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; } + const basegfx::BColor& getBColor() const { return maBColor; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// PolyPolygonGradientPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class PolyPolygonGradientPrimitive2D : public PolyPolygonColorPrimitive2D + { + private: + attribute::FillGradientAttribute maFillGradient; + + protected: + // local decomposition. + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + PolyPolygonGradientPrimitive2D( + const basegfx::B2DPolyPolygon& rPolyPolygon, + const basegfx::BColor& rBColor, + const attribute::FillGradientAttribute& rFillGradient); + + // get data + const attribute::FillGradientAttribute& getFillGradient() const { return maFillGradient; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// PolyPolygonHatchPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class PolyPolygonHatchPrimitive2D : public PolyPolygonColorPrimitive2D + { + private: + attribute::FillHatchAttribute maFillHatch; + + protected: + // local decomposition. + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + PolyPolygonHatchPrimitive2D( + const basegfx::B2DPolyPolygon& rPolyPolygon, + const basegfx::BColor& rBColor, + const attribute::FillHatchAttribute& rFillHatch); + + // get data + const attribute::FillHatchAttribute& getFillHatch() const { return maFillHatch; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// PolyPolygonBitmapPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class PolyPolygonBitmapPrimitive2D : public PolyPolygonColorPrimitive2D + { + private: + attribute::FillBitmapAttribute maFillBitmap; + + protected: + // local decomposition. + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + PolyPolygonBitmapPrimitive2D( + const basegfx::B2DPolyPolygon& rPolyPolygon, + const basegfx::BColor& rBColor, + const attribute::FillBitmapAttribute& rFillBitmap); + + // get data + const attribute::FillBitmapAttribute& getFillBitmap() const { return maFillBitmap; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx new file mode 100644 index 000000000000..6c78d4ec7231 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx @@ -0,0 +1,138 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sceneprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:02 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SCENEPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SCENEPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#endif + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_BASEPRIMITIVE3D_HXX +#include <drawinglayer/primitive3d/baseprimitive3d.hxx> +#endif + +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX +#include <drawinglayer/attribute/sdrattribute3d.hxx> +#endif + +#ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_TRANSFORMATION3D_HXX +#include <drawinglayer/geometry/transformation3d.hxx> +#endif + +#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX +#include <basegfx/matrix/b2dhommatrix.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class ScenePrimitive2D : public BasePrimitive2D + { + private: + primitive3d::Primitive3DSequence mxChildren3D; // the 3d sub-primitives + attribute::SdrSceneAttribute maSdrSceneAttribute; // 3d scene attribute set + attribute::SdrLightingAttribute maSdrLightingAttribute; // lighting attribute set + geometry::Transformation3D maTransformation3D; // scene transformation set and object transformation + + // the primitiveSequence for on-demand created shadow primitives (see mbShadow3DChecked) + Primitive2DSequence maShadowPrimitives; + + // the primitiveSequence for on-demand created label primitives (see mbLabelChecked) + Primitive2DSequence maLabelPrimitives; + + // bitfield + + // flag if given 3D geometry is already cheched for shadow definitions and 2d shadows + // are created in maShadowPrimitives + unsigned mbShadow3DChecked : 1; + + // flag if given 3D geometry is already cheched for label definitions and 2d labels + // are created in maLabelPrimitives + unsigned mbLabel3DChecked : 1; + + // the last used viewInformation, used from getDecomposition for buffering + basegfx::B2DHomMatrix maLastViewTransformation; + basegfx::B2DRange maLastViewport; + + // protected helpers + bool impGetShadow3D(const geometry::ViewInformation2D& rViewInformation) const; + bool impGetLabel3D(const geometry::ViewInformation2D& rViewInformation) const; + + protected: + // local decomposition. + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + // public helpers + basegfx::B3DHomMatrix createProjection(const basegfx::B3DRange& r3DRange) const; + + // constructor/destructor + ScenePrimitive2D( + const primitive3d::Primitive3DSequence& rxChildren3D, + const attribute::SdrSceneAttribute& rSdrSceneAttribute, + const attribute::SdrLightingAttribute& rSdrLightingAttribute, + const geometry::Transformation3D& rTransformation3D); + + // get data + const primitive3d::Primitive3DSequence& getChildren3D() const { return mxChildren3D; } + const attribute::SdrSceneAttribute& getSdrSceneAttribute() const { return maSdrSceneAttribute; } + const attribute::SdrLightingAttribute& getSdrLightingAttribute() const { return maSdrLightingAttribute; } + const geometry::Transformation3D& getTransformation3D() const { return maTransformation3D; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + + // get local decomposition. Overloaded since this decomposition is view-dependent + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SCENEPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx new file mode 100644 index 000000000000..1720757fd737 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx @@ -0,0 +1,94 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: shadowprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:02 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SHADOWPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SHADOWPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GROUPPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/groupprimitive2d.hxx> +#endif + +#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX +#include <basegfx/matrix/b2dhommatrix.hxx> +#endif + +#ifndef _BGFX_COLOR_BCOLOR_HXX +#include <basegfx/color/bcolor.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class ShadowPrimitive2D : public GroupPrimitive2D + { + private: + basegfx::B2DHomMatrix maShadowTransform; + basegfx::BColor maShadowColor; + + protected: + // create decomposition + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + ShadowPrimitive2D( + const basegfx::B2DHomMatrix& rShadowTransform, + const basegfx::BColor& rShadowColor, + const Primitive2DSequence& rChildren); + + // get data + const basegfx::B2DHomMatrix& getShadowTransform() const { return maShadowTransform; } + const basegfx::BColor& getShadowColor() const { return maShadowColor; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SHADOWPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx new file mode 100644 index 000000000000..3a673d3279a5 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx @@ -0,0 +1,96 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: textlayoutdevice.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:02 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_TEXTLAYOUTDEVICE_HXX +#define INCLUDED_DRAWINGLAYER_TEXTLAYOUTDEVICE_HXX + +#ifndef _SAL_TYPES_H_ +#include <sal/types.h> +#endif + +#ifndef _SOLAR_H +#include <tools/solar.h> +#endif + +#ifndef _TL_POLY_HXX +#include <tools/poly.hxx> +#endif + +#ifndef _BGFX_RANGE_B2DRANGE_HXX +#include <basegfx/range/b2drange.hxx> +#endif + +#include <vector> + +////////////////////////////////////////////////////////////////////////////// +// predefines +class VirtualDevice; +class Font; +class String; + +namespace drawinglayer { namespace primitive2d { + struct FontAttributes; +}} + +////////////////////////////////////////////////////////////////////////////// +// access to one global impTimedRefDev incarnation in namespace drawinglayer::primitive + +namespace drawinglayer +{ + namespace primitive2d + { + class TextLayouterDevice + { + // interlally used VirtualDevice + VirtualDevice& mrDevice; + + public: + TextLayouterDevice(); + ~TextLayouterDevice(); + + void setFont(const Font& rFont); + void setFontAttributes(const FontAttributes& rFontAttributes, const basegfx::B2DHomMatrix& rTransform); + double getTextHeight(); + double getTextWidth(const String& rText, xub_StrLen nIndex, xub_StrLen nLength); + bool getTextOutlines(PolyPolyVector& rPolyPolyVector, const String& rText, xub_StrLen nIndex, xub_StrLen nLength, const ::std::vector< sal_Int32 >& rDXArray); + basegfx::B2DRange getTextBoundRect(const String& rText, xub_StrLen nIndex, xub_StrLen nLength); + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //_DRAWINGLAYER_TEXTLAYOUTDEVICE_HXX + diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx new file mode 100644 index 000000000000..dbbce8254fc6 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx @@ -0,0 +1,264 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: textprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:03 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#endif + +#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX +#include <basegfx/matrix/b2dhommatrix.hxx> +#endif + +#ifndef _STRING_HXX +#include <tools/string.hxx> +#endif + +#ifndef _SV_FONT_HXX +#include <vcl/font.hxx> +#endif + +#ifndef _BGFX_COLOR_BCOLOR_HXX +#include <basegfx/color/bcolor.hxx> +#endif + +#include <vector> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + struct FontAttributes + { + String maFamilyName; + String maStyleName; + sal_uInt16 mnWeight; + + // bitfield + unsigned mbSymbol : 1; + unsigned mbVertical : 1; + unsigned mbItalic : 1; + + // compare operator + bool operator==(const FontAttributes& rCompare) const + { + return (maFamilyName == rCompare.maFamilyName + && maStyleName == rCompare.maStyleName + && mnWeight == rCompare.mnWeight + && mbSymbol == rCompare.mbSymbol + && mbVertical == rCompare.mbVertical + && mbItalic == rCompare.mbItalic); + } + }; + + // helper methods for vcl font + Font getVclFontFromFontAttributes(const FontAttributes& rFontAttributes, const basegfx::B2DVector& rFontSize, double fFontRotation); + Font getVclFontFromFontAttributes(const FontAttributes& rFontAttributes, const basegfx::B2DHomMatrix& rTransform); + FontAttributes getFontAttributesFromVclFont(basegfx::B2DVector& rSize, const Font& rFont); + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class TextSimplePortionPrimitive2D : public BasePrimitive2D + { + private: + basegfx::B2DHomMatrix maTextTransform; // text range transformation from unit range ([0.0 .. 1.0]) to text range + String maText; // the text + ::std::vector< double > maDXArray; // the DX array scale-independent in unit coordinates + FontAttributes maFontAttributes; // the font to use + basegfx::BColor maFontColor; // font color + + protected: + // local decomposition. + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + TextSimplePortionPrimitive2D( + const basegfx::B2DHomMatrix& rNewTransform, + const String& rText, + const ::std::vector< double >& rDXArray, + const FontAttributes& rFontAttributes, + const basegfx::BColor& rFontColor); + + // get data + const basegfx::B2DHomMatrix& getTextTransform() const { return maTextTransform; } + const String& getText() const { return maText; } + const ::std::vector< double >& getDXArray() const { return maDXArray; } + const FontAttributes& getFontAttributes() const { return maFontAttributes; } + const basegfx::BColor& getFontColor() const { return maFontColor; } + + // helper to have a central conversion to font-size-scaled integer DXArray + void getIntegerDXArray(::std::vector< sal_Int32 >& rDXArray) const; + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + // get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + enum FontUnderline + { + FONT_UNDERLINE_NONE, + FONT_UNDERLINE_SINGLE, + FONT_UNDERLINE_DOUBLE, + FONT_UNDERLINE_DOTTED, + FONT_UNDERLINE_DASH, + FONT_UNDERLINE_LONGDASH, + FONT_UNDERLINE_DASHDOT, + FONT_UNDERLINE_DASHDOTDOT, + FONT_UNDERLINE_SMALLWAVE, + FONT_UNDERLINE_WAVE, + FONT_UNDERLINE_DOUBLEWAVE, + FONT_UNDERLINE_BOLD, + FONT_UNDERLINE_BOLDDOTTED, + FONT_UNDERLINE_BOLDDASH, + FONT_UNDERLINE_BOLDLONGDASH, + FONT_UNDERLINE_BOLDDASHDOT, + FONT_UNDERLINE_BOLDDASHDOTDOT, + FONT_UNDERLINE_BOLDWAVE + }; + + enum FontStrikeout + { + FONT_STRIKEOUT_NONE, + FONT_STRIKEOUT_SINGLE, + FONT_STRIKEOUT_DOUBLE, + FONT_STRIKEOUT_BOLD, + FONT_STRIKEOUT_SLASH, + FONT_STRIKEOUT_X + }; + + enum FontEmphasisMark + { + FONT_EMPHASISMARK_NONE, + FONT_EMPHASISMARK_DOT, + FONT_EMPHASISMARK_CIRCLE, + FONT_EMPHASISMARK_DISC, + FONT_EMPHASISMARK_ACCENT + }; + + enum FontRelief + { + FONT_RELIEF_NONE, + FONT_RELIEF_EMBOSSED, + FONT_RELIEF_ENGRAVED + }; + + class TextComplexPortionPrimitive2D : public TextSimplePortionPrimitive2D + { + private: + FontUnderline meFontUnderline; + FontStrikeout meFontStrikeout; + FontEmphasisMark meFontEmphasisMark; + FontRelief meFontRelief; + + // bitfield + unsigned mbUnderlineAbove : 1; + unsigned mbWordLineMode : 1; + unsigned mbEmphasisMarkAbove : 1; + unsigned mbEmphasisMarkBelow : 1; + unsigned mbShadow : 1; + unsigned mbOutline : 1; + + protected: + // local decomposition. + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + TextComplexPortionPrimitive2D( + const basegfx::B2DHomMatrix& rNewTransform, + const String& rText, + const ::std::vector< double >& rDXArray, + const FontAttributes& rFontAttributes, + const basegfx::BColor& rFontColor, + FontUnderline eFontUnderline = FONT_UNDERLINE_NONE, + bool bUnderlineAbove = false, + FontStrikeout eFontStrikeout = FONT_STRIKEOUT_NONE, + bool bWordLineMode = false, + FontEmphasisMark eFontEmphasisMark = FONT_EMPHASISMARK_NONE, + bool bEmphasisMarkAbove = true, + bool bEmphasisMarkBelow = false, + FontRelief eFontRelief = FONT_RELIEF_NONE, + bool bShadow = false, + bool bOutline = false); + + // get data + FontUnderline getFontUnderline() const { return meFontUnderline; } + FontStrikeout getFontStrikeout() const { return meFontStrikeout; } + FontEmphasisMark getFontEmphasisMark() const { return meFontEmphasisMark; } + FontRelief getFontRelief() const { return meFontRelief; } + bool getUnderlineAbove() const { return mbUnderlineAbove; } + bool getWordLineMode() const { return mbWordLineMode; } + bool getEmphasisMarkAbove() const { return mbEmphasisMarkAbove; } + bool getEmphasisMarkBelow() const { return mbEmphasisMarkBelow; } + bool getShadow() const { return mbShadow; } + bool getOutline() const { return mbOutline; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //_DRAWINGLAYER_PRIMITIVE_TEXTPRIMITIVE_HXX + +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx new file mode 100644 index 000000000000..fffee24822f7 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx @@ -0,0 +1,83 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: transformprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:03 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GROUPPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/groupprimitive2d.hxx> +#endif + +#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX +#include <basegfx/matrix/b2dhommatrix.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class TransformPrimitive2D : public GroupPrimitive2D + { + private: + basegfx::B2DHomMatrix maTransformation; + + public: + TransformPrimitive2D( + const basegfx::B2DHomMatrix& rTransformation, + const Primitive2DSequence& rChildren); + + // get data + const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx new file mode 100644 index 000000000000..334721868a71 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx @@ -0,0 +1,80 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: unifiedalphaprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:03 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDALPHAPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDALPHAPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GROUPPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/groupprimitive2d.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class UnifiedAlphaPrimitive2D : public GroupPrimitive2D + { + private: + double mfAlpha; // unified transparence + + protected: + // create decomposition + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + UnifiedAlphaPrimitive2D( + const Primitive2DSequence& rChildren, + double fAlpha); + + // get data + double getAlpha() const { return mfAlpha; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDALPHAPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx new file mode 100644 index 000000000000..e8f95c4ba9ab --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx @@ -0,0 +1,173 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: baseprimitive3d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:32:39 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_BASEPRIMITIVE3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_BASEPRIMITIVE3D_HXX + +#ifndef _CPPUHELPER_COMPBASE1_HXX_ +#include <cppuhelper/compbase1.hxx> +#endif + +#include <boost/utility.hpp> + +#ifndef _COM_SUN_STAR_GRAPHIC_XPRIMITIVE3D_HPP_ +#include <com/sun/star/graphic/XPrimitive3D.hpp> +#endif + +#ifndef _COMPHELPER_BROADCASTHELPER_HXX_ +#include <comphelper/broadcasthelper.hxx> +#endif + +#ifndef _BGFX_RANGE_B3DRANGE_HXX +#include <basegfx/range/b3drange.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// defines for Create3DPrimitiveID + +#define Create3DPrimitiveID(a, b, c, d) ((((((a << 8L)|b)<<8L)|c)<<8L)|d) + +////////////////////////////////////////////////////////////////////////////// +// basePrimitive3D class + +namespace drawinglayer +{ + namespace primitive3d + { + // typedefs for basePrimitive3DImplBase, Primitive3DSequence and Primitive3DReference + typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitive3D > BasePrimitive3DImplBase; + typedef ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive3D > Primitive3DReference; + typedef ::com::sun::star::uno::Sequence< Primitive3DReference > Primitive3DSequence; + + class BasePrimitive3D + : private boost::noncopyable, + protected comphelper::OBaseMutex, + public BasePrimitive3DImplBase + { + private: + // a sequence used for buffering the last createLocalDecomposition() result. Use + // the protected access methods to change. Only implementations of getDecomposition() + // should make use. + Primitive3DSequence maLocalDecomposition; + + protected: + // access methods to maLocalDecomposition. The usage of this methods may allow + // later thread-safe stuff to be added if needed. Only to be used by getDecomposition() + // implementations for buffering the last decomposition. + const Primitive3DSequence& getLocalDecomposition() const { return maLocalDecomposition; } + void setLocalDecomposition(const Primitive3DSequence& rNew) { maLocalDecomposition = rNew; } + + // method which is to be used to implement the local decomposition of a 2D primitive. The default + // implementation will just return an empty decomposition + virtual Primitive3DSequence createLocalDecomposition(double fTime) const; + + public: + // constructor + BasePrimitive3D(); + + // the ==operator is mainly needed to allow testing newly-created high level primitives against their last + // incarnation which buffers/holds the decompositionsThe default implementation + // uses getPrimitiveID()-calls to test if it's the same ID at last. Overloaded implementation are then + // based on this implementation + virtual bool operator==( const BasePrimitive3D& rPrimitive ) const; + bool operator!=( const BasePrimitive3D& rPrimitive ) const { return !operator==(rPrimitive); } + + // This method is for places where using the C++ implementation directly is possible. The subprocessing + // and range merging is more efficient when working directly on basegfx::B3DRange. The default implementation + // will use getDecomposition results to create the range + virtual basegfx::B3DRange getB3DRange(double fTime) const; + + // provide unique ID for fast identifying of known primitive implementations in renderers. These use + // the Create3DPrimitiveID macro to define unique IDs. The same macro is used from the renderers + // in their typical switch/case loop + virtual sal_uInt32 getPrimitiveID() const = 0; + + // The getDecomposition default implementation will on demand use createLocalDecomposition() if maLocalDecomposition is empty. + // It will set maLocalDecomposition to this obtained decomposition to buffer it. + // If the decomposition is also time-dependent, this method needs to be overloaded and the + // time for the last decomposition need to be remembered, too, and be used in the next call to decide if + // the buffered decomposition may be reused or not. + virtual Primitive3DSequence get3DDecomposition(double fTime) const; + + // + // Methods from XPrimitive3D + // + + // The getDecomposition implementation for UNO API will use getDecomposition from this implementation. It + // will get the time from the Primitive2DParameters for that purpose + virtual Primitive3DSequence SAL_CALL getDecomposition( const ::com::sun::star::graphic::Primitive3DParameters& aPrimitive2DParameters ) throw ( ::com::sun::star::uno::RuntimeException ); + + // the getRange default implemenation will use getDecomposition to create the range information from merging + // getRange results from the single local decomposition primitives. + virtual ::com::sun::star::geometry::RealRectangle3D SAL_CALL getRange( const ::com::sun::star::graphic::Primitive3DParameters& aPrimitive2DParameters ) throw ( ::com::sun::star::uno::RuntimeException ); + }; + } // end of namespace primitive3d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// tooling + +namespace drawinglayer +{ + namespace primitive3d + { + // get B3DRange from a given Primitive3DReference + basegfx::B3DRange getB3DRangeFromPrimitive3DReference(const Primitive3DReference& rCandidate, double fTime); + + // get range3D from a given Primitive3DSequence + basegfx::B3DRange getB3DRangeFromPrimitive3DSequence(const Primitive3DSequence& rCandidate, double fTime); + + // compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D) + // and using compare operator + bool arePrimitive3DReferencesEqual(const Primitive3DReference& rA, const Primitive3DReference& rB); + + // compare two Primitive3DReferences for equality, uses arePrimitive3DReferencesEqual internally + bool arePrimitive3DSequencesEqual(const Primitive3DSequence& rA, const Primitive3DSequence& rB); + + // concatenate sequence + void appendPrimitive3DSequenceToPrimitive3DSequence(Primitive3DSequence& rDest, const Primitive3DSequence& rSource); + + // concatenate single Primitive3D + void appendPrimitive3DReferenceToPrimitive3DSequence(Primitive3DSequence& rDest, const Primitive3DReference& rSource); + + } // end of namespace primitive3d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_BASEPRIMITIVE3D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx new file mode 100644 index 000000000000..aea5517fe907 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx @@ -0,0 +1,80 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: groupprimitive3d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:32:39 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_GROUPPRIMITIVE3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_GROUPPRIMITIVE3D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_BASEPRIMITIVE3D_HXX +#include <drawinglayer/primitive3d/baseprimitive3d.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive3d + { + class GroupPrimitive3D : public BasePrimitive3D + { + private: + // the children. Declared private since this shall never be changed at all after construction + Primitive3DSequence maChildren; + + protected: + // local decomposition. Implementation will just return children + virtual Primitive3DSequence createLocalDecomposition(double fTime) const; + + public: + // constructor + GroupPrimitive3D(const Primitive3DSequence& rChildren); + + // data access + Primitive3DSequence getChildren() const { return maChildren; } + + // compare operator + virtual bool operator==( const BasePrimitive3D& rPrimitive ) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive3d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_GROUPPRIMITIVE3D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx index 9e21e8cb722a..70bcc61f6a78 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: hatchtextureprimitive3d.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:38:13 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:32:39 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,10 +33,10 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX -#define _DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX -#ifndef _DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX #include <drawinglayer/primitive3d/textureprimitive3d.hxx> #endif @@ -46,40 +46,38 @@ namespace drawinglayer { namespace primitive3d { - class hatchTexturePrimitive3D : public texturePrimitive3D + class HatchTexturePrimitive3D : public TexturePrimitive3D { - protected: - attribute::fillHatchAttribute maHatch; - - // create decomposition - virtual void decompose(primitiveVector3D& rTarget); + private: + attribute::FillHatchAttribute maHatch; - // helpers - void impCreateDecomposition(const primitiveVector3D& rSource, primitiveVector3D& rDest); + protected: + // local decomposition. + virtual Primitive3DSequence createLocalDecomposition(double fTime) const; public: - hatchTexturePrimitive3D( - const attribute::fillHatchAttribute& rHatch, - const primitiveVector3D& rPrimitiveVector, + HatchTexturePrimitive3D( + const attribute::FillHatchAttribute& rHatch, + const Primitive3DSequence& rChildren, const basegfx::B2DVector& rTextureSize, bool bModulate, bool bFilter); - virtual ~hatchTexturePrimitive3D(); // get data - const attribute::fillHatchAttribute& getHatch() const { return maHatch; } + const attribute::FillHatchAttribute& getHatch() const { return maHatch; } // compare operator - virtual bool operator==(const basePrimitive3D& rPrimitive) const; + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // id generator - virtual PrimitiveID getID() const; + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; }; } // end of namespace primitive3d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif // _DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX +////////////////////////////////////////////////////////////////////////////// // eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx index 3b60baa7f6e6..bf17b19a8ecc 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: modifiedcolorprimitive3d.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:38:14 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:32:39 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,11 +33,11 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_PRIMITIVE3D_MODIFIEDCOLORPRIMITIVE3D_HXX -#define _DRAWINGLAYER_PRIMITIVE3D_MODIFIEDCOLORPRIMITIVE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_MODIFIEDCOLORPRIMITIVE3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_MODIFIEDCOLORPRIMITIVE3D_HXX -#ifndef _DRAWINGLAYER_PRIMITIVE3D_VECTORPRIMITIVE3D_HXX -#include <drawinglayer/primitive3d/vectorprimitive3d.hxx> +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_GROUPPRIMITIVE3D_HXX +#include <drawinglayer/primitive3d/groupprimitive3d.hxx> #endif #ifndef _BGFX_COLOR_BCOLORMODIFIER_HXX @@ -50,31 +50,31 @@ namespace drawinglayer { namespace primitive3d { - class modifiedColorPrimitive3D : public vectorPrimitive3D + class ModifiedColorPrimitive3D : public GroupPrimitive3D { - protected: + private: basegfx::BColorModifier maColorModifier; public: - modifiedColorPrimitive3D( - const primitiveVector3D& rPrimitiveVector, + ModifiedColorPrimitive3D( + const Primitive3DSequence& rChildren, const basegfx::BColorModifier& rColorModifier); - virtual ~modifiedColorPrimitive3D(); // get data const basegfx::BColorModifier& getColorModifier() const { return maColorModifier; } // compare operator - virtual bool operator==(const basePrimitive3D& rPrimitive) const; + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // id generator - virtual PrimitiveID getID() const; + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; }; } // end of namespace primitive3d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif //_DRAWINGLAYER_PRIMITIVE3D_MODIFIEDCOLORPRIMITIVE3D_HXX +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_MODIFIEDCOLORPRIMITIVE3D_HXX +////////////////////////////////////////////////////////////////////////////// // eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx index d75c051f41d6..5527409f5990 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: polygonprimitive3d.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:38:13 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:32:39 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,11 +33,11 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX -#define _DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX -#ifndef _DRAWINGLAYER_PRIMITIVE3D_PRIMITIVE3D_HXX -#include <drawinglayer/primitive3d/primitive3d.hxx> +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_BASEPRIMITIVE3D_HXX +#include <drawinglayer/primitive3d/baseprimitive3d.hxx> #endif #ifndef _BGFX_COLOR_BCOLOR_HXX @@ -48,41 +48,39 @@ #include <basegfx/polygon/b3dpolygon.hxx> #endif -#ifndef _DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX #include <drawinglayer/attribute/strokeattribute.hxx> #endif ////////////////////////////////////////////////////////////////////////////// -// predefines - -////////////////////////////////////////////////////////////////////////////// namespace drawinglayer { namespace primitive3d { - class polygonHairlinePrimitive3D : public basePrimitive3D + class PolygonHairlinePrimitive3D : public BasePrimitive3D { - protected: + private: basegfx::B3DPolygon maPolygon; basegfx::BColor maBColor; public: - polygonHairlinePrimitive3D(const basegfx::B3DPolygon& rPolygon, const basegfx::BColor& rBColor); - virtual ~polygonHairlinePrimitive3D(); + PolygonHairlinePrimitive3D( + const basegfx::B3DPolygon& rPolygon, + const basegfx::BColor& rBColor); // get data const basegfx::B3DPolygon& getB3DPolygon() const { return maPolygon; } const basegfx::BColor& getBColor() const { return maBColor; } // compare operator - virtual bool operator==(const basePrimitive3D& rPrimitive) const; + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // id generator - virtual PrimitiveID getID() const; + // get range + virtual basegfx::B3DRange getB3DRange(double fTime) const; - // get 3Drange of primitive. Default implementation uses decomposition - virtual basegfx::B3DRange get3DRange() const; + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; }; } // end of namespace primitive3d } // end of namespace drawinglayer @@ -93,36 +91,37 @@ namespace drawinglayer { namespace primitive3d { - class polygonStrokePrimitive3D : public basePrimitive3D + class PolygonStrokePrimitive3D : public BasePrimitive3D { - protected: + private: basegfx::B3DPolygon maPolygon; - attribute::strokeAttribute maStrokeAttribute; + attribute::StrokeAttribute maStrokeAttribute; - // create decomposition - virtual void decompose(primitiveVector3D& rTarget); + protected: + // local decomposition. + virtual Primitive3DSequence createLocalDecomposition(double fTime) const; public: - polygonStrokePrimitive3D( + PolygonStrokePrimitive3D( const basegfx::B3DPolygon& rPolygon, - const attribute::strokeAttribute& rStrokeAttribute); - virtual ~polygonStrokePrimitive3D(); + const attribute::StrokeAttribute& rStrokeAttribute); // get data basegfx::B3DPolygon getB3DPolygon() const { return maPolygon; } - const attribute::strokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; } + const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; } // compare operator - virtual bool operator==(const basePrimitive3D& rPrimitive) const; + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // id generator - virtual PrimitiveID getID() const; + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; }; } // end of namespace primitive3d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif // _DRAWINGLAYER_PRIMITIVE_POLYGONPRIMITIVE_HXX +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX +////////////////////////////////////////////////////////////////////////////// // eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx index 320ee5010749..969ae6c5b454 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: polygontubeprimitive3d.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:38:13 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:32:39 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,10 +33,10 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_PRIMITIVE3D_POLYGONTUBEPRIMITIVE3D_HXX -#define _DRAWINGLAYER_PRIMITIVE3D_POLYGONTUBEPRIMITIVE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONTUBEPRIMITIVE3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONTUBEPRIMITIVE3D_HXX -#ifndef _DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX #include <drawinglayer/primitive3d/polygonprimitive3d.hxx> #endif @@ -54,25 +54,25 @@ namespace drawinglayer { namespace primitive3d { - class polygonTubePrimitive3D : public polygonHairlinePrimitive3D + class PolygonTubePrimitive3D : public PolygonHairlinePrimitive3D { - protected: + private: double mfRadius; double mfDegreeStepWidth; double mfMiterMinimumAngle; - basegfx::tools::B2DLineJoin maLineJoin; + basegfx::tools::B2DLineJoin maLineJoin; - // create decomposition - virtual void decompose(primitiveVector3D& rTarget); + protected: + // local decomposition. + virtual Primitive3DSequence createLocalDecomposition(double fTime) const; public: - polygonTubePrimitive3D( + PolygonTubePrimitive3D( const basegfx::B3DPolygon& rPolygon, const basegfx::BColor& rBColor, double fRadius, basegfx::tools::B2DLineJoin aLineJoin, double fDegreeStepWidth = 10.0 * F_PI180, double fMiterMinimumAngle = 15.0 * F_PI180); - virtual ~polygonTubePrimitive3D(); // get data double getRadius() const { return mfRadius; } @@ -81,16 +81,17 @@ namespace drawinglayer basegfx::tools::B2DLineJoin getLineJoin() const { return maLineJoin; } // compare operator - virtual bool operator==(const basePrimitive3D& rPrimitive) const; + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // id generator - virtual PrimitiveID getID() const; + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; }; } // end of namespace primitive3d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif // _DRAWINGLAYER_PRIMITIVE3D_POLYGONTUBEPRIMITIVE3D_HXX +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONTUBEPRIMITIVE3D_HXX +////////////////////////////////////////////////////////////////////////////// // eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx index c03e78b51630..ab32cf75362a 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: polypolygonprimitive3d.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:38:13 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:32:39 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,23 +33,19 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE_HXX -#define _DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE3D_HXX -#ifndef _DRAWINGLAYER_PRIMITIVE3D_PRIMITIVE3D_HXX -#include <drawinglayer/primitive3d/primitive3d.hxx> -#endif - -#ifndef _DRAWINGLAYER_ATTRIBUTE_MATERIALATTRIBUTE3D_HXX -#include <drawinglayer/attribute/materialattribute3d.hxx> +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_BASEPRIMITIVE3D_HXX +#include <drawinglayer/primitive3d/baseprimitive3d.hxx> #endif #ifndef _BGFX_POLYGON_B3DPOLYPOLYGON_HXX #include <basegfx/polygon/b3dpolypolygon.hxx> #endif -#ifndef _DRAWINGLAYER_TEXTURE_TEXTURE_HXX -#include <drawinglayer/texture/texture.hxx> +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_MATERIALATTRIBUTE3D_HXX +#include <drawinglayer/attribute/materialattribute3d.hxx> #endif ////////////////////////////////////////////////////////////////////////////// @@ -58,41 +54,41 @@ namespace drawinglayer { namespace primitive3d { - class polyPolygonMaterialPrimitive3D : public basePrimitive3D + class PolyPolygonMaterialPrimitive3D : public BasePrimitive3D { - protected: - basegfx::B3DPolyPolygon maPolyPolygon; - attribute::materialAttribute3D maMaterial; + private: + basegfx::B3DPolyPolygon maPolyPolygon; + attribute::MaterialAttribute3D maMaterial; // bitfield unsigned mbDoubleSided : 1; public: - polyPolygonMaterialPrimitive3D( + PolyPolygonMaterialPrimitive3D( const basegfx::B3DPolyPolygon& rPolyPolygon, - const attribute::materialAttribute3D& rMaterial, + const attribute::MaterialAttribute3D& rMaterial, bool bDoubleSided); - virtual ~polyPolygonMaterialPrimitive3D(); // get data const basegfx::B3DPolyPolygon& getB3DPolyPolygon() const { return maPolyPolygon; } - const attribute::materialAttribute3D& getMaterial() const { return maMaterial; } + const attribute::MaterialAttribute3D& getMaterial() const { return maMaterial; } bool getDoubleSided() const { return mbDoubleSided; } // compare operator - virtual bool operator==(const basePrimitive3D& rPrimitive) const; + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // id generator - virtual PrimitiveID getID() const; + // get range + virtual basegfx::B3DRange getB3DRange(double fTime) const; - // get 3Drange of primitive. Default implementation uses decomposition - virtual basegfx::B3DRange get3DRange() const; + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; }; } // end of namespace primitive3d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif //_DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE_HXX +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE3D_HXX +////////////////////////////////////////////////////////////////////////////// // eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx index f74d8267f8d0..f962c00b94a0 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: sdrcubeprimitive3d.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:38:13 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:32:39 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,48 +33,47 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDRCUBEPRIMITIVE3D_HXX -#define _DRAWINGLAYER_PRIMITIVE3D_SDRCUBEPRIMITIVE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRCUBEPRIMITIVE3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRCUBEPRIMITIVE3D_HXX -#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX #include <drawinglayer/primitive3d/sdrprimitive3d.hxx> #endif ////////////////////////////////////////////////////////////////////////////// -// predefines namespace drawinglayer { namespace primitive3d { - class sdrCubePrimitive3D : public sdrPrimitive3D + class SdrCubePrimitive3D : public SdrPrimitive3D { protected: - // create decomposition - virtual void decompose(primitiveVector3D& rTarget); + // local decomposition. + virtual Primitive3DSequence createLocalDecomposition(double fTime) const; public: - sdrCubePrimitive3D( + SdrCubePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::sdrLineFillShadowAttribute& rSdrLFSAttribute, - const attribute::sdr3DObjectAttribute& rSdr3DObjectAttribute); - virtual ~sdrCubePrimitive3D(); + const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute); // compare operator - virtual bool operator==(const basePrimitive3D& rPrimitive) const; + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // id generator - virtual PrimitiveID getID() const; + // get range + virtual basegfx::B3DRange getB3DRange(double fTime) const; - // get 3D range of primitive. - virtual basegfx::B3DRange get3DRange() const; + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; }; - } // end of namespace overlay + } // end of namespace primitive3d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif //_DRAWINGLAYER_PRIMITIVE3D_SDRCUBEPRIMITIVE3D_HXX +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRCUBEPRIMITIVE3D_HXX +////////////////////////////////////////////////////////////////////////////// // eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx index c5aa63c3dac9..1d374c387e01 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: sdrdecompositiontools3d.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:38:13 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:32:40 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,11 +33,11 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDRDECOMPOSITIONTOOLS3D_HXX -#define _DRAWINGLAYER_PRIMITIVE3D_SDRDECOMPOSITIONTOOLS3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRDECOMPOSITIONTOOLS3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRDECOMPOSITIONTOOLS3D_HXX -#ifndef _DRAWINGLAYER_PRIMITIVE3D_PRIMITIVE3D_HXX -#include <drawinglayer/primitive3d/primitive3d.hxx> +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_BASEPRIMITIVE3D_HXX +#include <drawinglayer/primitive3d/baseprimitive3d.hxx> #endif #include <vector> @@ -52,11 +52,11 @@ namespace basegfx { } namespace drawinglayer { namespace attribute { - class sdrLineAttribute; - class sdrFillAttribute; - class sdr3DObjectAttribute; - class fillGradientAttribute; - class sdrShadowAttribute; + class SdrLineAttribute; + class SdrFillAttribute; + class Sdr3DObjectAttribute; + class FillGradientAttribute; + class SdrShadowAttribute; }} ////////////////////////////////////////////////////////////////////////////// @@ -65,24 +65,22 @@ namespace drawinglayer { namespace primitive3d { - void add3DPolyPolygonLinePrimitive( + Primitive3DSequence create3DPolyPolygonLinePrimitives( const basegfx::B3DPolyPolygon& rUnitPolyPolygon, const basegfx::B3DHomMatrix& rObjectTransform, - primitiveVector3D& rTarget, - const attribute::sdrLineAttribute& rLine); + const attribute::SdrLineAttribute& rLine); - void add3DPolyPolygonFillPrimitive( + Primitive3DSequence create3DPolyPolygonFillPrimitives( const ::std::vector< basegfx::B3DPolyPolygon >& r3DPolyPolygonVector, const basegfx::B3DHomMatrix& rObjectTransform, const basegfx::B2DVector& rTextureSize, - primitiveVector3D& rTarget, - const attribute::sdr3DObjectAttribute& aSdr3DObjectAttribute, - const attribute::sdrFillAttribute& rFill, - const attribute::fillGradientAttribute* pFillGradient = 0L); + const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute, + const attribute::SdrFillAttribute& rFill, + const attribute::FillGradientAttribute* pFillGradient = 0L); - void addShadowPrimitive3D( - primitiveVector3D& rTarget, - const attribute::sdrShadowAttribute& rShadow, + Primitive3DSequence createShadowPrimitive3D( + const Primitive3DSequence& rSource, + const attribute::SdrShadowAttribute& rShadow, bool bShadow3D); } // end of namespace overlay } // end of namespace drawinglayer diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx index c1a6f49027df..af9ad13932ef 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: sdrextrudelathetools3d.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:38:14 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:32:40 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,10 +33,8 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDELATHETOOLS3D_HXX -#define _DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDELATHETOOLS3D_HXX - -#include <vector> +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDELATHETOOLS3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDELATHETOOLS3D_HXX #ifndef _BGFX_POLYGON_B3DPOLYPOLYGON_HXX #include <basegfx/polygon/b3dpolypolygon.hxx> @@ -46,6 +44,8 @@ #include <basegfx/polygon/b2dpolypolygontools.hxx> #endif +#include <vector> + ////////////////////////////////////////////////////////////////////////////// // predefines @@ -55,30 +55,35 @@ namespace drawinglayer { namespace primitive3d { - // slice types - enum sliceType + // Slice3D types + enum SliceType3D { - SLICETYPE_REGULAR, // normal geoemtry slice - SLICETYPE_FRONTCAP, // front cap - SLICETYPE_BACKCAP // back cap + SLICETYPE3D_REGULAR, // normal geoemtry Slice3D + SLICETYPE3D_FRONTCAP, // front cap + SLICETYPE3D_BACKCAP // back cap }; - // class to hold one 3D slice - class slice + // class to hold one Slice3D + class Slice3D { protected: basegfx::B3DPolyPolygon maPolyPolygon; - sliceType maSliceType; + SliceType3D maSliceType; public: - slice(const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::B3DHomMatrix& aTransform, sliceType aSliceType = SLICETYPE_REGULAR) + Slice3D( + const basegfx::B2DPolyPolygon& rPolyPolygon, + const basegfx::B3DHomMatrix& aTransform, + SliceType3D aSliceType = SLICETYPE3D_REGULAR) : maPolyPolygon(basegfx::tools::createB3DPolyPolygonFromB2DPolyPolygon(rPolyPolygon)), maSliceType(aSliceType) { maPolyPolygon.transform(aTransform); } - slice(const basegfx::B3DPolyPolygon& rPolyPolygon, sliceType aSliceType = SLICETYPE_REGULAR) + Slice3D( + const basegfx::B3DPolyPolygon& rPolyPolygon, + SliceType3D aSliceType = SLICETYPE3D_REGULAR) : maPolyPolygon(rPolyPolygon), maSliceType(aSliceType) { @@ -86,25 +91,52 @@ namespace drawinglayer // data access const basegfx::B3DPolyPolygon& getB3DPolyPolygon() const { return maPolyPolygon; } - sliceType getSliceType() const { return maSliceType; } + SliceType3D getSliceType() const { return maSliceType; } }; - // typedef for a group of slices - typedef ::std::vector< slice > sliceVector; + // typedef for a group of Slice3Ds + typedef ::std::vector< Slice3D > Slice3DVector; // helpers for creation - void createLatheSlices(sliceVector& rSliceVector, const basegfx::B2DPolyPolygon& rSource, - double fBackScale, double fDiagonal, double fRotation, sal_uInt32 nSteps, - bool bCharacterMode, bool bCloseFront, bool bCloseBack); - void createExtrudeSlices(sliceVector& rSliceVector, const basegfx::B2DPolyPolygon& rSource, - double fBackScale, double fDiagonal, double fDepth, - bool bCharacterMode, bool bCloseFront, bool bCloseBack); + void createLatheSlices( + Slice3DVector& rSliceVector, + const basegfx::B2DPolyPolygon& rSource, + double fBackScale, + double fDiagonal, + double fRotation, + sal_uInt32 nSteps, + bool bCharacterMode, + bool bCloseFront, + bool bCloseBack); + + void createExtrudeSlices( + Slice3DVector& rSliceVector, + const basegfx::B2DPolyPolygon& rSource, + double fBackScale, + double fDiagonal, + double fDepth, + bool bCharacterMode, + bool bCloseFront, + bool bCloseBack); // helpers for geometry extraction - void extractLinesFromSlice(basegfx::B3DPolyPolygon& rLine, const sliceVector& rSliceVector, bool bClosed); - void extractPlanesFromSlice(::std::vector< basegfx::B3DPolyPolygon >& rFill, const sliceVector& rSliceVector, - bool bCreateNormals, bool bSmoothHorizontalNormals, bool bSmoothNormals, bool bSmoothLids, bool bClosed, - double fSmoothNormalsMix, double fSmoothLidsMix, bool bCreateTextureCoordinates, const basegfx::B2DHomMatrix& rTexTransform); + void extractLinesFromSlice( + basegfx::B3DPolyPolygon& rLine, + const Slice3DVector& rSliceVector, + bool bClosed); + + void extractPlanesFromSlice( + ::std::vector< basegfx::B3DPolyPolygon >& rFill, + const Slice3DVector& rSliceVector, + bool bCreateNormals, + bool bSmoothHorizontalNormals, + bool bSmoothNormals, + bool bSmoothLids, + bool bClosed, + double fSmoothNormalsMix, + double fSmoothLidsMix, + bool bCreateTextureCoordinates, + const basegfx::B2DHomMatrix& rTexTransform); } // end of namespace overlay } // end of namespace drawinglayer diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx index 7b0a4df0bf6b..9b6787079b8a 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: sdrextrudeprimitive3d.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:38:13 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:32:40 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,10 +33,10 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDEPRIMITIVE3D_HXX -#define _DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDEPRIMITIVE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDEPRIMITIVE3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDEPRIMITIVE3D_HXX -#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX #include <drawinglayer/primitive3d/sdrprimitive3d.hxx> #endif @@ -45,26 +45,20 @@ #endif ////////////////////////////////////////////////////////////////////////////// -// predefines - -////////////////////////////////////////////////////////////////////////////// namespace drawinglayer { namespace primitive3d { - class sdrExtrudePrimitive3D : public sdrPrimitive3D + class SdrExtrudePrimitive3D : public SdrPrimitive3D { private: - // create slices - void impCreateSlices(); - // geometry helper for slices - basegfx::B2DPolyPolygon maCorrectedPolyPolygon; - sliceVector maSlices; + basegfx::B2DPolyPolygon maCorrectedPolyPolygon; + Slice3DVector maSlices; - protected: - basegfx::B2DPolyPolygon maPolyPolygon; + // primitive data + basegfx::B2DPolyPolygon maPolyPolygon; double mfDepth; double mfDiagonal; double mfBackScale; @@ -77,18 +71,22 @@ namespace drawinglayer unsigned mbCloseFront : 1; unsigned mbCloseBack : 1; - // create decomposition - virtual void decompose(primitiveVector3D& rTarget); + // create slices + void impCreateSlices(); // get (evtl. create) slices - const sliceVector& getSlices() const; + const Slice3DVector& getSlices() const; + + protected: + // local decomposition. + virtual Primitive3DSequence createLocalDecomposition(double fTime) const; public: - sdrExtrudePrimitive3D( + SdrExtrudePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::sdrLineFillShadowAttribute& rSdrLFSAttribute, - const attribute::sdr3DObjectAttribute& rSdr3DObjectAttribute, + const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute, const basegfx::B2DPolyPolygon& rPolyPolygon, double fDepth, double fDiagonal, @@ -99,16 +97,6 @@ namespace drawinglayer bool bCharacterMode, bool bCloseFront, bool bCloseBack); - virtual ~sdrExtrudePrimitive3D(); - - // compare operator - virtual bool operator==(const basePrimitive3D& rPrimitive) const; - - // id generator - virtual PrimitiveID getID() const; - - // get 3D range of primitive. - virtual basegfx::B3DRange get3DRange() const; // data access const basegfx::B2DPolyPolygon& getPolyPolygon() const { return maPolyPolygon; } @@ -121,12 +109,22 @@ namespace drawinglayer bool getCharacterMode() const { return mbCharacterMode; } bool getCloseFront() const { return mbCloseFront; } bool getCloseBack() const { return mbCloseBack; } + + // compare operator + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; + + // get range + virtual basegfx::B3DRange getB3DRange(double fTime) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; }; - } // end of namespace overlay + } // end of namespace primitive3d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif //_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDEPRIMITIVE3D_HXX +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDEPRIMITIVE3D_HXX +////////////////////////////////////////////////////////////////////////////// // eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx index 88f2f9cff114..9567612b6b6c 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: sdrlatheprimitive3d.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:38:12 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:32:40 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,10 +33,10 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDRLATHEPRIMITIVE3D_HXX -#define _DRAWINGLAYER_PRIMITIVE3D_SDRLATHEPRIMITIVE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRLATHEPRIMITIVE3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRLATHEPRIMITIVE3D_HXX -#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX #include <drawinglayer/primitive3d/sdrprimitive3d.hxx> #endif @@ -45,25 +45,19 @@ #endif ////////////////////////////////////////////////////////////////////////////// -// predefines - -////////////////////////////////////////////////////////////////////////////// namespace drawinglayer { namespace primitive3d { - class sdrLathePrimitive3D : public sdrPrimitive3D + class SdrLathePrimitive3D : public SdrPrimitive3D { private: - // create slices - void impCreateSlices(); - // geometry helper for slices - sliceVector maSlices; + Slice3DVector maSlices; - protected: - basegfx::B2DPolyPolygon maPolyPolygon; + // primitive data + basegfx::B2DPolyPolygon maPolyPolygon; sal_uInt32 mnHorizontalSegments; sal_uInt32 mnVerticalSegments; double mfDiagonal; @@ -78,18 +72,22 @@ namespace drawinglayer unsigned mbCloseFront : 1; unsigned mbCloseBack : 1; - // create decomposition - virtual void decompose(primitiveVector3D& rTarget); + // create slices + void impCreateSlices(); // get (evtl. create) slices - const sliceVector& getSlices() const; + const Slice3DVector& getSlices() const; + + protected: + // local decomposition. + virtual Primitive3DSequence createLocalDecomposition(double fTime) const; public: - sdrLathePrimitive3D( + SdrLathePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::sdrLineFillShadowAttribute& rSdrLFSAttribute, - const attribute::sdr3DObjectAttribute& rSdr3DObjectAttribute, + const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute, const basegfx::B2DPolyPolygon& rPolyPolygon, sal_uInt32 nHorizontalSegments, sal_uInt32 nVerticalSegments, @@ -102,21 +100,11 @@ namespace drawinglayer bool bCharacterMode, bool bCloseFront, bool bCloseBack); - virtual ~sdrLathePrimitive3D(); - - // compare operator - virtual bool operator==(const basePrimitive3D& rPrimitive) const; - - // id generator - virtual PrimitiveID getID() const; - - // get 3D range of primitive. - virtual basegfx::B3DRange get3DRange() const; // data access const basegfx::B2DPolyPolygon& getPolyPolygon() const { return maPolyPolygon; } sal_uInt32 getHorizontalSegments() const { return mnHorizontalSegments; } - sal_uInt32 getVerticalSegments() const { return mnVerticalSegments ; } + sal_uInt32 getVerticalSegments() const { return mnVerticalSegments; } double getDiagonal() const { return mfDiagonal; } double getBackScale() const { return mfBackScale; } double getRotation() const { return mfRotation; } @@ -126,12 +114,22 @@ namespace drawinglayer bool getCharacterMode() const { return mbCharacterMode; } bool getCloseFront() const { return mbCloseFront; } bool getCloseBack() const { return mbCloseBack; } + + // compare operator + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; + + // get range + virtual basegfx::B3DRange getB3DRange(double fTime) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; }; - } // end of namespace overlay + } // end of namespace primitive3d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif //_DRAWINGLAYER_PRIMITIVE3D_SDRLATHEPRIMITIVE3D_HXX +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRLATHEPRIMITIVE3D_HXX +////////////////////////////////////////////////////////////////////////////// // eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx new file mode 100644 index 000000000000..6b47aeaf0b40 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx @@ -0,0 +1,84 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sdrpolypolygonprimitive3d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:32:40 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPOLYPOLYGONPRIMITIVE3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPOLYPOLYGONPRIMITIVE3D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX +#include <drawinglayer/primitive3d/sdrprimitive3d.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive3d + { + class SdrPolyPolygonPrimitive3D : public SdrPrimitive3D + { + private: + // the polyPolygon evtl with normals and texture coordinates + basegfx::B3DPolyPolygon maPolyPolygon3D; + + protected: + // local decomposition. + virtual Primitive3DSequence createLocalDecomposition(double fTime) const; + + public: + SdrPolyPolygonPrimitive3D( + const basegfx::B3DPolyPolygon& rPolyPolygon3D, + const basegfx::B3DHomMatrix& rTransform, + const basegfx::B2DVector& rTextureSize, + const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute); + + // data access + const basegfx::B3DPolyPolygon& getPolyPolygon3D() const { return maPolyPolygon3D; } + + // compare operator + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; + + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; + }; + } // end of namespace primitive3d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPOLYPOLYGONPRIMITIVE3D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx index d0d98f373a38..23273ce761f2 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: sdrprimitive3d.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:38:13 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:32:40 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,35 +33,32 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX -#define _DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX -#ifndef _DRAWINGLAYER_PRIMITIVE3D_PRIMITIVE3D_HXX -#include <drawinglayer/primitive3d/primitive3d.hxx> +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_BASEPRIMITIVE3D_HXX +#include <drawinglayer/primitive3d/baseprimitive3d.hxx> #endif #ifndef _BGFX_MATRIX_B3DHOMMATRIX_HXX #include <basegfx/matrix/b3dhommatrix.hxx> #endif -#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX -#include <drawinglayer/attribute/sdrallattribute3d.hxx> -#endif - -#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX -#include <drawinglayer/attribute/sdrattribute.hxx> +#ifndef _BGFX_VECTOR_B2DVECTOR_HXX +#include <basegfx/vector/b2dvector.hxx> #endif -#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDELATHETOOLS3D_HXX -#include <drawinglayer/primitive3d/sdrextrudelathetools3d.hxx> +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX +#include <drawinglayer/attribute/sdrallattribute3d.hxx> #endif -#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX #include <drawinglayer/attribute/sdrattribute3d.hxx> #endif -////////////////////////////////////////////////////////////////////////////// -// predefines +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDELATHETOOLS3D_HXX +#include <drawinglayer/primitive3d/sdrextrudelathetools3d.hxx> +#endif ////////////////////////////////////////////////////////////////////////////// @@ -69,44 +66,45 @@ namespace drawinglayer { namespace primitive3d { - class sdrPrimitive3D : public basePrimitive3D + class SdrPrimitive3D : public BasePrimitive3D { - protected: + private: basegfx::B3DHomMatrix maTransform; - basegfx::B2DVector maTextureSize; - attribute::sdrLineFillShadowAttribute maSdrLFSAttribute; - attribute::sdr3DObjectAttribute maSdr3DObjectAttribute; + basegfx::B2DVector maTextureSize; + attribute::SdrLineFillShadowAttribute maSdrLFSAttribute; + attribute::Sdr3DObjectAttribute maSdr3DObjectAttribute; + protected: // Standard implementation for primitive3D which // will use maTransform as range and expand by evtl. line width / 2 basegfx::B3DRange getStandard3DRange() const; // implementation for primitive3D which - // will use given slices and expand by evtl. line width / 2 - basegfx::B3DRange get3DRangeFromSlices(const sliceVector& rSlices) const; + // will use given Slice3Ds and expand by evtl. line width / 2 + basegfx::B3DRange get3DRangeFromSlices(const Slice3DVector& rSlices) const; public: - sdrPrimitive3D( + SdrPrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::sdrLineFillShadowAttribute& rSdrLFSAttribute, - const attribute::sdr3DObjectAttribute& rSdr3DObjectAttribute); - virtual ~sdrPrimitive3D(); - - // compare operator - virtual bool operator==(const basePrimitive3D& rPrimitive) const; + const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute); // data access const basegfx::B3DHomMatrix& getTransform() const { return maTransform; } const basegfx::B2DVector& getTextureSize() const { return maTextureSize; } - const attribute::sdrLineFillShadowAttribute& getSdrLFSAttribute() const { return maSdrLFSAttribute; } - const attribute::sdr3DObjectAttribute getSdr3DObjectAttribute() const { return maSdr3DObjectAttribute; } + const attribute::SdrLineFillShadowAttribute& getSdrLFSAttribute() const { return maSdrLFSAttribute; } + const attribute::Sdr3DObjectAttribute getSdr3DObjectAttribute() const { return maSdr3DObjectAttribute; } + + // compare operator + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; }; - } // end of namespace overlay + } // end of namespace primitive3d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif //_DRAWINGLAYER_PRIMITIVE3D_SDRCUBEPRIMITIVE3D_HXX +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX +////////////////////////////////////////////////////////////////////////////// // eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx index 5f4302b0b5d2..9773d8c4e8c7 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: sdrsphereprimitive3d.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:38:13 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:32:40 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,58 +33,57 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDRSPHEREPRIMITIVE3D_HXX -#define _DRAWINGLAYER_PRIMITIVE3D_SDRSPHEREPRIMITIVE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRSPHEREPRIMITIVE3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRSPHEREPRIMITIVE3D_HXX -#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX #include <drawinglayer/primitive3d/sdrprimitive3d.hxx> #endif ////////////////////////////////////////////////////////////////////////////// -// predefines - -////////////////////////////////////////////////////////////////////////////// namespace drawinglayer { namespace primitive3d { - class sdrSpherePrimitive3D : public sdrPrimitive3D + class SdrSpherePrimitive3D : public SdrPrimitive3D { - protected: + private: sal_uInt32 mnHorizontalSegments; sal_uInt32 mnVerticalSegments; - // create decomposition - virtual void decompose(primitiveVector3D& rTarget); + protected: + // local decomposition. + virtual Primitive3DSequence createLocalDecomposition(double fTime) const; public: - sdrSpherePrimitive3D( + SdrSpherePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::sdrLineFillShadowAttribute& rSdrLFSAttribute, - const attribute::sdr3DObjectAttribute& rSdr3DObjectAttribute, - sal_uInt32 nHorizontalSegments, sal_uInt32 nVerticalSegments); - virtual ~sdrSpherePrimitive3D(); + const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute, + sal_uInt32 nHorizontalSegments, + sal_uInt32 nVerticalSegments); - // compare operator - virtual bool operator==(const basePrimitive3D& rPrimitive) const; + // data access + sal_uInt32 getHorizontalSegments() const { return mnHorizontalSegments; } + sal_uInt32 getVerticalSegments() const { return mnVerticalSegments; } - // id generator - virtual PrimitiveID getID() const; + // compare operator + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // get 3D range of primitive. - virtual basegfx::B3DRange get3DRange() const; + // get range + virtual basegfx::B3DRange getB3DRange(double fTime) const; - // data access - sal_uInt32 getHorizontalSegments() const { return mnHorizontalSegments; } - sal_uInt32 getVerticalSegments() const { return mnVerticalSegments ; } + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; }; - } // end of namespace overlay + } // end of namespace primitive3d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif //_DRAWINGLAYER_PRIMITIVE3D_SDRSPHEREPRIMITIVE3D_HXX +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRSPHEREPRIMITIVE3D_HXX +////////////////////////////////////////////////////////////////////////////// // eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx index f25e2c1da32e..bea22f95be18 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: shadowprimitive3d.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:38:14 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:32:40 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,11 +33,11 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX -#define _DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX -#ifndef _DRAWINGLAYER_PRIMITIVE3D_VECTORPRIMITIVE3D_HXX -#include <drawinglayer/primitive3d/vectorprimitive3d.hxx> +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_GROUPPRIMITIVE3D_HXX +#include <drawinglayer/primitive3d/groupprimitive3d.hxx> #endif #ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX @@ -54,21 +54,23 @@ namespace drawinglayer { namespace primitive3d { - class shadowPrimitive3D : public vectorPrimitive3D + class ShadowPrimitive3D : public GroupPrimitive3D { protected: - basegfx::B2DHomMatrix maShadowTransform; + basegfx::B2DHomMatrix maShadowTransform; basegfx::BColor maShadowColor; - double mfShadowTransparence; + double mfShadowTransparence; // bitfield - unsigned mbShadow3D : 1; + unsigned mbShadow3D : 1; public: - shadowPrimitive3D( - const basegfx::B2DHomMatrix& rShadowTransform, const basegfx::BColor& rShadowColor, - double fShadowTransparence, bool bShadow3D, const primitiveVector3D& rPrimitiveVector); - virtual ~shadowPrimitive3D(); + ShadowPrimitive3D( + const basegfx::B2DHomMatrix& rShadowTransform, + const basegfx::BColor& rShadowColor, + double fShadowTransparence, + bool bShadow3D, + const Primitive3DSequence& rChildren); // get data const basegfx::B2DHomMatrix& getShadowTransform() const { return maShadowTransform; } @@ -77,16 +79,17 @@ namespace drawinglayer bool getShadow3D() const { return mbShadow3D; } // compare operator - virtual bool operator==(const basePrimitive3D& rPrimitive) const; + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // id generator - virtual PrimitiveID getID() const; + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; }; } // end of namespace primitive3d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif // _DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX +////////////////////////////////////////////////////////////////////////////// // eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx index 3d65319f4d7f..67a96149775f 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: textureprimitive3d.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:38:13 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:32:40 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,18 +33,18 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX -#define _DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX -#ifndef _DRAWINGLAYER_PRIMITIVE3D_VECTORPRIMITIVE3D_HXX -#include <drawinglayer/primitive3d/vectorprimitive3d.hxx> +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_GROUPPRIMITIVE3D_HXX +#include <drawinglayer/primitive3d/groupprimitive3d.hxx> #endif -#ifndef _DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX #include <drawinglayer/attribute/fillattribute.hxx> #endif -#ifndef _DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX #include <drawinglayer/attribute/fillbitmapattribute.hxx> #endif @@ -58,10 +58,10 @@ namespace drawinglayer { namespace primitive3d { - class texturePrimitive3D : public vectorPrimitive3D + class TexturePrimitive3D : public GroupPrimitive3D { - protected: - basegfx::B2DVector maTextureSize; + private: + basegfx::B2DVector maTextureSize; // bitfield // flag if texture shall be modulated with white interpolated color @@ -71,12 +71,11 @@ namespace drawinglayer unsigned mbFilter : 1; public: - texturePrimitive3D( - const primitiveVector3D& rPrimitiveVector, + TexturePrimitive3D( + const Primitive3DSequence& rChildren, const basegfx::B2DVector& rTextureSize, bool bModulate, bool bFilter); - virtual ~texturePrimitive3D(); // get data const basegfx::B2DVector& getTextureSize() const { return maTextureSize; } @@ -84,7 +83,7 @@ namespace drawinglayer bool getFilter() const { return mbFilter; } // compare operator - virtual bool operator==(const basePrimitive3D& rPrimitive) const; + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; }; } // end of namespace primitive3d } // end of namespace drawinglayer @@ -95,28 +94,28 @@ namespace drawinglayer { namespace primitive3d { - class simpleTransparenceTexturePrimitive3D : public texturePrimitive3D + class UnifiedAlphaTexturePrimitive3D : public TexturePrimitive3D { - protected: + private: double mfTransparence; - // create decomposition - virtual void decompose(primitiveVector3D& rTarget); + protected: + // local decomposition. + virtual Primitive3DSequence createLocalDecomposition(double fTime) const; public: - simpleTransparenceTexturePrimitive3D( + UnifiedAlphaTexturePrimitive3D( double fTransparence, - const primitiveVector3D& rPrimitiveVector); - virtual ~simpleTransparenceTexturePrimitive3D(); + const Primitive3DSequence& rChildren); // get data double getTransparence() const { return mfTransparence; } // compare operator - virtual bool operator==(const basePrimitive3D& rPrimitive) const; + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // id generator - virtual PrimitiveID getID() const; + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; }; } // end of namespace primitive3d } // end of namespace drawinglayer @@ -127,31 +126,31 @@ namespace drawinglayer { namespace primitive3d { - class gradientTexturePrimitive3D : public texturePrimitive3D + class GradientTexturePrimitive3D : public TexturePrimitive3D { - protected: - attribute::fillGradientAttribute maGradient; + private: + attribute::FillGradientAttribute maGradient; - // create decomposition - virtual void decompose(primitiveVector3D& rTarget); + protected: + // local decomposition. + virtual Primitive3DSequence createLocalDecomposition(double fTime) const; public: - gradientTexturePrimitive3D( - const attribute::fillGradientAttribute& rGradient, - const primitiveVector3D& rPrimitiveVector, + GradientTexturePrimitive3D( + const attribute::FillGradientAttribute& rGradient, + const Primitive3DSequence& rChildren, const basegfx::B2DVector& rTextureSize, bool bModulate, bool bFilter); - virtual ~gradientTexturePrimitive3D(); // get data - const attribute::fillGradientAttribute& getGradient() const { return maGradient; } + const attribute::FillGradientAttribute& getGradient() const { return maGradient; } // compare operator - virtual bool operator==(const basePrimitive3D& rPrimitive) const; + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // id generator - virtual PrimitiveID getID() const; + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; }; } // end of namespace primitive3d } // end of namespace drawinglayer @@ -162,31 +161,31 @@ namespace drawinglayer { namespace primitive3d { - class bitmapTexturePrimitive3D : public texturePrimitive3D + class BitmapTexturePrimitive3D : public TexturePrimitive3D { - protected: - attribute::fillBitmapAttribute maBitmap; + private: + attribute::FillBitmapAttribute maBitmap; - // create decomposition - virtual void decompose(primitiveVector3D& rTarget); + protected: + // local decomposition. + virtual Primitive3DSequence createLocalDecomposition(double fTime) const; public: - bitmapTexturePrimitive3D( - const attribute::fillBitmapAttribute& rBitmap, - const primitiveVector3D& rPrimitiveVector, + BitmapTexturePrimitive3D( + const attribute::FillBitmapAttribute& rBitmap, + const Primitive3DSequence& rChildren, const basegfx::B2DVector& rTextureSize, bool bModulate, bool bFilter); - virtual ~bitmapTexturePrimitive3D(); // get data - const attribute::fillBitmapAttribute& getBitmap() const { return maBitmap; } + const attribute::FillBitmapAttribute& getBitmap() const { return maBitmap; } // compare operator - virtual bool operator==(const basePrimitive3D& rPrimitive) const; + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // id generator - virtual PrimitiveID getID() const; + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; }; } // end of namespace primitive3d } // end of namespace drawinglayer @@ -197,26 +196,26 @@ namespace drawinglayer { namespace primitive3d { - class transparenceTexturePrimitive3D : public gradientTexturePrimitive3D + class AlphaTexturePrimitive3D : public GradientTexturePrimitive3D { public: - transparenceTexturePrimitive3D( - const attribute::fillGradientAttribute& rGradient, - const primitiveVector3D& rPrimitiveVector, + AlphaTexturePrimitive3D( + const attribute::FillGradientAttribute& rGradient, + const Primitive3DSequence& rChildren, const basegfx::B2DVector& rTextureSize); - virtual ~transparenceTexturePrimitive3D(); // compare operator - virtual bool operator==(const basePrimitive3D& rPrimitive) const; + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // id generator - virtual PrimitiveID getID() const; + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; }; } // end of namespace primitive3d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif // _DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX +////////////////////////////////////////////////////////////////////////////// // eof diff --git a/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx index ad8ea2b2648b..e75340b22638 100644 --- a/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: transformprimitive3d.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:38:14 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:32:41 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,11 +33,11 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_PRIMITIVE3D_TRANSFORMPRIMITIVE3D_HXX -#define _DRAWINGLAYER_PRIMITIVE3D_TRANSFORMPRIMITIVE3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TRANSFORMPRIMITIVE3D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TRANSFORMPRIMITIVE3D_HXX -#ifndef _DRAWINGLAYER_PRIMITIVE3D_VECTORPRIMITIVE3D_HXX -#include <drawinglayer/primitive3d/vectorprimitive3d.hxx> +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_GROUPPRIMITIVE3D_HXX +#include <drawinglayer/primitive3d/groupprimitive3d.hxx> #endif #ifndef _BGFX_MATRIX_B3DHOMMATRIX_HXX @@ -50,32 +50,34 @@ namespace drawinglayer { namespace primitive3d { - class transformPrimitive3D : public vectorPrimitive3D + class TransformPrimitive3D : public GroupPrimitive3D { - protected: + private: basegfx::B3DHomMatrix maTransformation; public: - transformPrimitive3D(const basegfx::B3DHomMatrix& rTransformation, const primitiveVector3D& rPrimitiveVector); - virtual ~transformPrimitive3D(); + TransformPrimitive3D( + const basegfx::B3DHomMatrix& rTransformation, + const Primitive3DSequence& rChildren); // get data const basegfx::B3DHomMatrix& getTransformation() const { return maTransformation; } // compare operator - virtual bool operator==(const basePrimitive3D& rPrimitive) const; + virtual bool operator==(const BasePrimitive3D& rPrimitive) const; - // id generator - virtual PrimitiveID getID() const; + // get range + virtual basegfx::B3DRange getB3DRange(double fTime) const; - // get 3D range of primitive (for 3D geometries). Default implementation uses decomposition, analog to getRange - virtual basegfx::B3DRange get3DRange() const; + // provide unique ID + virtual sal_uInt32 getPrimitiveID() const; }; } // end of namespace primitive3d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// -#endif //_DRAWINGLAYER_PRIMITIVE3D_TRANSFORMPRIMITIVE3D_HXX +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TRANSFORMPRIMITIVE3D_HXX +////////////////////////////////////////////////////////////////////////////// // eof diff --git a/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx new file mode 100644 index 000000000000..b21dc9682729 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx @@ -0,0 +1,109 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: baseprocessor2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:25 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_BASEPROCESSOR2D_HXX +#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_BASEPROCESSOR2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#endif + +#ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX +#include <drawinglayer/geometry/viewinformation2d.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace processor2d + { + class BaseProcessor2D + { + protected: + geometry::ViewInformation2D maViewInformation2D; + + public: + BaseProcessor2D(const geometry::ViewInformation2D& rViewInformation); + virtual ~BaseProcessor2D(); + + // the central processing method + virtual void process(const primitive2d::Primitive2DSequence& rSource) = 0; + + // data access + const geometry::ViewInformation2D& getViewInformation2D() const { return maViewInformation2D; } + }; + } // end of namespace processor2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace processor2d + { + class CollectingProcessor2D : public BaseProcessor2D + { + private: + primitive2d::Primitive2DSequence maPrimitiveSequence; + + public: + CollectingProcessor2D(const geometry::ViewInformation2D& rViewInformation); + + // the central processing method + virtual void process(const primitive2d::Primitive2DSequence& rSource); + + // helpers for adding to local sequence + void appendPrimitive2DSequence(const primitive2d::Primitive2DSequence& rSource) + { + primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(maPrimitiveSequence, rSource); + } + + void appendPrimitive2DReference(const primitive2d::Primitive2DReference& rSource) + { + primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(maPrimitiveSequence, rSource); + } + + // data access + const primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitiveSequence; } + }; + } // end of namespace processor2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PROCESSOR2D_BASEPROCESSOR2D_HXX + +// eof diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx new file mode 100644 index 000000000000..842dea1e7caa --- /dev/null +++ b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx @@ -0,0 +1,127 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclprocessor2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2006-10-19 10:28:25 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLPROCESSOR2D_HXX +#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLPROCESSOR2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_BASEPROCESSOR2D_HXX +#include <drawinglayer/processor2d/baseprocessor2d.hxx> +#endif + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx> +#endif + +#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX +#include <basegfx/matrix/b2dhommatrix.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// predefines +class OutputDevice; + +namespace basegfx { + class BColor; +} + +namespace drawinglayer { namespace primitive2d { + class TextSimplePortionPrimitive2D; + class PolygonHairlinePrimitive2D; + class BitmapPrimitive2D; + class FillBitmapPrimitive2D; + class PolyPolygonGradientPrimitive2D; + class PolyPolygonColorPrimitive2D; + class MetafilePrimitive2D; + class MaskPrimitive2D; + class AlphaPrimitive2D; + class TransformPrimitive2D; + class MarkerPrimitive2D; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace processor2d + { + class VclProcessor2D : public BaseProcessor2D + { + protected: + // the destination OutDev + OutputDevice* mpOutputDevice; + + // the modifiedColorPrimitive stack + basegfx::BColorModifierStack maBColorModifierStack; + + // the current transformation + basegfx::B2DHomMatrix maCurrentTransformation; + + // bitfield + // flag to hold info if output of given OutDev goes to metafile + unsigned mbOutputToRecordingMetaFile : 1; + + ////////////////////////////////////////////////////////////////////////////// + // rendering support + void RenderTextSimplePortionPrimitive2D(const primitive2d::TextSimplePortionPrimitive2D& rTextCandidate); + void RenderPolygonHairlinePrimitive2D(const primitive2d::PolygonHairlinePrimitive2D& rPolygonCandidate); + void RenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate); + void RenderFillBitmapPrimitive2D(const primitive2d::FillBitmapPrimitive2D& rFillBitmapCandidate); + void RenderPolyPolygonGradientPrimitive2D(const primitive2d::PolyPolygonGradientPrimitive2D& rPolygonCandidate); + void RenderPolyPolygonColorPrimitive2D(const primitive2d::PolyPolygonColorPrimitive2D& rPolygonCandidate); + void RenderMetafilePrimitive2D(const primitive2d::MetafilePrimitive2D& rPolygonCandidate); + void RenderMaskPrimitive2D(const primitive2d::MaskPrimitive2D& rMaskCandidate); + void RenderModifiedColorPrimitive2D(const primitive2d::ModifiedColorPrimitive2D& rModifiedCandidate); + void RenderAlphaPrimitive2D(const primitive2d::AlphaPrimitive2D& rTransCandidate); + void RenderTransformPrimitive2D(const primitive2d::TransformPrimitive2D& rTransformCandidate); + void RenderMarkerPrimitive2D(const primitive2d::MarkerPrimitive2D& rTransCandidate); + + public: + // constructor/destructor + VclProcessor2D( + const geometry::ViewInformation2D& rViewInformation, + OutputDevice& rOutDev); + virtual ~VclProcessor2D(); + + // the central processing method + virtual void process(const primitive2d::Primitive2DSequence& rSource); + }; + } // end of namespace processor2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif // INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLPROCESSOR2D_HXX + +// eof diff --git a/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx index d34d76cf0f01..3dc0ef43eff8 100644 --- a/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx +++ b/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: baseprocessor3d.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:45:32 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:33:20 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,49 +33,33 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_PROCESSOR3D_BASEPROCESSOR3D_HXX -#define _DRAWINGLAYER_PROCESSOR3D_BASEPROCESSOR3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_BASEPROCESSOR3D_HXX +#define INCLUDED_DRAWINGLAYER_PROCESSOR3D_BASEPROCESSOR3D_HXX -#ifndef _DRAWINGLAYER_GEOMETRY_VIEWINFORMATION_HXX -#include <drawinglayer/geometry/viewinformation.hxx> -#endif - -#ifndef _DRAWINGLAYER_GEOMETRY_TRANSFORMATION3D_HXX -#include <drawinglayer/geometry/transformation3d.hxx> -#endif - -#ifndef _DRAWINGLAYER_PRIMITIVE3D_PRIMITIVE3D_HXX -#include <drawinglayer/primitive3d/primitive3d.hxx> +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_BASEPRIMITIVE3D_HXX +#include <drawinglayer/primitive3d/baseprimitive3d.hxx> #endif ////////////////////////////////////////////////////////////////////////////// -// predefines - -////////////////////////////////////////////////////////////////////////////// namespace drawinglayer { namespace processor3d { - class baseProcessor3D + class BaseProcessor3D { - protected: - // the view information and the complete 3d stack - const geometry::viewInformation maViewInformation; - const geometry::transformation3D maTransformation3D; + private: + double mfTime; public: - baseProcessor3D( - const geometry::viewInformation& rViewInformation, - const geometry::transformation3D& rTransformation3D); - virtual ~baseProcessor3D(); + BaseProcessor3D(double fTime); + virtual ~BaseProcessor3D(); // the central processing method - virtual void process(const primitive3d::primitiveVector3D& rSource) = 0; + virtual void process(const primitive3d::Primitive3DSequence& rSource) = 0; // data access - const geometry::viewInformation& getViewInformation() const { return maViewInformation; } - const geometry::transformation3D& getTransformation3D() const { return maTransformation3D; } + double getTime() const { return mfTime; } }; } // end of namespace processor3d } // end of namespace drawinglayer @@ -86,22 +70,30 @@ namespace drawinglayer { namespace processor3d { - class collectingProcessor3D : public baseProcessor3D + class CollectingProcessor3D : public BaseProcessor3D { - protected: - primitive3d::primitiveVector3D maPrimitiveVector; + private: + primitive3d::Primitive3DSequence maPrimitiveSequence; public: - collectingProcessor3D( - const geometry::viewInformation& rViewInformation, - const geometry::transformation3D& rTransformation3D); - virtual ~collectingProcessor3D(); + CollectingProcessor3D(double fTime); // the central processing method - virtual void process(const primitive3d::primitiveVector3D& rSource); + virtual void process(const primitive3d::Primitive3DSequence& rSource); + + // helpers for adding to local sequence + void appendPrimitive3DSequence(const primitive3d::Primitive3DSequence& rSource) + { + primitive3d::appendPrimitive3DSequenceToPrimitive3DSequence(maPrimitiveSequence, rSource); + } + + void appendPrimitive3DReference(const primitive3d::Primitive3DReference& rSource) + { + primitive3d::appendPrimitive3DReferenceToPrimitive3DSequence(maPrimitiveSequence, rSource); + } // data access - const primitive3d::primitiveVector3D& getPrimitives() const { return maPrimitiveVector; } + const primitive3d::Primitive3DSequence& getPrimitive3DSequence() const { return maPrimitiveSequence; } }; } // end of namespace processor3d } // end of namespace drawinglayer diff --git a/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx index 3bc59564aea6..f7de8ae0d2a8 100644 --- a/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx +++ b/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: defaultprocessor3d.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:45:32 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:33:20 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,10 +33,10 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_PROCESSOR3D_DEFAULTPROCESSOR3D_HXX -#define _DRAWINGLAYER_PROCESSOR3D_DEFAULTPROCESSOR3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_DEFAULTPROCESSOR3D_HXX +#define INCLUDED_DRAWINGLAYER_PROCESSOR3D_DEFAULTPROCESSOR3D_HXX -#ifndef _DRAWINGLAYER_PROCESSOR3D_BASEPROCESSOR3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_BASEPROCESSOR3D_HXX #include <drawinglayer/processor3d/baseprocessor3d.hxx> #endif @@ -44,24 +44,24 @@ #include <basegfx/matrix/b3dhommatrix.hxx> #endif -#ifndef _BGFX_COLOR_BCOLOR_HXX -#include <basegfx/color/bcolor.hxx> +#ifndef _BGFX_RANGE_B2DRANGE_HXX +#include <basegfx/range/b2drange.hxx> #endif -#ifndef _DRAWINGLAYER_GEOMETRY_TRANSFORMATION3D_HXX -#include <drawinglayer/geometry/transformation3d.hxx> +#ifndef _BGFX_COLOR_BCOLORMODIFIER_HXX +#include <basegfx/color/bcolormodifier.hxx> #endif -#ifndef _SV_BITMAPEX_HXX -#include <vcl/bitmapex.hxx> +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> #endif -#ifndef _DRAWINGLAYER_PRIMITIVE3D_MODIFIEDCOLORPRIMITIVE3D_HXX -#include <drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx> +#ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_TRANSFORMATION3D_HXX +#include <drawinglayer/geometry/transformation3d.hxx> #endif -#ifndef _BGFX_RANGE_B2DRANGE_HXX -#include <basegfx/range/b2drange.hxx> +#ifndef _SV_BITMAPEX_HXX +#include <vcl/bitmapex.hxx> #endif ////////////////////////////////////////////////////////////////////////////// @@ -71,23 +71,24 @@ namespace basegfx { } namespace drawinglayer { namespace attribute { - class sdrSceneAttribute; - class sdrLightingAttribute; - class materialAttribute3D; + class SdrSceneAttribute; + class SdrLightingAttribute; + class MaterialAttribute3D; }} namespace drawinglayer { namespace primitive3d { - class polygonHairlinePrimitive3D; - class polyPolygonMaterialPrimitive3D; - class gradientTexturePrimitive3D; - class hatchTexturePrimitive3D; - class bitmapTexturePrimitive3D; - class transparenceTexturePrimitive3D; - class transformPrimitive3D; + class PolygonHairlinePrimitive3D; + class PolyPolygonMaterialPrimitive3D; + class GradientTexturePrimitive3D; + class HatchTexturePrimitive3D; + class BitmapTexturePrimitive3D; + class AlphaTexturePrimitive3D; + class TransformPrimitive3D; + class ModifiedColorPrimitive3D; }} namespace drawinglayer { namespace texture { - class geoTexSvx; + class GeoTexSvx; }} ////////////////////////////////////////////////////////////////////////////// @@ -96,12 +97,12 @@ namespace drawinglayer { namespace processor3d { - class defaultProcessor3D : public baseProcessor3D + class DefaultProcessor3D : public BaseProcessor3D { - protected: + private: // render information - const attribute::sdrSceneAttribute& mrSdrSceneAttribute; // read-only scene infos (normal handling, etc...) - const attribute::sdrLightingAttribute& mrSdrLightingAttribute; // read-only light infos (lights, etc...) + const attribute::SdrSceneAttribute& mrSdrSceneAttribute; // read-only scene infos (normal handling, etc...) + const attribute::SdrLightingAttribute& mrSdrLightingAttribute; // read-only light infos (lights, etc...) basegfx::B3DHomMatrix maDeviceToView; // scale and translate to map to target view size basegfx::B3DHomMatrix maWorldToEye; // world to eye coordinates basegfx::B3DHomMatrix maWorldToView; // mul maWorldToEye with maProjection and maDeviceToView @@ -116,10 +117,10 @@ namespace drawinglayer basegfx::BColorModifierStack maBColorModifierStack; // the current active texture - texture::geoTexSvx* mpGeoTexSvx; + texture::GeoTexSvx* mpGeoTexSvx; // the current active transparence texture - texture::geoTexSvx* mpTransparenceGeoTexSvx; + texture::GeoTexSvx* mpTransparenceGeoTexSvx; // bitfield unsigned mbModulate : 1; @@ -129,43 +130,43 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// // rendering support - void impRender_GRX3(const primitive3d::gradientTexturePrimitive3D& rPrimitive, bool bTransparence); - void impRender_HAX3(const primitive3d::hatchTexturePrimitive3D& rPrimitive); - void impRender_BMX3(const primitive3d::bitmapTexturePrimitive3D& rPrimitive); - void impRender_MCOL(const primitive3d::modifiedColorPrimitive3D& rModifiedCandidate); - void impRender_POH3(const primitive3d::polygonHairlinePrimitive3D& rPrimitive); - void impRender_POM3(const primitive3d::polyPolygonMaterialPrimitive3D& rPrimitive); - void impRender_TRN3(const primitive3d::transformPrimitive3D& rTransformCandidate); + void impRender_GRX3(const primitive3d::GradientTexturePrimitive3D& rPrimitive, bool bTransparence); + void impRender_HAX3(const primitive3d::HatchTexturePrimitive3D& rPrimitive); + void impRender_BMX3(const primitive3d::BitmapTexturePrimitive3D& rPrimitive); + void impRender_MCOL(const primitive3d::ModifiedColorPrimitive3D& rModifiedCandidate); + void impRender_POH3(const primitive3d::PolygonHairlinePrimitive3D& rPrimitive); + void impRender_POM3(const primitive3d::PolyPolygonMaterialPrimitive3D& rPrimitive); + void impRender_TRN3(const primitive3d::TransformPrimitive3D& rTransformCandidate); ////////////////////////////////////////////////////////////////////////////// // lighting support basegfx::BColor impSolveColorModel( basegfx::B3DVector aNormal, - const attribute::materialAttribute3D& rMaterial); + const attribute::MaterialAttribute3D& rMaterial); public: - defaultProcessor3D( - const geometry::viewInformation& rViewInformation, - const geometry::transformation3D& rTransformation3D, - const attribute::sdrSceneAttribute& rSdrSceneAttribute, - const attribute::sdrLightingAttribute& rSdrLightingAttribute, + DefaultProcessor3D( + const geometry::ViewInformation2D& rViewInformation, + const geometry::Transformation3D& rTransformation3D, + const attribute::SdrSceneAttribute& rSdrSceneAttribute, + const attribute::SdrLightingAttribute& rSdrLightingAttribute, double fSizeX, double fSizeY, const basegfx::B2DRange& rVisiblePart); - virtual ~defaultProcessor3D(); + virtual ~DefaultProcessor3D(); // the central processing method - virtual void process(const primitive3d::primitiveVector3D& rSource); + virtual void process(const primitive3d::Primitive3DSequence& rSource); // helpers for drawing transparent parts in 2nd run - void processNonTransparent(const primitive3d::primitiveVector3D& rSource); - void processTransparent(const primitive3d::primitiveVector3D& rSource); + void processNonTransparent(const primitive3d::Primitive3DSequence& rSource); + void processTransparent(const primitive3d::Primitive3DSequence& rSource); // data read access - const attribute::sdrLightingAttribute& getSdrLightingAttribute() const { return mrSdrLightingAttribute; } + const attribute::SdrLightingAttribute& getSdrLightingAttribute() const { return mrSdrLightingAttribute; } const basegfx::BColorModifierStack& getBColorModifierStack() const { return maBColorModifierStack; } - const texture::geoTexSvx* getGeoTexSvx() const { return mpGeoTexSvx; } - const texture::geoTexSvx* getTransparenceGeoTexSvx() const { return mpTransparenceGeoTexSvx; } + const texture::GeoTexSvx* getGeoTexSvx() const { return mpGeoTexSvx; } + const texture::GeoTexSvx* getTransparenceGeoTexSvx() const { return mpTransparenceGeoTexSvx; } bool getModulate() const { return mbModulate; } bool getFilter() const { return mbFilter; } diff --git a/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx b/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx index f4126416d043..d976f4f6ee29 100644 --- a/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx +++ b/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx @@ -4,9 +4,9 @@ * * $RCSfile: shadow3dextractor.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:45:32 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:33:20 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,21 +33,29 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_PROCESSOR3D_SHADOW3DEXTRACTOR_HXX -#define _DRAWINGLAYER_PROCESSOR3D_SHADOW3DEXTRACTOR_HXX +#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_SHADOW3DEXTRACTOR_HXX +#define INCLUDED_DRAWINGLAYER_PROCESSOR3D_SHADOW3DEXTRACTOR_HXX -#ifndef _DRAWINGLAYER_PROCESSOR3D_BASEPROCESSOR3D_HXX +#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_BASEPROCESSOR3D_HXX #include <drawinglayer/processor3d/baseprocessor3d.hxx> #endif -#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX -#include <basegfx/matrix/b2dhommatrix.hxx> +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#endif + +#ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_TRANSFORMATION3D_HXX +#include <drawinglayer/geometry/transformation3d.hxx> #endif #ifndef _BGFX_MATRIX_B3DHOMMATRIX_HXX #include <basegfx/matrix/b3dhommatrix.hxx> #endif +#ifndef _BGFX_COLOR_BCOLOR_HXX +#include <basegfx/color/bcolor.hxx> +#endif + #ifndef _BGFX_POLYGON_B2DPOLYGON_HXX #include <basegfx/polygon/b2dpolygon.hxx> #endif @@ -64,50 +72,38 @@ #include <basegfx/polygon/b3dpolypolygon.hxx> #endif -#ifndef _BGFX_COLOR_BCOLOR_HXX -#include <basegfx/color/bcolor.hxx> -#endif - -#ifndef _DRAWINGLAYER_PRIMITIVE_PRIMITIVE_HXX -#include <drawinglayer/primitive/primitive.hxx> +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX +#include <drawinglayer/attribute/sdrattribute3d.hxx> #endif ////////////////////////////////////////////////////////////////////////////// -// predefines - -namespace drawinglayer { namespace geometry { - class viewInformation; -}} - -namespace drawinglayer { namespace attribute { - class sdrLightingAttribute; -}} - -////////////////////////////////////////////////////////////////////////////// namespace drawinglayer { namespace processor3d { - class shadow3DExtractingProcessor : public baseProcessor3D + class Shadow3DExtractingProcessor : public BaseProcessor3D { - protected: - // result holding vector (2D) and target vector for stacking (inited to &maPrimitiveVector) - primitive::primitiveVector maPrimitiveVector; - primitive::primitiveVector* mpTargetVector; + private: + // result holding vector (2D) and target vector for stacking (inited to &maPrimitive2DSequence) + primitive2d::Primitive2DSequence maPrimitive2DSequence; + primitive2d::Primitive2DSequence* mpPrimitive2DSequence; + + // the 3d transformation stack + const geometry::Transformation3D maTransformation3D; // prepared data (transformations) for 2D/3D shadow calculations basegfx::B3DHomMatrix maWorldToEye; basegfx::B3DHomMatrix maEyeToView; basegfx::B3DHomMatrix maWorldToView; - basegfx::B3DVector maLightNormal; - basegfx::B3DVector maShadowPlaneNormal; + basegfx::B3DVector maLightNormal; + basegfx::B3DVector maShadowPlaneNormal; basegfx::B3DPoint maPlanePoint; double mfLightPlaneScalar; // the shadow color used for sub-primitives. Can stay at black since // the encapsulating 2d shadow primitive will contain the color - basegfx::BColor maPrimitiveColor; + basegfx::BColor maPrimitiveColor; // bitfield // flag if shadow plane projection preparation leaded to valid results @@ -119,24 +115,24 @@ namespace drawinglayer // flag if conversion shall use projection unsigned mbUseProjection : 1; - // protected helpers + // helpers basegfx::B2DPolygon impDoShadowProjection(const basegfx::B3DPolygon& rSource); basegfx::B2DPolyPolygon impDoShadowProjection(const basegfx::B3DPolyPolygon& rSource); public: - shadow3DExtractingProcessor( - const geometry::viewInformation& rViewInformation, - const geometry::transformation3D& rTransformation3D, - const attribute::sdrLightingAttribute& rSdrLightingAttribute, - const primitive3d::primitiveVector3D& rPrimitiveVector, + Shadow3DExtractingProcessor( + double fTime, + const geometry::Transformation3D& rTransformation3D, + const attribute::SdrLightingAttribute& rSdrLightingAttribute, + const primitive3d::Primitive3DSequence& rPrimitiveVector, double fShadowSlant); - virtual ~shadow3DExtractingProcessor(); // the central processing method - virtual void process(const primitive3d::primitiveVector3D& rSource); + virtual void process(const primitive3d::Primitive3DSequence& rSource); // data access - const primitive::primitiveVector& getPrimitives() const { return maPrimitiveVector; } + const primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; } + const geometry::Transformation3D& getTransformation3D() const { return maTransformation3D; } }; } // end of namespace processor3d } // end of namespace drawinglayer diff --git a/drawinglayer/inc/drawinglayer/texture/texture.hxx b/drawinglayer/inc/drawinglayer/texture/texture.hxx index 946297f92fad..9de1c654eb2f 100644 --- a/drawinglayer/inc/drawinglayer/texture/texture.hxx +++ b/drawinglayer/inc/drawinglayer/texture/texture.hxx @@ -4,9 +4,9 @@ * * $RCSfile: texture.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: aw $ $Date: 2006-08-09 16:46:03 $ + * last change: $Author: aw $ $Date: 2006-10-19 10:33:37 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,8 +33,8 @@ * ************************************************************************/ -#ifndef _DRAWINGLAYER_TEXTURE_TEXTURE_HXX -#define _DRAWINGLAYER_TEXTURE_TEXTURE_HXX +#ifndef INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE_HXX +#define INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE_HXX #ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX #include <basegfx/matrix/b2dhommatrix.hxx> @@ -55,15 +55,15 @@ namespace drawinglayer { namespace texture { - class geoTexSvx + class GeoTexSvx { public: - geoTexSvx(); - virtual ~geoTexSvx(); + GeoTexSvx(); + virtual ~GeoTexSvx(); // compare operator - virtual bool operator==(const geoTexSvx& rGeoTexSvx) const; - bool operator!=(const geoTexSvx& rGeoTexSvx) const { return !operator==(rGeoTexSvx); } + virtual bool operator==(const GeoTexSvx& rGeoTexSvx) const; + bool operator!=(const GeoTexSvx& rGeoTexSvx) const { return !operator==(rGeoTexSvx); } // virtual base methods virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices); @@ -79,14 +79,14 @@ namespace drawinglayer { namespace texture { - class geoTexSvxGradient : public geoTexSvx + class GeoTexSvxGradient : public GeoTexSvx { protected: basegfx::B2DHomMatrix maTextureTransform; basegfx::B2DHomMatrix maBackTextureTransform; basegfx::B2DRange maTargetRange; - basegfx::BColor maStart; - basegfx::BColor maEnd; + basegfx::BColor maStart; + basegfx::BColor maEnd; sal_uInt32 mnSteps; double mfAspect; double mfBorder; @@ -96,11 +96,11 @@ namespace drawinglayer void impAppendColorsRadial(::std::vector< basegfx::BColor >& rColors); public: - geoTexSvxGradient(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder); - virtual ~geoTexSvxGradient(); + GeoTexSvxGradient(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder); + virtual ~GeoTexSvxGradient(); // compare operator - virtual bool operator==(const geoTexSvx& rGeoTexSvx) const; + virtual bool operator==(const GeoTexSvx& rGeoTexSvx) const; // virtual base methods virtual void appendColors(::std::vector< basegfx::BColor >& rColors) = 0; @@ -118,11 +118,11 @@ namespace drawinglayer { namespace texture { - class geoTexSvxGradientLinear : public geoTexSvxGradient + class GeoTexSvxGradientLinear : public GeoTexSvxGradient { public: - geoTexSvxGradientLinear(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fAngle); - virtual ~geoTexSvxGradientLinear(); + GeoTexSvxGradientLinear(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fAngle); + virtual ~GeoTexSvxGradientLinear(); virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices); virtual void appendColors(::std::vector< basegfx::BColor >& rColors); @@ -137,14 +137,14 @@ namespace drawinglayer { namespace texture { - class geoTexSvxGradientAxial : public geoTexSvxGradient + class GeoTexSvxGradientAxial : public GeoTexSvxGradient { protected: double mfInternalSteps; public: - geoTexSvxGradientAxial(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fAngle); - virtual ~geoTexSvxGradientAxial(); + GeoTexSvxGradientAxial(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fAngle); + virtual ~GeoTexSvxGradientAxial(); virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices); virtual void appendColors(::std::vector< basegfx::BColor >& rColors); @@ -159,11 +159,11 @@ namespace drawinglayer { namespace texture { - class geoTexSvxGradientRadial : public geoTexSvxGradient + class GeoTexSvxGradientRadial : public GeoTexSvxGradient { public: - geoTexSvxGradientRadial(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fOffsetX, double fOffsetY); - virtual ~geoTexSvxGradientRadial(); + GeoTexSvxGradientRadial(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fOffsetX, double fOffsetY); + virtual ~GeoTexSvxGradientRadial(); virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices); virtual void appendColors(::std::vector< basegfx::BColor >& rColors); @@ -178,11 +178,11 @@ namespace drawinglayer { namespace texture { - class geoTexSvxGradientElliptical : public geoTexSvxGradient + class GeoTexSvxGradientElliptical : public GeoTexSvxGradient { public: - geoTexSvxGradientElliptical(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fOffsetX, double fOffsetY, double fAngle); - virtual ~geoTexSvxGradientElliptical(); + GeoTexSvxGradientElliptical(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fOffsetX, double fOffsetY, double fAngle); + virtual ~GeoTexSvxGradientElliptical(); virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices); virtual void appendColors(::std::vector< basegfx::BColor >& rColors); @@ -197,11 +197,11 @@ namespace drawinglayer { namespace texture { - class geoTexSvxGradientSquare : public geoTexSvxGradient + class GeoTexSvxGradientSquare : public GeoTexSvxGradient { public: - geoTexSvxGradientSquare(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fOffsetX, double fOffsetY, double fAngle); - virtual ~geoTexSvxGradientSquare(); + GeoTexSvxGradientSquare(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fOffsetX, double fOffsetY, double fAngle); + virtual ~GeoTexSvxGradientSquare(); virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices); virtual void appendColors(::std::vector< basegfx::BColor >& rColors); @@ -216,11 +216,11 @@ namespace drawinglayer { namespace texture { - class geoTexSvxGradientRect : public geoTexSvxGradient + class GeoTexSvxGradientRect : public GeoTexSvxGradient { public: - geoTexSvxGradientRect(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fOffsetX, double fOffsetY, double fAngle); - virtual ~geoTexSvxGradientRect(); + GeoTexSvxGradientRect(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fOffsetX, double fOffsetY, double fAngle); + virtual ~GeoTexSvxGradientRect(); virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices); virtual void appendColors(::std::vector< basegfx::BColor >& rColors); @@ -235,7 +235,7 @@ namespace drawinglayer { namespace texture { - class geoTexSvxHatch : public geoTexSvx + class GeoTexSvxHatch : public GeoTexSvx { protected: basegfx::B2DHomMatrix maTextureTransform; @@ -245,11 +245,11 @@ namespace drawinglayer sal_uInt32 mnSteps; public: - geoTexSvxHatch(const basegfx::B2DRange& rTargetRange, double fDistance, double fAngle); - virtual ~geoTexSvxHatch(); + GeoTexSvxHatch(const basegfx::B2DRange& rTargetRange, double fDistance, double fAngle); + virtual ~GeoTexSvxHatch(); // compare operator - virtual bool operator==(const geoTexSvx& rGeoTexSvx) const; + virtual bool operator==(const GeoTexSvx& rGeoTexSvx) const; virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices); double getDistanceToHatch(const basegfx::B2DPoint& rUV) const; @@ -263,18 +263,18 @@ namespace drawinglayer { namespace texture { - class geoTexSvxTiled : public geoTexSvx + class GeoTexSvxTiled : public GeoTexSvx { protected: basegfx::B2DPoint maTopLeft; - basegfx::B2DVector maSize; + basegfx::B2DVector maSize; public: - geoTexSvxTiled(const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize); - virtual ~geoTexSvxTiled(); + GeoTexSvxTiled(const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize); + virtual ~GeoTexSvxTiled(); // compare operator - virtual bool operator==(const geoTexSvx& rGeoTexSvx) const; + virtual bool operator==(const GeoTexSvx& rGeoTexSvx) const; virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices); }; |