summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorArmin Weiss <aw@openoffice.org>2006-10-19 09:40:02 +0000
committerArmin Weiss <aw@openoffice.org>2006-10-19 09:40:02 +0000
commit821e3b2b3026f21e396a8da3e152781a546ef5f5 (patch)
tree93c50872528b5002b4096e3c4ff704c2640272d3 /drawinglayer
parent0e1043d292a8f5165742a8711d71c28d62b0f4c7 (diff)
#i39532# primitive
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/inc/drawinglayer/animation/animationtiming.hxx68
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/fillattribute.hxx28
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx19
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx32
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx62
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrattribute.hxx80
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx64
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx22
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx28
-rw-r--r--drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx101
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx76
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx185
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx93
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx181
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx90
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx94
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx94
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx90
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx93
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx119
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx81
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx116
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx80
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx90
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx80
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx210
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx196
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx138
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx94
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx96
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx264
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx83
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx80
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx173
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx80
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx42
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx30
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx63
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx33
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx48
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx39
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx42
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx90
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx66
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx66
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx84
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx68
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx55
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx39
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx119
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx34
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx109
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx127
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx68
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx105
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx78
-rw-r--r--drawinglayer/inc/drawinglayer/texture/texture.hxx84
-rw-r--r--drawinglayer/prj/build.lst6
-rw-r--r--drawinglayer/prj/d.lst69
-rw-r--r--drawinglayer/source/animation/animationtiming.cxx94
-rw-r--r--drawinglayer/source/attribute/fillattribute.cxx14
-rw-r--r--drawinglayer/source/attribute/fillbitmapattribute.cxx10
-rw-r--r--drawinglayer/source/attribute/materialattribute3d.cxx44
-rw-r--r--drawinglayer/source/attribute/sdrallattribute3d.cxx40
-rw-r--r--drawinglayer/source/attribute/sdrattribute.cxx51
-rw-r--r--drawinglayer/source/attribute/sdrattribute3d.cxx64
-rw-r--r--drawinglayer/source/attribute/sdrfillbitmapattribute.cxx16
-rw-r--r--drawinglayer/source/geometry/makefile.mk8
-rw-r--r--drawinglayer/source/geometry/viewinformation2d.cxx267
-rw-r--r--drawinglayer/source/primitive2d/alphaprimitive2d.cxx78
-rw-r--r--drawinglayer/source/primitive2d/animatedprimitive2d.cxx256
-rw-r--r--drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx138
-rw-r--r--drawinglayer/source/primitive2d/baseprimitive2d.cxx274
-rw-r--r--drawinglayer/source/primitive2d/bitmapprimitive2d.cxx91
-rw-r--r--drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx137
-rw-r--r--drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx156
-rw-r--r--drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx217
-rw-r--r--drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx175
-rw-r--r--drawinglayer/source/primitive2d/gridprimitive2d.cxx302
-rw-r--r--drawinglayer/source/primitive2d/groupprimitive2d.cxx86
-rw-r--r--drawinglayer/source/primitive2d/helplineprimitive2d.cxx245
-rw-r--r--drawinglayer/source/primitive2d/makefile.mk75
-rw-r--r--drawinglayer/source/primitive2d/maskprimitive2d.cxx78
-rw-r--r--drawinglayer/source/primitive2d/metafileprimitive2d.cxx91
-rw-r--r--drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx78
-rw-r--r--drawinglayer/source/primitive2d/polygonprimitive2d.cxx434
-rw-r--r--drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx261
-rw-r--r--drawinglayer/source/primitive2d/sceneprimitive2d.cxx427
-rw-r--r--drawinglayer/source/primitive2d/shadowprimitive2d.cxx131
-rw-r--r--drawinglayer/source/primitive2d/textlayoutdevice.cxx217
-rw-r--r--drawinglayer/source/primitive2d/textprimitive2d.cxx378
-rw-r--r--drawinglayer/source/primitive2d/transformprimitive2d.cxx89
-rw-r--r--drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx124
-rw-r--r--drawinglayer/source/primitive3d/baseprimitive3d.cxx266
-rw-r--r--drawinglayer/source/primitive3d/groupprimitive3d.cxx86
-rw-r--r--drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx404
-rw-r--r--drawinglayer/source/primitive3d/makefile.mk31
-rw-r--r--drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx31
-rw-r--r--drawinglayer/source/primitive3d/polygonprimitive3d.cxx101
-rw-r--r--drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx173
-rw-r--r--drawinglayer/source/primitive3d/polypolygonprimitive3d.cxx44
-rw-r--r--drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx79
-rw-r--r--drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx157
-rw-r--r--drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx122
-rw-r--r--drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx134
-rw-r--r--drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx141
-rw-r--r--drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx125
-rw-r--r--drawinglayer/source/primitive3d/sdrprimitive3d.cxx50
-rw-r--r--drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx85
-rw-r--r--drawinglayer/source/primitive3d/shadowprimitive3d.cxx44
-rw-r--r--drawinglayer/source/primitive3d/textureprimitive3d.cxx152
-rw-r--r--drawinglayer/source/primitive3d/transformprimitive3d.cxx45
-rw-r--r--drawinglayer/source/processor2d/baseprocessor2d.cxx82
-rw-r--r--drawinglayer/source/processor2d/makefile.mk54
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx1718
-rw-r--r--drawinglayer/source/processor3d/baseprocessor3d.cxx34
-rw-r--r--drawinglayer/source/processor3d/defaultprocessor3d.cxx488
-rw-r--r--drawinglayer/source/processor3d/makefile.mk12
-rw-r--r--drawinglayer/source/processor3d/shadow3dextractor.cxx354
-rw-r--r--drawinglayer/source/texture/texture.cxx124
-rw-r--r--drawinglayer/util/makefile.mk8
121 files changed, 13001 insertions, 2333 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);
};
diff --git a/drawinglayer/prj/build.lst b/drawinglayer/prj/build.lst
index 63d56b2b047c..90ba87fc8d36 100644
--- a/drawinglayer/prj/build.lst
+++ b/drawinglayer/prj/build.lst
@@ -2,12 +2,12 @@ fx drawinglayer : goodies sal vcl basegfx offuh cppuhelper cppu NULL
fx drawinglayer usr1 - all fx_mkout NULL
fx drawinglayer\inc get - all fx_inc NULL
fx drawinglayer\prj get - all fx_prj NULL
-fx drawinglayer\source\primitive nmake - all fx_primitive NULL
+fx drawinglayer\source\primitive2d nmake - all fx_primitive2d NULL
fx drawinglayer\source\primitive3d nmake - all fx_primitive3d NULL
fx drawinglayer\source\animation nmake - all fx_animation NULL
fx drawinglayer\source\geometry nmake - all fx_geometry NULL
-fx drawinglayer\source\processor nmake - all fx_processor NULL
+fx drawinglayer\source\processor2d nmake - all fx_processor2d NULL
fx drawinglayer\source\processor3d nmake - all fx_processor3d NULL
fx drawinglayer\source\attribute nmake - all fx_attribute NULL
fx drawinglayer\source\texture nmake - all fx_texture NULL
-fx drawinglayer\util nmake - all fx_util fx_primitive fx_primitive3d fx_animation fx_geometry fx_processor fx_processor3d fx_attribute fx_texture NULL
+fx drawinglayer\util nmake - all fx_util fx_primitive2d fx_primitive3d fx_animation fx_geometry fx_processor2d fx_processor3d fx_attribute fx_texture NULL
diff --git a/drawinglayer/prj/d.lst b/drawinglayer/prj/d.lst
index f0d41821a911..0a918d98249c 100644
--- a/drawinglayer/prj/d.lst
+++ b/drawinglayer/prj/d.lst
@@ -6,65 +6,64 @@
mkdir: %_DEST%\inc%_EXT%\drawinglayer
-mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive
-..\inc\drawinglayer\primitive\animatedprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\animatedprimitive.hxx
-..\inc\drawinglayer\primitive\backgroundcolorprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\backgroundcolorprimitive.hxx
-..\inc\drawinglayer\primitive\bitmapprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\bitmapprimitive.hxx
-..\inc\drawinglayer\primitive\fillbitmapprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\fillbitmapprimitive.hxx
-..\inc\drawinglayer\primitive\embedded3dprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\embedded3dprimitive.hxx
-..\inc\drawinglayer\primitive\fillgradientprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\fillgradientprimitive.hxx
-..\inc\drawinglayer\primitive\fillhatchprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\fillhatchprimitive.hxx
-..\inc\drawinglayer\primitive\gridprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\gridprimitive.hxx
-..\inc\drawinglayer\primitive\helplineprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\helplineprimitive.hxx
-..\inc\drawinglayer\primitive\markerprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\markerprimitive.hxx
-..\inc\drawinglayer\primitive\maskprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\maskprimitive.hxx
-..\inc\drawinglayer\primitive\metafileprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\metafileprimitive.hxx
-..\inc\drawinglayer\primitive\modifiedcolorprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\modifiedcolorprimitive.hxx
-..\inc\drawinglayer\primitive\polygonprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\polygonprimitive.hxx
-..\inc\drawinglayer\primitive\polypolygonprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\polypolygonprimitive.hxx
-..\inc\drawinglayer\primitive\primitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\primitive.hxx
-..\inc\drawinglayer\primitive\primitivedefines.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\primitivedefines.hxx
-..\inc\drawinglayer\primitive\sceneprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\sceneprimitive.hxx
-..\inc\drawinglayer\primitive\shadowprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\shadowprimitive.hxx
-..\inc\drawinglayer\primitive\simpletransparenceprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\simpletransparenceprimitive.hxx
-..\inc\drawinglayer\primitive\textlayoutdevice.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\textlayoutdevice.hxx
-..\inc\drawinglayer\primitive\textprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\textprimitive.hxx
-..\inc\drawinglayer\primitive\transformprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\transformprimitive.hxx
-..\inc\drawinglayer\primitive\transparenceprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\transparenceprimitive.hxx
-..\inc\drawinglayer\primitive\vectorprimitive.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\vectorprimitive.hxx
+mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d
+..\inc\drawinglayer\primitive2d\alphaprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\alphaprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\animatedprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\animatedprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\backgroundcolorprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\backgroundcolorprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\baseprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\baseprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\bitmapprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\bitmapprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\embedded3dprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\embedded3dprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\fillbitmapprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\fillbitmapprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\fillgradientprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\fillgradientprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\fillhatchprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\fillhatchprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\gridprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\gridprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\groupprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\groupprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\helplineprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\helplineprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\markerprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\markerprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\maskprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\maskprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\metafileprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\metafileprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\modifiedcolorprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\modifiedcolorprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\polygonprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\polygonprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\polypolygonprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\polypolygonprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\sceneprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\sceneprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\shadowprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\shadowprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\textlayoutdevice.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\textlayoutdevice.hxx
+..\inc\drawinglayer\primitive2d\textprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\textprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\transformprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\transformprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\unifiedalphaprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\unifiedalphaprimitive2d.hxx
mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive3d
+..\inc\drawinglayer\primitive3d\baseprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\baseprimitive3d.hxx
+..\inc\drawinglayer\primitive3d\groupprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\groupprimitive3d.hxx
..\inc\drawinglayer\primitive3d\hatchtextureprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\hatchtextureprimitive3d.hxx
..\inc\drawinglayer\primitive3d\modifiedcolorprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\modifiedcolorprimitive3d.hxx
..\inc\drawinglayer\primitive3d\polygonprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\polygonprimitive3d.hxx
..\inc\drawinglayer\primitive3d\polygontubeprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\polygontubeprimitive3d.hxx
..\inc\drawinglayer\primitive3d\polypolygonprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\polypolygonprimitive3d.hxx
-..\inc\drawinglayer\primitive3d\primitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\primitive3d.hxx
..\inc\drawinglayer\primitive3d\sdrcubeprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\sdrcubeprimitive3d.hxx
..\inc\drawinglayer\primitive3d\sdrdecompositiontools3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\sdrdecompositiontools3d.hxx
..\inc\drawinglayer\primitive3d\sdrextrudelathetools3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\sdrextrudelathetools3d.hxx
..\inc\drawinglayer\primitive3d\sdrextrudeprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\sdrextrudeprimitive3d.hxx
..\inc\drawinglayer\primitive3d\sdrlabelprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\sdrlabelprimitive3d.hxx
..\inc\drawinglayer\primitive3d\sdrlatheprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\sdrlatheprimitive3d.hxx
-..\inc\drawinglayer\primitive3d\sdrpolygonprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\sdrpolygonprimitive3d.hxx
+..\inc\drawinglayer\primitive3d\sdrpolypolygonprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\sdrpolypolygonprimitive3d.hxx
..\inc\drawinglayer\primitive3d\sdrprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\sdrprimitive3d.hxx
..\inc\drawinglayer\primitive3d\sdrsphereprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\sdrsphereprimitive3d.hxx
..\inc\drawinglayer\primitive3d\shadowprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\shadowprimitive3d.hxx
..\inc\drawinglayer\primitive3d\textureprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\textureprimitive3d.hxx
..\inc\drawinglayer\primitive3d\transformprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\transformprimitive3d.hxx
-..\inc\drawinglayer\primitive3d\vectorprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\vectorprimitive3d.hxx
mkdir: %_DEST%\inc%_EXT%\drawinglayer\animation
..\inc\drawinglayer\animation\animationtiming.hxx %_DEST%\inc%_EXT%\drawinglayer\animation\animationtiming.hxx
mkdir: %_DEST%\inc%_EXT%\drawinglayer\geometry
..\inc\drawinglayer\geometry\transformation3d.hxx %_DEST%\inc%_EXT%\drawinglayer\geometry\transformation3d.hxx
-..\inc\drawinglayer\geometry\viewinformation.hxx %_DEST%\inc%_EXT%\drawinglayer\geometry\viewinformation.hxx
+..\inc\drawinglayer\geometry\viewinformation2d.hxx %_DEST%\inc%_EXT%\drawinglayer\geometry\viewinformation2d.hxx
-mkdir: %_DEST%\inc%_EXT%\drawinglayer\processor
-..\inc\drawinglayer\processor\animatedextractor.hxx %_DEST%\inc%_EXT%\drawinglayer\processor\animatedextractor.hxx
-..\inc\drawinglayer\processor\baseprocessor.hxx %_DEST%\inc%_EXT%\drawinglayer\processor\baseprocessor.hxx
-..\inc\drawinglayer\processor\vclprocessor.hxx %_DEST%\inc%_EXT%\drawinglayer\processor\vclprocessor.hxx
+mkdir: %_DEST%\inc%_EXT%\drawinglayer\processor2d
+..\inc\drawinglayer\processor2d\animatedextractor2d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor2d\animatedextractor2d.hxx
+..\inc\drawinglayer\processor2d\baseprocessor2d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor2d\baseprocessor2d.hxx
+..\inc\drawinglayer\processor2d\vclprocessor2d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor2d\vclprocessor2d.hxx
mkdir: %_DEST%\inc%_EXT%\drawinglayer\processor3d
..\inc\drawinglayer\processor3d\baseprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\baseprocessor3d.hxx
@@ -82,4 +81,4 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\attribute
..\inc\drawinglayer\attribute\strokeattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\strokeattribute.hxx
mkdir: %_DEST%\inc%_EXT%\drawinglayer\texture
-..\inc\drawinglayer\texture\texture.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive\texture.hxx
+..\inc\drawinglayer\texture\texture.hxx %_DEST%\inc%_EXT%\drawinglayer\texture\texture.hxx
diff --git a/drawinglayer/source/animation/animationtiming.cxx b/drawinglayer/source/animation/animationtiming.cxx
index f281742a7311..92f0e1a3fbcf 100644
--- a/drawinglayer/source/animation/animationtiming.cxx
+++ b/drawinglayer/source/animation/animationtiming.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: animationtiming.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: aw $ $Date: 2006-09-27 16:32:56 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:36:00 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,7 +33,7 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_ANIMATION_ANIMATIONTIMING_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ANIMATION_ANIMATIONTIMING_HXX
#include <drawinglayer/animation/animationtiming.hxx>
#endif
@@ -49,51 +49,51 @@ namespace drawinglayer
{
//////////////////////////////////////////////////////////////////////////////
- animationEntry::animationEntry()
+ AnimationEntry::AnimationEntry()
{
}
- animationEntry::~animationEntry()
+ AnimationEntry::~AnimationEntry()
{
}
//////////////////////////////////////////////////////////////////////////////
- animationEntryFixed::animationEntryFixed(double fDuration, double fState)
+ AnimationEntryFixed::AnimationEntryFixed(double fDuration, double fState)
: mfDuration(fDuration),
mfState(fState)
{
}
- animationEntryFixed::~animationEntryFixed()
+ AnimationEntryFixed::~AnimationEntryFixed()
{
}
- animationEntry* animationEntryFixed::clone() const
+ AnimationEntry* AnimationEntryFixed::clone() const
{
- return new animationEntryFixed(mfDuration, mfState);
+ return new AnimationEntryFixed(mfDuration, mfState);
}
- bool animationEntryFixed::operator==(const animationEntry& rCandidate) const
+ bool AnimationEntryFixed::operator==(const AnimationEntry& rCandidate) const
{
- const animationEntryFixed* pCompare = dynamic_cast< const animationEntryFixed* >(&rCandidate);
+ const AnimationEntryFixed* pCompare = dynamic_cast< const AnimationEntryFixed* >(&rCandidate);
return (pCompare
&& basegfx::fTools::equal(mfDuration, pCompare->mfDuration)
&& basegfx::fTools::equal(mfState, pCompare->mfState));
}
- double animationEntryFixed::getDuration() const
+ double AnimationEntryFixed::getDuration() const
{
return mfDuration;
}
- double animationEntryFixed::getStateAtTime(double /*fTime*/) const
+ double AnimationEntryFixed::getStateAtTime(double /*fTime*/) const
{
return mfState;
}
- double animationEntryFixed::getNextEventTime(double fTime) const
+ double AnimationEntryFixed::getNextEventTime(double fTime) const
{
if(basegfx::fTools::less(fTime, mfDuration))
{
@@ -107,7 +107,7 @@ namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
- animationEntryLinear::animationEntryLinear(double fDuration, double fFrequency, double fStart, double fStop)
+ AnimationEntryLinear::AnimationEntryLinear(double fDuration, double fFrequency, double fStart, double fStop)
: mfDuration(fDuration),
mfFrequency(fFrequency),
mfStart(fStart),
@@ -115,18 +115,18 @@ namespace drawinglayer
{
}
- animationEntryLinear::~animationEntryLinear()
+ AnimationEntryLinear::~AnimationEntryLinear()
{
}
- animationEntry* animationEntryLinear::clone() const
+ AnimationEntry* AnimationEntryLinear::clone() const
{
- return new animationEntryLinear(mfDuration, mfFrequency, mfStart, mfStop);
+ return new AnimationEntryLinear(mfDuration, mfFrequency, mfStart, mfStop);
}
- bool animationEntryLinear::operator==(const animationEntry& rCandidate) const
+ bool AnimationEntryLinear::operator==(const AnimationEntry& rCandidate) const
{
- const animationEntryLinear* pCompare = dynamic_cast< const animationEntryLinear* >(&rCandidate);
+ const AnimationEntryLinear* pCompare = dynamic_cast< const AnimationEntryLinear* >(&rCandidate);
return (pCompare
&& basegfx::fTools::equal(mfDuration, pCompare->mfDuration)
@@ -134,12 +134,12 @@ namespace drawinglayer
&& basegfx::fTools::equal(mfStop, pCompare->mfStop));
}
- double animationEntryLinear::getDuration() const
+ double AnimationEntryLinear::getDuration() const
{
return mfDuration;
}
- double animationEntryLinear::getStateAtTime(double fTime) const
+ double AnimationEntryLinear::getStateAtTime(double fTime) const
{
if(basegfx::fTools::more(mfDuration, 0.0))
{
@@ -160,7 +160,7 @@ namespace drawinglayer
}
}
- double animationEntryLinear::getNextEventTime(double fTime) const
+ double AnimationEntryLinear::getNextEventTime(double fTime) const
{
if(basegfx::fTools::less(fTime, mfDuration))
{
@@ -184,7 +184,7 @@ namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
- sal_uInt32 animationEntryList::impGetIndexAtTime(double fTime, double &rfAddedTime) const
+ sal_uInt32 AnimationEntryList::impGetIndexAtTime(double fTime, double &rfAddedTime) const
{
sal_uInt32 nIndex(0L);
@@ -196,12 +196,12 @@ namespace drawinglayer
return nIndex;
}
- animationEntryList::animationEntryList()
+ AnimationEntryList::AnimationEntryList()
: mfDuration(0.0)
{
}
- animationEntryList::~animationEntryList()
+ AnimationEntryList::~AnimationEntryList()
{
for(sal_uInt32 a(0L); a < maEntries.size(); a++)
{
@@ -209,9 +209,9 @@ namespace drawinglayer
}
}
- animationEntry* animationEntryList::clone() const
+ AnimationEntry* AnimationEntryList::clone() const
{
- animationEntryList* pNew = new animationEntryList();
+ AnimationEntryList* pNew = new AnimationEntryList();
for(sal_uInt32 a(0L); a < maEntries.size(); a++)
{
@@ -221,9 +221,9 @@ namespace drawinglayer
return pNew;
}
- bool animationEntryList::operator==(const animationEntry& rCandidate) const
+ bool AnimationEntryList::operator==(const AnimationEntry& rCandidate) const
{
- const animationEntryList* pCompare = dynamic_cast< const animationEntryList* >(&rCandidate);
+ const AnimationEntryList* pCompare = dynamic_cast< const AnimationEntryList* >(&rCandidate);
if(pCompare && mfDuration == pCompare->mfDuration)
{
@@ -241,7 +241,7 @@ namespace drawinglayer
return false;
}
- void animationEntryList::append(const animationEntry& rCandidate)
+ void AnimationEntryList::append(const AnimationEntry& rCandidate)
{
const double fDuration(rCandidate.getDuration());
@@ -252,12 +252,12 @@ namespace drawinglayer
}
}
- double animationEntryList::getDuration() const
+ double AnimationEntryList::getDuration() const
{
return mfDuration;
}
- double animationEntryList::getStateAtTime(double fTime) const
+ double AnimationEntryList::getStateAtTime(double fTime) const
{
if(!basegfx::fTools::equalZero(mfDuration))
{
@@ -273,7 +273,7 @@ namespace drawinglayer
return 0.0;
}
- double animationEntryList::getNextEventTime(double fTime) const
+ double AnimationEntryList::getNextEventTime(double fTime) const
{
double fNewTime(0.0);
@@ -293,19 +293,19 @@ namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
- animationEntryLoop::animationEntryLoop(sal_uInt32 nRepeat)
- : animationEntryList(),
+ AnimationEntryLoop::AnimationEntryLoop(sal_uInt32 nRepeat)
+ : AnimationEntryList(),
mnRepeat(nRepeat)
{
}
- animationEntryLoop::~animationEntryLoop()
+ AnimationEntryLoop::~AnimationEntryLoop()
{
}
- animationEntry* animationEntryLoop::clone() const
+ AnimationEntry* AnimationEntryLoop::clone() const
{
- animationEntryLoop* pNew = new animationEntryLoop(mnRepeat);
+ AnimationEntryLoop* pNew = new AnimationEntryLoop(mnRepeat);
for(sal_uInt32 a(0L); a < maEntries.size(); a++)
{
@@ -315,21 +315,21 @@ namespace drawinglayer
return pNew;
}
- bool animationEntryLoop::operator==(const animationEntry& rCandidate) const
+ bool AnimationEntryLoop::operator==(const AnimationEntry& rCandidate) const
{
- const animationEntryLoop* pCompare = dynamic_cast< const animationEntryLoop* >(&rCandidate);
+ const AnimationEntryLoop* pCompare = dynamic_cast< const AnimationEntryLoop* >(&rCandidate);
return (pCompare
&& mnRepeat == pCompare->mnRepeat
- && animationEntryList::operator==(rCandidate));
+ && AnimationEntryList::operator==(rCandidate));
}
- double animationEntryLoop::getDuration() const
+ double AnimationEntryLoop::getDuration() const
{
return (mfDuration * (double)mnRepeat);
}
- double animationEntryLoop::getStateAtTime(double fTime) const
+ double AnimationEntryLoop::getStateAtTime(double fTime) const
{
if(mnRepeat && !basegfx::fTools::equalZero(mfDuration))
{
@@ -343,14 +343,14 @@ namespace drawinglayer
{
const double fTimeAtLoopStart((double)nCurrentLoop * mfDuration);
const double fRelativeTime(fTime - fTimeAtLoopStart);
- return animationEntryList::getStateAtTime(fRelativeTime);
+ return AnimationEntryList::getStateAtTime(fRelativeTime);
}
}
return 0.0;
}
- double animationEntryLoop::getNextEventTime(double fTime) const
+ double AnimationEntryLoop::getNextEventTime(double fTime) const
{
double fNewTime(0.0);
@@ -362,7 +362,7 @@ namespace drawinglayer
{
const double fTimeAtLoopStart((double)nCurrentLoop * mfDuration);
const double fRelativeTime(fTime - fTimeAtLoopStart);
- const double fNextEventAtLoop(animationEntryList::getNextEventTime(fRelativeTime));
+ const double fNextEventAtLoop(AnimationEntryList::getNextEventTime(fRelativeTime));
if(!basegfx::fTools::equalZero(fNextEventAtLoop))
{
diff --git a/drawinglayer/source/attribute/fillattribute.cxx b/drawinglayer/source/attribute/fillattribute.cxx
index 197f65071a0f..3807fbb293ae 100644
--- a/drawinglayer/source/attribute/fillattribute.cxx
+++ b/drawinglayer/source/attribute/fillattribute.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: fillattribute.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:47:33 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:36:13 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,7 +33,7 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX
#include <drawinglayer/attribute/fillattribute.hxx>
#endif
@@ -47,7 +47,7 @@ namespace drawinglayer
{
namespace attribute
{
- fillGradientAttribute::fillGradientAttribute(GradientStyle eStyle, double fBorder, double fOffsetX, double fOffsetY, double fAngle,
+ FillGradientAttribute::FillGradientAttribute(GradientStyle eStyle, double fBorder, double fOffsetX, double fOffsetY, double fAngle,
const basegfx::BColor& rStartColor, const basegfx::BColor& rEndColor, sal_uInt16 nSteps)
: maStartColor(rStartColor),
maEndColor(rEndColor),
@@ -60,7 +60,7 @@ namespace drawinglayer
{
}
- bool fillGradientAttribute::operator==(const fillGradientAttribute& rCandidate) const
+ bool FillGradientAttribute::operator==(const FillGradientAttribute& rCandidate) const
{
return (meStyle == rCandidate.meStyle
&& maStartColor == rCandidate.maStartColor
@@ -80,7 +80,7 @@ namespace drawinglayer
{
namespace attribute
{
- fillHatchAttribute::fillHatchAttribute(HatchStyle eStyle, double fDistance, double fAngle, const basegfx::BColor& rColor, bool bFillBackground)
+ FillHatchAttribute::FillHatchAttribute(HatchStyle eStyle, double fDistance, double fAngle, const basegfx::BColor& rColor, bool bFillBackground)
: mfDistance(fDistance),
mfAngle(fAngle),
maColor(rColor),
@@ -89,7 +89,7 @@ namespace drawinglayer
{
}
- bool fillHatchAttribute::operator==(const fillHatchAttribute& rCandidate) const
+ bool FillHatchAttribute::operator==(const FillHatchAttribute& rCandidate) const
{
return (meStyle == rCandidate.meStyle
&& mfDistance == rCandidate.mfDistance
diff --git a/drawinglayer/source/attribute/fillbitmapattribute.cxx b/drawinglayer/source/attribute/fillbitmapattribute.cxx
index 625657412eaa..daf02163a2f9 100644
--- a/drawinglayer/source/attribute/fillbitmapattribute.cxx
+++ b/drawinglayer/source/attribute/fillbitmapattribute.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: fillbitmapattribute.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:47:33 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:36:13 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,7 +33,7 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX
#include <drawinglayer/attribute/fillbitmapattribute.hxx>
#endif
@@ -43,7 +43,7 @@ namespace drawinglayer
{
namespace attribute
{
- fillBitmapAttribute::fillBitmapAttribute(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize, bool bTiling)
+ FillBitmapAttribute::FillBitmapAttribute(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize, bool bTiling)
: maBitmap(rBitmap),
maTopLeft(rTopLeft),
maSize(rSize),
@@ -51,7 +51,7 @@ namespace drawinglayer
{
}
- bool fillBitmapAttribute::operator==(const fillBitmapAttribute& rCandidate) const
+ bool FillBitmapAttribute::operator==(const FillBitmapAttribute& rCandidate) const
{
return (maBitmap == rCandidate.maBitmap
&& maTopLeft == rCandidate.maTopLeft
diff --git a/drawinglayer/source/attribute/materialattribute3d.cxx b/drawinglayer/source/attribute/materialattribute3d.cxx
index 4a2c0b30cdbc..b4c9d7257429 100644
--- a/drawinglayer/source/attribute/materialattribute3d.cxx
+++ b/drawinglayer/source/attribute/materialattribute3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: materialattribute3d.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:47:33 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:36:13 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,7 +33,7 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_ATTRIBUTE_MATERIALATTRIBUTE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_MATERIALATTRIBUTE3D_HXX
#include <drawinglayer/attribute/materialattribute3d.hxx>
#endif
@@ -47,7 +47,7 @@ namespace drawinglayer
{
namespace
{
- class impMaterialAttribute3D
+ class ImpMaterialAttribute3D
{
public:
// materialAttribute3D definitions
@@ -59,7 +59,7 @@ namespace drawinglayer
// refcounter
sal_uInt32 mnRefCount;
- impMaterialAttribute3D(const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity)
+ ImpMaterialAttribute3D(const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity)
: maColor(rColor),
maSpecular(rSpecular),
maEmission(rEmission),
@@ -68,7 +68,7 @@ namespace drawinglayer
{
}
- impMaterialAttribute3D(const basegfx::BColor& rColor)
+ ImpMaterialAttribute3D(const basegfx::BColor& rColor)
: maColor(rColor),
maSpecular(1.0, 1.0, 1.0),
maEmission(),
@@ -77,13 +77,13 @@ namespace drawinglayer
{
}
- impMaterialAttribute3D()
+ ImpMaterialAttribute3D()
: mnSpecularIntensity(0),
mnRefCount(0L)
{
}
- bool operator==(const impMaterialAttribute3D& rCandidate) const
+ bool operator==(const ImpMaterialAttribute3D& rCandidate) const
{
return (maColor == rCandidate.maColor
&& maSpecular == rCandidate.maSpecular
@@ -105,28 +105,28 @@ namespace drawinglayer
{
namespace attribute
{
- materialAttribute3D::materialAttribute3D(const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity)
- : mpMaterialAttribute3D(new impMaterialAttribute3D(rColor, rSpecular, rEmission, nSpecularIntensity))
+ MaterialAttribute3D::MaterialAttribute3D(const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity)
+ : mpMaterialAttribute3D(new ImpMaterialAttribute3D(rColor, rSpecular, rEmission, nSpecularIntensity))
{
}
- materialAttribute3D::materialAttribute3D(const basegfx::BColor& rColor)
- : mpMaterialAttribute3D(new impMaterialAttribute3D(rColor))
+ MaterialAttribute3D::MaterialAttribute3D(const basegfx::BColor& rColor)
+ : mpMaterialAttribute3D(new ImpMaterialAttribute3D(rColor))
{
}
- materialAttribute3D::materialAttribute3D()
- : mpMaterialAttribute3D(new impMaterialAttribute3D())
+ MaterialAttribute3D::MaterialAttribute3D()
+ : mpMaterialAttribute3D(new ImpMaterialAttribute3D())
{
}
- materialAttribute3D::materialAttribute3D(const materialAttribute3D& rCandidate)
+ MaterialAttribute3D::MaterialAttribute3D(const MaterialAttribute3D& rCandidate)
: mpMaterialAttribute3D(rCandidate.mpMaterialAttribute3D)
{
mpMaterialAttribute3D->mnRefCount++;
}
- materialAttribute3D::~materialAttribute3D()
+ MaterialAttribute3D::~MaterialAttribute3D()
{
if(mpMaterialAttribute3D->mnRefCount)
{
@@ -138,7 +138,7 @@ namespace drawinglayer
}
}
- materialAttribute3D& materialAttribute3D::operator=(const materialAttribute3D& rCandidate)
+ MaterialAttribute3D& MaterialAttribute3D::operator=(const MaterialAttribute3D& rCandidate)
{
if(rCandidate.mpMaterialAttribute3D != mpMaterialAttribute3D)
{
@@ -158,7 +158,7 @@ namespace drawinglayer
return *this;
}
- bool materialAttribute3D::operator==(const materialAttribute3D& rCandidate) const
+ bool MaterialAttribute3D::operator==(const MaterialAttribute3D& rCandidate) const
{
if(rCandidate.mpMaterialAttribute3D == mpMaterialAttribute3D)
{
@@ -168,22 +168,22 @@ namespace drawinglayer
return (*rCandidate.mpMaterialAttribute3D == *mpMaterialAttribute3D);
}
- const basegfx::BColor& materialAttribute3D::getColor() const
+ const basegfx::BColor& MaterialAttribute3D::getColor() const
{
return mpMaterialAttribute3D->getColor();
}
- const basegfx::BColor& materialAttribute3D::getSpecular() const
+ const basegfx::BColor& MaterialAttribute3D::getSpecular() const
{
return mpMaterialAttribute3D->getSpecular();
}
- const basegfx::BColor& materialAttribute3D::getEmission() const
+ const basegfx::BColor& MaterialAttribute3D::getEmission() const
{
return mpMaterialAttribute3D->getEmission();
}
- sal_uInt16 materialAttribute3D::getSpecularIntensity() const
+ sal_uInt16 MaterialAttribute3D::getSpecularIntensity() const
{
return mpMaterialAttribute3D->getSpecularIntensity();
}
diff --git a/drawinglayer/source/attribute/sdrallattribute3d.cxx b/drawinglayer/source/attribute/sdrallattribute3d.cxx
index 1ac32323c7ef..2fa01f0ec661 100644
--- a/drawinglayer/source/attribute/sdrallattribute3d.cxx
+++ b/drawinglayer/source/attribute/sdrallattribute3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sdrallattribute3d.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:47:33 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:36:13 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,15 +33,15 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX
#include <drawinglayer/attribute/sdrallattribute3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX
#include <drawinglayer/attribute/sdrattribute.hxx>
#endif
-#ifndef _DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX
#include <drawinglayer/attribute/fillattribute.hxx>
#endif
@@ -55,12 +55,12 @@ namespace drawinglayer
{
namespace attribute
{
- sdrLineFillShadowAttribute::sdrLineFillShadowAttribute(
- sdrLineAttribute* pLine,
- sdrFillAttribute* pFill,
- sdrLineStartEndAttribute* pLineStartEnd,
- sdrShadowAttribute* pShadow,
- fillGradientAttribute* pFillFloatTransGradient)
+ SdrLineFillShadowAttribute::SdrLineFillShadowAttribute(
+ SdrLineAttribute* pLine,
+ SdrFillAttribute* pFill,
+ SdrLineStartEndAttribute* pLineStartEnd,
+ SdrShadowAttribute* pShadow,
+ FillGradientAttribute* pFillFloatTransGradient)
: mpShadow(pShadow),
mpLine(pLine),
mpLineStartEnd(pLineStartEnd),
@@ -69,7 +69,7 @@ namespace drawinglayer
{
}
- sdrLineFillShadowAttribute::sdrLineFillShadowAttribute(const sdrLineFillShadowAttribute& rCandidate)
+ SdrLineFillShadowAttribute::SdrLineFillShadowAttribute(const SdrLineFillShadowAttribute& rCandidate)
: mpShadow(0L),
mpLine(0L),
mpLineStartEnd(0L),
@@ -82,7 +82,7 @@ namespace drawinglayer
}
}
- sdrLineFillShadowAttribute::~sdrLineFillShadowAttribute()
+ SdrLineFillShadowAttribute::~SdrLineFillShadowAttribute()
{
delete mpShadow;
delete mpLine;
@@ -91,7 +91,7 @@ namespace drawinglayer
delete mpFillFloatTransGradient;
}
- sdrLineFillShadowAttribute& sdrLineFillShadowAttribute::operator=(const sdrLineFillShadowAttribute& rCandidate)
+ SdrLineFillShadowAttribute& SdrLineFillShadowAttribute::operator=(const SdrLineFillShadowAttribute& rCandidate)
{
// handle mpShadow
{
@@ -105,7 +105,7 @@ namespace drawinglayer
// copy mpShadow if necessary
if(!mpShadow && rCandidate.mpShadow)
{
- mpShadow = new sdrShadowAttribute(*rCandidate.mpShadow);
+ mpShadow = new SdrShadowAttribute(*rCandidate.mpShadow);
}
}
@@ -121,7 +121,7 @@ namespace drawinglayer
// copy mpLine if necessary
if(!mpLine && rCandidate.mpLine)
{
- mpLine = new sdrLineAttribute(*rCandidate.mpLine);
+ mpLine = new SdrLineAttribute(*rCandidate.mpLine);
}
}
@@ -137,7 +137,7 @@ namespace drawinglayer
// copy mpLineStartEnd if necessary
if(!mpLineStartEnd && rCandidate.mpLineStartEnd)
{
- mpLineStartEnd = new sdrLineStartEndAttribute(*rCandidate.mpLineStartEnd);
+ mpLineStartEnd = new SdrLineStartEndAttribute(*rCandidate.mpLineStartEnd);
}
}
@@ -153,7 +153,7 @@ namespace drawinglayer
// copy mpFill if necessary
if(!mpFill && rCandidate.mpFill)
{
- mpFill = new sdrFillAttribute(*rCandidate.mpFill);
+ mpFill = new SdrFillAttribute(*rCandidate.mpFill);
}
}
@@ -169,14 +169,14 @@ namespace drawinglayer
// copy mpFillFloatTransGradient if necessary
if(!mpFillFloatTransGradient && rCandidate.mpFillFloatTransGradient)
{
- mpFillFloatTransGradient = new fillGradientAttribute(*rCandidate.mpFillFloatTransGradient);
+ mpFillFloatTransGradient = new FillGradientAttribute(*rCandidate.mpFillFloatTransGradient);
}
}
return *this;
}
- bool sdrLineFillShadowAttribute::operator==(const sdrLineFillShadowAttribute& rCandidate) const
+ bool SdrLineFillShadowAttribute::operator==(const SdrLineFillShadowAttribute& rCandidate) const
{
// handle mpShadow
if(!pointerOrContentEqual(mpShadow, rCandidate.mpShadow))
diff --git a/drawinglayer/source/attribute/sdrattribute.cxx b/drawinglayer/source/attribute/sdrattribute.cxx
index 6c4a8ff84501..0ce4a4f56763 100644
--- a/drawinglayer/source/attribute/sdrattribute.cxx
+++ b/drawinglayer/source/attribute/sdrattribute.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sdrattribute.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:47:34 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:36:14 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,15 +33,15 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX
#include <drawinglayer/attribute/sdrattribute.hxx>
#endif
-#ifndef _DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX
#include <drawinglayer/attribute/fillattribute.hxx>
#endif
-#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX
#include <drawinglayer/attribute/sdrfillbitmapattribute.hxx>
#endif
@@ -51,7 +51,7 @@ namespace drawinglayer
{
namespace attribute
{
- sdrLineAttribute::sdrLineAttribute(
+ SdrLineAttribute::SdrLineAttribute(
basegfx::tools::B2DLineJoin eJoin, double fWidth, double fTransparence, const basegfx::BColor& rColor,
const ::std::vector< double >& rDotDashArray, double fFullDotDashLen)
: meJoin(eJoin),
@@ -63,11 +63,11 @@ namespace drawinglayer
{
}
- sdrLineAttribute::~sdrLineAttribute()
+ SdrLineAttribute::~SdrLineAttribute()
{
}
- bool sdrLineAttribute::operator==(const sdrLineAttribute& rCandidate) const
+ bool SdrLineAttribute::operator==(const SdrLineAttribute& rCandidate) const
{
return (meJoin == rCandidate.meJoin
&& mfWidth == rCandidate.mfWidth
@@ -84,7 +84,7 @@ namespace drawinglayer
{
namespace attribute
{
- sdrLineStartEndAttribute::sdrLineStartEndAttribute(
+ SdrLineStartEndAttribute::SdrLineStartEndAttribute(
const basegfx::B2DPolyPolygon& rStartPolyPolygon, const basegfx::B2DPolyPolygon& rEndPolyPolygon,
double fStartWidth, double fEndWidth, bool bStartActive, bool bEndActive, bool bStartCentered, bool bEndCentered)
: maStartPolyPolygon(rStartPolyPolygon),
@@ -98,11 +98,11 @@ namespace drawinglayer
{
}
- sdrLineStartEndAttribute::~sdrLineStartEndAttribute()
+ SdrLineStartEndAttribute::~SdrLineStartEndAttribute()
{
}
- bool sdrLineStartEndAttribute::operator==(const sdrLineStartEndAttribute& rCandidate) const
+ bool SdrLineStartEndAttribute::operator==(const SdrLineStartEndAttribute& rCandidate) const
{
return (mbStartActive == rCandidate.mbStartActive
&& mbEndActive == rCandidate.mbEndActive
@@ -122,18 +122,18 @@ namespace drawinglayer
{
namespace attribute
{
- sdrShadowAttribute::sdrShadowAttribute(const basegfx::B2DVector& rOffset, double fTransparence, const basegfx::BColor& rColor)
+ SdrShadowAttribute::SdrShadowAttribute(const basegfx::B2DVector& rOffset, double fTransparence, const basegfx::BColor& rColor)
: maOffset(rOffset),
mfTransparence(fTransparence),
maColor(rColor)
{
}
- sdrShadowAttribute::~sdrShadowAttribute()
+ SdrShadowAttribute::~SdrShadowAttribute()
{
}
- bool sdrShadowAttribute::operator==(const sdrShadowAttribute& rCandidate) const
+ bool SdrShadowAttribute::operator==(const SdrShadowAttribute& rCandidate) const
{
return (mfTransparence == rCandidate.mfTransparence
&& maColor == rCandidate.maColor
@@ -148,9 +148,12 @@ namespace drawinglayer
{
namespace attribute
{
- sdrFillAttribute::sdrFillAttribute(
- double fTransparence, const basegfx::BColor& rColor, fillGradientAttribute* pGradient,
- fillHatchAttribute* pHatch, sdrFillBitmapAttribute* pBitmap)
+ SdrFillAttribute::SdrFillAttribute(
+ double fTransparence,
+ const basegfx::BColor& rColor,
+ FillGradientAttribute* pGradient,
+ FillHatchAttribute* pHatch,
+ SdrFillBitmapAttribute* pBitmap)
: mfTransparence(fTransparence),
maColor(rColor),
mpGradient(pGradient),
@@ -159,7 +162,7 @@ namespace drawinglayer
{
}
- sdrFillAttribute::sdrFillAttribute(const sdrFillAttribute& rCandidate)
+ SdrFillAttribute::SdrFillAttribute(const SdrFillAttribute& rCandidate)
: mfTransparence(1.0),
mpGradient(0L),
mpHatch(0L),
@@ -171,14 +174,14 @@ namespace drawinglayer
}
}
- sdrFillAttribute::~sdrFillAttribute()
+ SdrFillAttribute::~SdrFillAttribute()
{
delete mpGradient;
delete mpHatch;
delete mpBitmap;
}
- sdrFillAttribute& sdrFillAttribute::operator=(const sdrFillAttribute& rCandidate)
+ SdrFillAttribute& SdrFillAttribute::operator=(const SdrFillAttribute& rCandidate)
{
// copy data
mfTransparence = rCandidate.mfTransparence;
@@ -196,7 +199,7 @@ namespace drawinglayer
// copy mpGradient if necessary
if(!mpGradient && rCandidate.mpGradient)
{
- mpGradient = new fillGradientAttribute(*rCandidate.mpGradient);
+ mpGradient = new FillGradientAttribute(*rCandidate.mpGradient);
}
}
@@ -212,7 +215,7 @@ namespace drawinglayer
// copy mpHatch if necessary
if(!mpHatch && rCandidate.mpHatch)
{
- mpHatch = new fillHatchAttribute(*rCandidate.mpHatch);
+ mpHatch = new FillHatchAttribute(*rCandidate.mpHatch);
}
}
@@ -228,14 +231,14 @@ namespace drawinglayer
// copy mpBitmap if necessary
if(!mpBitmap && rCandidate.mpBitmap)
{
- mpBitmap = new sdrFillBitmapAttribute(*rCandidate.mpBitmap);
+ mpBitmap = new SdrFillBitmapAttribute(*rCandidate.mpBitmap);
}
}
return *this;
}
- bool sdrFillAttribute::operator==(const sdrFillAttribute& rCandidate) const
+ bool SdrFillAttribute::operator==(const SdrFillAttribute& rCandidate) const
{
if(mfTransparence != rCandidate.mfTransparence)
return false;
diff --git a/drawinglayer/source/attribute/sdrattribute3d.cxx b/drawinglayer/source/attribute/sdrattribute3d.cxx
index ccbe27181256..831e23484c40 100644
--- a/drawinglayer/source/attribute/sdrattribute3d.cxx
+++ b/drawinglayer/source/attribute/sdrattribute3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sdrattribute3d.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:47:34 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:36:14 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,7 +33,7 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX
#include <drawinglayer/attribute/sdrattribute3d.hxx>
#endif
@@ -43,13 +43,13 @@ namespace drawinglayer
{
namespace attribute
{
- sdr3DObjectAttribute::sdr3DObjectAttribute(
+ 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,
@@ -67,22 +67,18 @@ namespace drawinglayer
{
}
- sdr3DObjectAttribute::~sdr3DObjectAttribute()
- {
- }
-
- bool sdr3DObjectAttribute::operator==(const sdr3DObjectAttribute& rCandidate) const
+ bool Sdr3DObjectAttribute::operator==(const Sdr3DObjectAttribute& rCandidate) const
{
return (maNormalsKind == rCandidate.maNormalsKind
- && maTextureProjectionX == rCandidate.maTextureProjectionX
- && maTextureProjectionY == rCandidate.maTextureProjectionY
- && maTextureKind == rCandidate.maTextureKind
- && maTextureMode == rCandidate.maTextureMode
- && maMaterial == rCandidate.maMaterial
- && mbNormalsInvert == rCandidate.mbNormalsInvert
- && mbDoubleSided == rCandidate.mbDoubleSided
- && mbShadow3D == rCandidate.mbShadow3D
- && mbTextureFilter == rCandidate.mbTextureFilter);
+ && maTextureProjectionX == rCandidate.maTextureProjectionX
+ && maTextureProjectionY == rCandidate.maTextureProjectionY
+ && maTextureKind == rCandidate.maTextureKind
+ && maTextureMode == rCandidate.maTextureMode
+ && maMaterial == rCandidate.maMaterial
+ && mbNormalsInvert == rCandidate.mbNormalsInvert
+ && mbDoubleSided == rCandidate.mbDoubleSided
+ && mbShadow3D == rCandidate.mbShadow3D
+ && mbTextureFilter == rCandidate.mbTextureFilter);
}
} // end of namespace attribute
} // end of namespace drawinglayer
@@ -93,18 +89,14 @@ namespace drawinglayer
{
namespace attribute
{
- sdr3DLightAttribute::sdr3DLightAttribute(const basegfx::BColor& rColor, const basegfx::B3DVector& rDirection, bool bSpecular)
+ Sdr3DLightAttribute::Sdr3DLightAttribute(const basegfx::BColor& rColor, const basegfx::B3DVector& rDirection, bool bSpecular)
: maColor(rColor),
maDirection(rDirection),
mbSpecular(bSpecular)
{
}
- sdr3DLightAttribute::~sdr3DLightAttribute()
- {
- }
-
- bool sdr3DLightAttribute::operator==(const sdr3DLightAttribute& rCandidate) const
+ bool Sdr3DLightAttribute::operator==(const Sdr3DLightAttribute& rCandidate) const
{
return (maColor == rCandidate.maColor
&& maDirection == rCandidate.maDirection
@@ -119,26 +111,22 @@ namespace drawinglayer
{
namespace attribute
{
- sdrLightingAttribute::sdrLightingAttribute(
+ SdrLightingAttribute::SdrLightingAttribute(
const basegfx::BColor& rAmbientLight,
- const ::std::vector< sdr3DLightAttribute >& rLightVector)
+ const ::std::vector< Sdr3DLightAttribute >& rLightVector)
: maAmbientLight(rAmbientLight),
maLightVector(rLightVector)
{
}
- sdrLightingAttribute::~sdrLightingAttribute()
- {
- }
-
- bool sdrLightingAttribute::operator==(const sdrLightingAttribute& rCandidate) const
+ bool SdrLightingAttribute::operator==(const SdrLightingAttribute& rCandidate) const
{
return (maAmbientLight == rCandidate.maAmbientLight
&& maLightVector == rCandidate.maLightVector);
}
// color model solver
- basegfx::BColor sdrLightingAttribute::solveColorModel(
+ basegfx::BColor SdrLightingAttribute::solveColorModel(
const basegfx::B3DVector& rNormalInEyeCoordinates,
const basegfx::BColor& rColor, const basegfx::BColor& rSpecular,
const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity) const
@@ -160,7 +148,7 @@ namespace drawinglayer
for(sal_uInt32 a(0L); a < nLightCount; a++)
{
- const sdr3DLightAttribute& rLight(maLightVector[a]);
+ const Sdr3DLightAttribute& rLight(maLightVector[a]);
const double fCosFac(rLight.getDirection().scalar(aEyeNormal));
if(basegfx::fTools::more(fCosFac, 0.0))
@@ -198,7 +186,7 @@ namespace drawinglayer
{
namespace attribute
{
- sdrSceneAttribute::sdrSceneAttribute(
+ SdrSceneAttribute::SdrSceneAttribute(
double fDistance,
double fShadowSlant,
::com::sun::star::drawing::ProjectionMode aProjectionMode,
@@ -212,11 +200,7 @@ namespace drawinglayer
{
}
- sdrSceneAttribute::~sdrSceneAttribute()
- {
- }
-
- bool sdrSceneAttribute::operator==(const sdrSceneAttribute& rCandidate) const
+ bool SdrSceneAttribute::operator==(const SdrSceneAttribute& rCandidate) const
{
return (mfDistance == rCandidate.mfDistance
&& mfShadowSlant == rCandidate.mfShadowSlant
diff --git a/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx b/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx
index 4f7e8b5947a2..afa2ee17f261 100644
--- a/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx
+++ b/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sdrfillbitmapattribute.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:47:34 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:36:14 $
*
* 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_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX
#include <drawinglayer/attribute/sdrfillbitmapattribute.hxx>
#endif
-#ifndef _DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX
#include <drawinglayer/attribute/fillbitmapattribute.hxx>
#endif
@@ -55,7 +55,7 @@ namespace drawinglayer
{
namespace attribute
{
- sdrFillBitmapAttribute::sdrFillBitmapAttribute(
+ 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)
@@ -70,7 +70,7 @@ namespace drawinglayer
{
}
- bool sdrFillBitmapAttribute::operator==(const sdrFillBitmapAttribute& rCandidate) const
+ bool SdrFillBitmapAttribute::operator==(const SdrFillBitmapAttribute& rCandidate) const
{
return (maBitmap == rCandidate.maBitmap
&& maSize == rCandidate.maSize
@@ -82,7 +82,7 @@ namespace drawinglayer
&& mbLogSize == rCandidate.mbLogSize);
}
- fillBitmapAttribute sdrFillBitmapAttribute::getFillBitmapAttribute(const basegfx::B2DRange& rRange) const
+ FillBitmapAttribute SdrFillBitmapAttribute::getFillBitmapAttribute(const basegfx::B2DRange& rRange) const
{
// get logical size of bitmap (before expanding eventually)
Bitmap aBitmap(maBitmap);
@@ -236,7 +236,7 @@ namespace drawinglayer
aBitmapSize.setY(aBitmapSize.getY() / fRangeHeight);
}
- return fillBitmapAttribute(aBitmap, aBitmapTopLeft, aBitmapSize, mbTiling);
+ return FillBitmapAttribute(aBitmap, aBitmapTopLeft, aBitmapSize, mbTiling);
}
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/geometry/makefile.mk b/drawinglayer/source/geometry/makefile.mk
index 3e1f2074a5b6..5c52333c57ae 100644
--- a/drawinglayer/source/geometry/makefile.mk
+++ b/drawinglayer/source/geometry/makefile.mk
@@ -4,9 +4,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.1 $
+# $Revision: 1.2 $
#
-# last change: $Author: aw $ $Date: 2006-05-12 11:49:41 $
+# last change: $Author: aw $ $Date: 2006-10-19 10:36:46 $
#
# The Contents of this file are made available subject to
# the terms of GNU Lesser General Public License Version 2.1.
@@ -44,8 +44,8 @@ TARGET=geometry
# --- Files -------------------------------------
SLOFILES= \
- $(SLO)$/viewinformation.obj \
- $(SLO)$/transformation3d.obj
+ $(SLO)$/transformation3d.obj \
+ $(SLO)$/viewinformation2d.obj
# --- Targets ----------------------------------
diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx b/drawinglayer/source/geometry/viewinformation2d.cxx
new file mode 100644
index 000000000000..0ad71b94dd80
--- /dev/null
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -0,0 +1,267 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: viewinformation2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:40: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_GEOMETRY_VIEWINFORMATION2D_HXX
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#endif
+
+#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#endif
+
+#ifndef _BGFX_RANGE_B2DRANGE_HXX
+#include <basegfx/range/b2drange.hxx>
+#endif
+
+#ifndef _OSL_MUTEX_HXX_
+#include <osl/mutex.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_GRAPHIC_PRIMITIVE2DPARAMETERS_HPP_
+#include "com/sun/star/graphic/Primitive2DParameters.hpp"
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace
+ {
+ class ImpViewInformation2D
+ {
+ private:
+ // ViewInformation2D implementation can change refcount, so we have only
+ // two memory regions for pairs of ViewInformation2D/ImpViewInformation2D
+ friend class ::drawinglayer::geometry::ViewInformation2D;
+
+ // the refcounter
+ sal_uInt32 mnRefCount;
+
+ protected:
+ // the view transformation
+ ::basegfx::B2DHomMatrix maViewTransformation;
+ ::basegfx::B2DHomMatrix maInverseViewTransformation;
+
+ // the visible ranges
+ ::basegfx::B2DRange maViewport;
+ ::basegfx::B2DRange maDiscreteViewport;
+
+ // the point in time
+ double mfViewTime;
+
+ // bitfield
+ unsigned mbInverseValid : 1;
+ unsigned mbDiscreteViewportValid : 1;
+
+ public:
+ ImpViewInformation2D(
+ const ::basegfx::B2DHomMatrix& rViewTransformation,
+ const ::basegfx::B2DRange& rViewport,
+ double fViewTime)
+ : mnRefCount(0L),
+ maViewTransformation(rViewTransformation),
+ maInverseViewTransformation(maViewTransformation),
+ maViewport(rViewport),
+ maDiscreteViewport(),
+ mfViewTime(fViewTime),
+ mbInverseValid(false),
+ mbDiscreteViewportValid(false)
+ {
+ }
+
+ ImpViewInformation2D(
+ const ::com::sun::star::graphic::Primitive2DParameters& rParams)
+ : mnRefCount(0L),
+ maViewTransformation(basegfx::unotools::homMatrixFromAffineMatrix(rParams.ViewTransformation)),
+ maInverseViewTransformation(maViewTransformation),
+ maViewport(basegfx::unotools::b2DRectangleFromRealRectangle2D(rParams.Viewport)),
+ maDiscreteViewport(),
+ mfViewTime(rParams.Time),
+ mbInverseValid(false),
+ mbDiscreteViewportValid(false)
+ {
+ }
+
+ bool operator==(const ImpViewInformation2D& rCandidate) const
+ {
+ return (maViewTransformation == rCandidate.maViewTransformation
+ && mfViewTime == rCandidate.mfViewTime
+ && maViewport == rCandidate.maViewport);
+ }
+
+ const ::basegfx::B2DHomMatrix& getViewTransformation() const { return maViewTransformation; }
+
+ const ::basegfx::B2DRange& getViewport() const { return maViewport; }
+
+ const ::basegfx::B2DRange& getDiscreteViewport() const
+ {
+ ::osl::Mutex m_mutex;
+
+ if(!mbDiscreteViewportValid)
+ {
+ ::basegfx::B2DRange aDiscreteViewport(maViewport);
+ aDiscreteViewport.transform(getViewTransformation());
+ const_cast< ImpViewInformation2D* >(this)->maDiscreteViewport = aDiscreteViewport;
+ const_cast< ImpViewInformation2D* >(this)->mbDiscreteViewportValid = true;
+ }
+
+ return maDiscreteViewport;
+ }
+
+ const ::basegfx::B2DHomMatrix& getInverseViewTransformation() const
+ {
+ ::osl::Mutex m_mutex;
+
+ if(!mbInverseValid)
+ {
+ const_cast< ImpViewInformation2D* >(this)->maInverseViewTransformation.invert();
+ const_cast< ImpViewInformation2D* >(this)->mbInverseValid = true;
+ }
+
+ return maInverseViewTransformation;
+ }
+
+ double getViewTime() const { return mfViewTime; }
+ };
+ } // end of anonymous namespace
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace geometry
+ {
+ ViewInformation2D::ViewInformation2D(
+ const ::basegfx::B2DHomMatrix& rViewTransformation,
+ const ::basegfx::B2DRange& rViewport,
+ double fViewTime)
+ : mpViewInformation2D(new ImpViewInformation2D(rViewTransformation, rViewport, fViewTime))
+ {
+ }
+
+ ViewInformation2D::ViewInformation2D(
+ const ::com::sun::star::graphic::Primitive2DParameters& rParams)
+ : mpViewInformation2D(new ImpViewInformation2D(rParams))
+ {
+ }
+
+ ViewInformation2D::ViewInformation2D(
+ const ViewInformation2D& rCandidate)
+ : mpViewInformation2D(rCandidate.mpViewInformation2D)
+ {
+ ::osl::Mutex m_mutex;
+ mpViewInformation2D->mnRefCount++;
+ }
+
+ ViewInformation2D::~ViewInformation2D()
+ {
+ ::osl::Mutex m_mutex;
+
+ if(mpViewInformation2D->mnRefCount)
+ {
+ mpViewInformation2D->mnRefCount--;
+ }
+ else
+ {
+ delete mpViewInformation2D;
+ }
+ }
+
+ ViewInformation2D& ViewInformation2D::operator=(const ViewInformation2D& rCandidate)
+ {
+ ::osl::Mutex m_mutex;
+
+ if(rCandidate.mpViewInformation2D != mpViewInformation2D)
+ {
+ if(mpViewInformation2D->mnRefCount)
+ {
+ mpViewInformation2D->mnRefCount--;
+ }
+ else
+ {
+ delete mpViewInformation2D;
+ }
+
+ mpViewInformation2D = rCandidate.mpViewInformation2D;
+ mpViewInformation2D->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool ViewInformation2D::operator==(const ViewInformation2D& rCandidate) const
+ {
+ if(rCandidate.mpViewInformation2D == mpViewInformation2D)
+ {
+ return true;
+ }
+
+ return (*rCandidate.mpViewInformation2D == *mpViewInformation2D);
+ }
+
+ const ::basegfx::B2DHomMatrix& ViewInformation2D::getViewTransformation() const
+ {
+ return mpViewInformation2D->getViewTransformation();
+ }
+
+ const ::basegfx::B2DRange& ViewInformation2D::getViewport() const
+ {
+ return mpViewInformation2D->getViewport();
+ }
+
+ const ::basegfx::B2DRange& ViewInformation2D::getDiscreteViewport() const
+ {
+ return mpViewInformation2D->getDiscreteViewport();
+ }
+
+ const ::basegfx::B2DHomMatrix& ViewInformation2D::getInverseViewTransformation() const
+ {
+ return mpViewInformation2D->getInverseViewTransformation();
+ }
+
+ double ViewInformation2D::getViewTime() const
+ {
+ return mpViewInformation2D->getViewTime();
+ }
+ } // end of namespace geometry
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/alphaprimitive2d.cxx b/drawinglayer/source/primitive2d/alphaprimitive2d.cxx
new file mode 100644
index 000000000000..5aedcead73b5
--- /dev/null
+++ b/drawinglayer/source/primitive2d/alphaprimitive2d.cxx
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: alphaprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35: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_ALPHAPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ AlphaPrimitive2D::AlphaPrimitive2D(
+ const Primitive2DSequence& rChildren,
+ const Primitive2DSequence& rAlpha)
+ : GroupPrimitive2D(rChildren),
+ maAlpha(rAlpha)
+ {
+ }
+
+ bool AlphaPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(GroupPrimitive2D::operator==(rPrimitive))
+ {
+ const AlphaPrimitive2D& rCompare = (AlphaPrimitive2D&)rPrimitive;
+
+ return (getAlpha() == rCompare.getAlpha());
+ }
+
+ return false;
+ }
+
+ sal_uInt32 AlphaPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','A','l','p');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/animatedprimitive2d.cxx b/drawinglayer/source/primitive2d/animatedprimitive2d.cxx
new file mode 100644
index 000000000000..18e39d7e086a
--- /dev/null
+++ b/drawinglayer/source/primitive2d/animatedprimitive2d.cxx
@@ -0,0 +1,256 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: animatedprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35: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_ANIMATEDPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/animatedprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_ANIMATION_ANIMATIONTIMING_HXX
+#include <drawinglayer/animation/animationtiming.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence AnimatedSwitchPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ if(getChildren().hasElements())
+ {
+ const double fState(getAnimationEntry().getStateAtTime(rViewInformation.getViewTime()));
+ const sal_Int32 nLen(getChildren().getLength());
+ sal_Int32 nIndex(basegfx::fround(fState * (double)nLen));
+
+ if(nIndex >= nLen)
+ {
+ nIndex = nLen - 1L;
+ }
+
+ const Primitive2DReference xRef(getChildren()[nIndex], uno::UNO_QUERY_THROW);
+ return Primitive2DSequence(&xRef, 1L);
+ }
+
+ return Primitive2DSequence();
+ }
+
+ AnimatedSwitchPrimitive2D::AnimatedSwitchPrimitive2D(
+ const animation::AnimationEntry& rAnimationEntry,
+ const Primitive2DSequence& rChildren,
+ bool bIsTextAnimation)
+ : GroupPrimitive2D(rChildren),
+ mpAnimationEntry(0),
+ mfDecomposeViewTime(0.0),
+ mbIsTextAnimation(bIsTextAnimation)
+ {
+ // clone given animation description
+ mpAnimationEntry = rAnimationEntry.clone();
+ }
+
+ AnimatedSwitchPrimitive2D::~AnimatedSwitchPrimitive2D()
+ {
+ // delete cloned animation description
+ delete mpAnimationEntry;
+ }
+
+ bool AnimatedSwitchPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(GroupPrimitive2D::operator==(rPrimitive))
+ {
+ const AnimatedSwitchPrimitive2D& rCompare = static_cast< const AnimatedSwitchPrimitive2D& >(rPrimitive);
+
+ return (getAnimationEntry() == rCompare.getAnimationEntry());
+ }
+
+ return false;
+ }
+
+ Primitive2DSequence AnimatedSwitchPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ if(getLocalDecomposition().hasElements() && mfDecomposeViewTime != rViewInformation.getViewTime())
+ {
+ // conditions of last local decomposition have changed, delete
+ const_cast< AnimatedSwitchPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence());
+ }
+
+ if(!getLocalDecomposition().hasElements())
+ {
+ // remember time
+ const_cast< AnimatedSwitchPrimitive2D* >(this)->mfDecomposeViewTime = rViewInformation.getViewTime();
+ }
+
+ // use parent implementation
+ return GroupPrimitive2D::get2DDecomposition(rViewInformation);
+ }
+
+ basegfx::B2DRange AnimatedSwitchPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ // to get range from decomposition and not from group content, call implementation from
+ // BasePrimitive2D here
+ return BasePrimitive2D::getB2DRange(rViewInformation);
+ }
+
+ sal_uInt32 AnimatedSwitchPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','A','S','w');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence AnimatedBlinkPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ if(getChildren().hasElements())
+ {
+ const double fState(getAnimationEntry().getStateAtTime(rViewInformation.getViewTime()));
+
+ if(fState < 0.5)
+ {
+ return getChildren();
+ }
+ }
+
+ return Primitive2DSequence();
+ }
+
+ AnimatedBlinkPrimitive2D::AnimatedBlinkPrimitive2D(
+ const animation::AnimationEntry& rAnimationEntry,
+ const Primitive2DSequence& rChildren,
+ bool bIsTextAnimation)
+ : AnimatedSwitchPrimitive2D(rAnimationEntry, rChildren, bIsTextAnimation)
+ {
+ }
+
+ sal_uInt32 AnimatedBlinkPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','A','B','l');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence AnimatedInterpolatePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ // ensure matrices are decomposed
+ if(!mbDecomposed)
+ {
+ const_cast< AnimatedInterpolatePrimitive2D* >(this)->implDecompose();
+ }
+
+ // create state at time
+ double fState(getAnimationEntry().getStateAtTime(rViewInformation.getViewTime()));
+
+ if(fState < 0.0)
+ {
+ fState = 0.0;
+ }
+
+ if(fState > 1.0)
+ {
+ fState = 1.0;
+ }
+
+ // interpolate for state
+ basegfx::B2DVector aScale(basegfx::interpolate(maScaleA, maScaleB, fState));
+ basegfx::B2DVector aTranslate(basegfx::interpolate(maTranslateA, maTranslateB, fState));
+ const double fRotate(((mfRotateB - mfRotateA) * fState) + mfRotateA);
+ const double fShearX(((mfShearXB - mfShearXA) * fState) + mfShearXA);
+
+ // build matrix for state
+ basegfx::B2DHomMatrix aMergedTransform;
+ aMergedTransform.scale(aScale.getX(), aScale.getY());
+ aMergedTransform.shearX(fShearX);
+ aMergedTransform.rotate(fRotate);
+ aMergedTransform.translate(aTranslate.getX(), aTranslate.getY());
+
+ // create new transform primitive reference, return new sequence
+ const Primitive2DReference xRef(new TransformPrimitive2D(aMergedTransform, getChildren()));
+ return Primitive2DSequence(&xRef, 1L);
+ }
+
+ void AnimatedInterpolatePrimitive2D::implDecompose()
+ {
+ maStart.decompose(maScaleA, maTranslateA, mfRotateA, mfShearXA);
+ maStop.decompose(maScaleB, maTranslateB, mfRotateB, mfShearXB);
+ mbDecomposed = true;
+ }
+
+ AnimatedInterpolatePrimitive2D::AnimatedInterpolatePrimitive2D(
+ const animation::AnimationEntry& rAnimationEntry,
+ const Primitive2DSequence& rChildren,
+ const basegfx::B2DHomMatrix& rStart,
+ const basegfx::B2DHomMatrix& rStop,
+ bool bIsTextAnimation)
+ : AnimatedSwitchPrimitive2D(rAnimationEntry, rChildren, bIsTextAnimation),
+ maStart(rStart),
+ maStop(rStop),
+ mbDecomposed(false)
+ {
+ }
+
+ sal_uInt32 AnimatedInterpolatePrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','A','I','n');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx b/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx
new file mode 100644
index 000000000000..644cd916da56
--- /dev/null
+++ b/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx
@@ -0,0 +1,138 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: backgroundcolorprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35: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_BACKGROUNDCOLORPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGON_HXX
+#include <basegfx/polygon/b2dpolygon.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGONTOOLS_HXX
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence BackgroundColorPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ if(!rViewInformation.getViewport().isEmpty())
+ {
+ const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(rViewInformation.getViewport()));
+ const Primitive2DReference xRef(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aOutline), getBColor()));
+ return Primitive2DSequence(&xRef, 1L);
+ }
+ else
+ {
+ return Primitive2DSequence();
+ }
+ }
+
+ BackgroundColorPrimitive2D::BackgroundColorPrimitive2D(
+ const basegfx::BColor& rBColor)
+ : BasePrimitive2D(),
+ maBColor(rBColor),
+ maLastViewport()
+ {
+ }
+
+ bool BackgroundColorPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const BackgroundColorPrimitive2D& rCompare = (BackgroundColorPrimitive2D&)rPrimitive;
+
+ return (getBColor() == rCompare.getBColor());
+ }
+
+ return false;
+ }
+
+ basegfx::B2DRange BackgroundColorPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ // always as big as the view
+ return rViewInformation.getViewport();
+ }
+
+ sal_uInt32 BackgroundColorPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','B','C','o');
+ }
+
+ Primitive2DSequence BackgroundColorPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ if(getLocalDecomposition().hasElements() && (maLastViewport != rViewInformation.getViewport()))
+ {
+ // conditions of last local decomposition have changed, delete
+ const_cast< BackgroundColorPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence());
+ }
+
+ if(!getLocalDecomposition().hasElements())
+ {
+ // remember ViewRange
+ const_cast< BackgroundColorPrimitive2D* >(this)->maLastViewport = rViewInformation.getViewport();
+ }
+
+ // use parent implementation
+ return BasePrimitive2D::get2DDecomposition(rViewInformation);
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
new file mode 100644
index 000000000000..2865904aa828
--- /dev/null
+++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
@@ -0,0 +1,274 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: baseprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35: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_BASEPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence BasePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ return Primitive2DSequence();
+ }
+
+ BasePrimitive2D::BasePrimitive2D()
+ : BasePrimitive2DImplBase(m_aMutex),
+ maLocalDecomposition()
+ {
+ }
+
+ bool BasePrimitive2D::operator==( const BasePrimitive2D& rPrimitive ) const
+ {
+ return (getPrimitiveID() == rPrimitive.getPrimitiveID());
+ }
+
+ basegfx::B2DRange BasePrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ return getB2DRangeFromPrimitive2DSequence(get2DDecomposition(rViewInformation), rViewInformation);
+ }
+
+ Primitive2DSequence BasePrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ if(!getLocalDecomposition().hasElements())
+ {
+ const Primitive2DSequence aNewSequence(createLocalDecomposition(rViewInformation));
+ const_cast< BasePrimitive2D* >(this)->setLocalDecomposition(aNewSequence);
+ }
+
+ return getLocalDecomposition();
+ }
+
+ Primitive2DSequence SAL_CALL BasePrimitive2D::getDecomposition( const graphic::Primitive2DParameters& aPrimitive2DParameters ) throw ( uno::RuntimeException )
+ {
+ const geometry::ViewInformation2D aViewInformation(aPrimitive2DParameters);
+ return get2DDecomposition(aViewInformation);
+ }
+
+ com::sun::star::geometry::RealRectangle2D SAL_CALL BasePrimitive2D::getRange( const graphic::Primitive2DParameters& aPrimitive2DParameters ) throw ( uno::RuntimeException )
+ {
+ const geometry::ViewInformation2D aViewInformation(aPrimitive2DParameters);
+ return basegfx::unotools::rectangle2DFromB2DRectangle(getB2DRange(aViewInformation));
+ }
+ } // 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)
+ {
+ basegfx::B2DRange aRetval;
+
+ if(rCandidate.is())
+ {
+ // try to get C++ implementation base
+ const BasePrimitive2D* pCandidate(dynamic_cast< BasePrimitive2D* >(rCandidate.get()));
+
+ if(pCandidate)
+ {
+ // use it if possible
+ aRetval.expand(pCandidate->getB2DRange(aViewInformation));
+ }
+ else
+ {
+ // use UNO API call instead
+ graphic::Primitive2DParameters aPrimitive2DParameters;
+
+ basegfx::unotools::affineMatrixFromHomMatrix(aPrimitive2DParameters.ViewTransformation, aViewInformation.getViewTransformation());
+ aPrimitive2DParameters.Viewport = basegfx::unotools::rectangle2DFromB2DRectangle(aViewInformation.getViewport());
+ aPrimitive2DParameters.Time = aViewInformation.getViewTime();
+
+ aRetval.expand(basegfx::unotools::b2DRectangleFromRealRectangle2D(rCandidate->getRange(aPrimitive2DParameters)));
+ }
+ }
+
+ return aRetval;
+ }
+
+ // get B2DRange from a given Primitive2DSequence
+ basegfx::B2DRange getB2DRangeFromPrimitive2DSequence(const Primitive2DSequence& rCandidate, const geometry::ViewInformation2D& aViewInformation)
+ {
+ basegfx::B2DRange aRetval;
+
+ if(rCandidate.hasElements())
+ {
+ const sal_Int32 nCount(rCandidate.getLength());
+
+ for(sal_Int32 a(0L); a < nCount; a++)
+ {
+ aRetval.expand(getB2DRangeFromPrimitive2DReference(rCandidate[a], aViewInformation));
+ }
+ }
+
+ return aRetval;
+ }
+
+ bool arePrimitive2DReferencesEqual(const Primitive2DReference& rxA, const Primitive2DReference& rxB)
+ {
+ const sal_Bool bAIs(rxA.is());
+
+ if(bAIs != rxB.is())
+ {
+ return false;
+ }
+
+ if(!bAIs)
+ {
+ return true;
+ }
+
+ const BasePrimitive2D* pA(dynamic_cast< const BasePrimitive2D* >(rxA.get()));
+ const BasePrimitive2D* pB(dynamic_cast< const BasePrimitive2D* >(rxB.get()));
+ const bool bAEqualZero(pA == 0L);
+
+ if(bAEqualZero != (pB == 0L))
+ {
+ return false;
+ }
+
+ if(bAEqualZero)
+ {
+ return false;
+ }
+
+ return (pA->operator==(*pB));
+ }
+
+ bool arePrimitive2DSequencesEqual(const Primitive2DSequence& rA, const Primitive2DSequence& rB)
+ {
+ const sal_Bool bAHasElements(rA.hasElements());
+
+ if(bAHasElements != rB.hasElements())
+ {
+ return false;
+ }
+
+ if(!bAHasElements)
+ {
+ return true;
+ }
+
+ const sal_Int32 nCount(rA.getLength());
+
+ if(nCount != rB.getLength())
+ {
+ return false;
+ }
+
+ for(sal_Int32 a(0L); a < nCount; a++)
+ {
+ if(!arePrimitive2DReferencesEqual(rA[a], rB[a]))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ // concatenate sequence
+ void appendPrimitive2DSequenceToPrimitive2DSequence(Primitive2DSequence& rDest, const Primitive2DSequence& rSource)
+ {
+ if(rSource.hasElements())
+ {
+ if(rDest.hasElements())
+ {
+ const sal_Int32 nSourceCount(rSource.getLength());
+ const sal_Int32 nDestCount(rDest.getLength());
+ const sal_Int32 nTargetCount(nSourceCount + nDestCount);
+ sal_Int32 nInsertPos(nDestCount);
+
+ rDest.realloc(nTargetCount);
+
+ for(sal_Int32 a(0L); a < nSourceCount; a++)
+ {
+ if(rSource[a].is())
+ {
+ rDest[nInsertPos++] = rSource[a];
+ }
+ }
+
+ if(nInsertPos != nTargetCount)
+ {
+ rDest.realloc(nInsertPos);
+ }
+ }
+ else
+ {
+ rDest = rSource;
+ }
+ }
+ }
+
+ // concatenate single Primitive2D
+ void appendPrimitive2DReferenceToPrimitive2DSequence(Primitive2DSequence& rDest, const Primitive2DReference& rSource)
+ {
+ if(rSource.is())
+ {
+ const sal_Int32 nDestCount(rDest.getLength());
+ rDest.realloc(nDestCount + 1L);
+ rDest[nDestCount] = rSource;
+ }
+ }
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx
new file mode 100644
index 000000000000..c228f57a4ba9
--- /dev/null
+++ b/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: bitmapprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35: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_BITMAPPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ BitmapPrimitive2D::BitmapPrimitive2D(
+ const BitmapEx& rBitmapEx,
+ const basegfx::B2DHomMatrix& rTransform)
+ : BasePrimitive2D(),
+ maBitmapEx(rBitmapEx),
+ maTransform(rTransform)
+ {
+ }
+
+ bool BitmapPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const BitmapPrimitive2D& rCompare = (BitmapPrimitive2D&)rPrimitive;
+
+ return (maBitmapEx == rCompare.maBitmapEx
+ && maTransform == rCompare.maTransform);
+ }
+
+ return false;
+ }
+
+ sal_uInt32 BitmapPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','B','i','t');
+ }
+
+ basegfx::B2DRange BitmapPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0);
+ aRetval.transform(maTransform);
+ return aRetval;
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx b/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx
new file mode 100644
index 000000000000..959f9d028d4b
--- /dev/null
+++ b/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx
@@ -0,0 +1,137 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: embedded3dprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35: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_EMBEDDED3DPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/embedded3dprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGON_HXX
+#include <basegfx/polygon/b2dpolygon.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGONTOOLS_HXX
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#endif
+
+#ifndef _BGFX_COLOR_BCOLOR_HXX
+#include <basegfx/color/bcolor.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYGONPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence Embedded3DPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ // use info to create a yellow 2d rectangle, similar to empty 3d scenes and/or groups
+ basegfx::B3DRange a3DRange(primitive3d::getB3DRangeFromPrimitive3DSequence(getChildren3D(), rViewInformation.getViewTime()));
+ a3DRange.transform(getTransformation3D().getWorldToView());
+
+ // create 2d range from projected 3d and transform with scene's object transformation
+ basegfx::B2DRange a2DRange;
+ a2DRange.expand(basegfx::B2DPoint(a3DRange.getMinX(), a3DRange.getMinY()));
+ a2DRange.expand(basegfx::B2DPoint(a3DRange.getMaxX(), a3DRange.getMaxY()));
+ a2DRange.transform(getTransformation3D().getObjectTransformation());
+
+ const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(a2DRange));
+ const basegfx::BColor aYellow(1.0, 1.0, 0.0);
+ const Primitive2DReference xRef(new PolygonHairlinePrimitive2D(aOutline, aYellow));
+ return Primitive2DSequence(&xRef, 1L);
+ }
+
+ Embedded3DPrimitive2D::Embedded3DPrimitive2D(
+ const primitive3d::Primitive3DSequence& rxChildren3D,
+ const geometry::Transformation3D& rTransformation3D)
+ : BasePrimitive2D(),
+ mxChildren3D(rxChildren3D),
+ maTransformation3D(rTransformation3D)
+ {
+ }
+
+ bool Embedded3DPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const Embedded3DPrimitive2D& rCompare = static_cast< const Embedded3DPrimitive2D& >(rPrimitive);
+
+ return (primitive3d::arePrimitive3DSequencesEqual(getChildren3D(), rCompare.getChildren3D())
+ && getTransformation3D() == rCompare.getTransformation3D());
+ }
+
+ return false;
+ }
+
+ sal_uInt32 Embedded3DPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','E','m','b');
+ }
+
+ basegfx::B2DRange Embedded3DPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ // use the 3d transformation stack to create a projection of the 3D range
+ basegfx::B3DRange a3DRange(primitive3d::getB3DRangeFromPrimitive3DSequence(getChildren3D(), rViewInformation.getViewTime()));
+ a3DRange.transform(getTransformation3D().getWorldToView());
+
+ // create 2d range from projected 3d and transform with scene's object transformation
+ basegfx::B2DRange aRetval;
+ aRetval.expand(basegfx::B2DPoint(a3DRange.getMinX(), a3DRange.getMinY()));
+ aRetval.expand(basegfx::B2DPoint(a3DRange.getMaxX(), a3DRange.getMaxY()));
+ aRetval.transform(getTransformation3D().getObjectTransformation());
+
+ return aRetval;
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx
new file mode 100644
index 000000000000..cabbc2b7afab
--- /dev/null
+++ b/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx
@@ -0,0 +1,156 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: fillbitmapprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35: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_FILLBITMAPPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/fillbitmapprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE_BITMAPPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGON_HXX
+#include <basegfx/polygon/b2dpolygon.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGONTOOLS_HXX
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE_HXX
+#include <drawinglayer/texture/texture.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence FillBitmapPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ const Size aTileSizePixel(getFillBitmap().getBitmap().GetSizePixel());
+ Primitive2DSequence aRetval;
+
+ // is there a tile with some size at all?
+ if(aTileSizePixel.getWidth() && aTileSizePixel.getHeight())
+ {
+ if(getFillBitmap().getTiling())
+ {
+ // get object range and create tiling matrices
+ ::std::vector< basegfx::B2DHomMatrix > aMatrices;
+ texture::GeoTexSvxTiled aTiling(getFillBitmap().getTopLeft(), getFillBitmap().getSize());
+ aTiling.appendTransformations(aMatrices);
+
+ // resize result
+ aRetval.realloc(aMatrices.size());
+
+ // create one primitive for each matrix
+ for(sal_uInt32 a(0L); a < aMatrices.size(); a++)
+ {
+ basegfx::B2DHomMatrix aNewMatrix = aMatrices[a];
+ aNewMatrix *= getTransformation();
+
+ // create bitmap primitive and add to result
+ const Primitive2DReference xRef(new BitmapPrimitive2D(BitmapEx(getFillBitmap().getBitmap()), aNewMatrix));
+ aRetval[a] = xRef;
+ }
+ }
+ else
+ {
+ // create new object transform
+ basegfx::B2DHomMatrix aObjectTransform;
+ aObjectTransform.set(0L, 0L, getFillBitmap().getSize().getX());
+ aObjectTransform.set(1L, 1L, getFillBitmap().getSize().getY());
+ aObjectTransform.set(0L, 2L, getFillBitmap().getTopLeft().getX());
+ aObjectTransform.set(1L, 2L, getFillBitmap().getTopLeft().getY());
+ aObjectTransform *= getTransformation();
+
+ // create bitmap primitive and add exclusive to decomposition (hand over ownership)
+ const Primitive2DReference xRef(new BitmapPrimitive2D(BitmapEx(getFillBitmap().getBitmap()), aObjectTransform));
+ aRetval = Primitive2DSequence(&xRef, 1L);
+ }
+ }
+
+ return aRetval;
+ }
+
+ FillBitmapPrimitive2D::FillBitmapPrimitive2D(
+ const basegfx::B2DHomMatrix& rTransformation,
+ const attribute::FillBitmapAttribute& rFillBitmap)
+ : BasePrimitive2D(),
+ maTransformation(rTransformation),
+ maFillBitmap(rFillBitmap)
+ {
+ }
+
+ bool FillBitmapPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const FillBitmapPrimitive2D& rCompare = static_cast< const FillBitmapPrimitive2D& >(rPrimitive);
+
+ return (getTransformation() == rCompare.getTransformation()
+ && getFillBitmap() == rCompare.getFillBitmap());
+ }
+
+ return false;
+ }
+
+ basegfx::B2DRange FillBitmapPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ // return range of it
+ basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ aPolygon.transform(getTransformation());
+ return basegfx::tools::getRange(aPolygon);
+ }
+
+ sal_uInt32 FillBitmapPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','F','B','i');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
new file mode 100644
index 000000000000..e5ddbacbdbc9
--- /dev/null
+++ b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
@@ -0,0 +1,217 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: fillgradientprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35: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_FILLGRADIENTPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGON_HXX
+#include <basegfx/polygon/b2dpolygon.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGONTOOLS_HXX
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE_HXX
+#include <drawinglayer/texture/texture.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence FillGradientPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ const attribute::GradientStyle aGradientStyle(maFillGradient.getStyle());
+ ::std::vector< basegfx::B2DHomMatrix > aMatrices;
+ ::std::vector< basegfx::BColor > aColors;
+ basegfx::B2DPolygon aUnitPolygon;
+ sal_uInt32 nSteps(maFillGradient.getSteps());
+
+ if(attribute::GRADIENTSTYLE_RADIAL == aGradientStyle || attribute::GRADIENTSTYLE_ELLIPTICAL == aGradientStyle)
+ {
+ const basegfx::B2DPoint aCircleCenter(0.5, 0.5);
+ aUnitPolygon = basegfx::tools::createPolygonFromEllipse(aCircleCenter, 0.5, 0.5);
+ aUnitPolygon = basegfx::tools::adaptiveSubdivideByAngle(aUnitPolygon);
+ }
+ else
+ {
+ aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0));
+ }
+
+ // make sure steps is not too high/low
+ const basegfx::BColor aStart(maFillGradient.getStartColor());
+ const basegfx::BColor aEnd(maFillGradient.getEndColor());
+ const sal_uInt32 nMaxSteps(sal_uInt32((aStart.getMaximumDistance(aEnd) * 127.5) + 0.5));
+
+ if(nSteps == 0L)
+ {
+ nSteps = nMaxSteps;
+ }
+
+ if(nSteps < 2L)
+ {
+ nSteps = 2L;
+ }
+
+ if(nSteps > nMaxSteps)
+ {
+ nSteps = nMaxSteps;
+ }
+
+ switch(aGradientStyle)
+ {
+ case attribute::GRADIENTSTYLE_LINEAR:
+ {
+ texture::GeoTexSvxGradientLinear aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), -maFillGradient.getAngle());
+ aGradient.appendTransformations(aMatrices);
+ aGradient.appendColors(aColors);
+ break;
+ }
+ case attribute::GRADIENTSTYLE_AXIAL:
+ {
+ texture::GeoTexSvxGradientAxial aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), -maFillGradient.getAngle());
+ aGradient.appendTransformations(aMatrices);
+ aGradient.appendColors(aColors);
+ break;
+ }
+ case attribute::GRADIENTSTYLE_RADIAL:
+ {
+ texture::GeoTexSvxGradientRadial aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY());
+ aGradient.appendTransformations(aMatrices);
+ aGradient.appendColors(aColors);
+ break;
+ }
+ case attribute::GRADIENTSTYLE_ELLIPTICAL:
+ {
+ texture::GeoTexSvxGradientElliptical aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), -maFillGradient.getAngle());
+ aGradient.appendTransformations(aMatrices);
+ aGradient.appendColors(aColors);
+ break;
+ }
+ case attribute::GRADIENTSTYLE_SQUARE:
+ {
+ texture::GeoTexSvxGradientSquare aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), -maFillGradient.getAngle());
+ aGradient.appendTransformations(aMatrices);
+ aGradient.appendColors(aColors);
+ break;
+ }
+ case attribute::GRADIENTSTYLE_RECT:
+ {
+ texture::GeoTexSvxGradientRect aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), -maFillGradient.getAngle());
+ aGradient.appendTransformations(aMatrices);
+ aGradient.appendColors(aColors);
+ break;
+ }
+ }
+
+ // prepare return value
+ Primitive2DSequence aRetval(aColors.size() ? aMatrices.size() + 1L : aMatrices.size());
+
+ // create solid fill with start color
+ if(aColors.size())
+ {
+ // create primitive
+ const Primitive2DReference xRef(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(getObjectRange())), aColors[0L]));
+ aRetval[0L] = xRef;
+ }
+
+ // create solid fill steps
+ for(sal_uInt32 a(0L); a < aMatrices.size(); a++)
+ {
+ // create part polygon
+ basegfx::B2DPolygon aNewPoly(aUnitPolygon);
+ aNewPoly.transform(aMatrices[a]);
+
+ // create solid fill
+ const Primitive2DReference xRef(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aNewPoly), aColors[a + 1L]));
+ aRetval[a + 1L] = xRef;
+ }
+
+ return aRetval;
+ }
+
+ FillGradientPrimitive2D::FillGradientPrimitive2D(
+ const basegfx::B2DRange& rObjectRange,
+ const attribute::FillGradientAttribute& rFillGradient)
+ : BasePrimitive2D(),
+ maObjectRange(rObjectRange),
+ maFillGradient(rFillGradient)
+ {
+ }
+
+ bool FillGradientPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const FillGradientPrimitive2D& rCompare = (FillGradientPrimitive2D&)rPrimitive;
+
+ return (getObjectRange() == rCompare.getObjectRange()
+ && maFillGradient == rCompare.maFillGradient);
+ }
+
+ return false;
+ }
+
+ basegfx::B2DRange FillGradientPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ // return ObjectRange
+ return getObjectRange();
+ }
+
+ sal_uInt32 FillGradientPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','F','G','r');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
new file mode 100644
index 000000000000..a5f813839349
--- /dev/null
+++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
@@ -0,0 +1,175 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: fillhatchprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35: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_FILLHATCHPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE_HXX
+#include <drawinglayer/texture/texture.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGONTOOLS_HXX
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGON_HXX
+#include <basegfx/polygon/b2dpolygon.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYGONPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence FillHatchPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ // create hatch
+ const basegfx::BColor aHatchColor(maFillHatch.getColor());
+ const double fAngle(-maFillHatch.getAngle());
+ ::std::vector< basegfx::B2DHomMatrix > aMatrices;
+
+ // get hatch transformations
+ switch(maFillHatch.getStyle())
+ {
+ case attribute::HATCHSTYLE_TRIPLE:
+ {
+ // rotated 45 degrees
+ texture::GeoTexSvxHatch aHatch(getObjectRange(), maFillHatch.getDistance(), fAngle + F_PI4);
+ aHatch.appendTransformations(aMatrices);
+ }
+ case attribute::HATCHSTYLE_DOUBLE:
+ {
+ // rotated 90 degrees
+ texture::GeoTexSvxHatch aHatch(getObjectRange(), maFillHatch.getDistance(), fAngle + F_PI2);
+ aHatch.appendTransformations(aMatrices);
+ }
+ case attribute::HATCHSTYLE_SINGLE:
+ {
+ // angle as given
+ texture::GeoTexSvxHatch aHatch(getObjectRange(), maFillHatch.getDistance(), fAngle);
+ aHatch.appendTransformations(aMatrices);
+ }
+ }
+
+ // prepare return value
+ const bool bFillBackground(maFillHatch.isFillBackground());
+ Primitive2DSequence aRetval(bFillBackground ? aMatrices.size() + 1L : aMatrices.size());
+
+ // evtl. create filled background
+ if(bFillBackground)
+ {
+ // create primitive for background
+ const Primitive2DReference xRef(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(getObjectRange())), maBColor));
+ aRetval[0L] = xRef;
+ }
+
+ // create primitives
+ const basegfx::B2DPoint aStart(0.0, 0.0);
+ const basegfx::B2DPoint aEnd(1.0, 0.0);
+
+ for(sal_uInt32 a(0L); a < aMatrices.size(); a++)
+ {
+ const basegfx::B2DHomMatrix& rMatrix = aMatrices[a];
+ basegfx::B2DPolygon aNewLine;
+
+ aNewLine.append(rMatrix * aStart);
+ aNewLine.append(rMatrix * aEnd);
+
+ // create hairline
+ const Primitive2DReference xRef(new PolygonHairlinePrimitive2D(aNewLine, aHatchColor));
+ aRetval[bFillBackground ? (a + 1L) : a] = xRef;
+ }
+
+ return aRetval;
+ }
+
+ FillHatchPrimitive2D::FillHatchPrimitive2D(
+ const basegfx::B2DRange& rObjectRange,
+ const basegfx::BColor& rBColor,
+ const attribute::FillHatchAttribute& rFillHatch)
+ : BasePrimitive2D(),
+ maObjectRange(rObjectRange),
+ maFillHatch(rFillHatch),
+ maBColor(rBColor)
+ {
+ }
+
+ bool FillHatchPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const FillHatchPrimitive2D& rCompare = (FillHatchPrimitive2D&)rPrimitive;
+
+ return (getObjectRange() == rCompare.getObjectRange()
+ && maFillHatch == rCompare.maFillHatch
+ && maBColor == rCompare.maBColor);
+ }
+
+ return false;
+ }
+
+ basegfx::B2DRange FillHatchPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ // return ObjectRange
+ return getObjectRange();
+ }
+
+ sal_uInt32 FillHatchPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','F','H','a');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/gridprimitive2d.cxx b/drawinglayer/source/primitive2d/gridprimitive2d.cxx
new file mode 100644
index 000000000000..9bb9d88fefd7
--- /dev/null
+++ b/drawinglayer/source/primitive2d/gridprimitive2d.cxx
@@ -0,0 +1,302 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: gridprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35: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_GRIDPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/gridprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MARKERPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/markerprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence GridPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ std::vector< BasePrimitive2D* > aTempPrimitiveTarget;
+
+ if(!rViewInformation.getViewport().isEmpty() && getWidth() > 0.0 && getHeight() > 0.0)
+ {
+ // decompose grid matrix to get logic size
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ getTransform().decompose(aScale, aTranslate, fRotate, fShearX);
+
+ // create grid matrix which transforms from scaled logic to view
+ basegfx::B2DHomMatrix aRST;
+ aRST.rotate(fRotate);
+ aRST.shearX(fShearX);
+ aRST.translate(aTranslate.getX(), aTranslate.getY());
+ aRST *= rViewInformation.getViewTransformation();
+
+ // get step widths
+ double fStepX(getWidth());
+ double fStepY(getHeight());
+ const double fMinimalStep(10.0);
+
+ // guarantee a step width of 100.0
+ if(basegfx::fTools::less(fStepX, fMinimalStep))
+ {
+ fStepX = fMinimalStep;
+ }
+
+ if(basegfx::fTools::less(fStepY, fMinimalStep))
+ {
+ fStepY = fMinimalStep;
+ }
+
+ // get relative distances in view
+ double fViewStepX((rViewInformation.getViewTransformation() * basegfx::B2DVector(fStepX, 0.0)).getLength());
+ double fViewStepY((rViewInformation.getViewTransformation() * basegfx::B2DVector(0.0, fStepY)).getLength());
+ double fSmallStepX(1.0), fViewSmallStepX(1.0), fSmallStepY(1.0), fViewSmallStepY(1.0);
+ sal_uInt32 nSmallStepsX(0L), nSmallStepsY(0L);
+
+ // setup subdivisions
+ if(getSubdivisionsX())
+ {
+ fSmallStepX = fStepX / getSubdivisionsX();
+ fViewSmallStepX = fViewStepX / getSubdivisionsX();
+ }
+
+ if(getSubdivisionsY())
+ {
+ fSmallStepY = fStepY / getSubdivisionsY();
+ fViewSmallStepY = fViewStepY / getSubdivisionsY();
+ }
+
+ // correct step width
+ while(fViewStepX < getSmallestViewDistance())
+ {
+ fViewStepX *= 2.0;
+ fStepX *= 2.0;
+ }
+
+ while(fViewStepY < getSmallestViewDistance())
+ {
+ fViewStepY *= 2.0;
+ fStepY *= 2.0;
+ }
+
+ // correct small step width
+ if(getSubdivisionsX())
+ {
+ while(fViewSmallStepX < getSmallestSubdivisionViewDistance())
+ {
+ fViewSmallStepX *= 2.0;
+ fSmallStepX *= 2.0;
+ }
+
+ nSmallStepsX = (sal_uInt32)(fStepX / fSmallStepX);
+ }
+
+ if(getSubdivisionsY())
+ {
+ while(fViewSmallStepY < getSmallestSubdivisionViewDistance())
+ {
+ fViewSmallStepY *= 2.0;
+ fSmallStepY *= 2.0;
+ }
+
+ nSmallStepsY = (sal_uInt32)(fStepY / fSmallStepY);
+ }
+
+ for(double fX(0.0); fX < aScale.getX(); fX += fStepX)
+ {
+ const bool bXZero(basegfx::fTools::equalZero(fX));
+
+ for(double fY(0.0); fY < aScale.getY(); fY += fStepY)
+ {
+ const bool bYZero(basegfx::fTools::equalZero(fY));
+ basegfx::B2DPoint aViewPos(aRST * basegfx::B2DPoint(fX, fY));
+
+ if(rViewInformation.getDiscreteViewport().isInside(aViewPos) && !bXZero && !bYZero)
+ {
+ const basegfx::B2DPoint aLogicPos(rViewInformation.getInverseViewTransformation() * aViewPos);
+ MarkerPrimitive2D* pNew = new MarkerPrimitive2D(aLogicPos, 0.5, 0.5, getBColor(), MARKERSTYLE2D_CROSS);
+ aTempPrimitiveTarget.push_back(pNew);
+ }
+
+ if(getSubdivisionsX() && !bYZero)
+ {
+ double fF(fX + fSmallStepX);
+
+ for(sal_uInt32 a(0L); a < nSmallStepsX && fF < aScale.getX(); a++, fF += fSmallStepX)
+ {
+ aViewPos = aRST * basegfx::B2DPoint(fF, fY);
+
+ if(rViewInformation.getDiscreteViewport().isInside(aViewPos))
+ {
+ const basegfx::B2DPoint aLogicPos(rViewInformation.getInverseViewTransformation() * aViewPos);
+ MarkerPrimitive2D* pNew = new MarkerPrimitive2D(aLogicPos, 0.5, 0.5, getBColor(), MARKERSTYLE2D_POINT);
+ aTempPrimitiveTarget.push_back(pNew);
+ }
+ }
+ }
+
+ if(getSubdivisionsY() && !bXZero)
+ {
+ double fF(fY + fSmallStepY);
+
+ for(sal_uInt32 a(0L); a < nSmallStepsY && fF < aScale.getY(); a++, fF += fSmallStepY)
+ {
+ aViewPos = aRST * basegfx::B2DPoint(fX, fF);
+
+ if(rViewInformation.getDiscreteViewport().isInside(aViewPos))
+ {
+ const basegfx::B2DPoint aLogicPos(rViewInformation.getInverseViewTransformation() * aViewPos);
+ MarkerPrimitive2D* pNew = new MarkerPrimitive2D(aLogicPos, 0.5, 0.5, getBColor(), MARKERSTYLE2D_POINT);
+ aTempPrimitiveTarget.push_back(pNew);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // prepare return value
+ Primitive2DSequence aRetval(aTempPrimitiveTarget.size());
+
+ for(sal_uInt32 a(0L); a < aTempPrimitiveTarget.size(); a++)
+ {
+ const Primitive2DReference xRef(aTempPrimitiveTarget[a]);
+ aRetval[a] = xRef;
+ }
+
+ return aRetval;
+ }
+
+ GridPrimitive2D::GridPrimitive2D(
+ const basegfx::B2DHomMatrix& rTransform,
+ double fWidth,
+ double fHeight,
+ double fSmallestViewDistance,
+ double fSmallestSubdivisionViewDistance,
+ sal_uInt32 nSubdivisionsX,
+ sal_uInt32 nSubdivisionsY,
+ const basegfx::BColor& rBColor)
+ : BasePrimitive2D(),
+ maTransform(rTransform),
+ mfWidth(fWidth),
+ mfHeight(fHeight),
+ mfSmallestViewDistance(fSmallestViewDistance),
+ mfSmallestSubdivisionViewDistance(fSmallestSubdivisionViewDistance),
+ mnSubdivisionsX(nSubdivisionsX),
+ mnSubdivisionsY(nSubdivisionsY),
+ maBColor(rBColor),
+ maLastViewTransformation(),
+ maLastViewport()
+ {
+ }
+
+ bool GridPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const GridPrimitive2D& rCompare = (GridPrimitive2D&)rPrimitive;
+
+ return (getTransform() == rCompare.getTransform()
+ && getWidth() == rCompare.getWidth()
+ && getHeight() == rCompare.getHeight()
+ && getSmallestViewDistance() == rCompare.getSmallestViewDistance()
+ && getSmallestSubdivisionViewDistance() == rCompare.getSmallestSubdivisionViewDistance()
+ && getSubdivisionsX() == rCompare.getSubdivisionsX()
+ && getSubdivisionsY() == rCompare.getSubdivisionsY()
+ && getBColor() == rCompare.getBColor());
+ }
+
+ return false;
+ }
+
+ basegfx::B2DRange GridPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ // get object's range
+ basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
+ aUnitRange.transform(getTransform());
+
+ // intersect with visible part
+ aUnitRange.intersect(rViewInformation.getViewport());
+
+ return aUnitRange;
+ }
+
+ sal_uInt32 GridPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','G','r','i');
+ }
+
+ Primitive2DSequence GridPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ if(getLocalDecomposition().hasElements())
+ {
+ if(maLastViewport != rViewInformation.getViewport() || maLastViewTransformation != rViewInformation.getViewTransformation())
+ {
+ // conditions of last local decomposition have changed, delete
+ const_cast< GridPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence());
+ }
+ }
+
+ if(!getLocalDecomposition().hasElements())
+ {
+ // remember ViewRange and ViewTransformation
+ const_cast< GridPrimitive2D* >(this)->maLastViewTransformation = rViewInformation.getViewTransformation();
+ const_cast< GridPrimitive2D* >(this)->maLastViewport = rViewInformation.getViewport();
+ }
+
+ // use parent implementation
+ return BasePrimitive2D::get2DDecomposition(rViewInformation);
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/groupprimitive2d.cxx b/drawinglayer/source/primitive2d/groupprimitive2d.cxx
new file mode 100644
index 000000000000..da6a0c370f86
--- /dev/null
+++ b/drawinglayer/source/primitive2d/groupprimitive2d.cxx
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: groupprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35: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_GROUPPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /// default: just return children, so all renderers not supporting group will use it's content
+ Primitive2DSequence GroupPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ return getChildren();
+ }
+
+ GroupPrimitive2D::GroupPrimitive2D( const Primitive2DSequence& rChildren )
+ : BasePrimitive2D(),
+ maChildren(rChildren)
+ {
+ }
+
+ /** The compare opertator uses the Sequence::==operator, so only checking if
+ the rererences are equal. All non-equal references are interpreted as
+ non-equal.
+ */
+ bool GroupPrimitive2D::operator==( const BasePrimitive2D& rPrimitive ) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const GroupPrimitive2D& rCompare = static_cast< const GroupPrimitive2D& >(rPrimitive);
+
+ return (arePrimitive2DSequencesEqual(getChildren(), rCompare.getChildren()));
+ }
+
+ return false;
+ }
+
+ sal_uInt32 GroupPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','G','r','o');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/helplineprimitive2d.cxx b/drawinglayer/source/primitive2d/helplineprimitive2d.cxx
new file mode 100644
index 000000000000..231c683812db
--- /dev/null
+++ b/drawinglayer/source/primitive2d/helplineprimitive2d.cxx
@@ -0,0 +1,245 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: helplineprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35: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_HELPLINEPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/helplineprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGON_HXX
+#include <basegfx/polygon/b2dpolygon.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYGONPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_POLYPOLYGON_B2DPOLYGONCLIPPER_HXX
+#include <basegfx/polygon/b2dpolygonclipper.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence HelplinePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ std::vector< BasePrimitive2D* > aTempPrimitiveTarget;
+
+ if(!rViewInformation.getViewport().isEmpty() && !getDirection().equalZero())
+ {
+ // position to view coordinates, DashLen and DashLen in logic
+ const basegfx::B2DPoint aViewPosition(rViewInformation.getViewTransformation() * getPosition());
+ const double fLogicDashLen((rViewInformation.getInverseViewTransformation() * basegfx::B2DVector(getViewDashLength(), 0.0)).getLength());
+
+ switch(getStyle())
+ {
+ default : // HELPLINESTYLE2D_POINT
+ {
+ const double fViewFixValue(15.0);
+ basegfx::B2DVector aNormalizedDirection(getDirection());
+ aNormalizedDirection.normalize();
+ aNormalizedDirection *= fViewFixValue;
+ const basegfx::B2DPoint aStartA(aViewPosition - aNormalizedDirection);
+ const basegfx::B2DPoint aEndA(aViewPosition + aNormalizedDirection);
+ basegfx::B2DPolygon aLineA;
+ aLineA.append(aStartA);
+ aLineA.append(aEndA);
+ aLineA.transform(rViewInformation.getInverseViewTransformation());
+ PolygonMarkerPrimitive2D* pNewA = new PolygonMarkerPrimitive2D(aLineA, getRGBColA(), getRGBColB(), fLogicDashLen);
+ aTempPrimitiveTarget.push_back(pNewA);
+
+ const basegfx::B2DVector aPerpendicularNormalizedDirection(getPerpendicular(aNormalizedDirection));
+ const basegfx::B2DPoint aStartB(aViewPosition - aPerpendicularNormalizedDirection);
+ const basegfx::B2DPoint aEndB(aViewPosition + aPerpendicularNormalizedDirection);
+ basegfx::B2DPolygon aLineB;
+ aLineB.append(aStartB);
+ aLineB.append(aEndB);
+ aLineB.transform(rViewInformation.getInverseViewTransformation());
+ PolygonMarkerPrimitive2D* pNewB = new PolygonMarkerPrimitive2D(aLineB, getRGBColA(), getRGBColB(), fLogicDashLen);
+ aTempPrimitiveTarget.push_back(pNewB);
+
+ break;
+ }
+ case HELPLINESTYLE2D_LINE :
+ {
+ basegfx::B2DPolygon aLine;
+
+ if(basegfx::areParallel(getDirection(), basegfx::B2DVector(1.0, 0.0)))
+ {
+ // parallel to X-Axis, get cuts with Y-Axes
+ const double fCutA((rViewInformation.getDiscreteViewport().getMinX() - aViewPosition.getX()) / getDirection().getX());
+ const double fCutB((rViewInformation.getDiscreteViewport().getMaxX() - aViewPosition.getX()) / getDirection().getX());
+ const basegfx::B2DPoint aPosA(aViewPosition + (fCutA * getDirection()));
+ const basegfx::B2DPoint aPosB(aViewPosition + (fCutB * getDirection()));
+ const bool bBothLeft(aPosA.getX() < rViewInformation.getDiscreteViewport().getMinX() && aPosB.getX() < rViewInformation.getDiscreteViewport().getMinX());
+ const bool bBothRight(aPosA.getX() > rViewInformation.getDiscreteViewport().getMaxX() && aPosB.getX() < rViewInformation.getDiscreteViewport().getMaxX());
+
+ if(!bBothLeft && !bBothRight)
+ {
+ aLine.append(aPosA);
+ aLine.append(aPosB);
+ }
+ }
+ else
+ {
+ // get cuts with X-Axes
+ const double fCutA((rViewInformation.getDiscreteViewport().getMinY() - aViewPosition.getY()) / getDirection().getY());
+ const double fCutB((rViewInformation.getDiscreteViewport().getMaxY() - aViewPosition.getY()) / getDirection().getY());
+ const basegfx::B2DPoint aPosA(aViewPosition + (fCutA * getDirection()));
+ const basegfx::B2DPoint aPosB(aViewPosition + (fCutB * getDirection()));
+ const bool bBothAbove(aPosA.getY() < rViewInformation.getDiscreteViewport().getMinY() && aPosB.getY() < rViewInformation.getDiscreteViewport().getMinY());
+ const bool bBothBelow(aPosA.getY() > rViewInformation.getDiscreteViewport().getMaxY() && aPosB.getY() < rViewInformation.getDiscreteViewport().getMaxY());
+
+ if(!bBothAbove && !bBothBelow)
+ {
+ aLine.append(aPosA);
+ aLine.append(aPosB);
+ }
+ }
+
+ if(aLine.count())
+ {
+ // clip against visible area
+ const basegfx::B2DPolyPolygon aResult(basegfx::tools::clipPolygonOnRange(aLine, rViewInformation.getDiscreteViewport(), true, true));
+
+ for(sal_uInt32 a(0L); a < aResult.count(); a++)
+ {
+ basegfx::B2DPolygon aPart(aResult.getB2DPolygon(a));
+ aPart.transform(rViewInformation.getInverseViewTransformation());
+ PolygonMarkerPrimitive2D* pNew = new PolygonMarkerPrimitive2D(aPart, getRGBColA(), getRGBColB(), fLogicDashLen);
+ aTempPrimitiveTarget.push_back(pNew);
+ }
+ }
+
+ break;
+ }
+ }
+ }
+
+ // prepare return value
+ Primitive2DSequence aRetval(aTempPrimitiveTarget.size());
+
+ for(sal_uInt32 a(0L); a < aTempPrimitiveTarget.size(); a++)
+ {
+ const Primitive2DReference xRef(aTempPrimitiveTarget[a]);
+ aRetval[a] = xRef;
+ }
+
+ return aRetval;
+ }
+
+ HelplinePrimitive2D::HelplinePrimitive2D(
+ const basegfx::B2DPoint& rPosition,
+ const basegfx::B2DVector& rDirection,
+ HelplineStyle2D eStyle,
+ const basegfx::BColor& rRGBColA,
+ const basegfx::BColor& rRGBColB,
+ double fViewDashLength)
+ : BasePrimitive2D(),
+ maPosition(rPosition),
+ maDirection(rDirection),
+ meStyle(eStyle),
+ maRGBColA(rRGBColA),
+ maRGBColB(rRGBColB),
+ mfViewDashLength(fViewDashLength),
+ maLastViewTransformation(),
+ maLastViewport()
+ {
+ }
+
+ bool HelplinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const HelplinePrimitive2D& rCompare = (HelplinePrimitive2D&)rPrimitive;
+
+ return (getPosition() == rCompare.getPosition()
+ && getDirection() == rCompare.getDirection()
+ && getStyle() == rCompare.getStyle()
+ && getRGBColA() == rCompare.getRGBColA()
+ && getRGBColB() == rCompare.getRGBColB()
+ && getViewDashLength() == rCompare.getViewDashLength());
+ }
+
+ return false;
+ }
+
+ sal_uInt32 HelplinePrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','H','e','l');
+ }
+
+ Primitive2DSequence HelplinePrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ if(getLocalDecomposition().hasElements())
+ {
+ if(maLastViewport != rViewInformation.getViewport() || maLastViewTransformation != rViewInformation.getViewTransformation())
+ {
+ // conditions of last local decomposition have changed, delete
+ const_cast< HelplinePrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence());
+ }
+ }
+
+ if(!getLocalDecomposition().hasElements())
+ {
+ // remember ViewRange and ViewTransformation
+ const_cast< HelplinePrimitive2D* >(this)->maLastViewTransformation = rViewInformation.getViewTransformation();
+ const_cast< HelplinePrimitive2D* >(this)->maLastViewport = rViewInformation.getViewport();
+ }
+
+ // use parent implementation
+ return BasePrimitive2D::get2DDecomposition(rViewInformation);
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/makefile.mk b/drawinglayer/source/primitive2d/makefile.mk
new file mode 100644
index 000000000000..a4d65536d4a0
--- /dev/null
+++ b/drawinglayer/source/primitive2d/makefile.mk
@@ -0,0 +1,75 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1 $
+#
+# last change: $Author: aw $ $Date: 2006-10-19 10:35: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
+#
+#*************************************************************************
+
+PRJ=..$/..
+PRJNAME=drawinglayer
+TARGET=primitive2d
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings ----------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Files -------------------------------------
+
+SLOFILES= \
+ $(SLO)$/alphaprimitive2d.obj \
+ $(SLO)$/animatedprimitive2d.obj \
+ $(SLO)$/baseprimitive2d.obj \
+ $(SLO)$/backgroundcolorprimitive2d.obj \
+ $(SLO)$/bitmapprimitive2d.obj \
+ $(SLO)$/embedded3dprimitive2d.obj \
+ $(SLO)$/fillbitmapprimitive2d.obj \
+ $(SLO)$/fillgradientprimitive2d.obj \
+ $(SLO)$/fillhatchprimitive2d.obj \
+ $(SLO)$/gridprimitive2d.obj \
+ $(SLO)$/groupprimitive2d.obj \
+ $(SLO)$/helplineprimitive2d.obj \
+ $(SLO)$/markerprimitive2d.obj \
+ $(SLO)$/maskprimitive2d.obj \
+ $(SLO)$/metafileprimitive2d.obj \
+ $(SLO)$/modifiedcolorprimitive2d.obj \
+ $(SLO)$/polypolygonprimitive2d.obj \
+ $(SLO)$/polygonprimitive2d.obj \
+ $(SLO)$/sceneprimitive2d.obj \
+ $(SLO)$/shadowprimitive2d.obj \
+ $(SLO)$/textlayoutdevice.obj \
+ $(SLO)$/textprimitive2d.obj \
+ $(SLO)$/transformprimitive2d.obj \
+ $(SLO)$/unifiedalphaprimitive2d.obj
+
+# --- Targets ----------------------------------
+
+.INCLUDE : target.mk
diff --git a/drawinglayer/source/primitive2d/maskprimitive2d.cxx b/drawinglayer/source/primitive2d/maskprimitive2d.cxx
new file mode 100644
index 000000000000..7aae26bdf45c
--- /dev/null
+++ b/drawinglayer/source/primitive2d/maskprimitive2d.cxx
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: maskprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35: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_MASKPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ MaskPrimitive2D::MaskPrimitive2D(
+ const basegfx::B2DPolyPolygon& rMask,
+ const Primitive2DSequence& rChildren)
+ : GroupPrimitive2D(rChildren),
+ maMask(rMask)
+ {
+ }
+
+ bool MaskPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(GroupPrimitive2D::operator==(rPrimitive))
+ {
+ const MaskPrimitive2D& rCompare = static_cast< const MaskPrimitive2D& >(rPrimitive);
+
+ return (getMask() == rCompare.getMask());
+ }
+
+ return false;
+ }
+
+ sal_uInt32 MaskPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','M','a','s');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
new file mode 100644
index 000000000000..cbdefa340c7b
--- /dev/null
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: metafileprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35: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_METAFILEPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ MetafilePrimitive2D::MetafilePrimitive2D(
+ const GDIMetaFile& rMetaFile,
+ const basegfx::B2DHomMatrix& rMetaFileTransform)
+ : BasePrimitive2D(),
+ maMetaFile(rMetaFile),
+ maMetaFileTransform(rMetaFileTransform)
+ {
+ }
+
+ bool MetafilePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const MetafilePrimitive2D& rCompare = (MetafilePrimitive2D&)rPrimitive;
+
+ return (getMetaFile() == rCompare.getMetaFile()
+ && getTransform() == rCompare.getTransform());
+ }
+
+ return false;
+ }
+
+ sal_uInt32 MetafilePrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','M','e','t');
+ }
+
+ basegfx::B2DRange MetafilePrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0);
+ aRetval.transform(getTransform());
+ return aRetval;
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx b/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx
new file mode 100644
index 000000000000..36432333122c
--- /dev/null
+++ b/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: modifiedcolorprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35: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_MODIFIEDCOLORPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ ModifiedColorPrimitive2D::ModifiedColorPrimitive2D(
+ const Primitive2DSequence& rChildren,
+ const basegfx::BColorModifier& rColorModifier)
+ : GroupPrimitive2D(rChildren),
+ maColorModifier(rColorModifier)
+ {
+ }
+
+ bool ModifiedColorPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(GroupPrimitive2D::operator==(rPrimitive))
+ {
+ const ModifiedColorPrimitive2D& rCompare = (ModifiedColorPrimitive2D&)rPrimitive;
+
+ return (getColorModifier() == rCompare.getColorModifier());
+ }
+
+ return false;
+ }
+
+ sal_uInt32 ModifiedColorPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','M','C','o');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
new file mode 100644
index 000000000000..9dc860899b09
--- /dev/null
+++ b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
@@ -0,0 +1,434 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: polygonprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35: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_POLYGONPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGONTOOLS_HXX
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#endif
+
+#ifndef _BGFX_POLYPOLYGON_B2DPOLYGONTOOLS_HXX
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ PolygonHairlinePrimitive2D::PolygonHairlinePrimitive2D(
+ const basegfx::B2DPolygon& rPolygon,
+ const basegfx::BColor& rBColor)
+ : BasePrimitive2D(),
+ maPolygon(rPolygon),
+ maBColor(rBColor)
+ {
+ }
+
+ bool PolygonHairlinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const PolygonHairlinePrimitive2D& rCompare = (PolygonHairlinePrimitive2D&)rPrimitive;
+
+ return (getB2DPolygon() == rCompare.getB2DPolygon()
+ && getBColor() == rCompare.getBColor());
+ }
+
+ return false;
+ }
+
+ basegfx::B2DRange PolygonHairlinePrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ // return range
+ return basegfx::tools::getRange(basegfx::tools::adaptiveSubdivideByAngle(getB2DPolygon()));
+ }
+
+ sal_uInt32 PolygonHairlinePrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','P','H','a');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence PolygonMarkerPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ if(getDashLength() > 0.0)
+ {
+ ::std::vector< double > aDashA;
+ ::std::vector< double > aDashB;
+
+ aDashA.push_back(getDashLength());
+ aDashA.push_back(getDashLength());
+
+ aDashB.push_back(0.0);
+ aDashB.push_back(getDashLength());
+ aDashB.push_back(getDashLength());
+ aDashB.push_back(0.0);
+
+ const basegfx::B2DPolyPolygon aDashedPolyPolyA(basegfx::tools::applyLineDashing(getB2DPolygon(), aDashA, 2.0 * getDashLength()));
+ const basegfx::B2DPolyPolygon aDashedPolyPolyB(basegfx::tools::applyLineDashing(getB2DPolygon(), aDashB, 2.0 * getDashLength()));
+
+ // prepare return value
+ Primitive2DSequence aRetval(aDashedPolyPolyA.count() + aDashedPolyPolyB.count());
+ sal_uInt32 a(0L), b(0L);
+
+ for(; a < aDashedPolyPolyA.count(); a++)
+ {
+ const Primitive2DReference xRef(new PolygonHairlinePrimitive2D(aDashedPolyPolyA.getB2DPolygon(a), getRGBColorA()));
+ aRetval[a] = xRef;
+ }
+
+ for(; b < aDashedPolyPolyB.count(); b++)
+ {
+ const Primitive2DReference xRef(new PolygonHairlinePrimitive2D(aDashedPolyPolyB.getB2DPolygon(b), getRGBColorB()));
+ aRetval[a + b] = xRef;
+ }
+
+ return aRetval;
+ }
+ else
+ {
+ const Primitive2DReference xRef(new PolygonHairlinePrimitive2D(getB2DPolygon(), getRGBColorA()));
+ return Primitive2DSequence(&xRef, 1L);
+ }
+ }
+
+ PolygonMarkerPrimitive2D::PolygonMarkerPrimitive2D(
+ const basegfx::B2DPolygon& rPolygon,
+ const basegfx::BColor& rRGBColorA,
+ const basegfx::BColor& rRGBColorB,
+ double fDashLength)
+ : BasePrimitive2D(),
+ maPolygon(rPolygon),
+ maRGBColorA(rRGBColorA),
+ maRGBColorB(rRGBColorB),
+ mfDashLength(fDashLength)
+ {
+ }
+
+ bool PolygonMarkerPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const PolygonMarkerPrimitive2D& rCompare = (PolygonMarkerPrimitive2D&)rPrimitive;
+
+ return (getB2DPolygon() == rCompare.getB2DPolygon()
+ && getRGBColorA() == rCompare.getRGBColorA()
+ && getRGBColorB() == rCompare.getRGBColorB()
+ && getDashLength() == rCompare.getDashLength());
+ }
+
+ return false;
+ }
+
+ basegfx::B2DRange PolygonMarkerPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ // return range
+ return basegfx::tools::getRange(basegfx::tools::adaptiveSubdivideByAngle(getB2DPolygon()));
+ }
+
+ sal_uInt32 PolygonMarkerPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','P','M','a');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence PolygonStrokePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ if(getB2DPolygon().count())
+ {
+ basegfx::B2DPolyPolygon aHairLinePolyPolygon;
+
+ if(0.0 == getStrokeAttribute().getFullDotDashLen())
+ {
+ aHairLinePolyPolygon.append(getB2DPolygon());
+ }
+ else
+ {
+ // apply LineStyle
+ const basegfx::B2DPolygon aHairLinePolygon(basegfx::tools::adaptiveSubdivideByAngle(getB2DPolygon()));
+ aHairLinePolyPolygon = basegfx::tools::applyLineDashing(aHairLinePolygon, getStrokeAttribute().getDotDashArray(), getStrokeAttribute().getFullDotDashLen());
+
+ // merge LineStyle polygons to bigger parts
+ aHairLinePolyPolygon = basegfx::tools::mergeDashedLines(aHairLinePolyPolygon);
+ }
+
+ if(getStrokeAttribute().getWidth())
+ {
+ // create fat line data
+ aHairLinePolyPolygon = basegfx::tools::adaptiveSubdivideByAngle(aHairLinePolyPolygon);
+ const double fHalfLineWidth(getStrokeAttribute().getWidth() / 2.0);
+ const double fDegreeStepWidth(10.0 * F_PI180);
+ const double fMiterMinimumAngle(15.0 * F_PI180);
+ const basegfx::tools::B2DLineJoin aLineJoin(getStrokeAttribute().getLineJoin());
+ basegfx::B2DPolyPolygon aAreaPolyPolygon;
+
+ for(sal_uInt32 a(0L); a < aHairLinePolyPolygon.count(); a++)
+ {
+ const basegfx::B2DPolyPolygon aNewPolyPolygon(basegfx::tools::createAreaGeometryForPolygon(
+ aHairLinePolyPolygon.getB2DPolygon(a), fHalfLineWidth, aLineJoin, fDegreeStepWidth, fMiterMinimumAngle));
+ aAreaPolyPolygon.append(aNewPolyPolygon);
+ }
+
+ // prepare return value
+ Primitive2DSequence aRetval(aAreaPolyPolygon.count());
+
+ // create primitive
+ for(sal_uInt32 b(0L); b < aAreaPolyPolygon.count(); b++)
+ {
+ // put into single polyPolygon primitives to make clear thta this is NOT meant
+ // to be painted XORed as fill rule. Alternatively, a melting process may be used
+ // here one day.
+ const basegfx::B2DPolyPolygon aNewPolyPolygon(aAreaPolyPolygon.getB2DPolygon(b));
+ const Primitive2DReference xRef(new PolyPolygonColorPrimitive2D(aNewPolyPolygon, getStrokeAttribute().getColor()));
+ aRetval[b] = xRef;
+ }
+
+ return aRetval;
+ }
+ else
+ {
+ // prepare return value
+ Primitive2DSequence aRetval(aHairLinePolyPolygon.count());
+
+ // create hair line data for all sub polygons
+ for(sal_uInt32 a(0L); a < aHairLinePolyPolygon.count(); a++)
+ {
+ const basegfx::B2DPolygon aCandidate = aHairLinePolyPolygon.getB2DPolygon(a);
+ const Primitive2DReference xRef(new PolygonHairlinePrimitive2D(aCandidate, getStrokeAttribute().getColor()));
+ aRetval[a] = xRef;
+ }
+
+ return aRetval;
+ }
+ }
+ else
+ {
+ return Primitive2DSequence();
+ }
+ }
+
+ PolygonStrokePrimitive2D::PolygonStrokePrimitive2D(
+ const basegfx::B2DPolygon& rPolygon,
+ const attribute::StrokeAttribute& rStrokeAttribute)
+ : BasePrimitive2D(),
+ maPolygon(rPolygon),
+ maStrokeAttribute(rStrokeAttribute)
+ {
+ }
+
+ bool PolygonStrokePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const PolygonStrokePrimitive2D& rCompare = (PolygonStrokePrimitive2D&)rPrimitive;
+
+ return (getB2DPolygon() == rCompare.getB2DPolygon()
+ && getStrokeAttribute() == rCompare.getStrokeAttribute());
+ }
+
+ return false;
+ }
+
+ basegfx::B2DRange PolygonStrokePrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ // get range of it (subdivided)
+ basegfx::B2DRange aRetval(basegfx::tools::getRange(basegfx::tools::adaptiveSubdivideByAngle(getB2DPolygon())));
+
+ // if width, grow by line width
+ if(getStrokeAttribute().getWidth())
+ {
+ aRetval.grow(getStrokeAttribute().getWidth() / 2.0);
+ }
+
+ return aRetval;
+ }
+
+ sal_uInt32 PolygonStrokePrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','P','S','t');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence PolygonStrokeArrowPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ // copy local polygon, it may be changed
+ basegfx::B2DPolygon aLocalPolygon(getB2DPolygon());
+ basegfx::B2DPolyPolygon aArrowA;
+ basegfx::B2DPolyPolygon aArrowB;
+
+ if(!aLocalPolygon.isClosed())
+ {
+ // apply arrows. To do that, make sure it's not a curve (necessary at the moment, maybe optimized later)
+ aLocalPolygon = basegfx::tools::adaptiveSubdivideByAngle(aLocalPolygon);
+ const double fPolyLength(basegfx::tools::getLength(aLocalPolygon));
+ double fStart(0.0);
+ double fEnd(0.0);
+
+ if(getStart().isActive())
+ {
+ // create start arrow primitive and consume
+ aArrowA = basegfx::tools::createAreaGeometryForLineStartEnd(
+ aLocalPolygon, getStart().getB2DPolyPolygon(), true, getStart().getWidth(), getStart().isCentered() ? 0.5 : 0.0, &fStart);
+
+ // create some overlapping
+ fStart *= 0.8;
+ }
+
+ if(getEnd().isActive())
+ {
+ // create end arrow primitive and consume
+ aArrowB = basegfx::tools::createAreaGeometryForLineStartEnd(
+ aLocalPolygon, getEnd().getB2DPolyPolygon(), false, getEnd().getWidth(), getEnd().isCentered() ? 0.5 : 0.0, &fEnd);
+
+ // create some overlapping
+ fEnd *= 0.8;
+ }
+
+ if(0.0 != fStart || 0.0 != fEnd)
+ {
+ // build new poly, consume something from old poly
+ aLocalPolygon = basegfx::tools::getSnippetAbsolute(aLocalPolygon, fStart, fPolyLength - fEnd, fPolyLength);
+ }
+ }
+
+ // prepare return value
+ Primitive2DSequence aRetval(1L + (aArrowA.count() ? 1L : 0L) + (aArrowB.count() ? 1L : 0L));
+ sal_uInt32 nInd(0L);
+
+ // add shaft
+ const Primitive2DReference xRefShaft(new PolygonStrokePrimitive2D(aLocalPolygon, getStrokeAttribute()));
+ aRetval[nInd++] = xRefShaft;
+
+ if(aArrowA.count())
+ {
+ const Primitive2DReference xRefA(new PolyPolygonColorPrimitive2D(aArrowA, getStrokeAttribute().getColor()));
+ aRetval[nInd++] = xRefA;
+ }
+
+ if(aArrowB.count())
+ {
+ const Primitive2DReference xRefB(new PolyPolygonColorPrimitive2D(aArrowB, getStrokeAttribute().getColor()));
+ aRetval[nInd++] = xRefB;
+ }
+
+ return aRetval;
+ }
+
+ PolygonStrokeArrowPrimitive2D::PolygonStrokeArrowPrimitive2D(
+ const basegfx::B2DPolygon& rPolygon,
+ const attribute::StrokeAttribute& rStrokeAttribute,
+ const attribute::StrokeArrowAttribute& rStart,
+ const attribute::StrokeArrowAttribute& rEnd)
+ : PolygonStrokePrimitive2D(rPolygon, rStrokeAttribute),
+ maStart(rStart),
+ maEnd(rEnd)
+ {
+ }
+
+ bool PolygonStrokeArrowPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(PolygonStrokePrimitive2D::operator==(rPrimitive))
+ {
+ const PolygonStrokeArrowPrimitive2D& rCompare = (PolygonStrokeArrowPrimitive2D&)rPrimitive;
+
+ return (getStart() == rCompare.getStart()
+ && getEnd() == rCompare.getEnd());
+ }
+
+ return false;
+ }
+
+ basegfx::B2DRange PolygonStrokeArrowPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ basegfx::B2DRange aRetval;
+
+ if(getStart().isActive() || getEnd().isActive())
+ {
+ // use decomposition when line start/end is used
+ return BasePrimitive2D::getB2DRange(rViewInformation);
+ }
+ else
+ {
+ // get range from parent
+ return PolygonStrokePrimitive2D::getB2DRange(rViewInformation);
+ }
+ }
+
+ sal_uInt32 PolygonStrokeArrowPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','P','S','A');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
new file mode 100644
index 000000000000..6320dd6f04d8
--- /dev/null
+++ b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
@@ -0,0 +1,261 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: polypolygonprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35:04 $
+ *
+ * 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
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_POLYPOLYGON_B2DPOLYGONTOOLS_HXX
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLGRADIENTPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MASKPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLHATCHPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLBITMAPPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/fillbitmapprimitive2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ PolyPolygonColorPrimitive2D::PolyPolygonColorPrimitive2D(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const basegfx::BColor& rBColor)
+ : BasePrimitive2D(),
+ maPolyPolygon(rPolyPolygon),
+ maBColor(rBColor)
+ {
+ }
+
+ bool PolyPolygonColorPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const PolyPolygonColorPrimitive2D& rCompare = (PolyPolygonColorPrimitive2D&)rPrimitive;
+
+ return (getB2DPolyPolygon() == rCompare.getB2DPolyPolygon()
+ && getBColor() == rCompare.getBColor());
+ }
+
+ return false;
+ }
+
+ basegfx::B2DRange PolyPolygonColorPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ // return range
+ return basegfx::tools::getRange(basegfx::tools::adaptiveSubdivideByAngle(getB2DPolyPolygon()));
+ }
+
+ sal_uInt32 PolyPolygonColorPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','P','P','C');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence PolyPolygonGradientPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ // create SubSequence with FillGradientPrimitive2D
+ FillGradientPrimitive2D* pNewGradient = new FillGradientPrimitive2D(getB2DRange(rViewInformation), getFillGradient());
+ const Primitive2DReference xSubRef(pNewGradient);
+ const Primitive2DSequence aSubSequence(&xSubRef, 1L);
+
+ // create mask primitive
+ MaskPrimitive2D* pNewMask = new MaskPrimitive2D(getB2DPolyPolygon(), aSubSequence);
+ const Primitive2DReference xRef(pNewMask);
+ return Primitive2DSequence(&xRef, 1L);
+ }
+
+ PolyPolygonGradientPrimitive2D::PolyPolygonGradientPrimitive2D(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const basegfx::BColor& rBColor,
+ const attribute::FillGradientAttribute& rFillGradient)
+ : PolyPolygonColorPrimitive2D(rPolyPolygon, rBColor),
+ maFillGradient(rFillGradient)
+ {
+ }
+
+ bool PolyPolygonGradientPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(PolyPolygonColorPrimitive2D::operator==(rPrimitive))
+ {
+ const PolyPolygonGradientPrimitive2D& rCompare = (PolyPolygonGradientPrimitive2D&)rPrimitive;
+
+ return (getFillGradient() == rCompare.getFillGradient());
+ }
+
+ return false;
+ }
+
+ sal_uInt32 PolyPolygonGradientPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','P','P','G');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence PolyPolygonHatchPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ // create SubSequence with FillHatchPrimitive2D
+ FillHatchPrimitive2D* pNewHatch = new FillHatchPrimitive2D(getB2DRange(rViewInformation), getBColor(), getFillHatch());
+ const Primitive2DReference xSubRef(pNewHatch);
+ const Primitive2DSequence aSubSequence(&xSubRef, 1L);
+
+ // create mask primitive
+ MaskPrimitive2D* pNewMask = new MaskPrimitive2D(getB2DPolyPolygon(), aSubSequence);
+ const Primitive2DReference xRef(pNewMask);
+ return Primitive2DSequence(&xRef, 1L);
+ }
+
+ PolyPolygonHatchPrimitive2D::PolyPolygonHatchPrimitive2D(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const basegfx::BColor& rBColor,
+ const attribute::FillHatchAttribute& rFillHatch)
+ : PolyPolygonColorPrimitive2D(rPolyPolygon, rBColor),
+ maFillHatch(rFillHatch)
+ {
+ }
+
+ bool PolyPolygonHatchPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(PolyPolygonColorPrimitive2D::operator==(rPrimitive))
+ {
+ const PolyPolygonHatchPrimitive2D& rCompare = (PolyPolygonHatchPrimitive2D&)rPrimitive;
+
+ return (getFillHatch() == rCompare.getFillHatch());
+ }
+
+ return false;
+ }
+
+ sal_uInt32 PolyPolygonHatchPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','P','P','H');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence PolyPolygonBitmapPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ // create SubSequence with FillBitmapPrimitive2D
+ const basegfx::B2DRange aOwnRange(getB2DRange(rViewInformation));
+ basegfx::B2DHomMatrix aNewObjectTransform;
+ aNewObjectTransform.set(0, 0, aOwnRange.getWidth());
+ aNewObjectTransform.set(1, 1, aOwnRange.getHeight());
+ aNewObjectTransform.set(0, 2, aOwnRange.getMinX());
+ aNewObjectTransform.set(1, 2, aOwnRange.getMinY());
+ FillBitmapPrimitive2D* pNewBitmap = new FillBitmapPrimitive2D(aNewObjectTransform, getFillBitmap());
+ const Primitive2DReference xSubRef(pNewBitmap);
+ const Primitive2DSequence aSubSequence(&xSubRef, 1L);
+
+ // create mask primitive
+ MaskPrimitive2D* pNewMask = new MaskPrimitive2D(getB2DPolyPolygon(), aSubSequence);
+ const Primitive2DReference xRef(pNewMask);
+ return Primitive2DSequence(&xRef, 1L);
+ }
+
+ PolyPolygonBitmapPrimitive2D::PolyPolygonBitmapPrimitive2D(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const basegfx::BColor& rBColor,
+ const attribute::FillBitmapAttribute& rFillBitmap)
+ : PolyPolygonColorPrimitive2D(rPolyPolygon, rBColor),
+ maFillBitmap(rFillBitmap)
+ {
+ }
+
+ bool PolyPolygonBitmapPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(PolyPolygonColorPrimitive2D::operator==(rPrimitive))
+ {
+ const PolyPolygonBitmapPrimitive2D& rCompare = (PolyPolygonBitmapPrimitive2D&)rPrimitive;
+
+ return (getFillBitmap() == rCompare.getFillBitmap());
+ }
+
+ return false;
+ }
+
+ sal_uInt32 PolyPolygonBitmapPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','P','P','B');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
new file mode 100644
index 000000000000..1b4584582dc9
--- /dev/null
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -0,0 +1,427 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sceneprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35:04 $
+ *
+ * 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
+#include <drawinglayer/primitive2d/sceneprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGONTOOLS_HXX
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGON_HXX
+#include <basegfx/polygon/b2dpolygon.hxx>
+#endif
+
+#ifndef _BGFX_POLYPOLYGON_B2DPOLYGONCLIPPER_HXX
+#include <basegfx/polygon/b2dpolygonclipper.hxx>
+#endif
+
+#ifndef _BGFX_POLYPOLYGON_B2DPOLYGONTOOLS_HXX
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#endif
+
+#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BITMAPPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_DEFAULTPROCESSOR3D_HXX
+#include <drawinglayer/processor3d/defaultprocessor3d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_SHADOW3DEXTRACTOR_HXX
+#include <drawinglayer/processor3d/shadow3dextractor.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_LABEL3DEXTRACTOR_HXX
+#include <drawinglayer/processor3d/label3dextractor.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence ScenePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ Primitive2DSequence aRetval;
+
+ // create 2D shadows from contained 3D primitives. This creates the shadow primitives on demand and tells if
+ // there are some or not. Do this at start, the shadow might still be visible even when the scene is not
+ if(impGetShadow3D(rViewInformation))
+ {
+ // test visibility
+ const basegfx::B2DRange aShadow2DRange(getB2DRangeFromPrimitive2DSequence(maShadowPrimitives, rViewInformation));
+
+ if(aShadow2DRange.overlaps(rViewInformation.getViewport()))
+ {
+ // add extracted 2d shadows (before 3d scene creations itself)
+ aRetval = maShadowPrimitives;
+ }
+ }
+
+ // get geometry of output range
+ basegfx::B2DPolygon aLogicOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ aLogicOutline.transform(getTransformation3D().getObjectTransformation());
+
+ // clip it against ViewRange
+ const basegfx::B2DPolyPolygon aLogicClippedOutline(basegfx::tools::clipPolygonOnRange(aLogicOutline, rViewInformation.getViewport(), true, false));
+ const basegfx::B2DRange aLogicVisiblePart(basegfx::tools::getRange(aLogicClippedOutline));
+
+ if(!aLogicVisiblePart.isEmpty())
+ {
+ // transform back to unity
+ basegfx::B2DHomMatrix aInverseTransform(getTransformation3D().getObjectTransformation());
+ basegfx::B2DPolyPolygon aUnitClippedOutline(aLogicClippedOutline);
+ aInverseTransform.invert();
+ aUnitClippedOutline.transform(aInverseTransform);
+
+ // get logical size by decomposing
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ getTransformation3D().getObjectTransformation().decompose(aScale, aTranslate, fRotate, fShearX);
+
+ // get logical sizes and generate visible part in unit coordinates
+ double fLogicSizeX(aScale.getX());
+ double fLogicSizeY(aScale.getY());
+ const basegfx::B2DRange aUnitVisiblePart(basegfx::tools::getRange(aUnitClippedOutline));
+
+ // test if view size (pixel) maybe too big and limit it
+ const double fViewSizeX(fLogicSizeX * (rViewInformation.getViewTransformation() * basegfx::B2DVector(aUnitVisiblePart.getWidth(), 0.0)).getLength());
+ const double fViewSizeY(fLogicSizeY * (rViewInformation.getViewTransformation() * basegfx::B2DVector(0.0, aUnitVisiblePart.getHeight())).getLength());
+ const double fViewVisibleArea(fViewSizeX * fViewSizeY);
+ double fReduceFactor(1.0);
+
+ if(fViewVisibleArea > 1000000.0)
+ {
+ fReduceFactor = sqrt(1000000.0 / fViewVisibleArea);
+ fLogicSizeX *= fReduceFactor;
+ fLogicSizeY *= fReduceFactor;
+ }
+
+ // use default 3D primitive processor to create BitmapEx for aUnitVisiblePart and process
+ processor3d::DefaultProcessor3D aProcessor3D(
+ rViewInformation,
+ getTransformation3D(),
+ getSdrSceneAttribute(),
+ getSdrLightingAttribute(),
+ fLogicSizeX,
+ fLogicSizeY,
+ aUnitVisiblePart);
+
+ aProcessor3D.processNonTransparent(getChildren3D());
+ aProcessor3D.processTransparent(getChildren3D());
+
+ const BitmapEx aNewBitmap(aProcessor3D.getBitmapEx());
+ const Size aBitmapSizePixel(aNewBitmap.GetSizePixel());
+
+ if(aBitmapSizePixel.getWidth() && aBitmapSizePixel.getHeight())
+ {
+ // correct reduce-factor free logic, view-unit-aligned coordinates for the created bitmap
+ // without translation
+ basegfx::B2DPoint aViewTopLeft(aUnitVisiblePart.getMinX() * aScale.getX(), aUnitVisiblePart.getMinY() * aScale.getY());
+ aViewTopLeft *= rViewInformation.getViewTransformation();
+ aViewTopLeft.setX(floor(aViewTopLeft.getX()));
+ aViewTopLeft.setY(floor(aViewTopLeft.getY()));
+ const basegfx::B2DPoint aLogicTopLeft(rViewInformation.getInverseViewTransformation() * aViewTopLeft);
+
+ // same for size, do not forget to correct by fReduceFactor
+ const basegfx::B2DVector aViewSize(aBitmapSizePixel.getWidth() / fReduceFactor, aBitmapSizePixel.getHeight() / fReduceFactor);
+ const basegfx::B2DVector aLogicSize(rViewInformation.getInverseViewTransformation() * aViewSize);
+
+ // create 2d transform from it. Target is to always have a output-pixel-aligned
+ // logic position and size wich corresponds to the bitmap size (when no reduceFactor)
+ basegfx::B2DHomMatrix aNew2DTransform;
+ aNew2DTransform.scale(aLogicSize.getX(), aLogicSize.getY());
+ aNew2DTransform.translate(aLogicTopLeft.getX(), aLogicTopLeft.getY());
+ aNew2DTransform.shearX(fShearX);
+ aNew2DTransform.rotate(fRotate);
+ aNew2DTransform.translate(aTranslate.getX(), aTranslate.getY());
+
+ // create bitmap primitive and add
+ BitmapPrimitive2D* pNewTextBitmap = new BitmapPrimitive2D(aNewBitmap, aNew2DTransform);
+ const Primitive2DReference xRef(pNewTextBitmap);
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, xRef);
+
+#ifdef DBG_UTIL
+ {
+ // check if pixel size and transformation is correct
+ if(basegfx::fTools::equal(fReduceFactor, 1.0))
+ {
+ if(basegfx::fTools::equalZero(fShearX) && basegfx::fTools::equalZero(fRotate))
+ {
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+
+ pNewTextBitmap->getTransform().decompose(aScale, aTranslate, fRotate, fShearX);
+ basegfx::B2DVector aViewSize(basegfx::absolute(aScale));
+ aViewSize *= rViewInformation.getViewTransformation();
+ const Size aSourceSizePixel(pNewTextBitmap->getBitmapEx().GetSizePixel());
+ const bool bXEqual(aSourceSizePixel.getWidth() == basegfx::fround(aViewSize.getX()));
+ const bool bYEqual(aSourceSizePixel.getHeight() == basegfx::fround(aViewSize.getY()));
+ OSL_ENSURE(bXEqual && bYEqual, "3D renderer produced non-pixel-aligned graphic (!)");
+ }
+ }
+ }
+#endif
+ }
+ }
+
+ // create 2D labels from contained 3D label primitives. This creates the label primitives on demand and tells if
+ // there are some or not. Do this at end, the labels might still be visible even when the scene is not
+ if(impGetLabel3D(rViewInformation))
+ {
+ // test visibility
+ const basegfx::B2DRange aLabel2DRange(getB2DRangeFromPrimitive2DSequence(maLabelPrimitives, rViewInformation));
+
+ if(aLabel2DRange.overlaps(rViewInformation.getViewport()))
+ {
+ // add extracted 2d labels (after 3d scene creations)
+ appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, maLabelPrimitives);
+ }
+ }
+
+ return aRetval;
+ }
+
+ ScenePrimitive2D::ScenePrimitive2D(
+ const primitive3d::Primitive3DSequence& rxChildren3D,
+ const attribute::SdrSceneAttribute& rSdrSceneAttribute,
+ const attribute::SdrLightingAttribute& rSdrLightingAttribute,
+ const geometry::Transformation3D& rTransformation3D)
+ : BasePrimitive2D(),
+ mxChildren3D(rxChildren3D),
+ maSdrSceneAttribute(rSdrSceneAttribute),
+ maSdrLightingAttribute(rSdrLightingAttribute),
+ maTransformation3D(rTransformation3D),
+ mbShadow3DChecked(false),
+ mbLabel3DChecked(false),
+ maLastViewTransformation(),
+ maLastViewport()
+ {
+ }
+
+ bool ScenePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const ScenePrimitive2D& rCompare = (ScenePrimitive2D&)rPrimitive;
+
+ return (primitive3d::arePrimitive3DSequencesEqual(getChildren3D(), rCompare.getChildren3D())
+ && getSdrSceneAttribute() == rCompare.getSdrSceneAttribute()
+ && getSdrLightingAttribute() == rCompare.getSdrLightingAttribute()
+ && getTransformation3D() == rCompare.getTransformation3D());
+ }
+
+ return false;
+ }
+
+ sal_uInt32 ScenePrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','S','c','e');
+ }
+
+ basegfx::B2DRange ScenePrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ // call parent. Do not calculate using unit range since the decomposition may extend the range
+ // by single pixels to level out the boundaries of the created bitmap primitives. So, use
+ // the default mechanism to use the range of the sub-primitives.
+ basegfx::B2DRange aRetval(BasePrimitive2D::getB2DRange(rViewInformation));
+
+ // expand by evtl. existing shadow primitives
+ if(impGetShadow3D(rViewInformation))
+ {
+ const basegfx::B2DRange aShadow2DRange(getB2DRangeFromPrimitive2DSequence(maShadowPrimitives, rViewInformation));
+
+ if(!aShadow2DRange.isEmpty())
+ {
+ aRetval.expand(aShadow2DRange);
+ }
+ }
+
+ // expand by evtl. existing label primitives
+ if(impGetLabel3D(rViewInformation))
+ {
+ const basegfx::B2DRange aLabel2DRange(getB2DRangeFromPrimitive2DSequence(maLabelPrimitives, rViewInformation));
+
+ if(!aLabel2DRange.isEmpty())
+ {
+ aRetval.expand(aLabel2DRange);
+ }
+ }
+
+ return aRetval;
+ }
+
+ Primitive2DSequence ScenePrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ // check if mpLocalDecomposition can be reused. Basic decision is based on the
+ // comparison of old and new viewTransformations, if they are equal reuse is possible anyways.
+ bool bNeedNewDecomposition(false);
+
+ if(getLocalDecomposition().hasElements())
+ {
+ if(maLastViewport != rViewInformation.getViewport() || maLastViewTransformation != rViewInformation.getViewTransformation())
+ {
+ bNeedNewDecomposition = true;
+ }
+ }
+
+ if(bNeedNewDecomposition)
+ {
+ // here is space to find out if only the visible view area has changed (scroll)
+ // and thus the object decomposition may be reused. For that, the logic visible part
+ // and the view sizes need to be the same
+ basegfx::B2DPolygon aWorldOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ aWorldOutline.transform(getTransformation3D().getObjectTransformation());
+
+ // calculate last clipped visible part
+ const basegfx::B2DPolyPolygon aLastLogicClippedOutline(basegfx::tools::clipPolygonOnRange(aWorldOutline, maLastViewport, true, false));
+ const basegfx::B2DRange aLastLogicVisiblePart(basegfx::tools::getRange(aLastLogicClippedOutline));
+
+ // calculate new clipped visible part
+ const basegfx::B2DPolyPolygon aNewLogicClippedOutline(basegfx::tools::clipPolygonOnRange(aWorldOutline, rViewInformation.getViewport(), true, false));
+ const basegfx::B2DRange aNewLogicVisiblePart(basegfx::tools::getRange(aNewLogicClippedOutline));
+
+ if(aLastLogicVisiblePart.equal(aNewLogicVisiblePart))
+ {
+ // logic visible part is the same, check for same view size to test for zooming
+ basegfx::B2DRange aLastViewVisiblePart(aLastLogicVisiblePart);
+ aLastViewVisiblePart.transform(maLastViewTransformation);
+ const basegfx::B2DVector aLastViewSize(aLastViewVisiblePart.getRange());
+
+ basegfx::B2DRange aNewViewVisiblePart(aNewLogicVisiblePart);
+ aNewViewVisiblePart.transform(rViewInformation.getViewTransformation());
+ const basegfx::B2DVector aNewViewSize(aNewViewVisiblePart.getRange());
+
+ if(aLastViewSize.equal(aNewViewSize))
+ {
+ // view size is the same, reuse possible
+ bNeedNewDecomposition = false;
+ }
+ }
+ }
+
+ if(bNeedNewDecomposition)
+ {
+ // conditions of last local decomposition have changed, delete
+ const_cast< ScenePrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence());
+ }
+
+ if(!getLocalDecomposition().hasElements())
+ {
+ // remember ViewRange and ViewTransformation
+ const_cast< ScenePrimitive2D* >(this)->maLastViewTransformation = rViewInformation.getViewTransformation();
+ const_cast< ScenePrimitive2D* >(this)->maLastViewport = rViewInformation.getViewport();
+ }
+
+ // use parent implementation
+ return BasePrimitive2D::get2DDecomposition(rViewInformation);
+ }
+
+ bool ScenePrimitive2D::impGetShadow3D(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ osl::MutexGuard aGuard( m_aMutex );
+
+ // create on demand
+ if(!mbShadow3DChecked && getChildren3D().hasElements())
+ {
+ // create shadow extraction processor
+ processor3d::Shadow3DExtractingProcessor aShadowProcessor(
+ rViewInformation.getViewTime(),
+ getTransformation3D(),
+ getSdrLightingAttribute(),
+ getChildren3D(),
+ getSdrSceneAttribute().getShadowSlant());
+
+ // process local primitives
+ aShadowProcessor.process(getChildren3D());
+
+ // fetch result and set checked flag
+ const_cast< ScenePrimitive2D* >(this)->maShadowPrimitives = aShadowProcessor.getPrimitive2DSequence();
+ const_cast< ScenePrimitive2D* >(this)->mbShadow3DChecked = true;
+ }
+
+ // return if there are shadow primitives
+ return maShadowPrimitives.hasElements();
+ }
+
+ bool ScenePrimitive2D::impGetLabel3D(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ osl::MutexGuard aGuard( m_aMutex );
+
+ // create on demand
+ if(!mbLabel3DChecked && getChildren3D().hasElements())
+ {
+ // create label extraction processor
+ processor3d::Label3DExtractingProcessor aLabelProcessor(
+ rViewInformation.getViewTime(),
+ getTransformation3D());
+
+ // process local primitives
+ aLabelProcessor.process(getChildren3D());
+
+ // fetch result and set checked flag
+ const_cast< ScenePrimitive2D* >(this)->maLabelPrimitives = aLabelProcessor.getPrimitive2DSequence();
+ const_cast< ScenePrimitive2D* >(this)->mbLabel3DChecked = true;
+ }
+
+ // return if there are label primitives
+ return maLabelPrimitives.hasElements();
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
new file mode 100644
index 000000000000..b716a2ae6835
--- /dev/null
+++ b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: shadowprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35:04 $
+ *
+ * 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
+#include <drawinglayer/primitive2d/shadowprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_COLOR_BCOLORMODIFIER_HXX
+#include <basegfx/color/bcolormodifier.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_ALPHAPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDALPHAPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence ShadowPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ Primitive2DSequence aRetval;
+
+ if(getChildren().hasElements())
+ {
+ // create a modifiedColorPrimitive containing the shadow color and the content
+ const basegfx::BColorModifier aBColorModifier(getShadowColor());
+ const Primitive2DReference xRefA(new ModifiedColorPrimitive2D(getChildren(), aBColorModifier));
+ const Primitive2DSequence aSequenceB(&xRefA, 1L);
+
+ // build transformed primitiveVector with shadow offset and add to target
+ const Primitive2DReference xRefB(new TransformPrimitive2D(getShadowTransform(), aSequenceB));
+ aRetval = Primitive2DSequence(&xRefB, 1L);
+ }
+
+ return aRetval;
+ }
+
+ ShadowPrimitive2D::ShadowPrimitive2D(
+ const basegfx::B2DHomMatrix& rShadowTransform,
+ const basegfx::BColor& rShadowColor,
+ const Primitive2DSequence& rChildren)
+ : GroupPrimitive2D(rChildren),
+ maShadowTransform(rShadowTransform),
+ maShadowColor(rShadowColor)
+ {
+ }
+
+ bool ShadowPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(GroupPrimitive2D::operator==(rPrimitive))
+ {
+ const ShadowPrimitive2D& rCompare = static_cast< const ShadowPrimitive2D& >(rPrimitive);
+
+ return (getShadowTransform() == rCompare.getShadowTransform()
+ && getShadowColor() == rCompare.getShadowColor());
+ }
+
+ return false;
+ }
+
+ sal_uInt32 ShadowPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','S','h','a');
+ }
+
+ basegfx::B2DRange ShadowPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ basegfx::B2DRange aRetval(getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation));
+ aRetval.transform(getShadowTransform());
+ return aRetval;
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
new file mode 100644
index 000000000000..0156d114ffa2
--- /dev/null
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -0,0 +1,217 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: textlayoutdevice.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35:04 $
+ *
+ * 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
+#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#endif
+
+#ifndef _SV_TIMER_HXX
+#include <vcl/timer.hxx>
+#endif
+
+#ifndef _SV_VIRDEV_HXX
+#include <vcl/virdev.hxx>
+#endif
+
+#ifndef _SV_FONT_HXX
+#include <vcl/font.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/textprimitive2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+// VDev RevDevice provider
+
+namespace
+{
+ class ImpTimedRefDev : public Timer
+ {
+ ImpTimedRefDev** mppStaticPointerOnMe;
+ VirtualDevice* mpVirDev;
+ sal_uInt32 mnUseCount;
+
+ public:
+ ImpTimedRefDev(ImpTimedRefDev** ppStaticPointerOnMe);
+ ~ImpTimedRefDev();
+ virtual void Timeout();
+
+ VirtualDevice& acquireVirtualDevice();
+ void releaseVirtualDevice();
+ };
+
+ ImpTimedRefDev::ImpTimedRefDev(ImpTimedRefDev** ppStaticPointerOnMe)
+ : mppStaticPointerOnMe(ppStaticPointerOnMe),
+ mpVirDev(0L),
+ mnUseCount(0L)
+ {
+ SetTimeout(3L * 60L * 1000L); // three minutes
+ Start();
+ }
+
+ ImpTimedRefDev::~ImpTimedRefDev()
+ {
+ OSL_ENSURE(0L == mnUseCount, "destruction of a still used ImpTimedRefDev (!)");
+
+ if(mppStaticPointerOnMe && *mppStaticPointerOnMe)
+ {
+ *mppStaticPointerOnMe = 0L;
+ }
+
+ if(mpVirDev)
+ {
+ delete mpVirDev;
+ }
+ }
+
+ void ImpTimedRefDev::Timeout()
+ {
+ // for obvious reasons, do not call anything after this
+ delete (this);
+ }
+
+ VirtualDevice& ImpTimedRefDev::acquireVirtualDevice()
+ {
+ if(!mpVirDev)
+ {
+ mpVirDev = new VirtualDevice();
+ mpVirDev->SetMapMode(MAP_100TH_MM);
+ mpVirDev->SetReferenceDevice(VirtualDevice::REFDEV_MODE06);
+ }
+
+ if(!mnUseCount)
+ {
+ Stop();
+ }
+
+ mnUseCount++;
+
+ return *mpVirDev;
+ }
+
+ void ImpTimedRefDev::releaseVirtualDevice()
+ {
+ OSL_ENSURE(mnUseCount, "mismatch call number to releaseVirtualDevice() (!)");
+ mnUseCount--;
+
+ if(!mnUseCount)
+ {
+ Start();
+ }
+ }
+} // end of anonymous namespace
+
+//////////////////////////////////////////////////////////////////////////////
+// access to one global ImpTimedRefDev incarnation in namespace drawinglayer::primitive
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ // static pointer here
+ ImpTimedRefDev* pImpGlobalRefDev = 0L;
+
+ // static methods here
+ VirtualDevice& acquireGlobalVirtualDevice()
+ {
+ if(!pImpGlobalRefDev)
+ {
+ pImpGlobalRefDev = new ImpTimedRefDev(&pImpGlobalRefDev);
+ }
+
+ return pImpGlobalRefDev->acquireVirtualDevice();
+ }
+
+ void releaseGlobalVirtualDevice()
+ {
+ OSL_ENSURE(pImpGlobalRefDev, "releaseGlobalVirtualDevice() without prior acquireGlobalVirtualDevice() call(!)");
+ pImpGlobalRefDev->releaseVirtualDevice();
+ }
+
+ TextLayouterDevice::TextLayouterDevice()
+ : mrDevice(acquireGlobalVirtualDevice())
+ {
+ }
+
+ TextLayouterDevice::~TextLayouterDevice()
+ {
+ releaseGlobalVirtualDevice();
+ }
+
+ void TextLayouterDevice::setFont(const Font& rFont)
+ {
+ mrDevice.SetFont(rFont);
+ }
+
+ void TextLayouterDevice::setFontAttributes(const FontAttributes& rFontAttributes, const basegfx::B2DHomMatrix& rTransform)
+ {
+ mrDevice.SetFont(getVclFontFromFontAttributes(rFontAttributes, rTransform));
+ }
+
+ double TextLayouterDevice::getTextHeight()
+ {
+ return mrDevice.GetTextHeight();
+ }
+
+ double TextLayouterDevice::getTextWidth(const String& rText, xub_StrLen nIndex, xub_StrLen nLength)
+ {
+ return mrDevice.GetTextWidth(rText, nIndex, nLength);
+ }
+
+ bool TextLayouterDevice::getTextOutlines(PolyPolyVector& rPolyPolyVector, const String& rText, xub_StrLen nIndex, xub_StrLen nLength, const ::std::vector< sal_Int32 >& rDXArray)
+ {
+ return mrDevice.GetTextOutlines(rPolyPolyVector, rText, nIndex, nIndex, nLength, true, 0, &(rDXArray[0]));
+ }
+
+ basegfx::B2DRange TextLayouterDevice::getTextBoundRect(const String& rText, xub_StrLen nIndex, xub_StrLen nLength)
+ {
+ if(rText.Len() && nLength)
+ {
+ Rectangle aRect;
+ mrDevice.GetTextBoundRect(aRect, rText, nIndex, nIndex, nLength);
+
+ return basegfx::B2DRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom());
+ }
+ else
+ {
+ return basegfx::B2DRange();
+ }
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx
new file mode 100644
index 000000000000..286cf88bf2e1
--- /dev/null
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -0,0 +1,378 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: textprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35:04 $
+ *
+ * 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_PRIMITIVE_TEXTPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/textprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_TEXTLAYOUTDEVICE_HXX
+#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#endif
+
+#ifndef _SV_VIRDEV_HXX
+#include <vcl/virdev.hxx>
+#endif
+
+#ifndef _BGFX_COLOR_BCOLOR_HXX
+#include <basegfx/color/bcolor.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGONTOOLS_HXX
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGON_HXX
+#include <basegfx/polygon/b2dpolygon.hxx>
+#endif
+
+#ifndef _BGFX_NUMERIC_FTOOLS_HXX
+#include <basegfx/numeric/ftools.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Font getVclFontFromFontAttributes(const FontAttributes& rFontAttributes, const basegfx::B2DHomMatrix& rTransform)
+ {
+ // decompose matrix to have position and size of text
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ rTransform.decompose(aScale, aTranslate, fRotate, fShearX);
+ return getVclFontFromFontAttributes(rFontAttributes, aScale, fRotate);
+ }
+
+ Font getVclFontFromFontAttributes(const FontAttributes& rFontAttributes, const basegfx::B2DVector& rFontSize, double fFontRotation)
+ {
+ sal_uInt32 nWidth(basegfx::fround(fabs(rFontSize.getX())));
+ sal_uInt32 nHeight(basegfx::fround(fabs(rFontSize.getY())));
+
+ if(nWidth == nHeight)
+ {
+ nWidth = 0L;
+ }
+
+ Font aRetval(
+ rFontAttributes.maFamilyName,
+ rFontAttributes.maStyleName,
+ Size(nWidth, nHeight));
+
+ if(!basegfx::fTools::equalZero(fFontRotation))
+ {
+ sal_Int16 aRotate10th((sal_Int16)(fFontRotation * (-1800.0/F_PI)));
+ aRetval.SetOrientation(aRotate10th % 3600);
+ }
+
+ aRetval.SetAlign(ALIGN_BASELINE);
+ aRetval.SetCharSet(rFontAttributes.mbSymbol ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE);
+ aRetval.SetVertical(rFontAttributes.mbVertical ? TRUE : FALSE);
+ aRetval.SetWeight(static_cast<FontWeight>(rFontAttributes.mnWeight));
+ aRetval.SetItalic(rFontAttributes.mbItalic ? ITALIC_NORMAL : ITALIC_NONE);
+
+ return aRetval;
+ }
+
+ FontAttributes getFontAttributesFromVclFont(basegfx::B2DVector& rSize, const Font& rFont)
+ {
+ FontAttributes aRetval;
+
+ aRetval.maFamilyName = rFont.GetName();
+ aRetval.maStyleName = rFont.GetStyleName();
+ aRetval.mbSymbol = (RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet());
+ aRetval.mbVertical = rFont.IsVertical();
+ aRetval.mnWeight = static_cast<sal_uInt16>(rFont.GetWeight());
+ aRetval.mbItalic = (rFont.GetItalic() != ITALIC_NONE);
+
+ const sal_Int32 nWidth(rFont.GetSize().getWidth());
+ const sal_Int32 nHeight(rFont.GetSize().getHeight());
+ rSize.setX(nWidth ? nWidth : nHeight);
+ rSize.setY(nHeight);
+
+ return aRetval;
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence TextSimplePortionPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ // get integer DXArray for getTextOutlines call (ATM uses vcl)
+ ::std::vector< sal_Int32 > aNewIntegerDXArray;
+ getIntegerDXArray(aNewIntegerDXArray);
+
+ // get outlines
+ TextLayouterDevice aTextLayouter;
+ aTextLayouter.setFontAttributes(getFontAttributes(), getTextTransform());
+ PolyPolyVector aPolyPolyVector;
+ aTextLayouter.getTextOutlines(aPolyPolyVector, getText(), 0L, getText().Len(), aNewIntegerDXArray);
+
+ // get result count
+ const sal_uInt32 nCount(aPolyPolyVector.size());
+
+ if(nCount)
+ {
+ // outlines already have scale and rotate included, so build new transformation
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ getTextTransform().decompose(aScale, aTranslate, fRotate, fShearX);
+ basegfx::B2DHomMatrix aNewTransform;
+ const bool bShearUsed(!basegfx::fTools::equalZero(fShearX));
+ const bool bRotateUsed(!basegfx::fTools::equalZero(fRotate));
+
+ if(bShearUsed)
+ {
+ // The order would be wrong when just adding shear, so rotate back, apply shear, rotate again
+ if(bRotateUsed)
+ {
+ aNewTransform.rotate(-fRotate);
+ }
+
+ // add shear (before rotate)
+ aNewTransform.shearX(fShearX);
+
+ if(bRotateUsed)
+ {
+ aNewTransform.rotate(fRotate);
+ }
+ }
+
+ // add translation
+ aNewTransform.translate(aTranslate.getX(), aTranslate.getY());
+
+ // prepare retval
+ Primitive2DSequence aRetval(nCount);
+
+ for(sal_uInt32 a(0L); a < nCount; a++)
+ {
+ // prepare polygon
+ basegfx::B2DPolyPolygon aPolyPolygon(aPolyPolyVector[a].getB2DPolyPolygon());
+ aPolyPolygon.transform(aNewTransform);
+
+ // create primitive
+ const Primitive2DReference xRef(new PolyPolygonColorPrimitive2D(aPolyPolygon, getFontColor()));
+ aRetval[a] = xRef;
+ }
+
+ return aRetval;
+ }
+ else
+ {
+ return Primitive2DSequence();
+ }
+ }
+
+ TextSimplePortionPrimitive2D::TextSimplePortionPrimitive2D(
+ const basegfx::B2DHomMatrix& rNewTransform,
+ const String& rText,
+ const ::std::vector< double >& rDXArray,
+ const FontAttributes& rFontAttributes,
+ const basegfx::BColor& rFontColor)
+ : BasePrimitive2D(),
+ maTextTransform(rNewTransform),
+ maText(rText),
+ maDXArray(rDXArray),
+ maFontAttributes(rFontAttributes),
+ maFontColor(rFontColor)
+ {
+ }
+
+ void TextSimplePortionPrimitive2D::getIntegerDXArray(::std::vector< sal_Int32 >& rDXArray) const
+ {
+ rDXArray.clear();
+
+ if(getDXArray().size())
+ {
+ rDXArray.reserve(getDXArray().size());
+ const basegfx::B2DVector aPixelVector(getTextTransform() * basegfx::B2DVector(1.0, 0.0));
+ const double fPixelVectorLength(aPixelVector.getLength());
+
+ for(::std::vector< double >::const_iterator aStart(getDXArray().begin()); aStart != getDXArray().end(); aStart++)
+ {
+ rDXArray.push_back(basegfx::fround((*aStart) * fPixelVectorLength));
+ }
+ }
+ }
+
+ bool TextSimplePortionPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const TextSimplePortionPrimitive2D& rCompare = (TextSimplePortionPrimitive2D&)rPrimitive;
+
+ return (getTextTransform() == rCompare.getTextTransform()
+ && getText() == rCompare.getText()
+ && getDXArray() == rCompare.getDXArray()
+ && getFontAttributes() == rCompare.getFontAttributes()
+ && getFontColor() == rCompare.getFontColor());
+ }
+
+ return false;
+ }
+
+ sal_uInt32 TextSimplePortionPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','T','S','i');
+ }
+
+ basegfx::B2DRange TextSimplePortionPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ const xub_StrLen aStrLen(getText().Len());
+ basegfx::B2DRange aRetval;
+
+ if(aStrLen)
+ {
+ // get TextBoundRect as base size
+ TextLayouterDevice aTextLayouter;
+ aTextLayouter.setFontAttributes(getFontAttributes(), getTextTransform());
+ aRetval = aTextLayouter.getTextBoundRect(getText(), 0L, aStrLen);
+
+ // apply textTransform to it, but without scaling. The scale defines the font size
+ // which is already part of the fetched textRange
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ basegfx::B2DHomMatrix aTextTransformWithoutScale;
+
+ getTextTransform().decompose(aScale, aTranslate, fRotate, fShearX);
+ aTextTransformWithoutScale.shearX(fShearX);
+ aTextTransformWithoutScale.rotate(fRotate);
+ aTextTransformWithoutScale.translate(aTranslate.getX(), aTranslate.getY());
+ aRetval.transform(aTextTransformWithoutScale);
+ }
+
+ return aRetval;
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence TextComplexPortionPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ // TODO: need to take care of
+ // -underline
+ // -strikethrough
+ // -emphasis mark
+ // -relief (embosses/engraved)
+ // -shadow
+ // -outline
+
+ // ATM: Just create a simple text primitive and ignore other attributes
+ const Primitive2DReference xRef(new TextSimplePortionPrimitive2D(getTextTransform(), getText(), getDXArray(), getFontAttributes(), getFontColor()));
+ return Primitive2DSequence(&xRef, 1L);
+ }
+
+ TextComplexPortionPrimitive2D::TextComplexPortionPrimitive2D(
+ const basegfx::B2DHomMatrix& rNewTransform,
+ const String& rText,
+ const ::std::vector< double >& rDXArray,
+ const FontAttributes& rFontAttributes,
+ const basegfx::BColor& rFontColor,
+ FontUnderline eFontUnderline,
+ bool bUnderlineAbove,
+ FontStrikeout eFontStrikeout,
+ bool bWordLineMode,
+ FontEmphasisMark eFontEmphasisMark,
+ bool bEmphasisMarkAbove,
+ bool bEmphasisMarkBelow,
+ FontRelief eFontRelief,
+ bool bShadow,
+ bool bOutline)
+ : TextSimplePortionPrimitive2D(rNewTransform, rText, rDXArray, rFontAttributes, rFontColor),
+ meFontUnderline(eFontUnderline),
+ meFontStrikeout(eFontStrikeout),
+ meFontRelief(eFontRelief),
+ mbUnderlineAbove(bUnderlineAbove),
+ mbWordLineMode(bWordLineMode),
+ meFontEmphasisMark(eFontEmphasisMark),
+ mbEmphasisMarkAbove(bEmphasisMarkAbove),
+ mbEmphasisMarkBelow(bEmphasisMarkBelow),
+ mbShadow(bShadow),
+ mbOutline(bOutline)
+ {
+ }
+
+ bool TextComplexPortionPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(TextSimplePortionPrimitive2D::operator==(rPrimitive))
+ {
+ const TextComplexPortionPrimitive2D& rCompare = (TextComplexPortionPrimitive2D&)rPrimitive;
+
+ return (getFontUnderline() == rCompare.getFontUnderline()
+ && getFontStrikeout() == rCompare.getFontStrikeout()
+ && getUnderlineAbove() == rCompare.getUnderlineAbove()
+ && getWordLineMode() == rCompare.getWordLineMode()
+ && getFontEmphasisMark() == rCompare.getFontEmphasisMark()
+ && getEmphasisMarkAbove() == rCompare.getEmphasisMarkAbove()
+ && getEmphasisMarkBelow() == rCompare.getEmphasisMarkBelow()
+ && getFontRelief() == rCompare.getFontRelief()
+ && getShadow() == rCompare.getShadow()
+ && getOutline() == rCompare.getOutline());
+ }
+
+ return false;
+ }
+
+ sal_uInt32 TextComplexPortionPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','T','C','o');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/transformprimitive2d.cxx b/drawinglayer/source/primitive2d/transformprimitive2d.cxx
new file mode 100644
index 000000000000..eba0b39020cd
--- /dev/null
+++ b/drawinglayer/source/primitive2d/transformprimitive2d.cxx
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: transformprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35:04 $
+ *
+ * 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
+#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ TransformPrimitive2D::TransformPrimitive2D(
+ const basegfx::B2DHomMatrix& rTransformation,
+ const Primitive2DSequence& rChildren)
+ : GroupPrimitive2D(rChildren),
+ maTransformation(rTransformation)
+ {
+ }
+
+ bool TransformPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(GroupPrimitive2D::operator==(rPrimitive))
+ {
+ const TransformPrimitive2D& rCompare = static_cast< const TransformPrimitive2D& >(rPrimitive);
+
+ return (getTransformation() == rCompare.getTransformation());
+ }
+
+ return false;
+ }
+
+ basegfx::B2DRange TransformPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ basegfx::B2DRange aRetval(getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation));
+ aRetval.transform(getTransformation());
+ return aRetval;
+ }
+
+ sal_uInt32 TransformPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','T','r','a');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx b/drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx
new file mode 100644
index 000000000000..29dda5d3a66e
--- /dev/null
+++ b/drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: unifiedalphaprimitive2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35:04 $
+ *
+ * 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
+#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGON_HXX
+#include <basegfx/polygon/b2dpolygon.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGONTOOLS_HXX
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#endif
+
+#ifndef _BGFX_COLOR_BCOLOR_HXX
+#include <basegfx/color/bcolor.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_ALPHAPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence UnifiedAlphaPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ if(0.0 == getAlpha())
+ {
+ // no transparence used, so just use the content
+ return getChildren();
+ }
+ else if(getAlpha() > 0.0 && getAlpha() < 1.0)
+ {
+ // create fill polygon for TransparenceList
+ const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation)));
+ const basegfx::BColor aGray(getAlpha(), getAlpha(), getAlpha());
+ const Primitive2DReference xRefA(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPolygon), aGray));
+ const Primitive2DSequence aAlphaContent(&xRefA, 1L);
+
+ // create sub-transparence group with a gray-colored rectangular fill polygon
+ const Primitive2DReference xRefB(new AlphaPrimitive2D(getChildren(), aAlphaContent));
+ return Primitive2DSequence(&xRefB, 1L);
+ }
+ else
+ {
+ // completely transparent or invalid definition, add nothing
+ return Primitive2DSequence();
+ }
+ }
+
+ UnifiedAlphaPrimitive2D::UnifiedAlphaPrimitive2D(
+ const Primitive2DSequence& rChildren,
+ double fAlpha)
+ : GroupPrimitive2D(rChildren),
+ mfAlpha(fAlpha)
+ {
+ }
+
+ bool UnifiedAlphaPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(GroupPrimitive2D::operator==(rPrimitive))
+ {
+ const UnifiedAlphaPrimitive2D& rCompare = (UnifiedAlphaPrimitive2D&)rPrimitive;
+
+ return (getAlpha() == rCompare.getAlpha());
+ }
+
+ return false;
+ }
+
+ sal_uInt32 UnifiedAlphaPrimitive2D::getPrimitiveID() const
+ {
+ return Create2DPrimitiveID('2','U','A','l');
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive3d/baseprimitive3d.cxx b/drawinglayer/source/primitive3d/baseprimitive3d.cxx
new file mode 100644
index 000000000000..10525a13d0d7
--- /dev/null
+++ b/drawinglayer/source/primitive3d/baseprimitive3d.cxx
@@ -0,0 +1,266 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: baseprimitive3d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:38:32 $
+ *
+ * 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
+#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ Primitive3DSequence BasePrimitive3D::createLocalDecomposition(double /*fTime*/) const
+ {
+ // default returns an empty sequence
+ return Primitive3DSequence();
+ }
+
+ BasePrimitive3D::BasePrimitive3D()
+ : BasePrimitive3DImplBase(m_aMutex),
+ maLocalDecomposition()
+ {
+ }
+
+ bool BasePrimitive3D::operator==( const BasePrimitive3D& rPrimitive ) const
+ {
+ return (getPrimitiveID() == rPrimitive.getPrimitiveID());
+ }
+
+ basegfx::B3DRange BasePrimitive3D::getB3DRange(double fTime) const
+ {
+ return getB3DRangeFromPrimitive3DSequence(get3DDecomposition(fTime), fTime);
+ }
+
+
+ Primitive3DSequence BasePrimitive3D::get3DDecomposition(double fTime) const
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ if(!getLocalDecomposition().hasElements())
+ {
+ const Primitive3DSequence aNewSequence(createLocalDecomposition(fTime));
+ const_cast< BasePrimitive3D* >(this)->setLocalDecomposition(aNewSequence);
+ }
+
+ return getLocalDecomposition();
+ }
+
+ Primitive3DSequence SAL_CALL BasePrimitive3D::getDecomposition( const graphic::Primitive3DParameters& aPrimitive2DParameters ) throw ( uno::RuntimeException )
+ {
+ return get3DDecomposition(aPrimitive2DParameters.Time);
+ }
+
+ geometry::RealRectangle3D SAL_CALL BasePrimitive3D::getRange( const graphic::Primitive3DParameters& aPrimitive2DParameters ) throw ( uno::RuntimeException )
+ {
+ return basegfx::unotools::rectangle3DFromB3DRectangle(getB3DRange(aPrimitive2DParameters.Time));
+ }
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// tooling
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ // get range3D from a given Primitive3DReference
+ basegfx::B3DRange getB3DRangeFromPrimitive3DReference(const Primitive3DReference& rCandidate, double fTime)
+ {
+ basegfx::B3DRange aRetval;
+
+ if(rCandidate.is())
+ {
+ // try to get C++ implementation base
+ const BasePrimitive3D* pCandidate(dynamic_cast< BasePrimitive3D* >(rCandidate.get()));
+
+ if(pCandidate)
+ {
+ // use it if possible
+ aRetval.expand(pCandidate->getB3DRange(fTime));
+ }
+ else
+ {
+ // use UNO API call instead
+ graphic::Primitive3DParameters aPrimitive3DParameters;
+ aPrimitive3DParameters.Time = fTime;
+ aRetval.expand(basegfx::unotools::b3DRectangleFromRealRectangle3D(rCandidate->getRange(aPrimitive3DParameters)));
+ }
+ }
+
+ return aRetval;
+ }
+
+ // get range3D from a given Primitive3DSequence
+ basegfx::B3DRange getB3DRangeFromPrimitive3DSequence(const Primitive3DSequence& rCandidate, double fTime)
+ {
+ basegfx::B3DRange aRetval;
+
+ if(rCandidate.hasElements())
+ {
+ const sal_Int32 nCount(rCandidate.getLength());
+
+ for(sal_Int32 a(0L); a < nCount; a++)
+ {
+ aRetval.expand(getB3DRangeFromPrimitive3DReference(rCandidate[a], fTime));
+ }
+ }
+
+ return aRetval;
+ }
+
+ bool arePrimitive3DReferencesEqual(const Primitive3DReference& rxA, const Primitive3DReference& rxB)
+ {
+ const sal_Bool bAIs(rxA.is());
+
+ if(bAIs != rxB.is())
+ {
+ return false;
+ }
+
+ if(!bAIs)
+ {
+ return true;
+ }
+
+ const BasePrimitive3D* pA(dynamic_cast< const BasePrimitive3D* >(rxA.get()));
+ const BasePrimitive3D* pB(dynamic_cast< const BasePrimitive3D* >(rxB.get()));
+ const bool bAEqualZero(pA == 0L);
+
+ if(bAEqualZero != (pB == 0L))
+ {
+ return false;
+ }
+
+ if(bAEqualZero)
+ {
+ return false;
+ }
+
+ return (pA->operator==(*pB));
+ }
+
+ bool arePrimitive3DSequencesEqual(const Primitive3DSequence& rA, const Primitive3DSequence& rB)
+ {
+ const sal_Bool bAHasElements(rA.hasElements());
+
+ if(bAHasElements != rB.hasElements())
+ {
+ return false;
+ }
+
+ if(!bAHasElements)
+ {
+ return true;
+ }
+
+ const sal_Int32 nCount(rA.getLength());
+
+ if(nCount != rB.getLength())
+ {
+ return false;
+ }
+
+ for(sal_Int32 a(0L); a < nCount; a++)
+ {
+ if(!arePrimitive3DReferencesEqual(rA[a], rB[a]))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ // concatenate sequence
+ void appendPrimitive3DSequenceToPrimitive3DSequence(Primitive3DSequence& rDest, const Primitive3DSequence& rSource)
+ {
+ if(rSource.hasElements())
+ {
+ if(rDest.hasElements())
+ {
+ const sal_Int32 nSourceCount(rSource.getLength());
+ const sal_Int32 nDestCount(rDest.getLength());
+ const sal_Int32 nTargetCount(nSourceCount + nDestCount);
+ sal_Int32 nInsertPos(nDestCount);
+
+ rDest.realloc(nTargetCount);
+
+ for(sal_Int32 a(0L); a < nSourceCount; a++)
+ {
+ if(rSource[a].is())
+ {
+ rDest[nInsertPos++] = rSource[a];
+ }
+ }
+
+ if(nInsertPos != nTargetCount)
+ {
+ rDest.realloc(nInsertPos);
+ }
+ }
+ else
+ {
+ rDest = rSource;
+ }
+ }
+ }
+
+ // concatenate single Primitive3D
+ void appendPrimitive3DReferenceToPrimitive3DSequence(Primitive3DSequence& rDest, const Primitive3DReference& rSource)
+ {
+ if(rSource.is())
+ {
+ const sal_Int32 nDestCount(rDest.getLength());
+ rDest.realloc(nDestCount + 1L);
+ rDest[nDestCount] = rSource;
+ }
+ }
+
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive3d/groupprimitive3d.cxx b/drawinglayer/source/primitive3d/groupprimitive3d.cxx
new file mode 100644
index 000000000000..1b89299acf27
--- /dev/null
+++ b/drawinglayer/source/primitive3d/groupprimitive3d.cxx
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: groupprimitive3d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:38:32 $
+ *
+ * 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
+#include <drawinglayer/primitive3d/groupprimitive3d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /// default: just return children, so all renderers not supporting group will use it's content
+ Primitive3DSequence GroupPrimitive3D::createLocalDecomposition(double /*fTime*/) const
+ {
+ return getChildren();
+ }
+
+ GroupPrimitive3D::GroupPrimitive3D( const Primitive3DSequence& rChildren )
+ : BasePrimitive3D(),
+ maChildren(rChildren)
+ {
+ }
+
+ /** The compare opertator uses the Sequence::==operator, so only checking if
+ the rererences are equal. All non-equal references are interpreted as
+ non-equal.
+ */
+ bool GroupPrimitive3D::operator==( const BasePrimitive3D& rPrimitive ) const
+ {
+ if(BasePrimitive3D::operator==(rPrimitive))
+ {
+ const GroupPrimitive3D& rCompare = static_cast< const GroupPrimitive3D& >(rPrimitive);
+
+ return (arePrimitive3DSequencesEqual(getChildren(), rCompare.getChildren()));
+ }
+
+ return false;
+ }
+
+ sal_uInt32 GroupPrimitive3D::getPrimitiveID() const
+ {
+ return Create3DPrimitiveID('3','G','r','o');
+ }
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
index 1ab1baa2827d..9b7c47f62ed3 100644
--- a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: hatchtextureprimitive3d.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:51:14 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:38:32 $
*
* 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_HATCHTEXTUREPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
#endif
@@ -57,6 +57,14 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#endif
+#ifndef _BGFX_RANGE_B2DRANGE_HXX
+#include <basegfx/range/b2drange.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE_HXX
+#include <drawinglayer/texture/texture.hxx>
+#endif
+
#ifndef _BGFX_POLYPOLYGON_B2DPOLYGONCLIPPER_HXX
#include <basegfx/polygon/b2dpolygonclipper.hxx>
#endif
@@ -65,244 +73,268 @@
#include <basegfx/matrix/b3dhommatrix.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/polygonprimitive3d.hxx>
#endif
//////////////////////////////////////////////////////////////////////////////
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
namespace drawinglayer
{
namespace primitive3d
{
- void hatchTexturePrimitive3D::impCreateDecomposition(const primitiveVector3D& rSource, primitiveVector3D& rDest)
+ Primitive3DSequence HatchTexturePrimitive3D::createLocalDecomposition(double /*fTime*/) const
{
- for(sal_uInt32 a(0L); a < rSource.size(); a++)
+ Primitive3DSequence aRetval;
+
+ if(getChildren().hasElements())
{
- // get reference
- const referencedPrimitive3D& rCandidate = rSource[a];
+ const Primitive3DSequence aSource(getChildren());
+ const sal_Int32 nSourceCount(aSource.getLength());
+ std::vector< Primitive3DReference > aDestination;
- // not all content is needed, remove transparencies and ModifiedColorPrimitives
- switch(rCandidate.getID())
+ for(sal_Int32 a(0L); a < nSourceCount; a++)
{
- case CreatePrimitiveID('P', 'O', 'M', '3'):
+ // get reference
+ const Primitive3DReference xReference(aSource[a]);
+
+ if(xReference.is())
{
- // polyPolygonMaterialPrimitive3D, check texturing and hatching
- const polyPolygonMaterialPrimitive3D& rPrimitive = static_cast< const polyPolygonMaterialPrimitive3D& >(rCandidate.getBasePrimitive());
- const basegfx::B3DPolyPolygon aFillPolyPolygon(rPrimitive.getB3DPolyPolygon());
+ // try to cast to BasePrimitive2D implementation
+ const BasePrimitive3D* pBasePrimitive = dynamic_cast< const BasePrimitive3D* >(xReference.get());
- if(aFillPolyPolygon.areTextureCoordinatesUsed())
+ if(pBasePrimitive)
{
- const sal_uInt32 nPolyCount(aFillPolyPolygon.count());
- basegfx::B2DPolyPolygon aTexPolyPolygon;
- basegfx::B2DPoint a2N;
- basegfx::B2DVector a2X, a2Y;
- basegfx::B3DPoint a3N;
- basegfx::B3DVector a3X, a3Y;
- bool b2N(false), b2X(false), b2Y(false);
- sal_uInt32 a, b;
-
- for(a = 0L; a < nPolyCount; a++)
+ // it is a BasePrimitive3D implementation, use getPrimitiveID() call for switch
+ // not all content is needed, remove transparencies and ModifiedColorPrimitives
+ switch(pBasePrimitive->getPrimitiveID())
{
- const basegfx::B3DPolygon aPartPoly(aFillPolyPolygon.getB3DPolygon(a));
- const sal_uInt32 nPointCount(aPartPoly.count());
- basegfx::B2DPolygon aTexPolygon;
-
- for(b = 0L; b < nPointCount; b++)
+ case Create3DPrimitiveID('3','P','P','M') :
{
- const basegfx::B2DPoint a2Candidate(aPartPoly.getTextureCoordinate(b));
+ // polyPolygonMaterialPrimitive3D, check texturing and hatching
+ const PolyPolygonMaterialPrimitive3D& rPrimitive = static_cast< const PolyPolygonMaterialPrimitive3D& >(*pBasePrimitive);
+ const basegfx::B3DPolyPolygon aFillPolyPolygon(rPrimitive.getB3DPolyPolygon());
- if(!b2N)
+ if(maHatch.isFillBackground())
{
- a2N = a2Candidate;
- a3N = aPartPoly.getB3DPoint(b);
- b2N = true;
+ // add original primitive for background
+ aDestination.push_back(xReference);
}
- else if(!b2X && !a2N.equal(a2Candidate))
- {
- a2X = a2Candidate - a2N;
- a3X = aPartPoly.getB3DPoint(b) - a3N;
- b2X = true;
- }
- else if(!b2Y && !a2N.equal(a2Candidate) && !a2X.equal(a2Candidate))
- {
- a2Y = a2Candidate - a2N;
-
- const double fCross(a2X.cross(a2Y));
- if(!basegfx::fTools::equalZero(fCross))
+ if(aFillPolyPolygon.areTextureCoordinatesUsed())
+ {
+ const sal_uInt32 nPolyCount(aFillPolyPolygon.count());
+ basegfx::B2DPolyPolygon aTexPolyPolygon;
+ basegfx::B2DPoint a2N;
+ basegfx::B2DVector a2X, a2Y;
+ basegfx::B3DPoint a3N;
+ basegfx::B3DVector a3X, a3Y;
+ bool b2N(false), b2X(false), b2Y(false);
+ sal_uInt32 a, b;
+
+ for(a = 0L; a < nPolyCount; a++)
{
- a3Y = aPartPoly.getB3DPoint(b) - a3N;
- b2Y = true;
+ const basegfx::B3DPolygon aPartPoly(aFillPolyPolygon.getB3DPolygon(a));
+ const sal_uInt32 nPointCount(aPartPoly.count());
+ basegfx::B2DPolygon aTexPolygon;
+
+ for(b = 0L; b < nPointCount; b++)
+ {
+ const basegfx::B2DPoint a2Candidate(aPartPoly.getTextureCoordinate(b));
+
+ if(!b2N)
+ {
+ a2N = a2Candidate;
+ a3N = aPartPoly.getB3DPoint(b);
+ b2N = true;
+ }
+ else if(!b2X && !a2N.equal(a2Candidate))
+ {
+ a2X = a2Candidate - a2N;
+ a3X = aPartPoly.getB3DPoint(b) - a3N;
+ b2X = true;
+ }
+ else if(!b2Y && !a2N.equal(a2Candidate) && !a2X.equal(a2Candidate))
+ {
+ a2Y = a2Candidate - a2N;
+
+ const double fCross(a2X.cross(a2Y));
+
+ if(!basegfx::fTools::equalZero(fCross))
+ {
+ a3Y = aPartPoly.getB3DPoint(b) - a3N;
+ b2Y = true;
+ }
+ }
+
+ aTexPolygon.append(a2Candidate);
+ }
+
+ aTexPolygon.setClosed(true);
+ aTexPolyPolygon.append(aTexPolygon);
}
- }
-
- aTexPolygon.append(a2Candidate);
- }
- aTexPolygon.setClosed(true);
- aTexPolyPolygon.append(aTexPolygon);
- }
-
- if(b2N && b2X && b2Y)
- {
- // found two linearly independent 2D vectors
- // get 2d range of texture coordinates
- const basegfx::B2DRange aOutlineRange(basegfx::tools::getRange(aTexPolyPolygon));
- const basegfx::BColor aHatchColor(maHatch.getColor());
- const double fAngle(-maHatch.getAngle());
- ::std::vector< basegfx::B2DHomMatrix > aMatrices;
-
- // get hatch transformations
- switch(maHatch.getStyle())
- {
- case attribute::HATCHSTYLE_TRIPLE:
- {
- // rotated 45 degrees
- texture::geoTexSvxHatch aHatch(aOutlineRange, maHatch.getDistance(), fAngle + F_PI4);
- aHatch.appendTransformations(aMatrices);
- }
- case attribute::HATCHSTYLE_DOUBLE:
- {
- // rotated 90 degrees
- texture::geoTexSvxHatch aHatch(aOutlineRange, maHatch.getDistance(), fAngle + F_PI2);
- aHatch.appendTransformations(aMatrices);
- }
- case attribute::HATCHSTYLE_SINGLE:
- {
- // angle as given
- texture::geoTexSvxHatch aHatch(aOutlineRange, maHatch.getDistance(), fAngle);
- aHatch.appendTransformations(aMatrices);
+ if(b2N && b2X && b2Y)
+ {
+ // found two linearly independent 2D vectors
+ // get 2d range of texture coordinates
+ const basegfx::B2DRange aOutlineRange(basegfx::tools::getRange(aTexPolyPolygon));
+ const basegfx::BColor aHatchColor(getHatch().getColor());
+ const double fAngle(-getHatch().getAngle());
+ ::std::vector< basegfx::B2DHomMatrix > aMatrices;
+
+ // get hatch transformations
+ switch(getHatch().getStyle())
+ {
+ case attribute::HATCHSTYLE_TRIPLE:
+ {
+ // rotated 45 degrees
+ texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle + F_PI4);
+ aHatch.appendTransformations(aMatrices);
+ }
+ case attribute::HATCHSTYLE_DOUBLE:
+ {
+ // rotated 90 degrees
+ texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle + F_PI2);
+ aHatch.appendTransformations(aMatrices);
+ }
+ case attribute::HATCHSTYLE_SINGLE:
+ {
+ // angle as given
+ texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle);
+ aHatch.appendTransformations(aMatrices);
+ }
+ }
+
+ // create geometry from unit line
+ basegfx::B2DPolyPolygon a2DHatchLines;
+ basegfx::B2DPolygon a2DUnitLine;
+ a2DUnitLine.append(basegfx::B2DPoint(0.0, 0.0));
+ a2DUnitLine.append(basegfx::B2DPoint(1.0, 0.0));
+
+ for(a = 0L; a < aMatrices.size(); a++)
+ {
+ const basegfx::B2DHomMatrix& rMatrix = aMatrices[a];
+ basegfx::B2DPolygon aNewLine(a2DUnitLine);
+ aNewLine.transform(rMatrix);
+ a2DHatchLines.append(aNewLine);
+ }
+
+ if(a2DHatchLines.count())
+ {
+ // clip against texture polygon
+ a2DHatchLines = basegfx::tools::clipPolyPolygonOnPolyPolygon(a2DHatchLines, aTexPolyPolygon, true, false);
+ }
+
+ if(a2DHatchLines.count())
+ {
+ // create 2d matrix with 2d vectors as column vectors and 2d point as offset, this represents
+ // a coordinate system transformation from unit coordinates to the new coordinate system
+ basegfx::B2DHomMatrix a2D;
+ a2D.set(0, 0, a2X.getX());
+ a2D.set(1, 0, a2X.getY());
+ a2D.set(0, 1, a2Y.getX());
+ a2D.set(1, 1, a2Y.getY());
+ a2D.set(0, 2, a2N.getX());
+ a2D.set(1, 2, a2N.getY());
+
+ // invert that transformation, so we have a back-transformation from texture coordinates
+ // to unit coordinates
+ a2D.invert();
+ a2DHatchLines.transform(a2D);
+
+ // expand back-transformated geometry tpo 3D
+ basegfx::B3DPolyPolygon a3DHatchLines(basegfx::tools::createB3DPolyPolygonFromB2DPolyPolygon(a2DHatchLines, 0.0));
+
+ // create 3d matrix with 3d vectors as column vectors (0,0,1 as Z) and 3d point as offset, this represents
+ // a coordinate system transformation from unit coordinates to the object's 3d coordinate system
+ basegfx::B3DHomMatrix a3D;
+ a3D.set(0, 0, a3X.getX());
+ a3D.set(1, 0, a3X.getY());
+ a3D.set(2, 0, a3X.getZ());
+ a3D.set(0, 1, a3Y.getX());
+ a3D.set(1, 1, a3Y.getY());
+ a3D.set(2, 1, a3Y.getZ());
+ a3D.set(0, 3, a3N.getX());
+ a3D.set(1, 3, a3N.getY());
+ a3D.set(2, 3, a3N.getZ());
+
+ // transform hatch lines to 3D object coordinates
+ a3DHatchLines.transform(a3D);
+
+ // build primitives from this geometry
+ const sal_uInt32 nHatchLines(a3DHatchLines.count());
+
+ for(a = 0L; a < nHatchLines; a++)
+ {
+ const Primitive3DReference xRef(new PolygonHairlinePrimitive3D(a3DHatchLines.getB3DPolygon(a), aHatchColor));
+ aDestination.push_back(xRef);
+ }
+ }
+ }
}
- }
-
- // create geometry from unit line
- basegfx::B2DPolyPolygon a2DHatchLines;
- basegfx::B2DPolygon a2DUnitLine;
- a2DUnitLine.append(basegfx::B2DPoint(0.0, 0.0));
- a2DUnitLine.append(basegfx::B2DPoint(1.0, 0.0));
- for(a = 0L; a < aMatrices.size(); a++)
- {
- const basegfx::B2DHomMatrix& rMatrix = aMatrices[a];
- basegfx::B2DPolygon aNewLine(a2DUnitLine);
- aNewLine.transform(rMatrix);
- a2DHatchLines.append(aNewLine);
+ break;
}
-
- if(a2DHatchLines.count())
+ default :
{
- // clip against texture polygon
- a2DHatchLines = basegfx::tools::clipPolyPolygonOnPolyPolygon(a2DHatchLines, aTexPolyPolygon, true, false);
- }
-
- if(a2DHatchLines.count())
- {
- // create 2d matrix with 2d vectors as column vectors and 2d point as offset, this represents
- // a coordinate system transformation from unit coordinates to the new coordinate system
- basegfx::B2DHomMatrix a2D;
- a2D.set(0, 0, a2X.getX());
- a2D.set(1, 0, a2X.getY());
- a2D.set(0, 1, a2Y.getX());
- a2D.set(1, 1, a2Y.getY());
- a2D.set(0, 2, a2N.getX());
- a2D.set(1, 2, a2N.getY());
-
- // invert that transformation, so we have a back-transformation from texture coordinates
- // to unit coordinates
- a2D.invert();
- a2DHatchLines.transform(a2D);
-
- // expand back-transformated geometry tpo 3D
- basegfx::B3DPolyPolygon a3DHatchLines(basegfx::tools::createB3DPolyPolygonFromB2DPolyPolygon(a2DHatchLines, 0.0));
-
- // create 3d matrix with 3d vectors as column vectors (0,0,1 as Z) and 3d point as offset, this represents
- // a coordinate system transformation from unit coordinates to the object's 3d coordinate system
- basegfx::B3DHomMatrix a3D;
- a3D.set(0, 0, a3X.getX());
- a3D.set(1, 0, a3X.getY());
- a3D.set(2, 0, a3X.getZ());
- a3D.set(0, 1, a3Y.getX());
- a3D.set(1, 1, a3Y.getY());
- a3D.set(2, 1, a3Y.getZ());
- a3D.set(0, 3, a3N.getX());
- a3D.set(1, 3, a3N.getY());
- a3D.set(2, 3, a3N.getZ());
-
- // transform hatch lines to 3D object coordinates
- a3DHatchLines.transform(a3D);
-
- // build primitives from this geometry
- const sal_uInt32 nHatchLines(a3DHatchLines.count());
-
- for(a = 0L; a < nHatchLines; a++)
- {
- basePrimitive3D* pNew = new polygonHairlinePrimitive3D(a3DHatchLines.getB3DPolygon(a), aHatchColor);
- rDest.push_back(referencedPrimitive3D(*pNew));
- }
+ // add reference to result
+ aDestination.push_back(xReference);
+ break;
}
}
}
-
- if(maHatch.isFillBackground())
+ else
{
- // add original primitive for background
- rDest.push_back(rCandidate);
+ // unknown implementation, add to result
+ aDestination.push_back(xReference);
}
-
- break;
}
+ }
- default:
- {
- // add to destination
- rDest.push_back(rCandidate);
- break;
- }
+ // prepare return value
+ const sal_uInt32 nDestSize(aDestination.size());
+ aRetval.realloc(nDestSize);
+
+ for(sal_uInt32 b(0L); b < nDestSize; b++)
+ {
+ aRetval[b] = aDestination[b];
}
}
- }
- void hatchTexturePrimitive3D::decompose(primitiveVector3D& rTarget)
- {
- if(maPrimitiveVector.size())
- {
- // create decomposition
- primitiveVector3D aNewPrimitiveVector;
- impCreateDecomposition(maPrimitiveVector, aNewPrimitiveVector);
- rTarget.insert(rTarget.end(), aNewPrimitiveVector.begin(), aNewPrimitiveVector.end());
- }
+ return aRetval;
}
- hatchTexturePrimitive3D::hatchTexturePrimitive3D(
- const attribute::fillHatchAttribute& rHatch,
- const primitiveVector3D& rPrimitiveVector,
+ HatchTexturePrimitive3D::HatchTexturePrimitive3D(
+ const attribute::FillHatchAttribute& rHatch,
+ const Primitive3DSequence& rChildren,
const basegfx::B2DVector& rTextureSize,
bool bModulate,
bool bFilter)
- : texturePrimitive3D(rPrimitiveVector, rTextureSize, bModulate, bFilter),
+ : TexturePrimitive3D(rChildren, rTextureSize, bModulate, bFilter),
maHatch(rHatch)
{
}
- hatchTexturePrimitive3D::~hatchTexturePrimitive3D()
- {
- }
-
- bool hatchTexturePrimitive3D::operator==(const basePrimitive3D& rPrimitive) const
+ bool HatchTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
- if(texturePrimitive3D::operator==(rPrimitive))
+ if(TexturePrimitive3D::operator==(rPrimitive))
{
- const hatchTexturePrimitive3D& rCompare = (hatchTexturePrimitive3D&)rPrimitive;
- return (maHatch == rCompare.maHatch);
+ const HatchTexturePrimitive3D& rCompare = (HatchTexturePrimitive3D&)rPrimitive;
+
+ return (getHatch() == rCompare.getHatch());
}
return false;
}
- PrimitiveID hatchTexturePrimitive3D::getID() const
+ sal_uInt32 HatchTexturePrimitive3D::getPrimitiveID() const
{
- return CreatePrimitiveID('H', 'A', 'X', '3');
+ return Create3DPrimitiveID('3','H','T','e');
}
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive3d/makefile.mk b/drawinglayer/source/primitive3d/makefile.mk
index dcb84b36d464..d30d1dd942f5 100644
--- a/drawinglayer/source/primitive3d/makefile.mk
+++ b/drawinglayer/source/primitive3d/makefile.mk
@@ -4,9 +4,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.3 $
+# $Revision: 1.4 $
#
-# last change: $Author: aw $ $Date: 2006-08-09 16:51:14 $
+# last change: $Author: aw $ $Date: 2006-10-19 10:38:32 $
#
# The Contents of this file are made available subject to
# the terms of GNU Lesser General Public License Version 2.1.
@@ -36,6 +36,7 @@
PRJ=..$/..
PRJNAME=drawinglayer
TARGET=primitive3d
+ENABLE_EXCEPTIONS=TRUE
# --- Settings ----------------------------------
@@ -44,25 +45,25 @@ TARGET=primitive3d
# --- Files -------------------------------------
SLOFILES= \
- $(SLO)$/primitive3d.obj \
- $(SLO)$/vectorprimitive3d.obj \
- $(SLO)$/shadowprimitive3d.obj \
- $(SLO)$/textureprimitive3d.obj \
+ $(SLO)$/baseprimitive3d.obj \
+ $(SLO)$/groupprimitive3d.obj \
$(SLO)$/hatchtextureprimitive3d.obj \
- $(SLO)$/polygontubeprimitive3d.obj \
- $(SLO)$/polygonprimitive3d.obj \
+ $(SLO)$/modifiedcolorprimitive3d.obj \
$(SLO)$/polypolygonprimitive3d.obj \
- $(SLO)$/transformprimitive3d.obj \
+ $(SLO)$/polygonprimitive3d.obj \
+ $(SLO)$/polygontubeprimitive3d.obj \
+ $(SLO)$/sdrcubeprimitive3d.obj \
$(SLO)$/sdrdecompositiontools3d.obj \
$(SLO)$/sdrextrudelathetools3d.obj \
- $(SLO)$/sdrprimitive3d.obj \
- $(SLO)$/sdrlabelprimitive3d.obj \
- $(SLO)$/sdrcubeprimitive3d.obj \
$(SLO)$/sdrextrudeprimitive3d.obj \
- $(SLO)$/sdrsphereprimitive3d.obj \
+ $(SLO)$/sdrlabelprimitive3d.obj \
$(SLO)$/sdrlatheprimitive3d.obj \
- $(SLO)$/sdrpolygonprimitive3d.obj \
- $(SLO)$/modifiedcolorprimitive3d.obj
+ $(SLO)$/sdrpolypolygonprimitive3d.obj \
+ $(SLO)$/sdrprimitive3d.obj \
+ $(SLO)$/sdrsphereprimitive3d.obj \
+ $(SLO)$/shadowprimitive3d.obj \
+ $(SLO)$/textureprimitive3d.obj \
+ $(SLO)$/transformprimitive3d.obj
# --- Targets ----------------------------------
diff --git a/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx b/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx
index 0d5d911919d3..e96d54b9e512 100644
--- a/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: modifiedcolorprimitive3d.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:51:15 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:38:32 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,42 +33,43 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_MODIFIEDCOLORPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_MODIFIEDCOLORPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx>
#endif
//////////////////////////////////////////////////////////////////////////////
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
namespace drawinglayer
{
namespace primitive3d
{
- modifiedColorPrimitive3D::modifiedColorPrimitive3D(
- const primitiveVector3D& rPrimitiveVector,
+ ModifiedColorPrimitive3D::ModifiedColorPrimitive3D(
+ const Primitive3DSequence& rChildren,
const basegfx::BColorModifier& rColorModifier)
- : vectorPrimitive3D(rPrimitiveVector),
+ : GroupPrimitive3D(rChildren),
maColorModifier(rColorModifier)
{
}
- modifiedColorPrimitive3D::~modifiedColorPrimitive3D()
+ bool ModifiedColorPrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
- }
-
- bool modifiedColorPrimitive3D::operator==(const basePrimitive3D& rPrimitive) const
- {
- if(vectorPrimitive3D::operator==(rPrimitive))
+ if(GroupPrimitive3D::operator==(rPrimitive))
{
- const modifiedColorPrimitive3D& rCompare = (modifiedColorPrimitive3D&)rPrimitive;
+ const ModifiedColorPrimitive3D& rCompare = (ModifiedColorPrimitive3D&)rPrimitive;
+
return (maColorModifier == rCompare.maColorModifier);
}
return false;
}
- PrimitiveID modifiedColorPrimitive3D::getID() const
+ sal_uInt32 ModifiedColorPrimitive3D::getPrimitiveID() const
{
- return CreatePrimitiveID('M', 'C', 'L', '3');
+ return Create3DPrimitiveID('3','M','C','o');
}
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive3d/polygonprimitive3d.cxx b/drawinglayer/source/primitive3d/polygonprimitive3d.cxx
index 435ccca60716..753eecfac098 100644
--- a/drawinglayer/source/primitive3d/polygonprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/polygonprimitive3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: polygonprimitive3d.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:51:15 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:38:32 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,7 +33,7 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/polygonprimitive3d.hxx>
#endif
@@ -41,52 +41,58 @@
#include <basegfx/polygon/b3dpolygontools.hxx>
#endif
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
#ifndef _BGFX_POLYPOLYGON_B3DPOLYGONTOOLS_HXX
#include <basegfx/polygon/b3dpolypolygontools.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_POLYGONTUBEPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONTUBEPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/polygontubeprimitive3d.hxx>
#endif
//////////////////////////////////////////////////////////////////////////////
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
namespace drawinglayer
{
namespace primitive3d
{
- polygonHairlinePrimitive3D::polygonHairlinePrimitive3D(const basegfx::B3DPolygon& rPolygon, const basegfx::BColor& rBColor)
- : basePrimitive3D(),
+ PolygonHairlinePrimitive3D::PolygonHairlinePrimitive3D(
+ const basegfx::B3DPolygon& rPolygon,
+ const basegfx::BColor& rBColor)
+ : BasePrimitive3D(),
maPolygon(rPolygon),
maBColor(rBColor)
{
}
- polygonHairlinePrimitive3D::~polygonHairlinePrimitive3D()
+ bool PolygonHairlinePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
- }
-
- bool polygonHairlinePrimitive3D::operator==(const basePrimitive3D& rPrimitive) const
- {
- if(getID() == rPrimitive.getID())
+ if(BasePrimitive3D::operator==(rPrimitive))
{
- const polygonHairlinePrimitive3D& rCompare = (polygonHairlinePrimitive3D&)rPrimitive;
+ const PolygonHairlinePrimitive3D& rCompare = (PolygonHairlinePrimitive3D&)rPrimitive;
- return (maPolygon == rCompare.maPolygon
- && maBColor == rCompare.maBColor);
+ return (getB3DPolygon() == rCompare.getB3DPolygon()
+ && getBColor() == rCompare.getBColor());
}
return false;
}
- PrimitiveID polygonHairlinePrimitive3D::getID() const
+ basegfx::B3DRange PolygonHairlinePrimitive3D::getB3DRange(double /*fTime*/) const
{
- return CreatePrimitiveID('P', 'O', 'H', '3');
+ return basegfx::tools::getRange(getB3DPolygon());
}
- basegfx::B3DRange polygonHairlinePrimitive3D::get3DRange() const
+ sal_uInt32 PolygonHairlinePrimitive3D::getPrimitiveID() const
{
- return basegfx::tools::getRange(maPolygon);
+ return Create3DPrimitiveID('3','P','H','a');
}
} // end of namespace primitive3d
} // end of namespace drawinglayer
@@ -97,34 +103,37 @@ namespace drawinglayer
{
namespace primitive3d
{
- void polygonStrokePrimitive3D::decompose(primitiveVector3D& rTarget)
+ Primitive3DSequence PolygonStrokePrimitive3D::createLocalDecomposition(double /*fTime*/) const
{
- if(maPolygon.count())
+ Primitive3DSequence aRetval;
+
+ if(getB3DPolygon().count())
{
- basegfx::B3DPolyPolygon aHairLinePolyPolygon(maPolygon);
+ basegfx::B3DPolyPolygon aHairLinePolyPolygon(getB3DPolygon());
- if(0.0 != maStrokeAttribute.getFullDotDashLen())
+ if(0.0 != getStrokeAttribute().getFullDotDashLen())
{
// apply LineStyle
- aHairLinePolyPolygon = basegfx::tools::applyLineDashing(aHairLinePolyPolygon, maStrokeAttribute.getDotDashArray(), maStrokeAttribute.getFullDotDashLen());
+ aHairLinePolyPolygon = basegfx::tools::applyLineDashing(aHairLinePolyPolygon, getStrokeAttribute().getDotDashArray(), getStrokeAttribute().getFullDotDashLen());
// merge LineStyle polygons to bigger parts
aHairLinePolyPolygon = basegfx::tools::mergeDashedLines(aHairLinePolyPolygon);
}
- if(maStrokeAttribute.getWidth())
+ // prepare result
+ aRetval.realloc(aHairLinePolyPolygon.count());
+
+ if(getStrokeAttribute().getWidth())
{
// create fat line data
- const double fRadius(maStrokeAttribute.getWidth() / 2.0);
- const basegfx::tools::B2DLineJoin aLineJoin(maStrokeAttribute.getLineJoin());
+ const double fRadius(getStrokeAttribute().getWidth() / 2.0);
+ const basegfx::tools::B2DLineJoin aLineJoin(getStrokeAttribute().getLineJoin());
for(sal_uInt32 a(0L); a < aHairLinePolyPolygon.count(); a++)
{
// create tube primitives
- polygonTubePrimitive3D* pNew = new polygonTubePrimitive3D(aHairLinePolyPolygon.getB3DPolygon(a),
- maStrokeAttribute.getColor(),
- fRadius, aLineJoin);
- rTarget.push_back(referencedPrimitive3D(*pNew));
+ const Primitive3DReference xRef(new PolygonTubePrimitive3D(aHairLinePolyPolygon.getB3DPolygon(a), getStrokeAttribute().getColor(), fRadius, aLineJoin));
+ aRetval[a] = xRef;
}
}
else
@@ -133,42 +142,40 @@ namespace drawinglayer
for(sal_uInt32 a(0L); a < aHairLinePolyPolygon.count(); a++)
{
const basegfx::B3DPolygon aCandidate = aHairLinePolyPolygon.getB3DPolygon(a);
- basePrimitive3D* pNew = new polygonHairlinePrimitive3D(aCandidate, maStrokeAttribute.getColor());
- rTarget.push_back(referencedPrimitive3D(*pNew));
+ const Primitive3DReference xRef(new PolygonHairlinePrimitive3D(aCandidate, getStrokeAttribute().getColor()));
+ aRetval[a] = xRef;
}
}
}
+
+ return aRetval;
}
- polygonStrokePrimitive3D::polygonStrokePrimitive3D(
+ PolygonStrokePrimitive3D::PolygonStrokePrimitive3D(
const basegfx::B3DPolygon& rPolygon,
- const attribute::strokeAttribute& rStrokeAttribute)
- : basePrimitive3D(),
+ const attribute::StrokeAttribute& rStrokeAttribute)
+ : BasePrimitive3D(),
maPolygon(rPolygon),
maStrokeAttribute(rStrokeAttribute)
{
}
- polygonStrokePrimitive3D::~polygonStrokePrimitive3D()
- {
- }
-
- bool polygonStrokePrimitive3D::operator==(const basePrimitive3D& rPrimitive) const
+ bool PolygonStrokePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
- if(getID() == rPrimitive.getID())
+ if(BasePrimitive3D::operator==(rPrimitive))
{
- const polygonStrokePrimitive3D& rCompare = (polygonStrokePrimitive3D&)rPrimitive;
+ const PolygonStrokePrimitive3D& rCompare = (PolygonStrokePrimitive3D&)rPrimitive;
- return (maPolygon == rCompare.maPolygon
- && maStrokeAttribute == rCompare.maStrokeAttribute);
+ return (getB3DPolygon() == rCompare.getB3DPolygon()
+ && getStrokeAttribute() == rCompare.getStrokeAttribute());
}
return false;
}
- PrimitiveID polygonStrokePrimitive3D::getID() const
+ sal_uInt32 PolygonStrokePrimitive3D::getPrimitiveID() const
{
- return CreatePrimitiveID('P', 'L', 'S', '3');
+ return Create3DPrimitiveID('3','P','S','t');
}
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
index 7b18f2b4030a..3eaf0e695758 100644
--- a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: polygontubeprimitive3d.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: aw $ $Date: 2006-09-27 16:33:17 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:38:33 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,35 +33,31 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_POLYGONTUBEPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONTUBEPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/polygontubeprimitive3d.hxx>
#endif
-#ifndef _BGFX_POLYGON_B3DPOLYPOLYGON_HXX
-#include <basegfx/polygon/b3dpolypolygon.hxx>
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_MATERIALATTRIBUTE3D_HXX
+#include <drawinglayer/attribute/materialattribute3d.hxx>
#endif
#ifndef _BGFX_MATRIX_B3DHOMMATRIX_HXX
#include <basegfx/matrix/b3dhommatrix.hxx>
#endif
-#ifndef _DRAWINGLAYER_ATTRIBUTE_MATERIALATTRIBUTE3D_HXX
-#include <drawinglayer/attribute/materialattribute3d.hxx>
+#ifndef _BGFX_POLYGON_B3DPOLYPOLYGON_HXX
+#include <basegfx/polygon/b3dpolypolygon.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
#endif
-#ifndef _OSL_MUTEX_HXX_
-#include <osl/mutex.hxx>
-#endif
-
#ifndef _BGFX_POLYPOLYGON_B3DPOLYGONTOOLS_HXX
#include <basegfx/polygon/b3dpolypolygontools.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_TRANSFORMPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TRANSFORMPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
#endif
@@ -73,14 +69,14 @@ namespace drawinglayer
{
namespace // anonymous namespace
{
- const primitiveVector3D& getLineTubeSegments(
+ Primitive3DSequence getLineTubeSegments(
sal_uInt32 nSegments,
- const attribute::materialAttribute3D& rMaterial)
+ const attribute::MaterialAttribute3D& rMaterial)
{
// static data for buffered tube primitives
- static primitiveVector3D aLineTubeList;
+ static Primitive3DSequence aLineTubeList;
static sal_uInt32 nLineTubeSegments(0L);
- static attribute::materialAttribute3D aLineMaterial;
+ static attribute::MaterialAttribute3D aLineMaterial;
// may exclusively change static data, use mutex
::osl::Mutex m_mutex;
@@ -89,10 +85,10 @@ namespace drawinglayer
{
nLineTubeSegments = nSegments;
aLineMaterial = rMaterial;
- aLineTubeList.clear();
+ aLineTubeList = Primitive3DSequence();
}
- if(0L == aLineTubeList.size() && 0L != nLineTubeSegments)
+ if(!aLineTubeList.hasElements() && 0L != nLineTubeSegments)
{
const basegfx::B3DPoint aLeft(0.0, 0.0, 0.0);
const basegfx::B3DPoint aRight(1.0, 0.0, 0.0);
@@ -100,6 +96,7 @@ namespace drawinglayer
basegfx::B3DPoint aLastRight(1.0, 1.0, 0.0);
basegfx::B3DHomMatrix aRot;
aRot.rotate(F_2PI / (double)nLineTubeSegments, 0.0, 0.0);
+ aLineTubeList.realloc(nLineTubeSegments);
for(sal_uInt32 a(0L); a < nLineTubeSegments; a++)
{
@@ -122,8 +119,8 @@ namespace drawinglayer
aNewPolygon.setClosed(true);
const basegfx::B3DPolyPolygon aNewPolyPolygon(aNewPolygon);
- basePrimitive3D* pNew = new polyPolygonMaterialPrimitive3D(aNewPolyPolygon, aLineMaterial, false);
- aLineTubeList.push_back(referencedPrimitive3D(*pNew));
+ const Primitive3DReference xRef(new PolyPolygonMaterialPrimitive3D(aNewPolyPolygon, aLineMaterial, false));
+ aLineTubeList[a] = xRef;
aLastLeft = aNextLeft;
aLastRight = aNextRight;
@@ -133,14 +130,14 @@ namespace drawinglayer
return aLineTubeList;
}
- const primitiveVector3D& getLineCapSegments(
+ Primitive3DSequence getLineCapSegments(
sal_uInt32 nSegments,
- const attribute::materialAttribute3D& rMaterial)
+ const attribute::MaterialAttribute3D& rMaterial)
{
// static data for buffered tube primitives
- static primitiveVector3D aLineCapList;
+ static Primitive3DSequence aLineCapList;
static sal_uInt32 nLineCapSegments(0L);
- static attribute::materialAttribute3D aLineMaterial;
+ static attribute::MaterialAttribute3D aLineMaterial;
// may exclusively change static data, use mutex
::osl::Mutex m_mutex;
@@ -149,15 +146,16 @@ namespace drawinglayer
{
nLineCapSegments = nSegments;
aLineMaterial = rMaterial;
- aLineCapList.clear();
+ aLineCapList = Primitive3DSequence();
}
- if(0L == aLineCapList.size() && 0L != nLineCapSegments)
+ if(!aLineCapList.hasElements() && 0L != nLineCapSegments)
{
const basegfx::B3DPoint aNull(0.0, 0.0, 0.0);
basegfx::B3DPoint aLast(0.0, 1.0, 0.0);
basegfx::B3DHomMatrix aRot;
aRot.rotate(F_2PI / (double)nLineCapSegments, 0.0, 0.0);
+ aLineCapList.realloc(nLineCapSegments);
for(sal_uInt32 a(0L); a < nLineCapSegments; a++)
{
@@ -176,8 +174,8 @@ namespace drawinglayer
aNewPolygon.setClosed(true);
const basegfx::B3DPolyPolygon aNewPolyPolygon(aNewPolygon);
- basePrimitive3D* pNew = new polyPolygonMaterialPrimitive3D(aNewPolyPolygon, aLineMaterial, false);
- aLineCapList.push_back(referencedPrimitive3D(*pNew));
+ const Primitive3DReference xRef(new PolyPolygonMaterialPrimitive3D(aNewPolyPolygon, aLineMaterial, false));
+ aLineCapList[a] = xRef;
aLast = aNext;
}
@@ -186,10 +184,9 @@ namespace drawinglayer
return aLineCapList;
}
- void getLineJoinSegments(
- primitiveVector3D& rDest,
+ Primitive3DSequence getLineJoinSegments(
sal_uInt32 nSegments,
- const attribute::materialAttribute3D& rMaterial,
+ const attribute::MaterialAttribute3D& rMaterial,
double fAngle,
double /*fDegreeStepWidth*/,
double fMiterMinimumAngle,
@@ -197,6 +194,7 @@ namespace drawinglayer
{
// nSegments is for whole circle, adapt to half circle
const sal_uInt32 nVerSeg(nSegments >> 1L);
+ std::vector< BasePrimitive3D* > aResultVector;
if(nVerSeg)
{
@@ -214,8 +212,8 @@ namespace drawinglayer
{
const basegfx::B3DPolygon aPartPolygon(aSphere.getB3DPolygon(a));
const basegfx::B3DPolyPolygon aPartPolyPolygon(aPartPolygon);
- basePrimitive3D* pNew = new polyPolygonMaterialPrimitive3D(aPartPolyPolygon, rMaterial, false);
- rDest.push_back(referencedPrimitive3D(*pNew));
+ BasePrimitive3D* pNew = new PolyPolygonMaterialPrimitive3D(aPartPolyPolygon, rMaterial, false);
+ aResultVector.push_back(pNew);
}
}
else
@@ -363,8 +361,8 @@ namespace drawinglayer
if(aNewPolygon.count())
{
const basegfx::B3DPolyPolygon aNewPolyPolygon(aNewPolygon);
- basePrimitive3D* pNew = new polyPolygonMaterialPrimitive3D(aNewPolyPolygon, rMaterial, false);
- rDest.push_back(referencedPrimitive3D(*pNew));
+ BasePrimitive3D* pNew = new PolyPolygonMaterialPrimitive3D(aNewPolyPolygon, rMaterial, false);
+ aResultVector.push_back(pNew);
}
if(bMiter && aMiterPolygon.count())
@@ -377,8 +375,8 @@ namespace drawinglayer
// create primitive
const basegfx::B3DPolyPolygon aMiterPolyPolygon(aMiterPolygon);
- basePrimitive3D* pNew = new polyPolygonMaterialPrimitive3D(aMiterPolyPolygon, rMaterial, false);
- rDest.push_back(referencedPrimitive3D(*pNew));
+ BasePrimitive3D* pNew = new PolyPolygonMaterialPrimitive3D(aMiterPolyPolygon, rMaterial, false);
+ aResultVector.push_back(pNew);
}
// prepare next step
@@ -395,6 +393,15 @@ namespace drawinglayer
}
}
}
+
+ Primitive3DSequence aRetval(aResultVector.size());
+
+ for(sal_uInt32 a(0L); a < aResultVector.size(); a++)
+ {
+ aRetval[a] = Primitive3DReference(aResultVector[a]);
+ }
+
+ return aRetval;
}
basegfx::B3DHomMatrix getRotationFromVector(const basegfx::B3DVector& rVector)
@@ -418,30 +425,35 @@ namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
namespace drawinglayer
{
namespace primitive3d
{
- void polygonTubePrimitive3D::decompose(primitiveVector3D& rTarget)
+ Primitive3DSequence PolygonTubePrimitive3D::createLocalDecomposition(double /*fTime*/) const
{
- const sal_uInt32 nPointCount(maPolygon.count());
+ const sal_uInt32 nPointCount(getB3DPolygon().count());
+ std::vector< BasePrimitive3D* > aResultVector;
if(0L != nPointCount)
{
- if(basegfx::fTools::more(mfRadius, 0.0))
+ if(basegfx::fTools::more(getRadius(), 0.0))
{
- const attribute::materialAttribute3D aMaterial(maBColor);
+ const attribute::MaterialAttribute3D aMaterial(getBColor());
static sal_uInt32 nSegments(8L); // default for 3d line segments, for more quality just raise this value (in even steps)
- const bool bClosed(maPolygon.isClosed());
- const bool bNoLineJoin(basegfx::tools::B2DLINEJOIN_NONE == maLineJoin);
+ const bool bClosed(getB3DPolygon().isClosed());
+ const bool bNoLineJoin(basegfx::tools::B2DLINEJOIN_NONE == getLineJoin());
const sal_uInt32 nLoopCount(bClosed ? nPointCount : nPointCount - 1L);
- basegfx::B3DPoint aLast(maPolygon.getB3DPoint(nPointCount - 1L));
- basegfx::B3DPoint aCurr(maPolygon.getB3DPoint(0L));
+ basegfx::B3DPoint aLast(getB3DPolygon().getB3DPoint(nPointCount - 1L));
+ basegfx::B3DPoint aCurr(getB3DPolygon().getB3DPoint(0L));
for(sal_uInt32 a(0L); a < nLoopCount; a++)
{
// get next data
- const basegfx::B3DPoint aNext(maPolygon.getB3DPoint((a + 1L) % nPointCount));
+ const basegfx::B3DPoint aNext(getB3DPolygon().getB3DPoint((a + 1L) % nPointCount));
const basegfx::B3DVector aForw(aNext - aCurr);
const double fForwLen(aForw.getLength());
@@ -452,15 +464,15 @@ namespace drawinglayer
// create default transformation with scale and rotate
basegfx::B3DHomMatrix aVectorTrans;
- aVectorTrans.scale(fForwLen, mfRadius, mfRadius);
+ aVectorTrans.scale(fForwLen, getRadius(), getRadius());
aVectorTrans *= aRotVector;
aVectorTrans.translate(aCurr.getX(), aCurr.getY(), aCurr.getZ());
if(bNoLineJoin || (!bClosed && !a))
{
// line start edge, build transformed primitiveVector3D
- transformPrimitive3D* pNewTransformedA = new transformPrimitive3D(aVectorTrans, getLineCapSegments(nSegments, aMaterial));
- rTarget.push_back(referencedPrimitive3D(*pNewTransformedA));
+ TransformPrimitive3D* pNewTransformedA = new TransformPrimitive3D(aVectorTrans, getLineCapSegments(nSegments, aMaterial));
+ aResultVector.push_back(pNewTransformedA);
}
else
{
@@ -469,10 +481,9 @@ namespace drawinglayer
if(!basegfx::fTools::equalZero(fCross))
{
- // line connect non-parallel, aBack, aForw, use maLineJoin
- primitiveVector3D aNewList;
+ // line connect non-parallel, aBack, aForw, use getLineJoin()
const double fAngle(acos(aBack.scalar(aForw) / (fForwLen * aBack.getLength()))); // 0.0 .. F_PI2
- getLineJoinSegments(aNewList, nSegments, aMaterial, fAngle, mfDegreeStepWidth, mfMiterMinimumAngle, maLineJoin);
+ Primitive3DSequence aNewList(getLineJoinSegments(nSegments, aMaterial, fAngle, getDegreeStepWidth(), getMiterMinimumAngle(), getLineJoin()));
// calculate transformation. First, get angle in YZ between nForw projected on (1, 0, 0) and nBack
basegfx::B3DHomMatrix aInvRotVector(aRotVector);
@@ -486,18 +497,18 @@ namespace drawinglayer
aSphereTrans.rotate(0.0, F_PI2, 0.0);
aSphereTrans.rotate(F_PI - fRotInYZ, 0.0, 0.0);
aSphereTrans *= aRotVector;
- aSphereTrans.scale(mfRadius, mfRadius, mfRadius);
+ aSphereTrans.scale(getRadius(), getRadius(), getRadius());
aSphereTrans.translate(aCurr.getX(), aCurr.getY(), aCurr.getZ());
// line start edge, build transformed primitiveVector3D
- transformPrimitive3D* pNewTransformedB = new transformPrimitive3D(aSphereTrans, aNewList);
- rTarget.push_back(referencedPrimitive3D(*pNewTransformedB));
+ TransformPrimitive3D* pNewTransformedB = new TransformPrimitive3D(aSphereTrans, aNewList);
+ aResultVector.push_back(pNewTransformedB);
}
}
// create line segments, build transformed primitiveVector3D
- transformPrimitive3D* pNewTransformedC = new transformPrimitive3D(aVectorTrans, getLineTubeSegments(nSegments, aMaterial));
- rTarget.push_back(referencedPrimitive3D(*pNewTransformedC));
+ TransformPrimitive3D* pNewTransformedC = new TransformPrimitive3D(aVectorTrans, getLineTubeSegments(nSegments, aMaterial));
+ aResultVector.push_back(pNewTransformedC);
if(bNoLineJoin || (!bClosed && ((a + 1L) == nLoopCount)))
{
@@ -505,13 +516,13 @@ namespace drawinglayer
basegfx::B3DHomMatrix aBackTrans;
aBackTrans.rotate(0.0, F_PI, 0.0);
aBackTrans.translate(1.0, 0.0, 0.0);
- aBackTrans.scale(fForwLen, mfRadius, mfRadius);
+ aBackTrans.scale(fForwLen, getRadius(), getRadius());
aBackTrans *= aRotVector;
aBackTrans.translate(aCurr.getX(), aCurr.getY(), aCurr.getZ());
// line end edge, build transformed primitiveVector3D
- transformPrimitive3D* pNewTransformedD = new transformPrimitive3D(aBackTrans, getLineCapSegments(nSegments, aMaterial));
- rTarget.push_back(referencedPrimitive3D(*pNewTransformedD));
+ TransformPrimitive3D* pNewTransformedD = new TransformPrimitive3D(aBackTrans, getLineCapSegments(nSegments, aMaterial));
+ aResultVector.push_back(pNewTransformedD);
}
}
@@ -523,19 +534,29 @@ namespace drawinglayer
else
{
// create hairline
- polygonHairlinePrimitive3D* pNew = new polygonHairlinePrimitive3D(maPolygon, maBColor);
- rTarget.push_back(referencedPrimitive3D(*pNew));
+ PolygonHairlinePrimitive3D* pNew = new PolygonHairlinePrimitive3D(getB3DPolygon(), getBColor());
+ aResultVector.push_back(pNew);
}
}
+
+ // prepare return value
+ Primitive3DSequence aRetval(aResultVector.size());
+
+ for(sal_uInt32 a(0L); a < aResultVector.size(); a++)
+ {
+ aRetval[a] = Primitive3DReference(aResultVector[a]);
+ }
+
+ return aRetval;
}
- polygonTubePrimitive3D::polygonTubePrimitive3D(
+ PolygonTubePrimitive3D::PolygonTubePrimitive3D(
const basegfx::B3DPolygon& rPolygon,
const basegfx::BColor& rBColor,
double fRadius, basegfx::tools::B2DLineJoin aLineJoin,
double fDegreeStepWidth,
double fMiterMinimumAngle)
- : polygonHairlinePrimitive3D(rPolygon, rBColor),
+ : PolygonHairlinePrimitive3D(rPolygon, rBColor),
mfRadius(fRadius),
mfDegreeStepWidth(fDegreeStepWidth),
mfMiterMinimumAngle(fMiterMinimumAngle),
@@ -543,28 +564,24 @@ namespace drawinglayer
{
}
- polygonTubePrimitive3D::~polygonTubePrimitive3D()
- {
- }
-
- bool polygonTubePrimitive3D::operator==(const basePrimitive3D& rPrimitive) const
+ bool PolygonTubePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
- if(polygonHairlinePrimitive3D::operator==(rPrimitive))
+ if(PolygonHairlinePrimitive3D::operator==(rPrimitive))
{
- const polygonTubePrimitive3D& rCompare = (polygonTubePrimitive3D&)rPrimitive;
+ const PolygonTubePrimitive3D& rCompare = (PolygonTubePrimitive3D&)rPrimitive;
- return (mfRadius == rCompare.mfRadius
- && mfDegreeStepWidth == rCompare.mfDegreeStepWidth
- && mfMiterMinimumAngle == rCompare.mfMiterMinimumAngle
- && maLineJoin == rCompare.maLineJoin);
+ return (getRadius() == rCompare.getRadius()
+ && getDegreeStepWidth() == rCompare.getDegreeStepWidth()
+ && getMiterMinimumAngle() == rCompare.getMiterMinimumAngle()
+ && getLineJoin() == rCompare.getLineJoin());
}
return false;
}
- PrimitiveID polygonTubePrimitive3D::getID() const
+ sal_uInt32 PolygonTubePrimitive3D::getPrimitiveID() const
{
- return CreatePrimitiveID('T', 'U', 'B', '3');
+ return Create3DPrimitiveID('3','P','T','u');
}
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive3d/polypolygonprimitive3d.cxx b/drawinglayer/source/primitive3d/polypolygonprimitive3d.cxx
index 6e838043762b..ff7aba0a8fbc 100644
--- a/drawinglayer/source/primitive3d/polypolygonprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/polypolygonprimitive3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: polypolygonprimitive3d.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:51:15 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:38:33 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,7 +33,7 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
#endif
@@ -41,49 +41,53 @@
#include <basegfx/polygon/b3dpolypolygontools.hxx>
#endif
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
{
namespace primitive3d
{
- polyPolygonMaterialPrimitive3D::polyPolygonMaterialPrimitive3D(
+ PolyPolygonMaterialPrimitive3D::PolyPolygonMaterialPrimitive3D(
const basegfx::B3DPolyPolygon& rPolyPolygon,
- const attribute::materialAttribute3D& rMaterial,
+ const attribute::MaterialAttribute3D& rMaterial,
bool bDoubleSided)
- : basePrimitive3D(),
+ : BasePrimitive3D(),
maPolyPolygon(rPolyPolygon),
maMaterial(rMaterial),
mbDoubleSided(bDoubleSided)
{
}
- polyPolygonMaterialPrimitive3D::~polyPolygonMaterialPrimitive3D()
- {
- }
-
- bool polyPolygonMaterialPrimitive3D::operator==(const basePrimitive3D& rPrimitive) const
+ bool PolyPolygonMaterialPrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
- if(getID() == rPrimitive.getID())
+ if(BasePrimitive3D::operator==(rPrimitive))
{
- const polyPolygonMaterialPrimitive3D& rCompare = (polyPolygonMaterialPrimitive3D&)rPrimitive;
+ const PolyPolygonMaterialPrimitive3D& rCompare = (PolyPolygonMaterialPrimitive3D&)rPrimitive;
- return (maPolyPolygon == rCompare.maPolyPolygon
- && maMaterial == rCompare.maMaterial
- && mbDoubleSided == rCompare.mbDoubleSided);
+ return (getB3DPolyPolygon() == rCompare.getB3DPolyPolygon()
+ && getMaterial() == rCompare.getMaterial()
+ && getDoubleSided() == rCompare.getDoubleSided());
}
return false;
}
- PrimitiveID polyPolygonMaterialPrimitive3D::getID() const
+ basegfx::B3DRange PolyPolygonMaterialPrimitive3D::getB3DRange(double /*fTime*/) const
{
- return CreatePrimitiveID('P', 'O', 'M', '3');
+ return basegfx::tools::getRange(getB3DPolyPolygon());
}
- basegfx::B3DRange polyPolygonMaterialPrimitive3D::get3DRange() const
+ sal_uInt32 PolyPolygonMaterialPrimitive3D::getPrimitiveID() const
{
- return basegfx::tools::getRange(maPolyPolygon);
+ return Create3DPrimitiveID('3','P','P','M');
}
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx
index aa2a43198df4..7fe1b1fd896d 100644
--- a/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sdrcubeprimitive3d.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:51:15 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:38:33 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,37 +33,33 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDRCUBEPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRCUBEPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/sdrcubeprimitive3d.hxx>
#endif
-#ifndef _BGFX_RANGE_B3DRANGE_HXX
-#include <basegfx/range/b3drange.hxx>
+#ifndef _BGFX_POLYPOLYGON_B3DPOLYGONTOOLS_HXX
+#include <basegfx/polygon/b3dpolypolygontools.hxx>
#endif
-#ifndef _BGFX_POLYGON_B3DPOLYPOLYGON_HXX
-#include <basegfx/polygon/b3dpolypolygon.hxx>
+#ifndef _BGFX_POLYGON_B3DPOLYGON_HXX
+#include <basegfx/polygon/b3dpolygon.hxx>
#endif
-#ifndef _BGFX_POLYPOLYGON_B3DPOLYGONTOOLS_HXX
-#include <basegfx/polygon/b3dpolypolygontools.hxx>
+#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX
+#include <basegfx/matrix/b2dhommatrix.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDRDECOMPOSITIONTOOLS3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRDECOMPOSITIONTOOLS3D_HXX
#include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
#endif
-#ifndef _BGFX_POLYGON_B3DPOLYGON_HXX
-#include <basegfx/polygon/b3dpolygon.hxx>
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
#endif
-#ifndef _BGFX_POLYGON_B3DPOLYGONTOOLS_HXX
-#include <basegfx/polygon/b3dpolygontools.hxx>
-#endif
+//////////////////////////////////////////////////////////////////////////////
-#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX
-#include <basegfx/matrix/b2dhommatrix.hxx>
-#endif
+using namespace com::sun::star;
//////////////////////////////////////////////////////////////////////////////
@@ -71,9 +67,10 @@ namespace drawinglayer
{
namespace primitive3d
{
- void sdrCubePrimitive3D::decompose(primitiveVector3D& rTarget)
+ Primitive3DSequence SdrCubePrimitive3D::createLocalDecomposition(double /*fTime*/) const
{
const basegfx::B3DRange aUnitRange(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
+ Primitive3DSequence aRetval;
// add fill
if(getSdrLFSAttribute().getFill())
@@ -157,7 +154,7 @@ namespace drawinglayer
// transform texture coordinates to texture size
basegfx::B2DHomMatrix aTexMatrix;
- aTexMatrix.scale(maTextureSize.getX(), maTextureSize.getY());
+ aTexMatrix.scale(getTextureSize().getX(), getTextureSize().getY());
aFill.transformTextureCoordiantes(aTexMatrix);
}
@@ -170,8 +167,8 @@ namespace drawinglayer
}
// create single PolyPolygonFill primitives
- add3DPolyPolygonFillPrimitive(
- a3DPolyPolygonVector, maTransform, maTextureSize, rTarget,
+ aRetval = create3DPolyPolygonFillPrimitives(
+ a3DPolyPolygonVector, getTransform(), getTextureSize(),
getSdr3DObjectAttribute(), *getSdrLFSAttribute().getFill(),
getSdrLFSAttribute().getFillFloatTransGradient());
}
@@ -180,40 +177,35 @@ namespace drawinglayer
if(getSdrLFSAttribute().getLine())
{
basegfx::B3DPolyPolygon aLine(basegfx::tools::createCubePolyPolygonFromB3DRange(aUnitRange));
- add3DPolyPolygonLinePrimitive(aLine, maTransform, rTarget, *getSdrLFSAttribute().getLine());
+ const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aLine, getTransform(), *getSdrLFSAttribute().getLine()));
+ appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
}
// add shadow
- if(getSdrLFSAttribute().getShadow())
+ if(getSdrLFSAttribute().getShadow() && aRetval.hasElements())
{
- addShadowPrimitive3D(rTarget, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D());
+ const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
+ appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
}
+
+ return aRetval;
}
- sdrCubePrimitive3D::sdrCubePrimitive3D(
+ SdrCubePrimitive3D::SdrCubePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::sdrLineFillShadowAttribute& rSdrLFSAttribute,
- const attribute::sdr3DObjectAttribute& rSdr3DObjectAttribute)
- : sdrPrimitive3D(rTransform, rTextureSize, rSdrLFSAttribute, rSdr3DObjectAttribute)
- {
- }
-
- sdrCubePrimitive3D::~sdrCubePrimitive3D()
+ const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute)
+ : SdrPrimitive3D(rTransform, rTextureSize, rSdrLFSAttribute, rSdr3DObjectAttribute)
{
}
- bool sdrCubePrimitive3D::operator==(const basePrimitive3D& rPrimitive) const
+ bool SdrCubePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
- return sdrPrimitive3D::operator==(rPrimitive);
+ return SdrPrimitive3D::operator==(rPrimitive);
}
- PrimitiveID sdrCubePrimitive3D::getID() const
- {
- return CreatePrimitiveID('S', 'C', 'U', '3');
- }
-
- basegfx::B3DRange sdrCubePrimitive3D::get3DRange() const
+ basegfx::B3DRange SdrCubePrimitive3D::getB3DRange(double /*fTime*/) const
{
// use defaut from sdrPrimitive3D which uses transformation expanded by line width/2.
// The parent implementation which uses the ranges of the decomposition would be more
@@ -223,6 +215,11 @@ namespace drawinglayer
// has priority here.
return getStandard3DRange();
}
+
+ sal_uInt32 SdrCubePrimitive3D::getPrimitiveID() const
+ {
+ return Create3DPrimitiveID('3','C','u','b');
+ }
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
index 0e9c053b15cf..1593e3d8d319 100644
--- a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sdrdecompositiontools3d.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:51:15 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:38:33 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,7 +33,7 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDRDECOMPOSITIONTOOLS3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRDECOMPOSITIONTOOLS3D_HXX
#include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
#endif
@@ -41,35 +41,31 @@
#include <basegfx/polygon/b3dpolygon.hxx>
#endif
-#ifndef _DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX
#include <drawinglayer/attribute/strokeattribute.hxx>
#endif
-#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX
#include <drawinglayer/attribute/sdrattribute.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_PRIMITIVE3D_HXX
-#include <drawinglayer/primitive3d/primitive3d.hxx>
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_BASEPRIMITIVE3D_HXX
+#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/polygonprimitive3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE_SIMPLETRANSPARENCEPRIMITIVE_HXX
-#include <drawinglayer/primitive/simpletransparenceprimitive.hxx>
-#endif
-
#ifndef _BGFX_POLYGON_B3DPOLYPOLYGON_HXX
#include <basegfx/polygon/b3dpolypolygon.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE_HXX
#include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX
#include <drawinglayer/attribute/sdrattribute.hxx>
#endif
@@ -77,15 +73,15 @@
#include <vcl/vclenum.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
-#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX
#include <drawinglayer/attribute/sdrfillbitmapattribute.hxx>
#endif
@@ -97,80 +93,81 @@
#include <basegfx/polygon/b3dpolypolygontools.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/textureprimitive3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_MODIFIEDCOLORPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_MODIFIEDCOLORPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/shadowprimitive3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX
#include <drawinglayer/attribute/sdrattribute3d.hxx>
#endif
+#ifndef _BGFX_RANGE_B2DRANGE_HXX
+#include <basegfx/range/b2drange.hxx>
+#endif
+
//////////////////////////////////////////////////////////////////////////////
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)
{
// prepare fully scaled polyPolygon
basegfx::B3DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
aScaledPolyPolygon.transform(rObjectTransform);
// create stroke attribute
- const attribute::strokeAttribute aStrokeAttribute(rLine.getColor(), rLine.getWidth(), rLine.getJoin(), rLine.getDotDashArray(), rLine.getFullDotDashLen());
+ const attribute::StrokeAttribute aStrokeAttribute(rLine.getColor(), rLine.getWidth(), rLine.getJoin(), rLine.getDotDashArray(), rLine.getFullDotDashLen());
// create primitives
- primitiveVector3D aNewPrimitiveVector;
+ Primitive3DSequence aRetval(aScaledPolyPolygon.count());
for(sal_uInt32 a(0L); a < aScaledPolyPolygon.count(); a++)
{
- basePrimitive3D* pNewLinePrimitive = new polygonStrokePrimitive3D(aScaledPolyPolygon.getB3DPolygon(a), aStrokeAttribute);
- aNewPrimitiveVector.push_back(referencedPrimitive3D(*pNewLinePrimitive));
+ const Primitive3DReference xRef(new PolygonStrokePrimitive3D(aScaledPolyPolygon.getB3DPolygon(a), aStrokeAttribute));
+ aRetval[a] = xRef;
}
if(0.0 != rLine.getTransparence())
{
- // create simpleTransparencePrimitive, add created fill primitives
- basePrimitive3D* pNewSimpleTransparenceTexturePrimitive3D = new simpleTransparenceTexturePrimitive3D(rLine.getTransparence(), aNewPrimitiveVector);
- rTarget.push_back(referencedPrimitive3D(*pNewSimpleTransparenceTexturePrimitive3D));
- }
- else
- {
- // add to decomposition
- rTarget.insert(rTarget.end(), aNewPrimitiveVector.begin(), aNewPrimitiveVector.end());
+ // create UnifiedAlphaTexturePrimitive3D, add created primitives and exchange
+ const Primitive3DReference xRef(new UnifiedAlphaTexturePrimitive3D(rLine.getTransparence(), aRetval));
+ aRetval = Primitive3DSequence(&xRef, 1L);
}
+
+ return aRetval;
}
- 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)
+ const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute,
+ const attribute::SdrFillAttribute& rFill,
+ const attribute::FillGradientAttribute* pFillGradient)
{
+ Primitive3DSequence aRetval;
+
if(r3DPolyPolygonVector.size())
{
// create list of simple fill primitives
- primitiveVector3D aNewPrimitiveVector;
+ aRetval.realloc(r3DPolyPolygonVector.size());
for(sal_uInt32 a(0L); a < r3DPolyPolygonVector.size(); a++)
{
@@ -183,11 +180,11 @@ namespace drawinglayer
aScaledPolyPolygon.transformNormals(rObjectTransform);
}
- basePrimitive3D* pNewFillPrimitive = new polyPolygonMaterialPrimitive3D(
+ const Primitive3DReference xRef(new PolyPolygonMaterialPrimitive3D(
aScaledPolyPolygon,
aSdr3DObjectAttribute.getMaterial(),
- aSdr3DObjectAttribute.getDoubleSided());
- aNewPrimitiveVector.push_back(referencedPrimitive3D(*pNewFillPrimitive));
+ aSdr3DObjectAttribute.getDoubleSided()));
+ aRetval[a] = xRef;
}
// look for and evtl. build texture sub-group primitive
@@ -195,79 +192,75 @@ namespace drawinglayer
{
bool bModulate(::com::sun::star::drawing::TextureMode_MODULATE == aSdr3DObjectAttribute.getTextureMode());
bool bFilter(aSdr3DObjectAttribute.getTextureFilter());
- basePrimitive3D* pNewTexturePrimitive3D = 0L;
+ BasePrimitive3D* pNewTexturePrimitive3D = 0L;
if(rFill.isGradient())
{
- // create gradientTexture3D with sublist, add to local aNewPrimitiveVector
- pNewTexturePrimitive3D = new gradientTexturePrimitive3D(*rFill.getGradient(), aNewPrimitiveVector, rTextureSize, bModulate, bFilter);
+ // create gradientTexture3D with sublist, add to local aRetval
+ pNewTexturePrimitive3D = new GradientTexturePrimitive3D(*rFill.getGradient(), aRetval, rTextureSize, bModulate, bFilter);
}
else if(rFill.isHatch())
{
- // create hatchTexture3D with sublist, add to local aNewPrimitiveVector
- pNewTexturePrimitive3D = new hatchTexturePrimitive3D(*rFill.getHatch(), aNewPrimitiveVector, rTextureSize, bModulate, bFilter);
+ // create hatchTexture3D with sublist, add to local aRetval
+ pNewTexturePrimitive3D = new HatchTexturePrimitive3D(*rFill.getHatch(), aRetval, rTextureSize, bModulate, bFilter);
}
else // if(rFill.isBitmap())
{
- // create bitmapTexture3D with sublist, add to local aNewPrimitiveVector
+ // create bitmapTexture3D with sublist, add to local aRetval
basegfx::B2DRange aTexRange(0.0, 0.0, rTextureSize.getX(), rTextureSize.getY());
- pNewTexturePrimitive3D = new bitmapTexturePrimitive3D(rFill.getBitmap()->getFillBitmapAttribute(aTexRange), aNewPrimitiveVector, rTextureSize, bModulate, bFilter);
+ pNewTexturePrimitive3D = new BitmapTexturePrimitive3D(rFill.getBitmap()->getFillBitmapAttribute(aTexRange), aRetval, rTextureSize, bModulate, bFilter);
}
- // exchange aNewPrimitiveVector content with texture group
- aNewPrimitiveVector.clear();
- aNewPrimitiveVector.push_back(referencedPrimitive3D(*pNewTexturePrimitive3D));
+ // exchange aRetval content with texture group
+ const Primitive3DReference xRef(pNewTexturePrimitive3D);
+ aRetval = Primitive3DSequence(&xRef, 1L);
if(::com::sun::star::drawing::TextureKind2_LUMINANCE == aSdr3DObjectAttribute.getTextureKind())
{
// use modified color primitive to force textures to gray
const basegfx::BColorModifier aBColorModifier(basegfx::BColor(), 0.0, basegfx::BCOLORMODIFYMODE_GRAY);
- basePrimitive3D* pModifiedColor = new modifiedColorPrimitive3D(aNewPrimitiveVector, aBColorModifier);
- aNewPrimitiveVector.clear();
- aNewPrimitiveVector.push_back(referencedPrimitive3D(*pModifiedColor));
+ const Primitive3DReference xRef2(new ModifiedColorPrimitive3D(aRetval, aBColorModifier));
+ aRetval = Primitive3DSequence(&xRef2, 1L);
}
}
if(0.0 != rFill.getTransparence())
{
- // create simpleTransparenceTexturePrimitive3D with sublist and append
- basePrimitive3D* pNewSimpleTransparenceTexturePrimitive3D = new simpleTransparenceTexturePrimitive3D(rFill.getTransparence(), aNewPrimitiveVector);
- rTarget.push_back(referencedPrimitive3D(*pNewSimpleTransparenceTexturePrimitive3D));
+ // create UnifiedAlphaTexturePrimitive3D with sublist and exchange
+ const Primitive3DReference xRef(new UnifiedAlphaTexturePrimitive3D(rFill.getTransparence(), aRetval));
+ aRetval = Primitive3DSequence(&xRef, 1L);
}
else if(pFillGradient)
{
- // create transparenceTexture3D with sublist and append
- basePrimitive3D* pNewTransparenceTexturePrimitive3D = new transparenceTexturePrimitive3D(*pFillGradient, aNewPrimitiveVector, rTextureSize);
- rTarget.push_back(referencedPrimitive3D(*pNewTransparenceTexturePrimitive3D));
- }
- else
- {
- // append list
- rTarget.insert(rTarget.end(), aNewPrimitiveVector.begin(), aNewPrimitiveVector.end());
+ // create AlphaTexturePrimitive3D with sublist and exchange
+ const Primitive3DReference xRef(new AlphaTexturePrimitive3D(*pFillGradient, aRetval, rTextureSize));
+ aRetval = Primitive3DSequence(&xRef, 1L);
}
}
+
+ return aRetval;
}
- void addShadowPrimitive3D(
- primitiveVector3D& rTarget,
- const attribute::sdrShadowAttribute& rShadow,
+ Primitive3DSequence createShadowPrimitive3D(
+ const Primitive3DSequence& rSource,
+ const attribute::SdrShadowAttribute& rShadow,
bool bShadow3D)
{
- // create Shadow primitives. Need to be added in front, should use already created primitives
- if(rTarget.size() && !basegfx::fTools::moreOrEqual(rShadow.getTransparence(), 1.0))
+ // create Shadow primitives. Uses already created primitives
+ if(rSource.hasElements() && !basegfx::fTools::moreOrEqual(rShadow.getTransparence(), 1.0))
{
// prepare new list for shadow geometry
- primitiveVector3D aNewList;
-
- // prepare shadow offset
- basegfx::B2DHomMatrix aShadowOffset;
+ basegfx::B2DHomMatrix aShadowOffset;
aShadowOffset.set(0, 2, rShadow.getOffset().getX());
aShadowOffset.set(1, 2, rShadow.getOffset().getY());
// create shadow primitive and add primitives
- shadowPrimitive3D* pNewShadow3D = new shadowPrimitive3D(aShadowOffset, rShadow.getColor(), rShadow.getTransparence(), bShadow3D, rTarget);
- rTarget.clear();
- rTarget.push_back(referencedPrimitive3D(*pNewShadow3D));
+ const Primitive3DReference xRef(new ShadowPrimitive3D(aShadowOffset, rShadow.getColor(), rShadow.getTransparence(), bShadow3D, rSource));
+ return Primitive3DSequence(&xRef, 1L);
+ }
+ else
+ {
+ return Primitive3DSequence();
}
}
} // end of namespace primitive3d
diff --git a/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx b/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx
index 98148757edf4..8474600605af 100644
--- a/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sdrextrudelathetools3d.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: aw $ $Date: 2006-09-27 16:33:18 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:38:33 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,7 +33,7 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDELATHETOOLS3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDELATHETOOLS3D_HXX
#include <drawinglayer/primitive3d/sdrextrudelathetools3d.hxx>
#endif
@@ -91,7 +91,9 @@ namespace
//////////////////////////////////////////////////////////////////////////////
// common helpers
- basegfx::B2DPolyPolygon impScalePolyPolygonOnCenter(const basegfx::B2DPolyPolygon& rSource, double fScale)
+ basegfx::B2DPolyPolygon impScalePolyPolygonOnCenter(
+ const basegfx::B2DPolyPolygon& rSource,
+ double fScale)
{
basegfx::B2DPolyPolygon aRetval(rSource);
@@ -110,7 +112,11 @@ namespace
return aRetval;
}
- void impGetOuterPolyPolygon(basegfx::B2DPolyPolygon& rPolygon, basegfx::B2DPolyPolygon& rOuterPolyPolygon, double fOffset, bool bCharacterMode)
+ void impGetOuterPolyPolygon(
+ basegfx::B2DPolyPolygon& rPolygon,
+ basegfx::B2DPolyPolygon& rOuterPolyPolygon,
+ double fOffset,
+ bool bCharacterMode)
{
rOuterPolyPolygon = rPolygon;
@@ -144,8 +150,14 @@ namespace
}
}
- void impAddInBetweenFill(basegfx::B3DPolyPolygon& rTarget, const basegfx::B3DPolyPolygon& rPolA, const basegfx::B3DPolyPolygon& rPolB,
- double fTexVerStart, double fTexVerStop, bool bCreateNormals, bool bCreateTextureCoordinates)
+ void impAddInBetweenFill(
+ basegfx::B3DPolyPolygon& rTarget,
+ const basegfx::B3DPolyPolygon& rPolA,
+ const basegfx::B3DPolyPolygon& rPolB,
+ double fTexVerStart,
+ double fTexVerStop,
+ bool bCreateNormals,
+ bool bCreateTextureCoordinates)
{
OSL_ENSURE(rPolA.count() == rPolB.count(), "impAddInBetweenFill: unequally sized polygons (!)");
const sal_uInt32 nPolygonCount(rPolA.count());
@@ -222,7 +234,9 @@ namespace
}
}
- void impSetNormal(basegfx::B3DPolyPolygon& rCandidate, const basegfx::B3DVector& rNormal)
+ void impSetNormal(
+ basegfx::B3DPolyPolygon& rCandidate,
+ const basegfx::B3DVector& rNormal)
{
for(sal_uInt32 a(0L); a < rCandidate.count(); a++)
{
@@ -237,7 +251,10 @@ namespace
}
}
- void impCreateInBetweenNormals(basegfx::B3DPolyPolygon& rPolA, basegfx::B3DPolyPolygon& rPolB, bool bSmoothHorizontalNormals)
+ void impCreateInBetweenNormals(
+ basegfx::B3DPolyPolygon& rPolA,
+ basegfx::B3DPolyPolygon& rPolB,
+ bool bSmoothHorizontalNormals)
{
OSL_ENSURE(rPolA.count() == rPolB.count(), "sdrExtrudePrimitive3D: unequally sized polygons (!)");
@@ -316,7 +333,10 @@ namespace
}
}
- void impMixNormals(basegfx::B3DPolyPolygon& rPolA, const basegfx::B3DPolyPolygon& rPolB, double fWeightA)
+ void impMixNormals(
+ basegfx::B3DPolyPolygon& rPolA,
+ const basegfx::B3DPolyPolygon& rPolB,
+ double fWeightA)
{
const double fWeightB(1.0 - fWeightA);
OSL_ENSURE(rPolA.count() == rPolB.count(), "sdrExtrudePrimitive3D: unequally sized polygons (!)");
@@ -340,7 +360,6 @@ namespace
rPolA.setB3DPolygon(a, aSubA);
}
}
-
} // end of anonymous namespace
//////////////////////////////////////////////////////////////////////////////
@@ -349,14 +368,21 @@ namespace drawinglayer
{
namespace primitive3d
{
- void createLatheSlices(sliceVector& rSliceVector, const basegfx::B2DPolyPolygon& rSource,
- double fBackScale, double fDiagonal, double fRotation, sal_uInt32 nSteps,
- 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)
{
if(basegfx::fTools::equalZero(fRotation) || 0L == nSteps)
{
// no rotation or no steps, just one plane
- rSliceVector.push_back(slice(rSource, basegfx::B3DHomMatrix()));
+ rSliceVector.push_back(Slice3D(rSource, basegfx::B3DHomMatrix()));
}
else
{
@@ -398,7 +424,7 @@ namespace drawinglayer
impGetOuterPolyPolygon(aFront, aOuterFront, fOffsetLen, bCharacterMode);
basegfx::B3DHomMatrix aTransform;
aTransform.translate(0.0, 0.0, fOffsetLen);
- rSliceVector.push_back(slice(aOuterFront, aTransform, SLICETYPE_FRONTCAP));
+ rSliceVector.push_back(Slice3D(aOuterFront, aTransform, SLICETYPE3D_FRONTCAP));
}
if(bCloseBack)
@@ -413,7 +439,7 @@ namespace drawinglayer
// add start polygon (a = 0L)
if(!bClosedRotation)
{
- rSliceVector.push_back(slice(aFront, basegfx::B3DHomMatrix()));
+ rSliceVector.push_back(Slice3D(aFront, basegfx::B3DHomMatrix()));
}
// create segments (a + 1 .. nSteps)
@@ -425,24 +451,30 @@ namespace drawinglayer
basegfx::B2DPolyPolygon aNewPoly(bBackScale ? basegfx::tools::interpolate(aFront, aBack, fStep) : aFront);
basegfx::B3DHomMatrix aNewMat;
aNewMat.rotate(0.0, fRotation * fStep, 0.0);
- rSliceVector.push_back(slice(aNewPoly, aNewMat));
+ rSliceVector.push_back(Slice3D(aNewPoly, aNewMat));
}
if(bCloseBack)
{
- rSliceVector.push_back(slice(aOuterBack, aTransformBack, SLICETYPE_BACKCAP));
+ rSliceVector.push_back(Slice3D(aOuterBack, aTransformBack, SLICETYPE3D_BACKCAP));
}
}
}
- void createExtrudeSlices(sliceVector& rSliceVector, const basegfx::B2DPolyPolygon& rSource,
- double fBackScale, double fDiagonal, double fDepth,
- 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)
{
if(basegfx::fTools::equalZero(fDepth))
{
// no depth, just one plane
- rSliceVector.push_back(slice(rSource, basegfx::B3DHomMatrix()));
+ rSliceVector.push_back(Slice3D(rSource, basegfx::B3DHomMatrix()));
}
else
{
@@ -474,7 +506,7 @@ namespace drawinglayer
impGetOuterPolyPolygon(aFront, aOuterFront, fOffset, bCharacterMode);
basegfx::B3DHomMatrix aTransformFront;
aTransformFront.translate(0.0, 0.0, fDepth);
- rSliceVector.push_back(slice(aOuterFront, aTransformFront, SLICETYPE_FRONTCAP));
+ rSliceVector.push_back(Slice3D(aOuterFront, aTransformFront, SLICETYPE3D_FRONTCAP));
}
if(bCloseBack)
@@ -489,26 +521,29 @@ namespace drawinglayer
basegfx::B3DHomMatrix aTransformA, aTransformB;
aTransformA.translate(0.0, 0.0, fZFront);
- rSliceVector.push_back(slice(aFront, aTransformA));
+ rSliceVector.push_back(Slice3D(aFront, aTransformA));
aTransformB.translate(0.0, 0.0, fZBack);
- rSliceVector.push_back(slice(aBack, aTransformB));
+ rSliceVector.push_back(Slice3D(aBack, aTransformB));
}
if(bCloseBack)
{
- rSliceVector.push_back(slice(aOuterBack, basegfx::B3DHomMatrix(), SLICETYPE_BACKCAP));
+ rSliceVector.push_back(Slice3D(aOuterBack, basegfx::B3DHomMatrix(), SLICETYPE3D_BACKCAP));
}
}
}
- void extractLinesFromSlice(basegfx::B3DPolyPolygon& rLine, const sliceVector& rSliceVector, bool bClosed)
+ void extractLinesFromSlice(
+ basegfx::B3DPolyPolygon& rLine,
+ const Slice3DVector& rSliceVector,
+ bool bClosed)
{
const sal_uInt32 nNumSlices(rSliceVector.size());
if(nNumSlices)
{
- // slices self
+ // Slice3Ds self
for(sal_uInt32 a(0L); a < nNumSlices; a++)
{
rLine.append(rSliceVector[a].getB3DPolyPolygon());
@@ -539,9 +574,18 @@ namespace drawinglayer
}
}
- 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 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)
{
const sal_uInt32 nNumSlices(rSliceVector.size());
@@ -596,9 +640,9 @@ namespace drawinglayer
for(a = 0L; a < nLoopCount; a++)
{
- const slice& rSliceA(rSliceVector[a]);
- const slice& rSliceB(rSliceVector[(a + 1L) % nNumSlices]);
- const bool bAcceptPair(SLICETYPE_REGULAR == rSliceA.getSliceType() && SLICETYPE_REGULAR == rSliceB.getSliceType());
+ const Slice3D& rSliceA(rSliceVector[a]);
+ const Slice3D& rSliceB(rSliceVector[(a + 1L) % nNumSlices]);
+ const bool bAcceptPair(SLICETYPE3D_REGULAR == rSliceA.getSliceType() && SLICETYPE3D_REGULAR == rSliceB.getSliceType());
basegfx::B3DPolyPolygon aPolA(rSliceA.getB3DPolyPolygon());
basegfx::B3DPolyPolygon aPolB(rSliceB.getB3DPolyPolygon());
@@ -611,11 +655,11 @@ namespace drawinglayer
{
const sal_uInt32 nIndPrev((a + nNumSlices - 1L) % nNumSlices);
- const slice& rSlicePrev(rSliceVector[nIndPrev]);
+ const Slice3D& rSlicePrev(rSliceVector[nIndPrev]);
basegfx::B3DPolyPolygon aPrev(rSlicePrev.getB3DPolyPolygon());
basegfx::B3DPolyPolygon aPolAA(rSliceA.getB3DPolyPolygon());
- if(SLICETYPE_FRONTCAP == rSlicePrev.getSliceType())
+ if(SLICETYPE3D_FRONTCAP == rSlicePrev.getSliceType())
{
basegfx::B3DPolyPolygon aFront(rSlicePrev.getB3DPolyPolygon());
const bool bHasSlant(aPolAA != aPrev);
@@ -701,11 +745,11 @@ namespace drawinglayer
{
const sal_uInt32 nIndNext((a + 2L) % nNumSlices);
- const slice& rSliceNext(rSliceVector[nIndNext]);
+ const Slice3D& rSliceNext(rSliceVector[nIndNext]);
basegfx::B3DPolyPolygon aNext(rSliceNext.getB3DPolyPolygon());
basegfx::B3DPolyPolygon aPolBB(rSliceB.getB3DPolyPolygon());
- if(SLICETYPE_BACKCAP == rSliceNext.getSliceType())
+ if(SLICETYPE3D_BACKCAP == rSliceNext.getSliceType())
{
basegfx::B3DPolyPolygon aBack(rSliceNext.getB3DPolyPolygon());
const bool bHasSlant(aPolBB != aNext);
diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
index 117274b3ca42..e5648f05f546 100644
--- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sdrextrudeprimitive3d.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:51:15 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:38:33 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,37 +33,33 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDEPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDEPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDELATHETOOLS3D_HXX
-#include <drawinglayer/primitive3d/sdrextrudelathetools3d.hxx>
-#endif
-
-#ifndef _BGFX_POLYPOLYGON_B3DPOLYGONTOOLS_HXX
-#include <basegfx/polygon/b3dpolypolygontools.hxx>
+#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX
+#include <basegfx/matrix/b2dhommatrix.hxx>
#endif
-#ifndef _BGFX_POLYGON_B3DPOLYPOLYGON_HXX
-#include <basegfx/polygon/b3dpolypolygon.hxx>
+#ifndef _BGFX_POLYGON_B2DPOLYGONTOOLS_HXX
+#include <basegfx/polygon/b2dpolygontools.hxx>
#endif
-#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX
-#include <basegfx/matrix/b2dhommatrix.hxx>
+#ifndef _BGFX_POLYPOLYGON_B3DPOLYGONTOOLS_HXX
+#include <basegfx/polygon/b3dpolypolygontools.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDRDECOMPOSITIONTOOLS3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRDECOMPOSITIONTOOLS3D_HXX
#include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
#endif
-#ifndef _BGFX_POLYPOLYGON_B2DPOLYGONTOOLS_HXX
-#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
#endif
-#ifndef _BGFX_POLYGON_B2DPOLYGONTOOLS_HXX
-#include <basegfx/polygon/b2dpolygontools.hxx>
-#endif
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
//////////////////////////////////////////////////////////////////////////////
@@ -71,10 +67,12 @@ namespace drawinglayer
{
namespace primitive3d
{
- void sdrExtrudePrimitive3D::decompose(primitiveVector3D& rTarget)
+ Primitive3DSequence SdrExtrudePrimitive3D::createLocalDecomposition(double /*fTime*/) const
{
+ Primitive3DSequence aRetval;
+
// get slices
- const sliceVector& rSliceVector = getSlices();
+ const Slice3DVector& rSliceVector = getSlices();
if(rSliceVector.size())
{
@@ -114,7 +112,7 @@ namespace drawinglayer
// create geometry
::std::vector< basegfx::B3DPolyPolygon > aFill;
extractPlanesFromSlice(aFill, rSliceVector,
- bCreateNormals, mbSmoothHorizontalNormals, mbSmoothNormals, mbSmoothLids, false,
+ bCreateNormals, getSmoothHorizontalNormals(), getSmoothNormals(), getSmoothLids(), false,
0.5, 0.6, bCreateTextureCoordiantesX || bCreateTextureCoordiantesY, aTexTransform);
// get full range
@@ -186,7 +184,7 @@ namespace drawinglayer
// transform texture coordinates to texture size
basegfx::B2DHomMatrix aTexMatrix;
- aTexMatrix.scale(maTextureSize.getX(), maTextureSize.getY());
+ aTexMatrix.scale(getTextureSize().getX(), getTextureSize().getY());
for(a = 0L; a < aFill.size(); a++)
{
@@ -195,8 +193,8 @@ namespace drawinglayer
}
// create single PolyPolygonFill primitives
- add3DPolyPolygonFillPrimitive(
- aFill, maTransform, maTextureSize, rTarget,
+ aRetval = create3DPolyPolygonFillPrimitives(
+ aFill, getTransform(), getTextureSize(),
getSdr3DObjectAttribute(), *getSdrLFSAttribute().getFill(),
getSdrLFSAttribute().getFillFloatTransGradient());
}
@@ -206,46 +204,49 @@ namespace drawinglayer
{
basegfx::B3DPolyPolygon aLine;
extractLinesFromSlice(aLine, rSliceVector, false);
- add3DPolyPolygonLinePrimitive(aLine, maTransform, rTarget, *maSdrLFSAttribute.getLine());
+ const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aLine, getTransform(), *getSdrLFSAttribute().getLine()));
+ appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
}
// add shadow
- if(getSdrLFSAttribute().getShadow())
+ if(getSdrLFSAttribute().getShadow() && aRetval.hasElements())
{
- addShadowPrimitive3D(rTarget, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D());
+ const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
+ appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
}
}
+
+ return aRetval;
}
- void sdrExtrudePrimitive3D::impCreateSlices()
+ void SdrExtrudePrimitive3D::impCreateSlices()
{
- maCorrectedPolyPolygon = maPolyPolygon;
-
// prepare the polygon
+ maCorrectedPolyPolygon = getPolyPolygon();
maCorrectedPolyPolygon.removeDoublePoints();
maCorrectedPolyPolygon = basegfx::tools::correctOrientations(maCorrectedPolyPolygon);
maCorrectedPolyPolygon = basegfx::tools::correctOutmostPolygon(maCorrectedPolyPolygon);
// prepare slices as geometry
- createExtrudeSlices(maSlices, maCorrectedPolyPolygon, mfBackScale, mfDiagonal, mfDepth, mbCharacterMode, mbCloseFront, mbCloseBack);
+ createExtrudeSlices(maSlices, maCorrectedPolyPolygon, getBackScale(), getDiagonal(), getDepth(), getCharacterMode(), getCloseFront(), getCloseBack());
}
- const sliceVector& sdrExtrudePrimitive3D::getSlices() const
+ const Slice3DVector& SdrExtrudePrimitive3D::getSlices() const
{
- if(maPolyPolygon.count() && !maSlices.size() && (getSdrLFSAttribute().getFill() || getSdrLFSAttribute().getLine()))
+ if(getPolyPolygon().count() && !maSlices.size() && (getSdrLFSAttribute().getFill() || getSdrLFSAttribute().getLine()))
{
::osl::Mutex m_mutex;
- const_cast< sdrExtrudePrimitive3D& >(*this).impCreateSlices();
+ const_cast< SdrExtrudePrimitive3D& >(*this).impCreateSlices();
}
return maSlices;
}
- sdrExtrudePrimitive3D::sdrExtrudePrimitive3D(
+ 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,
@@ -256,7 +257,7 @@ namespace drawinglayer
bool bCharacterMode,
bool bCloseFront,
bool bCloseBack)
- : sdrPrimitive3D(rTransform, rTextureSize, rSdrLFSAttribute, rSdr3DObjectAttribute),
+ : SdrPrimitive3D(rTransform, rTextureSize, rSdrLFSAttribute, rSdr3DObjectAttribute),
maPolyPolygon(rPolyPolygon),
mfDepth(fDepth),
mfDiagonal(fDiagonal),
@@ -269,64 +270,56 @@ namespace drawinglayer
mbCloseBack(bCloseBack)
{
// make sure depth is positive
- if(basegfx::fTools::lessOrEqual(mfDepth, 0.0))
+ if(basegfx::fTools::lessOrEqual(getDepth(), 0.0))
{
mfDepth = 0.0;
}
- // make sure the percentage value mfDiagonal is between 0.0 and 1.0
- if(basegfx::fTools::lessOrEqual(mfDiagonal, 0.0))
+ // make sure the percentage value getDiagonal() is between 0.0 and 1.0
+ if(basegfx::fTools::lessOrEqual(getDiagonal(), 0.0))
{
mfDiagonal = 0.0;
}
- else if(basegfx::fTools::moreOrEqual(mfDiagonal, 1.0))
+ else if(basegfx::fTools::moreOrEqual(getDiagonal(), 1.0))
{
mfDiagonal = 1.0;
}
// no close front/back when polygon is not closed
- if(maPolyPolygon.count() && !maPolyPolygon.getB2DPolygon(0L).isClosed())
+ if(getPolyPolygon().count() && !getPolyPolygon().getB2DPolygon(0L).isClosed())
{
mbCloseFront = mbCloseBack = false;
}
// no edge rounding when not closing
- if(!mbCloseFront && !mbCloseBack)
+ if(!getCloseFront() && !getCloseBack())
{
mfDiagonal = 0.0;
}
}
- sdrExtrudePrimitive3D::~sdrExtrudePrimitive3D()
- {
- }
-
- bool sdrExtrudePrimitive3D::operator==(const basePrimitive3D& rPrimitive) const
+ bool SdrExtrudePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
- if(sdrPrimitive3D::operator==(rPrimitive))
+ if(SdrPrimitive3D::operator==(rPrimitive))
{
- const sdrExtrudePrimitive3D& rCompare = static_cast< const sdrExtrudePrimitive3D& >(rPrimitive);
- return (maPolyPolygon == rCompare.maPolyPolygon
- && mfDepth == rCompare.mfDepth
- && mfDiagonal == rCompare.mfDiagonal
- && mfBackScale == rCompare.mfBackScale
- && mbSmoothNormals == rCompare.mbSmoothNormals
- && mbSmoothHorizontalNormals == rCompare.mbSmoothHorizontalNormals
- && mbSmoothLids == rCompare.mbSmoothLids
- && mbCharacterMode == rCompare.mbCharacterMode
- && mbCloseFront == rCompare.mbCloseFront
- && mbCloseBack == rCompare.mbCloseBack);
+ const SdrExtrudePrimitive3D& rCompare = static_cast< const SdrExtrudePrimitive3D& >(rPrimitive);
+
+ return (getPolyPolygon() == rCompare.getPolyPolygon()
+ && getDepth() == rCompare.getDepth()
+ && getDiagonal() == rCompare.getDiagonal()
+ && getBackScale() == rCompare.getBackScale()
+ && getSmoothNormals() == rCompare.getSmoothNormals()
+ && getSmoothHorizontalNormals() == rCompare.getSmoothHorizontalNormals()
+ && getSmoothLids() == rCompare.getSmoothLids()
+ && getCharacterMode() == rCompare.getCharacterMode()
+ && getCloseFront() == rCompare.getCloseFront()
+ && getCloseBack() == rCompare.getCloseBack());
}
return false;
}
- PrimitiveID sdrExtrudePrimitive3D::getID() const
- {
- return CreatePrimitiveID('S', 'X', 'T', '3');
- }
-
- basegfx::B3DRange sdrExtrudePrimitive3D::get3DRange() const
+ basegfx::B3DRange SdrExtrudePrimitive3D::getB3DRange(double /*fTime*/) const
{
// use defaut from sdrPrimitive3D which uses transformation expanded by line width/2
// The parent implementation which uses the ranges of the decomposition would be more
@@ -336,6 +329,11 @@ namespace drawinglayer
// has priority here.
return get3DRangeFromSlices(getSlices());
}
+
+ sal_uInt32 SdrExtrudePrimitive3D::getPrimitiveID() const
+ {
+ return Create3DPrimitiveID('3','E','x','t');
+ }
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
index 5ef59dbeedec..86ecce156d15 100644
--- a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sdrlatheprimitive3d.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:51:15 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:38:33 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,20 +33,12 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDRLATHEPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRLATHEPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/sdrlatheprimitive3d.hxx>
#endif
-#ifndef _BGFX_POLYPOLYGON_B2DPOLYGONTOOLS_HXX
-#include <basegfx/polygon/b2dpolypolygontools.hxx>
-#endif
-
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDELATHETOOLS3D_HXX
-#include <drawinglayer/primitive3d/sdrextrudelathetools3d.hxx>
-#endif
-
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDRDECOMPOSITIONTOOLS3D_HXX
-#include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
+#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX
+#include <basegfx/matrix/b2dhommatrix.hxx>
#endif
#ifndef _BGFX_POLYGON_B2DPOLYGONTOOLS_HXX
@@ -57,25 +49,35 @@
#include <basegfx/polygon/b3dpolypolygontools.hxx>
#endif
-#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX
-#include <basegfx/matrix/b2dhommatrix.hxx>
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRDECOMPOSITIONTOOLS3D_HXX
+#include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
#endif
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
{
namespace primitive3d
{
- void sdrLathePrimitive3D::decompose(primitiveVector3D& rTarget)
+ Primitive3DSequence SdrLathePrimitive3D::createLocalDecomposition(double /*fTime*/) const
{
+ Primitive3DSequence aRetval;
+
// get slices
- const sliceVector& rSliceVector = getSlices();
+ const Slice3DVector& rSliceVector = getSlices();
if(rSliceVector.size())
{
- const bool bBackScale(!basegfx::fTools::equal(mfBackScale, 1.0));
- const bool bClosedRotation(!bBackScale && mnHorizontalSegments && basegfx::fTools::equal(mfRotation, F_2PI));
+ const bool bBackScale(!basegfx::fTools::equal(getBackScale(), 1.0));
+ const bool bClosedRotation(!bBackScale && getHorizontalSegments() && basegfx::fTools::equal(getRotation(), F_2PI));
// add fill
if(getSdrLFSAttribute().getFill())
@@ -104,7 +106,7 @@ namespace drawinglayer
// create geometry
::std::vector< basegfx::B3DPolyPolygon > aFill;
extractPlanesFromSlice(aFill, rSliceVector,
- bCreateNormals, mbSmoothHorizontalNormals, mbSmoothNormals, mbSmoothLids, bClosedRotation,
+ bCreateNormals, getSmoothHorizontalNormals(), getSmoothNormals(), getSmoothLids(), bClosedRotation,
0.85, 0.6, bCreateTextureCoordiantesX || bCreateTextureCoordiantesY, aTexTransform);
// get full range
@@ -176,7 +178,7 @@ namespace drawinglayer
// transform texture coordinates to texture size
basegfx::B2DHomMatrix aTexMatrix;
- aTexMatrix.scale(maTextureSize.getX(), maTextureSize.getY());
+ aTexMatrix.scale(getTextureSize().getX(), getTextureSize().getY());
for(a = 0L; a < aFill.size(); a++)
{
@@ -185,8 +187,8 @@ namespace drawinglayer
}
// create single PolyPolygonFill primitives
- add3DPolyPolygonFillPrimitive(
- aFill, maTransform, maTextureSize, rTarget,
+ aRetval = create3DPolyPolygonFillPrimitives(
+ aFill, getTransform(), getTextureSize(),
getSdr3DObjectAttribute(), *getSdrLFSAttribute().getFill(),
getSdrLFSAttribute().getFillFloatTransGradient());
}
@@ -196,21 +198,25 @@ namespace drawinglayer
{
basegfx::B3DPolyPolygon aLine;
extractLinesFromSlice(aLine, rSliceVector, bClosedRotation);
- add3DPolyPolygonLinePrimitive(aLine, maTransform, rTarget, *maSdrLFSAttribute.getLine());
+ const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aLine, getTransform(), *getSdrLFSAttribute().getLine()));
+ appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
}
// add shadow
- if(getSdrLFSAttribute().getShadow())
+ if(getSdrLFSAttribute().getShadow() && aRetval.hasElements())
{
- addShadowPrimitive3D(rTarget, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D());
+ const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
+ appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
}
}
+
+ return aRetval;
}
- void sdrLathePrimitive3D::impCreateSlices()
+ void SdrLathePrimitive3D::impCreateSlices()
{
// prepare the polygon
- basegfx::B2DPolyPolygon aCandidate(basegfx::tools::adaptiveSubdivideByDistance(maPolyPolygon));
+ basegfx::B2DPolyPolygon aCandidate(basegfx::tools::adaptiveSubdivideByDistance(getPolyPolygon()));
aCandidate.removeDoublePoints();
aCandidate = basegfx::tools::correctOrientations(aCandidate);
aCandidate = basegfx::tools::correctOutmostPolygon(aCandidate);
@@ -221,31 +227,31 @@ namespace drawinglayer
const basegfx::B2DPolygon aSubCandidate(aCandidate.getB2DPolygon(0L));
const sal_uInt32 nSubEdgeCount(aSubCandidate.isClosed() ? aSubCandidate.count() : (aSubCandidate.count() ? aSubCandidate.count() - 1L : 0L));
- if(nSubEdgeCount != mnVerticalSegments)
+ if(nSubEdgeCount != getVerticalSegments())
{
- aCandidate = basegfx::tools::reSegmentPolyPolygon(aCandidate, mnVerticalSegments);
+ aCandidate = basegfx::tools::reSegmentPolyPolygon(aCandidate, getVerticalSegments());
}
// prepare slices as geometry
- createLatheSlices(maSlices, aCandidate, mfBackScale, mfDiagonal, mfRotation, mnHorizontalSegments, mbCharacterMode, mbCloseFront, mbCloseBack);
+ createLatheSlices(maSlices, aCandidate, getBackScale(), getDiagonal(), getRotation(), getHorizontalSegments(), getCharacterMode(), getCloseFront(), getCloseBack());
}
- const sliceVector& sdrLathePrimitive3D::getSlices() const
+ const Slice3DVector& SdrLathePrimitive3D::getSlices() const
{
- if(maPolyPolygon.count() && !maSlices.size() && (getSdrLFSAttribute().getFill() || getSdrLFSAttribute().getLine()))
+ if(getPolyPolygon().count() && !maSlices.size() && (getSdrLFSAttribute().getFill() || getSdrLFSAttribute().getLine()))
{
::osl::Mutex m_mutex;
- const_cast< sdrLathePrimitive3D& >(*this).impCreateSlices();
+ const_cast< SdrLathePrimitive3D& >(*this).impCreateSlices();
}
return maSlices;
}
- sdrLathePrimitive3D::sdrLathePrimitive3D(
+ 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,
@@ -258,7 +264,7 @@ namespace drawinglayer
bool bCharacterMode,
bool bCloseFront,
bool bCloseBack)
- : sdrPrimitive3D(rTransform, rTextureSize, rSdrLFSAttribute, rSdr3DObjectAttribute),
+ : SdrPrimitive3D(rTransform, rTextureSize, rSdrLFSAttribute, rSdr3DObjectAttribute),
maPolyPolygon(rPolyPolygon),
mnHorizontalSegments(nHorizontalSegments),
mnVerticalSegments(nVerticalSegments),
@@ -273,66 +279,58 @@ namespace drawinglayer
mbCloseBack(bCloseBack)
{
// make sure Rotation is positive
- if(basegfx::fTools::lessOrEqual(mfRotation, 0.0))
+ if(basegfx::fTools::lessOrEqual(getRotation(), 0.0))
{
mfRotation = 0.0;
}
- // make sure the percentage value mfDiagonal is between 0.0 and 1.0
- if(basegfx::fTools::lessOrEqual(mfDiagonal, 0.0))
+ // make sure the percentage value getDiagonal() is between 0.0 and 1.0
+ if(basegfx::fTools::lessOrEqual(getDiagonal(), 0.0))
{
mfDiagonal = 0.0;
}
- else if(basegfx::fTools::moreOrEqual(mfDiagonal, 1.0))
+ else if(basegfx::fTools::moreOrEqual(getDiagonal(), 1.0))
{
mfDiagonal = 1.0;
}
// no close front/back when polygon is not closed
- if(maPolyPolygon.count() && !maPolyPolygon.getB2DPolygon(0L).isClosed())
+ if(getPolyPolygon().count() && !getPolyPolygon().getB2DPolygon(0L).isClosed())
{
mbCloseFront = mbCloseBack = false;
}
// no edge rounding when not closing
- if(!mbCloseFront && !mbCloseBack)
+ if(!getCloseFront() && !getCloseBack())
{
mfDiagonal = 0.0;
}
}
- sdrLathePrimitive3D::~sdrLathePrimitive3D()
- {
- }
-
- bool sdrLathePrimitive3D::operator==(const basePrimitive3D& rPrimitive) const
+ bool SdrLathePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
- if(sdrPrimitive3D::operator==(rPrimitive))
+ if(SdrPrimitive3D::operator==(rPrimitive))
{
- const sdrLathePrimitive3D& rCompare = static_cast< const sdrLathePrimitive3D& >(rPrimitive);
- return (maPolyPolygon == rCompare.maPolyPolygon
- && mnHorizontalSegments == rCompare.mnHorizontalSegments
- && mnVerticalSegments == rCompare.mnVerticalSegments
- && mfDiagonal == rCompare.mfDiagonal
- && mfBackScale == rCompare.mfBackScale
- && mfRotation == rCompare.mfRotation
- && mbSmoothNormals == rCompare.mbSmoothNormals
- && mbSmoothHorizontalNormals == rCompare.mbSmoothHorizontalNormals
- && mbSmoothLids == rCompare.mbSmoothLids
- && mbCharacterMode == rCompare.mbCharacterMode
- && mbCloseFront == rCompare.mbCloseFront
- && mbCloseBack == rCompare.mbCloseBack);
+ const SdrLathePrimitive3D& rCompare = static_cast< const SdrLathePrimitive3D& >(rPrimitive);
+
+ return (getPolyPolygon() == rCompare.getPolyPolygon()
+ && getHorizontalSegments() == rCompare.getHorizontalSegments()
+ && getVerticalSegments() == rCompare.getVerticalSegments()
+ && getDiagonal() == rCompare.getDiagonal()
+ && getBackScale() == rCompare.getBackScale()
+ && getRotation() == rCompare.getRotation()
+ && getSmoothNormals() == rCompare.getSmoothNormals()
+ && getSmoothHorizontalNormals() == rCompare.getSmoothHorizontalNormals()
+ && getSmoothLids() == rCompare.getSmoothLids()
+ && getCharacterMode() == rCompare.getCharacterMode()
+ && getCloseFront() == rCompare.getCloseFront()
+ && getCloseBack() == rCompare.getCloseBack());
}
return false;
}
- PrimitiveID sdrLathePrimitive3D::getID() const
- {
- return CreatePrimitiveID('S', 'L', 'A', '3');
- }
-
- basegfx::B3DRange sdrLathePrimitive3D::get3DRange() const
+ basegfx::B3DRange SdrLathePrimitive3D::getB3DRange(double /*fTime*/) const
{
// use defaut from sdrPrimitive3D which uses transformation expanded by line width/2
// The parent implementation which uses the ranges of the decomposition would be more
@@ -342,6 +340,11 @@ namespace drawinglayer
// has priority here.
return get3DRangeFromSlices(getSlices());
}
+
+ sal_uInt32 SdrLathePrimitive3D::getPrimitiveID() const
+ {
+ return Create3DPrimitiveID('3','L','a','t');
+ }
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx
new file mode 100644
index 000000000000..c91be70dc08f
--- /dev/null
+++ b/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx
@@ -0,0 +1,125 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrpolypolygonprimitive3d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:38:34 $
+ *
+ * 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
+#include <drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRDECOMPOSITIONTOOLS3D_HXX
+#include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ Primitive3DSequence SdrPolyPolygonPrimitive3D::createLocalDecomposition(double /*fTime*/) const
+ {
+ Primitive3DSequence aRetval;
+
+ if(getPolyPolygon3D().count())
+ {
+ // add fill
+ if(getSdrLFSAttribute().getFill())
+ {
+ // create single PolyPolygonFill primitives
+ ::std::vector< basegfx::B3DPolyPolygon > aFill;
+ aFill.push_back(getPolyPolygon3D());
+
+ aRetval = create3DPolyPolygonFillPrimitives(
+ aFill, getTransform(), getTextureSize(),
+ getSdr3DObjectAttribute(), *getSdrLFSAttribute().getFill(),
+ getSdrLFSAttribute().getFillFloatTransGradient());
+ }
+
+ // add line
+ if(getSdrLFSAttribute().getLine())
+ {
+ basegfx::B3DPolyPolygon aLine(getPolyPolygon3D());
+ aLine.clearNormals();
+ aLine.clearTextureCoordinates();
+ const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aLine, getTransform(), *getSdrLFSAttribute().getLine()));
+ appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
+ }
+
+ // add shadow
+ if(getSdrLFSAttribute().getShadow() && aRetval.hasElements())
+ {
+ const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
+ appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
+ }
+ }
+
+ return aRetval;
+ }
+
+ SdrPolyPolygonPrimitive3D::SdrPolyPolygonPrimitive3D(
+ const basegfx::B3DPolyPolygon& rPolyPolygon3D,
+ const basegfx::B3DHomMatrix& rTransform,
+ const basegfx::B2DVector& rTextureSize,
+ const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute)
+ : SdrPrimitive3D(rTransform, rTextureSize, rSdrLFSAttribute, rSdr3DObjectAttribute),
+ maPolyPolygon3D(rPolyPolygon3D)
+ {
+ }
+
+ bool SdrPolyPolygonPrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
+ {
+ if(SdrPrimitive3D::operator==(rPrimitive))
+ {
+ const SdrPolyPolygonPrimitive3D& rCompare = static_cast< const SdrPolyPolygonPrimitive3D& >(rPrimitive);
+
+ return (getPolyPolygon3D() == rCompare.getPolyPolygon3D());
+ }
+
+ return false;
+ }
+
+ sal_uInt32 SdrPolyPolygonPrimitive3D::getPrimitiveID() const
+ {
+ return Create3DPrimitiveID('3','P','P','o');
+ }
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive3d/sdrprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrprimitive3d.cxx
index bc7f5a7878bc..7e6b47f28f04 100644
--- a/drawinglayer/source/primitive3d/sdrprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrprimitive3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sdrprimitive3d.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:51:15 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:38:34 $
*
* 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_SDRPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/sdrprimitive3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX
#include <drawinglayer/attribute/sdrattribute.hxx>
#endif
@@ -47,18 +47,22 @@
//////////////////////////////////////////////////////////////////////////////
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
namespace drawinglayer
{
namespace primitive3d
{
- basegfx::B3DRange sdrPrimitive3D::getStandard3DRange() const
+ basegfx::B3DRange SdrPrimitive3D::getStandard3DRange() const
{
basegfx::B3DRange aUnitRange(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
aUnitRange.transform(getTransform());
- if(maSdrLFSAttribute.getLine())
+ if(getSdrLFSAttribute().getLine())
{
- const attribute::sdrLineAttribute& rLine = *maSdrLFSAttribute.getLine();
+ const attribute::SdrLineAttribute& rLine = *getSdrLFSAttribute().getLine();
if(rLine.isVisible() && !basegfx::fTools::equalZero(rLine.getWidth()))
{
@@ -70,7 +74,7 @@ namespace drawinglayer
return aUnitRange;
}
- basegfx::B3DRange sdrPrimitive3D::get3DRangeFromSlices(const sliceVector& rSlices) const
+ basegfx::B3DRange SdrPrimitive3D::get3DRangeFromSlices(const Slice3DVector& rSlices) const
{
basegfx::B3DRange aRetval;
@@ -83,9 +87,9 @@ namespace drawinglayer
aRetval.transform(getTransform());
- if(maSdrLFSAttribute.getLine())
+ if(getSdrLFSAttribute().getLine())
{
- const attribute::sdrLineAttribute& rLine = *maSdrLFSAttribute.getLine();
+ const attribute::SdrLineAttribute& rLine = *getSdrLFSAttribute().getLine();
if(rLine.isVisible() && !basegfx::fTools::equalZero(rLine.getWidth()))
{
@@ -98,12 +102,12 @@ namespace drawinglayer
return aRetval;
}
- sdrPrimitive3D::sdrPrimitive3D(
+ SdrPrimitive3D::SdrPrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::sdrLineFillShadowAttribute& rSdrLFSAttribute,
- const attribute::sdr3DObjectAttribute& rSdr3DObjectAttribute)
- : basePrimitive3D(),
+ const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute)
+ : BasePrimitive3D(),
maTransform(rTransform),
maTextureSize(rTextureSize),
maSdrLFSAttribute(rSdrLFSAttribute),
@@ -111,20 +115,16 @@ namespace drawinglayer
{
}
- sdrPrimitive3D::~sdrPrimitive3D()
- {
- }
-
- bool sdrPrimitive3D::operator==(const basePrimitive3D& rPrimitive) const
+ bool SdrPrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
- if(getID() == rPrimitive.getID())
+ if(BasePrimitive3D::operator==(rPrimitive))
{
- const sdrPrimitive3D& rCompare = static_cast< const sdrPrimitive3D& >(rPrimitive);
+ const SdrPrimitive3D& rCompare = static_cast< const SdrPrimitive3D& >(rPrimitive);
- return (maTransform == rCompare.maTransform
- && maTextureSize == rCompare.maTextureSize
- && maSdrLFSAttribute == rCompare.maSdrLFSAttribute
- && maSdr3DObjectAttribute == rCompare.maSdr3DObjectAttribute);
+ return (getTransform() == rCompare.getTransform()
+ && getTextureSize() == rCompare.getTextureSize()
+ && getSdrLFSAttribute() == rCompare.getSdrLFSAttribute()
+ && getSdr3DObjectAttribute() == rCompare.getSdr3DObjectAttribute());
}
return false;
diff --git a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx
index 7c299a1215ca..bb01dc7cbfbe 100644
--- a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sdrsphereprimitive3d.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: aw $ $Date: 2006-09-27 16:33:18 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:38:34 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,38 +33,43 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDRSPHEREPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRSPHEREPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/sdrsphereprimitive3d.hxx>
#endif
-#ifndef _BGFX_POLYGON_B3DPOLYPOLYGON_HXX
-#include <basegfx/polygon/b3dpolypolygon.hxx>
-#endif
-
#ifndef _BGFX_POLYPOLYGON_B3DPOLYGONTOOLS_HXX
#include <basegfx/polygon/b3dpolypolygontools.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_SDRDECOMPOSITIONTOOLS3D_HXX
-#include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
+#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX
+#include <basegfx/matrix/b2dhommatrix.hxx>
#endif
#ifndef _BGFX_POLYGON_B3DPOLYGON_HXX
#include <basegfx/polygon/b3dpolygon.hxx>
#endif
-#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX
-#include <basegfx/matrix/b2dhommatrix.hxx>
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRDECOMPOSITIONTOOLS3D_HXX
+#include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
#endif
//////////////////////////////////////////////////////////////////////////////
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
namespace drawinglayer
{
namespace primitive3d
{
- void sdrSpherePrimitive3D::decompose(primitiveVector3D& rTarget)
+ Primitive3DSequence SdrSpherePrimitive3D::createLocalDecomposition(double /*fTime*/) const
{
+ Primitive3DSequence aRetval;
const basegfx::B3DRange aUnitRange(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
// add fill
@@ -136,7 +141,7 @@ namespace drawinglayer
// transform texture coordinates to texture size
basegfx::B2DHomMatrix aTexMatrix;
- aTexMatrix.scale(maTextureSize.getX(), maTextureSize.getY());
+ aTexMatrix.scale(getTextureSize().getX(), getTextureSize().getY());
aFill.transformTextureCoordiantes(aTexMatrix);
}
@@ -149,60 +154,57 @@ namespace drawinglayer
}
// create single PolyPolygonFill primitives
- add3DPolyPolygonFillPrimitive(
- a3DPolyPolygonVector, maTransform, maTextureSize, rTarget,
+ aRetval = create3DPolyPolygonFillPrimitives(
+ a3DPolyPolygonVector, getTransform(), getTextureSize(),
getSdr3DObjectAttribute(), *getSdrLFSAttribute().getFill(),
getSdrLFSAttribute().getFillFloatTransGradient());
}
// add line
- if(maSdrLFSAttribute.getLine())
+ if(getSdrLFSAttribute().getLine())
{
basegfx::B3DPolyPolygon aSphere(basegfx::tools::createSpherePolyPolygonFromB3DRange(aUnitRange, getHorizontalSegments(), getVerticalSegments()));
- add3DPolyPolygonLinePrimitive(aSphere, maTransform, rTarget, *maSdrLFSAttribute.getLine());
+ const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aSphere, getTransform(), *getSdrLFSAttribute().getLine()));
+ appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
}
// add shadow
- if(getSdrLFSAttribute().getShadow())
+ if(getSdrLFSAttribute().getShadow() && aRetval.hasElements())
{
- addShadowPrimitive3D(rTarget, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D());
+ const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
+ appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
}
+
+ return aRetval;
}
- sdrSpherePrimitive3D::sdrSpherePrimitive3D(
+ SdrSpherePrimitive3D::SdrSpherePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::sdrLineFillShadowAttribute& rSdrLFSAttribute,
- const attribute::sdr3DObjectAttribute& rSdr3DObjectAttribute,
- sal_uInt32 nHorizontalSegments, sal_uInt32 nVerticalSegments)
- : sdrPrimitive3D(rTransform, rTextureSize, rSdrLFSAttribute, rSdr3DObjectAttribute),
+ const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute,
+ sal_uInt32 nHorizontalSegments,
+ sal_uInt32 nVerticalSegments)
+ : SdrPrimitive3D(rTransform, rTextureSize, rSdrLFSAttribute, rSdr3DObjectAttribute),
mnHorizontalSegments(nHorizontalSegments),
mnVerticalSegments(nVerticalSegments)
{
}
- sdrSpherePrimitive3D::~sdrSpherePrimitive3D()
- {
- }
-
- bool sdrSpherePrimitive3D::operator==(const basePrimitive3D& rPrimitive) const
+ bool SdrSpherePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
- if(sdrPrimitive3D::operator==(rPrimitive))
+ if(SdrPrimitive3D::operator==(rPrimitive))
{
- const sdrSpherePrimitive3D& rCompare = static_cast< const sdrSpherePrimitive3D& >(rPrimitive);
- return (mnHorizontalSegments == rCompare.mnHorizontalSegments
- && mnVerticalSegments == rCompare.mnVerticalSegments);
+ const SdrSpherePrimitive3D& rCompare = static_cast< const SdrSpherePrimitive3D& >(rPrimitive);
+
+ return (getHorizontalSegments() == rCompare.getHorizontalSegments()
+ && getVerticalSegments() == rCompare.getVerticalSegments());
}
return false;
}
- PrimitiveID sdrSpherePrimitive3D::getID() const
- {
- return CreatePrimitiveID('S', 'S', 'P', '3');
- }
-
- basegfx::B3DRange sdrSpherePrimitive3D::get3DRange() const
+ basegfx::B3DRange SdrSpherePrimitive3D::getB3DRange(double /*fTime*/) const
{
// use defaut from sdrPrimitive3D which uses transformation expanded by line width/2
// The parent implementation which uses the ranges of the decomposition would be more
@@ -212,6 +214,11 @@ namespace drawinglayer
// has priority here.
return getStandard3DRange();
}
+
+ sal_uInt32 SdrSpherePrimitive3D::getPrimitiveID() const
+ {
+ return Create3DPrimitiveID('3','S','p','h');
+ }
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive3d/shadowprimitive3d.cxx b/drawinglayer/source/primitive3d/shadowprimitive3d.cxx
index f806265eefc2..10ebb54f23a6 100644
--- a/drawinglayer/source/primitive3d/shadowprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/shadowprimitive3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: shadowprimitive3d.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:51:16 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:38:34 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,20 +33,27 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/shadowprimitive3d.hxx>
#endif
//////////////////////////////////////////////////////////////////////////////
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
namespace drawinglayer
{
namespace primitive3d
{
- shadowPrimitive3D::shadowPrimitive3D(
- const basegfx::B2DHomMatrix& rShadowTransform, const basegfx::BColor& rShadowColor,
- double fShadowTransparence, bool bShadow3D, const primitiveVector3D& rPrimitiveVector)
- : vectorPrimitive3D(rPrimitiveVector),
+ ShadowPrimitive3D::ShadowPrimitive3D(
+ const basegfx::B2DHomMatrix& rShadowTransform,
+ const basegfx::BColor& rShadowColor,
+ double fShadowTransparence,
+ bool bShadow3D,
+ const Primitive3DSequence& rChildren)
+ : GroupPrimitive3D(rChildren),
maShadowTransform(rShadowTransform),
maShadowColor(rShadowColor),
mfShadowTransparence(fShadowTransparence),
@@ -54,27 +61,24 @@ namespace drawinglayer
{
}
- shadowPrimitive3D::~shadowPrimitive3D()
+ bool ShadowPrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
- }
-
- bool shadowPrimitive3D::operator==(const basePrimitive3D& rPrimitive) const
- {
- if(vectorPrimitive3D::operator==(rPrimitive))
+ if(GroupPrimitive3D::operator==(rPrimitive))
{
- const shadowPrimitive3D& rCompare = (shadowPrimitive3D&)rPrimitive;
- return (maShadowTransform == rCompare.maShadowTransform
- && maShadowColor == rCompare.maShadowColor
- && mfShadowTransparence == rCompare.mfShadowTransparence
- && mbShadow3D == rCompare.mbShadow3D);
+ const ShadowPrimitive3D& rCompare = (ShadowPrimitive3D&)rPrimitive;
+
+ return (getShadowTransform() == rCompare.getShadowTransform()
+ && getShadowColor() == rCompare.getShadowColor()
+ && getShadowTransparence() == rCompare.getShadowTransparence()
+ && getShadow3D() == rCompare.getShadow3D());
}
return false;
}
- PrimitiveID shadowPrimitive3D::getID() const
+ sal_uInt32 ShadowPrimitive3D::getPrimitiveID() const
{
- return CreatePrimitiveID('S', 'H', 'D', '3');
+ return Create3DPrimitiveID('3','S','h','a');
}
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive3d/textureprimitive3d.cxx b/drawinglayer/source/primitive3d/textureprimitive3d.cxx
index a220c5c76ae4..876765b948d9 100644
--- a/drawinglayer/source/primitive3d/textureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/textureprimitive3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: textureprimitive3d.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:51:16 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:38:34 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,37 +33,39 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/textureprimitive3d.hxx>
#endif
//////////////////////////////////////////////////////////////////////////////
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
namespace drawinglayer
{
namespace primitive3d
{
- texturePrimitive3D::texturePrimitive3D(
- const primitiveVector3D& rPrimitiveVector,
+ TexturePrimitive3D::TexturePrimitive3D(
+ const Primitive3DSequence& rChildren,
const basegfx::B2DVector& rTextureSize,
bool bModulate, bool bFilter)
- : vectorPrimitive3D(rPrimitiveVector),
+ : GroupPrimitive3D(rChildren),
maTextureSize(rTextureSize),
mbModulate(bModulate),
mbFilter(bFilter)
{
}
- texturePrimitive3D::~texturePrimitive3D()
- {
- }
-
- bool texturePrimitive3D::operator==(const basePrimitive3D& rPrimitive) const
+ bool TexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
- if(vectorPrimitive3D::operator==(rPrimitive))
+ if(GroupPrimitive3D::operator==(rPrimitive))
{
- const texturePrimitive3D& rCompare = (texturePrimitive3D&)rPrimitive;
- return (mbModulate == rCompare.mbModulate && mbFilter == rCompare.mbFilter);
+ const TexturePrimitive3D& rCompare = (TexturePrimitive3D&)rPrimitive;
+
+ return (getModulate() == rCompare.getModulate()
+ && getFilter() == rCompare.getFilter());
}
return false;
@@ -77,53 +79,51 @@ namespace drawinglayer
{
namespace primitive3d
{
- void simpleTransparenceTexturePrimitive3D::decompose(primitiveVector3D& rTarget)
+ Primitive3DSequence UnifiedAlphaTexturePrimitive3D::createLocalDecomposition(double /*fTime*/) const
{
- if(0.0 == mfTransparence)
+ if(0.0 == getTransparence())
{
- // no transparence used, so just add the content
- rTarget.insert(rTarget.end(), maPrimitiveVector.begin(), maPrimitiveVector.end());
+ // no transparence used, so just use content
+ return getChildren();
}
- else if(mfTransparence > 0.0 && mfTransparence < 1.0)
+ else if(getTransparence() > 0.0 && getTransparence() < 1.0)
{
- // create transparenceTexturePrimitive3D with fixed transparence as replacement
- const basegfx::BColor aGray(mfTransparence, mfTransparence, mfTransparence);
- const attribute::fillGradientAttribute aFillGradient(attribute::GRADIENTSTYLE_LINEAR, 0.0, 0.0, 0.0, 0.0, aGray, aGray, 1);
- basePrimitive3D* pNewTransparenceTexturePrimitive3D = new transparenceTexturePrimitive3D(aFillGradient, maPrimitiveVector, maTextureSize);
- rTarget.push_back(referencedPrimitive3D(*pNewTransparenceTexturePrimitive3D));
+ // create AlphaTexturePrimitive3D with fixed transparence as replacement
+ const basegfx::BColor aGray(getTransparence(), getTransparence(), getTransparence());
+ const attribute::FillGradientAttribute aFillGradient(attribute::GRADIENTSTYLE_LINEAR, 0.0, 0.0, 0.0, 0.0, aGray, aGray, 1);
+ const Primitive3DReference xRef(new AlphaTexturePrimitive3D(aFillGradient, getChildren(), getTextureSize()));
+ return Primitive3DSequence(&xRef, 1L);
}
else
{
// completely transparent or invalid definition, add nothing
+ return Primitive3DSequence();
}
}
- simpleTransparenceTexturePrimitive3D::simpleTransparenceTexturePrimitive3D(
+ UnifiedAlphaTexturePrimitive3D::UnifiedAlphaTexturePrimitive3D(
double fTransparence,
- const primitiveVector3D& rPrimitiveVector)
- : texturePrimitive3D(rPrimitiveVector, basegfx::B2DVector(), false, false),
+ const Primitive3DSequence& rChildren)
+ : TexturePrimitive3D(rChildren, basegfx::B2DVector(), false, false),
mfTransparence(fTransparence)
{
}
- simpleTransparenceTexturePrimitive3D::~simpleTransparenceTexturePrimitive3D()
+ bool UnifiedAlphaTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
- }
-
- bool simpleTransparenceTexturePrimitive3D::operator==(const basePrimitive3D& rPrimitive) const
- {
- if(texturePrimitive3D::operator==(rPrimitive))
+ if(TexturePrimitive3D::operator==(rPrimitive))
{
- const simpleTransparenceTexturePrimitive3D& rCompare = (simpleTransparenceTexturePrimitive3D&)rPrimitive;
- return (mfTransparence == rCompare.mfTransparence);
+ const UnifiedAlphaTexturePrimitive3D& rCompare = (UnifiedAlphaTexturePrimitive3D&)rPrimitive;
+
+ return (getTransparence() == rCompare.getTransparence());
}
return false;
}
- PrimitiveID simpleTransparenceTexturePrimitive3D::getID() const
+ sal_uInt32 UnifiedAlphaTexturePrimitive3D::getPrimitiveID() const
{
- return CreatePrimitiveID('S', 'T', 'X', '3');
+ return Create3DPrimitiveID('3','U','A','T');
}
} // end of namespace primitive3d
} // end of namespace drawinglayer
@@ -134,40 +134,37 @@ namespace drawinglayer
{
namespace primitive3d
{
- void gradientTexturePrimitive3D::decompose(primitiveVector3D& rTarget)
+ Primitive3DSequence GradientTexturePrimitive3D::createLocalDecomposition(double /*fTime*/) const
{
- rTarget.insert(rTarget.end(), maPrimitiveVector.begin(), maPrimitiveVector.end());
+ return getChildren();
}
- gradientTexturePrimitive3D::gradientTexturePrimitive3D(
- const attribute::fillGradientAttribute& rGradient,
- const primitiveVector3D& rPrimitiveVector,
+ GradientTexturePrimitive3D::GradientTexturePrimitive3D(
+ const attribute::FillGradientAttribute& rGradient,
+ const Primitive3DSequence& rChildren,
const basegfx::B2DVector& rTextureSize,
bool bModulate,
bool bFilter)
- : texturePrimitive3D(rPrimitiveVector, rTextureSize, bModulate, bFilter),
+ : TexturePrimitive3D(rChildren, rTextureSize, bModulate, bFilter),
maGradient(rGradient)
{
}
- gradientTexturePrimitive3D::~gradientTexturePrimitive3D()
+ bool GradientTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
- }
-
- bool gradientTexturePrimitive3D::operator==(const basePrimitive3D& rPrimitive) const
- {
- if(texturePrimitive3D::operator==(rPrimitive))
+ if(TexturePrimitive3D::operator==(rPrimitive))
{
- const gradientTexturePrimitive3D& rCompare = (gradientTexturePrimitive3D&)rPrimitive;
- return (maGradient == rCompare.maGradient);
+ const GradientTexturePrimitive3D& rCompare = (GradientTexturePrimitive3D&)rPrimitive;
+
+ return (getGradient() == rCompare.getGradient());
}
return false;
}
- PrimitiveID gradientTexturePrimitive3D::getID() const
+ sal_uInt32 GradientTexturePrimitive3D::getPrimitiveID() const
{
- return CreatePrimitiveID('G', 'R', 'X', '3');
+ return Create3DPrimitiveID('3','G','T','e');
}
} // end of namespace primitive3d
} // end of namespace drawinglayer
@@ -178,39 +175,36 @@ namespace drawinglayer
{
namespace primitive3d
{
- void bitmapTexturePrimitive3D::decompose(primitiveVector3D& rTarget)
+ Primitive3DSequence BitmapTexturePrimitive3D::createLocalDecomposition(double /*fTime*/) const
{
- rTarget.insert(rTarget.end(), maPrimitiveVector.begin(), maPrimitiveVector.end());
+ return getChildren();
}
- bitmapTexturePrimitive3D::bitmapTexturePrimitive3D(
- const attribute::fillBitmapAttribute& rBitmap,
- const primitiveVector3D& rPrimitiveVector,
+ BitmapTexturePrimitive3D::BitmapTexturePrimitive3D(
+ const attribute::FillBitmapAttribute& rBitmap,
+ const Primitive3DSequence& rChildren,
const basegfx::B2DVector& rTextureSize,
bool bModulate, bool bFilter)
- : texturePrimitive3D(rPrimitiveVector, rTextureSize, bModulate, bFilter),
+ : TexturePrimitive3D(rChildren, rTextureSize, bModulate, bFilter),
maBitmap(rBitmap)
{
}
- bitmapTexturePrimitive3D::~bitmapTexturePrimitive3D()
+ bool BitmapTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
- }
-
- bool bitmapTexturePrimitive3D::operator==(const basePrimitive3D& rPrimitive) const
- {
- if(texturePrimitive3D::operator==(rPrimitive))
+ if(TexturePrimitive3D::operator==(rPrimitive))
{
- const bitmapTexturePrimitive3D& rCompare = (bitmapTexturePrimitive3D&)rPrimitive;
- return (maBitmap == rCompare.maBitmap);
+ const BitmapTexturePrimitive3D& rCompare = (BitmapTexturePrimitive3D&)rPrimitive;
+
+ return (getBitmap() == rCompare.getBitmap());
}
return false;
}
- PrimitiveID bitmapTexturePrimitive3D::getID() const
+ sal_uInt32 BitmapTexturePrimitive3D::getPrimitiveID() const
{
- return CreatePrimitiveID('B', 'M', 'X', '3');
+ return Create3DPrimitiveID('3','B','T','e');
}
} // end of namespace primitive3d
} // end of namespace drawinglayer
@@ -221,26 +215,22 @@ namespace drawinglayer
{
namespace primitive3d
{
- transparenceTexturePrimitive3D::transparenceTexturePrimitive3D(
- const attribute::fillGradientAttribute& rGradient,
- const primitiveVector3D& rPrimitiveVector,
+ AlphaTexturePrimitive3D::AlphaTexturePrimitive3D(
+ const attribute::FillGradientAttribute& rGradient,
+ const Primitive3DSequence& rChildren,
const basegfx::B2DVector& rTextureSize)
- : gradientTexturePrimitive3D(rGradient, rPrimitiveVector, rTextureSize, false, false)
- {
- }
-
- transparenceTexturePrimitive3D::~transparenceTexturePrimitive3D()
+ : GradientTexturePrimitive3D(rGradient, rChildren, rTextureSize, false, false)
{
}
- bool transparenceTexturePrimitive3D::operator==(const basePrimitive3D& rPrimitive) const
+ bool AlphaTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
- return (gradientTexturePrimitive3D::operator==(rPrimitive));
+ return (GradientTexturePrimitive3D::operator==(rPrimitive));
}
- PrimitiveID transparenceTexturePrimitive3D::getID() const
+ sal_uInt32 AlphaTexturePrimitive3D::getPrimitiveID() const
{
- return CreatePrimitiveID('T', 'R', 'X', '3');
+ return Create3DPrimitiveID('3','A','T','e');
}
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive3d/transformprimitive3d.cxx b/drawinglayer/source/primitive3d/transformprimitive3d.cxx
index 22fafbcac2b2..80a2635b6061 100644
--- a/drawinglayer/source/primitive3d/transformprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/transformprimitive3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: transformprimitive3d.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:51:16 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:38:34 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,47 +33,54 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_TRANSFORMPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TRANSFORMPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
#endif
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
{
namespace primitive3d
{
- transformPrimitive3D::transformPrimitive3D(const basegfx::B3DHomMatrix& rTransformation, const primitiveVector3D& rPrimitiveVector)
- : vectorPrimitive3D(rPrimitiveVector),
+ TransformPrimitive3D::TransformPrimitive3D(
+ const basegfx::B3DHomMatrix& rTransformation,
+ const Primitive3DSequence& rChildren)
+ : GroupPrimitive3D(rChildren),
maTransformation(rTransformation)
{
}
- transformPrimitive3D::~transformPrimitive3D()
+ bool TransformPrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
- }
-
- bool transformPrimitive3D::operator==(const basePrimitive3D& rPrimitive) const
- {
- if(vectorPrimitive3D::operator==(rPrimitive))
+ if(GroupPrimitive3D::operator==(rPrimitive))
{
- const transformPrimitive3D& rCompare = static_cast< const transformPrimitive3D& >(rPrimitive);
- return (maTransformation == rCompare.maTransformation);
+ const TransformPrimitive3D& rCompare = static_cast< const TransformPrimitive3D& >(rPrimitive);
+
+ return (getTransformation() == rCompare.getTransformation());
}
return false;
}
- PrimitiveID transformPrimitive3D::getID() const
+ basegfx::B3DRange TransformPrimitive3D::getB3DRange(double fTime) const
{
- return CreatePrimitiveID('T', 'R', 'N', '3');
+ basegfx::B3DRange aRetval(getB3DRangeFromPrimitive3DSequence(getChildren(), fTime));
+ aRetval.transform(getTransformation());
+ return aRetval;
}
- basegfx::B3DRange transformPrimitive3D::get3DRange() const
+ sal_uInt32 TransformPrimitive3D::getPrimitiveID() const
{
- basegfx::B3DRange aRetval(get3DRangeFromVector(maPrimitiveVector));
- aRetval.transform(maTransformation);
- return aRetval;
+ return Create3DPrimitiveID('3','T','r','a');
}
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/processor2d/baseprocessor2d.cxx b/drawinglayer/source/processor2d/baseprocessor2d.cxx
new file mode 100644
index 000000000000..e68d2870a315
--- /dev/null
+++ b/drawinglayer/source/processor2d/baseprocessor2d.cxx
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: baseprocessor2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35:37 $
+ *
+ * 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
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ BaseProcessor2D::BaseProcessor2D(const geometry::ViewInformation2D& rViewInformation)
+ : maViewInformation2D(rViewInformation)
+ {
+ }
+
+ BaseProcessor2D::~BaseProcessor2D()
+ {
+ }
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ CollectingProcessor2D::CollectingProcessor2D(const geometry::ViewInformation2D& rViewInformation)
+ : BaseProcessor2D(rViewInformation),
+ maPrimitiveSequence()
+ {
+ }
+
+ void CollectingProcessor2D::process(const primitive2d::Primitive2DSequence& rSource)
+ {
+ // accept everything
+ primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(maPrimitiveSequence, rSource);
+ }
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/processor2d/makefile.mk b/drawinglayer/source/processor2d/makefile.mk
new file mode 100644
index 000000000000..ac668486e739
--- /dev/null
+++ b/drawinglayer/source/processor2d/makefile.mk
@@ -0,0 +1,54 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1 $
+#
+# last change: $Author: aw $ $Date: 2006-10-19 10:35:37 $
+#
+# 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
+#
+#*************************************************************************
+
+PRJ=..$/..
+PRJNAME=drawinglayer
+TARGET=processor2d
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings ----------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Files -------------------------------------
+
+SLOFILES= \
+ $(SLO)$/animatedextractor2d.obj \
+ $(SLO)$/baseprocessor2d.obj \
+ $(SLO)$/vclprocessor2d.obj
+
+# --- Targets ----------------------------------
+
+.INCLUDE : target.mk
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
new file mode 100644
index 000000000000..b45f0146f99b
--- /dev/null
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -0,0 +1,1718 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: vclprocessor2d.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2006-10-19 10:35:37 $
+ *
+ * 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
+#include <drawinglayer/processor2d/vclprocessor2d.hxx>
+#endif
+
+#ifndef _SV_OUTDEV_HXX
+#include <vcl/outdev.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGON_HXX
+#include <basegfx/polygon/b2dpolygon.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX
+#include <drawinglayer/attribute/fillattribute.hxx>
+#endif
+
+#ifndef _BGFX_POLYPOLYGON_B2DPOLYGONTOOLS_HXX
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGONTOOLS_HXX
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE_HXX
+#include <drawinglayer/texture/texture.hxx>
+#endif
+
+#ifndef _SV_BMPACC_HXX
+#include <vcl/bmpacc.hxx>
+#endif
+
+#ifndef _SV_BITMAPEX_HXX
+#include <vcl/bitmapex.hxx>
+#endif
+
+#ifndef _SV_VIRDEV_HXX
+#include <vcl/virdev.hxx>
+#endif
+
+#ifndef _GRFMGR_HXX
+#include <goodies/grfmgr.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE_TEXTPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/textprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYGONPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BITMAPPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX
+#include <drawinglayer/attribute/sdrfillbitmapattribute.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLBITMAPPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/fillbitmapprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_METAFILEPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
+#endif
+
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MASKPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_ALPHAPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MARKERPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/markerprimitive2d.hxx>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+// support methods for vcl direct gradeint renderering
+
+namespace drawinglayer
+{
+ namespace
+ {
+ sal_uInt32 impCalcGradientSteps(OutputDevice& rOutDev, sal_uInt32 nSteps, const basegfx::B2DRange& rRange, sal_uInt32 nMaxDist)
+ {
+ if(nSteps == 0L)
+ {
+ const Size aSize(rOutDev.LogicToPixel(Size(basegfx::fround(rRange.getWidth()), basegfx::fround(rRange.getHeight()))));
+ nSteps = (aSize.getWidth() + aSize.getHeight()) >> 3L;
+ }
+
+ if(nSteps < 2L)
+ {
+ nSteps = 2L;
+ }
+
+ if(nSteps > nMaxDist)
+ {
+ nSteps = nMaxDist;
+ }
+
+ return nSteps;
+ }
+
+ void impDrawGradientToOutDevSimple(
+ OutputDevice& rOutDev,
+ const basegfx::B2DPolyPolygon& rTargetForm,
+ const ::std::vector< basegfx::B2DHomMatrix >& rMatrices,
+ const ::std::vector< basegfx::BColor >& rColors,
+ const basegfx::B2DPolygon& rUnitPolygon)
+ {
+ rOutDev.SetLineColor();
+
+ for(sal_uInt32 a(0L); a < rColors.size(); a++)
+ {
+ // set correct color
+ const basegfx::BColor aFillColor(rColors[a]);
+ rOutDev.SetFillColor(Color(aFillColor));
+
+ if(a)
+ {
+ if(a - 1L < rMatrices.size())
+ {
+ basegfx::B2DPolygon aNewPoly(rUnitPolygon);
+ aNewPoly.transform(rMatrices[a - 1L]);
+ rOutDev.DrawPolygon(Polygon(aNewPoly));
+ }
+ }
+ else
+ {
+ rOutDev.DrawPolyPolygon(PolyPolygon(rTargetForm));
+ }
+ }
+ }
+
+ void impDrawGradientToOutDevComplex(
+ OutputDevice& rOutDev,
+ const basegfx::B2DPolyPolygon& rTargetForm,
+ const ::std::vector< basegfx::B2DHomMatrix >& rMatrices,
+ const ::std::vector< basegfx::BColor >& rColors,
+ const basegfx::B2DPolygon& rUnitPolygon)
+ {
+ PolyPolygon aVclTargetForm(rTargetForm);
+ ::std::vector< Polygon > aVclPolygons;
+ sal_uInt32 a;
+
+ // remember and set to XOR
+ rOutDev.SetLineColor();
+ rOutDev.Push(PUSH_RASTEROP);
+ rOutDev.SetRasterOp(ROP_XOR);
+
+ // draw gradient PolyPolygons
+ for(a = 0L; a < rMatrices.size(); a++)
+ {
+ // create polygon and remember
+ basegfx::B2DPolygon aNewPoly(rUnitPolygon);
+ aNewPoly.transform(rMatrices[a]);
+ aVclPolygons.push_back(Polygon(aNewPoly));
+
+ // set correct color
+ if(rColors.size() > a)
+ {
+ const basegfx::BColor aFillColor(rColors[a]);
+ rOutDev.SetFillColor(Color(aFillColor));
+ }
+
+ // create vcl PolyPolygon and draw it
+ if(a)
+ {
+ PolyPolygon aVclPolyPoly(aVclPolygons[a - 1L]);
+ aVclPolyPoly.Insert(aVclPolygons[a]);
+ rOutDev.DrawPolyPolygon(aVclPolyPoly);
+ }
+ else
+ {
+ PolyPolygon aVclPolyPoly(aVclTargetForm);
+ aVclPolyPoly.Insert(aVclPolygons[0L]);
+ rOutDev.DrawPolyPolygon(aVclPolyPoly);
+ }
+ }
+
+ // draw last poly in last color
+ if(rColors.size())
+ {
+ const basegfx::BColor aFillColor(rColors[rColors.size() - 1L]);
+ rOutDev.SetFillColor(Color(aFillColor));
+ rOutDev.DrawPolygon(aVclPolygons[aVclPolygons.size() - 1L]);
+ }
+
+ // draw object form in black and go back to XOR
+ rOutDev.SetFillColor(COL_BLACK);
+ rOutDev.SetRasterOp(ROP_0);
+ rOutDev.DrawPolyPolygon(aVclTargetForm);
+ rOutDev.SetRasterOp(ROP_XOR);
+
+ // draw gradient PolyPolygons again
+ for(a = 0L; a < rMatrices.size(); a++)
+ {
+ // set correct color
+ if(rColors.size() > a)
+ {
+ const basegfx::BColor aFillColor(rColors[a]);
+ rOutDev.SetFillColor(Color(aFillColor));
+ }
+
+ // create vcl PolyPolygon and draw it
+ if(a)
+ {
+ PolyPolygon aVclPolyPoly(aVclPolygons[a - 1L]);
+ aVclPolyPoly.Insert(aVclPolygons[a]);
+ rOutDev.DrawPolyPolygon(aVclPolyPoly);
+ }
+ else
+ {
+ PolyPolygon aVclPolyPoly(aVclTargetForm);
+ aVclPolyPoly.Insert(aVclPolygons[0L]);
+ rOutDev.DrawPolyPolygon(aVclPolyPoly);
+ }
+ }
+
+ // draw last poly in last color
+ if(rColors.size())
+ {
+ const basegfx::BColor aFillColor(rColors[rColors.size() - 1L]);
+ rOutDev.SetFillColor(Color(aFillColor));
+ rOutDev.DrawPolygon(aVclPolygons[aVclPolygons.size() - 1L]);
+ }
+
+ // reset drawmode
+ rOutDev.Pop();
+ }
+
+ void impDrawGradientToOutDev(
+ OutputDevice& rOutDev,
+ const basegfx::B2DPolyPolygon& rTargetForm,
+ attribute::GradientStyle eGradientStyle,
+ sal_uInt32 nSteps,
+ const basegfx::BColor& rStart,
+ const basegfx::BColor& rEnd,
+ double fBorder, double fAngle, double fOffsetX, double fOffsetY, bool bSimple)
+ {
+ const basegfx::B2DRange aOutlineRange(basegfx::tools::getRange(rTargetForm));
+ ::std::vector< basegfx::B2DHomMatrix > aMatrices;
+ ::std::vector< basegfx::BColor > aColors;
+ basegfx::B2DPolygon aUnitPolygon;
+
+ if(attribute::GRADIENTSTYLE_RADIAL == eGradientStyle || attribute::GRADIENTSTYLE_ELLIPTICAL == eGradientStyle)
+ {
+ const basegfx::B2DPoint aCircleCenter(0.5, 0.5);
+ aUnitPolygon = basegfx::tools::createPolygonFromEllipse(aCircleCenter, 0.5, 0.5);
+ // aUnitPolygon = basegfx::tools::adaptiveSubdivideByAngle(aUnitPolygon);
+ }
+ else
+ {
+ aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0));
+ }
+
+ // make sure steps is not too high/low
+ nSteps = impCalcGradientSteps(rOutDev, nSteps, aOutlineRange, sal_uInt32((rStart.getMaximumDistance(rEnd) * 127.5) + 0.5));
+
+ // create geometries
+ switch(eGradientStyle)
+ {
+ case attribute::GRADIENTSTYLE_LINEAR:
+ {
+ texture::GeoTexSvxGradientLinear aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fAngle);
+ aGradient.appendTransformations(aMatrices);
+ aGradient.appendColors(aColors);
+ break;
+ }
+ case attribute::GRADIENTSTYLE_AXIAL:
+ {
+ texture::GeoTexSvxGradientAxial aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fAngle);
+ aGradient.appendTransformations(aMatrices);
+ aGradient.appendColors(aColors);
+ break;
+ }
+ case attribute::GRADIENTSTYLE_RADIAL:
+ {
+ texture::GeoTexSvxGradientRadial aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fOffsetX, fOffsetY);
+ aGradient.appendTransformations(aMatrices);
+ aGradient.appendColors(aColors);
+ break;
+ }
+ case attribute::GRADIENTSTYLE_ELLIPTICAL:
+ {
+ texture::GeoTexSvxGradientElliptical aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fOffsetX, fOffsetX, fAngle);
+ aGradient.appendTransformations(aMatrices);
+ aGradient.appendColors(aColors);
+ break;
+ }
+ case attribute::GRADIENTSTYLE_SQUARE:
+ {
+ texture::GeoTexSvxGradientSquare aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fOffsetX, fOffsetX, fAngle);
+ aGradient.appendTransformations(aMatrices);
+ aGradient.appendColors(aColors);
+ break;
+ }
+ case attribute::GRADIENTSTYLE_RECT:
+ {
+ texture::GeoTexSvxGradientRect aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fOffsetX, fOffsetX, fAngle);
+ aGradient.appendTransformations(aMatrices);
+ aGradient.appendColors(aColors);
+ break;
+ }
+ }
+
+ // paint them with mask using the XOR method
+ if(aMatrices.size())
+ {
+ if(bSimple)
+ {
+ impDrawGradientToOutDevSimple(rOutDev, rTargetForm, aMatrices, aColors, aUnitPolygon);
+ }
+ else
+ {
+ impDrawGradientToOutDevComplex(rOutDev, rTargetForm, aMatrices, aColors, aUnitPolygon);
+ }
+ }
+ }
+ } // end of anonymous namespace
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// support for rendering Bitmap and BitmapEx contents
+
+namespace drawinglayer
+{
+ namespace
+ {
+ void impSmoothPoint(BitmapColor& rValue, const basegfx::B2DPoint& rSource, sal_Int32 nIntX, sal_Int32 nIntY, BitmapReadAccess& rRead)
+ {
+ double fDeltaX(rSource.getX() - nIntX);
+ double fDeltaY(rSource.getY() - nIntY);
+ sal_Int32 nIndX(0L);
+ sal_Int32 nIndY(0L);
+
+ if(fDeltaX > 0.0 && nIntX + 1L < rRead.Width())
+ {
+ nIndX++;
+ }
+ else if(fDeltaX < 0.0 && nIntX >= 1L)
+ {
+ fDeltaX = -fDeltaX;
+ nIndX--;
+ }
+
+ if(fDeltaY > 0.0 && nIntY + 1L < rRead.Height())
+ {
+ nIndY++;
+ }
+ else if(fDeltaY < 0.0 && nIntY >= 1L)
+ {
+ fDeltaY = -fDeltaY;
+ nIndY--;
+ }
+
+ if(nIndX || nIndY)
+ {
+ const double fColorToReal(1.0 / 255.0);
+ double fR(rValue.GetRed() * fColorToReal);
+ double fG(rValue.GetGreen() * fColorToReal);
+ double fB(rValue.GetBlue() * fColorToReal);
+ double fRBottom(0.0), fGBottom(0.0), fBBottom(0.0);
+
+ if(nIndX)
+ {
+ const double fMulA(fDeltaX * fColorToReal);
+ double fMulB(1.0 - fDeltaX);
+ const BitmapColor aTopPartner(rRead.GetColor(nIntY, nIntX + nIndX));
+
+ fR = (fR * fMulB) + (aTopPartner.GetRed() * fMulA);
+ fG = (fG * fMulB) + (aTopPartner.GetGreen() * fMulA);
+ fB = (fB * fMulB) + (aTopPartner.GetBlue() * fMulA);
+
+ if(nIndY)
+ {
+ fMulB *= fColorToReal;
+ const BitmapColor aBottom(rRead.GetColor(nIntY + nIndY, nIntX));
+ const BitmapColor aBottomPartner(rRead.GetColor(nIntY + nIndY, nIntX + nIndX));
+
+ fRBottom = (aBottom.GetRed() * fMulB) + (aBottomPartner.GetRed() * fMulA);
+ fGBottom = (aBottom.GetGreen() * fMulB) + (aBottomPartner.GetGreen() * fMulA);
+ fBBottom = (aBottom.GetBlue() * fMulB) + (aBottomPartner.GetBlue() * fMulA);
+ }
+ }
+
+ if(nIndY)
+ {
+ if(!nIndX)
+ {
+ const BitmapColor aBottom(rRead.GetColor(nIntY + nIndY, nIntX));
+
+ fRBottom = aBottom.GetRed() * fColorToReal;
+ fGBottom = aBottom.GetGreen() * fColorToReal;
+ fBBottom = aBottom.GetBlue() * fColorToReal;
+ }
+
+ const double fMulB(1.0 - fDeltaY);
+
+ fR = (fR * fMulB) + (fRBottom * fDeltaY);
+ fG = (fG * fMulB) + (fGBottom * fDeltaY);
+ fB = (fB * fMulB) + (fBBottom * fDeltaY);
+ }
+
+ rValue.SetRed((sal_uInt8)(fR * 255.0));
+ rValue.SetGreen((sal_uInt8)(fG * 255.0));
+ rValue.SetBlue((sal_uInt8)(fB * 255.0));
+ }
+ }
+
+ void impSmoothIndex(BitmapColor& rValue, const basegfx::B2DPoint& rSource, sal_Int32 nIntX, sal_Int32 nIntY, BitmapReadAccess& rRead)
+ {
+ double fDeltaX(rSource.getX() - nIntX);
+ double fDeltaY(rSource.getY() - nIntY);
+ sal_Int32 nIndX(0L);
+ sal_Int32 nIndY(0L);
+
+ if(fDeltaX > 0.0 && nIntX + 1L < rRead.Width())
+ {
+ nIndX++;
+ }
+ else if(fDeltaX < 0.0 && nIntX >= 1L)
+ {
+ fDeltaX = -fDeltaX;
+ nIndX--;
+ }
+
+ if(fDeltaY > 0.0 && nIntY + 1L < rRead.Height())
+ {
+ nIndY++;
+ }
+ else if(fDeltaY < 0.0 && nIntY >= 1L)
+ {
+ fDeltaY = -fDeltaY;
+ nIndY--;
+ }
+
+ if(nIndX || nIndY)
+ {
+ const double fColorToReal(1.0 / 255.0);
+ double fVal(rValue.GetIndex() * fColorToReal);
+ double fValBottom(0.0);
+
+ if(nIndX)
+ {
+ const double fMulA(fDeltaX * fColorToReal);
+ double fMulB(1.0 - fDeltaX);
+ const BitmapColor aTopPartner(rRead.GetPixel(nIntY, nIntX + nIndX));
+
+ fVal = (fVal * fMulB) + (aTopPartner.GetIndex() * fMulA);
+
+ if(nIndY)
+ {
+ fMulB *= fColorToReal;
+ const BitmapColor aBottom(rRead.GetPixel(nIntY + nIndY, nIntX));
+ const BitmapColor aBottomPartner(rRead.GetPixel(nIntY + nIndY, nIntX + nIndX));
+
+ fValBottom = (aBottom.GetIndex() * fMulB) + (aBottomPartner.GetIndex() * fMulA);
+ }
+ }
+
+ if(nIndY)
+ {
+ if(!nIndX)
+ {
+ const BitmapColor aBottom(rRead.GetPixel(nIntY + nIndY, nIntX));
+
+ fValBottom = aBottom.GetIndex() * fColorToReal;
+ }
+
+ const double fMulB(1.0 - fDeltaY);
+
+ fVal = (fVal * fMulB) + (fValBottom * fDeltaY);
+ }
+
+ rValue.SetIndex((sal_uInt8)(fVal * 255.0));
+ }
+ }
+
+ void impTransformBitmap(const Bitmap& rSource, Bitmap& rDestination, const basegfx::B2DHomMatrix& rTransform, bool bSmooth)
+ {
+ BitmapWriteAccess* pWrite = rDestination.AcquireWriteAccess();
+
+ if(pWrite)
+ {
+ const Size aContentSizePixel(rSource.GetSizePixel());
+ BitmapReadAccess* pRead = (const_cast< Bitmap& >(rSource)).AcquireReadAccess();
+
+ if(pRead)
+ {
+ const Size aDestinationSizePixel(rDestination.GetSizePixel());
+ bool bWorkWithIndex(rDestination.GetBitCount() <= 8);
+ BitmapColor aOutside(pRead->GetBestMatchingColor(BitmapColor(0xff, 0xff, 0xff)));
+
+ for(sal_Int32 y(0L); y < aDestinationSizePixel.getHeight(); y++)
+ {
+ for(sal_Int32 x(0L); x < aDestinationSizePixel.getWidth(); x++)
+ {
+ const basegfx::B2DPoint aSourceCoor(rTransform * basegfx::B2DPoint(x, y));
+ const sal_Int32 nIntX(basegfx::fround(aSourceCoor.getX()));
+
+ if(nIntX >= 0L && nIntX < aContentSizePixel.getWidth())
+ {
+ const sal_Int32 nIntY(basegfx::fround(aSourceCoor.getY()));
+
+ if(nIntY >= 0L && nIntY < aContentSizePixel.getHeight())
+ {
+ if(bWorkWithIndex)
+ {
+ BitmapColor aValue(pRead->GetPixel(nIntY, nIntX));
+
+ if(bSmooth)
+ {
+ impSmoothIndex(aValue, aSourceCoor, nIntX, nIntY, *pRead);
+ }
+
+ pWrite->SetPixel(y, x, aValue);
+ }
+ else
+ {
+ BitmapColor aValue(pRead->GetColor(nIntY, nIntX));
+
+ if(bSmooth)
+ {
+ impSmoothPoint(aValue, aSourceCoor, nIntX, nIntY, *pRead);
+ }
+
+ pWrite->SetPixel(y, x, aValue.IsIndex() ? aValue : pWrite->GetBestMatchingColor(aValue));
+ }
+
+ continue;
+ }
+ }
+
+ // here are outside pixels. Complete mask
+ if(bWorkWithIndex)
+ {
+ pWrite->SetPixel(y, x, aOutside);
+ }
+ }
+ }
+
+ delete pRead;
+ }
+
+ delete pWrite;
+ }
+ }
+
+ Bitmap impCreateEmptyBitmapWithPattern(const Bitmap& rSource, const Size& aTargetSizePixel)
+ {
+ Bitmap aRetval;
+ BitmapReadAccess* pReadAccess = (const_cast< Bitmap& >(rSource)).AcquireReadAccess();
+
+ if(pReadAccess)
+ {
+ if(rSource.GetBitCount() <= 8)
+ {
+ BitmapPalette aPalette(pReadAccess->GetPalette());
+ aRetval = Bitmap(aTargetSizePixel, rSource.GetBitCount(), &aPalette);
+ }
+ else
+ {
+ aRetval = Bitmap(aTargetSizePixel, rSource.GetBitCount());
+ }
+
+ delete pReadAccess;
+ }
+
+ return aRetval;
+ }
+
+ BitmapEx impTransformBitmapEx(const BitmapEx& rSource, const Rectangle &rCroppedRectPixel, const basegfx::B2DHomMatrix& rTransform)
+ {
+ // force destination to 24 bit, we want to smooth output
+ const Size aDestinationSize(rCroppedRectPixel.GetSize());
+ Bitmap aDestination(impCreateEmptyBitmapWithPattern(rSource.GetBitmap(), aDestinationSize));
+ static bool bDoSmoothAtAll(true);
+ impTransformBitmap(rSource.GetBitmap(), aDestination, rTransform, bDoSmoothAtAll);
+
+ // create mask
+ if(rSource.IsTransparent())
+ {
+ if(rSource.IsAlpha())
+ {
+ Bitmap aAlpha(impCreateEmptyBitmapWithPattern(rSource.GetAlpha().GetBitmap(), aDestinationSize));
+ impTransformBitmap(rSource.GetAlpha().GetBitmap(), aAlpha, rTransform, bDoSmoothAtAll);
+ return BitmapEx(aDestination, AlphaMask(aAlpha));
+ }
+ else
+ {
+ Bitmap aMask(impCreateEmptyBitmapWithPattern(rSource.GetMask(), aDestinationSize));
+ impTransformBitmap(rSource.GetMask(), aMask, rTransform, false);
+ return BitmapEx(aDestination, aMask);
+ }
+ }
+
+ return BitmapEx(aDestination);
+ }
+
+ } // end of anonymous namespace
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// support class for OutputDevice output with mask
+
+namespace drawinglayer
+{
+ namespace
+ {
+ class impBufferDevice
+ {
+ OutputDevice& mrOutDev;
+ VirtualDevice maContent;
+ VirtualDevice* mpMask;
+ VirtualDevice* mpAlpha;
+ Rectangle maDestPixel;
+
+ public:
+ impBufferDevice(OutputDevice& rOutDev, const basegfx::B2DRange& rRange);
+ ~impBufferDevice();
+
+ void paint(double fTrans = 0.0);
+ bool isVisible() const { return !maDestPixel.IsEmpty(); }
+ VirtualDevice& getContent() { return maContent; }
+ VirtualDevice& getMask();
+ VirtualDevice& getAlpha();
+ };
+
+ impBufferDevice::impBufferDevice(OutputDevice& rOutDev, const basegfx::B2DRange& rRange)
+ : mrOutDev(rOutDev),
+ maContent(rOutDev),
+ mpMask(0L),
+ mpAlpha(0L)
+ {
+ const Rectangle aRectLogic(
+ (sal_Int32)floor(rRange.getMinX()), (sal_Int32)floor(rRange.getMinY()),
+ (sal_Int32)floor(rRange.getMaxX()) + 1L, (sal_Int32)floor(rRange.getMaxY()) + 1L);
+ const Rectangle aRectPixel(rOutDev.LogicToPixel(aRectLogic));
+ const Point aEmptyPoint;
+ maDestPixel = Rectangle(aEmptyPoint, rOutDev.GetOutputSizePixel());
+ maDestPixel.Intersection(aRectPixel);
+
+ if(isVisible())
+ {
+ maContent.SetOutputSizePixel(maDestPixel.GetSize(), false);
+
+ const bool bWasEnabledSrc(rOutDev.IsMapModeEnabled());
+ rOutDev.EnableMapMode(false);
+ maContent.DrawOutDev(aEmptyPoint, maDestPixel.GetSize(), maDestPixel.TopLeft(), maDestPixel.GetSize(), rOutDev);
+ rOutDev.EnableMapMode(bWasEnabledSrc);
+
+ MapMode aNewMapMode(rOutDev.GetMapMode());
+ const Point aLogicTopLeft(rOutDev.PixelToLogic(maDestPixel.TopLeft()));
+ aNewMapMode.SetOrigin(Point(-aLogicTopLeft.X(), -aLogicTopLeft.Y()));
+
+ maContent.SetMapMode(aNewMapMode);
+ }
+ }
+
+ impBufferDevice::~impBufferDevice()
+ {
+ delete mpMask;
+ delete mpAlpha;
+ }
+
+ void impBufferDevice::paint(double fTrans)
+ {
+ const Point aEmptyPoint;
+ const Size aSizePixel(maContent.GetOutputSizePixel());
+ const bool bWasEnabledDst(mrOutDev.IsMapModeEnabled());
+
+ mrOutDev.EnableMapMode(false);
+ maContent.EnableMapMode(false);
+ Bitmap aContent(maContent.GetBitmap(aEmptyPoint, aSizePixel));
+
+ if(mpAlpha)
+ {
+ mpAlpha->EnableMapMode(false);
+ AlphaMask aAlphaMask(mpAlpha->GetBitmap(aEmptyPoint, aSizePixel));
+ mrOutDev.DrawBitmapEx(maDestPixel.TopLeft(), BitmapEx(aContent, aAlphaMask));
+ }
+ else if(mpMask)
+ {
+ mpMask->EnableMapMode(false);
+ Bitmap aMask(mpMask->GetBitmap(aEmptyPoint, aSizePixel));
+ mrOutDev.DrawBitmapEx(maDestPixel.TopLeft(), BitmapEx(aContent, aMask));
+ }
+ else if(0.0 != fTrans)
+ {
+ sal_uInt8 nMaskValue((sal_uInt8)basegfx::fround(fTrans * 255.0));
+ AlphaMask aAlphaMask(aSizePixel, &nMaskValue);
+ mrOutDev.DrawBitmapEx(maDestPixel.TopLeft(), BitmapEx(aContent, aAlphaMask));
+ }
+ else
+ {
+ mrOutDev.DrawBitmap(maDestPixel.TopLeft(), aContent);
+ }
+
+ mrOutDev.EnableMapMode(bWasEnabledDst);
+ }
+
+ VirtualDevice& impBufferDevice::getMask()
+ {
+ if(!mpMask)
+ {
+ mpMask = new VirtualDevice(mrOutDev, 1);
+ mpMask->SetOutputSizePixel(maDestPixel.GetSize(), true);
+ mpMask->SetMapMode(maContent.GetMapMode());
+ }
+
+ return *mpMask;
+ }
+
+ VirtualDevice& impBufferDevice::getAlpha()
+ {
+ if(!mpAlpha)
+ {
+ mpAlpha = new VirtualDevice();
+ mpAlpha->SetOutputSizePixel(maDestPixel.GetSize(), true);
+ mpAlpha->SetMapMode(maContent.GetMapMode());
+ }
+
+ return *mpAlpha;
+ }
+ } // end of anonymous namespace
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// support for different kinds of bitmap rendering using vcl
+
+namespace drawinglayer
+{
+ namespace
+ {
+ void RenderBitmapPrimitive2D_GraphicManager(OutputDevice& rOutDev, const BitmapEx& rBitmapEx, const basegfx::B2DHomMatrix& rTransform)
+ {
+ // prepare attributes
+ GraphicAttr aAttributes;
+
+ // decompose matrix to check for shear, rotate and mirroring
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ rTransform.decompose(aScale, aTranslate, fRotate, fShearX);
+
+ // mirror flags
+ aAttributes.SetMirrorFlags(
+ (basegfx::fTools::less(aScale.getX(), 0.0) ? BMP_MIRROR_HORZ : 0)|
+ (basegfx::fTools::less(aScale.getY(), 0.0) ? BMP_MIRROR_VERT : 0));
+
+ // rotation
+ if(!basegfx::fTools::equalZero(fRotate))
+ {
+ double fRotation(fmod(3600.0 - (fRotate * (10.0 / F_PI180)), 3600.0));
+ aAttributes.SetRotation((sal_uInt16)(fRotation));
+ }
+
+ // prepare Bitmap
+ basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0);
+
+ if(basegfx::fTools::equalZero(fRotate))
+ {
+ aOutlineRange.transform(rTransform);
+ }
+ else
+ {
+ // if rotated, create the unrotated output rectangle for the GraphicManager paint
+ basegfx::B2DHomMatrix aSimpleObjectMatrix;
+
+ aSimpleObjectMatrix.scale(fabs(aScale.getX()), fabs(aScale.getY()));
+ aSimpleObjectMatrix.translate(aTranslate.getX(), aTranslate.getY());
+
+ aOutlineRange.transform(aSimpleObjectMatrix);
+ }
+
+ // prepare dest coor
+ const Rectangle aDestRectPixel(
+ basegfx::fround(aOutlineRange.getMinX()), basegfx::fround(aOutlineRange.getMinY()),
+ basegfx::fround(aOutlineRange.getMaxX()), basegfx::fround(aOutlineRange.getMaxY()));
+
+ // paint it using GraphicManager
+ Graphic aGraphic(rBitmapEx);
+ GraphicObject aGraphicObject(aGraphic);
+ aGraphicObject.Draw(&rOutDev, aDestRectPixel.TopLeft(), aDestRectPixel.GetSize(), &aAttributes);
+ }
+
+ void RenderBitmapPrimitive2D_BitmapEx(OutputDevice& rOutDev, const BitmapEx& rBitmapEx, const basegfx::B2DHomMatrix& rTransform)
+ {
+ // only translate and scale, use vcl's DrawBitmapEx().
+ BitmapEx aContent(rBitmapEx);
+
+ // prepare dest coor. Necessary to expand since vcl's DrawBitmapEx draws one pix less
+ basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0);
+ aOutlineRange.transform(rTransform);
+ const Rectangle aDestRectPixel(
+ basegfx::fround(aOutlineRange.getMinX()), basegfx::fround(aOutlineRange.getMinY()),
+ basegfx::fround(aOutlineRange.getMaxX()), basegfx::fround(aOutlineRange.getMaxY()));
+
+ // decompose matrix to check for shear, rotate and mirroring
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ rTransform.decompose(aScale, aTranslate, fRotate, fShearX);
+
+ // Check mirroring.
+ sal_uInt32 nMirrorFlags(BMP_MIRROR_NONE);
+
+ if(basegfx::fTools::less(aScale.getX(), 0.0))
+ {
+ nMirrorFlags |= BMP_MIRROR_HORZ;
+ }
+
+ if(basegfx::fTools::less(aScale.getY(), 0.0))
+ {
+ nMirrorFlags |= BMP_MIRROR_VERT;
+ }
+
+ if(BMP_MIRROR_NONE != nMirrorFlags)
+ {
+ aContent.Mirror(nMirrorFlags);
+ }
+
+ // draw bitmap
+ rOutDev.DrawBitmapEx(aDestRectPixel.TopLeft(), aDestRectPixel.GetSize(), aContent);
+ }
+
+ void RenderBitmapPrimitive2D_self(OutputDevice& rOutDev, const BitmapEx& rBitmapEx, const basegfx::B2DHomMatrix& rTransform)
+ {
+ // process self with free transformation (containing shear and rotate). Get dest rect in pixels.
+ basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0);
+ aOutlineRange.transform(rTransform);
+ const Rectangle aDestRectLogic(
+ basegfx::fround(aOutlineRange.getMinX()), basegfx::fround(aOutlineRange.getMinY()),
+ basegfx::fround(aOutlineRange.getMaxX()), basegfx::fround(aOutlineRange.getMaxY()));
+ const Rectangle aDestRectPixel(rOutDev.LogicToPixel(aDestRectLogic));
+
+ // intersect with output pixel size
+ const Rectangle aOutputRectPixel(Point(), rOutDev.GetOutputSizePixel());
+ const Rectangle aCroppedRectPixel(aDestRectPixel.GetIntersection(aOutputRectPixel));
+
+ if(!aCroppedRectPixel.IsEmpty())
+ {
+ // build transform from pixel in aDestination to pixel in rBitmapEx
+ basegfx::B2DHomMatrix aTransform;
+
+ // from relative in aCroppedRectPixel to relative in aDestRectPixel
+ aTransform.translate(aCroppedRectPixel.Left() - aDestRectPixel.Left(), aCroppedRectPixel.Top() - aDestRectPixel.Top());
+
+ // from relative in aDestRectPixel to absolute Logic
+ aTransform.scale((double)aDestRectLogic.getWidth() / (double)aDestRectPixel.getWidth(), (double)aDestRectLogic.getHeight() / (double)aDestRectPixel.getHeight());
+ aTransform.translate(aDestRectLogic.Left(), aDestRectLogic.Top());
+
+ // from absolute in Logic to unified object coordinates (0.0 .. 1.0 in x and y)
+ basegfx::B2DHomMatrix aInvBitmapTransform(rTransform);
+ aInvBitmapTransform.invert();
+ aTransform = aInvBitmapTransform * aTransform;
+
+ // from unit object coordinates to rBitmapEx pixel coordintes
+ const Size aSourceSizePixel(rBitmapEx.GetSizePixel());
+ aTransform.scale(aSourceSizePixel.getWidth() - 1L, aSourceSizePixel.getHeight() - 1L);
+
+ // create bitmap using source, destination and linear back-transformation
+ BitmapEx aDestination = impTransformBitmapEx(rBitmapEx, aCroppedRectPixel, aTransform);
+
+ // paint
+ const bool bWasEnabled(rOutDev.IsMapModeEnabled());
+ rOutDev.EnableMapMode(false);
+ rOutDev.DrawBitmapEx(aCroppedRectPixel.TopLeft(), aDestination);
+ rOutDev.EnableMapMode(bWasEnabled);
+ }
+ }
+
+ BitmapEx impModifyBitmapEx(const basegfx::BColorModifierStack& rBColorModifierStack, const BitmapEx& rSource)
+ {
+ Bitmap aChangedBitmap(rSource.GetBitmap());
+ bool bDone(false);
+
+ for(sal_uInt32 a(rBColorModifierStack.count()); a && !bDone; )
+ {
+ const basegfx::BColorModifier& rModifier = rBColorModifierStack.getBColorModifier(--a);
+
+ switch(rModifier.getMode())
+ {
+ case basegfx::BCOLORMODIFYMODE_REPLACE :
+ {
+ // complete replace
+ if(rSource.IsTransparent())
+ {
+ // clear bitmap with dest color
+ aChangedBitmap.Erase(Color(rModifier.getBColor()));
+ }
+ else
+ {
+ // erase bitmap, caller will know to paint direct
+ aChangedBitmap.SetEmpty();
+ }
+
+ bDone = true;
+ break;
+ }
+
+ default : // BCOLORMODIFYMODE_INTERPOLATE, BCOLORMODIFYMODE_GRAY, BCOLORMODIFYMODE_BLACKANDWHITE
+ {
+ BitmapWriteAccess* pContent = aChangedBitmap.AcquireWriteAccess();
+
+ if(pContent)
+ {
+ for(sal_uInt32 y(0L); y < (sal_uInt32)pContent->Height(); y++)
+ {
+ for(sal_uInt32 x(0L); x < (sal_uInt32)pContent->Width(); x++)
+ {
+ const basegfx::BColor aBColor(rModifier.getModifiedColor(Color(pContent->GetPixel(y, x)).getBColor()));
+ pContent->SetPixel(y, x, BitmapColor(Color(aBColor)));
+ }
+ }
+
+ delete pContent;
+ }
+
+ break;
+ }
+ }
+ }
+
+ if(aChangedBitmap.IsEmpty())
+ {
+ return BitmapEx();
+ }
+ else
+ {
+ if(rSource.IsTransparent())
+ {
+ if(rSource.IsAlpha())
+ {
+ return BitmapEx(aChangedBitmap, rSource.GetAlpha());
+ }
+ else
+ {
+ return BitmapEx(aChangedBitmap, rSource.GetMask());
+ }
+ }
+ else
+ {
+ return BitmapEx(aChangedBitmap);
+ }
+ }
+ }
+ } // end of anonymous namespace
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ //////////////////////////////////////////////////////////////////////////////
+ // rendering support
+
+ // directdraw of text simple portion
+ void VclProcessor2D::RenderTextSimplePortionPrimitive2D(const primitive2d::TextSimplePortionPrimitive2D& rTextCandidate)
+ {
+ // decompose matrix to have position and size of text
+ basegfx::B2DHomMatrix aLocalTransform(maCurrentTransformation * rTextCandidate.getTextTransform());
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ aLocalTransform.decompose(aScale, aTranslate, fRotate, fShearX);
+ bool bPrimitiveAccepted(false);
+
+ if(basegfx::fTools::equalZero(fShearX))
+ {
+ if(basegfx::fTools::less(aScale.getX(), 0.0) && basegfx::fTools::less(aScale.getY(), 0.0))
+ {
+ // handle special case: If scale is negative in (x,y) (3rd quadrant), it can
+ // be expressed as rotation by PI
+ aScale = basegfx::absolute(aScale);
+ fRotate += (180.0 * F_PI180);
+ }
+
+ if(basegfx::fTools::more(aScale.getX(), 0.0) && basegfx::fTools::more(aScale.getY(), 0.0))
+ {
+ // handle, there is no shear and no mirror
+ bPrimitiveAccepted = true;
+ const Font aFont(getVclFontFromFontAttributes(rTextCandidate.getFontAttributes(), aScale, fRotate));
+ const basegfx::B2DPoint aPoint(aLocalTransform * basegfx::B2DPoint(0.0, 0.0));
+ const Point aStartPoint(basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY()));
+
+ // create transformed integer DXArray in view coordinate system
+ ::std::vector< sal_Int32 > aTransformedDXArray;
+
+ if(rTextCandidate.getDXArray().size())
+ {
+ aTransformedDXArray.reserve(rTextCandidate.getDXArray().size());
+ const basegfx::B2DVector aPixelVector(aLocalTransform * basegfx::B2DVector(1.0, 0.0));
+ const double fPixelVectorLength(aPixelVector.getLength());
+
+ for(::std::vector< double >::const_iterator aStart(rTextCandidate.getDXArray().begin()); aStart != rTextCandidate.getDXArray().end(); aStart++)
+ {
+ aTransformedDXArray.push_back(basegfx::fround((*aStart) * fPixelVectorLength));
+ }
+ }
+
+ // set parameters and paint
+ const basegfx::BColor aRGBFontColor(maBColorModifierStack.getModifiedColor(rTextCandidate.getFontColor()));
+ mpOutputDevice->SetFont(aFont);
+ mpOutputDevice->SetTextColor(Color(aRGBFontColor));
+ mpOutputDevice->DrawTextArray(aStartPoint, rTextCandidate.getText(), &(aTransformedDXArray[0]));
+ }
+ }
+
+ if(!bPrimitiveAccepted)
+ {
+ // let break down
+ process(rTextCandidate.get2DDecomposition(getViewInformation2D()));
+ }
+ }
+
+ // direct draw of hairline
+ void VclProcessor2D::RenderPolygonHairlinePrimitive2D(const primitive2d::PolygonHairlinePrimitive2D& rPolygonCandidate)
+ {
+ const basegfx::BColor aHairlineColor(maBColorModifierStack.getModifiedColor(rPolygonCandidate.getBColor()));
+ mpOutputDevice->SetLineColor(Color(aHairlineColor));
+ mpOutputDevice->SetFillColor();
+
+ basegfx::B2DPolygon aLocalPolygon(rPolygonCandidate.getB2DPolygon());
+ aLocalPolygon.transform(maCurrentTransformation);
+
+ mpOutputDevice->DrawPolyLine(Polygon(aLocalPolygon));
+ }
+
+ // direct draw of transformed BitmapEx primitive
+ void VclProcessor2D::RenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate)
+ {
+ // decompose matrix to check for shear, rotate and mirroring
+ basegfx::B2DHomMatrix aLocalTransform(maCurrentTransformation * rBitmapCandidate.getTransform());
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ aLocalTransform.decompose(aScale, aTranslate, fRotate, fShearX);
+ BitmapEx aBitmapEx(rBitmapCandidate.getBitmapEx());
+ bool bPainted(false);
+
+ if(maBColorModifierStack.count())
+ {
+ aBitmapEx = impModifyBitmapEx(maBColorModifierStack, aBitmapEx);
+
+ if(aBitmapEx.IsEmpty())
+ {
+ // color gets completely replaced, get it
+ const basegfx::BColor aModifiedColor(maBColorModifierStack.getModifiedColor(basegfx::BColor()));
+ basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ aPolygon.transform(aLocalTransform);
+
+ mpOutputDevice->SetFillColor(Color(aModifiedColor));
+ mpOutputDevice->SetLineColor();
+ mpOutputDevice->DrawPolygon(Polygon(aPolygon));
+
+ bPainted = true;
+ }
+ }
+
+ if(!bPainted)
+ {
+ static bool bForceUseOfOwnTransformer(false);
+ static bool bUseGraphicManager(true);
+
+ if(!bForceUseOfOwnTransformer && basegfx::fTools::equalZero(fShearX))
+ {
+ if(basegfx::fTools::equalZero(fRotate) && !bUseGraphicManager)
+ {
+ RenderBitmapPrimitive2D_BitmapEx(*mpOutputDevice, aBitmapEx, aLocalTransform);
+ }
+ else
+ {
+ RenderBitmapPrimitive2D_GraphicManager(*mpOutputDevice, aBitmapEx, aLocalTransform);
+ }
+ }
+ else
+ {
+ if(!aBitmapEx.IsTransparent() && (!basegfx::fTools::equalZero(fShearX) || !basegfx::fTools::equalZero(fRotate)))
+ {
+ // parts will be uncovered, extend aBitmapEx with a mask bitmap
+ const Bitmap aContent(aBitmapEx.GetBitmap());
+ aBitmapEx = BitmapEx(aContent, Bitmap(aContent.GetSizePixel(), 1));
+ }
+
+ RenderBitmapPrimitive2D_self(*mpOutputDevice, aBitmapEx, aLocalTransform);
+ }
+ }
+ }
+
+ void VclProcessor2D::RenderFillBitmapPrimitive2D(const primitive2d::FillBitmapPrimitive2D& rFillBitmapCandidate)
+ {
+ const attribute::FillBitmapAttribute& rFillBitmapAttribute(rFillBitmapCandidate.getFillBitmap());
+ bool bPrimitiveAccepted(false);
+
+ if(rFillBitmapAttribute.getTiling())
+ {
+ // decompose matrix to check for shear, rotate and mirroring
+ basegfx::B2DHomMatrix aLocalTransform(maCurrentTransformation * rFillBitmapCandidate.getTransformation());
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ aLocalTransform.decompose(aScale, aTranslate, fRotate, fShearX);
+
+ if(basegfx::fTools::equalZero(fRotate) && basegfx::fTools::equalZero(fShearX))
+ {
+ // no shear or rotate, draw direct in pixel coordinates
+ bPrimitiveAccepted = true;
+ BitmapEx aBitmapEx(rFillBitmapAttribute.getBitmap());
+ bool bPainted(false);
+
+ if(maBColorModifierStack.count())
+ {
+ aBitmapEx = impModifyBitmapEx(maBColorModifierStack, aBitmapEx);
+
+ if(aBitmapEx.IsEmpty())
+ {
+ // color gets completely replaced, get it
+ const basegfx::BColor aModifiedColor(maBColorModifierStack.getModifiedColor(basegfx::BColor()));
+ basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ aPolygon.transform(aLocalTransform);
+
+ mpOutputDevice->SetFillColor(Color(aModifiedColor));
+ mpOutputDevice->SetLineColor();
+ mpOutputDevice->DrawPolygon(Polygon(aPolygon));
+
+ bPainted = true;
+ }
+ }
+
+ if(!bPainted)
+ {
+ const basegfx::B2DPoint aObjTopLeft(aTranslate.getX(), aTranslate.getY());
+ const basegfx::B2DPoint aObjBottomRight(aTranslate.getX() + aScale.getX(), aTranslate.getY() + aScale.getY());
+ const Point aObjTL(mpOutputDevice->LogicToPixel(Point((sal_Int32)aObjTopLeft.getX(), (sal_Int32)aObjTopLeft.getY())));
+ const Point aObjBR(mpOutputDevice->LogicToPixel(Point((sal_Int32)aObjBottomRight.getX(), (sal_Int32)aObjBottomRight.getY())));
+
+ const basegfx::B2DPoint aBmpTopLeft(aLocalTransform * rFillBitmapAttribute.getTopLeft());
+ const basegfx::B2DPoint aBmpBottomRight(aLocalTransform * basegfx::B2DPoint(rFillBitmapAttribute.getTopLeft() + rFillBitmapAttribute.getSize()));
+ const Point aBmpTL(mpOutputDevice->LogicToPixel(Point((sal_Int32)aBmpTopLeft.getX(), (sal_Int32)aBmpTopLeft.getY())));
+ const Point aBmpBR(mpOutputDevice->LogicToPixel(Point((sal_Int32)aBmpBottomRight.getX(), (sal_Int32)aBmpBottomRight.getY())));
+
+ sal_Int32 nOWidth(aObjBR.X() - aObjTL.X());
+ sal_Int32 nOHeight(aObjBR.Y() - aObjTL.Y());
+
+ if(nOWidth < 0L)
+ {
+ nOWidth = 1L;
+ }
+
+ if(nOHeight < 0L)
+ {
+ nOHeight = 1L;
+ }
+
+ sal_Int32 nBWidth(aBmpBR.X() - aBmpTL.X());
+ sal_Int32 nBHeight(aBmpBR.Y() - aBmpTL.Y());
+
+ if(nBWidth < 0L)
+ {
+ nBWidth = 1L;
+ }
+
+ if(nBHeight < 0L)
+ {
+ nBHeight = 1L;
+ }
+
+ sal_Int32 nBLeft(aBmpTL.X());
+ sal_Int32 nBTop(aBmpTL.Y());
+
+ if(nBLeft > aObjTL.X())
+ {
+ nBLeft -= ((nBLeft / nBWidth) + 1L) * nBWidth;
+ }
+
+ if(nBLeft + nBWidth <= aObjTL.X())
+ {
+ nBLeft -= (nBLeft / nBWidth) * nBWidth;
+ }
+
+ if(nBTop > aObjTL.Y())
+ {
+ nBTop -= ((nBTop / nBHeight) + 1L) * nBHeight;
+ }
+
+ if(nBTop + nBHeight <= aObjTL.Y())
+ {
+ nBTop -= (nBTop / nBHeight) * nBHeight;
+ }
+
+ // nBWidth, nBHeight is the pixel size of the neede bitmap. To not need to scale it
+ // in vcl many times, create a size-optimized version
+ const Size aNeededBitmapSizePixel(nBWidth, nBHeight);
+
+ if(aNeededBitmapSizePixel != aBitmapEx.GetSizePixel())
+ {
+ aBitmapEx.Scale(aNeededBitmapSizePixel);
+ }
+
+ // prepare OutDev
+ const Point aEmptyPoint(0, 0);
+ const Rectangle aVisiblePixel(aEmptyPoint, mpOutputDevice->GetOutputSizePixel());
+ const bool bWasEnabled(mpOutputDevice->IsMapModeEnabled());
+ mpOutputDevice->EnableMapMode(false);
+
+ for(sal_Int32 nXPos(nBLeft); nXPos < aObjTL.X() + nOWidth; nXPos += nBWidth)
+ {
+ for(sal_Int32 nYPos(nBTop); nYPos < aObjTL.Y() + nOHeight; nYPos += nBHeight)
+ {
+ const Rectangle aOutRectPixel(Point(nXPos, nYPos), aNeededBitmapSizePixel);
+
+ if(aOutRectPixel.IsOver(aVisiblePixel))
+ {
+ mpOutputDevice->DrawBitmapEx(aOutRectPixel.TopLeft(), aBitmapEx);
+ }
+ }
+ }
+
+ // restore OutDev
+ mpOutputDevice->EnableMapMode(bWasEnabled);
+ }
+ }
+ }
+
+ if(!bPrimitiveAccepted)
+ {
+ // do not accept, use decomposition
+ process(rFillBitmapCandidate.get2DDecomposition(getViewInformation2D()));
+ }
+ }
+
+ // direct draw of gradient
+ void VclProcessor2D::RenderPolyPolygonGradientPrimitive2D(const primitive2d::PolyPolygonGradientPrimitive2D& rPolygonCandidate)
+ {
+ const attribute::FillGradientAttribute& rGradient(rPolygonCandidate.getFillGradient());
+ basegfx::BColor aStartColor(maBColorModifierStack.getModifiedColor(rGradient.getStartColor()));
+ basegfx::BColor aEndColor(maBColorModifierStack.getModifiedColor(rGradient.getEndColor()));
+ basegfx::B2DPolyPolygon aLocalPolyPolygon(rPolygonCandidate.getB2DPolyPolygon());
+ aLocalPolyPolygon.transform(maCurrentTransformation);
+
+ if(aStartColor == aEndColor)
+ {
+ // no gradient at all, draw as polygon
+ mpOutputDevice->SetLineColor();
+ mpOutputDevice->SetFillColor(Color(aStartColor));
+ mpOutputDevice->DrawPolyPolygon(aLocalPolyPolygon);
+ }
+ else
+ {
+ impDrawGradientToOutDev(
+ *mpOutputDevice, aLocalPolyPolygon, rGradient.getStyle(), rGradient.getSteps(),
+ aStartColor, aEndColor, rGradient.getBorder(),
+ -rGradient.getAngle(), rGradient.getOffsetX(), rGradient.getOffsetY(), false);
+ }
+ }
+
+ // direct draw of PolyPolygon with color
+ void VclProcessor2D::RenderPolyPolygonColorPrimitive2D(const primitive2d::PolyPolygonColorPrimitive2D& rPolygonCandidate)
+ {
+ const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(rPolygonCandidate.getBColor()));
+ mpOutputDevice->SetFillColor(Color(aPolygonColor));
+ mpOutputDevice->SetLineColor();
+
+ basegfx::B2DPolyPolygon aLocalPolyPolygon(rPolygonCandidate.getB2DPolyPolygon());
+ aLocalPolyPolygon.transform(maCurrentTransformation);
+
+ mpOutputDevice->DrawPolyPolygon(PolyPolygon(aLocalPolyPolygon));
+ }
+
+ // direct draw of MetaFile
+ void VclProcessor2D::RenderMetafilePrimitive2D(const primitive2d::MetafilePrimitive2D& rMetaCandidate)
+ {
+ // decompose matrix to check for shear, rotate and mirroring
+ basegfx::B2DHomMatrix aLocalTransform(maCurrentTransformation * rMetaCandidate.getTransform());
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ aLocalTransform.decompose(aScale, aTranslate, fRotate, fShearX);
+
+ // get BoundRect
+ basegfx::B2DRange aOutlineRange(rMetaCandidate.getB2DRange(getViewInformation2D()));
+ aOutlineRange.transform(maCurrentTransformation);
+ const Rectangle aDestRectView(
+ basegfx::fround(aOutlineRange.getMinX()), basegfx::fround(aOutlineRange.getMinY()),
+ basegfx::fround(aOutlineRange.getMaxX()), basegfx::fround(aOutlineRange.getMaxY()));
+
+ // get metafile (copy it)
+ GDIMetaFile aMetaFile;
+
+ if(maBColorModifierStack.count())
+ {
+ const basegfx::BColor aRGBBaseColor(0, 0, 0);
+ const basegfx::BColor aRGBColor(maBColorModifierStack.getModifiedColor(aRGBBaseColor));
+ aMetaFile = rMetaCandidate.getMetaFile().GetMonochromeMtf(Color(aRGBColor));
+ }
+ else
+ {
+ aMetaFile = rMetaCandidate.getMetaFile();
+ }
+
+ // rotation
+ if(!basegfx::fTools::equalZero(fRotate))
+ {
+ double fRotation((fRotate / F_PI180) * -10.0);
+ aMetaFile.Rotate((sal_uInt16)(fRotation));
+ }
+
+ // paint it
+ aMetaFile.WindStart();
+ aMetaFile.Play(mpOutputDevice, aDestRectView.TopLeft(), aDestRectView.GetSize());
+ }
+
+ // mask group. Force output to VDev and create mask from given mask
+ void VclProcessor2D::RenderMaskPrimitive2D(const primitive2d::MaskPrimitive2D& rMaskCandidate)
+ {
+ if(rMaskCandidate.getChildren().hasElements())
+ {
+ basegfx::B2DPolyPolygon aMask(rMaskCandidate.getMask());
+ aMask.transform(maCurrentTransformation);
+ const basegfx::B2DRange aRange(basegfx::tools::getRange(aMask));
+ impBufferDevice aBufferDevice(*mpOutputDevice, aRange);
+
+ if(aBufferDevice.isVisible())
+ {
+ // remember last OutDev and set to content
+ OutputDevice* pLastOutputDevice = mpOutputDevice;
+ mpOutputDevice = &aBufferDevice.getContent();
+
+ // paint to it
+ process(rMaskCandidate.getChildren());
+
+ // back to old OutDev
+ mpOutputDevice = pLastOutputDevice;
+
+ // draw mask
+ VirtualDevice& rMask = aBufferDevice.getMask();
+ rMask.SetLineColor();
+ rMask.SetFillColor(COL_BLACK);
+ rMask.DrawPolyPolygon(PolyPolygon(aMask));
+
+ // dump buffer to outdev
+ aBufferDevice.paint();
+ }
+ }
+ }
+
+ // modified color group. Force output to unified color.
+ void VclProcessor2D::RenderModifiedColorPrimitive2D(const primitive2d::ModifiedColorPrimitive2D& rModifiedCandidate)
+ {
+ if(rModifiedCandidate.getChildren().hasElements())
+ {
+ maBColorModifierStack.push(rModifiedCandidate.getColorModifier());
+ process(rModifiedCandidate.getChildren());
+ maBColorModifierStack.pop();
+ }
+ }
+
+ // sub-transparence group. Draw to VDev first.
+ void VclProcessor2D::RenderAlphaPrimitive2D(const primitive2d::AlphaPrimitive2D& rTransCandidate)
+ {
+ if(rTransCandidate.getChildren().hasElements())
+ {
+ basegfx::B2DRange aRange(primitive2d::getB2DRangeFromPrimitive2DSequence(rTransCandidate.getChildren(), getViewInformation2D()));
+ aRange.transform(maCurrentTransformation);
+ impBufferDevice aBufferDevice(*mpOutputDevice, aRange);
+
+ if(aBufferDevice.isVisible())
+ {
+ // remember last OutDev and set to content
+ OutputDevice* pLastOutputDevice = mpOutputDevice;
+ mpOutputDevice = &aBufferDevice.getContent();
+
+ // paint content to it
+ process(rTransCandidate.getChildren());
+
+ // set to mask
+ mpOutputDevice = &aBufferDevice.getAlpha();
+
+ // when painting alpha masks, reset the color stack
+ basegfx::BColorModifierStack aLastBColorModifierStack(maBColorModifierStack);
+ maBColorModifierStack = basegfx::BColorModifierStack();
+
+ // paint mask to it
+ process(rTransCandidate.getAlpha());
+
+ // back to old color stack
+ maBColorModifierStack = aLastBColorModifierStack;
+
+ // back to old OutDev
+ mpOutputDevice = pLastOutputDevice;
+
+ // dump buffer to outdev
+ aBufferDevice.paint();
+ }
+ }
+ }
+
+ // transform group.
+ void VclProcessor2D::RenderTransformPrimitive2D(const primitive2d::TransformPrimitive2D& rTransformCandidate)
+ {
+ // remember current transformation
+ basegfx::B2DHomMatrix aLastCurrentTransformation(maCurrentTransformation);
+
+ // create new transformations
+ maCurrentTransformation = maCurrentTransformation * rTransformCandidate.getTransformation();
+
+ // let break down
+ process(rTransformCandidate.getChildren());
+
+ // restore transformations
+ maCurrentTransformation = aLastCurrentTransformation;
+ }
+
+ // marker
+ void VclProcessor2D::RenderMarkerPrimitive2D(const primitive2d::MarkerPrimitive2D& rMarkCandidate)
+ {
+ const basegfx::BColor aRGBColor(maBColorModifierStack.getModifiedColor(rMarkCandidate.getRGBColor()));
+ const Color aColor(aRGBColor);
+
+ // evtl. just test markers
+ static bool bForceMarkersToRangeTest(false);
+
+ if(bForceMarkersToRangeTest)
+ {
+ // ATM just test marker range
+ const basegfx::B2DRange aRange(rMarkCandidate.getB2DRange(getViewInformation2D()));
+ basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(aRange));
+ aPolygon.transform(maCurrentTransformation);
+
+ mpOutputDevice->SetFillColor();
+ mpOutputDevice->SetLineColor(aColor);
+ mpOutputDevice->DrawPolygon(Polygon(aPolygon));
+ }
+ else
+ {
+ const basegfx::B2DPoint aViewPosition(maCurrentTransformation * rMarkCandidate.getPosition());
+ Point aPos(basegfx::fround(aViewPosition.getX()), basegfx::fround(aViewPosition.getY()));
+
+ switch(rMarkCandidate.getStyle())
+ {
+ default : // MARKERSTYLE2D_POINT
+ {
+ mpOutputDevice->DrawPixel(aPos, aColor);
+ break;
+ }
+ case primitive2d::MARKERSTYLE2D_CROSS :
+ {
+ basegfx::B2DRange aRange;
+ rMarkCandidate.getRealtiveViewRange(aRange);
+ const basegfx::B2DPoint aCenter(aRange.getCenter());
+
+ aPos = mpOutputDevice->LogicToPixel(aPos);
+ aPos.X() += basegfx::fround(aCenter.getX());
+ aPos.Y() += basegfx::fround(aCenter.getY());
+
+ const bool bWasEnabled(mpOutputDevice->IsMapModeEnabled());
+ mpOutputDevice->EnableMapMode(false);
+
+ mpOutputDevice->DrawPixel(aPos, aColor);
+ mpOutputDevice->DrawPixel(Point(aPos.X() - 1L, aPos.Y()), aColor);
+ mpOutputDevice->DrawPixel(Point(aPos.X() + 1L, aPos.Y()), aColor);
+ mpOutputDevice->DrawPixel(Point(aPos.X(), aPos.Y() - 1L), aColor);
+ mpOutputDevice->DrawPixel(Point(aPos.X(), aPos.Y() + 1L), aColor);
+
+ mpOutputDevice->EnableMapMode(bWasEnabled);
+ break;
+ }
+ case primitive2d::MARKERSTYLE2D_GLUEPOINT :
+ {
+ basegfx::B2DRange aRange;
+ rMarkCandidate.getRealtiveViewRange(aRange);
+ const basegfx::B2DPoint aCenter(aRange.getCenter());
+
+ aPos = mpOutputDevice->LogicToPixel(aPos);
+ aPos.X() += basegfx::fround(aCenter.getX());
+ aPos.Y() += basegfx::fround(aCenter.getY());
+
+ const bool bWasEnabled(mpOutputDevice->IsMapModeEnabled());
+ mpOutputDevice->EnableMapMode(false);
+
+ // backpen
+ mpOutputDevice->SetLineColor(aColor);
+ mpOutputDevice->DrawLine(aPos + Point(-2, -3), aPos + Point(+3, +2));
+ mpOutputDevice->DrawLine(aPos + Point(-3, -2), aPos + Point(+2, +3));
+ mpOutputDevice->DrawLine(aPos + Point(-3, +2), aPos + Point(+2, -3));
+ mpOutputDevice->DrawLine(aPos + Point(-2, +3), aPos + Point(+3, -2));
+
+ // frontpen (hard coded)
+ mpOutputDevice->SetLineColor(COL_LIGHTBLUE);
+ mpOutputDevice->DrawLine(aPos + Point(-2, -2), aPos + Point(+2, +2));
+ mpOutputDevice->DrawLine(aPos + Point(-2, +2), aPos + Point(+2, -2));
+
+ mpOutputDevice->EnableMapMode(bWasEnabled);
+ break;
+ }
+ }
+ }
+ }
+
+ //////////////////////////////////////////////////////////////////////////////
+ // internal processing support
+
+ void VclProcessor2D::process(const primitive2d::Primitive2DSequence& rSource)
+ {
+ if(rSource.hasElements())
+ {
+ const sal_Int32 nCount(rSource.getLength());
+
+ for(sal_Int32 a(0L); a < nCount; a++)
+ {
+ // get reference
+ const primitive2d::Primitive2DReference xReference(rSource[a]);
+
+ if(xReference.is())
+ {
+ // try to cast to BasePrimitive2D implementation
+ const primitive2d::BasePrimitive2D* pBasePrimitive = dynamic_cast< const primitive2d::BasePrimitive2D* >(xReference.get());
+
+ if(pBasePrimitive)
+ {
+ // it is a BasePrimitive2D implementation, use getPrimitiveID() call for switch
+ switch(pBasePrimitive->getPrimitiveID())
+ {
+ case Create2DPrimitiveID('2','T','S','i') :
+ {
+ // directdraw of text simple portion
+ RenderTextSimplePortionPrimitive2D(static_cast< const primitive2d::TextSimplePortionPrimitive2D& >(*pBasePrimitive));
+ break;
+ }
+ case Create2DPrimitiveID('2','P','H','a') :
+ {
+ // direct draw of hairline
+ RenderPolygonHairlinePrimitive2D(static_cast< const primitive2d::PolygonHairlinePrimitive2D& >(*pBasePrimitive));
+ break;
+ }
+ case Create2DPrimitiveID('2','B','i','t') :
+ {
+ // direct draw of transformed BitmapEx primitive
+ RenderBitmapPrimitive2D(static_cast< const primitive2d::BitmapPrimitive2D& >(*pBasePrimitive));
+ break;
+ }
+ case Create2DPrimitiveID('2','F','B','i') :
+ {
+ // direct draw of fillBitmapPrimitive
+ RenderFillBitmapPrimitive2D(static_cast< const primitive2d::FillBitmapPrimitive2D& >(*pBasePrimitive));
+ break;
+ }
+ case Create2DPrimitiveID('2','P','P','G') :
+ {
+ // direct draw of gradient
+ RenderPolyPolygonGradientPrimitive2D(static_cast< const primitive2d::PolyPolygonGradientPrimitive2D& >(*pBasePrimitive));
+ break;
+ }
+ case Create2DPrimitiveID('2','P','P','C') :
+ {
+ // direct draw of PolyPolygon with color
+ RenderPolyPolygonColorPrimitive2D(static_cast< const primitive2d::PolyPolygonColorPrimitive2D& >(*pBasePrimitive));
+ break;
+ }
+ case Create2DPrimitiveID('2','M','e','t') :
+ {
+ // direct draw of MetaFile
+ RenderMetafilePrimitive2D(static_cast< const primitive2d::MetafilePrimitive2D& >(*pBasePrimitive));
+ break;
+ }
+ case Create2DPrimitiveID('2','M','a','s') :
+ {
+ // mask group. Force output to VDev and create mask from given mask
+ RenderMaskPrimitive2D(static_cast< const primitive2d::MaskPrimitive2D& >(*pBasePrimitive));
+ break;
+ }
+ case Create2DPrimitiveID('2','M','C','o') :
+ {
+ // modified color group. Force output to unified color.
+ RenderModifiedColorPrimitive2D(static_cast< const primitive2d::ModifiedColorPrimitive2D& >(*pBasePrimitive));
+ break;
+ }
+ case Create2DPrimitiveID('2','A','l','p') :
+ {
+ // sub-transparence group. Draw to VDev first.
+ RenderAlphaPrimitive2D(static_cast< const primitive2d::AlphaPrimitive2D& >(*pBasePrimitive));
+ break;
+ }
+ case Create2DPrimitiveID('2','T','r','a') :
+ {
+ // transform group.
+ RenderTransformPrimitive2D(static_cast< const primitive2d::TransformPrimitive2D& >(*pBasePrimitive));
+ break;
+ }
+ case Create2DPrimitiveID('2','M','a','r') :
+ {
+ // marker
+ RenderMarkerPrimitive2D(static_cast< const primitive2d::MarkerPrimitive2D& >(*pBasePrimitive));
+ break;
+ }
+ default :
+ {
+ // process recursively
+ process(pBasePrimitive->get2DDecomposition(getViewInformation2D()));
+ break;
+ }
+ }
+ }
+ else
+ {
+ // unknown implementation, use UNO API call instead and process recursively
+ com::sun::star::graphic::Primitive2DParameters aPrimitive2DParameters;
+
+ basegfx::unotools::affineMatrixFromHomMatrix(aPrimitive2DParameters.ViewTransformation, getViewInformation2D().getViewTransformation());
+ aPrimitive2DParameters.Viewport = basegfx::unotools::rectangle2DFromB2DRectangle(getViewInformation2D().getViewport());
+ aPrimitive2DParameters.Time = getViewInformation2D().getViewTime();
+
+ process(xReference->getDecomposition(aPrimitive2DParameters));
+ }
+ }
+ }
+ }
+ }
+
+ VclProcessor2D::VclProcessor2D(
+ const geometry::ViewInformation2D& rViewInformation,
+ OutputDevice& rOutDev)
+ : BaseProcessor2D(rViewInformation),
+ mbOutputToRecordingMetaFile(false)
+ {
+ // initialize destination OutDev
+ mpOutputDevice = &rOutDev;
+
+ // check if output is recorded to metafile
+ const GDIMetaFile* pMetaFile = mpOutputDevice->GetConnectMetaFile();
+ mbOutputToRecordingMetaFile = (pMetaFile && pMetaFile->IsRecord() && !pMetaFile->IsPause());
+
+ if(mbOutputToRecordingMetaFile)
+ {
+ // draw to logic coordinates, do not initialize maCurrentTransformation to viewTransformation,
+ // do not change MapMode of destination
+ }
+ else
+ {
+ // prepare maCurrentTransformation matrix with viewTransformation to go directly to pixels
+ maCurrentTransformation = rViewInformation.getViewTransformation();
+
+ // prepare output to pixels
+ mpOutputDevice->Push(PUSH_MAPMODE);
+ mpOutputDevice->SetMapMode();
+ }
+ }
+
+ VclProcessor2D::~VclProcessor2D()
+ {
+ if(mbOutputToRecordingMetaFile)
+ {
+ }
+ else
+ {
+ // restore MapMode
+ mpOutputDevice->Pop();
+ }
+ }
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/processor3d/baseprocessor3d.cxx b/drawinglayer/source/processor3d/baseprocessor3d.cxx
index 01e40b43f904..b8da56b28719 100644
--- a/drawinglayer/source/processor3d/baseprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/baseprocessor3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: baseprocessor3d.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:57:47 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:39:22 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,25 +33,26 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_PROCESSOR3D_BASEPROCESSOR3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_BASEPROCESSOR3D_HXX
#include <drawinglayer/processor3d/baseprocessor3d.hxx>
#endif
//////////////////////////////////////////////////////////////////////////////
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
namespace drawinglayer
{
namespace processor3d
{
- baseProcessor3D::baseProcessor3D(
- const geometry::viewInformation& rViewInformation,
- const geometry::transformation3D& rTransformation3D)
- : maViewInformation(rViewInformation),
- maTransformation3D(rTransformation3D)
+ BaseProcessor3D::BaseProcessor3D(double fTime)
+ : mfTime(fTime)
{
}
- baseProcessor3D::~baseProcessor3D()
+ BaseProcessor3D::~BaseProcessor3D()
{
}
} // end of namespace processor3d
@@ -63,21 +64,16 @@ namespace drawinglayer
{
namespace processor3d
{
- collectingProcessor3D::collectingProcessor3D(
- const geometry::viewInformation& rViewInformation,
- const geometry::transformation3D& rTransformation3D)
- : baseProcessor3D(rViewInformation, rTransformation3D)
- {
- }
-
- collectingProcessor3D::~collectingProcessor3D()
+ CollectingProcessor3D::CollectingProcessor3D(double fTime)
+ : BaseProcessor3D(fTime),
+ maPrimitiveSequence()
{
}
- void collectingProcessor3D::process(const primitive3d::primitiveVector3D& rSource)
+ void CollectingProcessor3D::process(const primitive3d::Primitive3DSequence& rSource)
{
// accept everything
- maPrimitiveVector.insert(maPrimitiveVector.end(), rSource.begin(), rSource.end());
+ primitive3d::appendPrimitive3DSequenceToPrimitive3DSequence(maPrimitiveSequence, rSource);
}
} // end of namespace processor3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
index 1ec617b0a944..6e04192319ff 100644
--- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: defaultprocessor3d.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: aw $ $Date: 2006-09-27 16:33:27 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:39:22 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,60 +33,82 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_PROCESSOR3D_DEFAULTPROCESSOR3D_HXX
+//////////////////////////////////////////////////////////////////////////////
+// includes for namespace basegfx
+
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_DEFAULTPROCESSOR3D_HXX
#include <drawinglayer/processor3d/defaultprocessor3d.hxx>
#endif
+#ifndef _BGFX_POLYGON_B3DPOLYGON_HXX
+#include <basegfx/polygon/b3dpolygon.hxx>
+#endif
+
+#ifndef _BGFX_RASTER_BZPIXELRASTER_HXX
+#include <basegfx/raster/bzpixelraster.hxx>
+#endif
+
#ifndef _SV_BMPACC_HXX
#include <vcl/bmpacc.hxx>
#endif
-#ifndef _BGFX_POLYGON_B3DPOLYGON_HXX
-#include <basegfx/polygon/b3dpolygon.hxx>
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_MATERIALATTRIBUTE3D_HXX
+#include <drawinglayer/attribute/materialattribute3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX
-#include <drawinglayer/primitive3d/polygonprimitive3d.hxx>
+//////////////////////////////////////////////////////////////////////////////
+// includes for namespace drawinglayer
+
+#ifndef INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE_HXX
+#include <drawinglayer/texture/texture.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_MODIFIEDCOLORPRIMITIVE3D_HXX
-#include <drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx>
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX
+#include <drawinglayer/attribute/sdrattribute3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE_HXX
-#include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX
+#include <drawinglayer/attribute/fillattribute.hxx>
#endif
-#ifndef _BGFX_POLYPOLYGON_B3DPOLYGONCLIPPER_HXX
-#include <basegfx/polygon/b3dpolygonclipper.hxx>
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX
+#include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx>
#endif
-#ifndef _BGFX_RASTER_BZPIXELRASTER_HXX
-#include <basegfx/raster/bzpixelraster.hxx>
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_MODIFIEDCOLORPRIMITIVE3D_HXX
+#include <drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX
+#include <drawinglayer/primitive3d/polygonprimitive3d.hxx>
#endif
#ifndef _BGFX_POLYGON_B3DPOLYGONTOOLS_HXX
#include <basegfx/polygon/b3dpolygontools.hxx>
#endif
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE3D_HXX
+#include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
+#endif
+
#ifndef _BGFX_POLYPOLYGON_B3DPOLYGONTOOLS_HXX
#include <basegfx/polygon/b3dpolypolygontools.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX
-#include <drawinglayer/primitive3d/textureprimitive3d.hxx>
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TRANSFORMPRIMITIVE3D_HXX
+#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX
-#include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx>
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRLABELPRIMITIVE3D_HXX
+#include <drawinglayer/primitive3d/sdrlabelprimitive3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_TRANSFORMPRIMITIVE3D_HXX
-#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
+#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
+#include <basegfx/tools/canvastools.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX
+#include <drawinglayer/geometry/viewinformation2d.hxx>
#endif
//////////////////////////////////////////////////////////////////////////////
@@ -606,8 +628,8 @@ namespace drawinglayer
{
protected:
basegfx::BZPixelRaster& mrBuffer;
- const attribute::materialAttribute3D& mrMaterial;
- const processor3d::defaultProcessor3D& mrProcessor;
+ const attribute::MaterialAttribute3D& mrMaterial;
+ const processor3d::DefaultProcessor3D& mrProcessor;
// virtual rasterconverter
virtual void processSpan(const basegfx::B3DScanlineEntry& rA, const basegfx::B3DScanlineEntry& rB, sal_Int32 nLine, sal_uInt32 nSpanCount);
@@ -617,8 +639,8 @@ namespace drawinglayer
BZPolyRaCon(
bool bArea,
basegfx::BZPixelRaster& rBuffer,
- const attribute::materialAttribute3D& rMaterial,
- const processor3d::defaultProcessor3D& rProcessor)
+ const attribute::MaterialAttribute3D& rMaterial,
+ const processor3d::DefaultProcessor3D& rProcessor)
: B3DPolyPolygonRasterConverter(bArea),
mrBuffer(rBuffer),
mrMaterial(rMaterial),
@@ -942,46 +964,41 @@ namespace drawinglayer
{
namespace texture
{
- class geoTexSvxMono : public geoTexSvx
+ class GeoTexSvxMono : public GeoTexSvx
{
protected:
- basegfx::BColor maSingleColor;
+ basegfx::BColor maSingleColor;
double mfOpacity;
public:
- geoTexSvxMono(const basegfx::BColor& rSingleColor, double fOpacity);
- virtual ~geoTexSvxMono();
+ GeoTexSvxMono(const basegfx::BColor& rSingleColor, double fOpacity);
// compare operator
- virtual bool operator==(const geoTexSvx& rGeoTexSvx) const;
+ virtual bool operator==(const GeoTexSvx& rGeoTexSvx) const;
virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const;
};
- geoTexSvxMono::geoTexSvxMono(const basegfx::BColor& rSingleColor, double fOpacity)
+ GeoTexSvxMono::GeoTexSvxMono(const basegfx::BColor& rSingleColor, double fOpacity)
: maSingleColor(rSingleColor),
mfOpacity(fOpacity)
{
}
- geoTexSvxMono::~geoTexSvxMono()
- {
- }
-
- bool geoTexSvxMono::operator==(const geoTexSvx& rGeoTexSvx) const
+ bool GeoTexSvxMono::operator==(const GeoTexSvx& rGeoTexSvx) const
{
- const geoTexSvxMono* pCompare = dynamic_cast< const geoTexSvxMono* >(&rGeoTexSvx);
+ const GeoTexSvxMono* pCompare = dynamic_cast< const GeoTexSvxMono* >(&rGeoTexSvx);
return (pCompare
&& maSingleColor == pCompare->maSingleColor
&& mfOpacity == pCompare->mfOpacity);
}
- void geoTexSvxMono::modifyBColor(const basegfx::B2DPoint& /*rUV*/, basegfx::BColor& rBColor, double& /*rfOpacity*/) const
+ void GeoTexSvxMono::modifyBColor(const basegfx::B2DPoint& /*rUV*/, basegfx::BColor& rBColor, double& /*rfOpacity*/) const
{
rBColor = maSingleColor;
}
- void geoTexSvxMono::modifyOpacity(const basegfx::B2DPoint& /*rUV*/, double& rfOpacity) const
+ void GeoTexSvxMono::modifyOpacity(const basegfx::B2DPoint& /*rUV*/, double& rfOpacity) const
{
rfOpacity = mfOpacity;
}
@@ -994,13 +1011,13 @@ namespace drawinglayer
{
namespace texture
{
- class geoTexSvxBitmap : public geoTexSvx
+ class GeoTexSvxBitmap : public GeoTexSvx
{
protected:
Bitmap maBitmap;
BitmapReadAccess* mpRead;
basegfx::B2DPoint maTopLeft;
- basegfx::B2DVector maSize;
+ basegfx::B2DVector maSize;
double mfMulX;
double mfMulY;
@@ -1008,13 +1025,13 @@ namespace drawinglayer
bool impIsValid(const basegfx::B2DPoint& rUV, sal_Int32& rX, sal_Int32& rY) const;
public:
- geoTexSvxBitmap(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize);
- virtual ~geoTexSvxBitmap();
+ GeoTexSvxBitmap(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize);
+ virtual ~GeoTexSvxBitmap();
virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const;
};
- geoTexSvxBitmap::geoTexSvxBitmap(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize)
+ GeoTexSvxBitmap::GeoTexSvxBitmap(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize)
: maBitmap(rBitmap),
mpRead(0L),
maTopLeft(rTopLeft),
@@ -1023,17 +1040,17 @@ namespace drawinglayer
mfMulY(0.0)
{
mpRead = maBitmap.AcquireReadAccess();
- OSL_ENSURE(mpRead, "geoTexSvxBitmap: Got no read access to Bitmap (!)");
+ OSL_ENSURE(mpRead, "GeoTexSvxBitmap: Got no read access to Bitmap (!)");
mfMulX = (double)mpRead->Width() / maSize.getX();
mfMulY = (double)mpRead->Height() / maSize.getY();
}
- geoTexSvxBitmap::~geoTexSvxBitmap()
+ GeoTexSvxBitmap::~GeoTexSvxBitmap()
{
delete mpRead;
}
- bool geoTexSvxBitmap::impIsValid(const basegfx::B2DPoint& rUV, sal_Int32& rX, sal_Int32& rY) const
+ bool GeoTexSvxBitmap::impIsValid(const basegfx::B2DPoint& rUV, sal_Int32& rX, sal_Int32& rY) const
{
if(mpRead)
{
@@ -1050,7 +1067,7 @@ namespace drawinglayer
return false;
}
- void geoTexSvxBitmap::modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const
+ void GeoTexSvxBitmap::modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const
{
sal_Int32 nX, nY;
@@ -1064,7 +1081,7 @@ namespace drawinglayer
}
}
- void geoTexSvxBitmap::modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const
+ void GeoTexSvxBitmap::modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const
{
sal_Int32 nX, nY;
@@ -1086,7 +1103,7 @@ namespace drawinglayer
{
namespace texture
{
- class geoTexSvxBitmapTiled : public geoTexSvxBitmap
+ class GeoTexSvxBitmapTiled : public GeoTexSvxBitmap
{
protected:
// helpers
@@ -1109,34 +1126,29 @@ namespace drawinglayer
}
public:
- geoTexSvxBitmapTiled(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize);
- virtual ~geoTexSvxBitmapTiled();
+ GeoTexSvxBitmapTiled(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize);
virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const;
};
- geoTexSvxBitmapTiled::geoTexSvxBitmapTiled(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize)
- : geoTexSvxBitmap(rBitmap, rTopLeft, rSize)
+ GeoTexSvxBitmapTiled::GeoTexSvxBitmapTiled(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize)
+ : GeoTexSvxBitmap(rBitmap, rTopLeft, rSize)
{
}
- geoTexSvxBitmapTiled::~geoTexSvxBitmapTiled()
- {
- }
-
- void geoTexSvxBitmapTiled::modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const
+ void GeoTexSvxBitmapTiled::modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const
{
if(mpRead)
{
- geoTexSvxBitmap::modifyBColor(impGetCorrected(rUV), rBColor, rfOpacity);
+ GeoTexSvxBitmap::modifyBColor(impGetCorrected(rUV), rBColor, rfOpacity);
}
}
- void geoTexSvxBitmapTiled::modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const
+ void GeoTexSvxBitmapTiled::modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const
{
if(mpRead)
{
- geoTexSvxBitmap::modifyOpacity(impGetCorrected(rUV), rfOpacity);
+ GeoTexSvxBitmap::modifyOpacity(impGetCorrected(rUV), rfOpacity);
}
}
} // end of namespace texture
@@ -1148,14 +1160,14 @@ namespace drawinglayer
{
namespace texture
{
- class geoTexSvxMultiHatch : public geoTexSvx
+ class GeoTexSvxMultiHatch : public GeoTexSvx
{
protected:
- basegfx::BColor maColor;
+ basegfx::BColor maColor;
double mfLogicPixelSize;
- geoTexSvxHatch* mp0;
- geoTexSvxHatch* mp1;
- geoTexSvxHatch* mp2;
+ GeoTexSvxHatch* mp0;
+ GeoTexSvxHatch* mp1;
+ GeoTexSvxHatch* mp2;
// bitfield
unsigned mbFillBackground : 1;
@@ -1164,8 +1176,8 @@ namespace drawinglayer
bool impIsOnHatch(const basegfx::B2DPoint& rUV) const;
public:
- geoTexSvxMultiHatch(const primitive3d::hatchTexturePrimitive3D& rPrimitive, double fLogicPixelSize);
- virtual ~geoTexSvxMultiHatch();
+ GeoTexSvxMultiHatch(const primitive3d::HatchTexturePrimitive3D& rPrimitive, double fLogicPixelSize);
+ virtual ~GeoTexSvxMultiHatch();
virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const;
@@ -1173,38 +1185,38 @@ namespace drawinglayer
bool getFillBackground() const { return mbFillBackground; }
};
- geoTexSvxMultiHatch::geoTexSvxMultiHatch(const primitive3d::hatchTexturePrimitive3D& rPrimitive, double fLogicPixelSize)
+ GeoTexSvxMultiHatch::GeoTexSvxMultiHatch(const primitive3d::HatchTexturePrimitive3D& rPrimitive, double fLogicPixelSize)
: mfLogicPixelSize(fLogicPixelSize),
mp0(0L),
mp1(0L),
mp2(0L)
{
- const attribute::fillHatchAttribute& rHatch(rPrimitive.getHatch());
+ const attribute::FillHatchAttribute& rHatch(rPrimitive.getHatch());
const basegfx::B2DRange aOutlineRange(0.0, 0.0, rPrimitive.getTextureSize().getX(), rPrimitive.getTextureSize().getY());
const double fAngleA(-rHatch.getAngle());
maColor = rHatch.getColor();
mbFillBackground = rHatch.isFillBackground();
- mp0 = new geoTexSvxHatch(aOutlineRange, rHatch.getDistance(), fAngleA);
+ mp0 = new GeoTexSvxHatch(aOutlineRange, rHatch.getDistance(), fAngleA);
if(attribute::HATCHSTYLE_DOUBLE == rHatch.getStyle() || attribute::HATCHSTYLE_TRIPLE == rHatch.getStyle())
{
- mp1 = new geoTexSvxHatch(aOutlineRange, rHatch.getDistance(), fAngleA + F_PI2);
+ mp1 = new GeoTexSvxHatch(aOutlineRange, rHatch.getDistance(), fAngleA + F_PI2);
}
if(attribute::HATCHSTYLE_TRIPLE == rHatch.getStyle())
{
- mp2 = new geoTexSvxHatch(aOutlineRange, rHatch.getDistance(), fAngleA + F_PI4);
+ mp2 = new GeoTexSvxHatch(aOutlineRange, rHatch.getDistance(), fAngleA + F_PI4);
}
}
- geoTexSvxMultiHatch::~geoTexSvxMultiHatch()
+ GeoTexSvxMultiHatch::~GeoTexSvxMultiHatch()
{
delete mp0;
delete mp1;
delete mp2;
}
- bool geoTexSvxMultiHatch::impIsOnHatch(const basegfx::B2DPoint& rUV) const
+ bool GeoTexSvxMultiHatch::impIsOnHatch(const basegfx::B2DPoint& rUV) const
{
double fSmallestDistance();
@@ -1226,7 +1238,7 @@ namespace drawinglayer
return false;
}
- void geoTexSvxMultiHatch::modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const
+ void GeoTexSvxMultiHatch::modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const
{
if(impIsOnHatch(rUV))
{
@@ -1238,7 +1250,7 @@ namespace drawinglayer
}
}
- void geoTexSvxMultiHatch::modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const
+ void GeoTexSvxMultiHatch::modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const
{
if(mbFillBackground || impIsOnHatch(rUV))
{
@@ -1260,26 +1272,26 @@ namespace drawinglayer
{
namespace processor3d
{
- void defaultProcessor3D::impRender_GRX3(const primitive3d::gradientTexturePrimitive3D& rPrimitive, bool bTransparence)
+ void DefaultProcessor3D::impRender_GRX3(const primitive3d::GradientTexturePrimitive3D& rPrimitive, bool bTransparence)
{
- const primitive3d::primitiveVector3D& rSubList = rPrimitive.getPrimitives();
+ const primitive3d::Primitive3DSequence& rSubSequence = rPrimitive.getChildren();
- if(rSubList.size())
+ if(rSubSequence.hasElements())
{
// rescue values
const bool bOldModulate(mbModulate); mbModulate = rPrimitive.getModulate();
const bool bOldFilter(mbFilter); mbFilter = rPrimitive.getFilter();
- texture::geoTexSvx* pOldTex = (bTransparence) ? mpTransparenceGeoTexSvx : mpGeoTexSvx;
+ texture::GeoTexSvx* pOldTex = (bTransparence) ? mpTransparenceGeoTexSvx : mpGeoTexSvx;
// create texture
- const attribute::fillGradientAttribute& rFillGradient = rPrimitive.getGradient();
+ const attribute::FillGradientAttribute& rFillGradient = rPrimitive.getGradient();
const basegfx::B2DRange aOutlineRange(0.0, 0.0, rPrimitive.getTextureSize().getX(), rPrimitive.getTextureSize().getY());
const attribute::GradientStyle aGradientStyle(rFillGradient.getStyle());
sal_uInt32 nSteps(rFillGradient.getSteps());
const basegfx::BColor aStart(rFillGradient.getStartColor());
const basegfx::BColor aEnd(rFillGradient.getEndColor());
const sal_uInt32 nMaxSteps(sal_uInt32((aStart.getMaximumDistance(aEnd) * 127.5) + 0.5));
- texture::geoTexSvx* pNewTex = 0L;
+ texture::GeoTexSvx* pNewTex = 0L;
if(nMaxSteps)
{
@@ -1303,32 +1315,32 @@ namespace drawinglayer
{
case attribute::GRADIENTSTYLE_LINEAR:
{
- pNewTex = new texture::geoTexSvxGradientLinear(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), -rFillGradient.getAngle());
+ pNewTex = new texture::GeoTexSvxGradientLinear(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), -rFillGradient.getAngle());
break;
}
case attribute::GRADIENTSTYLE_AXIAL:
{
- pNewTex = new texture::geoTexSvxGradientAxial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), -rFillGradient.getAngle());
+ pNewTex = new texture::GeoTexSvxGradientAxial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), -rFillGradient.getAngle());
break;
}
case attribute::GRADIENTSTYLE_RADIAL:
{
- pNewTex = new texture::geoTexSvxGradientRadial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY());
+ pNewTex = new texture::GeoTexSvxGradientRadial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY());
break;
}
case attribute::GRADIENTSTYLE_ELLIPTICAL:
{
- pNewTex = new texture::geoTexSvxGradientElliptical(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle());
+ pNewTex = new texture::GeoTexSvxGradientElliptical(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle());
break;
}
case attribute::GRADIENTSTYLE_SQUARE:
{
- pNewTex = new texture::geoTexSvxGradientSquare(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle());
+ pNewTex = new texture::GeoTexSvxGradientSquare(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle());
break;
}
case attribute::GRADIENTSTYLE_RECT:
{
- pNewTex = new texture::geoTexSvxGradientRect(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle());
+ pNewTex = new texture::GeoTexSvxGradientRect(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle());
break;
}
}
@@ -1336,7 +1348,7 @@ namespace drawinglayer
else
{
// no color distance -> same color, use simple texture
- pNewTex = new texture::geoTexSvxMono(aStart, 1.0 - aStart.luminance());
+ pNewTex = new texture::GeoTexSvxMono(aStart, 1.0 - aStart.luminance());
}
// set created texture
@@ -1350,7 +1362,7 @@ namespace drawinglayer
}
// process sub-list
- process(rSubList);
+ process(rSubSequence);
// delete texture
delete pNewTex;
@@ -1370,16 +1382,16 @@ namespace drawinglayer
}
}
- void defaultProcessor3D::impRender_HAX3(const primitive3d::hatchTexturePrimitive3D& rPrimitive)
+ void DefaultProcessor3D::impRender_HAX3(const primitive3d::HatchTexturePrimitive3D& rPrimitive)
{
- const primitive3d::primitiveVector3D& rSubList = rPrimitive.getPrimitives();
+ const primitive3d::Primitive3DSequence& rSubSequence = rPrimitive.getChildren();
- if(rSubList.size())
+ if(rSubSequence.hasElements())
{
// rescue values
const bool bOldModulate(mbModulate); mbModulate = rPrimitive.getModulate();
const bool bOldFilter(mbFilter); mbFilter = rPrimitive.getFilter();
- texture::geoTexSvx* pOldTex = mpGeoTexSvx;
+ texture::GeoTexSvx* pOldTex = mpGeoTexSvx;
// calculate logic pixel size in world coordinates
const basegfx::B3DPoint aZero(maInvWorldToView * basegfx::B3DPoint(0.0, 0.0, 0.0));
@@ -1403,11 +1415,11 @@ namespace drawinglayer
const double fLogicTexSize(fLogicTexSizeX > fLogicTexSizeY ? fLogicTexSizeX : fLogicTexSizeY);
// create texture and set
- texture::geoTexSvxMultiHatch* pNewTex = new texture::geoTexSvxMultiHatch(rPrimitive, fLogicTexSize);
+ texture::GeoTexSvxMultiHatch* pNewTex = new texture::GeoTexSvxMultiHatch(rPrimitive, fLogicTexSize);
mpGeoTexSvx = pNewTex;
// process sub-list
- process(rSubList);
+ process(rSubSequence);
// delete texture
delete mpGeoTexSvx;
@@ -1419,37 +1431,37 @@ namespace drawinglayer
}
}
- void defaultProcessor3D::impRender_BMX3(const primitive3d::bitmapTexturePrimitive3D& rPrimitive)
+ void DefaultProcessor3D::impRender_BMX3(const primitive3d::BitmapTexturePrimitive3D& rPrimitive)
{
- const primitive3d::primitiveVector3D& rSubList = rPrimitive.getPrimitives();
+ const primitive3d::Primitive3DSequence& rSubSequence = rPrimitive.getChildren();
- if(rSubList.size())
+ if(rSubSequence.hasElements())
{
// rescue values
const bool bOldModulate(mbModulate); mbModulate = rPrimitive.getModulate();
const bool bOldFilter(mbFilter); mbFilter = rPrimitive.getFilter();
- texture::geoTexSvx* pOldTex = mpGeoTexSvx;
+ texture::GeoTexSvx* pOldTex = mpGeoTexSvx;
// create texture
- const attribute::fillBitmapAttribute& rFillBitmapAttribute = rPrimitive.getBitmap();
+ const attribute::FillBitmapAttribute& rFillBitmapAttribute = rPrimitive.getBitmap();
if(rFillBitmapAttribute.getTiling())
{
- mpGeoTexSvx = new texture::geoTexSvxBitmapTiled(
+ mpGeoTexSvx = new texture::GeoTexSvxBitmapTiled(
rFillBitmapAttribute.getBitmap(),
rFillBitmapAttribute.getTopLeft() * rPrimitive.getTextureSize(),
rFillBitmapAttribute.getSize() * rPrimitive.getTextureSize());
}
else
{
- mpGeoTexSvx = new texture::geoTexSvxBitmap(
+ mpGeoTexSvx = new texture::GeoTexSvxBitmap(
rFillBitmapAttribute.getBitmap(),
rFillBitmapAttribute.getTopLeft() * rPrimitive.getTextureSize(),
rFillBitmapAttribute.getSize() * rPrimitive.getTextureSize());
}
// process sub-list
- process(rSubList);
+ process(rSubSequence);
// delete texture
delete mpGeoTexSvx;
@@ -1461,19 +1473,19 @@ namespace drawinglayer
}
}
- void defaultProcessor3D::impRender_MCOL(const primitive3d::modifiedColorPrimitive3D& rModifiedCandidate)
+ void DefaultProcessor3D::impRender_MCOL(const primitive3d::ModifiedColorPrimitive3D& rModifiedCandidate)
{
- const primitive3d::primitiveVector3D& rSubList = rModifiedCandidate.getPrimitives();
+ const primitive3d::Primitive3DSequence& rSubSequence = rModifiedCandidate.getChildren();
- if(rSubList.size())
+ if(rSubSequence.hasElements())
{
maBColorModifierStack.push(rModifiedCandidate.getColorModifier());
- process(rModifiedCandidate.getPrimitives());
+ process(rModifiedCandidate.getChildren());
maBColorModifierStack.pop();
}
}
- void defaultProcessor3D::impRender_POH3(const primitive3d::polygonHairlinePrimitive3D& rPrimitive)
+ void DefaultProcessor3D::impRender_POH3(const primitive3d::PolygonHairlinePrimitive3D& rPrimitive)
{
basegfx::B3DPolygon aHairline(rPrimitive.getB3DPolygon());
@@ -1491,7 +1503,7 @@ namespace drawinglayer
if(a2DRange.overlaps(maRasterRange))
{
- const attribute::materialAttribute3D aMaterial(rPrimitive.getBColor());
+ const attribute::MaterialAttribute3D aMaterial(rPrimitive.getBColor());
BZPolyRaCon aNewRaCon(false, *mpBZPixelRaster, aMaterial, *this);
aNewRaCon.addPolygon(aHairline, maInvEyeToView);
aNewRaCon.rasterconvert(0L, mpBZPixelRaster->getHeight());
@@ -1499,7 +1511,7 @@ namespace drawinglayer
}
}
- void defaultProcessor3D::impRender_POM3(const primitive3d::polyPolygonMaterialPrimitive3D& rPrimitive)
+ void DefaultProcessor3D::impRender_POM3(const primitive3d::PolyPolygonMaterialPrimitive3D& rPrimitive)
{
basegfx::B3DPolyPolygon aFill(rPrimitive.getB3DPolyPolygon());
basegfx::BColor aObjectColor(rPrimitive.getMaterial().getColor());
@@ -1636,7 +1648,7 @@ namespace drawinglayer
if(bPaintIt)
{
// draw it to ZBuffer
- const attribute::materialAttribute3D aMaterial(
+ const attribute::MaterialAttribute3D aMaterial(
aObjectColor, rPrimitive.getMaterial().getSpecular(),
rPrimitive.getMaterial().getEmission(),
rPrimitive.getMaterial().getSpecularIntensity());
@@ -1651,7 +1663,7 @@ namespace drawinglayer
}
}
- void defaultProcessor3D::impRender_TRN3(const primitive3d::transformPrimitive3D& rTransformCandidate)
+ void DefaultProcessor3D::impRender_TRN3(const primitive3d::TransformPrimitive3D& rTransformCandidate)
{
// remember current transformations
basegfx::B3DHomMatrix aLastWorldToView(maWorldToView);
@@ -1665,7 +1677,7 @@ namespace drawinglayer
maInvWorldToView.invert();
// let break down
- process(rTransformCandidate.getPrimitives());
+ process(rTransformCandidate.getChildren());
// restore transformations
maWorldToView = aLastWorldToView;
@@ -1673,132 +1685,144 @@ namespace drawinglayer
maInvWorldToView = aLastInvWorldToView;
}
- void defaultProcessor3D::process(const primitive3d::primitiveVector3D& rSource)
+ void DefaultProcessor3D::process(const primitive3d::Primitive3DSequence& rSource)
{
- for(sal_uInt32 a(0L); a < rSource.size(); a++)
+ if(rSource.hasElements())
{
- const primitive3d::referencedPrimitive3D& rCandidate = rSource[a];
+ const sal_Int32 nCount(rSource.getLength());
- switch(rCandidate.getID())
+ for(sal_Int32 a(0L); a < nCount; a++)
{
- case CreatePrimitiveID('G', 'R', 'X', '3'):
- {
- // gradientTexturePrimitive3D
- const primitive3d::gradientTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::gradientTexturePrimitive3D& >(rCandidate.getBasePrimitive());
- impRender_GRX3(rPrimitive, false);
- break;
- }
+ // get reference
+ const primitive3d::Primitive3DReference xReference(rSource[a]);
- case CreatePrimitiveID('H', 'A', 'X', '3'):
+ if(xReference.is())
{
- static bool bDoHatchDecomposition(true);
+ // try to cast to BasePrimitive3D implementation
+ const primitive3d::BasePrimitive3D* pBasePrimitive = dynamic_cast< const primitive3d::BasePrimitive3D* >(xReference.get());
- if(bDoHatchDecomposition)
+ if(pBasePrimitive)
{
- // let break down
- process(rCandidate.getBasePrimitive().getDecomposition());
- }
- else
- {
- // hatchTexturePrimitive3D
- const primitive3d::hatchTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::hatchTexturePrimitive3D& >(rCandidate.getBasePrimitive());
- impRender_HAX3(rPrimitive);
- }
+ // it is a BasePrimitive3D implementation, use getPrimitiveID() call for switch
+ switch(pBasePrimitive->getPrimitiveID())
+ {
+ case Create3DPrimitiveID('3','G','T','e') :
+ {
+ // GradientTexturePrimitive3D
+ const primitive3d::GradientTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::GradientTexturePrimitive3D& >(*pBasePrimitive);
+ impRender_GRX3(rPrimitive, false);
+ break;
+ }
+ case Create3DPrimitiveID('3','H','T','e') :
+ {
+ // HatchTexturePrimitive3D
+ static bool bDoHatchDecomposition(true);
- break;
- }
+ if(bDoHatchDecomposition)
+ {
+ // let break down
+ process(pBasePrimitive->get3DDecomposition(getTime()));
+ }
+ else
+ {
+ // hatchTexturePrimitive3D
+ const primitive3d::HatchTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::HatchTexturePrimitive3D& >(*pBasePrimitive);
+ impRender_HAX3(rPrimitive);
+ }
+ break;
+ }
+ case Create3DPrimitiveID('3','B','T','e') :
+ {
+ // BitmapTexturePrimitive3D
+ const primitive3d::BitmapTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::BitmapTexturePrimitive3D& >(*pBasePrimitive);
+ impRender_BMX3(rPrimitive);
+ break;
+ }
+ case Create3DPrimitiveID('3','A','T','e') :
+ {
+ // AlphaTexturePrimitive3D
+ const primitive3d::AlphaTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::AlphaTexturePrimitive3D& >(*pBasePrimitive);
- case CreatePrimitiveID('B', 'M', 'X', '3'):
- {
- // bitmapTexturePrimitive3D
- const primitive3d::bitmapTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::bitmapTexturePrimitive3D& >(rCandidate.getBasePrimitive());
- impRender_BMX3(rPrimitive);
- break;
- }
+ if(mbProcessTransparent)
+ {
+ impRender_GRX3(rPrimitive, true);
+ }
+ else
+ {
+ mbContainsTransparent = true;
+ }
+ break;
+ }
+ case Create3DPrimitiveID('3','M','C','o') :
+ {
+ // ModifiedColorPrimitive3D
+ // Force output to unified color.
+ const primitive3d::ModifiedColorPrimitive3D& rPrimitive = static_cast< const primitive3d::ModifiedColorPrimitive3D& >(*pBasePrimitive);
+ impRender_MCOL(rPrimitive);
+ break;
+ }
+ case Create3DPrimitiveID('3','P','H','a') :
+ {
+ // directdraw of PolygonHairlinePrimitive3D
+ const primitive3d::PolygonHairlinePrimitive3D& rPrimitive = static_cast< const primitive3d::PolygonHairlinePrimitive3D& >(*pBasePrimitive);
- case CreatePrimitiveID('T', 'R', 'X', '3'):
- {
- // transparenceTexturePrimitive3D
- const primitive3d::transparenceTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::transparenceTexturePrimitive3D& >(rCandidate.getBasePrimitive());
+ if((bool)mbProcessTransparent == (0L != mpTransparenceGeoTexSvx))
+ {
+ impRender_POH3(rPrimitive);
+ }
+ break;
+ }
+ case Create3DPrimitiveID('3','P','P','M') :
+ {
+ // directdraw of PolyPolygonMaterialPrimitive3D
+ const primitive3d::PolyPolygonMaterialPrimitive3D& rPrimitive = static_cast< const primitive3d::PolyPolygonMaterialPrimitive3D& >(*pBasePrimitive);
- if(mbProcessTransparent)
- {
- impRender_GRX3(rPrimitive, true);
+ if((bool)mbProcessTransparent == (0L != mpTransparenceGeoTexSvx))
+ {
+ impRender_POM3(rPrimitive);
+ }
+ break;
+ }
+ case Create3DPrimitiveID('3','T','r','a') :
+ {
+ // transform group (TransformPrimitive3D)
+ impRender_TRN3(static_cast< const primitive3d::TransformPrimitive3D& >(*pBasePrimitive));
+ break;
+ }
+ case Create3DPrimitiveID('3','L','a','b') :
+ {
+ // SdrLabelPrimitive3D. Accept, but ignore. Is handled by the scenePrimitive decompose
+ // method which creates 2d text objects at the 3d-projection-dependent positions.
+ break;
+ }
+ default:
+ {
+ // process recursively
+ process(pBasePrimitive->get3DDecomposition(getTime()));
+ break;
+ }
+ }
}
else
{
- mbContainsTransparent = true;
+ // unknown implementation, use UNO API call instead and process recursively
+ com::sun::star::graphic::Primitive3DParameters aPrimitive3DParameters;
+ aPrimitive3DParameters.Time = getTime();
+ process(xReference->getDecomposition(aPrimitive3DParameters));
}
-
- break;
- }
-
- case CreatePrimitiveID('M', 'C', 'L', '3'):
- {
- // modified color group. Force output to unified color.
- const primitive3d::modifiedColorPrimitive3D& rPrimitive = static_cast< const primitive3d::modifiedColorPrimitive3D& >(rCandidate.getBasePrimitive());
- impRender_MCOL(rPrimitive);
- break;
- }
-
- case CreatePrimitiveID('P', 'O', 'H', '3'):
- {
- // directdraw of polygonHairlinePrimitive3D
- const primitive3d::polygonHairlinePrimitive3D& rPrimitive = static_cast< const primitive3d::polygonHairlinePrimitive3D& >(rCandidate.getBasePrimitive());
-
- if((bool)mbProcessTransparent == (0L != mpTransparenceGeoTexSvx))
- {
- impRender_POH3(rPrimitive);
- }
-
- break;
- }
-
- case CreatePrimitiveID('P', 'O', 'M', '3'):
- {
- // directdraw of polyPolygonMaterialPrimitive3D
- const primitive3d::polyPolygonMaterialPrimitive3D& rPrimitive = static_cast< const primitive3d::polyPolygonMaterialPrimitive3D& >(rCandidate.getBasePrimitive());
-
- if((bool)mbProcessTransparent == (0L != mpTransparenceGeoTexSvx))
- {
- impRender_POM3(rPrimitive);
- }
-
- break;
- }
-
- case CreatePrimitiveID('T', 'R', 'N', '3'):
- {
- // transform group.
- impRender_TRN3(static_cast< const primitive3d::transformPrimitive3D& >(rCandidate.getBasePrimitive()));
- break;
- }
-
- case CreatePrimitiveID('L', 'A', 'B', '3'):
- {
- // sdrLabelPrimitive3D. Accept, but ignore. Is handled by the scenePrimitive decompose
- // method which creates 2d text objects at the 3d-projection-dependent positions.
- break;
- }
-
- default:
- {
- // let break down
- process(rCandidate.getBasePrimitive().getDecomposition());
- break;
}
}
}
}
- void defaultProcessor3D::processNonTransparent(const primitive3d::primitiveVector3D& rSource)
+ void DefaultProcessor3D::processNonTransparent(const primitive3d::Primitive3DSequence& rSource)
{
mbProcessTransparent = false;
mbContainsTransparent = false;
process(rSource);
}
- void defaultProcessor3D::processTransparent(const primitive3d::primitiveVector3D& rSource)
+ void DefaultProcessor3D::processTransparent(const primitive3d::Primitive3DSequence& rSource)
{
if(mbContainsTransparent)
{
@@ -1807,17 +1831,17 @@ namespace drawinglayer
}
}
- defaultProcessor3D::defaultProcessor3D(
- const geometry::viewInformation& rViewInformation,
- const geometry::transformation3D& rTransformation3D,
- const attribute::sdrSceneAttribute& rSdrSceneAttribute,
- const attribute::sdrLightingAttribute& rsdrLightingAttribute,
+ DefaultProcessor3D::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)
- : baseProcessor3D(rViewInformation, rTransformation3D),
+ : BaseProcessor3D(rViewInformation.getViewTime()),
mrSdrSceneAttribute(rSdrSceneAttribute),
- mrSdrLightingAttribute(rsdrLightingAttribute),
+ mrSdrLightingAttribute(rSdrLightingAttribute),
mpGeoTexSvx(0L),
mpTransparenceGeoTexSvx(0L),
mbModulate(false),
@@ -1826,8 +1850,8 @@ namespace drawinglayer
mbContainsTransparent(false)
{
// generate ViewSizes
- const double fFullViewSizeX((getViewInformation().getViewTransformation() * basegfx::B2DVector(fSizeX, 0.0)).getLength());
- const double fFullViewSizeY((getViewInformation().getViewTransformation() * basegfx::B2DVector(0.0, fSizeY)).getLength());
+ const double fFullViewSizeX((rViewInformation.getViewTransformation() * basegfx::B2DVector(fSizeX, 0.0)).getLength());
+ const double fFullViewSizeY((rViewInformation.getViewTransformation() * basegfx::B2DVector(0.0, fSizeY)).getLength());
const double fViewSizeX(fFullViewSizeX * rVisiblePart.getWidth());
const double fViewSizeY(fFullViewSizeY * rVisiblePart.getHeight());
const sal_uInt32 nViewSizeX((sal_uInt32)floor(fViewSizeX));
@@ -1837,7 +1861,7 @@ namespace drawinglayer
{
// create view unit buffer
mpBZPixelRaster = new basegfx::BZPixelRaster(nViewSizeX + 1L, nViewSizeY + 1L);
- OSL_ENSURE(mpBZPixelRaster, "defaultProcessor3D: Could not allocate basegfx::BZPixelRaster (!)");
+ OSL_ENSURE(mpBZPixelRaster, "DefaultProcessor3D: Could not allocate basegfx::BZPixelRaster (!)");
// create DeviceToView
// outcome is [-1.0 .. 1.0] in X,Y and Z.
@@ -1865,13 +1889,13 @@ namespace drawinglayer
}
// create world to eye transformation
- maWorldToEye = getTransformation3D().getOrientation() * getTransformation3D().getTransformation();
+ maWorldToEye = rTransformation3D.getOrientation() * rTransformation3D.getTransformation();
// create EyeToView transformation
- maWorldToView = maDeviceToView * getTransformation3D().getProjection() * maWorldToEye;
+ maWorldToView = maDeviceToView * rTransformation3D.getProjection() * maWorldToEye;
// create inverse EyeToView transformation
- maInvEyeToView = maDeviceToView * getTransformation3D().getProjection();
+ maInvEyeToView = maDeviceToView * rTransformation3D.getProjection();
maInvEyeToView.invert();
// create inverse WorldToView transformation
@@ -1884,7 +1908,7 @@ namespace drawinglayer
}
}
- defaultProcessor3D::~defaultProcessor3D()
+ DefaultProcessor3D::~DefaultProcessor3D()
{
if(mpBZPixelRaster)
{
@@ -1892,7 +1916,7 @@ namespace drawinglayer
}
}
- BitmapEx defaultProcessor3D::getBitmapEx() const
+ BitmapEx DefaultProcessor3D::getBitmapEx() const
{
if(mpBZPixelRaster)
{
diff --git a/drawinglayer/source/processor3d/makefile.mk b/drawinglayer/source/processor3d/makefile.mk
index c05046d27daa..e21b74a256cd 100644
--- a/drawinglayer/source/processor3d/makefile.mk
+++ b/drawinglayer/source/processor3d/makefile.mk
@@ -4,9 +4,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.1 $
+# $Revision: 1.2 $
#
-# last change: $Author: aw $ $Date: 2006-08-09 16:57:48 $
+# last change: $Author: aw $ $Date: 2006-10-19 10:39:22 $
#
# The Contents of this file are made available subject to
# the terms of GNU Lesser General Public License Version 2.1.
@@ -36,6 +36,7 @@
PRJ=..$/..
PRJNAME=drawinglayer
TARGET=processor3d
+ENABLE_EXCEPTIONS=TRUE
# --- Settings ----------------------------------
@@ -46,8 +47,11 @@ TARGET=processor3d
SLOFILES= \
$(SLO)$/baseprocessor3d.obj \
$(SLO)$/defaultprocessor3d.obj \
- $(SLO)$/shadow3dextractor.obj \
- $(SLO)$/label3dextractor.obj
+ $(SLO)$/label3dextractor.obj \
+ $(SLO)$/shadow3dextractor.obj
+
+
+
# --- Targets ----------------------------------
diff --git a/drawinglayer/source/processor3d/shadow3dextractor.cxx b/drawinglayer/source/processor3d/shadow3dextractor.cxx
index c9a0d854061d..6dc2383681b8 100644
--- a/drawinglayer/source/processor3d/shadow3dextractor.cxx
+++ b/drawinglayer/source/processor3d/shadow3dextractor.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: shadow3dextractor.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2006-08-09 16:57:48 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:39:22 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,23 +33,27 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_PROCESSOR3D_SHADOW3DEXTRACTOR_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_SHADOW3DEXTRACTOR_HXX
#include <drawinglayer/processor3d/shadow3dextractor.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/shadowprimitive3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE_SHADOWPRIMITIVE_HXX
-#include <drawinglayer/primitive/shadowprimitive.hxx>
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SHADOWPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/shadowprimitive2d.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_TRANSFORMPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDALPHAPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TRANSFORMPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/polygonprimitive3d.hxx>
#endif
@@ -57,7 +61,11 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYGONPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#endif
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
#endif
@@ -65,25 +73,17 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#endif
-#ifndef _DRAWINGLAYER_GEOMETRY_TRANSFORMATION3D_HXX
-#include <drawinglayer/geometry/transformation3d.hxx>
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#endif
-#ifndef _DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRLABELPRIMITIVE3D_HXX
+#include <drawinglayer/primitive3d/sdrlabelprimitive3d.hxx>
#endif
-#ifndef _DRAWINGLAYER_PRIMITIVE_SIMPLETRANSPARENCEPRIMITIVE_HXX
-#include <drawinglayer/primitive/simpletransparenceprimitive.hxx>
-#endif
-
-#ifndef _DRAWINGLAYER_PRIMITIVE_POLYGONPRIMITIVE_HXX
-#include <drawinglayer/primitive/polygonprimitive.hxx>
-#endif
+//////////////////////////////////////////////////////////////////////////////
-#ifndef _DRAWINGLAYER_PRIMITIVE_POLYPOLYGONPRIMITIVE_HXX
-#include <drawinglayer/primitive/polypolygonprimitive.hxx>
-#endif
+using namespace com::sun::star;
//////////////////////////////////////////////////////////////////////////////
@@ -91,14 +91,16 @@ namespace drawinglayer
{
namespace processor3d
{
- shadow3DExtractingProcessor::shadow3DExtractingProcessor(
- const geometry::viewInformation& rViewInformation,
- const geometry::transformation3D& rTransformation3D,
- const attribute::sdrLightingAttribute& rSdrLightingAttribute,
- const primitive3d::primitiveVector3D& rPrimitiveVector,
+ Shadow3DExtractingProcessor::Shadow3DExtractingProcessor(
+ double fTime,
+ const geometry::Transformation3D& rTransformation3D,
+ const attribute::SdrLightingAttribute& rSdrLightingAttribute,
+ const primitive3d::Primitive3DSequence& rPrimitiveSequence,
double fShadowSlant)
- : baseProcessor3D(rViewInformation, rTransformation3D),
- mpTargetVector(&maPrimitiveVector),
+ : BaseProcessor3D(fTime),
+ maPrimitive2DSequence(),
+ mpPrimitive2DSequence(&maPrimitive2DSequence),
+ maTransformation3D(rTransformation3D),
mbShadowProjectionIsValid(false),
mbConvert(false),
mbUseProjection(false)
@@ -126,10 +128,10 @@ namespace drawinglayer
maShadowPlaneNormal.normalize();
mfLightPlaneScalar = maLightNormal.scalar(maShadowPlaneNormal);
+ // use only when scalar is > 0.0, so the light is in front of the object
if(basegfx::fTools::more(mfLightPlaneScalar, 0.0))
{
- // use only when scalar is > 0.0, so the light is in front of the object
- basegfx::B3DRange aContained3DRange(get3DRangeFromVector(rPrimitiveVector));
+ basegfx::B3DRange aContained3DRange(primitive3d::getB3DRangeFromPrimitive3DSequence(rPrimitiveSequence, getTime()));
aContained3DRange.transform(maWorldToEye);
maPlanePoint.setX(maShadowPlaneNormal.getX() < 0.0 ? aContained3DRange.getMinX() : aContained3DRange.getMaxX());
maPlanePoint.setY(maShadowPlaneNormal.getY() > 0.0 ? aContained3DRange.getMinY() : aContained3DRange.getMaxY());
@@ -141,164 +143,174 @@ namespace drawinglayer
}
}
- shadow3DExtractingProcessor::~shadow3DExtractingProcessor()
+ void Shadow3DExtractingProcessor::process(const primitive3d::Primitive3DSequence& rSource)
{
- }
-
- void shadow3DExtractingProcessor::process(const primitive3d::primitiveVector3D& rSource)
- {
- for(sal_uInt32 a(0L); a < rSource.size(); a++)
+ if(rSource.hasElements())
{
- // get reference
- const primitive3d::referencedPrimitive3D& rCandidate = rSource[a];
+ const sal_Int32 nCount(rSource.getLength());
- switch(rCandidate.getID())
+ for(sal_Int32 a(0L); a < nCount; a++)
{
- case CreatePrimitiveID('S', 'H', 'D', '3'):
- {
- // shadow3d object. Call recursive with content and start conversion
- const primitive3d::shadowPrimitive3D& rPrimitive = static_cast< const primitive3d::shadowPrimitive3D& >(rCandidate.getBasePrimitive());
-
- // set new target
- primitive::primitiveVector aNewSubList;
- primitive::primitiveVector* pLastTargetVector = mpTargetVector;
- mpTargetVector = &aNewSubList;
-
- // activate convert
- const bool bLastConvert(mbConvert);
- mbConvert = true;
-
- // set projection flag
- const bool bLastUseProjection(mbUseProjection);
- mbUseProjection = rPrimitive.getShadow3D();
-
- // process content
- process(rPrimitive.getPrimitives());
+ // get reference
+ const primitive3d::Primitive3DReference xReference(rSource[a]);
- // restore values
- mbUseProjection = bLastUseProjection;
- mbConvert = bLastConvert;
- mpTargetVector = pLastTargetVector;
-
- // create 2d shadow primitive with result
- primitive::shadowPrimitive* pNew = new primitive::shadowPrimitive(rPrimitive.getShadowTransform(), rPrimitive.getShadowColor(), aNewSubList);
-
- if(basegfx::fTools::more(rPrimitive.getShadowTransparence(), 0.0))
- {
- // create simpleTransparencePrimitive, add created primitives
- primitive::primitiveVector aNewTransPrimitiveVector;
- aNewTransPrimitiveVector.push_back(primitive::referencedPrimitive(*pNew));
- primitive::simpleTransparencePrimitive* pNewTrans = new primitive::simpleTransparencePrimitive(rPrimitive.getShadowTransparence(), aNewTransPrimitiveVector);
- mpTargetVector->push_back(primitive::referencedPrimitive(*pNewTrans));
- }
- else
- {
- // add directly
- mpTargetVector->push_back(primitive::referencedPrimitive(*pNew));
- }
-
- break;
- }
-
- case CreatePrimitiveID('T', 'R', 'N', '3'):
+ if(xReference.is())
{
- // transform group. Remember current transformations
- const primitive3d::transformPrimitive3D& rPrimitive = static_cast< const primitive3d::transformPrimitive3D& >(rCandidate.getBasePrimitive());
- basegfx::B3DHomMatrix aLastWorldToView(maWorldToView);
- basegfx::B3DHomMatrix aLastWorldToEye(maWorldToEye);
-
- // create new transformations
- maWorldToView = maWorldToView * rPrimitive.getTransformation();
- maWorldToEye = maWorldToEye * rPrimitive.getTransformation();
-
- // let break down
- process(rPrimitive.getPrimitives());
-
- // restore transformations
- maWorldToView = aLastWorldToView;
- maWorldToEye = aLastWorldToEye;
- break;
- }
+ // try to cast to BasePrimitive3D implementation
+ const primitive3d::BasePrimitive3D* pBasePrimitive = dynamic_cast< const primitive3d::BasePrimitive3D* >(xReference.get());
- case CreatePrimitiveID('P', 'O', 'H', '3'):
- {
- // polygonHairlinePrimitive3D
- if(mbConvert)
+ if(pBasePrimitive)
{
- const primitive3d::polygonHairlinePrimitive3D& rPrimitive = static_cast< const primitive3d::polygonHairlinePrimitive3D& >(rCandidate.getBasePrimitive());
- basegfx::B2DPolygon a2DHairline;
-
- if(mbUseProjection)
+ // it is a BasePrimitive3D implementation, use getPrimitiveID() call for switch
+ switch(pBasePrimitive->getPrimitiveID())
{
- if(mbShadowProjectionIsValid)
+ case Create3DPrimitiveID('3','S','h','a') :
{
- a2DHairline = impDoShadowProjection(rPrimitive.getB3DPolygon());
+ // shadow3d object. Call recursive with content and start conversion
+ const primitive3d::ShadowPrimitive3D& rPrimitive = static_cast< const primitive3d::ShadowPrimitive3D& >(*pBasePrimitive);
+
+ // set new target
+ primitive2d::Primitive2DSequence aNewSubList;
+ primitive2d::Primitive2DSequence* pLastTargetSequence = mpPrimitive2DSequence;
+ mpPrimitive2DSequence = &aNewSubList;
+
+ // activate convert
+ const bool bLastConvert(mbConvert);
+ mbConvert = true;
+
+ // set projection flag
+ const bool bLastUseProjection(mbUseProjection);
+ mbUseProjection = rPrimitive.getShadow3D();
+
+ // process content
+ process(rPrimitive.getChildren());
+
+ // restore values
+ mbUseProjection = bLastUseProjection;
+ mbConvert = bLastConvert;
+ mpPrimitive2DSequence = pLastTargetSequence;
+
+ // create 2d shadow primitive with result
+ const primitive2d::Primitive2DReference xRef(new primitive2d::ShadowPrimitive2D(rPrimitive.getShadowTransform(), rPrimitive.getShadowColor(), aNewSubList));
+
+ if(basegfx::fTools::more(rPrimitive.getShadowTransparence(), 0.0))
+ {
+ // create simpleTransparencePrimitive, add created primitives
+ const primitive2d::Primitive2DSequence aNewTransPrimitiveVector(&xRef, 1L);
+ const primitive2d::Primitive2DReference xRef2(new primitive2d::UnifiedAlphaPrimitive2D(aNewTransPrimitiveVector, rPrimitive.getShadowTransparence()));
+ primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(*mpPrimitive2DSequence, xRef2);
+ }
+ else
+ {
+ // add directly
+ primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(*mpPrimitive2DSequence, xRef);
+ }
+ break;
}
- }
- else
- {
- a2DHairline = basegfx::tools::createB2DPolygonFromB3DPolygon(rPrimitive.getB3DPolygon(), maWorldToView);
- }
-
- if(a2DHairline.count())
- {
- a2DHairline.transform(getTransformation3D().getObjectTransformation());
- primitive::polygonHairlinePrimitive* pNew = new primitive::polygonHairlinePrimitive(a2DHairline, maPrimitiveColor);
- mpTargetVector->push_back(primitive::referencedPrimitive(*pNew));
- }
- }
-
- break;
- }
-
- case CreatePrimitiveID('P', 'O', 'M', '3'):
- {
- // polyPolygonMaterialPrimitive3D
- if(mbConvert)
- {
- const primitive3d::polyPolygonMaterialPrimitive3D& rPrimitive = static_cast< const primitive3d::polyPolygonMaterialPrimitive3D& >(rCandidate.getBasePrimitive());
- basegfx::B2DPolyPolygon a2DFill;
-
- if(mbUseProjection)
- {
- if(mbShadowProjectionIsValid)
+ case Create3DPrimitiveID('3','T','r','a') :
{
- a2DFill = impDoShadowProjection(rPrimitive.getB3DPolyPolygon());
+ // transform group. Remember current transformations
+ const primitive3d::TransformPrimitive3D& rPrimitive = static_cast< const primitive3d::TransformPrimitive3D& >(*pBasePrimitive);
+ basegfx::B3DHomMatrix aLastWorldToView(maWorldToView);
+ basegfx::B3DHomMatrix aLastWorldToEye(maWorldToEye);
+
+ // create new transformations
+ maWorldToView = maWorldToView * rPrimitive.getTransformation();
+ maWorldToEye = maWorldToEye * rPrimitive.getTransformation();
+
+ // let break down
+ process(rPrimitive.getChildren());
+
+ // restore transformations
+ maWorldToView = aLastWorldToView;
+ maWorldToEye = aLastWorldToEye;
+ break;
+ }
+ case Create3DPrimitiveID('3','P','H','a') :
+ {
+ // PolygonHairlinePrimitive3D
+ if(mbConvert)
+ {
+ const primitive3d::PolygonHairlinePrimitive3D& rPrimitive = static_cast< const primitive3d::PolygonHairlinePrimitive3D& >(*pBasePrimitive);
+ basegfx::B2DPolygon a2DHairline;
+
+ if(mbUseProjection)
+ {
+ if(mbShadowProjectionIsValid)
+ {
+ a2DHairline = impDoShadowProjection(rPrimitive.getB3DPolygon());
+ }
+ }
+ else
+ {
+ a2DHairline = basegfx::tools::createB2DPolygonFromB3DPolygon(rPrimitive.getB3DPolygon(), maWorldToView);
+ }
+
+ if(a2DHairline.count())
+ {
+ a2DHairline.transform(getTransformation3D().getObjectTransformation());
+ const primitive2d::Primitive2DReference xRef(new primitive2d::PolygonHairlinePrimitive2D(a2DHairline, maPrimitiveColor));
+ primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(*mpPrimitive2DSequence, xRef);
+ }
+ }
+ break;
+ }
+ case Create3DPrimitiveID('3','P','P','M') :
+ {
+ // PolyPolygonMaterialPrimitive3D
+ if(mbConvert)
+ {
+ const primitive3d::PolyPolygonMaterialPrimitive3D& rPrimitive = static_cast< const primitive3d::PolyPolygonMaterialPrimitive3D& >(*pBasePrimitive);
+ basegfx::B2DPolyPolygon a2DFill;
+
+ if(mbUseProjection)
+ {
+ if(mbShadowProjectionIsValid)
+ {
+ a2DFill = impDoShadowProjection(rPrimitive.getB3DPolyPolygon());
+ }
+ }
+ else
+ {
+ a2DFill = basegfx::tools::createB2DPolyPolygonFromB3DPolyPolygon(rPrimitive.getB3DPolyPolygon(), maWorldToView);
+ }
+
+ if(a2DFill.count())
+ {
+ a2DFill.transform(getTransformation3D().getObjectTransformation());
+ const primitive2d::Primitive2DReference xRef(new primitive2d::PolyPolygonColorPrimitive2D(a2DFill, maPrimitiveColor));
+ primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(*mpPrimitive2DSequence, xRef);
+ }
+ }
+ break;
+ }
+ case Create3DPrimitiveID('3','L','a','b') :
+ {
+ // SdrLabelPrimitive3D
+ // has no 3d shadow, accept and ignore
+ break;
+ }
+ default :
+ {
+ // process recursively
+ process(pBasePrimitive->get3DDecomposition(getTime()));
+ break;
}
- }
- else
- {
- a2DFill = basegfx::tools::createB2DPolyPolygonFromB3DPolyPolygon(rPrimitive.getB3DPolyPolygon(), maWorldToView);
- }
-
- if(a2DFill.count())
- {
- a2DFill.transform(getTransformation3D().getObjectTransformation());
- primitive::polyPolygonColorPrimitive* pNew = new primitive::polyPolygonColorPrimitive(a2DFill, maPrimitiveColor);
- mpTargetVector->push_back(primitive::referencedPrimitive(*pNew));
}
}
-
- break;
- }
-
- case CreatePrimitiveID('L', 'A', 'B', '3'):
- {
- // has no 3d shadow, accept and ignore
- break;
- }
-
- default:
- {
- // let break down
- process(rCandidate.getBasePrimitive().getDecomposition());
- break;
+ else
+ {
+ // unknown implementation, use UNO API call instead and process recursively
+ com::sun::star::graphic::Primitive3DParameters aPrimitive3DParameters;
+ aPrimitive3DParameters.Time = getTime();
+ process(xReference->getDecomposition(aPrimitive3DParameters));
+ }
}
}
}
}
- basegfx::B2DPolygon shadow3DExtractingProcessor::impDoShadowProjection(const basegfx::B3DPolygon& rSource)
+ basegfx::B2DPolygon Shadow3DExtractingProcessor::impDoShadowProjection(const basegfx::B3DPolygon& rSource)
{
basegfx::B2DPolygon aRetval;
@@ -327,7 +339,7 @@ namespace drawinglayer
return aRetval;
}
- basegfx::B2DPolyPolygon shadow3DExtractingProcessor::impDoShadowProjection(const basegfx::B3DPolyPolygon& rSource)
+ basegfx::B2DPolyPolygon Shadow3DExtractingProcessor::impDoShadowProjection(const basegfx::B3DPolyPolygon& rSource)
{
basegfx::B2DPolyPolygon aRetval;
diff --git a/drawinglayer/source/texture/texture.cxx b/drawinglayer/source/texture/texture.cxx
index 60e3042f6b31..b836ab854ad5 100644
--- a/drawinglayer/source/texture/texture.cxx
+++ b/drawinglayer/source/texture/texture.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: texture.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: aw $ $Date: 2006-09-27 16:33:43 $
+ * last change: $Author: aw $ $Date: 2006-10-19 10:39:34 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,7 +33,7 @@
*
************************************************************************/
-#ifndef _DRAWINGLAYER_TEXTURE_TEXTURE_HXX
+#ifndef INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE_HXX
#include <drawinglayer/texture/texture.hxx>
#endif
@@ -47,26 +47,26 @@ namespace drawinglayer
{
namespace texture
{
- geoTexSvx::geoTexSvx()
+ GeoTexSvx::GeoTexSvx()
{
}
- geoTexSvx::~geoTexSvx()
+ GeoTexSvx::~GeoTexSvx()
{
}
- bool geoTexSvx::operator==(const geoTexSvx& /*rGeoTexSvx*/) const
+ bool GeoTexSvx::operator==(const GeoTexSvx& /*rGeoTexSvx*/) const
{
// default implementation says yes (no data -> no difference)
return true;
}
- void geoTexSvx::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& /*rMatrices*/)
+ void GeoTexSvx::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& /*rMatrices*/)
{
// default implementation does nothing
}
- void geoTexSvx::modifyBColor(const basegfx::B2DPoint& /*rUV*/, basegfx::BColor& rBColor, double& /*rfOpacity*/) const
+ void GeoTexSvx::modifyBColor(const basegfx::B2DPoint& /*rUV*/, basegfx::BColor& rBColor, double& /*rfOpacity*/) const
{
// base implementation creates random color (for testing only, may also be pure virtual)
rBColor.setRed((rand() & 0x7fff) / 32767.0);
@@ -74,7 +74,7 @@ namespace drawinglayer
rBColor.setBlue((rand() & 0x7fff) / 32767.0);
}
- void geoTexSvx::modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const
+ void GeoTexSvx::modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const
{
// base implementation uses inverse of luminance of solved color
basegfx::BColor aBaseColor;
@@ -90,7 +90,7 @@ namespace drawinglayer
{
namespace texture
{
- void geoTexSvxGradient::impAppendMatrix(::std::vector< basegfx::B2DHomMatrix >& rMatrices, const basegfx::B2DRange& rRange)
+ void GeoTexSvxGradient::impAppendMatrix(::std::vector< basegfx::B2DHomMatrix >& rMatrices, const basegfx::B2DRange& rRange)
{
basegfx::B2DHomMatrix aNew;
aNew.set(0, 0, rRange.getWidth());
@@ -100,7 +100,7 @@ namespace drawinglayer
rMatrices.push_back(maTextureTransform * aNew);
}
- void geoTexSvxGradient::impAppendColorsRadial(::std::vector< basegfx::BColor >& rColors)
+ void GeoTexSvxGradient::impAppendColorsRadial(::std::vector< basegfx::BColor >& rColors)
{
if(mnSteps)
{
@@ -115,7 +115,7 @@ namespace drawinglayer
}
}
- geoTexSvxGradient::geoTexSvxGradient(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder)
+ GeoTexSvxGradient::GeoTexSvxGradient(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder)
: maTargetRange(rTargetRange),
maStart(rStart),
maEnd(rEnd),
@@ -125,13 +125,13 @@ namespace drawinglayer
{
}
- geoTexSvxGradient::~geoTexSvxGradient()
+ GeoTexSvxGradient::~GeoTexSvxGradient()
{
}
- bool geoTexSvxGradient::operator==(const geoTexSvx& rGeoTexSvx) const
+ bool GeoTexSvxGradient::operator==(const GeoTexSvx& rGeoTexSvx) const
{
- const geoTexSvxGradient* pCompare = dynamic_cast< const geoTexSvxGradient* >(&rGeoTexSvx);
+ const GeoTexSvxGradient* pCompare = dynamic_cast< const GeoTexSvxGradient* >(&rGeoTexSvx);
return (pCompare
&& maTextureTransform == pCompare->maTextureTransform
&& maTargetRange == pCompare->maTargetRange
@@ -148,8 +148,8 @@ namespace drawinglayer
{
namespace texture
{
- geoTexSvxGradientLinear::geoTexSvxGradientLinear(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fAngle)
- : geoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
+ GeoTexSvxGradientLinear::GeoTexSvxGradientLinear(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fAngle)
+ : GeoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
{
double fTargetSizeX(maTargetRange.getWidth());
double fTargetSizeY(maTargetRange.getHeight());
@@ -201,11 +201,11 @@ namespace drawinglayer
}
}
- geoTexSvxGradientLinear::~geoTexSvxGradientLinear()
+ GeoTexSvxGradientLinear::~GeoTexSvxGradientLinear()
{
}
- void geoTexSvxGradientLinear::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices)
+ void GeoTexSvxGradientLinear::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices)
{
if(mnSteps)
{
@@ -223,7 +223,7 @@ namespace drawinglayer
}
}
- void geoTexSvxGradientLinear::appendColors(::std::vector< basegfx::BColor >& rColors)
+ void GeoTexSvxGradientLinear::appendColors(::std::vector< basegfx::BColor >& rColors)
{
if(mnSteps)
{
@@ -236,7 +236,7 @@ namespace drawinglayer
}
}
- void geoTexSvxGradientLinear::modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& /*rfOpacity*/) const
+ void GeoTexSvxGradientLinear::modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& /*rfOpacity*/) const
{
const basegfx::B2DPoint aCoor(maBackTextureTransform * rUV);
@@ -270,8 +270,8 @@ namespace drawinglayer
{
namespace texture
{
- geoTexSvxGradientAxial::geoTexSvxGradientAxial(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fAngle)
- : geoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
+ GeoTexSvxGradientAxial::GeoTexSvxGradientAxial(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fAngle)
+ : GeoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
{
double fTargetSizeX(maTargetRange.getWidth());
double fTargetSizeY(maTargetRange.getHeight());
@@ -326,11 +326,11 @@ namespace drawinglayer
mfInternalSteps = (double)((mnSteps * 2L) - 1L);
}
- geoTexSvxGradientAxial::~geoTexSvxGradientAxial()
+ GeoTexSvxGradientAxial::~GeoTexSvxGradientAxial()
{
}
- void geoTexSvxGradientAxial::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices)
+ void GeoTexSvxGradientAxial::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices)
{
if(mnSteps)
{
@@ -350,7 +350,7 @@ namespace drawinglayer
}
}
- void geoTexSvxGradientAxial::appendColors(::std::vector< basegfx::BColor >& rColors)
+ void GeoTexSvxGradientAxial::appendColors(::std::vector< basegfx::BColor >& rColors)
{
if(mnSteps)
{
@@ -363,7 +363,7 @@ namespace drawinglayer
}
}
- void geoTexSvxGradientAxial::modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& /*rfOpacity*/) const
+ void GeoTexSvxGradientAxial::modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& /*rfOpacity*/) const
{
const basegfx::B2DPoint aCoor(maBackTextureTransform * rUV);
const double fAbsY(fabs(aCoor.getY()));
@@ -392,8 +392,8 @@ namespace drawinglayer
{
namespace texture
{
- geoTexSvxGradientRadial::geoTexSvxGradientRadial(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fOffsetX, double fOffsetY)
- : geoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
+ GeoTexSvxGradientRadial::GeoTexSvxGradientRadial(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fOffsetX, double fOffsetY)
+ : GeoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
{
double fTargetSizeX(maTargetRange.getWidth());
double fTargetSizeY(maTargetRange.getHeight());
@@ -437,11 +437,11 @@ namespace drawinglayer
}
}
- geoTexSvxGradientRadial::~geoTexSvxGradientRadial()
+ GeoTexSvxGradientRadial::~GeoTexSvxGradientRadial()
{
}
- void geoTexSvxGradientRadial::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices)
+ void GeoTexSvxGradientRadial::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices)
{
if(mnSteps)
{
@@ -478,12 +478,12 @@ namespace drawinglayer
}
}
- void geoTexSvxGradientRadial::appendColors(::std::vector< basegfx::BColor >& rColors)
+ void GeoTexSvxGradientRadial::appendColors(::std::vector< basegfx::BColor >& rColors)
{
impAppendColorsRadial(rColors);
}
- void geoTexSvxGradientRadial::modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& /*rfOpacity*/) const
+ void GeoTexSvxGradientRadial::modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& /*rfOpacity*/) const
{
const basegfx::B2DPoint aCoor(maBackTextureTransform * rUV);
const double fDist(aCoor.getX() * aCoor.getX() + aCoor.getY() * aCoor.getY());
@@ -512,8 +512,8 @@ namespace drawinglayer
{
namespace texture
{
- 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)
- : geoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
+ 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)
+ : GeoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
{
double fTargetSizeX(maTargetRange.getWidth());
double fTargetSizeY(maTargetRange.getHeight());
@@ -567,11 +567,11 @@ namespace drawinglayer
}
}
- geoTexSvxGradientElliptical::~geoTexSvxGradientElliptical()
+ GeoTexSvxGradientElliptical::~GeoTexSvxGradientElliptical()
{
}
- void geoTexSvxGradientElliptical::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices)
+ void GeoTexSvxGradientElliptical::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices)
{
if(mnSteps)
{
@@ -608,12 +608,12 @@ namespace drawinglayer
}
}
- void geoTexSvxGradientElliptical::appendColors(::std::vector< basegfx::BColor >& rColors)
+ void GeoTexSvxGradientElliptical::appendColors(::std::vector< basegfx::BColor >& rColors)
{
impAppendColorsRadial(rColors);
}
- void geoTexSvxGradientElliptical::modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& /*rfOpacity*/) const
+ void GeoTexSvxGradientElliptical::modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& /*rfOpacity*/) const
{
const basegfx::B2DPoint aCoor(maBackTextureTransform * rUV);
const double fDist(aCoor.getX() * aCoor.getX() + aCoor.getY() * aCoor.getY());
@@ -642,8 +642,8 @@ namespace drawinglayer
{
namespace texture
{
- 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)
- : geoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
+ 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)
+ : GeoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
{
double fTargetSizeX(maTargetRange.getWidth());
double fTargetSizeY(maTargetRange.getHeight());
@@ -704,11 +704,11 @@ namespace drawinglayer
}
}
- geoTexSvxGradientSquare::~geoTexSvxGradientSquare()
+ GeoTexSvxGradientSquare::~GeoTexSvxGradientSquare()
{
}
- void geoTexSvxGradientSquare::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices)
+ void GeoTexSvxGradientSquare::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices)
{
if(mnSteps)
{
@@ -753,12 +753,12 @@ namespace drawinglayer
}
}
- void geoTexSvxGradientSquare::appendColors(::std::vector< basegfx::BColor >& rColors)
+ void GeoTexSvxGradientSquare::appendColors(::std::vector< basegfx::BColor >& rColors)
{
impAppendColorsRadial(rColors);
}
- void geoTexSvxGradientSquare::modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& /*rfOpacity*/) const
+ void GeoTexSvxGradientSquare::modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& /*rfOpacity*/) const
{
const basegfx::B2DPoint aCoor(maBackTextureTransform * rUV);
const double fAbsX(fabs(aCoor.getX()));
@@ -788,8 +788,8 @@ namespace drawinglayer
{
namespace texture
{
- 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)
- : geoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
+ 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)
+ : GeoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
{
double fTargetSizeX(maTargetRange.getWidth());
double fTargetSizeY(maTargetRange.getHeight());
@@ -850,11 +850,11 @@ namespace drawinglayer
}
}
- geoTexSvxGradientRect::~geoTexSvxGradientRect()
+ GeoTexSvxGradientRect::~GeoTexSvxGradientRect()
{
}
- void geoTexSvxGradientRect::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices)
+ void GeoTexSvxGradientRect::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices)
{
if(mnSteps)
{
@@ -891,12 +891,12 @@ namespace drawinglayer
}
}
- void geoTexSvxGradientRect::appendColors(::std::vector< basegfx::BColor >& rColors)
+ void GeoTexSvxGradientRect::appendColors(::std::vector< basegfx::BColor >& rColors)
{
impAppendColorsRadial(rColors);
}
- void geoTexSvxGradientRect::modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& /*rfOpacity*/) const
+ void GeoTexSvxGradientRect::modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& /*rfOpacity*/) const
{
const basegfx::B2DPoint aCoor(maBackTextureTransform * rUV);
const double fAbsX(fabs(aCoor.getX()));
@@ -926,7 +926,7 @@ namespace drawinglayer
{
namespace texture
{
- geoTexSvxHatch::geoTexSvxHatch(const basegfx::B2DRange& rTargetRange, double fDistance, double fAngle)
+ GeoTexSvxHatch::GeoTexSvxHatch(const basegfx::B2DRange& rTargetRange, double fDistance, double fAngle)
: mfDistance(0.1),
mfAngle(fAngle),
mnSteps(10L)
@@ -976,13 +976,13 @@ namespace drawinglayer
maBackTextureTransform.invert();
}
- geoTexSvxHatch::~geoTexSvxHatch()
+ GeoTexSvxHatch::~GeoTexSvxHatch()
{
}
- bool geoTexSvxHatch::operator==(const geoTexSvx& rGeoTexSvx) const
+ bool GeoTexSvxHatch::operator==(const GeoTexSvx& rGeoTexSvx) const
{
- const geoTexSvxHatch* pCompare = dynamic_cast< const geoTexSvxHatch* >(&rGeoTexSvx);
+ const GeoTexSvxHatch* pCompare = dynamic_cast< const GeoTexSvxHatch* >(&rGeoTexSvx);
return (pCompare
&& maTextureTransform == pCompare->maTextureTransform
&& mfDistance == pCompare->mfDistance
@@ -990,7 +990,7 @@ namespace drawinglayer
&& mnSteps == pCompare->mnSteps);
}
- void geoTexSvxHatch::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices)
+ void GeoTexSvxHatch::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices)
{
for(sal_uInt32 a(1L); a < mnSteps; a++)
{
@@ -1002,7 +1002,7 @@ namespace drawinglayer
}
}
- double geoTexSvxHatch::getDistanceToHatch(const basegfx::B2DPoint& rUV) const
+ double GeoTexSvxHatch::getDistanceToHatch(const basegfx::B2DPoint& rUV) const
{
const basegfx::B2DPoint aCoor(maBackTextureTransform * rUV);
return fmod(aCoor.getY(), mfDistance);
@@ -1016,7 +1016,7 @@ namespace drawinglayer
{
namespace texture
{
- geoTexSvxTiled::geoTexSvxTiled(const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize)
+ GeoTexSvxTiled::GeoTexSvxTiled(const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize)
: maTopLeft(rTopLeft),
maSize(rSize)
{
@@ -1031,19 +1031,19 @@ namespace drawinglayer
}
}
- geoTexSvxTiled::~geoTexSvxTiled()
+ GeoTexSvxTiled::~GeoTexSvxTiled()
{
}
- bool geoTexSvxTiled::operator==(const geoTexSvx& rGeoTexSvx) const
+ bool GeoTexSvxTiled::operator==(const GeoTexSvx& rGeoTexSvx) const
{
- const geoTexSvxTiled* pCompare = dynamic_cast< const geoTexSvxTiled* >(&rGeoTexSvx);
+ const GeoTexSvxTiled* pCompare = dynamic_cast< const GeoTexSvxTiled* >(&rGeoTexSvx);
return (pCompare
&& maTopLeft == pCompare->maTopLeft
&& maSize == pCompare->maSize);
}
- void geoTexSvxTiled::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices)
+ void GeoTexSvxTiled::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices)
{
double fStartX(maTopLeft.getX());
double fStartY(maTopLeft.getY());
diff --git a/drawinglayer/util/makefile.mk b/drawinglayer/util/makefile.mk
index 307ffd92b078..9cd9206e8ca7 100644
--- a/drawinglayer/util/makefile.mk
+++ b/drawinglayer/util/makefile.mk
@@ -4,9 +4,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.5 $
+# $Revision: 1.6 $
#
-# last change: $Author: aw $ $Date: 2006-08-09 16:58:53 $
+# last change: $Author: aw $ $Date: 2006-10-19 10:26:01 $
#
# The Contents of this file are made available subject to
# the terms of GNU Lesser General Public License Version 2.1.
@@ -46,10 +46,10 @@ TARGET=drawinglayer
LIB1TARGET=$(SLB)$/drawinglayer.lib
LIB1FILES=\
- $(SLB)$/primitive.lib \
+ $(SLB)$/primitive2d.lib \
$(SLB)$/primitive3d.lib \
$(SLB)$/geometry.lib \
- $(SLB)$/processor.lib \
+ $(SLB)$/processor2d.lib \
$(SLB)$/processor3d.lib \
$(SLB)$/attribute.lib \
$(SLB)$/animation.lib \