summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@Sun.COM>2010-01-27 11:51:56 +0100
committerArmin Le Grand <Armin.Le.Grand@Sun.COM>2010-01-27 11:51:56 +0100
commitffe5c97056ab181367e49691d487eb6f6f375200 (patch)
tree552e2d32015f11e023004a4104e15cce886312e0 /drawinglayer
parentde7c998fe9ba5be956bf8a155455ad17985c4f88 (diff)
aw079: #i99147# attribute rework and others
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/fillattribute.hxx138
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx42
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/fillgradientattribute.hxx121
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/fillhatchattribute.hxx112
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx81
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx61
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/linestartendattribute.hxx47
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx12
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx66
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrattribute.hxx223
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx217
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrfillattribute.hxx99
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx61
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrlightattribute3d.hxx96
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrlightingattribute3d.hxx99
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrlineattribute.hxx104
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrlinestartendattribute.hxx102
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrobjectattribute3d.hxx111
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrsceneattribute3d.hxx94
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrshadowattribute.hxx93
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx54
-rw-r--r--drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx6
-rw-r--r--drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx6
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx8
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx20
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx (renamed from drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx)43
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx6
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx4
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/sdrdecompositiontools2d.hxx85
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/transparenceprimitive2d.hxx (renamed from drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx)34
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx (renamed from drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx)25
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx38
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx1
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx (renamed from drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx)47
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx11
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx8
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx26
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx177
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/canvasprocessor.hxx13
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx9
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx37
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx9
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx8
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx56
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx23
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx13
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx27
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx37
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx41
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/geometry2dextractor.hxx19
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx35
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/zbufferprocessor3d.hxx25
-rw-r--r--drawinglayer/prj/d.lst22
-rw-r--r--drawinglayer/source/attribute/fillattribute.cxx102
-rw-r--r--drawinglayer/source/attribute/fillbitmapattribute.cxx153
-rw-r--r--drawinglayer/source/attribute/fillgradientattribute.cxx250
-rw-r--r--drawinglayer/source/attribute/fillhatchattribute.cxx219
-rw-r--r--drawinglayer/source/attribute/fontattribute.cxx220
-rw-r--r--drawinglayer/source/attribute/lineattribute.cxx142
-rw-r--r--drawinglayer/source/attribute/linestartendattribute.cxx148
-rw-r--r--drawinglayer/source/attribute/makefile.mk27
-rw-r--r--drawinglayer/source/attribute/materialattribute3d.cxx93
-rw-r--r--drawinglayer/source/attribute/sdrallattribute3d.cxx169
-rw-r--r--drawinglayer/source/attribute/sdrattribute.cxx293
-rw-r--r--drawinglayer/source/attribute/sdrattribute3d.cxx219
-rw-r--r--drawinglayer/source/attribute/sdrfillattribute.cxx221
-rw-r--r--drawinglayer/source/attribute/sdrfillbitmapattribute.cxx259
-rw-r--r--drawinglayer/source/attribute/sdrlightattribute3d.cxx196
-rw-r--r--drawinglayer/source/attribute/sdrlightingattribute3d.cxx235
-rw-r--r--drawinglayer/source/attribute/sdrlineattribute.cxx250
-rw-r--r--drawinglayer/source/attribute/sdrlinestartendattribute.cxx254
-rw-r--r--drawinglayer/source/attribute/sdrobjectattribute3d.cxx292
-rw-r--r--drawinglayer/source/attribute/sdrsceneattribute3d.cxx218
-rw-r--r--drawinglayer/source/attribute/sdrshadowattribute.cxx193
-rw-r--r--drawinglayer/source/attribute/strokeattribute.cxx139
-rw-r--r--drawinglayer/source/geometry/viewinformation2d.cxx47
-rw-r--r--drawinglayer/source/geometry/viewinformation3d.cxx47
-rw-r--r--drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx78
-rw-r--r--drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx38
-rw-r--r--drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx108
-rw-r--r--drawinglayer/source/primitive2d/graphicprimitive2d.cxx6
-rw-r--r--drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx (renamed from drawinglayer/source/primitive2d/hittestprimitive2d.cxx)11
-rw-r--r--drawinglayer/source/primitive2d/invertprimitive2d.cxx2
-rw-r--r--drawinglayer/source/primitive2d/makefile.mk89
-rw-r--r--drawinglayer/source/primitive2d/mediaprimitive2d.cxx17
-rw-r--r--drawinglayer/source/primitive2d/metafileprimitive2d.cxx31
-rw-r--r--drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx5
-rw-r--r--drawinglayer/source/primitive2d/polygonprimitive2d.cxx31
-rw-r--r--drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx105
-rw-r--r--drawinglayer/source/primitive2d/sceneprimitive2d.cxx9
-rw-r--r--drawinglayer/source/primitive2d/sdrdecompositiontools2d.cxx130
-rw-r--r--drawinglayer/source/primitive2d/shadowprimitive2d.cxx4
-rw-r--r--drawinglayer/source/primitive2d/transparenceprimitive2d.cxx (renamed from drawinglayer/source/primitive2d/alphaprimitive2d.cxx)16
-rw-r--r--drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx (renamed from drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx)51
-rw-r--r--drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx3
-rw-r--r--drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx (renamed from drawinglayer/source/primitive3d/hittestprimitive3d.cxx)10
-rw-r--r--drawinglayer/source/primitive3d/makefile.mk2
-rw-r--r--drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx4
-rw-r--r--drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx37
-rw-r--r--drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx88
-rw-r--r--drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx45
-rw-r--r--drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx47
-rw-r--r--drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx44
-rw-r--r--drawinglayer/source/primitive3d/sdrprimitive3d.cxx16
-rw-r--r--drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx38
-rw-r--r--drawinglayer/source/primitive3d/textureprimitive3d.cxx28
-rw-r--r--drawinglayer/source/processor2d/canvasprocessor.cxx139
-rw-r--r--drawinglayer/source/processor2d/contourextractor2d.cxx10
-rw-r--r--drawinglayer/source/processor2d/hittestprocessor2d.cxx29
-rw-r--r--drawinglayer/source/processor2d/vclhelperbufferdevice.cxx4
-rw-r--r--drawinglayer/source/processor2d/vclhelperbufferdevice.hxx2
-rw-r--r--drawinglayer/source/processor2d/vclhelpergradient.cxx2
-rw-r--r--drawinglayer/source/processor2d/vclhelpergradient.hxx3
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx260
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx74
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx41
-rw-r--r--drawinglayer/source/processor3d/cutfindprocessor3d.cxx50
-rw-r--r--drawinglayer/source/processor3d/defaultprocessor3d.cxx10
-rw-r--r--drawinglayer/source/processor3d/geometry2dextractor.cxx4
-rw-r--r--drawinglayer/source/processor3d/shadow3dextractor.cxx4
-rw-r--r--drawinglayer/source/processor3d/zbufferprocessor3d.cxx2
-rw-r--r--drawinglayer/source/texture/texture3d.cxx1
136 files changed, 6453 insertions, 2642 deletions
diff --git a/drawinglayer/inc/drawinglayer/attribute/fillattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fillattribute.hxx
deleted file mode 100644
index e50a636e8a83..000000000000
--- a/drawinglayer/inc/drawinglayer/attribute/fillattribute.hxx
+++ /dev/null
@@ -1,138 +0,0 @@
-/*************************************************************************
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: fillattribute.hxx,v $
- *
- * $Revision: 1.3 $
- *
- * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
- *
- * 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_ATTRIBUTE_FILLATTRIBUTE_HXX
-#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX
-
-#include <basegfx/color/bcolor.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-// predefines
-class XHatch;
-
-namespace drawinglayer
-{
- namespace attribute
- {
- enum GradientStyle
- {
- GRADIENTSTYLE_LINEAR,
- GRADIENTSTYLE_AXIAL,
- GRADIENTSTYLE_RADIAL,
- GRADIENTSTYLE_ELLIPTICAL,
- GRADIENTSTYLE_SQUARE,
- GRADIENTSTYLE_RECT
- };
-
- enum HatchStyle
- {
- HATCHSTYLE_SINGLE,
- HATCHSTYLE_DOUBLE,
- HATCHSTYLE_TRIPLE
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class FillGradientAttribute
- {
- basegfx::BColor maStartColor;
- basegfx::BColor maEndColor;
- double mfBorder;
- double mfOffsetX;
- double mfOffsetY;
- double mfAngle;
- GradientStyle meStyle;
- sal_uInt16 mnSteps;
-
- public:
- 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;
-
- // data access
- const basegfx::BColor& getStartColor() const { return maStartColor; }
- const basegfx::BColor& getEndColor() const { return maEndColor; }
- double getBorder() const { return mfBorder; }
- double getOffsetX() const { return mfOffsetX; }
- double getOffsetY() const { return mfOffsetY; }
- double getAngle() const { return mfAngle; }
- GradientStyle getStyle() const { return meStyle; }
- sal_uInt16 getSteps() const { return mnSteps; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class FillHatchAttribute
- {
- double mfDistance;
- double mfAngle;
- 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;
-
- // data access
- double getDistance() const { return mfDistance; }
- double getAngle() const { return mfAngle; }
- const basegfx::BColor& getColor() const { return maColor; }
- HatchStyle getStyle() const { return meStyle; }
- bool isFillBackground() const { return mbFillBackground; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX
-
-// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx
index 376e1d626927..04d1a9298eb5 100644
--- a/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx
@@ -36,18 +36,22 @@
#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX
-#include <vcl/bitmapex.hxx>
-#include <basegfx/point/b2dpoint.hxx>
-#include <basegfx/vector/b2dvector.hxx>
+#include <sal/types.h>
//////////////////////////////////////////////////////////////////////////////
// predefines
+class BitmapEx;
+
namespace basegfx {
- class B2DRange;
- class BColor;
+ class B2DPoint;
+ class B2DVector;
}
+namespace drawinglayer { namespace attribute {
+ class ImpFillBitmapAttribute;
+}}
+
//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
@@ -56,26 +60,32 @@ namespace drawinglayer
{
class FillBitmapAttribute
{
- BitmapEx maBitmapEx;
- basegfx::B2DPoint maTopLeft;
- basegfx::B2DVector maSize;
-
- // bitfield
- unsigned mbTiling : 1;
+ private:
+ ImpFillBitmapAttribute* mpFillBitmapAttribute;
public:
+ /// constructors/assignmentoperator/destructor
FillBitmapAttribute(
const BitmapEx& rBitmapEx,
const basegfx::B2DPoint& rTopLeft,
const basegfx::B2DVector& rSize,
bool bTiling);
+ FillBitmapAttribute();
+ FillBitmapAttribute(const FillBitmapAttribute& rCandidate);
+ FillBitmapAttribute& operator=(const FillBitmapAttribute& rCandidate);
+ ~FillBitmapAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
bool operator==(const FillBitmapAttribute& rCandidate) const;
- // data access
- const BitmapEx& getBitmapEx() const { return maBitmapEx; }
- const basegfx::B2DPoint& getTopLeft() const { return maTopLeft; }
- const basegfx::B2DVector& getSize() const { return maSize; }
- bool getTiling() const { return mbTiling; }
+ // data read access
+ const BitmapEx& getBitmapEx() const;
+ const basegfx::B2DPoint& getTopLeft() const;
+ const basegfx::B2DVector& getSize() const;
+ bool getTiling() const;
};
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/inc/drawinglayer/attribute/fillgradientattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fillgradientattribute.hxx
new file mode 100644
index 000000000000..f7bddbfe0f89
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/fillgradientattribute.hxx
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: fillattribute.hxx,v $
+ *
+ * $Revision: 1.3 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * 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_ATTRIBUTE_FILLGRADIENTATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLGRADIENTATTRIBUTE_HXX
+
+#include <sal/types.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpFillGradientAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+// declarations
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ enum GradientStyle
+ {
+ GRADIENTSTYLE_LINEAR,
+ GRADIENTSTYLE_AXIAL,
+ GRADIENTSTYLE_RADIAL,
+ GRADIENTSTYLE_ELLIPTICAL,
+ GRADIENTSTYLE_SQUARE,
+ GRADIENTSTYLE_RECT
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class FillGradientAttribute
+ {
+ private:
+ ImpFillGradientAttribute* mpFillGradientAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ FillGradientAttribute(
+ GradientStyle eStyle,
+ double fBorder,
+ double fOffsetX,
+ double fOffsetY,
+ double fAngle,
+ const basegfx::BColor& rStartColor,
+ const basegfx::BColor& rEndColor,
+ sal_uInt16 nSteps);
+ FillGradientAttribute();
+ FillGradientAttribute(const FillGradientAttribute& rCandidate);
+ FillGradientAttribute& operator=(const FillGradientAttribute& rCandidate);
+ ~FillGradientAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const FillGradientAttribute& rCandidate) const;
+
+ // data read access
+ GradientStyle getStyle() const;
+ double getBorder() const;
+ double getOffsetX() const;
+ double getOffsetY() const;
+ double getAngle() const;
+ const basegfx::BColor& getStartColor() const;
+ const basegfx::BColor& getEndColor() const;
+ sal_uInt16 getSteps() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLGRADIENTATTRIBUTE_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/fillhatchattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fillhatchattribute.hxx
new file mode 100644
index 000000000000..9f147b36ef34
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/fillhatchattribute.hxx
@@ -0,0 +1,112 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: fillattribute.hxx,v $
+ *
+ * $Revision: 1.3 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * 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_ATTRIBUTE_FILLHATCHATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLHATCHATTRIBUTE_HXX
+
+#include <sal/types.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpFillHatchAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+// declarations
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ enum HatchStyle
+ {
+ HATCHSTYLE_SINGLE,
+ HATCHSTYLE_DOUBLE,
+ HATCHSTYLE_TRIPLE
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class FillHatchAttribute
+ {
+ private:
+ ImpFillHatchAttribute* mpFillHatchAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ FillHatchAttribute(
+ HatchStyle eStyle,
+ double fDistance,
+ double fAngle,
+ const basegfx::BColor& rColor,
+ bool bFillBackground);
+ FillHatchAttribute();
+ FillHatchAttribute(const FillHatchAttribute& rCandidate);
+ FillHatchAttribute& operator=(const FillHatchAttribute& rCandidate);
+ ~FillHatchAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const FillHatchAttribute& rCandidate) const;
+
+ // data read access
+ HatchStyle getStyle() const;
+ double getDistance() const;
+ double getAngle() const;
+ const basegfx::BColor& getColor() const;
+ bool isFillBackground() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLHATCHATTRIBUTE_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
index d8eed659f5e7..6a6cbe26be11 100644
--- a/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
@@ -36,9 +36,16 @@
#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FONTATTRIBUTE_HXX
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FONTATTRIBUTE_HXX
-#include <sal/config.h>
#include <sal/types.h>
-#include <tools/string.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+class String;
+
+namespace drawinglayer { namespace attribute {
+ class ImpFontAttribute;
+}}
//////////////////////////////////////////////////////////////////////////////
@@ -54,22 +61,11 @@ namespace drawinglayer
class FontAttribute
{
private:
- /// core data
- String maFamilyName; // Font Family Name
- String maStyleName; // Font Style Name
- sal_uInt16 mnWeight; // Font weight
-
- /// bitfield
- unsigned mbSymbol : 1; // Symbol Font Flag
- unsigned mbVertical : 1; // Vertical Text Flag
- unsigned mbItalic : 1; // Italic Flag
- unsigned mbOutline : 1; // Outline Flag
- unsigned mbRTL : 1; // RTL Flag
- unsigned mbBiDiStrong : 1; // BiDi Flag
- // TODO: pair kerning and CJK kerning
+ ImpFontAttribute* mpFontAttribute;
public:
- /// constructor
+ /// constructors/assignmentoperator/destructor
+ /// TODO: pair kerning and CJK kerning
FontAttribute(
const String& rFamilyName,
const String& rStyleName,
@@ -79,45 +75,28 @@ namespace drawinglayer
bool bItalic = false,
bool bOutline = false,
bool bRTL = false,
- bool bBiDiStrong = false)
- : maFamilyName(rFamilyName),
- maStyleName(rStyleName),
- mnWeight(nWeight),
- mbSymbol(bSymbol),
- mbVertical(bVertical),
- mbItalic(bItalic),
- mbOutline(bOutline),
- mbRTL(bRTL),
- mbBiDiStrong(bBiDiStrong)
- {
- }
+ bool bBiDiStrong = false);
+ FontAttribute();
+ FontAttribute(const FontAttribute& rCandidate);
+ FontAttribute& operator=(const FontAttribute& rCandidate);
+ ~FontAttribute();
- FontAttribute()
- : maFamilyName(),
- maStyleName(),
- mnWeight(0),
- mbSymbol(false),
- mbVertical(false),
- mbItalic(false),
- mbOutline(false),
- mbRTL(false),
- mbBiDiStrong(false)
- {
- }
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
- /// compare operator
- bool operator==(const FontAttribute& rCompare) const;
+ // compare operator
+ bool operator==(const FontAttribute& rCandidate) const;
/// data read access
- const String& getFamilyName() const { return maFamilyName; }
- const String& getStyleName() const { return maStyleName; }
- sal_uInt16 getWeight() const { return mnWeight; }
- bool getSymbol() const { return mbSymbol; }
- bool getVertical() const { return mbVertical; }
- bool getItalic() const { return mbItalic; }
- bool getOutline() const { return mbOutline; }
- bool getRTL() const { return mbRTL; }
- bool getBiDiStrong() const { return mbBiDiStrong; }
+ const String& getFamilyName() const;
+ const String& getStyleName() const;
+ sal_uInt16 getWeight() const;
+ bool getSymbol() const;
+ bool getVertical() const;
+ bool getItalic() const;
+ bool getOutline() const;
+ bool getRTL() const;
+ bool getBiDiStrong() const;
};
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx
index b4bdabe8d646..3ef055355bd5 100644
--- a/drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx
@@ -36,13 +36,19 @@
#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINEATTRIBUTE_HXX
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINEATTRIBUTE_HXX
-#include <basegfx/polygon/b2dlinegeometry.hxx>
-#include <basegfx/color/bcolor.hxx>
-#include <vector>
+#include <basegfx/vector/b2enums.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
+namespace basegfx {
+ class BColor;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpLineAttribute;
+}}
+
//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
@@ -52,50 +58,29 @@ namespace drawinglayer
class LineAttribute
{
private:
- basegfx::BColor maColor; // color
- double mfWidth; // absolute line width
- basegfx::B2DLineJoin meLineJoin; // type of LineJoin
+ ImpLineAttribute* mpLineAttribute;
public:
+ /// constructors/assignmentoperator/destructor
LineAttribute(
const basegfx::BColor& rColor,
double fWidth = 0.0,
- basegfx::B2DLineJoin aB2DLineJoin = basegfx::B2DLINEJOIN_ROUND)
- : maColor(rColor),
- mfWidth(fWidth),
- meLineJoin(aB2DLineJoin)
- {
- }
-
- LineAttribute(const LineAttribute& rCandidate)
- {
- *this = rCandidate;
- }
-
- LineAttribute& operator=(const LineAttribute& rCandidate)
- {
- maColor = rCandidate.maColor;
- mfWidth = rCandidate.mfWidth;
- meLineJoin = rCandidate.meLineJoin;
- return *this;
- }
+ basegfx::B2DLineJoin aB2DLineJoin = basegfx::B2DLINEJOIN_ROUND);
+ LineAttribute();
+ LineAttribute(const LineAttribute& rCandidate);
+ LineAttribute& operator=(const LineAttribute& rCandidate);
+ ~LineAttribute();
- ~LineAttribute()
- {
- }
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
// compare operator
- bool operator==(const LineAttribute& rCandidate) const
- {
- return (maColor == rCandidate.maColor
- && mfWidth == rCandidate.mfWidth
- && meLineJoin == rCandidate.meLineJoin);
- }
+ bool operator==(const LineAttribute& rCandidate) const;
- // data access
- const basegfx::BColor& getColor() const { return maColor; }
- double getWidth() const { return mfWidth; }
- basegfx::B2DLineJoin getLineJoin() const { return meLineJoin; }
+ // data read access
+ const basegfx::BColor& getColor() const;
+ double getWidth() const;
+ basegfx::B2DLineJoin getLineJoin() const;
};
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/inc/drawinglayer/attribute/linestartendattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/linestartendattribute.hxx
index dbd12c90c9d8..151e059559ec 100644
--- a/drawinglayer/inc/drawinglayer/attribute/linestartendattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/linestartendattribute.hxx
@@ -36,12 +36,19 @@
#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINESTARTENDATTRIBUTE_HXX
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINESTARTENDATTRIBUTE_HXX
-#include <basegfx/polygon/b2dpolypolygon.hxx>
-#include <basegfx/numeric/ftools.hxx>
+#include <sal/types.h>
//////////////////////////////////////////////////////////////////////////////
// predefines
+namespace basegfx {
+ class B2DPolyPolygon;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpLineStartEndAttribute;
+}}
+
//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
@@ -51,35 +58,29 @@ namespace drawinglayer
class LineStartEndAttribute
{
private:
- double mfWidth; // absolute line StartEndGeometry base width
- basegfx::B2DPolyPolygon maPolyPolygon; // the StartEndGeometry PolyPolygon
-
- // bitfield
- unsigned mbCentered : 1; // use centered to ineStart/End point?
+ ImpLineStartEndAttribute* mpLineStartEndAttribute;
public:
+ /// constructors/assignmentoperator/destructor
LineStartEndAttribute(
double fWidth,
const basegfx::B2DPolyPolygon& rPolyPolygon,
- bool bCentered)
- : mfWidth(fWidth),
- maPolyPolygon(rPolyPolygon),
- mbCentered(bCentered)
- {
- }
+ bool bCentered);
+ LineStartEndAttribute();
+ LineStartEndAttribute(const LineStartEndAttribute& rCandidate);
+ LineStartEndAttribute& operator=(const LineStartEndAttribute& rCandidate);
+ ~LineStartEndAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
// compare operator
- bool operator==(const LineStartEndAttribute& rCandidate) const
- {
- return (basegfx::fTools::equal(mfWidth, rCandidate.mfWidth)
- && maPolyPolygon == rCandidate.maPolyPolygon
- && mbCentered == rCandidate.mbCentered);
- }
+ bool operator==(const LineStartEndAttribute& rCandidate) const;
- // data access
- double getWidth() const { return mfWidth; }
- const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
- bool isCentered() const { return mbCentered; }
+ // data read access
+ double getWidth() const;
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const;
+ bool isCentered() const;
bool isActive() const;
};
} // end of namespace attribute
diff --git a/drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx
index 392f1b0a9113..1941770b9af3 100644
--- a/drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx
@@ -62,7 +62,11 @@ namespace drawinglayer
public:
// constructors/destructor
- MaterialAttribute3D(const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity);
+ 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);
@@ -71,11 +75,13 @@ namespace drawinglayer
// assignment operator
MaterialAttribute3D& operator=(const MaterialAttribute3D& rCandidate);
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
// compare operator
bool operator==(const MaterialAttribute3D& rCandidate) const;
- bool operator!=(const MaterialAttribute3D& rCandidate) const { return !operator==(rCandidate); }
- // data access
+ // data read access
const basegfx::BColor& getColor() const;
const basegfx::BColor& getSpecular() const;
const basegfx::BColor& getEmission() const;
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx
index 0763c2129f0d..c034a5fcc7a2 100644
--- a/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx
@@ -36,57 +36,53 @@
#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX
+#include <sal/types.h>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+
//////////////////////////////////////////////////////////////////////////////
// predefines
-namespace drawinglayer { namespace attribute {
- class SdrLineAttribute;
- class SdrFillAttribute;
- class SdrLineStartEndAttribute;
- class SdrShadowAttribute;
- class FillGradientAttribute;
-}}
-
//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
{
namespace attribute
{
- class SdrLineFillShadowAttribute
+ class SdrLineFillShadowAttribute3D
{
- // 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)
+ private:
+ const SdrLineAttribute maLine;
+ const SdrFillAttribute maFill;
+ const SdrLineStartEndAttribute maLineStartEnd;
+ const SdrShadowAttribute maShadow;
+ const FillGradientAttribute maFillFloatTransGradient;
public:
- SdrLineFillShadowAttribute(
- SdrLineAttribute* pLine = 0,
- SdrFillAttribute* pFill = 0,
- SdrLineStartEndAttribute* pLineStartEnd = 0,
- SdrShadowAttribute* pShadow = 0,
- FillGradientAttribute* pFillFloatTransGradient = 0);
- ~SdrLineFillShadowAttribute();
+ /// constructors/assignmentoperator/destructor
+ SdrLineFillShadowAttribute3D(
+ const SdrLineAttribute& rLine,
+ const SdrFillAttribute& rFill,
+ const SdrLineStartEndAttribute& rLineStartEnd,
+ const SdrShadowAttribute& rShadow,
+ const FillGradientAttribute& rFillFloatTransGradient);
+ SdrLineFillShadowAttribute3D();
- // copy constructor and assigment operator
- SdrLineFillShadowAttribute(const SdrLineFillShadowAttribute& rCandidate);
- SdrLineFillShadowAttribute& operator=(const SdrLineFillShadowAttribute& rCandidate);
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
// compare operator
- bool operator==(const SdrLineFillShadowAttribute& rCandidate) const;
-
- // bool access
- bool isVisible() const { return (mpFill || mpLine); }
+ bool operator==(const SdrLineFillShadowAttribute3D& rCandidate) const;
- // 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; }
+ // data read access
+ const SdrLineAttribute& getLine() const { return maLine; }
+ const SdrFillAttribute& getFill() const { return maFill; }
+ const SdrLineStartEndAttribute& getLineStartEnd() const { return maLineStartEnd; }
+ const SdrShadowAttribute& getShadow() const { return maShadow; }
+ const FillGradientAttribute& getFillFloatTransGradient() const { return maFillFloatTransGradient; }
};
} // end of namespace overlay
} // end of namespace drawinglayer
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrattribute.hxx
deleted file mode 100644
index a22d453c1657..000000000000
--- a/drawinglayer/inc/drawinglayer/attribute/sdrattribute.hxx
+++ /dev/null
@@ -1,223 +0,0 @@
-/*************************************************************************
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: sdrattribute.hxx,v $
- *
- * $Revision: 1.4 $
- *
- * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
- *
- * 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_ATTRIBUTE_SDRATTRIBUTE_HXX
-#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX
-
-#include <basegfx/polygon/b2dlinegeometry.hxx>
-#include <basegfx/color/bcolor.hxx>
-#include <vector>
-#include <basegfx/vector/b2dvector.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-// predefines
-class SdrTextObj;
-
-namespace drawinglayer { namespace attribute {
- class SdrFillBitmapAttribute;
- class FillHatchAttribute;
- class FillGradientAttribute;
-}}
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class SdrLineAttribute
- {
- // line definitions
- basegfx::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
- ::std::vector< double > maDotDashArray; // array of double which defines the dot-dash pattern
- double mfFullDotDashLen; // sum of maDotDashArray (for convenience)
-
- public:
- SdrLineAttribute(
- basegfx::B2DLineJoin eJoin, double fWidth, double fTransparence, const basegfx::BColor& rColor,
- const ::std::vector< double >& rDotDashArray, double fFullDotDashLen);
- ~SdrLineAttribute();
-
- // constructor to create a line attribute for a colored hairline
- SdrLineAttribute(const basegfx::BColor& rColor);
-
- // compare operator
- bool operator==(const SdrLineAttribute& rCandidate) const;
-
- // bool access
- bool isVisible() const { return (1.0 != mfTransparence); }
- bool isDashed() const { return (0L != maDotDashArray.size()); }
-
- // data access
- basegfx::B2DLineJoin getJoin() const { return meJoin; }
- double getWidth() const { return mfWidth; }
- double getTransparence() const { return mfTransparence; }
- const basegfx::BColor& getColor() const { return maColor; }
- const ::std::vector< double >& getDotDashArray() const { return maDotDashArray; }
- double getFullDotDashLen() const { return mfFullDotDashLen; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class SdrLineStartEndAttribute
- {
- // line arrow definitions
- basegfx::B2DPolyPolygon maStartPolyPolygon; // start Line PolyPolygon
- basegfx::B2DPolyPolygon maEndPolyPolygon; // end Line PolyPolygon
- double mfStartWidth; // 1/100th mm
- double mfEndWidth; // 1/100th mm
-
- // bitfield
- unsigned mbStartActive : 1L; // start of Line is active
- unsigned mbEndActive : 1L; // end of Line is active
- unsigned mbStartCentered : 1L; // Line is centered on line start point
- unsigned mbEndCentered : 1L; // Line is centered on line end point
-
- public:
- SdrLineStartEndAttribute(
- const basegfx::B2DPolyPolygon& rStartPolyPolygon, const basegfx::B2DPolyPolygon& rEndPolyPolygon,
- double fStartWidth, double fEndWidth, bool bStartActive, bool bEndActive, bool bStartCentered, bool bEndCentered);
- ~SdrLineStartEndAttribute();
-
- // compare operator
- bool operator==(const SdrLineStartEndAttribute& rCandidate) const;
-
- // bool access
- bool isStartActive() const { return mbStartActive; }
- bool isEndActive() const { return mbEndActive; }
- bool isStartCentered() const { return mbStartCentered; }
- bool isEndCentered() const { return mbEndCentered; }
- bool isVisible() const { return (isStartActive() || isEndActive()); }
-
- // data access
- const basegfx::B2DPolyPolygon& getStartPolyPolygon() const { return maStartPolyPolygon; }
- const basegfx::B2DPolyPolygon& getEndPolyPolygon() const { return maEndPolyPolygon; }
- double getStartWidth() const { return mfStartWidth; }
- double getEndWidth() const { return mfEndWidth; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class SdrShadowAttribute
- {
- // shadow definitions
- basegfx::B2DVector maOffset; // shadow offset 1/100th mm
- double mfTransparence; // [0.0 .. 1.0], 0.0==no transp.
- basegfx::BColor maColor; // color of shadow
-
- public:
- SdrShadowAttribute(
- const basegfx::B2DVector& rOffset, double fTransparence, const basegfx::BColor& rColor);
- ~SdrShadowAttribute();
-
- // compare operator
- bool operator==(const SdrShadowAttribute& rCandidate) const;
-
- // bool access
- bool isVisible() const { return (1.0 != mfTransparence); }
-
- // data access
- const basegfx::B2DVector& getOffset() const { return maOffset; }
- double getTransparence() const { return mfTransparence; }
- const basegfx::BColor& getColor() const { return maColor; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- 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)
-
- public:
- 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);
-
- // compare operator
- bool operator==(const SdrFillAttribute& rCandidate) const;
-
- // bool access
- bool isGradient() const { return (0L != mpGradient); }
- bool isHatch() const { return (0L != mpHatch); }
- bool isBitmap() const { return (0L != mpBitmap); }
- bool isColor() const { return (!mpGradient && !mpHatch && !mpBitmap); }
- bool isVisible() const { return (1.0 != mfTransparence); }
-
- // 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; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX
-
-// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx
deleted file mode 100644
index fd72f09c00f1..000000000000
--- a/drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx
+++ /dev/null
@@ -1,217 +0,0 @@
-/*************************************************************************
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: sdrattribute3d.hxx,v $
- *
- * $Revision: 1.4 $
- *
- * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
- *
- * 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_ATTRIBUTE_SDRATTRIBUTE3D_HXX
-#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX
-
-#include <basegfx/vector/b2dvector.hxx>
-#include <com/sun/star/drawing/NormalsKind.hpp>
-#include <com/sun/star/drawing/TextureProjectionMode.hpp>
-#include <com/sun/star/drawing/ProjectionMode.hpp>
-#include <com/sun/star/drawing/TextureKind2.hpp>
-#include <com/sun/star/drawing/TextureMode.hpp>
-#include <basegfx/vector/b3dvector.hxx>
-#include <com/sun/star/drawing/ShadeMode.hpp>
-#include <basegfx/color/bcolor.hxx>
-#include <drawinglayer/attribute/materialattribute3d.hxx>
-#include <vector>
-
-//////////////////////////////////////////////////////////////////////////////
-// predefines
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class Sdr3DObjectAttribute
- {
- // 3D object attribute definitions
- ::com::sun::star::drawing::NormalsKind maNormalsKind; // normals type (0..2)
- ::com::sun::star::drawing::TextureProjectionMode maTextureProjectionX; // texture projection type X (0..2)
- ::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
-
- // bitfield
- unsigned mbNormalsInvert : 1; // invert normals
- unsigned mbDoubleSided : 1; // surfaces are double sided
- unsigned mbShadow3D : 1; // display shadow in 3D (if on), params for that are at scene
- unsigned mbTextureFilter : 1; // filter texture to make more smooth
- unsigned mbReducedLineGeometry : 1; // use reduced line geometry (object specific)
-
- public:
- 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,
- bool bNormalsInvert,
- bool bDoubleSided,
- bool bShadow3D,
- bool bTextureFilter,
- bool bReducedLineGeometry);
-
- // compare operator
- bool operator==(const Sdr3DObjectAttribute& rCandidate) const;
-
- // data access
- ::com::sun::star::drawing::NormalsKind getNormalsKind() const { return maNormalsKind; }
- ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionX() const { return maTextureProjectionX; }
- ::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; }
- bool getNormalsInvert() const { return mbNormalsInvert; }
- bool getDoubleSided() const { return mbDoubleSided; }
- bool getShadow3D() const { return mbShadow3D; }
- bool getTextureFilter() const { return mbTextureFilter; }
- bool getReducedLineGeometry() const { return mbReducedLineGeometry; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class Sdr3DLightAttribute
- {
- // 3D light attribute definitions
- basegfx::BColor maColor;
- basegfx::B3DVector maDirection;
-
- // bitfield
- unsigned mbSpecular : 1;
-
- public:
- Sdr3DLightAttribute(
- const basegfx::BColor& rColor,
- const basegfx::B3DVector& rDirection,
- bool bSpecular);
-
- // compare operator
- bool operator==(const Sdr3DLightAttribute& rCandidate) const;
-
- // data access
- const basegfx::BColor& getColor() const { return maColor; }
- const basegfx::B3DVector& getDirection() const { return maDirection; }
- bool getSpecular() const { return mbSpecular; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class SdrLightingAttribute
- {
- // 3D light attribute definitions
- basegfx::BColor maAmbientLight;
- ::std::vector< Sdr3DLightAttribute > maLightVector;
-
- public:
- SdrLightingAttribute(
- const basegfx::BColor& rAmbientLight,
- const ::std::vector< Sdr3DLightAttribute >& rLightVector);
-
- // compare operator
- bool operator==(const SdrLightingAttribute& rCandidate) const;
-
- // data access
- const basegfx::BColor& getAmbientLight() const { return maAmbientLight; }
- const ::std::vector< Sdr3DLightAttribute >& getLightVector() const { return maLightVector; }
-
- // color model solver
- basegfx::BColor solveColorModel(
- const basegfx::B3DVector& rNormalInEyeCoordinates,
- const basegfx::BColor& rColor, const basegfx::BColor& rSpecular,
- const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity) const;
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class SdrSceneAttribute
- {
- // 3D scene attribute definitions
- double mfDistance;
- double mfShadowSlant;
- ::com::sun::star::drawing::ProjectionMode maProjectionMode;
- ::com::sun::star::drawing::ShadeMode maShadeMode;
-
- // bitfield
- unsigned mbTwoSidedLighting : 1;
-
- public:
- SdrSceneAttribute(
- double fDistance,
- double fShadowSlant,
- ::com::sun::star::drawing::ProjectionMode aProjectionMode,
- ::com::sun::star::drawing::ShadeMode aShadeMode,
- bool bTwoSidedLighting);
-
- // compare operator
- bool operator==(const SdrSceneAttribute& rCandidate) const;
-
- // data access
- double getDistance() const { return mfDistance; }
- double getShadowSlant() const { return mfShadowSlant; }
- ::com::sun::star::drawing::ProjectionMode getProjectionMode() const { return maProjectionMode; }
- ::com::sun::star::drawing::ShadeMode getShadeMode() const { return maShadeMode; }
- bool getTwoSidedLighting() const { return mbTwoSidedLighting; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX
-
-// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrfillattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrfillattribute.hxx
new file mode 100644
index 000000000000..6ae2084d1d30
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrfillattribute.hxx
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * 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_ATTRIBUTE_SDRFILLATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLATTRIBUTE_HXX
+
+#include <sal/types.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrFillAttribute;
+ class FillGradientAttribute;
+ class FillHatchAttribute;
+ class SdrFillBitmapAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrFillAttribute
+ {
+ private:
+ ImpSdrFillAttribute* mpSdrFillAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrFillAttribute(
+ double fTransparence,
+ const basegfx::BColor& rColor,
+ const FillGradientAttribute& rGradient,
+ const FillHatchAttribute& rHatch,
+ const SdrFillBitmapAttribute& rBitmap);
+ SdrFillAttribute();
+ SdrFillAttribute(const SdrFillAttribute& rCandidate);
+ SdrFillAttribute& operator=(const SdrFillAttribute& rCandidate);
+ ~SdrFillAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrFillAttribute& rCandidate) const;
+
+ // data read access
+ double getTransparence() const;
+ const basegfx::BColor& getColor() const;
+ const FillGradientAttribute& getGradient() const;
+ const FillHatchAttribute& getHatch() const;
+ const SdrFillBitmapAttribute& getBitmap() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLATTRIBUTE_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx
index 67fef6ea7e3d..ce9d9e23a086 100644
--- a/drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx
@@ -36,21 +36,23 @@
#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX
-#include <vcl/bitmap.hxx>
-#include <basegfx/vector/b2dvector.hxx>
+#include <sal/types.h>
//////////////////////////////////////////////////////////////////////////////
// predefines
-class SfxItemSet;
-namespace drawinglayer { namespace attribute {
- class FillBitmapAttribute;
-}}
+class Bitmap;
namespace basegfx {
class B2DRange;
+ class B2DVector;
}
+namespace drawinglayer { namespace attribute {
+ class FillBitmapAttribute;
+ class ImpSdrFillBitmapAttribute;
+}}
+
//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
@@ -59,27 +61,42 @@ namespace drawinglayer
{
class SdrFillBitmapAttribute
{
- Bitmap maBitmap;
- basegfx::B2DVector maSize;
- basegfx::B2DVector maOffset;
- basegfx::B2DVector maOffsetPosition;
- basegfx::B2DVector maRectPoint;
-
- // bitfield
- unsigned mbTiling : 1;
- unsigned mbStretch : 1;
- unsigned mbLogSize : 1;
+ private:
+ ImpSdrFillBitmapAttribute* mpSdrFillBitmapAttribute;
public:
+ /// constructors/assignmentoperator/destructor
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);
+ 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);
+ SdrFillBitmapAttribute();
+ SdrFillBitmapAttribute(const SdrFillBitmapAttribute& rCandidate);
+ SdrFillBitmapAttribute& operator=(const SdrFillBitmapAttribute& rCandidate);
+ ~SdrFillBitmapAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
bool operator==(const SdrFillBitmapAttribute& rCandidate) const;
- // data access
- const Bitmap& getBitmap() const { return maBitmap; }
- bool getTiling() const { return mbTiling; }
+ // data read access
+ const Bitmap& getBitmap() const;
+ const basegfx::B2DVector& getSize() const;
+ const basegfx::B2DVector& getOffset() const;
+ const basegfx::B2DVector& getOffsetPosition() const;
+ const basegfx::B2DVector& getRectPoint() const;
+ bool getTiling() const;
+ bool getStretch() const;
+ bool getLogSize() const;
+
+ // FillBitmapAttribute generator
FillBitmapAttribute getFillBitmapAttribute(const basegfx::B2DRange& rRange) const;
};
} // end of namespace attribute
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrlightattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrlightattribute3d.hxx
new file mode 100644
index 000000000000..aad8c6ff62ec
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrlightattribute3d.hxx
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute3d.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * 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_ATTRIBUTE_SDRLIGHTATTRIBUTE3D_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTATTRIBUTE3D_HXX
+
+#include <sal/types.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+ class B3DVector;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdr3DLightAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class Sdr3DLightAttribute
+ {
+ private:
+ ImpSdr3DLightAttribute* mpSdr3DLightAttribute;
+
+ public:
+ // constructors/destructor
+ Sdr3DLightAttribute(
+ const basegfx::BColor& rColor,
+ const basegfx::B3DVector& rDirection,
+ bool bSpecular);
+ Sdr3DLightAttribute(const basegfx::BColor& rColor);
+ Sdr3DLightAttribute();
+ Sdr3DLightAttribute(const Sdr3DLightAttribute& rCandidate);
+ ~Sdr3DLightAttribute();
+
+ // assignment operator
+ Sdr3DLightAttribute& operator=(const Sdr3DLightAttribute& rCandidate);
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const Sdr3DLightAttribute& rCandidate) const;
+
+ // data read access
+ const basegfx::BColor& getColor() const;
+ const basegfx::B3DVector& getDirection() const;
+ bool getSpecular() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTATTRIBUTE3D_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrlightingattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrlightingattribute3d.hxx
new file mode 100644
index 000000000000..b4c84d7cc1b0
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrlightingattribute3d.hxx
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute3d.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * 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_ATTRIBUTE_SDRLIGHTINGATTRIBUTE3D_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTINGATTRIBUTE3D_HXX
+
+#include <sal/types.h>
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+ class B3DVector;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrLightingAttribute;
+ class Sdr3DLightAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrLightingAttribute
+ {
+ private:
+ ImpSdrLightingAttribute* mpSdrLightingAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrLightingAttribute(
+ const basegfx::BColor& rAmbientLight,
+ const ::std::vector< Sdr3DLightAttribute >& rLightVector);
+ SdrLightingAttribute();
+ SdrLightingAttribute(const SdrLightingAttribute& rCandidate);
+ SdrLightingAttribute& operator=(const SdrLightingAttribute& rCandidate);
+ ~SdrLightingAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrLightingAttribute& rCandidate) const;
+
+ // data read access
+ const basegfx::BColor& getAmbientLight() const;
+ const ::std::vector< Sdr3DLightAttribute >& getLightVector() const;
+
+ // color model solver
+ basegfx::BColor solveColorModel(
+ const basegfx::B3DVector& rNormalInEyeCoordinates,
+ const basegfx::BColor& rColor, const basegfx::BColor& rSpecular,
+ const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity) const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTINGATTRIBUTE3D_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrlineattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrlineattribute.hxx
new file mode 100644
index 000000000000..5df511995e9f
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrlineattribute.hxx
@@ -0,0 +1,104 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * 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_ATTRIBUTE_SDRLINEATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINEATTRIBUTE_HXX
+
+#include <sal/types.h>
+#include <basegfx/vector/b2enums.hxx>
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrLineAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrLineAttribute
+ {
+ private:
+ ImpSdrLineAttribute* mpSdrLineAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrLineAttribute(
+ basegfx::B2DLineJoin eJoin,
+ double fWidth,
+ double fTransparence,
+ const basegfx::BColor& rColor,
+ const ::std::vector< double >& rDotDashArray,
+ double fFullDotDashLen);
+ SdrLineAttribute(const basegfx::BColor& rColor);
+ SdrLineAttribute();
+ SdrLineAttribute(const SdrLineAttribute& rCandidate);
+ SdrLineAttribute& operator=(const SdrLineAttribute& rCandidate);
+ ~SdrLineAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrLineAttribute& rCandidate) const;
+
+ // data access
+ basegfx::B2DLineJoin getJoin() const;
+ double getWidth() const;
+ double getTransparence() const;
+ const basegfx::BColor& getColor() const;
+ const ::std::vector< double >& getDotDashArray() const;
+ double getFullDotDashLen() const;
+
+ // bool access
+ bool isDashed() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINEATTRIBUTE_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrlinestartendattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrlinestartendattribute.hxx
new file mode 100644
index 000000000000..76bd836ac770
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrlinestartendattribute.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * 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_ATTRIBUTE_SDRLINESTARTENDATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINESTARTENDATTRIBUTE_HXX
+
+#include <sal/types.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class B2DPolyPolygon;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrLineStartEndAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrLineStartEndAttribute
+ {
+ private:
+ ImpSdrLineStartEndAttribute* mpSdrLineStartEndAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrLineStartEndAttribute(
+ const basegfx::B2DPolyPolygon& rStartPolyPolygon,
+ const basegfx::B2DPolyPolygon& rEndPolyPolygon,
+ double fStartWidth,
+ double fEndWidth,
+ bool bStartActive,
+ bool bEndActive,
+ bool bStartCentered,
+ bool bEndCentered);
+ SdrLineStartEndAttribute();
+ SdrLineStartEndAttribute(const SdrLineStartEndAttribute& rCandidate);
+ SdrLineStartEndAttribute& operator=(const SdrLineStartEndAttribute& rCandidate);
+ ~SdrLineStartEndAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrLineStartEndAttribute& rCandidate) const;
+
+ // data read access
+ const basegfx::B2DPolyPolygon& getStartPolyPolygon() const;
+ const basegfx::B2DPolyPolygon& getEndPolyPolygon() const;
+ double getStartWidth() const;
+ double getEndWidth() const;
+ bool isStartActive() const;
+ bool isEndActive() const;
+ bool isStartCentered() const;
+ bool isEndCentered() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINESTARTENDATTRIBUTE_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrobjectattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrobjectattribute3d.hxx
new file mode 100644
index 000000000000..d5ee84e8cfec
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrobjectattribute3d.hxx
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute3d.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * 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_ATTRIBUTE_SDROBJECTATTRIBUTE3D_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDROBJECTATTRIBUTE3D_HXX
+
+#include <sal/types.h>
+#include <com/sun/star/drawing/NormalsKind.hpp>
+#include <com/sun/star/drawing/TextureProjectionMode.hpp>
+#include <com/sun/star/drawing/TextureKind2.hpp>
+#include <com/sun/star/drawing/TextureMode.hpp>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdr3DObjectAttribute;
+ class MaterialAttribute3D;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class Sdr3DObjectAttribute
+ {
+ private:
+ ImpSdr3DObjectAttribute* mpSdr3DObjectAttribute;
+
+ public:
+ // constructors/destructor
+ 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,
+ bool bNormalsInvert,
+ bool bDoubleSided,
+ bool bShadow3D,
+ bool bTextureFilter,
+ bool bReducedLineGeometry);
+ Sdr3DObjectAttribute();
+ Sdr3DObjectAttribute(const Sdr3DObjectAttribute& rCandidate);
+ ~Sdr3DObjectAttribute();
+
+ // assignment operator
+ Sdr3DObjectAttribute& operator=(const Sdr3DObjectAttribute& rCandidate);
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const Sdr3DObjectAttribute& rCandidate) const;
+
+ // data read access
+ ::com::sun::star::drawing::NormalsKind getNormalsKind() const;
+ ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionX() const;
+ ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionY() const;
+ ::com::sun::star::drawing::TextureKind2 getTextureKind() const;
+ ::com::sun::star::drawing::TextureMode getTextureMode() const;
+ const MaterialAttribute3D& getMaterial() const;
+ bool getNormalsInvert() const;
+ bool getDoubleSided() const;
+ bool getShadow3D() const;
+ bool getTextureFilter() const;
+ bool getReducedLineGeometry() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDROBJECTATTRIBUTE3D_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrsceneattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrsceneattribute3d.hxx
new file mode 100644
index 000000000000..7b25b6c48666
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrsceneattribute3d.hxx
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute3d.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * 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_ATTRIBUTE_SDRSCENEATTRIBUTE3D_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSCENEATTRIBUTE3D_HXX
+
+#include <sal/types.h>
+#include <com/sun/star/drawing/ProjectionMode.hpp>
+#include <com/sun/star/drawing/ShadeMode.hpp>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrSceneAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrSceneAttribute
+ {
+ private:
+ ImpSdrSceneAttribute* mpSdrSceneAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrSceneAttribute(
+ double fDistance,
+ double fShadowSlant,
+ ::com::sun::star::drawing::ProjectionMode aProjectionMode,
+ ::com::sun::star::drawing::ShadeMode aShadeMode,
+ bool bTwoSidedLighting);
+ SdrSceneAttribute();
+ SdrSceneAttribute(const SdrSceneAttribute& rCandidate);
+ SdrSceneAttribute& operator=(const SdrSceneAttribute& rCandidate);
+ ~SdrSceneAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrSceneAttribute& rCandidate) const;
+
+ // data read access
+ double getDistance() const;
+ double getShadowSlant() const;
+ ::com::sun::star::drawing::ProjectionMode getProjectionMode() const;
+ ::com::sun::star::drawing::ShadeMode getShadeMode() const;
+ bool getTwoSidedLighting() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSCENEATTRIBUTE3D_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrshadowattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrshadowattribute.hxx
new file mode 100644
index 000000000000..72bdcd2af2c2
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrshadowattribute.hxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * 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_ATTRIBUTE_SDRSHADOWATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSHADOWATTRIBUTE_HXX
+
+#include <sal/types.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+ class B2DVector;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrShadowAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrShadowAttribute
+ {
+ private:
+ ImpSdrShadowAttribute* mpSdrShadowAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrShadowAttribute(
+ const basegfx::B2DVector& rOffset,
+ double fTransparence,
+ const basegfx::BColor& rColor);
+ SdrShadowAttribute();
+ SdrShadowAttribute(const SdrShadowAttribute& rCandidate);
+ SdrShadowAttribute& operator=(const SdrShadowAttribute& rCandidate);
+ ~SdrShadowAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrShadowAttribute& rCandidate) const;
+
+ // data access
+ const basegfx::B2DVector& getOffset() const;
+ double getTransparence() const;
+ const basegfx::BColor& getColor() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSHADOWATTRIBUTE_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx
index efe59d1eb9e5..e24ad09d3d6a 100644
--- a/drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx
@@ -36,13 +36,16 @@
#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX
-#include <basegfx/polygon/b2dlinegeometry.hxx>
-#include <basegfx/color/bcolor.hxx>
+#include <sal/types.h>
#include <vector>
//////////////////////////////////////////////////////////////////////////////
// predefines
+namespace drawinglayer { namespace attribute {
+ class ImpStrokeAttribute;
+}}
+
//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
@@ -52,49 +55,26 @@ namespace drawinglayer
class StrokeAttribute
{
private:
- ::std::vector< double > maDotDashArray; // array of double which defines the dot-dash pattern
- double mfFullDotDashLen; // sum of maDotDashArray (for convenience)
+ ImpStrokeAttribute* mpStrokeAttribute;
public:
+ /// constructors/assignmentoperator/destructor
StrokeAttribute(
const ::std::vector< double >& rDotDashArray,
- double fFullDotDashLen = 0.0)
- : maDotDashArray(rDotDashArray),
- mfFullDotDashLen(fFullDotDashLen)
- {
- }
-
- StrokeAttribute()
- : maDotDashArray(),
- mfFullDotDashLen(0.0)
- {
- }
-
- StrokeAttribute(const StrokeAttribute& rCandidate)
- {
- *this = rCandidate;
- }
-
- StrokeAttribute& operator=(const StrokeAttribute& rCandidate)
- {
- maDotDashArray = rCandidate.maDotDashArray;
- mfFullDotDashLen = rCandidate.mfFullDotDashLen;
- return *this;
- }
+ double fFullDotDashLen = 0.0);
+ StrokeAttribute();
+ StrokeAttribute(const StrokeAttribute& rCandidate);
+ StrokeAttribute& operator=(const StrokeAttribute& rCandidate);
+ ~StrokeAttribute();
- ~StrokeAttribute()
- {
- }
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
// compare operator
- bool operator==(const StrokeAttribute& rCandidate) const
- {
- return (mfFullDotDashLen == rCandidate.mfFullDotDashLen
- && maDotDashArray == rCandidate.maDotDashArray);
- }
+ bool operator==(const StrokeAttribute& rCandidate) const;
- // data access
- const ::std::vector< double >& getDotDashArray() const { return maDotDashArray; }
+ // data read access
+ const ::std::vector< double >& getDotDashArray() const;
double getFullDotDashLen() const;
};
} // end of namespace attribute
diff --git a/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx b/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx
index 0a87b268c8b1..c7cd87df6ffd 100644
--- a/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx
+++ b/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx
@@ -122,12 +122,18 @@ namespace drawinglayer
*/
ViewInformation2D(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters);
+ /// default (empty) constructor
+ ViewInformation2D();
+
/// copy constructor
ViewInformation2D(const ViewInformation2D& rCandidate);
/// destructor
~ViewInformation2D();
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
/// assignment operator
ViewInformation2D& operator=(const ViewInformation2D& rCandidate);
diff --git a/drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx b/drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx
index 605c26733cf3..a76ee2e21226 100644
--- a/drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx
+++ b/drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx
@@ -127,12 +127,18 @@ namespace drawinglayer
*/
ViewInformation3D(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters);
+ /// default (empty) constructor
+ ViewInformation3D();
+
/// copy constructor
ViewInformation3D(const ViewInformation3D& rCandidate);
/// destructor
~ViewInformation3D();
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
/// assignment operator
ViewInformation3D& operator=(const ViewInformation3D& rCandidate);
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx
index 6cf45ffefe54..254d535f9060 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx
@@ -110,14 +110,16 @@ namespace drawinglayer
Current Basic 2D Primitives are:
- - BitmapPrimitive2D (bitmap data, evtl. with alpha)
- - MetafilePrimitive2D (VCL Metafile, currently no decomposition, but planned, so may vanish)
+ - BitmapPrimitive2D (bitmap data, evtl. with transparence)
- PointArrayPrimitive2D (single points)
- PolygonHairlinePrimitive2D (hairline curves/polygons)
- PolyPolygonColorPrimitive2D (colored polygons)
+ UPDATE: MetafilePrimitive2D (VCL Metafile) is taken off this list since
+ it is implemented with the integration of CWS aw078 into DV300m69.
+
All other implemented primitives have a defined decomposition and can thus be
- decomposed downt to this small set.
+ decomposed down to this small set.
A renderer implementing support for this minimal set of primitives can completely
render primitive-based visualisations. Of course, he also has to take states into account
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
index d287482389b5..88848207dae4 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
@@ -48,7 +48,7 @@
//////////////////////////////////////////////////////////////////////////////
// local primitives
-#define PRIMITIVE2D_ID_ALPHAPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 0)
+#define PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 0)
#define PRIMITIVE2D_ID_ANIMATEDSWITCHPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 1)
#define PRIMITIVE2D_ID_ANIMATEDBLINKPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 2)
#define PRIMITIVE2D_ID_ANIMATEDINTERPOLATEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 3)
@@ -83,7 +83,7 @@
#define PRIMITIVE2D_ID_TEXTSIMPLEPORTIONPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 32)
#define PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 33)
#define PRIMITIVE2D_ID_TRANSFORMPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 34)
-#define PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 35)
+#define PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 35)
#define PRIMITIVE2D_ID_POINTARRAYPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 36)
#define PRIMITIVE2D_ID_TEXTHIERARCHYFIELDPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 37)
#define PRIMITIVE2D_ID_TEXTHIERARCHYLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 38)
@@ -101,14 +101,14 @@
#define PRIMITIVE2D_ID_STRUCTURETAGRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 50)
#define PRIMITIVE2D_ID_BORDERLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 51)
#define PRIMITIVE2D_ID_POLYPOLYGONMARKERPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 52)
-#define PRIMITIVE2D_ID_HITTESTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 53)
-#define PRIMITIVE2D_ID_INVERTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 54)
-#define PRIMITIVE2D_ID_DISCRETEBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 55)
-#define PRIMITIVE2D_ID_WALLPAPERBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 56)
-#define PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 57)
-#define PRIMITIVE2D_ID_TEXTCHARACTERSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 58)
-#define PRIMITIVE2D_ID_TEXTGEOMETRYSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 59)
-#define PRIMITIVE2D_ID_EPSPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 60)
+#define PRIMITIVE2D_ID_INVERTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 53)
+#define PRIMITIVE2D_ID_DISCRETEBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 54)
+#define PRIMITIVE2D_ID_WALLPAPERBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 55)
+#define PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 56)
+#define PRIMITIVE2D_ID_TEXTCHARACTERSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 57)
+#define PRIMITIVE2D_ID_TEXTGEOMETRYSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 58)
+#define PRIMITIVE2D_ID_EPSPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 59)
+#define PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 60)
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
index 0fd084c6fad0..0c6a28f29b41 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
@@ -37,7 +37,7 @@
#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLGRADIENTPRIMITIVE2D_HXX
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
index 1df3bb103eb0..a6640d67b877 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
@@ -37,7 +37,8 @@
#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLHATCHPRIMITIVE2D_HXX
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
+#include <drawinglayer/attribute/fillhatchattribute.hxx>
+#include <basegfx/color/bcolor.hxx>
//////////////////////////////////////////////////////////////////////////////
// FillHatchPrimitive2D class
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx
index 4ba83fc75c88..2dee07dd6de9 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx
@@ -74,7 +74,7 @@ namespace drawinglayer
/// Grid color for single-pixel grid points
basegfx::BColor maBColor;
- /// The Bitmap (with alpha) for grid cross points
+ /// The Bitmap (with transparence) for grid cross points
BitmapEx maCrossMarker;
/** the last used object to view transformtion and the last Viewport,
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx
index 89b49420a3e7..0fe7c1903815 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx
@@ -71,7 +71,7 @@ namespace drawinglayer
Current Basic 2D StatePrimitives are:
- - AlphaPrimitive2D (objects with freely defined transparence)
+ - TransparencePrimitive2D (objects with freely defined transparence)
- InvertPrimitive2D (for XOR)
- MaskPrimitive2D (for masking)
- ModifiedColorPrimitive2D (for a stack of color modifications)
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx
index 3b69c685c985..08ddd8237688 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx
@@ -33,8 +33,8 @@
*
************************************************************************/
-#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HITTESTPRIMITIVE2D_HXX
-#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HITTESTPRIMITIVE2D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HIDDENGEOMETRYPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HIDDENGEOMETRYPRIMITIVE2D_HXX
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
@@ -44,35 +44,28 @@ namespace drawinglayer
{
namespace primitive2d
{
- /** HitTestPrimitive2D class
-
- This primitive is used to represent geometry for non-visible objects,
- e.g. a PresObj's outline. To still be able to use primitives for HitTest
- functionality, the 2d decompositions will produce an as much as possible
- simplified line geometry encapsulated in this primtive when there is no
- line geometry. In a further enchanced version this may change to 'if neither
- filled nor lines' creation criteria. The whole primitive decomposes to nothing,
- so no one not knowing it will be influenced. Only helper processors for hit test
- (and maybe BoundRect extractors) will use it and it's children subcontent.
- */
- class HitTestPrimitive2D : public GroupPrimitive2D
+ // This primitive is used to represent geometry for non-visible objects,
+ // e.g. a PresObj's outline. To still be able to use primitives for HitTest
+ // functionality, the 2d decompositions will produce an as much as possible
+ // simplified line geometry encapsulated in this primtive when there is no
+ // line geometry. In a further enchanced version this may change to 'if neither
+ // filled nor lines' creation criteria. The whole primitive decomposes to nothing,
+ // so no one not knowing it will be influenced. Only helper processors for hit test
+ // (and maybe BoundRect extractors) will use it and it's children subcontent.
+ class HiddenGeometryPrimitive2D : public GroupPrimitive2D
{
public:
- /// constructor
- HitTestPrimitive2D(const Primitive2DSequence& rChildren);
+ HiddenGeometryPrimitive2D(const Primitive2DSequence& rChildren);
- /** despite returning an empty decomposition since it's no visualisation data,
- range calculation is intended to use invisible replacement geometry, so
- the local implementation will return the children's range
- */
+ // despite returning an empty decomposition since it's no visualisation data,
+ // range calculation is intended to use hidden geometry, so
+ // the local implementation will return the children's range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- /** local decomposition. Implementation will return empty Primitive2DSequence
- since this is no visualisation data
- */
+ /// local decomposition. Implementation will return empty Primitive2DSequence
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
- /// provide unique ID
+ // provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -80,7 +73,7 @@ namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
-#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HITTESTPRIMITIVE2D_HXX
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HIDDENGEOMETRYPRIMITIVE2D_HXX
//////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx
index 85f1c6510c5a..b7c47268dd5d 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx
@@ -2,7 +2,7 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: unifiedalphaprimitive2d.hxx,v $
+ * $RCSfile: UnifiedTransparencePrimitive2D.hxx,v $
*
* $Revision: 1.3 $
*
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx
index cc4c054f8bb3..0e525ef691d3 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx
@@ -55,7 +55,7 @@ namespace drawinglayer
invariant, so that the bitmap is always visualized unscaled and
unrotated.
It is used e.g. for grid position visualisation. The given Bitmap
- (with alpha) is defined to be visible centered at each of the given
+ (with transparence) is defined to be visible centered at each of the given
positions.
It decomposes to the needed number of BitmapPrimitive2D's, so it would
be efficient to handle it directly in a renderer.
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx
index 0cbd7e4628cb..0f25ce069021 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx
@@ -47,7 +47,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- /** MediaPrimitive2D class
+ /** MetafilePrimitive2D class
This is the MetaFile representing primitive. It's geometry is defined
by MetaFileTransform. The content (defined by MetaFile) will be scaled
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx
index 4c6f5b49bf01..2ffa1b01e243 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx
@@ -41,6 +41,8 @@
#include <drawinglayer/attribute/strokeattribute.hxx>
#include <drawinglayer/attribute/linestartendattribute.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/color/bcolor.hxx>
//////////////////////////////////////////////////////////////////////////////
// PolygonHairlinePrimitive2D class
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
index 187e89f42e97..07e6849ff1fc 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
@@ -37,12 +37,14 @@
#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/attribute/fillbitmapattribute.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <drawinglayer/attribute/lineattribute.hxx>
#include <drawinglayer/attribute/strokeattribute.hxx>
#include <drawinglayer/attribute/linestartendattribute.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+#include <drawinglayer/attribute/fillhatchattribute.hxx>
+#include <basegfx/color/bcolor.hxx>
//////////////////////////////////////////////////////////////////////////////
// PolyPolygonHairlinePrimitive2D class
@@ -409,7 +411,7 @@ namespace drawinglayer
/** PolyPolygonBitmapPrimitive2D class
This primitive defines a PolyPolygon filled with bitmap data
- (including alpha). The decomosition will create a MaskPrimitive2D
+ (including transparence). The decomosition will create a MaskPrimitive2D
containing a FillBitmapPrimitive2D.
*/
class PolyPolygonBitmapPrimitive2D : public BufferedDecompositionPrimitive2D
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
index 65d2bdf67f92..96d58cc0ca10 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
@@ -38,10 +38,12 @@
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <drawinglayer/geometry/viewinformation3d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <vcl/bitmapex.hxx>
+#include <drawinglayer/attribute/sdrsceneattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightattribute3d.hxx>
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/sdrdecompositiontools2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/sdrdecompositiontools2d.hxx
new file mode 100644
index 000000000000..e27a3b2b7725
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/sdrdecompositiontools2d.hxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrdecompositiontools3d.hxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:18 $
+ *
+ * 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_SDRDECOMPOSITIONTOOLS2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SDRDECOMPOSITIONTOOLS2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class B2DPolyPolygon;
+ class B2DHomMatrix;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ // helpers to create HitTestPrimitives Line
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DHomMatrix& rMatrix);
+
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DPolyPolygon& rPolygon);
+
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DRange& rRange);
+
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DRange& rRange,
+ const basegfx::B2DHomMatrix& rMatrix);
+
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DPolyPolygon& rPolygon,
+ const basegfx::B2DHomMatrix& rMatrix);
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SDRDECOMPOSITIONTOOLS2D_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/transparenceprimitive2d.hxx
index 10288b70bd1b..85032d0bd202 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/transparenceprimitive2d.hxx
@@ -33,8 +33,8 @@
*
************************************************************************/
-#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_ALPHAPRIMITIVE2D_HXX
-#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_ALPHAPRIMITIVE2D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSPARENCEPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSPARENCEPRIMITIVE2D_HXX
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
@@ -44,28 +44,28 @@ namespace drawinglayer
{
namespace primitive2d
{
- /** AlphaPrimitive2D class
+ /** TransparencePrimitive2D class
This is the basic primitive for applying freely defined transparence
to freely defined content. The basic idea is to associate a content
which is defined as a sequence of primitives and hold as child content
- in the GroupPrimitive2D with an alpha channel also defined as a sequence
- of primitives and hold in the Alpha member.
+ in the GroupPrimitive2D with a transparence channel also defined as a sequence
+ of primitives and hold in the transparence member.
- The basic definition is to use the Alpha content as Alpha-Mask by
- interpreting the Alpha-content not as RGB, but as Luminance alpha mask
+ The basic definition is to use the transparence content as transparence-Mask by
+ interpreting the transparence-content not as RGB, but as Luminance transparence mask
using the common RGB_to_luminance definition as e.g. used by VCL.
The defining geometry is the Range of the child primitive sequence,
this means the renderers will/shall use this geometric information for
- rendering, not the alpha one. The alpha one should/will be clipped
+ rendering, not the transparent one. The transparent one should/will be clipped
accordingly.
*/
- class AlphaPrimitive2D : public GroupPrimitive2D
+ class TransparencePrimitive2D : public GroupPrimitive2D
{
private:
- /// The Alpha-Mask who's RGB-Values are interpreted as Luminance
- Primitive2DSequence maAlpha;
+ /// The transparence-Mask who's RGB-Values are interpreted as Luminance
+ Primitive2DSequence maTransparence;
public:
/** constructor
@@ -74,17 +74,17 @@ namespace drawinglayer
The content which is defined to have a transparency. The
range of this primitive is defined by this content
- @param rAlpha
- The definition of the Alpha-channel for this primitive. It
+ @param rTransparence
+ The definition of the Transparence-channel for this primitive. It
will be interpreted as mask by interpreting as gray values
using the common RGB_to_luminance definitions
*/
- AlphaPrimitive2D(
+ TransparencePrimitive2D(
const Primitive2DSequence& rChildren,
- const Primitive2DSequence& rAlpha);
+ const Primitive2DSequence& rTransparence);
/// data read access
- const Primitive2DSequence& getAlpha() const { return maAlpha; }
+ const Primitive2DSequence& getTransparence() const { return maTransparence; }
/// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
@@ -97,7 +97,7 @@ namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
-#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_ALPHAPRIMITIVE2D_HXX
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSPARENCEPRIMITIVE2D_HXX
//////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx
index 6e8970e7bee5..52f3747ddba2 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx
@@ -2,7 +2,7 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: unifiedalphaprimitive2d.hxx,v $
+ * $RCSfile: UnifiedTransparencePrimitive2D.hxx,v $
*
* $Revision: 1.3 $
*
@@ -33,8 +33,8 @@
*
************************************************************************/
-#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDALPHAPRIMITIVE2D_HXX
-#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDALPHAPRIMITIVE2D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
@@ -44,7 +44,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- /** UnifiedAlphaPrimitive2D class
+ /** UnifiedTransparencePrimitive2D class
This primitive encapsualtes a child hierarchy and defines
that it shall be visualized with the given transparency. That
@@ -53,24 +53,27 @@ namespace drawinglayer
regions of combined transparency, but be all rendered with the
defined, single transparency.
*/
- class UnifiedAlphaPrimitive2D : public GroupPrimitive2D
+ class UnifiedTransparencePrimitive2D : public GroupPrimitive2D
{
private:
- /// the unified alpha transparence
- double mfAlpha;
+ /// the unified transparence
+ double mfTransparence;
public:
/// constructor
- UnifiedAlphaPrimitive2D(
+ UnifiedTransparencePrimitive2D(
const Primitive2DSequence& rChildren,
- double fAlpha);
+ double fTransparence);
/// data read access
- double getAlpha() const { return mfAlpha; }
+ double getTransparence() const { return mfTransparence; }
/// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+ /// own getB2DRange implementation to include transparent geometries to BoundRect calculations
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
/// create decomposition
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
@@ -82,7 +85,7 @@ namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
-#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDALPHAPRIMITIVE2D_HXX
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX
//////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx
index f5a851b0b053..f5d6a92cff68 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx
@@ -45,25 +45,25 @@
//////////////////////////////////////////////////////////////////////////////
// local primitives
-#define PRIMITIVE3D_ID_GROUPPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 0)
-#define PRIMITIVE3D_ID_HATCHTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 1)
-#define PRIMITIVE3D_ID_MODIFIEDCOLORPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 2)
-#define PRIMITIVE3D_ID_POLYGONHAIRLINEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 3)
-#define PRIMITIVE3D_ID_POLYGONSTROKEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 4)
-#define PRIMITIVE3D_ID_POLYGONTUBEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 5)
-#define PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 6)
-#define PRIMITIVE3D_ID_SDRCUBEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 7)
-#define PRIMITIVE3D_ID_SDREXTRUDEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 8)
-#define PRIMITIVE3D_ID_SDRLATHEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 9)
-#define PRIMITIVE3D_ID_SDRPOLYPOLYGONPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 10)
-#define PRIMITIVE3D_ID_SDRSPHEREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 11)
-#define PRIMITIVE3D_ID_SHADOWPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 12)
-#define PRIMITIVE3D_ID_UNIFIEDALPHATEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 13)
-#define PRIMITIVE3D_ID_GRADIENTTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 14)
-#define PRIMITIVE3D_ID_BITMAPTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 15)
-#define PRIMITIVE3D_ID_ALPHATEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 16)
-#define PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 17)
-#define PRIMITIVE3D_ID_HITTESTPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 18)
+#define PRIMITIVE3D_ID_GROUPPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 0)
+#define PRIMITIVE3D_ID_HATCHTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 1)
+#define PRIMITIVE3D_ID_MODIFIEDCOLORPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 2)
+#define PRIMITIVE3D_ID_POLYGONHAIRLINEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 3)
+#define PRIMITIVE3D_ID_POLYGONSTROKEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 4)
+#define PRIMITIVE3D_ID_POLYGONTUBEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 5)
+#define PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 6)
+#define PRIMITIVE3D_ID_SDRCUBEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 7)
+#define PRIMITIVE3D_ID_SDREXTRUDEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 8)
+#define PRIMITIVE3D_ID_SDRLATHEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 9)
+#define PRIMITIVE3D_ID_SDRPOLYPOLYGONPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 10)
+#define PRIMITIVE3D_ID_SDRSPHEREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 11)
+#define PRIMITIVE3D_ID_SHADOWPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 12)
+#define PRIMITIVE3D_ID_UNIFIEDTRANSPARENCETEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 13)
+#define PRIMITIVE3D_ID_GRADIENTTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 14)
+#define PRIMITIVE3D_ID_BITMAPTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 15)
+#define PRIMITIVE3D_ID_TRANSPARENCETEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 16)
+#define PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 17)
+#define PRIMITIVE3D_ID_HIDDENGEOMETRYPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 18)
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx
index 69e406c75d67..8e7004be5b51 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx
@@ -59,7 +59,7 @@ namespace drawinglayer
- TexturePrimitive3D (with the following variations)
- GradientTexturePrimitive3D (for 3D gradient fill)
- BitmapTexturePrimitive3D (for 3D Bitmap fill)
- - AlphaTexturePrimitive3D (for 3D transparence)
+ - TransparenceTexturePrimitive3D (for 3D transparence)
- HatchTexturePrimitive3D (for 3D hatch fill)
- TransformPrimitive3D (for a transformation stack)
*/
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx
index 2675a1284779..d63125d8cc29 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx
@@ -37,6 +37,7 @@
#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/textureprimitive3d.hxx>
+#include <drawinglayer/attribute/fillhatchattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx
index 4779241033b0..287bfcc689e4 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx
@@ -33,8 +33,8 @@
*
************************************************************************/
-#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HITTESTPRIMITIVE3D_HXX
-#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HITTESTPRIMITIVE3D_HXX
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HIDDENGEOMETRYPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HIDDENGEOMETRYPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/groupprimitive3d.hxx>
@@ -44,37 +44,30 @@ namespace drawinglayer
{
namespace primitive3d
{
- /** HitTestPrimitive3D class
-
- This primitive is used to represent geometry for non-visible objects,
- e.g. a 3D cube without fill attributes. To still be able to use
- primitives for HitTest functionality, the 3d decompositions produce
- an as much as possible simplified fill geometry encapsulated in this
- primtive when there is no fill geometry. Currently, the 3d hit test
- uses only areas, so maybe in a further enchanced version this will change
- to 'if neither filled nor lines' creation criteria. The whole primitive
- decomposes to nothing, so no one not knowing it will be influenced. Only
- helper processors for hit test (and maybe BoundRect extractors) will
- use it and it's children subcontent.
- */
- class HitTestPrimitive3D : public GroupPrimitive3D
+ // This primitive is used to represent geometry for non-visible objects,
+ // e.g. a 3D cube without fill attributes. To still be able to use
+ // primitives for HitTest functionality, the 3d decompositions produce
+ // an as much as possible simplified fill geometry encapsulated in this
+ // primtive when there is no fill geometry. Currently, the 3d hit test
+ // uses only areas, so maybe in a further enchanced version this will change
+ // to 'if neither filled nor lines' creation criteria. The whole primitive
+ // decomposes to nothing, so no one not knowing it will be influenced. Only
+ // helper processors for hit test (and maybe BoundRect extractors) will
+ // use it and it's children subcontent.
+ class HiddenGeometryPrimitive3D : public GroupPrimitive3D
{
public:
- /// constructor
- HitTestPrimitive3D(const Primitive3DSequence& rChildren);
+ HiddenGeometryPrimitive3D(const Primitive3DSequence& rChildren);
- /** despite returning an empty decomposition since it's no visualisation data,
- range calculation is intended to use invisible replacement geometry, so
- the local implementation will return the children's range
- */
+ // despite returning an empty decomposition since it's no visualisation data,
+ // range calculation is intended to use hidden geometry, so
+ // the local implementation will return the children's range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- /** local decomposition. Implementation will return empty Primitive3DSequence
- since this is no visualisation data
- */
+ /// The default implementation returns an empty sequence
virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
- /// provide unique ID
+ // provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
@@ -82,7 +75,7 @@ namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
-#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HITTESTPRIMITIVE3D_HXX
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HIDDENGEOMETRYPRIMITIVE3D_HXX
//////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx
index b3a57f2677dc..8d0e5512f8fa 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx
@@ -61,7 +61,7 @@ namespace drawinglayer
SdrCubePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute);
/// compare operator
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx
index 5b793a6928f8..f9710b4b70a7 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx
@@ -89,13 +89,20 @@ namespace drawinglayer
const basegfx::B2DVector& rTextureSize,
const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute,
const attribute::SdrFillAttribute& rFill,
- const attribute::FillGradientAttribute* pFillGradient = 0L);
+ const attribute::FillGradientAttribute& rFillGradient);
Primitive3DSequence createShadowPrimitive3D(
const Primitive3DSequence& rSource,
const attribute::SdrShadowAttribute& rShadow,
bool bShadow3D);
- } // end of namespace overlay
+
+ Primitive3DSequence createHiddenGeometryPrimitives3D(
+ const ::std::vector< basegfx::B3DPolyPolygon >& r3DPolyPolygonVector,
+ const basegfx::B3DHomMatrix& rObjectTransform,
+ const basegfx::B2DVector& rTextureSize,
+ const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute);
+
+ } // end of namespace primitive3d
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx
index a810e0f5ec8e..9531e5ffa0b9 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx
@@ -95,7 +95,7 @@ namespace drawinglayer
SdrExtrudePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute,
const basegfx::B2DPolyPolygon& rPolyPolygon,
double fDepth,
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx
index 084ce5bce35e..5e429e595d7f 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx
@@ -109,7 +109,7 @@ namespace drawinglayer
SdrLathePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute,
const basegfx::B2DPolyPolygon& rPolyPolygon,
sal_uInt32 nHorizontalSegments,
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx
index a6c68bd16da8..6c1a677675a0 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx
@@ -70,7 +70,7 @@ namespace drawinglayer
const basegfx::B3DPolyPolygon& rPolyPolygon3D,
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute);
/// data access
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx
index 4dd620848387..0a4301d2c00d 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx
@@ -40,8 +40,8 @@
#include <basegfx/matrix/b3dhommatrix.hxx>
#include <basegfx/vector/b2dvector.hxx>
#include <drawinglayer/attribute/sdrallattribute3d.hxx>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <drawinglayer/primitive3d/sdrextrudelathetools3d.hxx>
+#include <drawinglayer/attribute/sdrobjectattribute3d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -61,7 +61,7 @@ namespace drawinglayer
/// object surface attributes
basegfx::B3DHomMatrix maTransform;
basegfx::B2DVector maTextureSize;
- attribute::SdrLineFillShadowAttribute maSdrLFSAttribute;
+ attribute::SdrLineFillShadowAttribute3D maSdrLFSAttribute;
attribute::Sdr3DObjectAttribute maSdr3DObjectAttribute;
protected:
@@ -80,13 +80,13 @@ namespace drawinglayer
SdrPrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute);
/// data read access
const basegfx::B3DHomMatrix& getTransform() const { return maTransform; }
const basegfx::B2DVector& getTextureSize() const { return maTextureSize; }
- const attribute::SdrLineFillShadowAttribute& getSdrLFSAttribute() const { return maSdrLFSAttribute; }
+ const attribute::SdrLineFillShadowAttribute3D& getSdrLFSAttribute() const { return maSdrLFSAttribute; }
const attribute::Sdr3DObjectAttribute getSdr3DObjectAttribute() const { return maSdr3DObjectAttribute; }
/// compare operator
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx
index 52e646e6b4dc..0bd1cf7f3e17 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx
@@ -66,7 +66,7 @@ namespace drawinglayer
SdrSpherePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute,
sal_uInt32 nHorizontalSegments,
sal_uInt32 nVerticalSegments);
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx
index f8b81e357ea5..8825c76f6d6c 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx
@@ -37,9 +37,10 @@
#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/groupprimitive3d.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/attribute/fillbitmapattribute.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -91,13 +92,13 @@ namespace drawinglayer
{
namespace primitive3d
{
- /** UnifiedAlphaTexturePrimitive3D class
+ /** UnifiedTransparenceTexturePrimitive3D class
This 3D primitive expands TexturePrimitive3D to a unified
- alpha (transparence) texture definition. All 3D primitives
+ transparence texture definition. All 3D primitives
embedded here will be shown with the given transparency.
*/
- class UnifiedAlphaTexturePrimitive3D : public TexturePrimitive3D
+ class UnifiedTransparenceTexturePrimitive3D : public TexturePrimitive3D
{
private:
/// transparency definition
@@ -105,7 +106,7 @@ namespace drawinglayer
public:
/// constructor
- UnifiedAlphaTexturePrimitive3D(
+ UnifiedTransparenceTexturePrimitive3D(
double fTransparence,
const Primitive3DSequence& rChildren);
@@ -115,6 +116,9 @@ namespace drawinglayer
/// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+ /// own getB3DRange implementation to include transparent geometries to BoundRect calculations
+ virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
+
/// local decomposition.
virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
@@ -208,18 +212,18 @@ namespace drawinglayer
{
namespace primitive3d
{
- /** AlphaTexturePrimitive3D class
+ /** TransparenceTexturePrimitive3D class
- This 3D primitive expands TexturePrimitive3D to a alpha texture
- definition. For alpha definition, a gradient is used. The values in
- that gradient will be interpreted as luminance Alpha-Values. All 3D
+ This 3D primitive expands TexturePrimitive3D to a transparence texture
+ definition. For transparence definition, a gradient is used. The values in
+ that gradient will be interpreted as luminance Transparence-Values. All 3D
primitives embedded here will be shown with the defined transparence.
*/
- class AlphaTexturePrimitive3D : public GradientTexturePrimitive3D
+ class TransparenceTexturePrimitive3D : public GradientTexturePrimitive3D
{
public:
/// constructor
- AlphaTexturePrimitive3D(
+ TransparenceTexturePrimitive3D(
const attribute::FillGradientAttribute& rGradient,
const Primitive3DSequence& rChildren,
const basegfx::B2DVector& rTextureSize);
diff --git a/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx
index fceae8dbeb31..58b5601f6242 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx
@@ -45,30 +45,159 @@ namespace drawinglayer
{
namespace processor2d
{
+ /** BaseProcessor2D class
+
+ Baseclass for all C++ implementations of instances which process
+ primitives.
+
+ Instances which process primitives can be renderers, but also stuff
+ for HitTests, BoundRect calculations and/or animation processing. The
+ main usage are renderers, but they are supposed to handle any primitive
+ processing.
+
+ The base implementation is constructed with a ViewInformation2D which
+ is accessible throughout the processor implementations. The idea is
+ to construct any processor with a given ViewInformation2D. To be able
+ to handle primitives which need to change the current transformation
+ (as e.g. TransformPrimitive2D) it is allowed for the processor implementation
+ to change tis local value using updateViewInformation.
+
+ The basic processing method is process(..) which gets handed over the
+ sequence of primitives to process. For convenience of the C++ implementations,
+ the default implementation of process(..) maps all accesses to primitives to
+ single calls to processBasePrimitive2D(..) where the primitive in question is
+ already casted to the C++ implementation class.
+
+ The process(..) implementation makes a complete iteration over the given
+ sequence of primitives. If the Primitive is not derived from BasePrimitive2D
+ and thus not part of the C++ implementations, it converts ViewInformation2D
+ to the corresponding API implementation (an uno::Sequence< beans::PropertyValue >)
+ and recursively calls the method process(..) at the primitive with the decomposition
+ derived from that primitive. This is the preparation to handle unknown implementations
+ of the com::sun::star::graphic::XPrimitive2D interface in the future.
+
+ So, to implement a basic processor, it is necessary to overload and implement the
+ processBasePrimitive2D(..) method. A minimal renderer has to support the
+ Basic Primitives (see baseprimitive2d.hxx) and the Grouping Primitives (see
+ groupprimitive2d.hxx). These are (currently):
+
+ Basic Primitives:
+
+ - BitmapPrimitive2D (bitmap data, evtl. with transparence)
+ - PointArrayPrimitive2D (single points)
+ - PolygonHairlinePrimitive2D (hairline curves/polygons)
+ - PolyPolygonColorPrimitive2D (colored polygons)
+
+ Grouping Primitives:
+
+ - TransparencePrimitive2D (objects with freely defined transparence)
+ - InvertPrimitive2D (for XOR)
+ - MaskPrimitive2D (for masking)
+ - ModifiedColorPrimitive2D (for a stack of color modifications)
+ - TransformPrimitive2D (for a transformation stack)
+
+ A processor doing so is a minimal processor. Of course a processor may
+ handle any higher-level prmitive (that has a decomposition implementation)
+ for more direct data access or performance reasons, too.
+
+ The main part of a processBasePrimitive2D implementation is a switch..case
+ construct, looking like the following:
+
+ void foo::processBasePrimitive2D(const BasePrimitive2D& rCandidate)
+ {
+ switch(rCandidate.getPrimitive2DID())
+ {
+ case PRIMITIVE2D_ID_??? :
+ {
+ // process PRIMITIVE2D_ID_??? here...
+
+ ...
+
+ break;
+ }
+
+ ...
+
+ default :
+ {
+ // process recursively
+ process(rCandidate.get2DDecomposition(getViewInformation2D()));
+ break;
+ }
+ }
+ }
+
+ The default case makes the processor work with all complex primitives
+ by recursively using their decomposition.
+
+ You can also add a case for ignoring primitives by using:
+
+ case PRIMITIVE2D_ID_...IGNORE.A.. :
+ case PRIMITIVE2D_ID_...IGNORE.B.. :
+ case PRIMITIVE2D_ID_...IGNORE.C.. :
+ {
+ // ignore these primitives by neither processing nor
+ // recursively processing their decomposition
+ break;
+ }
+
+ Another useful case is embedding the processing of a complex primitive by
+ bracketing it with some actions:
+
+ case PRIMITIVE2D_ID_SOME_TEXT :
+ {
+ // encapsulate e.g. with changing local varibles, e.g.
+ // sometimes it's good to know if a basic primitive is
+ // part of a text, especially when not handling the text
+ // self but by purpose want to handle the decomposed
+ // geometries in the processor
+ startText();
+ process(rCandidate.get2DDecomposition(getViewInformation2D()));
+ endText();
+ break;
+ }
+
+ As an example a processor collecting the outlines of a sequence of primitives
+ only needs to handle some Basic Primitives and create outline and collect
+ outline polygons e.g. for primitives with area like BitmapPrimitive2D (a
+ rectangle) and PolyPolygonColorPrimitive2D. When also handling the Grouping
+ Primitives MaskPrimitive2D (e.g. ignoring it's content, using the mask polyPolygon)
+ and TransformPrimitive2D (to have the correct local transformation), a processor
+ creating the outline can be written using just four (4) primitives. As a tipp, it can
+ be helpful to add many for the purpose not interesting higher level primitives
+ to not force their decomposition to be created and/or parsed.
+ */
class BaseProcessor2D
{
private:
+ /// The ViewInformation2D itself. It's private to isolate accesses to it
geometry::ViewInformation2D maViewInformation2D;
protected:
+ /* access method to allow the implementations to change the current
+ ViewInformation2D if needed. This allows isolating these accesses
+ later if needed
+ */
void updateViewInformation(const geometry::ViewInformation2D& rViewInformation2D)
{
maViewInformation2D = rViewInformation2D;
}
- // as tooling, the process() implementation takes over API handling and calls this
- // virtual render method when the primitive implementation is BasePrimitive2D-based.
- // Default implementation does nothing
+ /* as tooling, the process() implementation takes over API handling and calls this
+ virtual render method when the primitive implementation is BasePrimitive2D-based.
+ Default implementation does nothing
+ */
virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
public:
+ /// constructor/destructor
BaseProcessor2D(const geometry::ViewInformation2D& rViewInformation);
virtual ~BaseProcessor2D();
- // the central processing method
+ /// the central processing method
virtual void process(const primitive2d::Primitive2DSequence& rSource);
- // data access
+ /// data read access
const geometry::ViewInformation2D& getViewInformation2D() const { return maViewInformation2D; }
};
} // end of namespace processor2d
@@ -76,6 +205,44 @@ namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ /** CollectingProcessor2D class
+
+ A processor which just collects all primitives given to it in
+ process(..) calls to maPrimitive2DSequence. This can e.g. be used to
+ hand around as instance over various methods where every called
+ method can add graphic content to it.
+ */
+ class CollectingProcessor2D : public BaseProcessor2D
+ {
+ private:
+ primitive2d::Primitive2DSequence maPrimitive2DSequence;
+
+ public:
+ CollectingProcessor2D(const geometry::ViewInformation2D& rViewInformation);
+ virtual ~CollectingProcessor2D();
+
+ /// the central processing method
+ virtual void process(const primitive2d::Primitive2DSequence& rSource);
+
+ /// helpers for adding to local sequence
+ void appendPrimitive2DReference(const primitive2d::Primitive2DReference& rSource)
+ {
+ primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(maPrimitive2DSequence, rSource);
+ }
+
+ /// data access and reset
+ const primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; }
+ void reset() { maPrimitive2DSequence = primitive2d::Primitive2DSequence(); }
+ };
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
#endif //INCLUDED_DRAWINGLAYER_PROCESSOR2D_BASEPROCESSOR2D_HXX
// eof
diff --git a/drawinglayer/inc/drawinglayer/processor2d/canvasprocessor.hxx b/drawinglayer/inc/drawinglayer/processor2d/canvasprocessor.hxx
index 0c356e731169..13f1d540c239 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/canvasprocessor.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/canvasprocessor.hxx
@@ -64,10 +64,10 @@ namespace drawinglayer { namespace primitive2d {
class MetafilePrimitive2D;
class TextSimplePortionPrimitive2D;
class BitmapPrimitive2D;
- class AlphaPrimitive2D;
+ class TransparencePrimitive2D;
class PolygonStrokePrimitive2D;
class FillBitmapPrimitive2D;
- class UnifiedAlphaPrimitive2D;
+ class UnifiedTransparencePrimitive2D;
}}
//////////////////////////////////////////////////////////////////////////////
@@ -76,6 +76,11 @@ namespace drawinglayer
{
namespace processor2d
{
+ /** canvasProcessor2D class
+
+ A basic implementation of a renderer for com::sun::star::rendering::XCanvas
+ as a target
+ */
class canvasProcessor2D : public BaseProcessor2D
{
private:
@@ -111,10 +116,10 @@ namespace drawinglayer
void impRenderMetafilePrimitive2D(const primitive2d::MetafilePrimitive2D& rMetaCandidate);
void impRenderTextSimplePortionPrimitive2D(const primitive2d::TextSimplePortionPrimitive2D& rTextCandidate);
void impRenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate);
- void impRenderAlphaPrimitive2D(const primitive2d::AlphaPrimitive2D& rAlphaCandidate);
+ void impRenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D& rTransparenceCandidate);
void impRenderPolygonStrokePrimitive2D(const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokePrimitive);
void impRenderFillBitmapPrimitive2D(const primitive2d::FillBitmapPrimitive2D& rFillBitmapPrimitive2D);
- void impRenderUnifiedAlphaPrimitive2D(const primitive2d::UnifiedAlphaPrimitive2D& rUniAlphaCandidate);
+ void impRenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate);
public:
canvasProcessor2D(
diff --git a/drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx
index dbe85fab07c5..9d4dd48f8dff 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx
@@ -46,13 +46,18 @@ namespace drawinglayer
{
namespace processor2d
{
+ /** ContourExtractor2D class
+
+ A processor who extracts the contour of the primtives feeded to it
+ in the single local PolyPolygon
+ */
class ContourExtractor2D : public BaseProcessor2D
{
private:
- // the extracted contour
+ /// the extracted contour
std::vector< basegfx::B2DPolyPolygon > maExtractedContour;
- // tooling methods
+ /// tooling methods
void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
public:
diff --git a/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx
index c0ab33052883..640ec11260c3 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx
@@ -51,29 +51,36 @@ namespace drawinglayer
{
namespace processor2d
{
+ /** HitTestProcessor2D class
+
+ This processor implements a HitTest with the feeded primitives,
+ given tolerance and extras
+ */
class HitTestProcessor2D : public BaseProcessor2D
{
private:
- // discrete HitTest position
+ /// discrete HitTest position
basegfx::B2DPoint maDiscreteHitPosition;
- // discrete HitTolerance
+ /// discrete HitTolerance
double mfDiscreteHitTolerance;
- // bitfield
+ /// bitfield
unsigned mbHit : 1;
unsigned mbHitToleranceUsed : 1;
- // this flag decides if primitives of type HitTestPrimitive2D
- // will be taken into account for HitTesting or not. Those primitives
- // are created for objects which are else completely invisible and normally
- // their content exists of hairline primitives describing the object's contour
- unsigned mbUseHitTestPrimitiveContent : 1;
+ /* this flag decides if primitives which are embedded to an
+ UnifiedTransparencePrimitive2D and are invisible will be taken into account for
+ HitTesting or not. Those primitives are created for objects which are else
+ completely invisible and normally their content exists of hairline
+ primitives describing the object's contour
+ */
+ unsigned mbUseInvisiblePrimitiveContent : 1;
- // flag to concentraze on text hits only
+ /// flag to concentraze on text hits only
unsigned mbHitTextOnly : 1;
- // tooling methods
+ /// tooling methods
void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
bool checkHairlineHitWithTolerance(
const basegfx::B2DPolygon& rPolygon,
@@ -91,18 +98,18 @@ namespace drawinglayer
bool bHitTextOnly);
virtual ~HitTestProcessor2D();
- // data write access
- void setUseHitTestPrimitiveContent(bool bNew)
+ /// data write access
+ void setUseInvisiblePrimitiveContent(bool bNew)
{
- if((bool)mbUseHitTestPrimitiveContent != bNew) mbUseHitTestPrimitiveContent = bNew;
+ if((bool)mbUseInvisiblePrimitiveContent != bNew) mbUseInvisiblePrimitiveContent = bNew;
}
- // data read access
+ /// data read access
const basegfx::B2DPoint& getDiscreteHitPosition() const { return maDiscreteHitPosition; }
double getDiscreteHitTolerance() const { return mfDiscreteHitTolerance; }
bool getHit() const { return mbHit; }
bool getHitToleranceUsed() const { return mbHitToleranceUsed; }
- bool getUseHitTestPrimitiveContent() const { return mbUseHitTestPrimitiveContent;}
+ bool getUseInvisiblePrimitiveContent() const { return mbUseInvisiblePrimitiveContent;}
bool getHitTextOnly() const { return mbHitTextOnly; }
};
} // end of namespace processor2d
diff --git a/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx
index b2697abece66..8162bb0934f4 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx
@@ -45,16 +45,21 @@ namespace drawinglayer
{
namespace processor2d
{
+ /** LineGeometryExtractor2D class
+
+ This processor can extract the line geometry from feeded primpitives. The
+ hairlines and the fille geometry from fat lines are separated.
+ */
class LineGeometryExtractor2D : public BaseProcessor2D
{
private:
std::vector< basegfx::B2DPolygon > maExtractedHairlines;
std::vector< basegfx::B2DPolyPolygon > maExtractedLineFills;
- // bitfield
+ /// bitfield
unsigned mbInLineGeometry : 1;
- // tooling methods
+ /// tooling methods
void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
public:
diff --git a/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx
index 88d9416b612a..77fa9432539d 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx
@@ -48,7 +48,7 @@ namespace drawinglayer
{
namespace processor2d
{
- // helper data structure for returning the result
+ /// helper data structure for returning the result
struct TextAsPolygonDataNode
{
private:
@@ -73,9 +73,13 @@ namespace drawinglayer
bool getIsFilled() const { return mbIsFilled; }
};
- // typedef for a vector of that helper data
+ /// typedef for a vector of that helper data
typedef ::std::vector< TextAsPolygonDataNode > TextAsPolygonDataNodeVector;
+ /** TextAsPolygonExtractor2D class
+
+ This processor extracts text in the feeded primitives to filled polygons
+ */
class TextAsPolygonExtractor2D : public BaseProcessor2D
{
private:
diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx
index 38e7e5143b8a..66af45a7c6ce 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx
@@ -47,6 +47,7 @@
//////////////////////////////////////////////////////////////////////////////
// predefines
+
class GDIMetaFile;
class Rectangle;
class Gradient;
@@ -70,10 +71,22 @@ namespace drawinglayer
{
namespace processor2d
{
+ /** VclMetafileProcessor2D class
+
+ This processor derived from VclProcessor2D is the base class for rendering
+ all feeded primitives to a classical VCL-Metafile, including all over the
+ time grown extra data in comments and PDF exception data creations. Also
+ printing needs some exception stuff.
+
+ All in all it is needed to emulate the old ::paint output from the old
+ Drawinglayer as long as exporters and/or filters still use the Metafile
+ and the extra-data added to it (which can be seen mostly as 'extensions'
+ or simply as 'hacks').
+ */
class VclMetafileProcessor2D : public VclProcessor2D
{
private:
- // local helper(s)
+ /// local helper(s)
Rectangle impDumpToMetaFile(
const primitive2d::Primitive2DSequence& rContent,
GDIMetaFile& o_rContentMetafile);
@@ -93,42 +106,47 @@ namespace drawinglayer
void impStartSvtGraphicStroke(SvtGraphicStroke* pSvtGraphicStroke);
void impEndSvtGraphicStroke(SvtGraphicStroke* pSvtGraphicStroke);
- // the current clipping PolyPolygon from MaskPrimitive2D
+ /// the current clipping PolyPolygon from MaskPrimitive2D
basegfx::B2DPolyPolygon maClipPolyPolygon;
- // the target MetaFile
+ /// the target MetaFile
GDIMetaFile* mpMetaFile;
- // do not allow embedding SvtGraphicFills into each other,
- // use a counter to prevent that
+ /* do not allow embedding SvtGraphicFills into each other,
+ use a counter to prevent that
+ */
sal_uInt32 mnSvtGraphicFillCount;
- // same for SvtGraphicStroke
+ /// same for SvtGraphicStroke
sal_uInt32 mnSvtGraphicStrokeCount;
- // hold the last unified transparence value to have it handy
- // on SvtGraphicStroke creation
+ /* hold the last unified transparence value to have it handy
+ on SvtGraphicStroke creation
+ */
double mfCurrentUnifiedTransparence;
- // break iterator support
- // made static so it only needs to be fetched once, even with many single
- // constructed VclMetafileProcessor2D. It's still incarnated on demand,
- // but exists for OOo runtime now by purpose.
+ /* break iterator support
+ made static so it only needs to be fetched once, even with many single
+ constructed VclMetafileProcessor2D. It's still incarnated on demand,
+ but exists for OOo runtime now by purpose.
+ */
static ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > mxBreakIterator;
- // vcl::PDFExtOutDevData support
- // For the first step, some extra actions at vcl::PDFExtOutDevData need to
- // be emulated with the VclMetafileProcessor2D. These are potentially temporarily
- // since PDF export may use PrimitiveSequences one day directly.
+ /* vcl::PDFExtOutDevData support
+ For the first step, some extra actions at vcl::PDFExtOutDevData need to
+ be emulated with the VclMetafileProcessor2D. These are potentially temporarily
+ since PDF export may use PrimitiveSequences one day directly.
+ */
vcl::PDFExtOutDevData* mpPDFExtOutDevData;
protected:
- // the local processor for BasePrinitive2D-Implementation based primitives,
- // called from the common process()-implementation
+ /* the local processor for BasePrinitive2D-Implementation based primitives,
+ called from the common process()-implementation
+ */
virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
public:
- // constructor/destructor
+ /// constructor/destructor
VclMetafileProcessor2D(
const geometry::ViewInformation2D& rViewInformation,
OutputDevice& rOutDev);
diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx
index 836a097ae4d9..0d277325129b 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx
@@ -40,34 +40,39 @@
#include <vcl/outdev.hxx>
//////////////////////////////////////////////////////////////////////////////
-// predefines
-
-//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
{
namespace processor2d
{
+ /** VclPixelProcessor2D class
+
+ This processor derived from VclProcessor2D is the base class for rendering
+ all feeded primitives to a VCL Window. It is the currently used renderer
+ for all VCL editing output from the DrawingLayer.
+ */
class VclPixelProcessor2D : public VclProcessor2D
{
private:
- // The Pixel renderer resets the original MapMode from the OutputDevice.
- // For some situations it is necessary to get it again, so it is rescued here
+ /* The Pixel renderer resets the original MapMode from the OutputDevice.
+ For some situations it is necessary to get it again, so it is rescued here
+ */
MapMode maOriginalMapMode;
protected:
- // the local processor for BasePrinitive2D-Implementation based primitives,
- // called from the common process()-implementation
+ /* the local processor for BasePrinitive2D-Implementation based primitives,
+ called from the common process()-implementation
+ */
virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
public:
- // constructor/destructor
+ /// constructor/destructor
VclPixelProcessor2D(
const geometry::ViewInformation2D& rViewInformation,
OutputDevice& rOutDev);
virtual ~VclPixelProcessor2D();
- // data access
+ /// data read access
const MapMode& getOriginalMapMode() const { return maOriginalMapMode; }
};
} // end of namespace processor2d
diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
index ff77cc3fd5d0..0cef3da7a8ee 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
@@ -55,8 +55,8 @@ namespace drawinglayer { namespace primitive2d {
class PolyPolygonColorPrimitive2D;
class MetafilePrimitive2D;
class MaskPrimitive2D;
- class UnifiedAlphaPrimitive2D;
- class AlphaPrimitive2D;
+ class UnifiedTransparencePrimitive2D;
+ class TransparencePrimitive2D;
class TransformPrimitive2D;
class MarkerArrayPrimitive2D;
class PointArrayPrimitive2D;
@@ -73,6 +73,11 @@ namespace drawinglayer
{
namespace processor2d
{
+ /** VclProcessor2D class
+
+ This processor is the base class for VCL-Based processors. It has no
+ processBasePrimitive2D implementation and thus is not usable directly.
+ */
class VclProcessor2D : public BaseProcessor2D
{
protected:
@@ -107,8 +112,8 @@ namespace drawinglayer
void RenderMetafilePrimitive2D(const primitive2d::MetafilePrimitive2D& rPolygonCandidate);
void RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive2D& rMaskCandidate);
void RenderModifiedColorPrimitive2D(const primitive2d::ModifiedColorPrimitive2D& rModifiedCandidate);
- void RenderUnifiedAlphaPrimitive2D(const primitive2d::UnifiedAlphaPrimitive2D& rTransCandidate);
- void RenderAlphaPrimitive2D(const primitive2d::AlphaPrimitive2D& rTransCandidate);
+ void RenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rTransCandidate);
+ void RenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D& rTransCandidate);
void RenderTransformPrimitive2D(const primitive2d::TransformPrimitive2D& rTransformCandidate);
void RenderPagePreviewPrimitive2D(const primitive2d::PagePreviewPrimitive2D& rPagePreviewCandidate);
void RenderMarkerArrayPrimitive2D(const primitive2d::MarkerArrayPrimitive2D& rMarkerArrayCandidate);
diff --git a/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx
index effc509d9981..f6e0b53d4362 100644
--- a/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx
@@ -45,6 +45,13 @@ namespace drawinglayer
{
namespace processor3d
{
+ /** BaseProcessor3D class
+
+ Baseclass for all C++ implementations of instances which process
+ primitives.
+
+ Please have a look at baseprocessor2d.hxx for more comments.
+ */
class BaseProcessor3D
{
private:
@@ -56,9 +63,10 @@ namespace drawinglayer
maViewInformation3D = rViewInformation3D;
}
- // as tooling, the process() implementation takes over API handling and calls this
- // virtual render method when the primitive implementation is BasePrimitive3D-based.
- // Default implementation does nothing
+ /* as tooling, the process() implementation takes over API handling and calls this
+ virtual render method when the primitive implementation is BasePrimitive3D-based.
+ Default implementation does nothing
+ */
virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
public:
@@ -80,6 +88,13 @@ namespace drawinglayer
{
namespace processor3d
{
+ /** CollectingProcessor3D class
+
+ A processor which just collects all primitives given to it in
+ process(..) calls to maPrimitive3DSequence. This can e.g. be used to
+ hand around as instance over various methods where every called
+ method can add graphic content to it.
+ */
class CollectingProcessor3D : public BaseProcessor3D
{
private:
@@ -89,16 +104,16 @@ namespace drawinglayer
CollectingProcessor3D(const geometry::ViewInformation3D& rViewInformation);
virtual ~CollectingProcessor3D();
- // the central processing method
+ /// the central processing method
virtual void process(const primitive3d::Primitive3DSequence& rSource);
- // helpers for adding to local sequence
+ /// helpers for adding to local sequence
void appendPrimitive3DReference(const primitive3d::Primitive3DReference& rSource)
{
primitive3d::appendPrimitive3DReferenceToPrimitive3DSequence(maPrimitive3DSequence, rSource);
}
- // data access and reset
+ /// data access and reset
const primitive3d::Primitive3DSequence& getPrimitive3DSequence() const { return maPrimitive3DSequence; }
void reset() { maPrimitive3DSequence = primitive3d::Primitive3DSequence(); }
};
diff --git a/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx
index 8a800d6d24b1..72552ea00e9c 100644
--- a/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx
@@ -44,26 +44,38 @@ namespace drawinglayer
{
namespace processor3d
{
+ /** CutFindProcessor class
+
+ This processor extracts all cuts of 3D plane geometries in the feeded primitives
+ with the given cut vector, based on the ViewInformation3D given.
+ */
class CutFindProcessor : public BaseProcessor3D
{
private:
- // the start and stop point for the cut vector
+ /// the start and stop point for the cut vector
basegfx::B3DPoint maFront;
basegfx::B3DPoint maBack;
- // the found cut points
+ /// the found cut points
::std::vector< basegfx::B3DPoint > maResult;
- // #i102956# the transformation change from TransformPrimitive3D processings
- // needs to be remembered to be able to transform found cuts to the
- // basic coordinate system the processor starts with
+ /* #i102956# the transformation change from TransformPrimitive3D processings
+ needs to be remembered to be able to transform found cuts to the
+ basic coordinate system the processor starts with
+ */
basegfx::B3DHomMatrix maCombinedTransform;
- // bitfield
+ /// bitfield
bool mbAnyHit : 1;
- // as tooling, the process() implementation takes over API handling and calls this
- // virtual render method when the primitive implementation is BasePrimitive3D-based.
+ /* this flag decides if primitives which are invisible will be taken into account for
+ HitTesting or not.
+ */
+ bool mbUseInvisiblePrimitiveContent : 1;
+
+ /* as tooling, the process() implementation takes over API handling and calls this
+ virtual render method when the primitive implementation is BasePrimitive3D-based.
+ */
virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
public:
@@ -72,9 +84,16 @@ namespace drawinglayer
const basegfx::B3DPoint& rBack,
bool bAnyHit);
- // data access
+ /// data write access
+ void setUseInvisiblePrimitiveContent(bool bNew)
+ {
+ if((bool)mbUseInvisiblePrimitiveContent != bNew) mbUseInvisiblePrimitiveContent = bNew;
+ }
+
+ /// data read access
const ::std::vector< basegfx::B3DPoint >& getCutPoints() const { return maResult; }
bool getAnyHit() const { return mbAnyHit; }
+ bool getUseInvisiblePrimitiveContent() const { return mbUseInvisiblePrimitiveContent;}
};
} // 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 d0f886cca703..89fbdaafa251 100644
--- a/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx
@@ -45,6 +45,7 @@
//////////////////////////////////////////////////////////////////////////////
// predefines
+
namespace basegfx {
class BZPixelRaster;
class B3DPolygon;
@@ -77,38 +78,49 @@ namespace drawinglayer
{
namespace processor3d
{
+ /** DefaultProcessor3D class
+
+ This processor renders all feeded primitives to a 2D raster where for all
+ primitives the two basic methods rasterconvertB3DPolygon for hairlines and
+ rasterconvertB3DPolyPolygon for filled geometry is called. It is a beseclass to
+ e.g. base a Z-Buffer supported renderer on the 3D primitive processing.
+ */
class DefaultProcessor3D : public BaseProcessor3D
{
protected:
- // render information
- const attribute::SdrSceneAttribute& mrSdrSceneAttribute; // read-only scene infos (normal handling, etc...)
- const attribute::SdrLightingAttribute& mrSdrLightingAttribute; // read-only light infos (lights, etc...)
+ /// read-only scene infos (normal handling, etc...)
+ const attribute::SdrSceneAttribute& mrSdrSceneAttribute;
+
+ /// read-only light infos (lights, etc...)
+ const attribute::SdrLightingAttribute& mrSdrLightingAttribute;
- // renderer range. Need to be correctly set by the derived implementations
- basegfx::B2DRange maRasterRange; // the (0, 0, W, H) range from mpBZPixelRaster
+ /// renderer range. Need to be correctly set by the derived implementations
+ /// normally the (0, 0, W, H) range from mpBZPixelRaster
+ basegfx::B2DRange maRasterRange;
- // the modifiedColorPrimitive stack
+ /// the modifiedColorPrimitive stack
basegfx::BColorModifierStack maBColorModifierStack;
- // the current active texture
+ /// the current active texture
boost::shared_ptr< texture::GeoTexSvx > mpGeoTexSvx;
- // the current active transparence texture
+ /// the current active transparence texture
boost::shared_ptr< texture::GeoTexSvx > mpTransparenceGeoTexSvx;
- // SvtOptionsDrawinglayer incarnation to react on diverse settings
+ /// SvtOptionsDrawinglayer incarnation to react on diverse settings
const SvtOptionsDrawinglayer maDrawinglayerOpt;
- // counter for entered transparence textures
+ /// counter for entered transparence textures
sal_uInt32 mnTransparenceCounter;
- // bitfield
+ /// bitfield
unsigned mbModulate : 1;
unsigned mbFilter : 1;
unsigned mbSimpleTextureActive : 1;
//////////////////////////////////////////////////////////////////////////////
// rendering support
+
void impRenderGradientTexturePrimitive3D(const primitive3d::GradientTexturePrimitive3D& rPrimitive, bool bTransparence);
void impRenderHatchTexturePrimitive3D(const primitive3d::HatchTexturePrimitive3D& rPrimitive);
void impRenderBitmapTexturePrimitive3D(const primitive3d::BitmapTexturePrimitive3D& rPrimitive);
@@ -120,6 +132,7 @@ namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
// rasterconversions for filled and non-filled polygons. These NEED to be
// implemented from derivations
+
virtual void rasterconvertB3DPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolygon& rHairline) const = 0;
virtual void rasterconvertB3DPolyPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolyPolygon& rFill) const = 0;
@@ -133,11 +146,11 @@ namespace drawinglayer
const attribute::SdrLightingAttribute& rSdrLightingAttribute);
virtual ~DefaultProcessor3D();
- // data read access
+ /// data read access
const attribute::SdrSceneAttribute& getSdrSceneAttribute() const { return mrSdrSceneAttribute; }
const attribute::SdrLightingAttribute& getSdrLightingAttribute() const { return mrSdrLightingAttribute; }
- // data read access renderer stuff
+ /// data read access renderer stuff
const basegfx::BColorModifierStack& getBColorModifierStack() const { return maBColorModifierStack; }
const boost::shared_ptr< texture::GeoTexSvx >& getGeoTexSvx() const { return mpGeoTexSvx; }
const boost::shared_ptr< texture::GeoTexSvx >& getTransparenceGeoTexSvx() const { return mpTransparenceGeoTexSvx; }
@@ -146,7 +159,7 @@ namespace drawinglayer
bool getFilter() const { return mbFilter; }
bool getSimpleTextureActive() const { return mbSimpleTextureActive; }
- // access to Drawinglayer configuration options
+ /// access to Drawinglayer configuration options
const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; }
};
} // end of namespace processor3d
diff --git a/drawinglayer/inc/drawinglayer/processor3d/geometry2dextractor.hxx b/drawinglayer/inc/drawinglayer/processor3d/geometry2dextractor.hxx
index 457ede952ccd..cf25c8813c13 100644
--- a/drawinglayer/inc/drawinglayer/processor3d/geometry2dextractor.hxx
+++ b/drawinglayer/inc/drawinglayer/processor3d/geometry2dextractor.hxx
@@ -48,20 +48,27 @@ namespace drawinglayer
{
namespace processor3d
{
+ /** Geometry2DExtractingProcessor class
+
+ This processor extracts the 2D geometry (projected geometry) of all feeded primitives.
+ It is e.g. used as sub-processor for contour extraction where 3D geometry is only
+ useful as 2D projected geometry.
+ */
class Geometry2DExtractingProcessor : public BaseProcessor3D
{
private:
- // result holding vector (2D)
+ /// result holding vector (2D)
primitive2d::Primitive2DSequence maPrimitive2DSequence;
- // object transformation for scene for 2d definition
+ /// object transformation for scene for 2d definition
basegfx::B2DHomMatrix maObjectTransformation;
- // the modifiedColorPrimitive stack
+ /// the modifiedColorPrimitive stack
basegfx::BColorModifierStack maBColorModifierStack;
- // as tooling, the process() implementation takes over API handling and calls this
- // virtual render method when the primitive implementation is BasePrimitive3D-based.
+ /* as tooling, the process() implementation takes over API handling and calls this
+ virtual render method when the primitive implementation is BasePrimitive3D-based.
+ */
virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
public:
@@ -69,7 +76,7 @@ namespace drawinglayer
const geometry::ViewInformation3D& rViewInformation,
const basegfx::B2DHomMatrix& rObjectTransformation);
- // data access
+ // data read access
const primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; }
const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
const basegfx::BColorModifierStack& getBColorModifierStack() const { return maBColorModifierStack; }
diff --git a/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx b/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx
index abb92693a037..977cd8327d94 100644
--- a/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx
+++ b/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx
@@ -52,17 +52,24 @@ namespace drawinglayer
{
namespace processor3d
{
+ /** Shadow3DExtractingProcessor class
+
+ This processor extracts the 2D shadow geometry (projected geometry) of all feeded primitives.
+ It is used to create the shadow of 3D objects which consists of 2D geometry. It needs quite
+ some data to do so since we do not only offer flat projected 2D shadow, but also projections
+ dependent on the light source
+ */
class Shadow3DExtractingProcessor : public BaseProcessor3D
{
private:
- // result holding vector (2D) and target vector for stacking (inited to &maPrimitive2DSequence)
+ /// result holding vector (2D) and target vector for stacking (inited to &maPrimitive2DSequence)
primitive2d::Primitive2DSequence maPrimitive2DSequence;
primitive2d::Primitive2DSequence* mpPrimitive2DSequence;
- // object transformation for scene for 2d definition
+ /// object transformation for scene for 2d definition
basegfx::B2DHomMatrix maObjectTransformation;
- // prepared data (transformations) for 2D/3D shadow calculations
+ /// prepared data (transformations) for 2D/3D shadow calculations
basegfx::B3DHomMatrix maWorldToEye;
basegfx::B3DHomMatrix maEyeToView;
basegfx::B3DVector maLightNormal;
@@ -70,26 +77,28 @@ namespace drawinglayer
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
+ /* the shadow color used for sub-primitives. Can stay at black since
+ the encapsulating 2d shadow primitive will contain the color
+ */
basegfx::BColor maPrimitiveColor;
- // bitfield
- // flag if shadow plane projection preparation leaded to valid results
+ /// bitfield
+ /// flag if shadow plane projection preparation leaded to valid results
unsigned mbShadowProjectionIsValid : 1;
- // flag if conversion is switched on
+ /// flag if conversion is switched on
unsigned mbConvert : 1;
- // flag if conversion shall use projection
+ /// flag if conversion shall use projection
unsigned mbUseProjection : 1;
- // helpers
+ /// local helpers
basegfx::B2DPolygon impDoShadowProjection(const basegfx::B3DPolygon& rSource);
basegfx::B2DPolyPolygon impDoShadowProjection(const basegfx::B3DPolyPolygon& rSource);
- // as tooling, the process() implementation takes over API handling and calls this
- // virtual render method when the primitive implementation is BasePrimitive3D-based.
+ /* as tooling, the process() implementation takes over API handling and calls this
+ virtual render method when the primitive implementation is BasePrimitive3D-based.
+ */
virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
public:
@@ -100,7 +109,7 @@ namespace drawinglayer
double fShadowSlant,
const basegfx::B3DRange& rContained3DRange);
- // data access
+ /// data read access
const primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; }
const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
const basegfx::B3DHomMatrix& getWorldToEye() const { return maWorldToEye; }
diff --git a/drawinglayer/inc/drawinglayer/processor3d/zbufferprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/zbufferprocessor3d.hxx
index b2e09205dba9..4d0968c6cd57 100644
--- a/drawinglayer/inc/drawinglayer/processor3d/zbufferprocessor3d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor3d/zbufferprocessor3d.hxx
@@ -66,28 +66,37 @@ namespace drawinglayer
{
namespace processor3d
{
+ /** ZBufferProcessor3D class
+
+ This 3D renderer derived from DefaultProcessor3D renders all feeded primitives to a 2D
+ raster bitmap using a Z-Buffer based approach. It is able to supersample and to handle
+ transparent content.
+ */
class ZBufferProcessor3D : public DefaultProcessor3D
{
private:
- // the raster target, a Z-Buffer
+ /// the raster target, a Z-Buffer
basegfx::BZPixelRaster* mpBZPixelRaster;
- // inverse of EyeToView for rasterconversion with evtl. Phong shading
+ /// inverse of EyeToView for rasterconversion with evtl. Phong shading
basegfx::B3DHomMatrix maInvEyeToView;
- // The raster converter for Z-Buffer
+ /// The raster converter for Z-Buffer
ZBufferRasterConverter3D* mpZBufferRasterConverter3D;
- // AA value. Defines how many oversmples will be used in X and Y. Values 0, 1
- // will switch it off while e.g. 2 will use 2x2 pixels for each pixel to create
+ /* AA value. Defines how many oversmples will be used in X and Y. Values 0, 1
+ will switch it off while e.g. 2 will use 2x2 pixels for each pixel to create
+ */
sal_uInt16 mnAntiAlialize;
- // remembered RasterPrimitive3D's which need to be painted back to front
- // for transparent 3D parts
+ /* remembered RasterPrimitive3D's which need to be painted back to front
+ for transparent 3D parts
+ */
std::vector< RasterPrimitive3D >* mpRasterPrimitive3Ds;
//////////////////////////////////////////////////////////////////////////////
// rasterconversions for filled and non-filled polygons
+
virtual void rasterconvertB3DPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolygon& rHairline) const;
virtual void rasterconvertB3DPolyPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolyPolygon& rFill) const;
@@ -105,7 +114,7 @@ namespace drawinglayer
void finish();
- // get the result as bitmapEx
+ /// get the result as bitmapEx
BitmapEx getBitmapEx() const;
};
} // end of namespace processor3d
diff --git a/drawinglayer/prj/d.lst b/drawinglayer/prj/d.lst
index ee5b96d98a03..7ae13f8ebe33 100644
--- a/drawinglayer/prj/d.lst
+++ b/drawinglayer/prj/d.lst
@@ -8,7 +8,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer
mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d
..\inc\drawinglayer\primitive2d\drawinglayer_primitivetypes2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\drawinglayer_primitivetypes2d.hxx
-..\inc\drawinglayer\primitive2d\alphaprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\alphaprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\transparenceprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\transparenceprimitive2d.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
@@ -24,7 +24,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d
..\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\hittestprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\hittestprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\hiddengeometryprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\hiddengeometryprimitive2d.hxx
..\inc\drawinglayer\primitive2d\invertprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\invertprimitive2d.hxx
..\inc\drawinglayer\primitive2d\markerarrayprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\markerarrayprimitive2d.hxx
..\inc\drawinglayer\primitive2d\maskprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\maskprimitive2d.hxx
@@ -36,6 +36,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d
..\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\primitivetools2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\primitivetools2d.hxx
+..\inc\drawinglayer\primitive2d\sdrdecompositiontools2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\sdrdecompositiontools2d.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\structuretagprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\structuretagprimitive2d.hxx
@@ -46,7 +47,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d
..\inc\drawinglayer\primitive2d\textdecoratedprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\textdecoratedprimitive2d.hxx
..\inc\drawinglayer\primitive2d\texthierarchyprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\texthierarchyprimitive2d.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
+..\inc\drawinglayer\primitive2d\unifiedtransparenceprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\unifiedtransparenceprimitive2d.hxx
..\inc\drawinglayer\primitive2d\wrongspellprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\wrongspellprimitive2d.hxx
mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive3d
@@ -54,7 +55,7 @@ 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\hittestprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\hittestprimitive3d.hxx
+..\inc\drawinglayer\primitive2d\hiddengeometryprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\hiddengeometryprimitive3d.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
@@ -97,13 +98,20 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\processor3d
..\inc\drawinglayer\processor3d\tbufferprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\tbufferprocessor3d.hxx
mkdir: %_DEST%\inc%_EXT%\drawinglayer\attribute
-..\inc\drawinglayer\attribute\fillattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fillattribute.hxx
+..\inc\drawinglayer\attribute\fillgradientattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fillgradientattribute.hxx
+..\inc\drawinglayer\attribute\fillhatchattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fillhatchattribute.hxx
..\inc\drawinglayer\attribute\fillbitmapattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fillbitmapattribute.hxx
..\inc\drawinglayer\attribute\fontattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fontattribute.hxx
..\inc\drawinglayer\attribute\materialattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\materialattribute3d.hxx
..\inc\drawinglayer\attribute\sdrallattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrallattribute3d.hxx
-..\inc\drawinglayer\attribute\sdrattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrattribute.hxx
-..\inc\drawinglayer\attribute\sdrattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrattribute3d.hxx
+..\inc\drawinglayer\attribute\sdrlineattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrlineattribute.hxx
+..\inc\drawinglayer\attribute\sdrlinestartendattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrlinestartendattribute.hxx
+..\inc\drawinglayer\attribute\sdrshadowattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrshadowattribute.hxx
+..\inc\drawinglayer\attribute\sdrfillattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrfillattribute.hxx
+..\inc\drawinglayer\attribute\sdrobjectattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrobjectattribute3d.hxx
+..\inc\drawinglayer\attribute\sdrlightattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrlightattribute3d.hxx
+..\inc\drawinglayer\attribute\sdrlightingattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrlightingattribute3d.hxx
+..\inc\drawinglayer\attribute\sdrsceneattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrsceneattribute3d.hxx
..\inc\drawinglayer\attribute\sdrfillbitmapattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrfillbitmapattribute.hxx
..\inc\drawinglayer\attribute\strokeattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\strokeattribute.hxx
..\inc\drawinglayer\attribute\lineattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\lineattribute.hxx
diff --git a/drawinglayer/source/attribute/fillattribute.cxx b/drawinglayer/source/attribute/fillattribute.cxx
deleted file mode 100644
index 12741e40c5c3..000000000000
--- a/drawinglayer/source/attribute/fillattribute.cxx
+++ /dev/null
@@ -1,102 +0,0 @@
-/*************************************************************************
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: fillattribute.cxx,v $
- *
- * $Revision: 1.4 $
- *
- * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
- *
- * 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
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_drawinglayer.hxx"
-
-#include <drawinglayer/attribute/fillattribute.hxx>
-#include <basegfx/numeric/ftools.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- 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),
- mfBorder(fBorder),
- mfOffsetX(fOffsetX),
- mfOffsetY(fOffsetY),
- mfAngle(fAngle),
- meStyle(eStyle),
- mnSteps(nSteps)
- {
- }
-
- bool FillGradientAttribute::operator==(const FillGradientAttribute& rCandidate) const
- {
- return (meStyle == rCandidate.meStyle
- && maStartColor == rCandidate.maStartColor
- && maEndColor == rCandidate.maEndColor
- && mfBorder == rCandidate.mfBorder
- && mfOffsetX == rCandidate.mfOffsetX
- && mfOffsetY == rCandidate.mfOffsetY
- && mfAngle == rCandidate.mfAngle
- && mnSteps == rCandidate.mnSteps);
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- FillHatchAttribute::FillHatchAttribute(HatchStyle eStyle, double fDistance, double fAngle, const basegfx::BColor& rColor, bool bFillBackground)
- : mfDistance(fDistance),
- mfAngle(fAngle),
- maColor(rColor),
- meStyle(eStyle),
- mbFillBackground(bFillBackground)
- {
- }
-
- bool FillHatchAttribute::operator==(const FillHatchAttribute& rCandidate) const
- {
- return (meStyle == rCandidate.meStyle
- && mfDistance == rCandidate.mfDistance
- && mfAngle == rCandidate.mfAngle
- && maColor == rCandidate.maColor
- && mbFillBackground == rCandidate.mbFillBackground);
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/drawinglayer/source/attribute/fillbitmapattribute.cxx b/drawinglayer/source/attribute/fillbitmapattribute.cxx
index 99afb234bda5..becd43c24a13 100644
--- a/drawinglayer/source/attribute/fillbitmapattribute.cxx
+++ b/drawinglayer/source/attribute/fillbitmapattribute.cxx
@@ -37,6 +37,7 @@
#include "precompiled_drawinglayer.hxx"
#include <drawinglayer/attribute/fillbitmapattribute.hxx>
+#include <vcl/bitmapex.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -44,25 +45,161 @@ namespace drawinglayer
{
namespace attribute
{
+ class ImpFillBitmapAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // data definitions
+ BitmapEx maBitmapEx;
+ basegfx::B2DPoint maTopLeft;
+ basegfx::B2DVector maSize;
+
+ // bitfield
+ unsigned mbTiling : 1;
+
+ ImpFillBitmapAttribute(
+ const BitmapEx& rBitmapEx,
+ const basegfx::B2DPoint& rTopLeft,
+ const basegfx::B2DVector& rSize,
+ bool bTiling)
+ : mnRefCount(0),
+ maBitmapEx(rBitmapEx),
+ maTopLeft(rTopLeft),
+ maSize(rSize),
+ mbTiling(bTiling)
+ {
+ }
+
+ bool operator==(const ImpFillBitmapAttribute& rCandidate) const
+ {
+ return (maBitmapEx == rCandidate.maBitmapEx
+ && maTopLeft == rCandidate.maTopLeft
+ && maSize == rCandidate.maSize
+ && mbTiling == rCandidate.mbTiling);
+ }
+
+ // data read access
+ const BitmapEx& getBitmapEx() const { return maBitmapEx; }
+ const basegfx::B2DPoint& getTopLeft() const { return maTopLeft; }
+ const basegfx::B2DVector& getSize() const { return maSize; }
+ bool getTiling() const { return mbTiling; }
+
+ static ImpFillBitmapAttribute* get_global_default()
+ {
+ static ImpFillBitmapAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpFillBitmapAttribute(
+ BitmapEx(),
+ basegfx::B2DPoint(),
+ basegfx::B2DVector(),
+ false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
FillBitmapAttribute::FillBitmapAttribute(
const BitmapEx& rBitmapEx,
const basegfx::B2DPoint& rTopLeft,
const basegfx::B2DVector& rSize,
bool bTiling)
- : maBitmapEx(rBitmapEx),
- maTopLeft(rTopLeft),
- maSize(rSize),
- mbTiling(bTiling)
+ : mpFillBitmapAttribute(new ImpFillBitmapAttribute(
+ rBitmapEx, rTopLeft, rSize, bTiling))
{
}
+ FillBitmapAttribute::FillBitmapAttribute()
+ : mpFillBitmapAttribute(ImpFillBitmapAttribute::get_global_default())
+ {
+ mpFillBitmapAttribute->mnRefCount++;
+ }
+
+ FillBitmapAttribute::FillBitmapAttribute(const FillBitmapAttribute& rCandidate)
+ : mpFillBitmapAttribute(rCandidate.mpFillBitmapAttribute)
+ {
+ mpFillBitmapAttribute->mnRefCount++;
+ }
+
+ FillBitmapAttribute::~FillBitmapAttribute()
+ {
+ if(mpFillBitmapAttribute->mnRefCount)
+ {
+ mpFillBitmapAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpFillBitmapAttribute;
+ }
+ }
+
+ bool FillBitmapAttribute::isDefault() const
+ {
+ return mpFillBitmapAttribute == ImpFillBitmapAttribute::get_global_default();
+ }
+
+ FillBitmapAttribute& FillBitmapAttribute::operator=(const FillBitmapAttribute& rCandidate)
+ {
+ if(rCandidate.mpFillBitmapAttribute != mpFillBitmapAttribute)
+ {
+ if(mpFillBitmapAttribute->mnRefCount)
+ {
+ mpFillBitmapAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpFillBitmapAttribute;
+ }
+
+ mpFillBitmapAttribute = rCandidate.mpFillBitmapAttribute;
+ mpFillBitmapAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
bool FillBitmapAttribute::operator==(const FillBitmapAttribute& rCandidate) const
{
- return (getBitmapEx() == rCandidate.getBitmapEx()
- && getTopLeft() == rCandidate.getTopLeft()
- && getSize() == rCandidate.getSize()
- && getTiling() == rCandidate.getTiling());
+ if(rCandidate.mpFillBitmapAttribute == mpFillBitmapAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpFillBitmapAttribute == *mpFillBitmapAttribute);
+ }
+
+ const BitmapEx& FillBitmapAttribute::getBitmapEx() const
+ {
+ return mpFillBitmapAttribute->getBitmapEx();
}
+
+ const basegfx::B2DPoint& FillBitmapAttribute::getTopLeft() const
+ {
+ return mpFillBitmapAttribute->getTopLeft();
+ }
+
+ const basegfx::B2DVector& FillBitmapAttribute::getSize() const
+ {
+ return mpFillBitmapAttribute->getSize();
+ }
+
+ bool FillBitmapAttribute::getTiling() const
+ {
+ return mpFillBitmapAttribute->getTiling();
+ }
+
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/attribute/fillgradientattribute.cxx b/drawinglayer/source/attribute/fillgradientattribute.cxx
new file mode 100644
index 000000000000..17e0cd6c098b
--- /dev/null
+++ b/drawinglayer/source/attribute/fillgradientattribute.cxx
@@ -0,0 +1,250 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: fillattribute.cxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+#include <basegfx/color/bcolor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpFillGradientAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // data definitions
+ GradientStyle meStyle;
+ double mfBorder;
+ double mfOffsetX;
+ double mfOffsetY;
+ double mfAngle;
+ basegfx::BColor maStartColor;
+ basegfx::BColor maEndColor;
+ sal_uInt16 mnSteps;
+
+ ImpFillGradientAttribute(
+ GradientStyle eStyle,
+ double fBorder,
+ double fOffsetX,
+ double fOffsetY,
+ double fAngle,
+ const basegfx::BColor& rStartColor,
+ const basegfx::BColor& rEndColor,
+ sal_uInt16 nSteps)
+ : mnRefCount(0),
+ meStyle(eStyle),
+ mfBorder(fBorder),
+ mfOffsetX(fOffsetX),
+ mfOffsetY(fOffsetY),
+ mfAngle(fAngle),
+ maStartColor(rStartColor),
+ maEndColor(rEndColor),
+ mnSteps(nSteps)
+ {
+ }
+
+ // data read access
+ GradientStyle getStyle() const { return meStyle; }
+ double getBorder() const { return mfBorder; }
+ double getOffsetX() const { return mfOffsetX; }
+ double getOffsetY() const { return mfOffsetY; }
+ double getAngle() const { return mfAngle; }
+ const basegfx::BColor& getStartColor() const { return maStartColor; }
+ const basegfx::BColor& getEndColor() const { return maEndColor; }
+ sal_uInt16 getSteps() const { return mnSteps; }
+
+ bool operator==(const ImpFillGradientAttribute& rCandidate) const
+ {
+ return (getStyle() == rCandidate.getStyle()
+ && getBorder() == rCandidate.getBorder()
+ && getOffsetX() == rCandidate.getOffsetX()
+ && getOffsetY() == rCandidate.getOffsetY()
+ && getAngle() == rCandidate.getAngle()
+ && getStartColor() == rCandidate.getStartColor()
+ && getEndColor() == rCandidate.getEndColor()
+ && getSteps() == rCandidate.getSteps());
+ }
+
+ static ImpFillGradientAttribute* get_global_default()
+ {
+ static ImpFillGradientAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpFillGradientAttribute(
+ GRADIENTSTYLE_LINEAR,
+ 0.0, 0.0, 0.0, 0.0,
+ basegfx::BColor(),
+ basegfx::BColor(),
+ 0);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ FillGradientAttribute::FillGradientAttribute(
+ GradientStyle eStyle,
+ double fBorder,
+ double fOffsetX,
+ double fOffsetY,
+ double fAngle,
+ const basegfx::BColor& rStartColor,
+ const basegfx::BColor& rEndColor,
+ sal_uInt16 nSteps)
+ : mpFillGradientAttribute(new ImpFillGradientAttribute(
+ eStyle, fBorder, fOffsetX, fOffsetY, fAngle, rStartColor, rEndColor, nSteps))
+ {
+ }
+
+ FillGradientAttribute::FillGradientAttribute()
+ : mpFillGradientAttribute(ImpFillGradientAttribute::get_global_default())
+ {
+ mpFillGradientAttribute->mnRefCount++;
+ }
+
+ FillGradientAttribute::FillGradientAttribute(const FillGradientAttribute& rCandidate)
+ : mpFillGradientAttribute(rCandidate.mpFillGradientAttribute)
+ {
+ mpFillGradientAttribute->mnRefCount++;
+ }
+
+ FillGradientAttribute::~FillGradientAttribute()
+ {
+ if(mpFillGradientAttribute->mnRefCount)
+ {
+ mpFillGradientAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpFillGradientAttribute;
+ }
+ }
+
+ bool FillGradientAttribute::isDefault() const
+ {
+ return mpFillGradientAttribute == ImpFillGradientAttribute::get_global_default();
+ }
+
+ FillGradientAttribute& FillGradientAttribute::operator=(const FillGradientAttribute& rCandidate)
+ {
+ if(rCandidate.mpFillGradientAttribute != mpFillGradientAttribute)
+ {
+ if(mpFillGradientAttribute->mnRefCount)
+ {
+ mpFillGradientAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpFillGradientAttribute;
+ }
+
+ mpFillGradientAttribute = rCandidate.mpFillGradientAttribute;
+ mpFillGradientAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool FillGradientAttribute::operator==(const FillGradientAttribute& rCandidate) const
+ {
+ if(rCandidate.mpFillGradientAttribute == mpFillGradientAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpFillGradientAttribute == *mpFillGradientAttribute);
+ }
+
+ const basegfx::BColor& FillGradientAttribute::getStartColor() const
+ {
+ return mpFillGradientAttribute->getStartColor();
+ }
+
+ const basegfx::BColor& FillGradientAttribute::getEndColor() const
+ {
+ return mpFillGradientAttribute->getEndColor();
+ }
+
+ double FillGradientAttribute::getBorder() const
+ {
+ return mpFillGradientAttribute->getBorder();
+ }
+
+ double FillGradientAttribute::getOffsetX() const
+ {
+ return mpFillGradientAttribute->getOffsetX();
+ }
+
+ double FillGradientAttribute::getOffsetY() const
+ {
+ return mpFillGradientAttribute->getOffsetY();
+ }
+
+ double FillGradientAttribute::getAngle() const
+ {
+ return mpFillGradientAttribute->getAngle();
+ }
+
+ GradientStyle FillGradientAttribute::getStyle() const
+ {
+ return mpFillGradientAttribute->getStyle();
+ }
+
+ sal_uInt16 FillGradientAttribute::getSteps() const
+ {
+ return mpFillGradientAttribute->getSteps();
+ }
+
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/fillhatchattribute.cxx b/drawinglayer/source/attribute/fillhatchattribute.cxx
new file mode 100644
index 000000000000..4a82ef5594ab
--- /dev/null
+++ b/drawinglayer/source/attribute/fillhatchattribute.cxx
@@ -0,0 +1,219 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: fillattribute.cxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/fillhatchattribute.hxx>
+#include <basegfx/color/bcolor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpFillHatchAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // data definitions
+ HatchStyle meStyle;
+ double mfDistance;
+ double mfAngle;
+ basegfx::BColor maColor;
+
+ // bitfield
+ unsigned mbFillBackground : 1;
+
+ ImpFillHatchAttribute(
+ HatchStyle eStyle,
+ double fDistance,
+ double fAngle,
+ const basegfx::BColor& rColor,
+ bool bFillBackground)
+ : mnRefCount(0),
+ meStyle(eStyle),
+ mfDistance(fDistance),
+ mfAngle(fAngle),
+ maColor(rColor),
+ mbFillBackground(bFillBackground)
+ {
+ }
+
+ // data read access
+ HatchStyle getStyle() const { return meStyle; }
+ double getDistance() const { return mfDistance; }
+ double getAngle() const { return mfAngle; }
+ const basegfx::BColor& getColor() const { return maColor; }
+ bool isFillBackground() const { return mbFillBackground; }
+
+ bool operator==(const ImpFillHatchAttribute& rCandidate) const
+ {
+ return (getStyle() == rCandidate.getStyle()
+ && getDistance() == rCandidate.getDistance()
+ && getAngle() == rCandidate.getAngle()
+ && getColor() == rCandidate.getColor()
+ && isFillBackground() == rCandidate.isFillBackground());
+ }
+
+ static ImpFillHatchAttribute* get_global_default()
+ {
+ static ImpFillHatchAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpFillHatchAttribute(
+ HATCHSTYLE_SINGLE,
+ 0.0, 0.0,
+ basegfx::BColor(),
+ false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ FillHatchAttribute::FillHatchAttribute(
+ HatchStyle eStyle,
+ double fDistance,
+ double fAngle,
+ const basegfx::BColor& rColor,
+ bool bFillBackground)
+ : mpFillHatchAttribute(new ImpFillHatchAttribute(
+ eStyle, fDistance, fAngle, rColor, bFillBackground))
+ {
+ }
+
+ FillHatchAttribute::FillHatchAttribute()
+ : mpFillHatchAttribute(ImpFillHatchAttribute::get_global_default())
+ {
+ mpFillHatchAttribute->mnRefCount++;
+ }
+
+ FillHatchAttribute::FillHatchAttribute(const FillHatchAttribute& rCandidate)
+ : mpFillHatchAttribute(rCandidate.mpFillHatchAttribute)
+ {
+ mpFillHatchAttribute->mnRefCount++;
+ }
+
+ FillHatchAttribute::~FillHatchAttribute()
+ {
+ if(mpFillHatchAttribute->mnRefCount)
+ {
+ mpFillHatchAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpFillHatchAttribute;
+ }
+ }
+
+ bool FillHatchAttribute::isDefault() const
+ {
+ return mpFillHatchAttribute == ImpFillHatchAttribute::get_global_default();
+ }
+
+ FillHatchAttribute& FillHatchAttribute::operator=(const FillHatchAttribute& rCandidate)
+ {
+ if(rCandidate.mpFillHatchAttribute != mpFillHatchAttribute)
+ {
+ if(mpFillHatchAttribute->mnRefCount)
+ {
+ mpFillHatchAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpFillHatchAttribute;
+ }
+
+ mpFillHatchAttribute = rCandidate.mpFillHatchAttribute;
+ mpFillHatchAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool FillHatchAttribute::operator==(const FillHatchAttribute& rCandidate) const
+ {
+ if(rCandidate.mpFillHatchAttribute == mpFillHatchAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpFillHatchAttribute == *mpFillHatchAttribute);
+ }
+
+ // data read access
+ HatchStyle FillHatchAttribute::getStyle() const
+ {
+ return mpFillHatchAttribute->getStyle();
+ }
+
+ double FillHatchAttribute::getDistance() const
+ {
+ return mpFillHatchAttribute->getDistance();
+ }
+
+ double FillHatchAttribute::getAngle() const
+ {
+ return mpFillHatchAttribute->getAngle();
+ }
+
+ const basegfx::BColor& FillHatchAttribute::getColor() const
+ {
+ return mpFillHatchAttribute->getColor();
+ }
+
+ bool FillHatchAttribute::isFillBackground() const
+ {
+ return mpFillHatchAttribute->isFillBackground();
+ }
+
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/fontattribute.cxx b/drawinglayer/source/attribute/fontattribute.cxx
index 5163e2f6a59a..2439d9894a70 100644
--- a/drawinglayer/source/attribute/fontattribute.cxx
+++ b/drawinglayer/source/attribute/fontattribute.cxx
@@ -37,6 +37,7 @@
#include "precompiled_drawinglayer.hxx"
#include <drawinglayer/attribute/fontattribute.hxx>
+#include <tools/string.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -44,18 +45,215 @@ namespace drawinglayer
{
namespace attribute
{
- bool FontAttribute::operator==(const FontAttribute& rCompare) const
- {
- return (getFamilyName() == rCompare.getFamilyName()
- && getStyleName() == rCompare.getStyleName()
- && getWeight() == rCompare.getWeight()
- && getSymbol() == rCompare.getSymbol()
- && getVertical() == rCompare.getVertical()
- && getItalic() == rCompare.getItalic()
- && getOutline() == rCompare.getOutline()
- && getRTL() == rCompare.getRTL()
- && getBiDiStrong() == rCompare.getBiDiStrong());
+ class ImpFontAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ /// core data
+ String maFamilyName; // Font Family Name
+ String maStyleName; // Font Style Name
+ sal_uInt16 mnWeight; // Font weight
+
+ /// bitfield
+ unsigned mbSymbol : 1; // Symbol Font Flag
+ unsigned mbVertical : 1; // Vertical Text Flag
+ unsigned mbItalic : 1; // Italic Flag
+ unsigned mbOutline : 1; // Outline Flag
+ unsigned mbRTL : 1; // RTL Flag
+ unsigned mbBiDiStrong : 1; // BiDi Flag
+
+ ImpFontAttribute(
+ const String& rFamilyName,
+ const String& rStyleName,
+ sal_uInt16 nWeight,
+ bool bSymbol,
+ bool bVertical,
+ bool bItalic,
+ bool bOutline,
+ bool bRTL,
+ bool bBiDiStrong)
+ : mnRefCount(0),
+ maFamilyName(rFamilyName),
+ maStyleName(rStyleName),
+ mnWeight(nWeight),
+ mbSymbol(bSymbol),
+ mbVertical(bVertical),
+ mbItalic(bItalic),
+ mbOutline(bOutline),
+ mbRTL(bRTL),
+ mbBiDiStrong(bBiDiStrong)
+ {
+ }
+
+ // data read access
+ const String& getFamilyName() const { return maFamilyName; }
+ const String& getStyleName() const { return maStyleName; }
+ sal_uInt16 getWeight() const { return mnWeight; }
+ bool getSymbol() const { return mbSymbol; }
+ bool getVertical() const { return mbVertical; }
+ bool getItalic() const { return mbItalic; }
+ bool getOutline() const { return mbOutline; }
+ bool getRTL() const { return mbRTL; }
+ bool getBiDiStrong() const { return mbBiDiStrong; }
+
+ bool operator==(const ImpFontAttribute& rCompare) const
+ {
+ return (getFamilyName() == rCompare.getFamilyName()
+ && getStyleName() == rCompare.getStyleName()
+ && getWeight() == rCompare.getWeight()
+ && getSymbol() == rCompare.getSymbol()
+ && getVertical() == rCompare.getVertical()
+ && getItalic() == rCompare.getItalic()
+ && getOutline() == rCompare.getOutline()
+ && getRTL() == rCompare.getRTL()
+ && getBiDiStrong() == rCompare.getBiDiStrong());
+ }
+
+ static ImpFontAttribute* get_global_default()
+ {
+ static ImpFontAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpFontAttribute(
+ String(), String(),
+ 0,
+ false, false, false, false, false, false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ FontAttribute::FontAttribute(
+ const String& rFamilyName,
+ const String& rStyleName,
+ sal_uInt16 nWeight,
+ bool bSymbol,
+ bool bVertical,
+ bool bItalic,
+ bool bOutline,
+ bool bRTL,
+ bool bBiDiStrong)
+ : mpFontAttribute(new ImpFontAttribute(
+ rFamilyName, rStyleName, nWeight, bSymbol, bVertical, bItalic, bOutline, bRTL, bBiDiStrong))
+ {
+ }
+
+ FontAttribute::FontAttribute()
+ : mpFontAttribute(ImpFontAttribute::get_global_default())
+ {
+ mpFontAttribute->mnRefCount++;
+ }
+
+ FontAttribute::FontAttribute(const FontAttribute& rCandidate)
+ : mpFontAttribute(rCandidate.mpFontAttribute)
+ {
+ mpFontAttribute->mnRefCount++;
+ }
+
+ FontAttribute::~FontAttribute()
+ {
+ if(mpFontAttribute->mnRefCount)
+ {
+ mpFontAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpFontAttribute;
+ }
+ }
+
+ bool FontAttribute::isDefault() const
+ {
+ return mpFontAttribute == ImpFontAttribute::get_global_default();
+ }
+
+ FontAttribute& FontAttribute::operator=(const FontAttribute& rCandidate)
+ {
+ if(rCandidate.mpFontAttribute != mpFontAttribute)
+ {
+ if(mpFontAttribute->mnRefCount)
+ {
+ mpFontAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpFontAttribute;
+ }
+
+ mpFontAttribute = rCandidate.mpFontAttribute;
+ mpFontAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool FontAttribute::operator==(const FontAttribute& rCandidate) const
+ {
+ if(rCandidate.mpFontAttribute == mpFontAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpFontAttribute == *mpFontAttribute);
+ }
+
+ const String& FontAttribute::getFamilyName() const
+ {
+ return mpFontAttribute->getFamilyName();
+ }
+
+ const String& FontAttribute::getStyleName() const
+ {
+ return mpFontAttribute->getStyleName();
+ }
+
+ sal_uInt16 FontAttribute::getWeight() const
+ {
+ return mpFontAttribute->getWeight();
}
+
+ bool FontAttribute::getSymbol() const
+ {
+ return mpFontAttribute->getSymbol();
+ }
+
+ bool FontAttribute::getVertical() const
+ {
+ return mpFontAttribute->getVertical();
+ }
+
+ bool FontAttribute::getItalic() const
+ {
+ return mpFontAttribute->getItalic();
+ }
+
+ bool FontAttribute::getOutline() const
+ {
+ return mpFontAttribute->getOutline();
+ }
+
+ bool FontAttribute::getRTL() const
+ {
+ return mpFontAttribute->getRTL();
+ }
+
+ bool FontAttribute::getBiDiStrong() const
+ {
+ return mpFontAttribute->getBiDiStrong();
+ }
+
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/attribute/lineattribute.cxx b/drawinglayer/source/attribute/lineattribute.cxx
index 5ab44b73db82..2a346599db8f 100644
--- a/drawinglayer/source/attribute/lineattribute.cxx
+++ b/drawinglayer/source/attribute/lineattribute.cxx
@@ -37,6 +37,7 @@
#include "precompiled_drawinglayer.hxx"
#include <drawinglayer/attribute/lineattribute.hxx>
+#include <basegfx/color/bcolor.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -44,6 +45,147 @@ namespace drawinglayer
{
namespace attribute
{
+ class ImpLineAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // data definitions
+ basegfx::BColor maColor; // color
+ double mfWidth; // absolute line width
+ basegfx::B2DLineJoin meLineJoin; // type of LineJoin
+
+ ImpLineAttribute(
+ const basegfx::BColor& rColor,
+ double fWidth,
+ basegfx::B2DLineJoin aB2DLineJoin)
+ : mnRefCount(0),
+ maColor(rColor),
+ mfWidth(fWidth),
+ meLineJoin(aB2DLineJoin)
+ {
+ }
+
+ // data read access
+ const basegfx::BColor& getColor() const { return maColor; }
+ double getWidth() const { return mfWidth; }
+ basegfx::B2DLineJoin getLineJoin() const { return meLineJoin; }
+
+ bool operator==(const ImpLineAttribute& rCandidate) const
+ {
+ return (getColor() == rCandidate.getColor()
+ && getWidth() == rCandidate.getWidth()
+ && getLineJoin() == rCandidate.getLineJoin());
+ }
+
+ static ImpLineAttribute* get_global_default()
+ {
+ static ImpLineAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpLineAttribute(
+ basegfx::BColor(),
+ 0.0,
+ basegfx::B2DLINEJOIN_ROUND);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ LineAttribute::LineAttribute(
+ const basegfx::BColor& rColor,
+ double fWidth,
+ basegfx::B2DLineJoin aB2DLineJoin)
+ : mpLineAttribute(new ImpLineAttribute(
+ rColor, fWidth, aB2DLineJoin))
+ {
+ }
+
+ LineAttribute::LineAttribute()
+ : mpLineAttribute(ImpLineAttribute::get_global_default())
+ {
+ mpLineAttribute->mnRefCount++;
+ }
+
+ LineAttribute::LineAttribute(const LineAttribute& rCandidate)
+ : mpLineAttribute(rCandidate.mpLineAttribute)
+ {
+ mpLineAttribute->mnRefCount++;
+ }
+
+ LineAttribute::~LineAttribute()
+ {
+ if(mpLineAttribute->mnRefCount)
+ {
+ mpLineAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpLineAttribute;
+ }
+ }
+
+ bool LineAttribute::isDefault() const
+ {
+ return mpLineAttribute == ImpLineAttribute::get_global_default();
+ }
+
+ LineAttribute& LineAttribute::operator=(const LineAttribute& rCandidate)
+ {
+ if(rCandidate.mpLineAttribute != mpLineAttribute)
+ {
+ if(mpLineAttribute->mnRefCount)
+ {
+ mpLineAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpLineAttribute;
+ }
+
+ mpLineAttribute = rCandidate.mpLineAttribute;
+ mpLineAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool LineAttribute::operator==(const LineAttribute& rCandidate) const
+ {
+ if(rCandidate.mpLineAttribute == mpLineAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpLineAttribute == *mpLineAttribute);
+ }
+
+ const basegfx::BColor& LineAttribute::getColor() const
+ {
+ return mpLineAttribute->getColor();
+ }
+
+ double LineAttribute::getWidth() const
+ {
+ return mpLineAttribute->getWidth();
+ }
+
+ basegfx::B2DLineJoin LineAttribute::getLineJoin() const
+ {
+ return mpLineAttribute->getLineJoin();
+ }
+
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/attribute/linestartendattribute.cxx b/drawinglayer/source/attribute/linestartendattribute.cxx
index 785819870114..3d93a6471cb7 100644
--- a/drawinglayer/source/attribute/linestartendattribute.cxx
+++ b/drawinglayer/source/attribute/linestartendattribute.cxx
@@ -38,6 +38,7 @@
#include <drawinglayer/attribute/linestartendattribute.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -45,11 +46,154 @@ namespace drawinglayer
{
namespace attribute
{
+ class ImpLineStartEndAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // data definitions
+ double mfWidth; // absolute line StartEndGeometry base width
+ basegfx::B2DPolyPolygon maPolyPolygon; // the StartEndGeometry PolyPolygon
+
+ // bitfield
+ unsigned mbCentered : 1; // use centered to ineStart/End point?
+
+ ImpLineStartEndAttribute(
+ double fWidth,
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ bool bCentered)
+ : mnRefCount(0),
+ mfWidth(fWidth),
+ maPolyPolygon(rPolyPolygon),
+ mbCentered(bCentered)
+ {
+ }
+
+ // data read access
+ double getWidth() const { return mfWidth; }
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
+ bool isCentered() const { return mbCentered; }
+
+ bool operator==(const ImpLineStartEndAttribute& rCandidate) const
+ {
+ return (basegfx::fTools::equal(getWidth(), rCandidate.getWidth())
+ && getB2DPolyPolygon() == rCandidate.getB2DPolyPolygon()
+ && isCentered() == rCandidate.isCentered());
+ }
+
+ static ImpLineStartEndAttribute* get_global_default()
+ {
+ static ImpLineStartEndAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpLineStartEndAttribute(
+ 0.0,
+ basegfx::B2DPolyPolygon(),
+ false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ LineStartEndAttribute::LineStartEndAttribute(
+ double fWidth,
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ bool bCentered)
+ : mpLineStartEndAttribute(new ImpLineStartEndAttribute(
+ fWidth, rPolyPolygon, bCentered))
+ {
+ }
+
+ LineStartEndAttribute::LineStartEndAttribute()
+ : mpLineStartEndAttribute(ImpLineStartEndAttribute::get_global_default())
+ {
+ mpLineStartEndAttribute->mnRefCount++;
+ }
+
+ LineStartEndAttribute::LineStartEndAttribute(const LineStartEndAttribute& rCandidate)
+ : mpLineStartEndAttribute(rCandidate.mpLineStartEndAttribute)
+ {
+ mpLineStartEndAttribute->mnRefCount++;
+ }
+
+ LineStartEndAttribute::~LineStartEndAttribute()
+ {
+ if(mpLineStartEndAttribute->mnRefCount)
+ {
+ mpLineStartEndAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpLineStartEndAttribute;
+ }
+ }
+
+ bool LineStartEndAttribute::isDefault() const
+ {
+ return mpLineStartEndAttribute == ImpLineStartEndAttribute::get_global_default();
+ }
+
+ LineStartEndAttribute& LineStartEndAttribute::operator=(const LineStartEndAttribute& rCandidate)
+ {
+ if(rCandidate.mpLineStartEndAttribute != mpLineStartEndAttribute)
+ {
+ if(mpLineStartEndAttribute->mnRefCount)
+ {
+ mpLineStartEndAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpLineStartEndAttribute;
+ }
+
+ mpLineStartEndAttribute = rCandidate.mpLineStartEndAttribute;
+ mpLineStartEndAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool LineStartEndAttribute::operator==(const LineStartEndAttribute& rCandidate) const
+ {
+ if(rCandidate.mpLineStartEndAttribute == mpLineStartEndAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpLineStartEndAttribute == *mpLineStartEndAttribute);
+ }
+
+ double LineStartEndAttribute::getWidth() const
+ {
+ return mpLineStartEndAttribute->getWidth();
+ }
+
+ const basegfx::B2DPolyPolygon& LineStartEndAttribute::getB2DPolyPolygon() const
+ {
+ return mpLineStartEndAttribute->getB2DPolyPolygon();
+ }
+
+ bool LineStartEndAttribute::isCentered() const
+ {
+ return mpLineStartEndAttribute->isCentered();
+ }
+
bool LineStartEndAttribute::isActive() const
{
return (0.0 != getWidth()
- && 0.0 != getB2DPolyPolygon().count()
- && 0.0 != getB2DPolyPolygon().getB2DPolygon(0L).count());
+ && 0 != getB2DPolyPolygon().count()
+ && 0 != getB2DPolyPolygon().getB2DPolygon(0).count());
}
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/attribute/makefile.mk b/drawinglayer/source/attribute/makefile.mk
index 65f899f67177..83eaa193bb4e 100644
--- a/drawinglayer/source/attribute/makefile.mk
+++ b/drawinglayer/source/attribute/makefile.mk
@@ -45,16 +45,23 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files -------------------------------------
SLOFILES= \
- $(SLO)$/fillattribute.obj \
- $(SLO)$/fillbitmapattribute.obj \
- $(SLO)$/fontattribute.obj \
- $(SLO)$/materialattribute3d.obj \
- $(SLO)$/sdrallattribute3d.obj \
- $(SLO)$/sdrattribute.obj \
- $(SLO)$/sdrattribute3d.obj \
- $(SLO)$/sdrfillbitmapattribute.obj \
- $(SLO)$/lineattribute.obj \
- $(SLO)$/linestartendattribute.obj \
+ $(SLO)$/fillgradientattribute.obj \
+ $(SLO)$/fillhatchattribute.obj \
+ $(SLO)$/fillbitmapattribute.obj \
+ $(SLO)$/fontattribute.obj \
+ $(SLO)$/materialattribute3d.obj \
+ $(SLO)$/sdrallattribute3d.obj \
+ $(SLO)$/sdrlineattribute.obj \
+ $(SLO)$/sdrlinestartendattribute.obj \
+ $(SLO)$/sdrshadowattribute.obj \
+ $(SLO)$/sdrfillattribute.obj \
+ $(SLO)$/sdrobjectattribute3d.obj \
+ $(SLO)$/sdrlightattribute3d.obj \
+ $(SLO)$/sdrlightingattribute3d.obj \
+ $(SLO)$/sdrsceneattribute3d.obj \
+ $(SLO)$/sdrfillbitmapattribute.obj \
+ $(SLO)$/lineattribute.obj \
+ $(SLO)$/linestartendattribute.obj \
$(SLO)$/strokeattribute.obj
# --- Targets ----------------------------------
diff --git a/drawinglayer/source/attribute/materialattribute3d.cxx b/drawinglayer/source/attribute/materialattribute3d.cxx
index bc3e8f3b317b..27bd5d5a1b1a 100644
--- a/drawinglayer/source/attribute/materialattribute3d.cxx
+++ b/drawinglayer/source/attribute/materialattribute3d.cxx
@@ -48,74 +48,87 @@ namespace drawinglayer
class ImpMaterialAttribute3D
{
public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
// materialAttribute3D definitions
basegfx::BColor maColor; // object color
basegfx::BColor maSpecular; // material specular color
basegfx::BColor maEmission; // material emissive color
- sal_uInt16 mnSpecularIntensity; // material specular intensity [0..128]
-
- // refcounter
- sal_uInt32 mnRefCount;
+ sal_uInt16 mnSpecularIntensity; // material specular intensity [0..128]
ImpMaterialAttribute3D(const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity)
- : maColor(rColor),
+ : mnRefCount(0),
+ maColor(rColor),
maSpecular(rSpecular),
maEmission(rEmission),
- mnSpecularIntensity(nSpecularIntensity),
- mnRefCount(0L)
+ mnSpecularIntensity(nSpecularIntensity)
{
}
ImpMaterialAttribute3D(const basegfx::BColor& rColor)
- : maColor(rColor),
+ : mnRefCount(0),
+ maColor(rColor),
maSpecular(1.0, 1.0, 1.0),
maEmission(),
- mnSpecularIntensity(15),
- mnRefCount(0L)
+ mnSpecularIntensity(15)
{
}
- ImpMaterialAttribute3D()
- : mnSpecularIntensity(0),
- mnRefCount(0L)
- {
- }
+ // data read access
+ const basegfx::BColor& getColor() const { return maColor; }
+ const basegfx::BColor& getSpecular() const { return maSpecular; }
+ const basegfx::BColor& getEmission() const { return maEmission; }
+ sal_uInt16 getSpecularIntensity() const { return mnSpecularIntensity; }
bool operator==(const ImpMaterialAttribute3D& rCandidate) const
{
- return (maColor == rCandidate.maColor
- && maSpecular == rCandidate.maSpecular
- && maEmission == rCandidate.maEmission
- && mnSpecularIntensity == rCandidate.mnSpecularIntensity);
+ return (getColor() == rCandidate.getColor()
+ && getSpecular() == rCandidate.getSpecular()
+ && getEmission() == rCandidate.getEmission()
+ && getSpecularIntensity() == rCandidate.getSpecularIntensity());
}
- const basegfx::BColor& getColor() const { return maColor; }
- const basegfx::BColor& getSpecular() const { return maSpecular; }
- const basegfx::BColor& getEmission() const { return maEmission; }
- sal_uInt16 getSpecularIntensity() const { return mnSpecularIntensity; }
- };
- } // end of anonymous namespace
-} // end of namespace drawinglayer
+ static ImpMaterialAttribute3D* get_global_default()
+ {
+ static ImpMaterialAttribute3D* pDefault = 0;
-//////////////////////////////////////////////////////////////////////////////
+ if(!pDefault)
+ {
+ pDefault = new ImpMaterialAttribute3D(
+ basegfx::BColor(),
+ basegfx::BColor(),
+ basegfx::BColor(),
+ 0);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
-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))
+ return pDefault;
+ }
+ };
+
+ 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)
+ MaterialAttribute3D::MaterialAttribute3D(
+ const basegfx::BColor& rColor)
: mpMaterialAttribute3D(new ImpMaterialAttribute3D(rColor))
{
}
MaterialAttribute3D::MaterialAttribute3D()
- : mpMaterialAttribute3D(new ImpMaterialAttribute3D())
+ : mpMaterialAttribute3D(ImpMaterialAttribute3D::get_global_default())
{
+ mpMaterialAttribute3D->mnRefCount++;
}
MaterialAttribute3D::MaterialAttribute3D(const MaterialAttribute3D& rCandidate)
@@ -136,6 +149,11 @@ namespace drawinglayer
}
}
+ bool MaterialAttribute3D::isDefault() const
+ {
+ return mpMaterialAttribute3D == ImpMaterialAttribute3D::get_global_default();
+ }
+
MaterialAttribute3D& MaterialAttribute3D::operator=(const MaterialAttribute3D& rCandidate)
{
if(rCandidate.mpMaterialAttribute3D != mpMaterialAttribute3D)
@@ -163,6 +181,11 @@ namespace drawinglayer
return true;
}
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
return (*rCandidate.mpMaterialAttribute3D == *mpMaterialAttribute3D);
}
diff --git a/drawinglayer/source/attribute/sdrallattribute3d.cxx b/drawinglayer/source/attribute/sdrallattribute3d.cxx
index 264d8d0432d1..379e38f0e6ed 100644
--- a/drawinglayer/source/attribute/sdrallattribute3d.cxx
+++ b/drawinglayer/source/attribute/sdrallattribute3d.cxx
@@ -37,12 +37,6 @@
#include "precompiled_drawinglayer.hxx"
#include <drawinglayer/attribute/sdrallattribute3d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-// pointer compare define
-#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q))
//////////////////////////////////////////////////////////////////////////////
@@ -50,150 +44,47 @@ namespace drawinglayer
{
namespace attribute
{
- SdrLineFillShadowAttribute::SdrLineFillShadowAttribute(
- SdrLineAttribute* pLine,
- SdrFillAttribute* pFill,
- SdrLineStartEndAttribute* pLineStartEnd,
- SdrShadowAttribute* pShadow,
- FillGradientAttribute* pFillFloatTransGradient)
- : mpShadow(pShadow),
- mpLine(pLine),
- mpLineStartEnd(pLineStartEnd),
- mpFill(pFill),
- mpFillFloatTransGradient(pFillFloatTransGradient)
- {
- }
-
- SdrLineFillShadowAttribute::SdrLineFillShadowAttribute(
- const SdrLineFillShadowAttribute& rCandidate)
- : mpShadow(0),
- mpLine(0),
- mpLineStartEnd(0),
- mpFill(0),
- mpFillFloatTransGradient(0)
+ SdrLineFillShadowAttribute3D::SdrLineFillShadowAttribute3D(
+ const SdrLineAttribute& rLine,
+ const SdrFillAttribute& rFill,
+ const SdrLineStartEndAttribute& rLineStartEnd,
+ const SdrShadowAttribute& rShadow,
+ const FillGradientAttribute& rFillFloatTransGradient)
+ : maLine(rLine),
+ maFill(rFill),
+ maLineStartEnd(rLineStartEnd),
+ maShadow(rShadow),
+ maFillFloatTransGradient(rFillFloatTransGradient)
{
- *this = rCandidate;
}
- SdrLineFillShadowAttribute::~SdrLineFillShadowAttribute()
+ SdrLineFillShadowAttribute3D::SdrLineFillShadowAttribute3D()
+ : maLine(),
+ maFill(),
+ maLineStartEnd(),
+ maShadow(),
+ maFillFloatTransGradient()
{
- delete mpShadow;
- delete mpLine;
- delete mpLineStartEnd;
- delete mpFill;
- delete mpFillFloatTransGradient;
}
- SdrLineFillShadowAttribute& SdrLineFillShadowAttribute::operator=(const SdrLineFillShadowAttribute& rCandidate)
+ bool SdrLineFillShadowAttribute3D::isDefault() const
{
- // handle mpShadow
- {
- // delete local mpShadow if necessary
- if(mpShadow)
- {
- delete mpShadow;
- mpShadow = 0;
- }
-
- // copy mpShadow if necessary
- if(rCandidate.mpShadow)
- {
- mpShadow = new SdrShadowAttribute(*rCandidate.mpShadow);
- }
- }
-
- // handle mpLine
- {
- // delete local mpLine if necessary
- if(mpLine)
- {
- delete mpLine;
- mpLine = 0;
- }
-
- // copy mpLine if necessary
- if(rCandidate.mpLine)
- {
- mpLine = new SdrLineAttribute(*rCandidate.mpLine);
- }
- }
-
- // handle mpLineStartEnd
- {
- // delete local mpLineStartEnd if necessary
- if(mpLineStartEnd)
- {
- delete mpLineStartEnd;
- mpLineStartEnd = 0;
- }
-
- // copy mpLineStartEnd if necessary
- if(rCandidate.mpLineStartEnd)
- {
- mpLineStartEnd = new SdrLineStartEndAttribute(*rCandidate.mpLineStartEnd);
- }
- }
-
- // handle mpFill
- {
- // delete local mpFill if necessary
- if(mpFill)
- {
- delete mpFill;
- mpFill = 0;
- }
-
- // copy mpFill if necessary
- if(rCandidate.mpFill)
- {
- mpFill = new SdrFillAttribute(*rCandidate.mpFill);
- }
- }
-
- // handle mpFillFloatTransGradient
- {
- // delete local mpFillFloatTransGradient if necessary
- if(mpFillFloatTransGradient)
- {
- delete mpFillFloatTransGradient;
- mpFillFloatTransGradient = 0;
- }
-
- // copy mpFillFloatTransGradient if necessary
- if(rCandidate.mpFillFloatTransGradient)
- {
- mpFillFloatTransGradient = new FillGradientAttribute(*rCandidate.mpFillFloatTransGradient);
- }
- }
-
- return *this;
+ return(getLine().isDefault()
+ && getFill().isDefault()
+ && getLineStartEnd().isDefault()
+ && getShadow().isDefault()
+ && getFillFloatTransGradient().isDefault());
}
- bool SdrLineFillShadowAttribute::operator==(const SdrLineFillShadowAttribute& rCandidate) const
+ bool SdrLineFillShadowAttribute3D::operator==(const SdrLineFillShadowAttribute3D& rCandidate) const
{
- // handle mpShadow
- if(!pointerOrContentEqual(mpShadow, rCandidate.mpShadow))
- return false;
-
- // handle mpLine
- if(!pointerOrContentEqual(mpLine, rCandidate.mpLine))
- return false;
-
- // handle mpLineStartEnd
- if(!pointerOrContentEqual(mpLineStartEnd, rCandidate.mpLineStartEnd))
- return false;
-
- // handle mpFill
- if(!pointerOrContentEqual(mpFill, rCandidate.mpFill))
- return false;
-
- // handle mpFillFloatTransGradient
- if(!pointerOrContentEqual(mpFillFloatTransGradient, rCandidate.mpFillFloatTransGradient))
- return false;
-
- return true;
+ return(getLine() == rCandidate.getLine()
+ && getFill() == rCandidate.getFill()
+ && getLineStartEnd() == rCandidate.getLineStartEnd()
+ && getShadow() == rCandidate.getShadow()
+ && getFillFloatTransGradient() == rCandidate.getFillFloatTransGradient());
}
- } // end of namespace attribute
+ } // end of namespace overlay
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/source/attribute/sdrattribute.cxx b/drawinglayer/source/attribute/sdrattribute.cxx
deleted file mode 100644
index 8e55afa6751e..000000000000
--- a/drawinglayer/source/attribute/sdrattribute.cxx
+++ /dev/null
@@ -1,293 +0,0 @@
-/*************************************************************************
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: sdrattribute.cxx,v $
- *
- * $Revision: 1.5 $
- *
- * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
- *
- * 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
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_drawinglayer.hxx"
-
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
-#include <drawinglayer/attribute/sdrfillbitmapattribute.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrLineAttribute::SdrLineAttribute(
- basegfx::B2DLineJoin eJoin, double fWidth, double fTransparence, const basegfx::BColor& rColor,
- const ::std::vector< double >& rDotDashArray, double fFullDotDashLen)
- : meJoin(eJoin),
- mfWidth(fWidth),
- mfTransparence(fTransparence),
- maColor(rColor),
- maDotDashArray(rDotDashArray),
- mfFullDotDashLen(fFullDotDashLen)
- {
- }
-
- SdrLineAttribute::SdrLineAttribute(const basegfx::BColor& rColor)
- : meJoin(basegfx::B2DLINEJOIN_NONE),
- mfWidth(0.0),
- mfTransparence(0.0),
- maColor(rColor),
- maDotDashArray(),
- mfFullDotDashLen(0.0)
- {
- }
-
- SdrLineAttribute::~SdrLineAttribute()
- {
- }
-
- bool SdrLineAttribute::operator==(const SdrLineAttribute& rCandidate) const
- {
- return (meJoin == rCandidate.meJoin
- && mfWidth == rCandidate.mfWidth
- && mfTransparence == rCandidate.mfTransparence
- && maColor == rCandidate.maColor
- && maDotDashArray == rCandidate.maDotDashArray);
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrLineStartEndAttribute::SdrLineStartEndAttribute(
- const basegfx::B2DPolyPolygon& rStartPolyPolygon, const basegfx::B2DPolyPolygon& rEndPolyPolygon,
- double fStartWidth, double fEndWidth, bool bStartActive, bool bEndActive, bool bStartCentered, bool bEndCentered)
- : maStartPolyPolygon(rStartPolyPolygon),
- maEndPolyPolygon(rEndPolyPolygon),
- mfStartWidth(fStartWidth),
- mfEndWidth(fEndWidth),
- mbStartActive(bStartActive),
- mbEndActive(bEndActive),
- mbStartCentered(bStartCentered),
- mbEndCentered(bEndCentered)
- {
- }
-
- SdrLineStartEndAttribute::~SdrLineStartEndAttribute()
- {
- }
-
- bool SdrLineStartEndAttribute::operator==(const SdrLineStartEndAttribute& rCandidate) const
- {
- return (mbStartActive == rCandidate.mbStartActive
- && mbEndActive == rCandidate.mbEndActive
- && mbStartCentered == rCandidate.mbStartCentered
- && mbEndCentered == rCandidate.mbEndCentered
- && mfStartWidth == rCandidate.mfStartWidth
- && mfEndWidth == rCandidate.mfEndWidth
- && maStartPolyPolygon == rCandidate.maStartPolyPolygon
- && maEndPolyPolygon == rCandidate.maEndPolyPolygon);
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrShadowAttribute::SdrShadowAttribute(const basegfx::B2DVector& rOffset, double fTransparence, const basegfx::BColor& rColor)
- : maOffset(rOffset),
- mfTransparence(fTransparence),
- maColor(rColor)
- {
- }
-
- SdrShadowAttribute::~SdrShadowAttribute()
- {
- }
-
- bool SdrShadowAttribute::operator==(const SdrShadowAttribute& rCandidate) const
- {
- return (mfTransparence == rCandidate.mfTransparence
- && maColor == rCandidate.maColor
- && maOffset == rCandidate.maOffset);
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrFillAttribute::SdrFillAttribute(
- double fTransparence,
- const basegfx::BColor& rColor,
- FillGradientAttribute* pGradient,
- FillHatchAttribute* pHatch,
- SdrFillBitmapAttribute* pBitmap)
- : mfTransparence(fTransparence),
- maColor(rColor),
- mpGradient(pGradient),
- mpHatch(pHatch),
- mpBitmap(pBitmap)
- {
- }
-
- SdrFillAttribute::SdrFillAttribute(const SdrFillAttribute& rCandidate)
- : mfTransparence(1.0),
- mpGradient(0L),
- mpHatch(0L),
- mpBitmap(0L)
- {
- if(!(*this == rCandidate))
- {
- *this = rCandidate;
- }
- }
-
- SdrFillAttribute::~SdrFillAttribute()
- {
- delete mpGradient;
- delete mpHatch;
- delete mpBitmap;
- }
-
- SdrFillAttribute& SdrFillAttribute::operator=(const SdrFillAttribute& rCandidate)
- {
- // copy data
- mfTransparence = rCandidate.mfTransparence;
- maColor = rCandidate.maColor;
-
- // handle mpGradient
- {
- // delete local mpGradient if necessary
- if(mpGradient && ((!rCandidate.mpGradient) || (!(*mpGradient == *rCandidate.mpGradient))))
- {
- delete mpGradient;
- mpGradient = 0L;
- }
-
- // copy mpGradient if necessary
- if(!mpGradient && rCandidate.mpGradient)
- {
- mpGradient = new FillGradientAttribute(*rCandidate.mpGradient);
- }
- }
-
- // handle mpHatch
- {
- // delete local mpHatch if necessary
- if(mpHatch && ((!rCandidate.mpHatch) || (!(*mpHatch == *rCandidate.mpHatch))))
- {
- delete mpHatch;
- mpHatch = 0L;
- }
-
- // copy mpHatch if necessary
- if(!mpHatch && rCandidate.mpHatch)
- {
- mpHatch = new FillHatchAttribute(*rCandidate.mpHatch);
- }
- }
-
- // handle mpBitmap
- {
- // delete local mpBitmap if necessary
- if(mpBitmap && ((!rCandidate.mpBitmap) || (!(*mpBitmap == *rCandidate.mpBitmap))))
- {
- delete mpBitmap;
- mpBitmap = 0L;
- }
-
- // copy mpBitmap if necessary
- if(!mpBitmap && rCandidate.mpBitmap)
- {
- mpBitmap = new SdrFillBitmapAttribute(*rCandidate.mpBitmap);
- }
- }
-
- return *this;
- }
-
- bool SdrFillAttribute::operator==(const SdrFillAttribute& rCandidate) const
- {
- if(mfTransparence != rCandidate.mfTransparence)
- return false;
-
- if(mpGradient)
- {
- if(!rCandidate.mpGradient)
- return false;
-
- if(!(*mpGradient == *rCandidate.mpGradient))
- return false;
- }
- else if(mpHatch)
- {
- if(!rCandidate.mpHatch)
- return false;
-
- if(!(*mpHatch == *rCandidate.mpHatch))
- return false;
-
- if(mpHatch->isFillBackground() && !(maColor == rCandidate.maColor))
- return false;
- }
- else if(mpBitmap)
- {
- if(!rCandidate.mpBitmap)
- return false;
-
- if(!(*mpBitmap == *rCandidate.mpBitmap))
- return false;
- }
- else
- {
- if(!rCandidate.isColor())
- return false;
-
- if(!(maColor == rCandidate.maColor))
- return false;
- }
-
- return true;
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/drawinglayer/source/attribute/sdrattribute3d.cxx b/drawinglayer/source/attribute/sdrattribute3d.cxx
deleted file mode 100644
index c130675b9c97..000000000000
--- a/drawinglayer/source/attribute/sdrattribute3d.cxx
+++ /dev/null
@@ -1,219 +0,0 @@
-/*************************************************************************
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: sdrattribute3d.cxx,v $
- *
- * $Revision: 1.5 $
- *
- * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
- *
- * 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
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_drawinglayer.hxx"
-
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- 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,
- bool bNormalsInvert,
- bool bDoubleSided,
- bool bShadow3D,
- bool bTextureFilter,
- bool bReducedLineGeometry)
- : maNormalsKind(aNormalsKind),
- maTextureProjectionX(aTextureProjectionX),
- maTextureProjectionY(aTextureProjectionY),
- maTextureKind(aTextureKind),
- maTextureMode(aTextureMode),
- maMaterial(rMaterial),
- mbNormalsInvert(bNormalsInvert),
- mbDoubleSided(bDoubleSided),
- mbShadow3D(bShadow3D),
- mbTextureFilter(bTextureFilter),
- mbReducedLineGeometry(bReducedLineGeometry)
- {
- }
-
- 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
- && mbReducedLineGeometry == rCandidate.mbReducedLineGeometry);
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- Sdr3DLightAttribute::Sdr3DLightAttribute(const basegfx::BColor& rColor, const basegfx::B3DVector& rDirection, bool bSpecular)
- : maColor(rColor),
- maDirection(rDirection),
- mbSpecular(bSpecular)
- {
- }
-
- bool Sdr3DLightAttribute::operator==(const Sdr3DLightAttribute& rCandidate) const
- {
- return (maColor == rCandidate.maColor
- && maDirection == rCandidate.maDirection
- && mbSpecular == rCandidate.mbSpecular);
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrLightingAttribute::SdrLightingAttribute(
- const basegfx::BColor& rAmbientLight,
- const ::std::vector< Sdr3DLightAttribute >& rLightVector)
- : maAmbientLight(rAmbientLight),
- maLightVector(rLightVector)
- {
- }
-
- bool SdrLightingAttribute::operator==(const SdrLightingAttribute& rCandidate) const
- {
- return (maAmbientLight == rCandidate.maAmbientLight
- && maLightVector == rCandidate.maLightVector);
- }
-
- // color model solver
- basegfx::BColor SdrLightingAttribute::solveColorModel(
- const basegfx::B3DVector& rNormalInEyeCoordinates,
- const basegfx::BColor& rColor, const basegfx::BColor& rSpecular,
- const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity) const
- {
- // initialize with emissive color
- basegfx::BColor aRetval(rEmission);
-
- // take care of global ambient light
- aRetval += getAmbientLight() * rColor;
-
- // prepare light access. Is there a light?
- const sal_uInt32 nLightCount(maLightVector.size());
-
- if(nLightCount && !rNormalInEyeCoordinates.equalZero())
- {
- // prepare normal
- basegfx::B3DVector aEyeNormal(rNormalInEyeCoordinates);
- aEyeNormal.normalize();
-
- for(sal_uInt32 a(0L); a < nLightCount; a++)
- {
- const Sdr3DLightAttribute& rLight(maLightVector[a]);
- const double fCosFac(rLight.getDirection().scalar(aEyeNormal));
-
- if(basegfx::fTools::more(fCosFac, 0.0))
- {
- aRetval += ((rLight.getColor() * rColor) * fCosFac);
-
- if(rLight.getSpecular())
- {
- // expand by (0.0, 0.0, 1.0) in Z
- basegfx::B3DVector aSpecularNormal(rLight.getDirection().getX(), rLight.getDirection().getY(), rLight.getDirection().getZ() + 1.0);
- aSpecularNormal.normalize();
- double fCosFac2(aSpecularNormal.scalar(aEyeNormal));
-
- if(basegfx::fTools::more(fCosFac2, 0.0))
- {
- fCosFac2 = pow(fCosFac2, (double)nSpecularIntensity);
- aRetval += (rSpecular * fCosFac2);
- }
- }
- }
- }
- }
-
- // clamp to color space before usage
- aRetval.clamp();
-
- return aRetval;
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrSceneAttribute::SdrSceneAttribute(
- double fDistance,
- double fShadowSlant,
- ::com::sun::star::drawing::ProjectionMode aProjectionMode,
- ::com::sun::star::drawing::ShadeMode aShadeMode,
- bool bTwoSidedLighting)
- : mfDistance(fDistance),
- mfShadowSlant(fShadowSlant),
- maProjectionMode(aProjectionMode),
- maShadeMode(aShadeMode),
- mbTwoSidedLighting(bTwoSidedLighting)
- {
- }
-
- bool SdrSceneAttribute::operator==(const SdrSceneAttribute& rCandidate) const
- {
- return (mfDistance == rCandidate.mfDistance
- && mfShadowSlant == rCandidate.mfShadowSlant
- && maProjectionMode == rCandidate.maProjectionMode
- && maShadeMode == rCandidate.maShadeMode
- && mbTwoSidedLighting == rCandidate.mbTwoSidedLighting);
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/drawinglayer/source/attribute/sdrfillattribute.cxx b/drawinglayer/source/attribute/sdrfillattribute.cxx
new file mode 100644
index 000000000000..bd99ba2c4ba4
--- /dev/null
+++ b/drawinglayer/source/attribute/sdrfillattribute.cxx
@@ -0,0 +1,221 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <drawinglayer/attribute/sdrfillbitmapattribute.hxx>
+#include <drawinglayer/attribute/fillhatchattribute.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpSdrFillAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // fill definitions
+ double mfTransparence; // [0.0 .. 1.0], 0.0==no transp.
+ basegfx::BColor maColor; // fill color
+ FillGradientAttribute maGradient; // fill gradient (if used)
+ FillHatchAttribute maHatch; // fill hatch (if used)
+ SdrFillBitmapAttribute maBitmap; // fill bitmap (if used)
+
+ public:
+ ImpSdrFillAttribute(
+ double fTransparence,
+ const basegfx::BColor& rColor,
+ const FillGradientAttribute& rGradient,
+ const FillHatchAttribute& rHatch,
+ const SdrFillBitmapAttribute& rBitmap)
+ : mnRefCount(0),
+ mfTransparence(fTransparence),
+ maColor(rColor),
+ maGradient(rGradient),
+ maHatch(rHatch),
+ maBitmap(rBitmap)
+ {
+ }
+
+ // data read access
+ double getTransparence() const { return mfTransparence; }
+ const basegfx::BColor& getColor() const { return maColor; }
+ const FillGradientAttribute& getGradient() const { return maGradient; }
+ const FillHatchAttribute& getHatch() const { return maHatch; }
+ const SdrFillBitmapAttribute& getBitmap() const { return maBitmap; }
+
+ // compare operator
+ bool operator==(const ImpSdrFillAttribute& rCandidate) const
+ {
+ return(getTransparence() == rCandidate.getTransparence()
+ && getColor() == rCandidate.getColor()
+ && getGradient() == rCandidate.getGradient()
+ && getHatch() == rCandidate.getHatch()
+ && getBitmap() == rCandidate.getBitmap());
+ }
+
+ static ImpSdrFillAttribute* get_global_default()
+ {
+ static ImpSdrFillAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrFillAttribute(
+ 0.0,
+ basegfx::BColor(),
+ FillGradientAttribute(),
+ FillHatchAttribute(),
+ SdrFillBitmapAttribute());
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ SdrFillAttribute::SdrFillAttribute(
+ double fTransparence,
+ const basegfx::BColor& rColor,
+ const FillGradientAttribute& rGradient,
+ const FillHatchAttribute& rHatch,
+ const SdrFillBitmapAttribute& rBitmap)
+ : mpSdrFillAttribute(new ImpSdrFillAttribute(
+ fTransparence, rColor, rGradient, rHatch, rBitmap))
+ {
+ }
+
+ SdrFillAttribute::SdrFillAttribute()
+ : mpSdrFillAttribute(ImpSdrFillAttribute::get_global_default())
+ {
+ mpSdrFillAttribute->mnRefCount++;
+ }
+
+ SdrFillAttribute::SdrFillAttribute(const SdrFillAttribute& rCandidate)
+ : mpSdrFillAttribute(rCandidate.mpSdrFillAttribute)
+ {
+ mpSdrFillAttribute->mnRefCount++;
+ }
+
+ SdrFillAttribute::~SdrFillAttribute()
+ {
+ if(mpSdrFillAttribute->mnRefCount)
+ {
+ mpSdrFillAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrFillAttribute;
+ }
+ }
+
+ bool SdrFillAttribute::isDefault() const
+ {
+ return mpSdrFillAttribute == ImpSdrFillAttribute::get_global_default();
+ }
+
+ SdrFillAttribute& SdrFillAttribute::operator=(const SdrFillAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdrFillAttribute != mpSdrFillAttribute)
+ {
+ if(mpSdrFillAttribute->mnRefCount)
+ {
+ mpSdrFillAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrFillAttribute;
+ }
+
+ mpSdrFillAttribute = rCandidate.mpSdrFillAttribute;
+ mpSdrFillAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool SdrFillAttribute::operator==(const SdrFillAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdrFillAttribute == mpSdrFillAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdrFillAttribute == *mpSdrFillAttribute);
+ }
+
+ double SdrFillAttribute::getTransparence() const
+ {
+ return mpSdrFillAttribute->getTransparence();
+ }
+
+ const basegfx::BColor& SdrFillAttribute::getColor() const
+ {
+ return mpSdrFillAttribute->getColor();
+ }
+
+ const FillGradientAttribute& SdrFillAttribute::getGradient() const
+ {
+ return mpSdrFillAttribute->getGradient();
+ }
+
+ const FillHatchAttribute& SdrFillAttribute::getHatch() const
+ {
+ return mpSdrFillAttribute->getHatch();
+ }
+
+ const SdrFillBitmapAttribute& SdrFillAttribute::getBitmap() const
+ {
+ return mpSdrFillAttribute->getBitmap();
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx b/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx
index d7e9090b0f62..8d46fac4a20e 100644
--- a/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx
+++ b/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx
@@ -38,8 +38,7 @@
#include <drawinglayer/attribute/sdrfillbitmapattribute.hxx>
#include <drawinglayer/attribute/fillbitmapattribute.hxx>
-#include <basegfx/numeric/ftools.hxx>
-#include <basegfx/range/b2drange.hxx>
+#include <vcl/bitmapex.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -47,37 +46,213 @@ namespace drawinglayer
{
namespace attribute
{
+ class ImpSdrFillBitmapAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // data definitions
+ Bitmap maBitmap;
+ basegfx::B2DVector maSize;
+ basegfx::B2DVector maOffset;
+ basegfx::B2DVector maOffsetPosition;
+ basegfx::B2DVector maRectPoint;
+
+ // bitfield
+ unsigned mbTiling : 1;
+ unsigned mbStretch : 1;
+ unsigned mbLogSize : 1;
+
+ ImpSdrFillBitmapAttribute(
+ 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)
+ : mnRefCount(0),
+ maBitmap(rBitmap),
+ maSize(rSize),
+ maOffset(rOffset),
+ maOffsetPosition(rOffsetPosition),
+ maRectPoint(rRectPoint),
+ mbTiling(bTiling),
+ mbStretch(bStretch),
+ mbLogSize(bLogSize)
+ {
+ }
+
+ // data read access
+ const Bitmap& getBitmap() const { return maBitmap; }
+ const basegfx::B2DVector& getSize() const { return maSize; }
+ const basegfx::B2DVector& getOffset() const { return maOffset; }
+ const basegfx::B2DVector& getOffsetPosition() const { return maOffsetPosition; }
+ const basegfx::B2DVector& getRectPoint() const { return maRectPoint; }
+ bool getTiling() const { return mbTiling; }
+ bool getStretch() const { return mbStretch; }
+ bool getLogSize() const { return mbLogSize; }
+
+ bool operator==(const ImpSdrFillBitmapAttribute& rCandidate) const
+ {
+ return (getBitmap() == rCandidate.getBitmap()
+ && getSize() == rCandidate.getSize()
+ && getOffset() == rCandidate.getOffset()
+ && getOffsetPosition() == rCandidate.getOffsetPosition()
+ && getRectPoint() == rCandidate.getRectPoint()
+ && getTiling() == rCandidate.getTiling()
+ && getStretch() == rCandidate.getStretch()
+ && getLogSize() == rCandidate.getLogSize());
+ }
+
+ static ImpSdrFillBitmapAttribute* get_global_default()
+ {
+ static ImpSdrFillBitmapAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrFillBitmapAttribute(
+ Bitmap(),
+ basegfx::B2DVector(),
+ basegfx::B2DVector(),
+ basegfx::B2DVector(),
+ basegfx::B2DVector(),
+ false,
+ false,
+ false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
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)
- : maBitmap(rBitmap),
- maSize(rSize),
- maOffset(rOffset),
- maOffsetPosition(rOffsetPosition),
- maRectPoint(rRectPoint),
- mbTiling(bTiling),
- mbStretch(bStretch),
- mbLogSize(bLogSize)
+ 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)
+ : mpSdrFillBitmapAttribute(new ImpSdrFillBitmapAttribute(
+ rBitmap, rSize, rOffset, rOffsetPosition, rRectPoint, bTiling, bStretch, bLogSize))
{
}
+ SdrFillBitmapAttribute::SdrFillBitmapAttribute()
+ : mpSdrFillBitmapAttribute(ImpSdrFillBitmapAttribute::get_global_default())
+ {
+ mpSdrFillBitmapAttribute->mnRefCount++;
+ }
+
+ SdrFillBitmapAttribute::SdrFillBitmapAttribute(const SdrFillBitmapAttribute& rCandidate)
+ : mpSdrFillBitmapAttribute(rCandidate.mpSdrFillBitmapAttribute)
+ {
+ mpSdrFillBitmapAttribute->mnRefCount++;
+ }
+
+ SdrFillBitmapAttribute::~SdrFillBitmapAttribute()
+ {
+ if(mpSdrFillBitmapAttribute->mnRefCount)
+ {
+ mpSdrFillBitmapAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrFillBitmapAttribute;
+ }
+ }
+
+ bool SdrFillBitmapAttribute::isDefault() const
+ {
+ return mpSdrFillBitmapAttribute == ImpSdrFillBitmapAttribute::get_global_default();
+ }
+
+ SdrFillBitmapAttribute& SdrFillBitmapAttribute::operator=(const SdrFillBitmapAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdrFillBitmapAttribute != mpSdrFillBitmapAttribute)
+ {
+ if(mpSdrFillBitmapAttribute->mnRefCount)
+ {
+ mpSdrFillBitmapAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrFillBitmapAttribute;
+ }
+
+ mpSdrFillBitmapAttribute = rCandidate.mpSdrFillBitmapAttribute;
+ mpSdrFillBitmapAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
bool SdrFillBitmapAttribute::operator==(const SdrFillBitmapAttribute& rCandidate) const
{
- return (maBitmap == rCandidate.maBitmap
- && maSize == rCandidate.maSize
- && maOffset == rCandidate.maOffset
- && maOffsetPosition == rCandidate.maOffsetPosition
- && maRectPoint == rCandidate.maRectPoint
- && mbTiling == rCandidate.mbTiling
- && mbStretch == rCandidate.mbStretch
- && mbLogSize == rCandidate.mbLogSize);
+ if(rCandidate.mpSdrFillBitmapAttribute == mpSdrFillBitmapAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdrFillBitmapAttribute == *mpSdrFillBitmapAttribute);
+ }
+
+ const Bitmap& SdrFillBitmapAttribute::getBitmap() const
+ {
+ return mpSdrFillBitmapAttribute->getBitmap();
+ }
+
+ const basegfx::B2DVector& SdrFillBitmapAttribute::getSize() const
+ {
+ return mpSdrFillBitmapAttribute->getSize();
+ }
+
+ const basegfx::B2DVector& SdrFillBitmapAttribute::getOffset() const
+ {
+ return mpSdrFillBitmapAttribute->getOffset();
+ }
+
+ const basegfx::B2DVector& SdrFillBitmapAttribute::getOffsetPosition() const
+ {
+ return mpSdrFillBitmapAttribute->getOffsetPosition();
+ }
+
+ const basegfx::B2DVector& SdrFillBitmapAttribute::getRectPoint() const
+ {
+ return mpSdrFillBitmapAttribute->getRectPoint();
+ }
+
+ bool SdrFillBitmapAttribute::getTiling() const
+ {
+ return mpSdrFillBitmapAttribute->getTiling();
+ }
+
+ bool SdrFillBitmapAttribute::getStretch() const
+ {
+ return mpSdrFillBitmapAttribute->getStretch();
+ }
+
+ bool SdrFillBitmapAttribute::getLogSize() const
+ {
+ return mpSdrFillBitmapAttribute->getLogSize();
}
FillBitmapAttribute SdrFillBitmapAttribute::getFillBitmapAttribute(const basegfx::B2DRange& rRange) const
{
// get logical size of bitmap (before expanding eventually)
- Bitmap aBitmap(maBitmap);
+ Bitmap aBitmap(getBitmap());
const basegfx::B2DVector aLogicalSize(aBitmap.GetPrefSize().getWidth(), aBitmap.GetPrefSize().getHeight());
// get hor/ver shiftings and apply them eventually to the bitmap, but only
@@ -85,17 +260,17 @@ namespace drawinglayer
bool bExpandWidth(false);
bool bExpandHeight(false);
- if(mbTiling)
+ if(getTiling())
{
- if(0.0 != maOffset.getX() || 0.0 != maOffset.getY())
+ if(0.0 != getOffset().getX() || 0.0 != getOffset().getY())
{
const sal_uInt32 nWidth(aBitmap.GetSizePixel().getWidth());
const sal_uInt32 nHeight(aBitmap.GetSizePixel().getHeight());
- if(0.0 != maOffset.getX())
+ if(0.0 != getOffset().getX())
{
bExpandHeight = true;
- const sal_uInt32 nOffset(basegfx::fround(((double)nWidth * maOffset.getX()) / 100.0));
+ const sal_uInt32 nOffset(basegfx::fround(((double)nWidth * getOffset().getX()) / 100.0));
aBitmap.Expand(0L, nHeight);
const Size aSizeA(nOffset, nHeight);
@@ -111,7 +286,7 @@ namespace drawinglayer
else
{
bExpandWidth = true;
- const sal_uInt32 nOffset(basegfx::fround(((double)nHeight * maOffset.getY()) / 100.0));
+ const sal_uInt32 nOffset(basegfx::fround(((double)nHeight * getOffset().getY()) / 100.0));
aBitmap.Expand(nWidth, 0L);
const Size aSize(nWidth, nHeight);
@@ -137,7 +312,7 @@ namespace drawinglayer
basegfx::B2DVector aBitmapTopLeft(0.0, 0.0);
// are canges needed?
- if(mbTiling || !mbStretch)
+ if(getTiling() || !getStretch())
{
// init values with range sizes
const double fRangeWidth(0.0 != rRange.getWidth() ? rRange.getWidth() : 1.0);
@@ -145,15 +320,15 @@ namespace drawinglayer
aBitmapSize = basegfx::B2DPoint(fRangeWidth, fRangeHeight);
// size changes
- if(0.0 != maSize.getX())
+ if(0.0 != getSize().getX())
{
- if(maSize.getX() < 0.0)
+ if(getSize().getX() < 0.0)
{
- aBitmapSize.setX(aBitmapSize.getX() * (maSize.getX() * -0.01));
+ aBitmapSize.setX(aBitmapSize.getX() * (getSize().getX() * -0.01));
}
else
{
- aBitmapSize.setX(maSize.getX());
+ aBitmapSize.setX(getSize().getX());
}
}
else
@@ -161,15 +336,15 @@ namespace drawinglayer
aBitmapSize.setX(aLogicalSize.getX());
}
- if(0.0 != maSize.getY())
+ if(0.0 != getSize().getY())
{
- if(maSize.getY() < 0.0)
+ if(getSize().getY() < 0.0)
{
- aBitmapSize.setY(aBitmapSize.getY() * (maSize.getY() * -0.01));
+ aBitmapSize.setY(aBitmapSize.getY() * (getSize().getY() * -0.01));
}
else
{
- aBitmapSize.setY(maSize.getY());
+ aBitmapSize.setY(getSize().getY());
}
}
else
@@ -178,7 +353,7 @@ namespace drawinglayer
}
// get values, force to centered if necessary
- const basegfx::B2DVector aRectPoint(mbTiling ? maRectPoint : basegfx::B2DVector(0.0, 0.0));
+ const basegfx::B2DVector aRectPoint(getTiling() ? getRectPoint() : basegfx::B2DVector(0.0, 0.0));
// position changes X
if(0.0 == aRectPoint.getX())
@@ -190,9 +365,9 @@ namespace drawinglayer
aBitmapTopLeft.setX(fRangeWidth - aBitmapSize.getX());
}
- if(mbTiling && 0.0 != maOffsetPosition.getX())
+ if(getTiling() && 0.0 != getOffsetPosition().getX())
{
- aBitmapTopLeft.setX(aBitmapTopLeft.getX() + (aBitmapSize.getX() * (maOffsetPosition.getX() * 0.01)));
+ aBitmapTopLeft.setX(aBitmapTopLeft.getX() + (aBitmapSize.getX() * (getOffsetPosition().getX() * 0.01)));
}
// position changes Y
@@ -205,9 +380,9 @@ namespace drawinglayer
aBitmapTopLeft.setY(fRangeHeight - aBitmapSize.getY());
}
- if(mbTiling && 0.0 != maOffsetPosition.getY())
+ if(getTiling() && 0.0 != getOffsetPosition().getY())
{
- aBitmapTopLeft.setY(aBitmapTopLeft.getY() + (aBitmapSize.getY() * (maOffsetPosition.getY() * 0.01)));
+ aBitmapTopLeft.setY(aBitmapTopLeft.getY() + (aBitmapSize.getY() * (getOffsetPosition().getY() * 0.01)));
}
// apply expand
@@ -228,7 +403,7 @@ namespace drawinglayer
aBitmapSize.setY(aBitmapSize.getY() / fRangeHeight);
}
- return FillBitmapAttribute(BitmapEx(aBitmap), aBitmapTopLeft, aBitmapSize, mbTiling);
+ return FillBitmapAttribute(BitmapEx(aBitmap), aBitmapTopLeft, aBitmapSize, getTiling());
}
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/attribute/sdrlightattribute3d.cxx b/drawinglayer/source/attribute/sdrlightattribute3d.cxx
new file mode 100644
index 000000000000..bc22d0a5f183
--- /dev/null
+++ b/drawinglayer/source/attribute/sdrlightattribute3d.cxx
@@ -0,0 +1,196 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute3d.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/sdrlightattribute3d.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <basegfx/vector/b3dvector.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpSdr3DLightAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // 3D light attribute definitions
+ basegfx::BColor maColor;
+ basegfx::B3DVector maDirection;
+
+ // bitfield
+ unsigned mbSpecular : 1;
+
+ ImpSdr3DLightAttribute(
+ const basegfx::BColor& rColor,
+ const basegfx::B3DVector& rDirection,
+ bool bSpecular)
+ : mnRefCount(0),
+ maColor(rColor),
+ maDirection(rDirection),
+ mbSpecular(bSpecular)
+ {
+ }
+
+ // data read access
+ const basegfx::BColor& getColor() const { return maColor; }
+ const basegfx::B3DVector& getDirection() const { return maDirection; }
+ bool getSpecular() const { return mbSpecular; }
+
+ bool operator==(const ImpSdr3DLightAttribute& rCandidate) const
+ {
+ return (getColor() == rCandidate.getColor()
+ && getDirection() == rCandidate.getDirection()
+ && getSpecular() == rCandidate.getSpecular());
+ }
+
+ static ImpSdr3DLightAttribute* get_global_default()
+ {
+ static ImpSdr3DLightAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdr3DLightAttribute(
+ basegfx::BColor(),
+ basegfx::B3DVector(),
+ false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ Sdr3DLightAttribute::Sdr3DLightAttribute(
+ const basegfx::BColor& rColor,
+ const basegfx::B3DVector& rDirection,
+ bool bSpecular)
+ : mpSdr3DLightAttribute(new ImpSdr3DLightAttribute(
+ rColor, rDirection, bSpecular))
+ {
+ }
+
+ Sdr3DLightAttribute::Sdr3DLightAttribute()
+ : mpSdr3DLightAttribute(ImpSdr3DLightAttribute::get_global_default())
+ {
+ mpSdr3DLightAttribute->mnRefCount++;
+ }
+
+ Sdr3DLightAttribute::Sdr3DLightAttribute(const Sdr3DLightAttribute& rCandidate)
+ : mpSdr3DLightAttribute(rCandidate.mpSdr3DLightAttribute)
+ {
+ mpSdr3DLightAttribute->mnRefCount++;
+ }
+
+ Sdr3DLightAttribute::~Sdr3DLightAttribute()
+ {
+ if(mpSdr3DLightAttribute->mnRefCount)
+ {
+ mpSdr3DLightAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdr3DLightAttribute;
+ }
+ }
+
+ bool Sdr3DLightAttribute::isDefault() const
+ {
+ return mpSdr3DLightAttribute == ImpSdr3DLightAttribute::get_global_default();
+ }
+
+ Sdr3DLightAttribute& Sdr3DLightAttribute::operator=(const Sdr3DLightAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdr3DLightAttribute != mpSdr3DLightAttribute)
+ {
+ if(mpSdr3DLightAttribute->mnRefCount)
+ {
+ mpSdr3DLightAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdr3DLightAttribute;
+ }
+
+ mpSdr3DLightAttribute = rCandidate.mpSdr3DLightAttribute;
+ mpSdr3DLightAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool Sdr3DLightAttribute::operator==(const Sdr3DLightAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdr3DLightAttribute == mpSdr3DLightAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdr3DLightAttribute == *mpSdr3DLightAttribute);
+ }
+
+ const basegfx::BColor& Sdr3DLightAttribute::getColor() const
+ {
+ return mpSdr3DLightAttribute->getColor();
+ }
+
+ const basegfx::B3DVector& Sdr3DLightAttribute::getDirection() const
+ {
+ return mpSdr3DLightAttribute->getDirection();
+ }
+
+ bool Sdr3DLightAttribute::getSpecular() const
+ {
+ return mpSdr3DLightAttribute->getSpecular();
+ }
+
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/sdrlightingattribute3d.cxx b/drawinglayer/source/attribute/sdrlightingattribute3d.cxx
new file mode 100644
index 000000000000..25407d52f282
--- /dev/null
+++ b/drawinglayer/source/attribute/sdrlightingattribute3d.cxx
@@ -0,0 +1,235 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute3d.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <basegfx/vector/b3dvector.hxx>
+#include <drawinglayer/attribute/sdrlightattribute3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpSdrLightingAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // 3D light attribute definitions
+ basegfx::BColor maAmbientLight;
+ ::std::vector< Sdr3DLightAttribute > maLightVector;
+
+ ImpSdrLightingAttribute(
+ const basegfx::BColor& rAmbientLight,
+ const ::std::vector< Sdr3DLightAttribute >& rLightVector)
+ : mnRefCount(0),
+ maAmbientLight(rAmbientLight),
+ maLightVector(rLightVector)
+ {
+ }
+
+ // data read access
+ const basegfx::BColor& getAmbientLight() const { return maAmbientLight; }
+ const ::std::vector< Sdr3DLightAttribute >& getLightVector() const { return maLightVector; }
+
+ bool operator==(const ImpSdrLightingAttribute& rCandidate) const
+ {
+ return (getAmbientLight() == rCandidate.getAmbientLight()
+ && getLightVector() == rCandidate.getLightVector());
+ }
+
+ static ImpSdrLightingAttribute* get_global_default()
+ {
+ static ImpSdrLightingAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrLightingAttribute(
+ basegfx::BColor(),
+ std::vector< Sdr3DLightAttribute >());
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ SdrLightingAttribute::SdrLightingAttribute(
+ const basegfx::BColor& rAmbientLight,
+ const ::std::vector< Sdr3DLightAttribute >& rLightVector)
+ : mpSdrLightingAttribute(new ImpSdrLightingAttribute(
+ rAmbientLight, rLightVector))
+ {
+ }
+
+ SdrLightingAttribute::SdrLightingAttribute()
+ : mpSdrLightingAttribute(ImpSdrLightingAttribute::get_global_default())
+ {
+ mpSdrLightingAttribute->mnRefCount++;
+ }
+
+ SdrLightingAttribute::SdrLightingAttribute(const SdrLightingAttribute& rCandidate)
+ : mpSdrLightingAttribute(rCandidate.mpSdrLightingAttribute)
+ {
+ mpSdrLightingAttribute->mnRefCount++;
+ }
+
+ SdrLightingAttribute::~SdrLightingAttribute()
+ {
+ if(mpSdrLightingAttribute->mnRefCount)
+ {
+ mpSdrLightingAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrLightingAttribute;
+ }
+ }
+
+ bool SdrLightingAttribute::isDefault() const
+ {
+ return mpSdrLightingAttribute == ImpSdrLightingAttribute::get_global_default();
+ }
+
+ SdrLightingAttribute& SdrLightingAttribute::operator=(const SdrLightingAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdrLightingAttribute != mpSdrLightingAttribute)
+ {
+ if(mpSdrLightingAttribute->mnRefCount)
+ {
+ mpSdrLightingAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrLightingAttribute;
+ }
+
+ mpSdrLightingAttribute = rCandidate.mpSdrLightingAttribute;
+ mpSdrLightingAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool SdrLightingAttribute::operator==(const SdrLightingAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdrLightingAttribute == mpSdrLightingAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdrLightingAttribute == *mpSdrLightingAttribute);
+ }
+
+ const basegfx::BColor& SdrLightingAttribute::getAmbientLight() const
+ {
+ return mpSdrLightingAttribute->getAmbientLight();
+ }
+
+ const ::std::vector< Sdr3DLightAttribute >& SdrLightingAttribute::getLightVector() const
+ {
+ return mpSdrLightingAttribute->getLightVector();
+ }
+
+ // color model solver
+ basegfx::BColor SdrLightingAttribute::solveColorModel(
+ const basegfx::B3DVector& rNormalInEyeCoordinates,
+ const basegfx::BColor& rColor, const basegfx::BColor& rSpecular,
+ const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity) const
+ {
+ // initialize with emissive color
+ basegfx::BColor aRetval(rEmission);
+
+ // take care of global ambient light
+ aRetval += mpSdrLightingAttribute->getAmbientLight() * rColor;
+
+ // prepare light access. Is there a light?
+ const sal_uInt32 nLightCount(mpSdrLightingAttribute->getLightVector().size());
+
+ if(nLightCount && !rNormalInEyeCoordinates.equalZero())
+ {
+ // prepare normal
+ basegfx::B3DVector aEyeNormal(rNormalInEyeCoordinates);
+ aEyeNormal.normalize();
+
+ for(sal_uInt32 a(0L); a < nLightCount; a++)
+ {
+ const Sdr3DLightAttribute& rLight(mpSdrLightingAttribute->getLightVector()[a]);
+ const double fCosFac(rLight.getDirection().scalar(aEyeNormal));
+
+ if(basegfx::fTools::more(fCosFac, 0.0))
+ {
+ aRetval += ((rLight.getColor() * rColor) * fCosFac);
+
+ if(rLight.getSpecular())
+ {
+ // expand by (0.0, 0.0, 1.0) in Z
+ basegfx::B3DVector aSpecularNormal(rLight.getDirection().getX(), rLight.getDirection().getY(), rLight.getDirection().getZ() + 1.0);
+ aSpecularNormal.normalize();
+ double fCosFac2(aSpecularNormal.scalar(aEyeNormal));
+
+ if(basegfx::fTools::more(fCosFac2, 0.0))
+ {
+ fCosFac2 = pow(fCosFac2, (double)nSpecularIntensity);
+ aRetval += (rSpecular * fCosFac2);
+ }
+ }
+ }
+ }
+ }
+
+ // clamp to color space before usage
+ aRetval.clamp();
+
+ return aRetval;
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/sdrlineattribute.cxx b/drawinglayer/source/attribute/sdrlineattribute.cxx
new file mode 100644
index 000000000000..1850d919069f
--- /dev/null
+++ b/drawinglayer/source/attribute/sdrlineattribute.cxx
@@ -0,0 +1,250 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <basegfx/color/bcolor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpSdrLineAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // line definitions
+ basegfx::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
+ ::std::vector< double > maDotDashArray; // array of double which defines the dot-dash pattern
+ double mfFullDotDashLen; // sum of maDotDashArray (for convenience)
+
+ ImpSdrLineAttribute(
+ basegfx::B2DLineJoin eJoin,
+ double fWidth,
+ double fTransparence,
+ const basegfx::BColor& rColor,
+ const ::std::vector< double >& rDotDashArray,
+ double fFullDotDashLen)
+ : mnRefCount(0),
+ meJoin(eJoin),
+ mfWidth(fWidth),
+ mfTransparence(fTransparence),
+ maColor(rColor),
+ maDotDashArray(rDotDashArray),
+ mfFullDotDashLen(fFullDotDashLen)
+ {
+ }
+
+ ImpSdrLineAttribute(const basegfx::BColor& rColor)
+ : mnRefCount(0),
+ meJoin(basegfx::B2DLINEJOIN_NONE),
+ mfWidth(0.0),
+ mfTransparence(0.0),
+ maColor(rColor),
+ maDotDashArray(),
+ mfFullDotDashLen(0.0)
+ {
+ }
+
+ // data read access
+ basegfx::B2DLineJoin getJoin() const { return meJoin; }
+ double getWidth() const { return mfWidth; }
+ double getTransparence() const { return mfTransparence; }
+ const basegfx::BColor& getColor() const { return maColor; }
+ const ::std::vector< double >& getDotDashArray() const { return maDotDashArray; }
+ double getFullDotDashLen() const { return mfFullDotDashLen; }
+
+ bool operator==(const ImpSdrLineAttribute& rCandidate) const
+ {
+ return (getJoin() == rCandidate.getJoin()
+ && getWidth() == rCandidate.getWidth()
+ && getTransparence() == rCandidate.getTransparence()
+ && getColor() == rCandidate.getColor()
+ && getDotDashArray() == rCandidate.getDotDashArray());
+ }
+
+ static ImpSdrLineAttribute* get_global_default()
+ {
+ static ImpSdrLineAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrLineAttribute(
+ basegfx::B2DLINEJOIN_ROUND,
+ 0.0,
+ 0.0,
+ basegfx::BColor(),
+ std::vector< double >(),
+ 0.0);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ SdrLineAttribute::SdrLineAttribute(
+ basegfx::B2DLineJoin eJoin,
+ double fWidth,
+ double fTransparence,
+ const basegfx::BColor& rColor,
+ const ::std::vector< double >& rDotDashArray,
+ double fFullDotDashLen)
+ : mpSdrLineAttribute(new ImpSdrLineAttribute(
+ eJoin, fWidth, fTransparence, rColor, rDotDashArray, fFullDotDashLen))
+ {
+ }
+
+ SdrLineAttribute::SdrLineAttribute(
+ const basegfx::BColor& rColor)
+ : mpSdrLineAttribute(new ImpSdrLineAttribute(rColor))
+ {
+ }
+
+ SdrLineAttribute::SdrLineAttribute()
+ : mpSdrLineAttribute(ImpSdrLineAttribute::get_global_default())
+ {
+ mpSdrLineAttribute->mnRefCount++;
+ }
+
+ SdrLineAttribute::SdrLineAttribute(const SdrLineAttribute& rCandidate)
+ : mpSdrLineAttribute(rCandidate.mpSdrLineAttribute)
+ {
+ mpSdrLineAttribute->mnRefCount++;
+ }
+
+ SdrLineAttribute::~SdrLineAttribute()
+ {
+ if(mpSdrLineAttribute->mnRefCount)
+ {
+ mpSdrLineAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrLineAttribute;
+ }
+ }
+
+ bool SdrLineAttribute::isDefault() const
+ {
+ return mpSdrLineAttribute == ImpSdrLineAttribute::get_global_default();
+ }
+
+ SdrLineAttribute& SdrLineAttribute::operator=(const SdrLineAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdrLineAttribute != mpSdrLineAttribute)
+ {
+ if(mpSdrLineAttribute->mnRefCount)
+ {
+ mpSdrLineAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrLineAttribute;
+ }
+
+ mpSdrLineAttribute = rCandidate.mpSdrLineAttribute;
+ mpSdrLineAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool SdrLineAttribute::operator==(const SdrLineAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdrLineAttribute == mpSdrLineAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdrLineAttribute == *mpSdrLineAttribute);
+ }
+
+ basegfx::B2DLineJoin SdrLineAttribute::getJoin() const
+ {
+ return mpSdrLineAttribute->getJoin();
+ }
+
+ double SdrLineAttribute::getWidth() const
+ {
+ return mpSdrLineAttribute->getWidth();
+ }
+
+ double SdrLineAttribute::getTransparence() const
+ {
+ return mpSdrLineAttribute->getTransparence();
+ }
+
+ const basegfx::BColor& SdrLineAttribute::getColor() const
+ {
+ return mpSdrLineAttribute->getColor();
+ }
+
+ const ::std::vector< double >& SdrLineAttribute::getDotDashArray() const
+ {
+ return mpSdrLineAttribute->getDotDashArray();
+ }
+
+ double SdrLineAttribute::getFullDotDashLen() const
+ {
+ return mpSdrLineAttribute->getFullDotDashLen();
+ }
+
+ bool SdrLineAttribute::isDashed() const
+ {
+ return (0L != getDotDashArray().size());
+ }
+
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/sdrlinestartendattribute.cxx b/drawinglayer/source/attribute/sdrlinestartendattribute.cxx
new file mode 100644
index 000000000000..ce85bdff5678
--- /dev/null
+++ b/drawinglayer/source/attribute/sdrlinestartendattribute.cxx
@@ -0,0 +1,254 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpSdrLineStartEndAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // line arrow definitions
+ basegfx::B2DPolyPolygon maStartPolyPolygon; // start Line PolyPolygon
+ basegfx::B2DPolyPolygon maEndPolyPolygon; // end Line PolyPolygon
+ double mfStartWidth; // 1/100th mm
+ double mfEndWidth; // 1/100th mm
+
+ // bitfield
+ unsigned mbStartActive : 1L; // start of Line is active
+ unsigned mbEndActive : 1L; // end of Line is active
+ unsigned mbStartCentered : 1L; // Line is centered on line start point
+ unsigned mbEndCentered : 1L; // Line is centered on line end point
+
+ ImpSdrLineStartEndAttribute(
+ const basegfx::B2DPolyPolygon& rStartPolyPolygon,
+ const basegfx::B2DPolyPolygon& rEndPolyPolygon,
+ double fStartWidth,
+ double fEndWidth,
+ bool bStartActive,
+ bool bEndActive,
+ bool bStartCentered,
+ bool bEndCentered)
+ : mnRefCount(0),
+ maStartPolyPolygon(rStartPolyPolygon),
+ maEndPolyPolygon(rEndPolyPolygon),
+ mfStartWidth(fStartWidth),
+ mfEndWidth(fEndWidth),
+ mbStartActive(bStartActive),
+ mbEndActive(bEndActive),
+ mbStartCentered(bStartCentered),
+ mbEndCentered(bEndCentered)
+ {
+ }
+
+ // data read access
+ const basegfx::B2DPolyPolygon& getStartPolyPolygon() const { return maStartPolyPolygon; }
+ const basegfx::B2DPolyPolygon& getEndPolyPolygon() const { return maEndPolyPolygon; }
+ double getStartWidth() const { return mfStartWidth; }
+ double getEndWidth() const { return mfEndWidth; }
+ bool isStartActive() const { return mbStartActive; }
+ bool isEndActive() const { return mbEndActive; }
+ bool isStartCentered() const { return mbStartCentered; }
+ bool isEndCentered() const { return mbEndCentered; }
+
+ bool operator==(const ImpSdrLineStartEndAttribute& rCandidate) const
+ {
+ return (getStartPolyPolygon() == rCandidate.getStartPolyPolygon()
+ && getEndPolyPolygon() == rCandidate.getEndPolyPolygon()
+ && getStartWidth() == rCandidate.getStartWidth()
+ && getEndWidth() == rCandidate.getEndWidth()
+ && isStartActive() == rCandidate.isStartActive()
+ && isEndActive() == rCandidate.isEndActive()
+ && isStartCentered() == rCandidate.isStartCentered()
+ && isEndCentered() == rCandidate.isEndCentered());
+ }
+
+ static ImpSdrLineStartEndAttribute* get_global_default()
+ {
+ static ImpSdrLineStartEndAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrLineStartEndAttribute(
+ basegfx::B2DPolyPolygon(),
+ basegfx::B2DPolyPolygon(),
+ 0.0,
+ 0.0,
+ false,
+ false,
+ false,
+ false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ SdrLineStartEndAttribute::SdrLineStartEndAttribute(
+ const basegfx::B2DPolyPolygon& rStartPolyPolygon,
+ const basegfx::B2DPolyPolygon& rEndPolyPolygon,
+ double fStartWidth,
+ double fEndWidth,
+ bool bStartActive,
+ bool bEndActive,
+ bool bStartCentered,
+ bool bEndCentered)
+ : mpSdrLineStartEndAttribute(new ImpSdrLineStartEndAttribute(
+ rStartPolyPolygon, rEndPolyPolygon, fStartWidth, fEndWidth, bStartActive, bEndActive, bStartCentered, bEndCentered))
+ {
+ }
+
+ SdrLineStartEndAttribute::SdrLineStartEndAttribute()
+ : mpSdrLineStartEndAttribute(ImpSdrLineStartEndAttribute::get_global_default())
+ {
+ mpSdrLineStartEndAttribute->mnRefCount++;
+ }
+
+ SdrLineStartEndAttribute::SdrLineStartEndAttribute(const SdrLineStartEndAttribute& rCandidate)
+ : mpSdrLineStartEndAttribute(rCandidate.mpSdrLineStartEndAttribute)
+ {
+ mpSdrLineStartEndAttribute->mnRefCount++;
+ }
+
+ SdrLineStartEndAttribute::~SdrLineStartEndAttribute()
+ {
+ if(mpSdrLineStartEndAttribute->mnRefCount)
+ {
+ mpSdrLineStartEndAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrLineStartEndAttribute;
+ }
+ }
+
+ bool SdrLineStartEndAttribute::isDefault() const
+ {
+ return mpSdrLineStartEndAttribute == ImpSdrLineStartEndAttribute::get_global_default();
+ }
+
+ SdrLineStartEndAttribute& SdrLineStartEndAttribute::operator=(const SdrLineStartEndAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdrLineStartEndAttribute != mpSdrLineStartEndAttribute)
+ {
+ if(mpSdrLineStartEndAttribute->mnRefCount)
+ {
+ mpSdrLineStartEndAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrLineStartEndAttribute;
+ }
+
+ mpSdrLineStartEndAttribute = rCandidate.mpSdrLineStartEndAttribute;
+ mpSdrLineStartEndAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool SdrLineStartEndAttribute::operator==(const SdrLineStartEndAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdrLineStartEndAttribute == mpSdrLineStartEndAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdrLineStartEndAttribute == *mpSdrLineStartEndAttribute);
+ }
+
+ const basegfx::B2DPolyPolygon& SdrLineStartEndAttribute::getStartPolyPolygon() const
+ {
+ return mpSdrLineStartEndAttribute->getStartPolyPolygon();
+ }
+
+ const basegfx::B2DPolyPolygon& SdrLineStartEndAttribute::getEndPolyPolygon() const
+ {
+ return mpSdrLineStartEndAttribute->getEndPolyPolygon();
+ }
+
+ double SdrLineStartEndAttribute::getStartWidth() const
+ {
+ return mpSdrLineStartEndAttribute->getStartWidth();
+ }
+
+ double SdrLineStartEndAttribute::getEndWidth() const
+ {
+ return mpSdrLineStartEndAttribute->getEndWidth();
+ }
+
+ bool SdrLineStartEndAttribute::isStartActive() const
+ {
+ return mpSdrLineStartEndAttribute->isStartActive();
+ }
+
+ bool SdrLineStartEndAttribute::isEndActive() const
+ {
+ return mpSdrLineStartEndAttribute->isEndActive();
+ }
+
+ bool SdrLineStartEndAttribute::isStartCentered() const
+ {
+ return mpSdrLineStartEndAttribute->isStartCentered();
+ }
+
+ bool SdrLineStartEndAttribute::isEndCentered() const
+ {
+ return mpSdrLineStartEndAttribute->isEndCentered();
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/sdrobjectattribute3d.cxx b/drawinglayer/source/attribute/sdrobjectattribute3d.cxx
new file mode 100644
index 000000000000..a51e333236bc
--- /dev/null
+++ b/drawinglayer/source/attribute/sdrobjectattribute3d.cxx
@@ -0,0 +1,292 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute3d.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/sdrobjectattribute3d.hxx>
+#include <drawinglayer/attribute/materialattribute3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpSdr3DObjectAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // 3D object attribute definitions
+ ::com::sun::star::drawing::NormalsKind maNormalsKind; // normals type (0..2)
+ ::com::sun::star::drawing::TextureProjectionMode maTextureProjectionX; // texture projection type X (0..2)
+ ::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
+
+ // bitfield
+ unsigned mbNormalsInvert : 1; // invert normals
+ unsigned mbDoubleSided : 1; // surfaces are double sided
+ unsigned mbShadow3D : 1; // display shadow in 3D (if on), params for that are at scene
+ unsigned mbTextureFilter : 1; // filter texture to make more smooth
+ unsigned mbReducedLineGeometry : 1; // use reduced line geometry (object specific)
+
+ ImpSdr3DObjectAttribute(
+ ::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,
+ bool bNormalsInvert,
+ bool bDoubleSided,
+ bool bShadow3D,
+ bool bTextureFilter,
+ bool bReducedLineGeometry)
+ : mnRefCount(0),
+ maNormalsKind(aNormalsKind),
+ maTextureProjectionX(aTextureProjectionX),
+ maTextureProjectionY(aTextureProjectionY),
+ maTextureKind(aTextureKind),
+ maTextureMode(aTextureMode),
+ maMaterial(rMaterial),
+ mbNormalsInvert(bNormalsInvert),
+ mbDoubleSided(bDoubleSided),
+ mbShadow3D(bShadow3D),
+ mbTextureFilter(bTextureFilter),
+ mbReducedLineGeometry(bReducedLineGeometry)
+ {
+ }
+
+ // data read access
+ ::com::sun::star::drawing::NormalsKind getNormalsKind() const { return maNormalsKind; }
+ ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionX() const { return maTextureProjectionX; }
+ ::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; }
+ bool getNormalsInvert() const { return mbNormalsInvert; }
+ bool getDoubleSided() const { return mbDoubleSided; }
+ bool getShadow3D() const { return mbShadow3D; }
+ bool getTextureFilter() const { return mbTextureFilter; }
+ bool getReducedLineGeometry() const { return mbReducedLineGeometry; }
+
+ bool operator==(const ImpSdr3DObjectAttribute& rCandidate) const
+ {
+ return (getNormalsKind() == rCandidate.getNormalsKind()
+ && getTextureProjectionX() == rCandidate.getTextureProjectionX()
+ && getTextureProjectionY() == rCandidate.getTextureProjectionY()
+ && getTextureKind() == rCandidate.getTextureKind()
+ && getTextureMode() == rCandidate.getTextureMode()
+ && getMaterial() == rCandidate.getMaterial()
+ && getNormalsInvert() == rCandidate.getNormalsInvert()
+ && getDoubleSided() == rCandidate.getDoubleSided()
+ && getShadow3D() == rCandidate.getShadow3D()
+ && getTextureFilter() == rCandidate.getTextureFilter()
+ && getReducedLineGeometry() == rCandidate.getReducedLineGeometry());
+ }
+
+ static ImpSdr3DObjectAttribute* get_global_default()
+ {
+ static ImpSdr3DObjectAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdr3DObjectAttribute(
+ ::com::sun::star::drawing::NormalsKind_SPECIFIC,
+ ::com::sun::star::drawing::TextureProjectionMode_OBJECTSPECIFIC,
+ ::com::sun::star::drawing::TextureProjectionMode_OBJECTSPECIFIC,
+ ::com::sun::star::drawing::TextureKind2_LUMINANCE,
+ ::com::sun::star::drawing::TextureMode_REPLACE,
+ MaterialAttribute3D(),
+ false,
+ false,
+ false,
+ false,
+ false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ 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,
+ bool bNormalsInvert,
+ bool bDoubleSided,
+ bool bShadow3D,
+ bool bTextureFilter,
+ bool bReducedLineGeometry)
+ : mpSdr3DObjectAttribute(new ImpSdr3DObjectAttribute(
+ aNormalsKind, aTextureProjectionX, aTextureProjectionY, aTextureKind, aTextureMode,
+ rMaterial, bNormalsInvert, bDoubleSided, bShadow3D, bTextureFilter, bReducedLineGeometry))
+ {
+ }
+
+ Sdr3DObjectAttribute::Sdr3DObjectAttribute()
+ : mpSdr3DObjectAttribute(ImpSdr3DObjectAttribute::get_global_default())
+ {
+ mpSdr3DObjectAttribute->mnRefCount++;
+ }
+
+ Sdr3DObjectAttribute::Sdr3DObjectAttribute(const Sdr3DObjectAttribute& rCandidate)
+ : mpSdr3DObjectAttribute(rCandidate.mpSdr3DObjectAttribute)
+ {
+ mpSdr3DObjectAttribute->mnRefCount++;
+ }
+
+ Sdr3DObjectAttribute::~Sdr3DObjectAttribute()
+ {
+ if(mpSdr3DObjectAttribute->mnRefCount)
+ {
+ mpSdr3DObjectAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdr3DObjectAttribute;
+ }
+ }
+
+ bool Sdr3DObjectAttribute::isDefault() const
+ {
+ return mpSdr3DObjectAttribute == ImpSdr3DObjectAttribute::get_global_default();
+ }
+
+ Sdr3DObjectAttribute& Sdr3DObjectAttribute::operator=(const Sdr3DObjectAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdr3DObjectAttribute != mpSdr3DObjectAttribute)
+ {
+ if(mpSdr3DObjectAttribute->mnRefCount)
+ {
+ mpSdr3DObjectAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdr3DObjectAttribute;
+ }
+
+ mpSdr3DObjectAttribute = rCandidate.mpSdr3DObjectAttribute;
+ mpSdr3DObjectAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool Sdr3DObjectAttribute::operator==(const Sdr3DObjectAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdr3DObjectAttribute == mpSdr3DObjectAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdr3DObjectAttribute == *mpSdr3DObjectAttribute);
+ }
+
+ ::com::sun::star::drawing::NormalsKind Sdr3DObjectAttribute::getNormalsKind() const
+ {
+ return mpSdr3DObjectAttribute->getNormalsKind();
+ }
+
+ ::com::sun::star::drawing::TextureProjectionMode Sdr3DObjectAttribute::getTextureProjectionX() const
+ {
+ return mpSdr3DObjectAttribute->getTextureProjectionX();
+ }
+
+ ::com::sun::star::drawing::TextureProjectionMode Sdr3DObjectAttribute::getTextureProjectionY() const
+ {
+ return mpSdr3DObjectAttribute->getTextureProjectionY();
+ }
+
+ ::com::sun::star::drawing::TextureKind2 Sdr3DObjectAttribute::getTextureKind() const
+ {
+ return mpSdr3DObjectAttribute->getTextureKind();
+ }
+
+ ::com::sun::star::drawing::TextureMode Sdr3DObjectAttribute::getTextureMode() const
+ {
+ return mpSdr3DObjectAttribute->getTextureMode();
+ }
+
+ const MaterialAttribute3D& Sdr3DObjectAttribute::getMaterial() const
+ {
+ return mpSdr3DObjectAttribute->getMaterial();
+ }
+
+ bool Sdr3DObjectAttribute::getNormalsInvert() const
+ {
+ return mpSdr3DObjectAttribute->getNormalsInvert();
+ }
+
+ bool Sdr3DObjectAttribute::getDoubleSided() const
+ {
+ return mpSdr3DObjectAttribute->getDoubleSided();
+ }
+
+ bool Sdr3DObjectAttribute::getShadow3D() const
+ {
+ return mpSdr3DObjectAttribute->getShadow3D();
+ }
+
+ bool Sdr3DObjectAttribute::getTextureFilter() const
+ {
+ return mpSdr3DObjectAttribute->getTextureFilter();
+ }
+
+ bool Sdr3DObjectAttribute::getReducedLineGeometry() const
+ {
+ return mpSdr3DObjectAttribute->getReducedLineGeometry();
+ }
+
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/sdrsceneattribute3d.cxx b/drawinglayer/source/attribute/sdrsceneattribute3d.cxx
new file mode 100644
index 000000000000..141f4c904873
--- /dev/null
+++ b/drawinglayer/source/attribute/sdrsceneattribute3d.cxx
@@ -0,0 +1,218 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute3d.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/sdrsceneattribute3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpSdrSceneAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // 3D scene attribute definitions
+ double mfDistance;
+ double mfShadowSlant;
+ ::com::sun::star::drawing::ProjectionMode maProjectionMode;
+ ::com::sun::star::drawing::ShadeMode maShadeMode;
+
+ // bitfield
+ unsigned mbTwoSidedLighting : 1;
+
+ public:
+ ImpSdrSceneAttribute(
+ double fDistance,
+ double fShadowSlant,
+ ::com::sun::star::drawing::ProjectionMode aProjectionMode,
+ ::com::sun::star::drawing::ShadeMode aShadeMode,
+ bool bTwoSidedLighting)
+ : mnRefCount(0),
+ mfDistance(fDistance),
+ mfShadowSlant(fShadowSlant),
+ maProjectionMode(aProjectionMode),
+ maShadeMode(aShadeMode),
+ mbTwoSidedLighting(bTwoSidedLighting)
+ {
+ }
+
+ // data read access
+ double getDistance() const { return mfDistance; }
+ double getShadowSlant() const { return mfShadowSlant; }
+ ::com::sun::star::drawing::ProjectionMode getProjectionMode() const { return maProjectionMode; }
+ ::com::sun::star::drawing::ShadeMode getShadeMode() const { return maShadeMode; }
+ bool getTwoSidedLighting() const { return mbTwoSidedLighting; }
+
+ bool operator==(const ImpSdrSceneAttribute& rCandidate) const
+ {
+ return (getDistance() == rCandidate.getDistance()
+ && getShadowSlant() == rCandidate.getShadowSlant()
+ && getProjectionMode() == rCandidate.getProjectionMode()
+ && getShadeMode() == rCandidate.getShadeMode()
+ && getTwoSidedLighting() == rCandidate.getTwoSidedLighting());
+ }
+
+ static ImpSdrSceneAttribute* get_global_default()
+ {
+ static ImpSdrSceneAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrSceneAttribute(
+ 0.0, 0.0,
+ ::com::sun::star::drawing::ProjectionMode_PARALLEL,
+ ::com::sun::star::drawing::ShadeMode_FLAT,
+ false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ SdrSceneAttribute::SdrSceneAttribute(
+ double fDistance,
+ double fShadowSlant,
+ ::com::sun::star::drawing::ProjectionMode aProjectionMode,
+ ::com::sun::star::drawing::ShadeMode aShadeMode,
+ bool bTwoSidedLighting)
+ : mpSdrSceneAttribute(new ImpSdrSceneAttribute(
+ fDistance, fShadowSlant, aProjectionMode, aShadeMode, bTwoSidedLighting))
+ {
+ }
+
+ SdrSceneAttribute::SdrSceneAttribute()
+ : mpSdrSceneAttribute(ImpSdrSceneAttribute::get_global_default())
+ {
+ mpSdrSceneAttribute->mnRefCount++;
+ }
+
+ SdrSceneAttribute::SdrSceneAttribute(const SdrSceneAttribute& rCandidate)
+ : mpSdrSceneAttribute(rCandidate.mpSdrSceneAttribute)
+ {
+ mpSdrSceneAttribute->mnRefCount++;
+ }
+
+ SdrSceneAttribute::~SdrSceneAttribute()
+ {
+ if(mpSdrSceneAttribute->mnRefCount)
+ {
+ mpSdrSceneAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrSceneAttribute;
+ }
+ }
+
+ bool SdrSceneAttribute::isDefault() const
+ {
+ return mpSdrSceneAttribute == ImpSdrSceneAttribute::get_global_default();
+ }
+
+ SdrSceneAttribute& SdrSceneAttribute::operator=(const SdrSceneAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdrSceneAttribute != mpSdrSceneAttribute)
+ {
+ if(mpSdrSceneAttribute->mnRefCount)
+ {
+ mpSdrSceneAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrSceneAttribute;
+ }
+
+ mpSdrSceneAttribute = rCandidate.mpSdrSceneAttribute;
+ mpSdrSceneAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool SdrSceneAttribute::operator==(const SdrSceneAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdrSceneAttribute == mpSdrSceneAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdrSceneAttribute == *mpSdrSceneAttribute);
+ }
+
+ double SdrSceneAttribute::getDistance() const
+ {
+ return mpSdrSceneAttribute->getDistance();
+ }
+
+ double SdrSceneAttribute::getShadowSlant() const
+ {
+ return mpSdrSceneAttribute->getShadowSlant();
+ }
+
+ ::com::sun::star::drawing::ProjectionMode SdrSceneAttribute::getProjectionMode() const
+ {
+ return mpSdrSceneAttribute->getProjectionMode();
+ }
+
+ ::com::sun::star::drawing::ShadeMode SdrSceneAttribute::getShadeMode() const
+ {
+ return mpSdrSceneAttribute->getShadeMode();
+ }
+
+ bool SdrSceneAttribute::getTwoSidedLighting() const
+ {
+ return mpSdrSceneAttribute->getTwoSidedLighting();
+ }
+
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/sdrshadowattribute.cxx b/drawinglayer/source/attribute/sdrshadowattribute.cxx
new file mode 100644
index 000000000000..9b31b5c6d348
--- /dev/null
+++ b/drawinglayer/source/attribute/sdrshadowattribute.cxx
@@ -0,0 +1,193 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#include <basegfx/color/bcolor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpSdrShadowAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // shadow definitions
+ basegfx::B2DVector maOffset; // shadow offset 1/100th mm
+ double mfTransparence; // [0.0 .. 1.0], 0.0==no transp.
+ basegfx::BColor maColor; // color of shadow
+
+ ImpSdrShadowAttribute(
+ const basegfx::B2DVector& rOffset,
+ double fTransparence,
+ const basegfx::BColor& rColor)
+ : mnRefCount(0),
+ maOffset(rOffset),
+ mfTransparence(fTransparence),
+ maColor(rColor)
+ {
+ }
+
+ // data read access
+ const basegfx::B2DVector& getOffset() const { return maOffset; }
+ double getTransparence() const { return mfTransparence; }
+ const basegfx::BColor& getColor() const { return maColor; }
+
+ bool operator==(const ImpSdrShadowAttribute& rCandidate) const
+ {
+ return (getOffset() == rCandidate.getOffset()
+ && getTransparence() == rCandidate.getTransparence()
+ && getColor() == rCandidate.getColor());
+ }
+
+ static ImpSdrShadowAttribute* get_global_default()
+ {
+ static ImpSdrShadowAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrShadowAttribute(
+ basegfx::B2DVector(),
+ 0.0,
+ basegfx::BColor());
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ SdrShadowAttribute::SdrShadowAttribute(
+ const basegfx::B2DVector& rOffset,
+ double fTransparence,
+ const basegfx::BColor& rColor)
+ : mpSdrShadowAttribute(new ImpSdrShadowAttribute(
+ rOffset, fTransparence, rColor))
+ {
+ }
+
+ SdrShadowAttribute::SdrShadowAttribute()
+ : mpSdrShadowAttribute(ImpSdrShadowAttribute::get_global_default())
+ {
+ mpSdrShadowAttribute->mnRefCount++;
+ }
+
+ SdrShadowAttribute::SdrShadowAttribute(const SdrShadowAttribute& rCandidate)
+ : mpSdrShadowAttribute(rCandidate.mpSdrShadowAttribute)
+ {
+ mpSdrShadowAttribute->mnRefCount++;
+ }
+
+ SdrShadowAttribute::~SdrShadowAttribute()
+ {
+ if(mpSdrShadowAttribute->mnRefCount)
+ {
+ mpSdrShadowAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrShadowAttribute;
+ }
+ }
+
+ bool SdrShadowAttribute::isDefault() const
+ {
+ return mpSdrShadowAttribute == ImpSdrShadowAttribute::get_global_default();
+ }
+
+ SdrShadowAttribute& SdrShadowAttribute::operator=(const SdrShadowAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdrShadowAttribute != mpSdrShadowAttribute)
+ {
+ if(mpSdrShadowAttribute->mnRefCount)
+ {
+ mpSdrShadowAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrShadowAttribute;
+ }
+
+ mpSdrShadowAttribute = rCandidate.mpSdrShadowAttribute;
+ mpSdrShadowAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool SdrShadowAttribute::operator==(const SdrShadowAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdrShadowAttribute == mpSdrShadowAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdrShadowAttribute == *mpSdrShadowAttribute);
+ }
+
+ const basegfx::B2DVector& SdrShadowAttribute::getOffset() const
+ {
+ return mpSdrShadowAttribute->getOffset();
+ }
+
+ double SdrShadowAttribute::getTransparence() const
+ {
+ return mpSdrShadowAttribute->getTransparence();
+ }
+
+ const basegfx::BColor& SdrShadowAttribute::getColor() const
+ {
+ return mpSdrShadowAttribute->getColor();
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/strokeattribute.cxx b/drawinglayer/source/attribute/strokeattribute.cxx
index f3eb4797b832..da1239e53211 100644
--- a/drawinglayer/source/attribute/strokeattribute.cxx
+++ b/drawinglayer/source/attribute/strokeattribute.cxx
@@ -45,16 +45,143 @@ namespace drawinglayer
{
namespace attribute
{
- double StrokeAttribute::getFullDotDashLen() const
+ class ImpStrokeAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // data definitions
+ ::std::vector< double > maDotDashArray; // array of double which defines the dot-dash pattern
+ double mfFullDotDashLen; // sum of maDotDashArray (for convenience)
+
+ ImpStrokeAttribute(
+ const ::std::vector< double >& rDotDashArray,
+ double fFullDotDashLen)
+ : mnRefCount(0),
+ maDotDashArray(rDotDashArray),
+ mfFullDotDashLen(fFullDotDashLen)
+ {
+ }
+
+ // data read access
+ const ::std::vector< double >& getDotDashArray() const { return maDotDashArray; }
+ double getFullDotDashLen() const
+ {
+ if(0.0 == mfFullDotDashLen && maDotDashArray.size())
+ {
+ // calculate length on demand
+ const double fAccumulated(::std::accumulate(maDotDashArray.begin(), maDotDashArray.end(), 0.0));
+ const_cast< ImpStrokeAttribute* >(this)->mfFullDotDashLen = fAccumulated;
+ }
+
+ return mfFullDotDashLen;
+ }
+
+ bool operator==(const ImpStrokeAttribute& rCandidate) const
+ {
+ return (getDotDashArray() == rCandidate.getDotDashArray()
+ && getFullDotDashLen() == rCandidate.getFullDotDashLen());
+ }
+
+ static ImpStrokeAttribute* get_global_default()
+ {
+ static ImpStrokeAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpStrokeAttribute(
+ std::vector< double >(),
+ 0.0);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ StrokeAttribute::StrokeAttribute(
+ const ::std::vector< double >& rDotDashArray,
+ double fFullDotDashLen)
+ : mpStrokeAttribute(new ImpStrokeAttribute(
+ rDotDashArray, fFullDotDashLen))
+ {
+ }
+
+ StrokeAttribute::StrokeAttribute()
+ : mpStrokeAttribute(ImpStrokeAttribute::get_global_default())
+ {
+ mpStrokeAttribute->mnRefCount++;
+ }
+
+ StrokeAttribute::StrokeAttribute(const StrokeAttribute& rCandidate)
+ : mpStrokeAttribute(rCandidate.mpStrokeAttribute)
+ {
+ mpStrokeAttribute->mnRefCount++;
+ }
+
+ StrokeAttribute::~StrokeAttribute()
+ {
+ if(mpStrokeAttribute->mnRefCount)
+ {
+ mpStrokeAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpStrokeAttribute;
+ }
+ }
+
+ bool StrokeAttribute::isDefault() const
+ {
+ return mpStrokeAttribute == ImpStrokeAttribute::get_global_default();
+ }
+
+ StrokeAttribute& StrokeAttribute::operator=(const StrokeAttribute& rCandidate)
+ {
+ if(rCandidate.mpStrokeAttribute != mpStrokeAttribute)
+ {
+ if(mpStrokeAttribute->mnRefCount)
+ {
+ mpStrokeAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpStrokeAttribute;
+ }
+
+ mpStrokeAttribute = rCandidate.mpStrokeAttribute;
+ mpStrokeAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool StrokeAttribute::operator==(const StrokeAttribute& rCandidate) const
{
- if(0.0 == mfFullDotDashLen && maDotDashArray.size())
+ if(rCandidate.mpStrokeAttribute == mpStrokeAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
{
- // calculate length on demand
- const double fAccumulated(::std::accumulate(maDotDashArray.begin(), maDotDashArray.end(), 0.0));
- const_cast< StrokeAttribute* >(this)->mfFullDotDashLen = fAccumulated;
+ return false;
}
- return mfFullDotDashLen;
+ return (*rCandidate.mpStrokeAttribute == *mpStrokeAttribute);
+ }
+
+ const ::std::vector< double >& StrokeAttribute::getDotDashArray() const
+ {
+ return mpStrokeAttribute->getDotDashArray();
+ }
+
+ double StrokeAttribute::getFullDotDashLen() const
+ {
+ return mpStrokeAttribute->getFullDotDashLen();
}
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx b/drawinglayer/source/geometry/viewinformation2d.cxx
index 3a3fd68831db..0f808e69b205 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -313,6 +313,22 @@ namespace drawinglayer
impInterpretPropertyValues(rViewParameters);
}
+ ImpViewInformation2D()
+ : mnRefCount(0),
+ maObjectTransformation(),
+ maViewTransformation(),
+ maObjectToViewTransformation(),
+ maInverseObjectToViewTransformation(),
+ maViewport(),
+ maDiscreteViewport(),
+ mxVisualizedPage(),
+ mfViewTime(),
+ mbReducedDisplayQuality(false),
+ mxViewInformation(),
+ mxExtendedInformation()
+ {
+ }
+
const basegfx::B2DHomMatrix& getObjectTransformation() const
{
return maObjectTransformation;
@@ -410,6 +426,21 @@ namespace drawinglayer
&& mfViewTime == rCandidate.mfViewTime
&& mxExtendedInformation == rCandidate.mxExtendedInformation);
}
+
+ static ImpViewInformation2D* get_global_default()
+ {
+ static ImpViewInformation2D* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpViewInformation2D();
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
};
} // end of anonymous namespace
} // end of namespace drawinglayer
@@ -442,6 +473,12 @@ namespace drawinglayer
{
}
+ ViewInformation2D::ViewInformation2D()
+ : mpViewInformation2D(ImpViewInformation2D::get_global_default())
+ {
+ mpViewInformation2D->mnRefCount++;
+ }
+
ViewInformation2D::ViewInformation2D(const ViewInformation2D& rCandidate)
: mpViewInformation2D(rCandidate.mpViewInformation2D)
{
@@ -463,6 +500,11 @@ namespace drawinglayer
}
}
+ bool ViewInformation2D::isDefault() const
+ {
+ return mpViewInformation2D == ImpViewInformation2D::get_global_default();
+ }
+
ViewInformation2D& ViewInformation2D::operator=(const ViewInformation2D& rCandidate)
{
::osl::Mutex m_mutex;
@@ -489,6 +531,11 @@ namespace drawinglayer
return true;
}
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
return (*rCandidate.mpViewInformation2D == *mpViewInformation2D);
}
diff --git a/drawinglayer/source/geometry/viewinformation3d.cxx b/drawinglayer/source/geometry/viewinformation3d.cxx
index a47384485ee7..62388adad37c 100644
--- a/drawinglayer/source/geometry/viewinformation3d.cxx
+++ b/drawinglayer/source/geometry/viewinformation3d.cxx
@@ -395,6 +395,18 @@ namespace drawinglayer
impInterpretPropertyValues(rViewParameters);
}
+ ImpViewInformation3D()
+ : mnRefCount(0),
+ maObjectTransformation(),
+ maOrientation(),
+ maProjection(),
+ maDeviceToView(),
+ mfViewTime(),
+ mxViewInformation(),
+ mxExtendedInformation()
+ {
+ }
+
const basegfx::B3DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
const basegfx::B3DHomMatrix& getOrientation() const { return maOrientation; }
const basegfx::B3DHomMatrix& getProjection() const { return maProjection; }
@@ -440,6 +452,21 @@ namespace drawinglayer
&& mfViewTime == rCandidate.mfViewTime
&& mxExtendedInformation == rCandidate.mxExtendedInformation);
}
+
+ static ImpViewInformation3D* get_global_default()
+ {
+ static ImpViewInformation3D* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpViewInformation3D();
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
};
} // end of anonymous namespace
} // end of namespace drawinglayer
@@ -457,7 +484,9 @@ namespace drawinglayer
const basegfx::B3DHomMatrix& rDeviceToView,
double fViewTime,
const uno::Sequence< beans::PropertyValue >& rExtendedParameters)
- : mpViewInformation3D(new ImpViewInformation3D(rObjectObjectTransformation, rOrientation, rProjection, rDeviceToView, fViewTime, rExtendedParameters))
+ : mpViewInformation3D(new ImpViewInformation3D(
+ rObjectObjectTransformation, rOrientation, rProjection,
+ rDeviceToView, fViewTime, rExtendedParameters))
{
}
@@ -466,6 +495,12 @@ namespace drawinglayer
{
}
+ ViewInformation3D::ViewInformation3D()
+ : mpViewInformation3D(ImpViewInformation3D::get_global_default())
+ {
+ mpViewInformation3D->mnRefCount++;
+ }
+
ViewInformation3D::ViewInformation3D(const ViewInformation3D& rCandidate)
: mpViewInformation3D(rCandidate.mpViewInformation3D)
{
@@ -487,6 +522,11 @@ namespace drawinglayer
}
}
+ bool ViewInformation3D::isDefault() const
+ {
+ return mpViewInformation3D == ImpViewInformation3D::get_global_default();
+ }
+
ViewInformation3D& ViewInformation3D::operator=(const ViewInformation3D& rCandidate)
{
::osl::Mutex m_mutex;
@@ -513,6 +553,11 @@ namespace drawinglayer
return true;
}
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
return (*rCandidate.mpViewInformation3D == *mpViewInformation3D);
}
diff --git a/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx
index ab9e9d19f6d2..aa5ede25314c 100644
--- a/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx
@@ -56,46 +56,54 @@ namespace drawinglayer
{
Primitive2DSequence FillBitmapPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- const Size aTileSizePixel(getFillBitmap().getBitmapEx().GetSizePixel());
Primitive2DSequence aRetval;
- // is there a tile with some size at all?
- if(aTileSizePixel.getWidth() && aTileSizePixel.getHeight())
+ if(!getFillBitmap().isDefault())
{
- 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());
+ const Size aTileSizePixel(getFillBitmap().getBitmapEx().GetSizePixel());
- // create one primitive for each matrix
- for(sal_uInt32 a(0L); a < aMatrices.size(); a++)
+ // is there a tile with some size at all?
+ if(aTileSizePixel.getWidth() && aTileSizePixel.getHeight())
+ {
+ if(getFillBitmap().getTiling())
{
- basegfx::B2DHomMatrix aNewMatrix = aMatrices[a];
- aNewMatrix *= getTransformation();
-
- // create bitmap primitive and add to result
- const Primitive2DReference xRef(new BitmapPrimitive2D(getFillBitmap().getBitmapEx(), aNewMatrix));
- aRetval[a] = xRef;
+ // 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(getFillBitmap().getBitmapEx(), 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(getFillBitmap().getBitmapEx(), aObjectTransform));
+
+ aRetval = Primitive2DSequence(&xRef, 1L);
}
- }
- 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(getFillBitmap().getBitmapEx(), aObjectTransform));
- aRetval = Primitive2DSequence(&xRef, 1L);
}
}
@@ -127,7 +135,7 @@ namespace drawinglayer
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)));
+ basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon());
aPolygon.transform(getTransformation());
return basegfx::tools::getRange(aPolygon);
}
diff --git a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
index 625dae6cb93a..7df93f9defce 100644
--- a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
@@ -62,10 +62,10 @@ namespace drawinglayer
rColors.clear();
// make sure steps is not too high/low
- const basegfx::BColor aStart(maFillGradient.getStartColor());
- const basegfx::BColor aEnd(maFillGradient.getEndColor());
+ const basegfx::BColor aStart(getFillGradient().getStartColor());
+ const basegfx::BColor aEnd(getFillGradient().getEndColor());
const sal_uInt32 nMaxSteps(sal_uInt32((aStart.getMaximumDistance(aEnd) * 127.5) + 0.5));
- sal_uInt32 nSteps(maFillGradient.getSteps());
+ sal_uInt32 nSteps(getFillGradient().getSteps());
if(nSteps == 0)
{
@@ -82,46 +82,46 @@ namespace drawinglayer
nSteps = nMaxSteps;
}
- switch(maFillGradient.getStyle())
+ switch(getFillGradient().getStyle())
{
case attribute::GRADIENTSTYLE_LINEAR:
{
- texture::GeoTexSvxGradientLinear aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), -maFillGradient.getAngle());
+ texture::GeoTexSvxGradientLinear aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), -getFillGradient().getAngle());
aGradient.appendTransformations(rMatrices);
aGradient.appendColors(rColors);
break;
}
case attribute::GRADIENTSTYLE_AXIAL:
{
- texture::GeoTexSvxGradientAxial aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), -maFillGradient.getAngle());
+ texture::GeoTexSvxGradientAxial aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), -getFillGradient().getAngle());
aGradient.appendTransformations(rMatrices);
aGradient.appendColors(rColors);
break;
}
case attribute::GRADIENTSTYLE_RADIAL:
{
- texture::GeoTexSvxGradientRadial aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY());
+ texture::GeoTexSvxGradientRadial aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY());
aGradient.appendTransformations(rMatrices);
aGradient.appendColors(rColors);
break;
}
case attribute::GRADIENTSTYLE_ELLIPTICAL:
{
- texture::GeoTexSvxGradientElliptical aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), -maFillGradient.getAngle());
+ texture::GeoTexSvxGradientElliptical aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), -getFillGradient().getAngle());
aGradient.appendTransformations(rMatrices);
aGradient.appendColors(rColors);
break;
}
case attribute::GRADIENTSTYLE_SQUARE:
{
- texture::GeoTexSvxGradientSquare aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), -maFillGradient.getAngle());
+ texture::GeoTexSvxGradientSquare aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), -getFillGradient().getAngle());
aGradient.appendTransformations(rMatrices);
aGradient.appendColors(rColors);
break;
}
case attribute::GRADIENTSTYLE_RECT:
{
- texture::GeoTexSvxGradientRect aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), -maFillGradient.getAngle());
+ texture::GeoTexSvxGradientRect aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), -getFillGradient().getAngle());
aGradient.appendTransformations(rMatrices);
aGradient.appendColors(rColors);
break;
@@ -218,15 +218,15 @@ namespace drawinglayer
// prepare shape of the Unit Polygon
basegfx::B2DPolygon aUnitPolygon;
- if(attribute::GRADIENTSTYLE_RADIAL == maFillGradient.getStyle()
- || attribute::GRADIENTSTYLE_ELLIPTICAL == maFillGradient.getStyle())
+ if(attribute::GRADIENTSTYLE_RADIAL == getFillGradient().getStyle()
+ || attribute::GRADIENTSTYLE_ELLIPTICAL == getFillGradient().getStyle())
{
const basegfx::B2DPoint aCircleCenter(0.5, 0.5);
aUnitPolygon = basegfx::tools::createPolygonFromEllipse(aCircleCenter, 0.5, 0.5);
}
else
{
- aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0));
+ aUnitPolygon = basegfx::tools::createUnitPolygon();
}
// get the transform matrices and colors (where colors
@@ -253,7 +253,15 @@ namespace drawinglayer
// that the rings will not overlap. This is useful fir the old XOR-paint
// 'trick' of VCL which is recorded in Metafiles; so this version may be
// used from the MetafilePrimitive2D in it's decomposition.
- return createFill(true);
+
+ if(!getFillGradient().isDefault())
+ {
+ return createFill(true);
+ }
+ else
+ {
+ return Primitive2DSequence();
+ }
}
FillGradientPrimitive2D::FillGradientPrimitive2D(
@@ -272,7 +280,7 @@ namespace drawinglayer
const FillGradientPrimitive2D& rCompare = (FillGradientPrimitive2D&)rPrimitive;
return (getObjectRange() == rCompare.getObjectRange()
- && maFillGradient == rCompare.maFillGradient);
+ && getFillGradient() == rCompare.getFillGradient());
}
return false;
diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
index 9e6e69516d43..e042019eb64b 100644
--- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
@@ -57,65 +57,73 @@ namespace drawinglayer
{
Primitive2DSequence FillHatchPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- // create hatch
- const basegfx::BColor aHatchColor(maFillHatch.getColor());
- const double fAngle(-maFillHatch.getAngle());
- ::std::vector< basegfx::B2DHomMatrix > aMatrices;
+ Primitive2DSequence aRetval;
- // get hatch transformations
- switch(maFillHatch.getStyle())
+ if(!getFillHatch().isDefault())
{
- case attribute::HATCHSTYLE_TRIPLE:
- {
- // rotated 45 degrees
- texture::GeoTexSvxHatch aHatch(getObjectRange(), maFillHatch.getDistance(), fAngle + F_PI4);
- aHatch.appendTransformations(aMatrices);
+ // create hatch
+ const basegfx::BColor aHatchColor(getFillHatch().getColor());
+ const double fAngle(-getFillHatch().getAngle());
+ ::std::vector< basegfx::B2DHomMatrix > aMatrices;
- // fall-through by purpose
- }
- case attribute::HATCHSTYLE_DOUBLE:
+ // get hatch transformations
+ switch(getFillHatch().getStyle())
{
- // rotated 90 degrees
- texture::GeoTexSvxHatch aHatch(getObjectRange(), maFillHatch.getDistance(), fAngle + F_PI2);
- aHatch.appendTransformations(aMatrices);
-
- // fall-through by purpose
+ case attribute::HATCHSTYLE_TRIPLE:
+ {
+ // rotated 45 degrees
+ texture::GeoTexSvxHatch aHatch(getObjectRange(), getFillHatch().getDistance(), fAngle + F_PI4);
+ aHatch.appendTransformations(aMatrices);
+
+ // fall-through by purpose
+ }
+ case attribute::HATCHSTYLE_DOUBLE:
+ {
+ // rotated 90 degrees
+ texture::GeoTexSvxHatch aHatch(getObjectRange(), getFillHatch().getDistance(), fAngle + F_PI2);
+ aHatch.appendTransformations(aMatrices);
+
+ // fall-through by purpose
+ }
+ case attribute::HATCHSTYLE_SINGLE:
+ {
+ // angle as given
+ texture::GeoTexSvxHatch aHatch(getObjectRange(), getFillHatch().getDistance(), fAngle);
+ 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());
+ // prepare return value
+ const bool bFillBackground(getFillHatch().isFillBackground());
+ aRetval.realloc(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;
- }
+ // evtl. create filled background
+ if(bFillBackground)
+ {
+ // create primitive for background
+ const Primitive2DReference xRef(
+ new PolyPolygonColorPrimitive2D(
+ basegfx::B2DPolyPolygon(
+ basegfx::tools::createPolygonFromRect(getObjectRange())), getBColor()));
+ aRetval[0] = xRef;
+ }
- // create primitives
- const basegfx::B2DPoint aStart(0.0, 0.0);
- const basegfx::B2DPoint aEnd(1.0, 0.0);
+ // 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;
+ 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);
+ aNewLine.append(rMatrix * aStart);
+ aNewLine.append(rMatrix * aEnd);
- // create hairline
- const Primitive2DReference xRef(new PolygonHairlinePrimitive2D(aNewLine, aHatchColor));
- aRetval[bFillBackground ? (a + 1L) : a] = xRef;
+ // create hairline
+ const Primitive2DReference xRef(new PolygonHairlinePrimitive2D(aNewLine, aHatchColor));
+ aRetval[bFillBackground ? (a + 1) : a] = xRef;
+ }
}
return aRetval;
@@ -139,8 +147,8 @@ namespace drawinglayer
const FillHatchPrimitive2D& rCompare = (FillHatchPrimitive2D&)rPrimitive;
return (getObjectRange() == rCompare.getObjectRange()
- && maFillHatch == rCompare.maFillHatch
- && maBColor == rCompare.maBColor);
+ && getFillHatch() == rCompare.getFillHatch()
+ && getBColor() == rCompare.getBColor());
}
return false;
diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
index 6d1540594dc9..2176a45341ec 100644
--- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
@@ -772,9 +772,7 @@ namespace drawinglayer
{
// clipping needed. Embed to MaskPrimitive2D. Create childs and mask polygon
const primitive2d::Primitive2DSequence aChildContent(&xPrimitive, 1);
- basegfx::B2DPolygon aMaskPolygon(
- basegfx::tools::createPolygonFromRect(
- basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aMaskPolygon(basegfx::tools::createUnitPolygon());
aMaskPolygon.transform(aTransform);
xPrimitive = Primitive2DReference(
@@ -880,7 +878,7 @@ namespace drawinglayer
else
{
// cropped got bigger, mask it with original object's bounds
- basegfx::B2DPolyPolygon aMaskPolyPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolyPolygon aMaskPolyPolygon(basegfx::tools::createUnitPolygon());
aMaskPolyPolygon.transform(getTransform());
// create maskPrimitive with aMaskPolyPolygon and aMaskContentVector
diff --git a/drawinglayer/source/primitive2d/hittestprimitive2d.cxx b/drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx
index 137f8cf8ad5c..2b3afeb0f8ed 100644
--- a/drawinglayer/source/primitive2d/hittestprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx
@@ -36,7 +36,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_drawinglayer.hxx"
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -49,25 +49,24 @@ namespace drawinglayer
{
namespace primitive2d
{
- HitTestPrimitive2D::HitTestPrimitive2D(
+ HiddenGeometryPrimitive2D::HiddenGeometryPrimitive2D(
const Primitive2DSequence& rChildren)
: GroupPrimitive2D(rChildren)
{
}
- basegfx::B2DRange HitTestPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
+ basegfx::B2DRange HiddenGeometryPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
return getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation);
}
- Primitive2DSequence HitTestPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence HiddenGeometryPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- // return empty sequence
return Primitive2DSequence();
}
// provide unique ID
- ImplPrimitrive2DIDBlock(HitTestPrimitive2D, PRIMITIVE2D_ID_HITTESTPRIMITIVE2D)
+ ImplPrimitrive2DIDBlock(HiddenGeometryPrimitive2D, PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D)
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive2d/invertprimitive2d.cxx b/drawinglayer/source/primitive2d/invertprimitive2d.cxx
index 374ec578113d..6faf4f2cf0ad 100644
--- a/drawinglayer/source/primitive2d/invertprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/invertprimitive2d.cxx
@@ -2,7 +2,7 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: unifiedalphaprimitive2d.cxx,v $
+ * $RCSfile: UnifiedTransparencePrimitive2D.cxx,v $
*
* $Revision: 1.5 $
*
diff --git a/drawinglayer/source/primitive2d/makefile.mk b/drawinglayer/source/primitive2d/makefile.mk
index c9a3cc191a35..078142b673b2 100644
--- a/drawinglayer/source/primitive2d/makefile.mk
+++ b/drawinglayer/source/primitive2d/makefile.mk
@@ -45,50 +45,51 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files -------------------------------------
SLOFILES= \
- $(SLO)$/alphaprimitive2d.obj \
- $(SLO)$/animatedprimitive2d.obj \
- $(SLO)$/baseprimitive2d.obj \
- $(SLO)$/backgroundcolorprimitive2d.obj \
- $(SLO)$/bitmapprimitive2d.obj \
- $(SLO)$/borderlineprimitive2d.obj \
- $(SLO)$/chartprimitive2d.obj \
- $(SLO)$/controlprimitive2d.obj \
- $(SLO)$/discretebitmapprimitive2d.obj \
- $(SLO)$/embedded3dprimitive2d.obj \
- $(SLO)$/epsprimitive2d.obj \
- $(SLO)$/fillbitmapprimitive2d.obj \
- $(SLO)$/fillgradientprimitive2d.obj \
- $(SLO)$/fillhatchprimitive2d.obj \
- $(SLO)$/graphicprimitive2d.obj \
- $(SLO)$/gridprimitive2d.obj \
- $(SLO)$/groupprimitive2d.obj \
- $(SLO)$/helplineprimitive2d.obj \
- $(SLO)$/hittestprimitive2d.obj \
- $(SLO)$/invertprimitive2d.obj \
- $(SLO)$/markerarrayprimitive2d.obj \
- $(SLO)$/pointarrayprimitive2d.obj \
- $(SLO)$/maskprimitive2d.obj \
- $(SLO)$/mediaprimitive2d.obj \
- $(SLO)$/metafileprimitive2d.obj \
- $(SLO)$/modifiedcolorprimitive2d.obj \
- $(SLO)$/pagepreviewprimitive2d.obj \
- $(SLO)$/polypolygonprimitive2d.obj \
- $(SLO)$/polygonprimitive2d.obj \
- $(SLO)$/primitivetools2d.obj \
- $(SLO)$/sceneprimitive2d.obj \
- $(SLO)$/shadowprimitive2d.obj \
- $(SLO)$/structuretagprimitive2d.obj \
- $(SLO)$/texteffectprimitive2d.obj \
- $(SLO)$/textenumsprimitive2d.obj \
- $(SLO)$/textlayoutdevice.obj \
- $(SLO)$/textlineprimitive2d.obj \
- $(SLO)$/textprimitive2d.obj \
- $(SLO)$/textstrikeoutprimitive2d.obj \
- $(SLO)$/textdecoratedprimitive2d.obj \
- $(SLO)$/texthierarchyprimitive2d.obj \
- $(SLO)$/transformprimitive2d.obj \
- $(SLO)$/unifiedalphaprimitive2d.obj \
- $(SLO)$/wallpaperprimitive2d.obj \
+ $(SLO)$/transparenceprimitive2d.obj \
+ $(SLO)$/animatedprimitive2d.obj \
+ $(SLO)$/baseprimitive2d.obj \
+ $(SLO)$/backgroundcolorprimitive2d.obj \
+ $(SLO)$/bitmapprimitive2d.obj \
+ $(SLO)$/borderlineprimitive2d.obj \
+ $(SLO)$/chartprimitive2d.obj \
+ $(SLO)$/controlprimitive2d.obj \
+ $(SLO)$/discretebitmapprimitive2d.obj \
+ $(SLO)$/embedded3dprimitive2d.obj \
+ $(SLO)$/epsprimitive2d.obj \
+ $(SLO)$/fillbitmapprimitive2d.obj \
+ $(SLO)$/fillgradientprimitive2d.obj \
+ $(SLO)$/fillhatchprimitive2d.obj \
+ $(SLO)$/graphicprimitive2d.obj \
+ $(SLO)$/gridprimitive2d.obj \
+ $(SLO)$/groupprimitive2d.obj \
+ $(SLO)$/helplineprimitive2d.obj \
+ $(SLO)$/hiddengeometryprimitive2d.obj \
+ $(SLO)$/invertprimitive2d.obj \
+ $(SLO)$/markerarrayprimitive2d.obj \
+ $(SLO)$/pointarrayprimitive2d.obj \
+ $(SLO)$/maskprimitive2d.obj \
+ $(SLO)$/mediaprimitive2d.obj \
+ $(SLO)$/metafileprimitive2d.obj \
+ $(SLO)$/modifiedcolorprimitive2d.obj \
+ $(SLO)$/pagepreviewprimitive2d.obj \
+ $(SLO)$/polypolygonprimitive2d.obj \
+ $(SLO)$/polygonprimitive2d.obj \
+ $(SLO)$/primitivetools2d.obj \
+ $(SLO)$/sceneprimitive2d.obj \
+ $(SLO)$/sdrdecompositiontools2d.obj \
+ $(SLO)$/shadowprimitive2d.obj \
+ $(SLO)$/structuretagprimitive2d.obj \
+ $(SLO)$/texteffectprimitive2d.obj \
+ $(SLO)$/textenumsprimitive2d.obj \
+ $(SLO)$/textlayoutdevice.obj \
+ $(SLO)$/textlineprimitive2d.obj \
+ $(SLO)$/textprimitive2d.obj \
+ $(SLO)$/textstrikeoutprimitive2d.obj \
+ $(SLO)$/textdecoratedprimitive2d.obj \
+ $(SLO)$/texthierarchyprimitive2d.obj \
+ $(SLO)$/transformprimitive2d.obj \
+ $(SLO)$/unifiedtransparenceprimitive2d.obj \
+ $(SLO)$/wallpaperprimitive2d.obj \
$(SLO)$/wrongspellprimitive2d.obj
# --- Targets ----------------------------------
diff --git a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx
index ba8f81448968..f99508be03e6 100644
--- a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx
@@ -46,6 +46,7 @@
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -58,9 +59,12 @@ namespace drawinglayer
Primitive2DSequence xRetval(1);
// create background object
- basegfx::B2DPolygon aBackgroundPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aBackgroundPolygon(basegfx::tools::createUnitPolygon());
aBackgroundPolygon.transform(getTransform());
- const Primitive2DReference xRefBackground(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aBackgroundPolygon), getBackgroundColor()));
+ const Primitive2DReference xRefBackground(
+ new PolyPolygonColorPrimitive2D(
+ basegfx::B2DPolyPolygon(aBackgroundPolygon),
+ getBackgroundColor()));
xRetval[0] = xRefBackground;
// try to get graphic snapshot
@@ -87,10 +91,13 @@ namespace drawinglayer
basegfx::B2DRange aDestRange(aSourceRange);
aDestRange.grow(-0.5 * fDiscreteSize);
- if(::basegfx::fTools::equalZero(aDestRange.getWidth()) || ::basegfx::fTools::equalZero(aDestRange.getHeight()))
+ if(basegfx::fTools::equalZero(aDestRange.getWidth()) || basegfx::fTools::equalZero(aDestRange.getHeight()))
{
- // shrunk primitive has no content (zero size in X or Y), nothing to display, nothing to return
- xRetval = Primitive2DSequence();
+ // shrunk primitive has no content (zero size in X or Y), nothing to display. Still create
+ // invisible content for HitTest and BoundRect
+ const Primitive2DReference xHiddenLines(new HiddenGeometryPrimitive2D(xRetval));
+
+ xRetval = Primitive2DSequence(&xHiddenLines, 1);
}
else
{
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index 2fb3d119d4bd..4bb123380ee6 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -53,10 +53,10 @@
#include <drawinglayer/primitive2d/discretebitmapprimitive2d.hxx>
#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
#include <vcl/salbtype.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/UnifiedTransparencePrimitive2D.hxx>
#include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx>
#include <vcl/svapp.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygonclipper.hxx>
@@ -589,7 +589,14 @@ namespace drawinglayer
Primitive2DSequence NonOverlappingFillGradientPrimitive2D::create2DDecomposition(
const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- return createFill(false);
+ if(!getFillGradient().isDefault())
+ {
+ return createFill(false);
+ }
+ else
+ {
+ return Primitive2DSequence();
+ }
}
} // end of namespace primitive2d
} // end of namespace drawinglayer
@@ -841,7 +848,7 @@ namespace
}
/** helper to create a regular BotmapEx from a MaskAction (definitions
- which use a bitmap without alpha but define one of the colors as
+ which use a bitmap without transparence but define one of the colors as
transparent)
*/
BitmapEx createMaskBmpEx(const Bitmap& rBitmap, const Color& rMaskColor)
@@ -2728,7 +2735,7 @@ namespace
if(aSubContent.hasElements())
{
rTargetHolders.Current().append(
- new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
aSubContent,
nTransparence * 0.01));
}
@@ -2839,9 +2846,9 @@ namespace
if(aAttribute.getStartColor() == aAttribute.getEndColor())
{
- // not really a gradient; create UnifiedAlphaPrimitive2D
+ // not really a gradient; create UnifiedTransparencePrimitive2D
rTargetHolders.Current().append(
- new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
xSubContent,
aAttribute.getStartColor().luminance()));
}
@@ -2853,17 +2860,17 @@ namespace
aTargetRectangle.Right(), aTargetRectangle.Bottom());
aRange.transform(rPropertyHolders.Current().getTransformation());
- // prepare gradient for alpha content
- const drawinglayer::primitive2d::Primitive2DReference xAlpha(
+ // prepare gradient for transparent content
+ const drawinglayer::primitive2d::Primitive2DReference xTransparence(
new drawinglayer::primitive2d::FillGradientPrimitive2D(
aRange,
aAttribute));
- // create alpha primitive
+ // create transparence primitive
rTargetHolders.Current().append(
- new drawinglayer::primitive2d::AlphaPrimitive2D(
+ new drawinglayer::primitive2d::TransparencePrimitive2D(
xSubContent,
- drawinglayer::primitive2d::Primitive2DSequence(&xAlpha, 1)));
+ drawinglayer::primitive2d::Primitive2DSequence(&xTransparence, 1)));
}
}
}
diff --git a/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx b/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx
index b747c79ee0c7..ec23791a7230 100644
--- a/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx
@@ -77,7 +77,10 @@ namespace drawinglayer
if(!aAllowedContentRange.isInside(aRealContentRange))
{
- const Primitive2DReference xReferenceA(new MaskPrimitive2D(basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(aAllowedContentRange)), aContent));
+ const Primitive2DReference xReferenceA(
+ new MaskPrimitive2D(
+ basegfx::B2DPolyPolygon(
+ basegfx::tools::createPolygonFromRect(aAllowedContentRange)), aContent));
aContent = Primitive2DSequence(&xReferenceA, 1);
}
diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
index 69cbd046efd2..c9108b58b000 100644
--- a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
@@ -43,6 +43,7 @@
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
+#include <basegfx/polygon/b2dlinegeometry.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -243,7 +244,7 @@ namespace drawinglayer
const basegfx::B2DPolygon aB2DPolygon(basegfx::tools::simplifyCurveSegments(getB2DPolygon()));
basegfx::B2DPolyPolygon aHairLinePolyPolygon;
- if(0.0 == getStrokeAttribute().getFullDotDashLen())
+ if(getStrokeAttribute().isDefault() || 0.0 == getStrokeAttribute().getFullDotDashLen())
{
// no line dashing, just copy
aHairLinePolyPolygon.append(aB2DPolygon);
@@ -251,12 +252,14 @@ namespace drawinglayer
else
{
// apply LineStyle
- basegfx::tools::applyLineDashing(aB2DPolygon, getStrokeAttribute().getDotDashArray(), &aHairLinePolyPolygon, 0, getStrokeAttribute().getFullDotDashLen());
+ basegfx::tools::applyLineDashing(
+ aB2DPolygon, getStrokeAttribute().getDotDashArray(),
+ &aHairLinePolyPolygon, 0, getStrokeAttribute().getFullDotDashLen());
}
const sal_uInt32 nCount(aHairLinePolyPolygon.count());
- if(getLineAttribute().getWidth())
+ if(!getLineAttribute().isDefault() && getLineAttribute().getWidth())
{
// create fat line data
const double fHalfLineWidth(getLineAttribute().getWidth() / 2.0);
@@ -293,7 +296,11 @@ namespace drawinglayer
else
{
// prepare return value
- const Primitive2DReference xRef(new PolyPolygonHairlinePrimitive2D(aHairLinePolyPolygon, getLineAttribute().getColor()));
+ const Primitive2DReference xRef(
+ new PolyPolygonHairlinePrimitive2D(
+ aHairLinePolyPolygon,
+ getLineAttribute().getColor()));
+
return Primitive2DSequence(&xRef, 1);
}
}
@@ -519,7 +526,7 @@ namespace drawinglayer
double fStart(0.0);
double fEnd(0.0);
- if(getStart().isActive())
+ if(!getStart().isDefault() && getStart().isActive())
{
// create start arrow primitive and consume
aArrowA = basegfx::tools::createAreaGeometryForLineStartEnd(
@@ -530,7 +537,7 @@ namespace drawinglayer
fStart *= 0.8;
}
- if(getEnd().isActive())
+ if(!getEnd().isDefault() && getEnd().isActive())
{
// create end arrow primitive and consume
aArrowB = basegfx::tools::createAreaGeometryForLineStartEnd(
@@ -553,18 +560,24 @@ namespace drawinglayer
sal_uInt32 nInd(0L);
// add shaft
- const Primitive2DReference xRefShaft(new PolygonStrokePrimitive2D(aLocalPolygon, getLineAttribute(), getStrokeAttribute()));
+ const Primitive2DReference xRefShaft(new
+ PolygonStrokePrimitive2D(
+ aLocalPolygon, getLineAttribute(), getStrokeAttribute()));
aRetval[nInd++] = xRefShaft;
if(aArrowA.count())
{
- const Primitive2DReference xRefA(new PolyPolygonColorPrimitive2D(aArrowA, getLineAttribute().getColor()));
+ const Primitive2DReference xRefA(
+ new PolyPolygonColorPrimitive2D(
+ aArrowA, getLineAttribute().getColor()));
aRetval[nInd++] = xRefA;
}
if(aArrowB.count())
{
- const Primitive2DReference xRefB(new PolyPolygonColorPrimitive2D(aArrowB, getLineAttribute().getColor()));
+ const Primitive2DReference xRefB(
+ new PolyPolygonColorPrimitive2D(
+ aArrowB, getLineAttribute().getColor()));
aRetval[nInd++] = xRefB;
}
diff --git a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
index 55c334434c70..0a7236a59127 100644
--- a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
@@ -196,7 +196,9 @@ namespace drawinglayer
for(sal_uInt32 a(0L); a < nCount; a++)
{
- aRetval[a] = Primitive2DReference(new PolygonStrokePrimitive2D(aPolyPolygon.getB2DPolygon(a), getLineAttribute(), getStrokeAttribute()));
+ aRetval[a] = Primitive2DReference(
+ new PolygonStrokePrimitive2D(
+ aPolyPolygon.getB2DPolygon(a), getLineAttribute(), getStrokeAttribute()));
}
return aRetval;
@@ -284,11 +286,14 @@ namespace drawinglayer
if(aPolygon.isClosed())
{
// no need for PolygonStrokeArrowPrimitive2D when polygon is closed
- aRetval[a] = Primitive2DReference(new PolygonStrokePrimitive2D(aPolygon, getLineAttribute(), getStrokeAttribute()));
+ aRetval[a] = Primitive2DReference(
+ new PolygonStrokePrimitive2D(aPolygon, getLineAttribute(), getStrokeAttribute()));
}
else
{
- aRetval[a] = Primitive2DReference(new PolygonStrokeArrowPrimitive2D(aPolygon, getLineAttribute(), getStrokeAttribute(), getStart(), getEnd()));
+ aRetval[a] = Primitive2DReference(
+ new PolygonStrokeArrowPrimitive2D(aPolygon, getLineAttribute(),
+ getStrokeAttribute(), getStart(), getEnd()));
}
}
@@ -406,16 +411,24 @@ namespace drawinglayer
{
Primitive2DSequence PolyPolygonGradientPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- // create SubSequence with FillGradientPrimitive2D
- const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
- FillGradientPrimitive2D* pNewGradient = new FillGradientPrimitive2D(aPolyPolygonRange, 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);
+ if(!getFillGradient().isDefault())
+ {
+ // create SubSequence with FillGradientPrimitive2D
+ const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
+ FillGradientPrimitive2D* pNewGradient = new FillGradientPrimitive2D(aPolyPolygonRange, 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, 1);
+ }
+ else
+ {
+ return Primitive2DSequence();
+ }
}
PolyPolygonGradientPrimitive2D::PolyPolygonGradientPrimitive2D(
@@ -453,16 +466,24 @@ namespace drawinglayer
{
Primitive2DSequence PolyPolygonHatchPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- // create SubSequence with FillHatchPrimitive2D
- const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
- FillHatchPrimitive2D* pNewHatch = new FillHatchPrimitive2D(aPolyPolygonRange, getBackgroundColor(), 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);
+ if(!getFillHatch().isDefault())
+ {
+ // create SubSequence with FillHatchPrimitive2D
+ const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
+ FillHatchPrimitive2D* pNewHatch = new FillHatchPrimitive2D(aPolyPolygonRange, getBackgroundColor(), 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, 1);
+ }
+ else
+ {
+ return Primitive2DSequence();
+ }
}
PolyPolygonHatchPrimitive2D::PolyPolygonHatchPrimitive2D(
@@ -503,21 +524,29 @@ namespace drawinglayer
{
Primitive2DSequence PolyPolygonBitmapPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- // create SubSequence with FillBitmapPrimitive2D
- const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
- basegfx::B2DHomMatrix aNewObjectTransform;
- aNewObjectTransform.set(0, 0, aPolyPolygonRange.getWidth());
- aNewObjectTransform.set(1, 1, aPolyPolygonRange.getHeight());
- aNewObjectTransform.set(0, 2, aPolyPolygonRange.getMinX());
- aNewObjectTransform.set(1, 2, aPolyPolygonRange.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);
+ if(!getFillBitmap().isDefault())
+ {
+ // create SubSequence with FillBitmapPrimitive2D
+ const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
+ basegfx::B2DHomMatrix aNewObjectTransform;
+ aNewObjectTransform.set(0, 0, aPolyPolygonRange.getWidth());
+ aNewObjectTransform.set(1, 1, aPolyPolygonRange.getHeight());
+ aNewObjectTransform.set(0, 2, aPolyPolygonRange.getMinX());
+ aNewObjectTransform.set(1, 2, aPolyPolygonRange.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, 1);
+ }
+ else
+ {
+ return Primitive2DSequence();
+ }
}
PolyPolygonBitmapPrimitive2D::PolyPolygonBitmapPrimitive2D(
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index 0223fb85d23e..48946810ee5f 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -156,8 +156,10 @@ namespace drawinglayer
if(impGetShadow3D(rViewInformation))
{
// test visibility
- const basegfx::B2DRange aShadow2DRange(getB2DRangeFromPrimitive2DSequence(maShadowPrimitives, rViewInformation));
- const basegfx::B2DRange aViewRange(rViewInformation.getViewport());
+ const basegfx::B2DRange aShadow2DRange(
+ getB2DRangeFromPrimitive2DSequence(maShadowPrimitives, rViewInformation));
+ const basegfx::B2DRange aViewRange(
+ rViewInformation.getViewport());
if(aViewRange.isEmpty() || aShadow2DRange.overlaps(aViewRange))
{
@@ -170,6 +172,7 @@ namespace drawinglayer
basegfx::B2DRange aDiscreteRange;
basegfx::B2DRange aVisibleDiscreteRange;
basegfx::B2DRange aUnitVisibleRange;
+
calculateDiscreteSizes(rViewInformation, aDiscreteRange, aVisibleDiscreteRange, aUnitVisibleRange);
if(!aVisibleDiscreteRange.isEmpty())
@@ -263,7 +266,7 @@ namespace drawinglayer
if(bAddOutlineToCreated3DSceneRepresentation)
{
- basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aOutline(basegfx::tools::createUnitPolygon());
aOutline.transform(aNew2DTransform);
const Primitive2DReference xRef2(new PolygonHairlinePrimitive2D(aOutline, basegfx::BColor(1.0, 0.0, 0.0)));
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, xRef2);
diff --git a/drawinglayer/source/primitive2d/sdrdecompositiontools2d.cxx b/drawinglayer/source/primitive2d/sdrdecompositiontools2d.cxx
new file mode 100644
index 000000000000..9d90c35103d9
--- /dev/null
+++ b/drawinglayer/source/primitive2d/sdrdecompositiontools2d.cxx
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrdecompositiontools3d.cxx,v $
+ *
+ * $Revision: 1.7 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:21 $
+ *
+ * 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DHomMatrix& rMatrix)
+ {
+ const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createUnitPolygon());
+
+ return createHiddenGeometryPrimitives2D(
+ bFilled,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ rMatrix);
+ }
+
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DPolyPolygon& rPolyPolygon)
+ {
+ return createHiddenGeometryPrimitives2D(
+ bFilled,
+ rPolyPolygon,
+ basegfx::B2DHomMatrix());
+ }
+
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DRange& rRange)
+ {
+ return createHiddenGeometryPrimitives2D(
+ bFilled,
+ rRange,
+ basegfx::B2DHomMatrix());
+ }
+
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DRange& rRange,
+ const basegfx::B2DHomMatrix& rMatrix)
+ {
+ const basegfx::B2DPolyPolygon aOutline(basegfx::tools::createPolygonFromRect(rRange));
+
+ return createHiddenGeometryPrimitives2D(
+ bFilled,
+ aOutline,
+ rMatrix);
+ }
+
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const basegfx::B2DHomMatrix& rMatrix)
+ {
+ // create fill or line primitive
+ Primitive2DReference xReference;
+ basegfx::B2DPolyPolygon aScaledOutline(rPolyPolygon);
+ aScaledOutline.transform(rMatrix);
+
+ if(bFilled)
+ {
+ xReference = new PolyPolygonColorPrimitive2D(
+ basegfx::B2DPolyPolygon(aScaledOutline),
+ basegfx::BColor(0.0, 0.0, 0.0));
+ }
+ else
+ {
+ const basegfx::BColor aGrayTone(0xc0 / 255.0, 0xc0 / 255.0, 0xc0 / 255.0);
+
+ xReference = new PolyPolygonHairlinePrimitive2D(
+ aScaledOutline,
+ aGrayTone);
+ }
+
+ // create HiddenGeometryPrimitive2D
+ return Primitive2DReference(
+ new HiddenGeometryPrimitive2D(Primitive2DSequence(&xReference, 1)));
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
index b6ce7dc3248d..7d8abd5490fb 100644
--- a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
@@ -41,8 +41,8 @@
#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <basegfx/tools/canvastools.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
+#include <drawinglayer/primitive2d/UnifiedTransparencePrimitive2D.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/source/primitive2d/alphaprimitive2d.cxx b/drawinglayer/source/primitive2d/transparenceprimitive2d.cxx
index a503c2979c41..cfe1e184e89e 100644
--- a/drawinglayer/source/primitive2d/alphaprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/transparenceprimitive2d.cxx
@@ -36,7 +36,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_drawinglayer.hxx"
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -49,28 +49,28 @@ namespace drawinglayer
{
namespace primitive2d
{
- AlphaPrimitive2D::AlphaPrimitive2D(
+ TransparencePrimitive2D::TransparencePrimitive2D(
const Primitive2DSequence& rChildren,
- const Primitive2DSequence& rAlpha)
+ const Primitive2DSequence& rTransparence)
: GroupPrimitive2D(rChildren),
- maAlpha(rAlpha)
+ maTransparence(rTransparence)
{
}
- bool AlphaPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ bool TransparencePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
if(GroupPrimitive2D::operator==(rPrimitive))
{
- const AlphaPrimitive2D& rCompare = (AlphaPrimitive2D&)rPrimitive;
+ const TransparencePrimitive2D& rCompare = (TransparencePrimitive2D&)rPrimitive;
- return (getAlpha() == rCompare.getAlpha());
+ return (getTransparence() == rCompare.getTransparence());
}
return false;
}
// provide unique ID
- ImplPrimitrive2DIDBlock(AlphaPrimitive2D, PRIMITIVE2D_ID_ALPHAPRIMITIVE2D)
+ ImplPrimitrive2DIDBlock(TransparencePrimitive2D, PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D)
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx
index a66ac0f3a539..b0905b2adf39 100644
--- a/drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx
@@ -2,7 +2,7 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: unifiedalphaprimitive2d.cxx,v $
+ * $RCSfile: UnifiedTransparencePrimitive2D.cxx,v $
*
* $Revision: 1.5 $
*
@@ -36,12 +36,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_drawinglayer.hxx"
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/UnifiedTransparencePrimitive2D.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/color/bcolor.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
@@ -55,39 +55,46 @@ namespace drawinglayer
{
namespace primitive2d
{
- UnifiedAlphaPrimitive2D::UnifiedAlphaPrimitive2D(
+ UnifiedTransparencePrimitive2D::UnifiedTransparencePrimitive2D(
const Primitive2DSequence& rChildren,
- double fAlpha)
+ double fTransparence)
: GroupPrimitive2D(rChildren),
- mfAlpha(fAlpha)
+ mfTransparence(fTransparence)
{
}
- bool UnifiedAlphaPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ bool UnifiedTransparencePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
if(GroupPrimitive2D::operator==(rPrimitive))
{
- const UnifiedAlphaPrimitive2D& rCompare = (UnifiedAlphaPrimitive2D&)rPrimitive;
+ const UnifiedTransparencePrimitive2D& rCompare = (UnifiedTransparencePrimitive2D&)rPrimitive;
- return (getAlpha() == rCompare.getAlpha());
+ return (getTransparence() == rCompare.getTransparence());
}
return false;
}
- Primitive2DSequence UnifiedAlphaPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ basegfx::B2DRange UnifiedTransparencePrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
- if(0.0 == getAlpha())
+ // do not use the fallback to decomposition here since for a correct BoundRect we also
+ // need invisible (1.0 == getTransparence()) geometry; these would be deleted in the decomposition
+ return getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation);
+ }
+
+ Primitive2DSequence UnifiedTransparencePrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ if(0.0 == getTransparence())
{
// no transparence used, so just use the content
return getChildren();
}
- else if(getAlpha() > 0.0 && getAlpha() < 1.0)
+ else if(getTransparence() > 0.0 && getTransparence() < 1.0)
{
- // The idea is to create a AlphaPrimitive2D with alpha content using a fill color
- // corresponding to the alpha value. Problem is that in most systems, the right
+ // The idea is to create a TransparencePrimitive2D with transparent content using a fill color
+ // corresponding to the transparence value. Problem is that in most systems, the right
// and bottom pixel array is not filled when filling polygons, thus this would not
- // always produce a complete alpha bitmap. There are some solutions:
+ // always produce a complete transparent bitmap. There are some solutions:
//
// - Grow the used polygon range by one discrete unit in X and Y. This
// will make the decomposition view-dependent.
@@ -99,17 +106,17 @@ namespace drawinglayer
// solution stays view-independent.
//
// I will take the last one here. The small overhead of two primitives will only be
- // used when UnifiedAlphaPrimitive2D is not handled directly.
+ // used when UnifiedTransparencePrimitive2D is not handled directly.
const basegfx::B2DRange aPolygonRange(getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation));
const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(aPolygonRange));
- const basegfx::BColor aGray(getAlpha(), getAlpha(), getAlpha());
- Primitive2DSequence aAlphaContent(2);
+ const basegfx::BColor aGray(getTransparence(), getTransparence(), getTransparence());
+ Primitive2DSequence aTransparenceContent(2);
- aAlphaContent[0] = Primitive2DReference(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPolygon), aGray));
- aAlphaContent[1] = Primitive2DReference(new PolygonHairlinePrimitive2D(aPolygon, aGray));
+ aTransparenceContent[0] = Primitive2DReference(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPolygon), aGray));
+ aTransparenceContent[1] = Primitive2DReference(new PolygonHairlinePrimitive2D(aPolygon, aGray));
// create sub-transparence group with a gray-colored rectangular fill polygon
- const Primitive2DReference xRefB(new AlphaPrimitive2D(getChildren(), aAlphaContent));
+ const Primitive2DReference xRefB(new TransparencePrimitive2D(getChildren(), aTransparenceContent));
return Primitive2DSequence(&xRefB, 1L);
}
else
@@ -120,7 +127,7 @@ namespace drawinglayer
}
// provide unique ID
- ImplPrimitrive2DIDBlock(UnifiedAlphaPrimitive2D, PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D)
+ ImplPrimitrive2DIDBlock(UnifiedTransparencePrimitive2D, PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D)
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
index 621b0b25ad98..dfa29c9260eb 100644
--- a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
@@ -223,7 +223,8 @@ namespace drawinglayer
if(bNeedsClipping)
{
// embed to clipping; this is necessary for tiled fills
- const basegfx::B2DPolyPolygon aPolyPolygon(basegfx::tools::createPolygonFromRect(getLocalObjectRange()));
+ const basegfx::B2DPolyPolygon aPolyPolygon(
+ basegfx::tools::createPolygonFromRect(getLocalObjectRange()));
const drawinglayer::primitive2d::Primitive2DReference xClippedFill(
new drawinglayer::primitive2d::MaskPrimitive2D(
aPolyPolygon,
diff --git a/drawinglayer/source/primitive3d/hittestprimitive3d.cxx b/drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx
index 65aede8142aa..e94eeb99f764 100644
--- a/drawinglayer/source/primitive3d/hittestprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx
@@ -36,7 +36,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_drawinglayer.hxx"
-#include <drawinglayer/primitive3d/hittestprimitive3d.hxx>
+#include <drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx>
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -49,25 +49,25 @@ namespace drawinglayer
{
namespace primitive3d
{
- HitTestPrimitive3D::HitTestPrimitive3D(
+ HiddenGeometryPrimitive3D::HiddenGeometryPrimitive3D(
const Primitive3DSequence& rChildren)
: GroupPrimitive3D(rChildren)
{
}
- basegfx::B3DRange HitTestPrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const
+ basegfx::B3DRange HiddenGeometryPrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const
{
return getB3DRangeFromPrimitive3DSequence(getChildren(), rViewInformation);
}
- Primitive3DSequence HitTestPrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
+ Primitive3DSequence HiddenGeometryPrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
// return empty sequence
return Primitive3DSequence();
}
// provide unique ID
- ImplPrimitrive3DIDBlock(HitTestPrimitive3D, PRIMITIVE3D_ID_HITTESTPRIMITIVE3D)
+ ImplPrimitrive3DIDBlock(HiddenGeometryPrimitive3D, PRIMITIVE3D_ID_HIDDENGEOMETRYPRIMITIVE3D)
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive3d/makefile.mk b/drawinglayer/source/primitive3d/makefile.mk
index fb160fb9bfa7..31c0c911bf0e 100644
--- a/drawinglayer/source/primitive3d/makefile.mk
+++ b/drawinglayer/source/primitive3d/makefile.mk
@@ -48,7 +48,7 @@ SLOFILES= \
$(SLO)$/baseprimitive3d.obj \
$(SLO)$/groupprimitive3d.obj \
$(SLO)$/hatchtextureprimitive3d.obj \
- $(SLO)$/hittestprimitive3d.obj \
+ $(SLO)$/hiddengeometryprimitive3d.obj \
$(SLO)$/modifiedcolorprimitive3d.obj \
$(SLO)$/polypolygonprimitive3d.obj \
$(SLO)$/polygonprimitive3d.obj \
diff --git a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
index de28e3ad74e5..23277a6eb91d 100644
--- a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
@@ -65,7 +65,7 @@ namespace drawinglayer
// may exclusively change static data, use mutex
::osl::Mutex m_mutex;
- if(nSegments != nLineTubeSegments || rMaterial != aLineMaterial)
+ if(nSegments != nLineTubeSegments || !(rMaterial == aLineMaterial))
{
nLineTubeSegments = nSegments;
aLineMaterial = rMaterial;
@@ -126,7 +126,7 @@ namespace drawinglayer
// may exclusively change static data, use mutex
::osl::Mutex m_mutex;
- if(nSegments != nLineCapSegments || rMaterial != aLineMaterial)
+ if(nSegments != nLineCapSegments || !(rMaterial == aLineMaterial))
{
nLineCapSegments = nSegments;
aLineMaterial = rMaterial;
diff --git a/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx
index 739914562071..307ee3a0db82 100644
--- a/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx
@@ -43,8 +43,9 @@
#include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
#include <basegfx/tools/canvastools.hxx>
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
-#include <drawinglayer/primitive3d/hittestprimitive3d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -63,7 +64,7 @@ namespace drawinglayer
basegfx::B3DPolyPolygon aFill(basegfx::tools::createCubeFillPolyPolygonFromB3DRange(aUnitRange));
// normal creation
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
if(::com::sun::star::drawing::NormalsKind_SPECIFIC == getSdr3DObjectAttribute().getNormalsKind()
|| ::com::sun::star::drawing::NormalsKind_SPHERE == getSdr3DObjectAttribute().getNormalsKind())
@@ -81,7 +82,7 @@ namespace drawinglayer
}
// texture coordinates
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
// handle texture coordinates X
const bool bParallelX(::com::sun::star::drawing::TextureProjectionMode_PARALLEL == getSdr3DObjectAttribute().getTextureProjectionX());
@@ -153,7 +154,7 @@ namespace drawinglayer
a3DPolyPolygonVector.push_back(basegfx::B3DPolyPolygon(aFill.getB3DPolygon(a)));
}
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
// add fill
aRetval = create3DPolyPolygonFillPrimitives(
@@ -161,39 +162,33 @@ namespace drawinglayer
getTransform(),
getTextureSize(),
getSdr3DObjectAttribute(),
- *getSdrLFSAttribute().getFill(),
+ getSdrLFSAttribute().getFill(),
getSdrLFSAttribute().getFillFloatTransGradient());
}
else
{
// create simplified 3d hit test geometry
- const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0);
-
- aRetval = create3DPolyPolygonFillPrimitives(
+ aRetval = createHiddenGeometryPrimitives3D(
a3DPolyPolygonVector,
getTransform(),
getTextureSize(),
- getSdr3DObjectAttribute(),
- aSimplifiedFillAttribute,
- 0);
-
- // encapsulate in HitTestPrimitive3D and add
- const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval));
- aRetval = Primitive3DSequence(&xRef, 1L);
+ getSdr3DObjectAttribute());
}
// add line
- if(getSdrLFSAttribute().getLine())
+ if(!getSdrLFSAttribute().getLine().isDefault())
{
basegfx::B3DPolyPolygon aLine(basegfx::tools::createCubePolyPolygonFromB3DRange(aUnitRange));
- const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aLine, getTransform(), *getSdrLFSAttribute().getLine()));
+ const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(
+ aLine, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
}
// add shadow
- if(getSdrLFSAttribute().getShadow() && aRetval.hasElements())
+ if(!getSdrLFSAttribute().getShadow().isDefault() && aRetval.hasElements())
{
- const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
+ const Primitive3DSequence aShadow(createShadowPrimitive3D(
+ aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
}
@@ -203,7 +198,7 @@ namespace drawinglayer
SdrCubePrimitive3D::SdrCubePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute)
: SdrPrimitive3D(rTransform, rTextureSize, rSdrLFSAttribute, rSdr3DObjectAttribute)
{
diff --git a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
index df682ab04e6f..210fed49065d 100644
--- a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
@@ -39,14 +39,11 @@
#include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
#include <basegfx/polygon/b3dpolygon.hxx>
#include <drawinglayer/attribute/strokeattribute.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
#include <drawinglayer/primitive3d/polygonprimitive3d.hxx>
#include <basegfx/polygon/b3dpolypolygon.hxx>
#include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <vcl/vclenum.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/attribute/fillbitmapattribute.hxx>
#include <drawinglayer/attribute/sdrfillbitmapattribute.hxx>
#include <vcl/bmpacc.hxx>
@@ -55,8 +52,12 @@
#include <drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx>
#include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx>
#include <drawinglayer/primitive3d/shadowprimitive3d.hxx>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <basegfx/range/b2drange.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrobjectattribute3d.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
+#include <drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -175,8 +176,8 @@ namespace drawinglayer
if(0.0 != rLine.getTransparence())
{
- // create UnifiedAlphaTexturePrimitive3D, add created primitives and exchange
- const Primitive3DReference xRef(new UnifiedAlphaTexturePrimitive3D(rLine.getTransparence(), aRetval));
+ // create UnifiedTransparenceTexturePrimitive3D, add created primitives and exchange
+ const Primitive3DReference xRef(new UnifiedTransparenceTexturePrimitive3D(rLine.getTransparence(), aRetval));
aRetval = Primitive3DSequence(&xRef, 1L);
}
@@ -189,7 +190,7 @@ namespace drawinglayer
const basegfx::B2DVector& rTextureSize,
const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute,
const attribute::SdrFillAttribute& rFill,
- const attribute::FillGradientAttribute* pFillGradient)
+ const attribute::FillGradientAttribute& rFillGradient)
{
Primitive3DSequence aRetval;
@@ -217,27 +218,45 @@ namespace drawinglayer
}
// look for and evtl. build texture sub-group primitive
- if(rFill.isGradient() || rFill.isHatch() || rFill.isBitmap())
+ if(!rFill.getGradient().isDefault()
+ || !rFill.getHatch().isDefault()
+ || !rFill.getBitmap().isDefault())
{
bool bModulate(::com::sun::star::drawing::TextureMode_MODULATE == aSdr3DObjectAttribute.getTextureMode());
bool bFilter(aSdr3DObjectAttribute.getTextureFilter());
- BasePrimitive3D* pNewTexturePrimitive3D = 0L;
+ BasePrimitive3D* pNewTexturePrimitive3D = 0;
- if(rFill.isGradient())
+ if(!rFill.getGradient().isDefault())
{
// create gradientTexture3D with sublist, add to local aRetval
- pNewTexturePrimitive3D = new GradientTexturePrimitive3D(*rFill.getGradient(), aRetval, rTextureSize, bModulate, bFilter);
+ pNewTexturePrimitive3D = new GradientTexturePrimitive3D(
+ rFill.getGradient(),
+ aRetval,
+ rTextureSize,
+ bModulate,
+ bFilter);
}
- else if(rFill.isHatch())
+ else if(!rFill.getHatch().isDefault())
{
// create hatchTexture3D with sublist, add to local aRetval
- pNewTexturePrimitive3D = new HatchTexturePrimitive3D(*rFill.getHatch(), aRetval, rTextureSize, bModulate, bFilter);
+ pNewTexturePrimitive3D = new HatchTexturePrimitive3D(
+ rFill.getHatch(),
+ aRetval,
+ rTextureSize,
+ bModulate,
+ bFilter);
}
- else // if(rFill.isBitmap())
+ else // if(!rFill.getBitmap().isDefault())
{
// 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), aRetval, rTextureSize, bModulate, bFilter);
+
+ pNewTexturePrimitive3D = new BitmapTexturePrimitive3D(
+ rFill.getBitmap().getFillBitmapAttribute(aTexRange),
+ aRetval,
+ rTextureSize,
+ bModulate,
+ bFilter);
}
// exchange aRetval content with texture group
@@ -255,14 +274,14 @@ namespace drawinglayer
if(0.0 != rFill.getTransparence())
{
- // create UnifiedAlphaTexturePrimitive3D with sublist and exchange
- const Primitive3DReference xRef(new UnifiedAlphaTexturePrimitive3D(rFill.getTransparence(), aRetval));
+ // create UnifiedTransparenceTexturePrimitive3D with sublist and exchange
+ const Primitive3DReference xRef(new UnifiedTransparenceTexturePrimitive3D(rFill.getTransparence(), aRetval));
aRetval = Primitive3DSequence(&xRef, 1L);
}
- else if(pFillGradient)
+ else if(!rFillGradient.isDefault())
{
- // create AlphaTexturePrimitive3D with sublist and exchange
- const Primitive3DReference xRef(new AlphaTexturePrimitive3D(*pFillGradient, aRetval, rTextureSize));
+ // create TransparenceTexturePrimitive3D with sublist and exchange
+ const Primitive3DReference xRef(new TransparenceTexturePrimitive3D(rFillGradient, aRetval, rTextureSize));
aRetval = Primitive3DSequence(&xRef, 1L);
}
}
@@ -292,6 +311,35 @@ namespace drawinglayer
return Primitive3DSequence();
}
}
+
+ Primitive3DSequence createHiddenGeometryPrimitives3D(
+ const ::std::vector< basegfx::B3DPolyPolygon >& r3DPolyPolygonVector,
+ const basegfx::B3DHomMatrix& rObjectTransform,
+ const basegfx::B2DVector& rTextureSize,
+ const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute)
+ {
+ // create hidden sub-geometry which can be used for HitTest
+ // and BoundRect calculations, but will not be visualized
+ const attribute::SdrFillAttribute aSimplifiedFillAttribute(
+ 0.0,
+ basegfx::BColor(),
+ attribute::FillGradientAttribute(),
+ attribute::FillHatchAttribute(),
+ attribute::SdrFillBitmapAttribute());
+
+ const Primitive3DReference aHidden(
+ new HiddenGeometryPrimitive3D(
+ create3DPolyPolygonFillPrimitives(
+ r3DPolyPolygonVector,
+ rObjectTransform,
+ rTextureSize,
+ aSdr3DObjectAttribute,
+ aSimplifiedFillAttribute,
+ attribute::FillGradientAttribute())));
+
+ return Primitive3DSequence(&aHidden, 1);
+ }
+
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
index 3554e9266ec1..87d5d3a50283 100644
--- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
@@ -44,8 +44,9 @@
#include <basegfx/tools/canvastools.hxx>
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
#include <drawinglayer/geometry/viewinformation3d.hxx>
-#include <drawinglayer/primitive3d/hittestprimitive3d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -76,7 +77,7 @@ namespace drawinglayer
double fRelativeTextureWidth(1.0);
basegfx::B2DHomMatrix aTexTransform;
- if(getSdrLFSAttribute().getFill() && (bCreateTextureCoordiantesX || bCreateTextureCoordiantesY))
+ if(!getSdrLFSAttribute().getFill().isDefault() && (bCreateTextureCoordiantesX || bCreateTextureCoordiantesY))
{
const basegfx::B2DPolygon aFirstPolygon(maCorrectedPolyPolygon.getB2DPolygon(0L));
const double fFrontLength(basegfx::tools::getLength(aFirstPolygon));
@@ -106,7 +107,7 @@ namespace drawinglayer
const basegfx::B3DRange aRange(getRangeFrom3DGeometry(aFill));
// normal creation
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
if(::com::sun::star::drawing::NormalsKind_SPHERE == eNormalsKind)
{
@@ -124,7 +125,7 @@ namespace drawinglayer
}
// texture coordinates
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
applyTextureTo3DGeometry(
getSdr3DObjectAttribute().getTextureProjectionX(),
@@ -134,7 +135,7 @@ namespace drawinglayer
getTextureSize());
}
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
// add fill
aRetval = create3DPolyPolygonFillPrimitives(
@@ -142,29 +143,21 @@ namespace drawinglayer
getTransform(),
getTextureSize(),
getSdr3DObjectAttribute(),
- *getSdrLFSAttribute().getFill(),
+ getSdrLFSAttribute().getFill(),
getSdrLFSAttribute().getFillFloatTransGradient());
}
else
{
// create simplified 3d hit test geometry
- const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0);
-
- aRetval = create3DPolyPolygonFillPrimitives(
+ aRetval = createHiddenGeometryPrimitives3D(
aFill,
getTransform(),
getTextureSize(),
- getSdr3DObjectAttribute(),
- aSimplifiedFillAttribute,
- 0);
-
- // encapsulate in HitTestPrimitive3D and add
- const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval));
- aRetval = Primitive3DSequence(&xRef, 1L);
+ getSdr3DObjectAttribute());
}
// add line
- if(getSdrLFSAttribute().getLine())
+ if(!getSdrLFSAttribute().getLine().isDefault())
{
if(getSdr3DObjectAttribute().getReducedLineGeometry())
{
@@ -349,7 +342,8 @@ namespace drawinglayer
if(aNewLineGeometry.count())
{
- const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aNewLineGeometry, getTransform(), *getSdrLFSAttribute().getLine()));
+ const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(
+ aNewLineGeometry, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
}
}
@@ -360,19 +354,22 @@ namespace drawinglayer
const basegfx::B3DPolyPolygon aVerLine(extractVerticalLinesFromSlice(rSliceVector));
// add horizontal lines
- const Primitive3DSequence aHorLines(create3DPolyPolygonLinePrimitives(aHorLine, getTransform(), *getSdrLFSAttribute().getLine()));
+ const Primitive3DSequence aHorLines(create3DPolyPolygonLinePrimitives(
+ aHorLine, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aHorLines);
// add vertical lines
- const Primitive3DSequence aVerLines(create3DPolyPolygonLinePrimitives(aVerLine, getTransform(), *getSdrLFSAttribute().getLine()));
+ const Primitive3DSequence aVerLines(create3DPolyPolygonLinePrimitives(
+ aVerLine, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aVerLines);
}
}
// add shadow
- if(getSdrLFSAttribute().getShadow() && aRetval.hasElements())
+ if(!getSdrLFSAttribute().getShadow().isDefault() && aRetval.hasElements())
{
- const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
+ const Primitive3DSequence aShadow(createShadowPrimitive3D(
+ aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
}
}
@@ -409,7 +406,7 @@ namespace drawinglayer
SdrExtrudePrimitive3D::SdrExtrudePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute,
const basegfx::B2DPolyPolygon& rPolyPolygon,
double fDepth,
diff --git a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
index 5e6c34e644de..0ee8fb1593e5 100644
--- a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
@@ -44,8 +44,9 @@
#include <basegfx/tools/canvastools.hxx>
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
#include <drawinglayer/geometry/viewinformation3d.hxx>
-#include <drawinglayer/primitive3d/hittestprimitive3d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -77,7 +78,8 @@ namespace drawinglayer
const bool bCreateTextureCoordiantesY(::com::sun::star::drawing::TextureProjectionMode_OBJECTSPECIFIC == getSdr3DObjectAttribute().getTextureProjectionY());
basegfx::B2DHomMatrix aTexTransform;
- if(getSdrLFSAttribute().getFill() && (bCreateTextureCoordiantesX || bCreateTextureCoordiantesY))
+ if(!getSdrLFSAttribute().getFill().isDefault()
+ && (bCreateTextureCoordiantesX || bCreateTextureCoordiantesY))
{
aTexTransform.set(0, 0, 0.0);
aTexTransform.set(0, 1, 1.0);
@@ -99,7 +101,7 @@ namespace drawinglayer
const basegfx::B3DRange aRange(getRangeFrom3DGeometry(aFill));
// normal creation
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
if(::com::sun::star::drawing::NormalsKind_SPHERE == eNormalsKind)
{
@@ -117,7 +119,7 @@ namespace drawinglayer
}
// texture coordinates
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
applyTextureTo3DGeometry(
getSdr3DObjectAttribute().getTextureProjectionX(),
@@ -127,7 +129,7 @@ namespace drawinglayer
getTextureSize());
}
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
// add fill
aRetval = create3DPolyPolygonFillPrimitives(
@@ -135,29 +137,21 @@ namespace drawinglayer
getTransform(),
getTextureSize(),
getSdr3DObjectAttribute(),
- *getSdrLFSAttribute().getFill(),
+ getSdrLFSAttribute().getFill(),
getSdrLFSAttribute().getFillFloatTransGradient());
}
else
{
// create simplified 3d hit test geometry
- const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0);
-
- aRetval = create3DPolyPolygonFillPrimitives(
+ aRetval = createHiddenGeometryPrimitives3D(
aFill,
getTransform(),
getTextureSize(),
- getSdr3DObjectAttribute(),
- aSimplifiedFillAttribute,
- 0);
-
- // encapsulate in HitTestPrimitive3D and add
- const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval));
- aRetval = Primitive3DSequence(&xRef, 1L);
+ getSdr3DObjectAttribute());
}
// add line
- if(getSdrLFSAttribute().getLine())
+ if(!getSdrLFSAttribute().getLine().isDefault())
{
if(getSdr3DObjectAttribute().getReducedLineGeometry())
{
@@ -191,7 +185,8 @@ namespace drawinglayer
if(aNewLineGeometry.count())
{
- const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aNewLineGeometry, getTransform(), *getSdrLFSAttribute().getLine()));
+ const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(
+ aNewLineGeometry, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
}
}
@@ -202,19 +197,23 @@ namespace drawinglayer
const basegfx::B3DPolyPolygon aVerLine(extractVerticalLinesFromSlice(rSliceVector));
// add horizontal lines
- const Primitive3DSequence aHorLines(create3DPolyPolygonLinePrimitives(aHorLine, getTransform(), *getSdrLFSAttribute().getLine()));
+ const Primitive3DSequence aHorLines(create3DPolyPolygonLinePrimitives(
+ aHorLine, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aHorLines);
// add vertical lines
- const Primitive3DSequence aVerLines(create3DPolyPolygonLinePrimitives(aVerLine, getTransform(), *getSdrLFSAttribute().getLine()));
+ const Primitive3DSequence aVerLines(create3DPolyPolygonLinePrimitives(
+ aVerLine, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aVerLines);
}
}
// add shadow
- if(getSdrLFSAttribute().getShadow() && aRetval.hasElements())
+ if(!getSdrLFSAttribute().getShadow().isDefault()
+ && aRetval.hasElements())
{
- const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
+ const Primitive3DSequence aShadow(createShadowPrimitive3D(
+ aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
}
}
@@ -262,7 +261,7 @@ namespace drawinglayer
SdrLathePrimitive3D::SdrLathePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute,
const basegfx::B2DPolyPolygon& rPolyPolygon,
sal_uInt32 nHorizontalSegments,
diff --git a/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx
index 69049fb7b24d..51f37be5b35b 100644
--- a/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx
@@ -40,8 +40,9 @@
#include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
#include <basegfx/polygon/b3dpolypolygontools.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <drawinglayer/primitive3d/hittestprimitive3d.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -66,7 +67,7 @@ namespace drawinglayer
const basegfx::B3DRange aRange(getRangeFrom3DGeometry(aFill));
// #i98295# normal creation
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
if(::com::sun::star::drawing::NormalsKind_SPHERE == getSdr3DObjectAttribute().getNormalsKind())
{
@@ -84,7 +85,7 @@ namespace drawinglayer
}
// #i98314# texture coordinates
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
applyTextureTo3DGeometry(
getSdr3DObjectAttribute().getTextureProjectionX(),
@@ -94,7 +95,7 @@ namespace drawinglayer
getTextureSize());
}
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
// add fill
aRetval = create3DPolyPolygonFillPrimitives(
@@ -102,41 +103,36 @@ namespace drawinglayer
getTransform(),
getTextureSize(),
getSdr3DObjectAttribute(),
- *getSdrLFSAttribute().getFill(),
+ getSdrLFSAttribute().getFill(),
getSdrLFSAttribute().getFillFloatTransGradient());
}
else
{
// create simplified 3d hit test geometry
- const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0);
-
- aRetval = create3DPolyPolygonFillPrimitives(
+ aRetval = createHiddenGeometryPrimitives3D(
aFill,
getTransform(),
getTextureSize(),
- getSdr3DObjectAttribute(),
- aSimplifiedFillAttribute,
- 0);
-
- // encapsulate in HitTestPrimitive3D and add
- const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval));
- aRetval = Primitive3DSequence(&xRef, 1L);
+ getSdr3DObjectAttribute());
}
// add line
- if(getSdrLFSAttribute().getLine())
+ if(!getSdrLFSAttribute().getLine().isDefault())
{
basegfx::B3DPolyPolygon aLine(getPolyPolygon3D());
aLine.clearNormals();
aLine.clearTextureCoordinates();
- const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aLine, getTransform(), *getSdrLFSAttribute().getLine()));
+ const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(
+ aLine, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
}
// add shadow
- if(getSdrLFSAttribute().getShadow() && aRetval.hasElements())
+ if(!getSdrLFSAttribute().getShadow().isDefault()
+ && aRetval.hasElements())
{
- const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
+ const Primitive3DSequence aShadow(createShadowPrimitive3D(
+ aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
}
}
@@ -148,7 +144,7 @@ namespace drawinglayer
const basegfx::B3DPolyPolygon& rPolyPolygon3D,
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute)
: SdrPrimitive3D(rTransform, rTextureSize, rSdrLFSAttribute, rSdr3DObjectAttribute),
maPolyPolygon3D(rPolyPolygon3D)
@@ -181,11 +177,11 @@ namespace drawinglayer
aRetval = basegfx::tools::getRange(getPolyPolygon3D());
aRetval.transform(getTransform());
- if(getSdrLFSAttribute().getLine())
+ if(!getSdrLFSAttribute().getLine().isDefault())
{
- const attribute::SdrLineAttribute& rLine = *getSdrLFSAttribute().getLine();
+ const attribute::SdrLineAttribute& rLine = getSdrLFSAttribute().getLine();
- if(rLine.isVisible() && !basegfx::fTools::equalZero(rLine.getWidth()))
+ if(!rLine.isDefault() && !basegfx::fTools::equalZero(rLine.getWidth()))
{
// expand by half LineWidth as tube radius
aRetval.grow(rLine.getWidth() / 2.0);
diff --git a/drawinglayer/source/primitive3d/sdrprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrprimitive3d.cxx
index f8489b6418ff..53d7f7c9e96a 100644
--- a/drawinglayer/source/primitive3d/sdrprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrprimitive3d.cxx
@@ -37,9 +37,9 @@
#include "precompiled_drawinglayer.hxx"
#include <drawinglayer/primitive3d/sdrprimitive3d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <basegfx/polygon/b3dpolypolygontools.hxx>
#include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -56,11 +56,11 @@ namespace drawinglayer
basegfx::B3DRange aUnitRange(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
aUnitRange.transform(getTransform());
- if(getSdrLFSAttribute().getLine())
+ if(!getSdrLFSAttribute().getLine().isDefault())
{
- const attribute::SdrLineAttribute& rLine = *getSdrLFSAttribute().getLine();
+ const attribute::SdrLineAttribute& rLine = getSdrLFSAttribute().getLine();
- if(rLine.isVisible() && !basegfx::fTools::equalZero(rLine.getWidth()))
+ if(!rLine.isDefault() && !basegfx::fTools::equalZero(rLine.getWidth()))
{
// expand by hald LineWidth as tube radius
aUnitRange.grow(rLine.getWidth() / 2.0);
@@ -83,11 +83,11 @@ namespace drawinglayer
aRetval.transform(getTransform());
- if(getSdrLFSAttribute().getLine())
+ if(!getSdrLFSAttribute().getLine().isDefault())
{
- const attribute::SdrLineAttribute& rLine = *getSdrLFSAttribute().getLine();
+ const attribute::SdrLineAttribute& rLine = getSdrLFSAttribute().getLine();
- if(rLine.isVisible() && !basegfx::fTools::equalZero(rLine.getWidth()))
+ if(!rLine.isDefault() && !basegfx::fTools::equalZero(rLine.getWidth()))
{
// expand by half LineWidth as tube radius
aRetval.grow(rLine.getWidth() / 2.0);
@@ -101,7 +101,7 @@ namespace drawinglayer
SdrPrimitive3D::SdrPrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute)
: BufferedDecompositionPrimitive3D(),
maTransform(rTransform),
diff --git a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx
index 663ae6ad0d37..d993f5117d3a 100644
--- a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx
@@ -43,8 +43,9 @@
#include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
#include <basegfx/tools/canvastools.hxx>
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
-#include <drawinglayer/primitive3d/hittestprimitive3d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -68,7 +69,7 @@ namespace drawinglayer
getHorizontalSegments(), getVerticalSegments(), bCreateNormals));
// normal inversion
- if(getSdrLFSAttribute().getFill()
+ if(!getSdrLFSAttribute().getFill().isDefault()
&& bCreateNormals
&& getSdr3DObjectAttribute().getNormalsInvert()
&& aFill.areNormalsUsed())
@@ -78,7 +79,7 @@ namespace drawinglayer
}
// texture coordinates
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
// handle texture coordinates X
const bool bParallelX(::com::sun::star::drawing::TextureProjectionMode_PARALLEL == getSdr3DObjectAttribute().getTextureProjectionX());
@@ -142,7 +143,7 @@ namespace drawinglayer
a3DPolyPolygonVector.push_back(basegfx::B3DPolyPolygon(aFill.getB3DPolygon(a)));
}
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
// add fill
aRetval = create3DPolyPolygonFillPrimitives(
@@ -150,39 +151,34 @@ namespace drawinglayer
getTransform(),
getTextureSize(),
getSdr3DObjectAttribute(),
- *getSdrLFSAttribute().getFill(),
+ getSdrLFSAttribute().getFill(),
getSdrLFSAttribute().getFillFloatTransGradient());
}
else
{
// create simplified 3d hit test geometry
- const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0);
-
- aRetval = create3DPolyPolygonFillPrimitives(
+ aRetval = createHiddenGeometryPrimitives3D(
a3DPolyPolygonVector,
getTransform(),
getTextureSize(),
- getSdr3DObjectAttribute(),
- aSimplifiedFillAttribute,
- 0);
-
- // encapsulate in HitTestPrimitive3D and add
- const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval));
- aRetval = Primitive3DSequence(&xRef, 1L);
+ getSdr3DObjectAttribute());
}
// add line
- if(getSdrLFSAttribute().getLine())
+ if(!getSdrLFSAttribute().getLine().isDefault())
{
basegfx::B3DPolyPolygon aSphere(basegfx::tools::createSpherePolyPolygonFromB3DRange(aUnitRange, getHorizontalSegments(), getVerticalSegments()));
- const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aSphere, getTransform(), *getSdrLFSAttribute().getLine()));
+ const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(
+ aSphere, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
}
// add shadow
- if(getSdrLFSAttribute().getShadow() && aRetval.hasElements())
+ if(!getSdrLFSAttribute().getShadow().isDefault()
+ && aRetval.hasElements())
{
- const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
+ const Primitive3DSequence aShadow(createShadowPrimitive3D(
+ aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
}
@@ -192,7 +188,7 @@ namespace drawinglayer
SdrSpherePrimitive3D::SdrSpherePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute,
sal_uInt32 nHorizontalSegments,
sal_uInt32 nVerticalSegments)
diff --git a/drawinglayer/source/primitive3d/textureprimitive3d.cxx b/drawinglayer/source/primitive3d/textureprimitive3d.cxx
index deeed95a71fd..9ba2c70ae074 100644
--- a/drawinglayer/source/primitive3d/textureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/textureprimitive3d.cxx
@@ -38,6 +38,7 @@
#include <drawinglayer/primitive3d/textureprimitive3d.hxx>
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
+#include <basegfx/color/bcolor.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -81,7 +82,7 @@ namespace drawinglayer
{
namespace primitive3d
{
- UnifiedAlphaTexturePrimitive3D::UnifiedAlphaTexturePrimitive3D(
+ UnifiedTransparenceTexturePrimitive3D::UnifiedTransparenceTexturePrimitive3D(
double fTransparence,
const Primitive3DSequence& rChildren)
: TexturePrimitive3D(rChildren, basegfx::B2DVector(), false, false),
@@ -89,11 +90,11 @@ namespace drawinglayer
{
}
- bool UnifiedAlphaTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
+ bool UnifiedTransparenceTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
if(TexturePrimitive3D::operator==(rPrimitive))
{
- const UnifiedAlphaTexturePrimitive3D& rCompare = (UnifiedAlphaTexturePrimitive3D&)rPrimitive;
+ const UnifiedTransparenceTexturePrimitive3D& rCompare = (UnifiedTransparenceTexturePrimitive3D&)rPrimitive;
return (getTransparence() == rCompare.getTransparence());
}
@@ -101,7 +102,14 @@ namespace drawinglayer
return false;
}
- Primitive3DSequence UnifiedAlphaTexturePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
+ basegfx::B3DRange UnifiedTransparenceTexturePrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const
+ {
+ // do not use the fallback to decomposition here since for a correct BoundRect we also
+ // need invisible (1.0 == getTransparence()) geometry; these would be deleted in the decomposition
+ return getB3DRangeFromPrimitive3DSequence(getChildren(), rViewInformation);
+ }
+
+ Primitive3DSequence UnifiedTransparenceTexturePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
if(0.0 == getTransparence())
{
@@ -110,10 +118,10 @@ namespace drawinglayer
}
else if(getTransparence() > 0.0 && getTransparence() < 1.0)
{
- // create AlphaTexturePrimitive3D with fixed transparence as replacement
+ // create TransparenceTexturePrimitive3D 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()));
+ const Primitive3DReference xRef(new TransparenceTexturePrimitive3D(aFillGradient, getChildren(), getTextureSize()));
return Primitive3DSequence(&xRef, 1L);
}
else
@@ -124,7 +132,7 @@ namespace drawinglayer
}
// provide unique ID
- ImplPrimitrive3DIDBlock(UnifiedAlphaTexturePrimitive3D, PRIMITIVE3D_ID_UNIFIEDALPHATEXTUREPRIMITIVE3D)
+ ImplPrimitrive3DIDBlock(UnifiedTransparenceTexturePrimitive3D, PRIMITIVE3D_ID_UNIFIEDTRANSPARENCETEXTUREPRIMITIVE3D)
} // end of namespace primitive3d
} // end of namespace drawinglayer
@@ -204,7 +212,7 @@ namespace drawinglayer
{
namespace primitive3d
{
- AlphaTexturePrimitive3D::AlphaTexturePrimitive3D(
+ TransparenceTexturePrimitive3D::TransparenceTexturePrimitive3D(
const attribute::FillGradientAttribute& rGradient,
const Primitive3DSequence& rChildren,
const basegfx::B2DVector& rTextureSize)
@@ -212,13 +220,13 @@ namespace drawinglayer
{
}
- bool AlphaTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
+ bool TransparenceTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
return (GradientTexturePrimitive3D::operator==(rPrimitive));
}
// provide unique ID
- ImplPrimitrive3DIDBlock(AlphaTexturePrimitive3D, PRIMITIVE3D_ID_ALPHATEXTUREPRIMITIVE3D)
+ ImplPrimitrive3DIDBlock(TransparenceTexturePrimitive3D, PRIMITIVE3D_ID_TRANSPARENCETEXTUREPRIMITIVE3D)
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/processor2d/canvasprocessor.cxx b/drawinglayer/source/processor2d/canvasprocessor.cxx
index 8eb713258b25..d089e6a440de 100644
--- a/drawinglayer/source/processor2d/canvasprocessor.cxx
+++ b/drawinglayer/source/processor2d/canvasprocessor.cxx
@@ -61,7 +61,7 @@
#include <vclhelperbitmaptransform.hxx>
#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <basegfx/tuple/b2i64tuple.hxx>
#include <basegfx/range/b2irange.hxx>
#include <com/sun/star/rendering/XIntegerReadOnlyBitmap.hpp>
@@ -70,7 +70,7 @@
#include <com/sun/star/rendering/PathJoinType.hpp>
#include <drawinglayer/primitive2d/fillbitmapprimitive2d.hxx>
#include <com/sun/star/rendering/TexturingMode.hpp>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/UnifiedTransparencePrimitive2D.hxx>
#include <vclhelperbufferdevice.hxx>
#include <drawinglayer/primitive2d/chartprimitive2d.hxx>
#include <helperchartrenderer.hxx>
@@ -388,7 +388,7 @@ using namespace com::sun::star;
// slightly inside), slightly enlarge the
// gradient:
//
- // y/2 sin(alpha) + x/2 cos(alpha)
+ // y/2 sin(transparence) + x/2 cos(transparence)
//
// (values to change are not actual
// gradient scales, but original bound
@@ -603,8 +603,7 @@ using namespace com::sun::star;
}
else
{
- aUnitPolygon = basegfx::tools::createPolygonFromRect(
- basegfx::B2DRange(0.0, 0.0, 1.0, 1.0));
+ aUnitPolygon = basegfx::tools::createUnitPolygon();
}
// create geometries
@@ -977,10 +976,10 @@ using namespace com::sun::star;
// paint content to it
process(rSubList);
- // TODO(F3): render transparent list to alpha
+ // TODO(F3): render transparent list to transparence
// channel. Note that the OutDev implementation has a
// shortcoming, in that nested transparency groups
- // don't work - alpha is not combined properly.
+ // don't work - transparence is not combined properly.
// process(rTransCandidate.getTransparenceList());
@@ -988,7 +987,7 @@ using namespace com::sun::star;
mxCanvas = xLastCanvas;
setWorldToView(aLastWorldToView);
- // DUMMY: add alpha modulation value to DeviceColor
+ // DUMMY: add transparence modulation value to DeviceColor
// TODO(F3): color management
canvas::tools::setDeviceColor( maRenderState,
1.0, 1.0, 1.0, 0.5 );
@@ -1307,7 +1306,7 @@ namespace drawinglayer
{
// there are principally two methods for implementing the mask primitive. One
// is to set a clip polygon at the canvas, the other is to create and use a
- // alpha-using XBitmap for content and draw the mask as alpha. Both have their
+ // transparence-using XBitmap for content and draw the mask as transparence. Both have their
// advantages and disadvantages, so here are both with a bool allowing simple
// change
if(bUseMaskBitmapMethod)
@@ -1380,8 +1379,8 @@ namespace drawinglayer
if(getOptionsDrawinglayer().IsAntiAliasing())
{
// with AA, use 8bit AlphaMask to get nice borders
- VirtualDevice& rAlpha = aBufferDevice.getAlpha();
- rAlpha.GetCanvas()->fillPolyPolygon(
+ VirtualDevice& rTransparence = aBufferDevice.getTransparence();
+ rTransparence.GetCanvas()->fillPolyPolygon(
basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(mxCanvas->getDevice(), aMask),
maViewState, maRenderState);
}
@@ -1586,7 +1585,7 @@ namespace drawinglayer
{
// replace with color filled polygon
const basegfx::BColor aModifiedColor(maBColorModifierStack.getModifiedColor(basegfx::BColor()));
- const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ const basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon());
maRenderState.DeviceColor = aModifiedColor.colorToDoubleSequence(mxCanvas->getDevice());
canvas::tools::setRenderStateTransform(maRenderState,
@@ -1619,12 +1618,12 @@ namespace drawinglayer
}
}
- void canvasProcessor2D::impRenderAlphaPrimitive2D(const primitive2d::AlphaPrimitive2D& rAlphaCandidate)
+ void canvasProcessor2D::impRenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D& rTransparenceCandidate)
{
- const primitive2d::Primitive2DSequence& rChildren = rAlphaCandidate.getChildren();
- const primitive2d::Primitive2DSequence& rAlpha = rAlphaCandidate.getAlpha();
+ const primitive2d::Primitive2DSequence& rChildren = rTransparenceCandidate.getChildren();
+ const primitive2d::Primitive2DSequence& rTransparence = rTransparenceCandidate.getTransparence();
- if(rChildren.hasElements() && rAlpha.hasElements())
+ if(rChildren.hasElements() && rTransparence.hasElements())
{
// get logic range of transparent part and clip with ViewRange
basegfx::B2DRange aLogicRange(primitive2d::getB2DRangeFromPrimitive2DSequence(rChildren, getViewInformation2D()));
@@ -1688,16 +1687,16 @@ namespace drawinglayer
process(rChildren);
// set to mask
- mpOutputDevice = &aBufferDevice.getAlpha();
+ mpOutputDevice = &aBufferDevice.getTransparence();
mxCanvas = mpOutputDevice->GetCanvas();
canvas::tools::setViewStateTransform(maViewState, getViewInformation2D().getViewTransformation());
- // when painting alpha masks, reset the color stack
+ // when painting transparence masks, reset the color stack
basegfx::BColorModifierStack aLastBColorModifierStack(maBColorModifierStack);
maBColorModifierStack = basegfx::BColorModifierStack();
- // paint mask to it (always with alpha intensities, evtl. with AA)
- process(rAlpha);
+ // paint mask to it (always with transparence intensities, evtl. with AA)
+ process(rTransparence);
// back to old color stack, OutDev, Canvas and ViewTransform
maBColorModifierStack = aLastBColorModifierStack;
@@ -1801,7 +1800,7 @@ namespace drawinglayer
{
// replace with color filled polygon
const basegfx::BColor aModifiedColor(maBColorModifierStack.getModifiedColor(basegfx::BColor()));
- const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ const basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon());
maRenderState.DeviceColor = aModifiedColor.colorToDoubleSequence(mxCanvas->getDevice());
canvas::tools::setRenderStateTransform(maRenderState,
@@ -1832,7 +1831,7 @@ namespace drawinglayer
aTexture.RepeatModeY = rendering::TexturingMode::REPEAT;
// canvas needs a polygon to fill, create unit rectangle polygon
- const basegfx::B2DPolygon aOutlineRectangle(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ const basegfx::B2DPolygon aOutlineRectangle(basegfx::tools::createUnitPolygon());
// set primitive's transformation as render state transform
canvas::tools::setRenderStateTransform(maRenderState,
@@ -1860,52 +1859,60 @@ namespace drawinglayer
}
}
- void canvasProcessor2D::impRenderUnifiedAlphaPrimitive2D(const primitive2d::UnifiedAlphaPrimitive2D& rUniAlphaCandidate)
+ void canvasProcessor2D::impRenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate)
{
- const primitive2d::Primitive2DSequence rChildren = rUniAlphaCandidate.getChildren();
-
- if(rChildren.hasElements())
+ if(0.0 == rUniTransparenceCandidate.getTransparence())
+ {
+ // not transparent at all, directly use content
+ process(rUniTransparenceCandidate.getChildren());
+ }
+ else if(rUniTransparenceCandidate.getTransparence() > 0.0 && rUniTransparenceCandidate.getTransparence() < 1.0)
{
- bool bOutputDone(false);
+ const primitive2d::Primitive2DSequence rChildren = rUniTransparenceCandidate.getChildren();
- // Detect if a single PolyPolygonColorPrimitive2D is contained; in that case,
- // use the fillPolyPolygon method with correctly set alpha. This is a often used
- // case, so detectiong it is valuable
- if(1 == rChildren.getLength())
+ if(rChildren.hasElements())
{
- const primitive2d::Primitive2DReference xReference(rChildren[0]);
- const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get());
+ bool bOutputDone(false);
- if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID())
+ // Detect if a single PolyPolygonColorPrimitive2D is contained; in that case,
+ // use the fillPolyPolygon method with correctly set transparence. This is a often used
+ // case, so detectiong it is valuable
+ if(1 == rChildren.getLength())
{
- // direct draw of PolyPolygon with color and transparence
- const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor()));
-
- // add alpha modulation value to DeviceColor
- uno::Sequence< double > aColor(4);
-
- aColor[0] = aPolygonColor.getRed();
- aColor[1] = aPolygonColor.getGreen();
- aColor[2] = aPolygonColor.getBlue();
- aColor[3] = 1.0 - rUniAlphaCandidate.getAlpha();
- maRenderState.DeviceColor = aColor;
-
- canvas::tools::setRenderStateTransform(maRenderState, getViewInformation2D().getObjectTransformation());
- mxCanvas->fillPolyPolygon(
- basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(mxCanvas->getDevice(), pPoPoColor->getB2DPolyPolygon()),
- maViewState, maRenderState);
- bOutputDone = true;
+ const primitive2d::Primitive2DReference xReference(rChildren[0]);
+ const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get());
+
+ if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID())
+ {
+ // direct draw of PolyPolygon with color and transparence
+ const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor()));
+
+ // add transparence modulation value to DeviceColor
+ uno::Sequence< double > aColor(4);
+
+ aColor[0] = aPolygonColor.getRed();
+ aColor[1] = aPolygonColor.getGreen();
+ aColor[2] = aPolygonColor.getBlue();
+ aColor[3] = 1.0 - rUniTransparenceCandidate.getTransparence();
+ maRenderState.DeviceColor = aColor;
+
+ canvas::tools::setRenderStateTransform(maRenderState, getViewInformation2D().getObjectTransformation());
+ mxCanvas->fillPolyPolygon(
+ basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(mxCanvas->getDevice(), pPoPoColor->getB2DPolyPolygon()),
+ maViewState, maRenderState);
+ bOutputDone = true;
+ }
}
- }
- if(!bOutputDone)
- {
- // process decomposition. This will be decomposed to an AlphaPrimitive2D
- // with the same child context and a single polygon for alpha context. This could be
- // directly handled here with known VCL-buffer technology, but would only
- // make a small difference compared to directly rendering the AlphaPrimitive2D
- // using impRenderAlphaPrimitive2D above.
- process(rUniAlphaCandidate.get2DDecomposition(getViewInformation2D()));
+ if(!bOutputDone)
+ {
+ // process decomposition. This will be decomposed to an TransparencePrimitive2D
+ // with the same child context and a single polygon for transparent context. This could be
+ // directly handled here with known VCL-buffer technology, but would only
+ // make a small difference compared to directly rendering the TransparencePrimitive2D
+ // using impRenderTransparencePrimitive2D above.
+ process(rUniTransparenceCandidate.get2DDecomposition(getViewInformation2D()));
+ }
}
}
}
@@ -2063,10 +2070,10 @@ namespace drawinglayer
break;
}
- case PRIMITIVE2D_ID_ALPHAPRIMITIVE2D :
+ case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D :
{
- // Alpha primitive
- impRenderAlphaPrimitive2D(static_cast< const primitive2d::AlphaPrimitive2D& >(rCandidate));
+ // Transparence primitive
+ impRenderTransparencePrimitive2D(static_cast< const primitive2d::TransparencePrimitive2D& >(rCandidate));
break;
}
@@ -2084,10 +2091,10 @@ namespace drawinglayer
break;
}
- case PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D :
+ case PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D :
{
- // UnifiedAlphaPrimitive2D
- impRenderUnifiedAlphaPrimitive2D(static_cast< const primitive2d::UnifiedAlphaPrimitive2D& >(rCandidate));
+ // UnifiedTransparencePrimitive2D
+ impRenderUnifiedTransparencePrimitive2D(static_cast< const primitive2d::UnifiedTransparencePrimitive2D& >(rCandidate));
break;
}
diff --git a/drawinglayer/source/processor2d/contourextractor2d.cxx b/drawinglayer/source/processor2d/contourextractor2d.cxx
index 3225651a6754..6c80c0dc4efc 100644
--- a/drawinglayer/source/processor2d/contourextractor2d.cxx
+++ b/drawinglayer/source/processor2d/contourextractor2d.cxx
@@ -43,7 +43,7 @@
#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <drawinglayer/primitive2d/sceneprimitive2d.hxx>
@@ -103,7 +103,7 @@ namespace drawinglayer
// extract BoundRect from bitmaps in world coordinates
const primitive2d::BitmapPrimitive2D& rBitmapCandidate(static_cast< const primitive2d::BitmapPrimitive2D& >(rCandidate));
basegfx::B2DHomMatrix aLocalTransform(getViewInformation2D().getObjectTransformation() * rBitmapCandidate.getTransform());
- basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon());
aPolygon.transform(aLocalTransform);
maExtractedContour.push_back(basegfx::B2DPolyPolygon(aPolygon));
break;
@@ -113,15 +113,15 @@ namespace drawinglayer
// extract BoundRect from MetaFiles in world coordinates
const primitive2d::MetafilePrimitive2D& rMetaCandidate(static_cast< const primitive2d::MetafilePrimitive2D& >(rCandidate));
basegfx::B2DHomMatrix aLocalTransform(getViewInformation2D().getObjectTransformation() * rMetaCandidate.getTransform());
- basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon());
aPolygon.transform(aLocalTransform);
maExtractedContour.push_back(basegfx::B2DPolyPolygon(aPolygon));
break;
}
- case PRIMITIVE2D_ID_ALPHAPRIMITIVE2D :
+ case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D :
{
// sub-transparence group. Look at children
- const primitive2d::AlphaPrimitive2D& rTransCandidate(static_cast< const primitive2d::AlphaPrimitive2D& >(rCandidate));
+ const primitive2d::TransparencePrimitive2D& rTransCandidate(static_cast< const primitive2d::TransparencePrimitive2D& >(rCandidate));
process(rTransCandidate.getChildren());
break;
}
diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index b10e10706520..e699f1ae8ea4 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -43,13 +43,13 @@
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
#include <drawinglayer/primitive2d/sceneprimitive2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
#include <basegfx/matrix/b3dhommatrix.hxx>
#include <drawinglayer/processor3d/cutfindprocessor3d.hxx>
+#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -66,7 +66,7 @@ namespace drawinglayer
mfDiscreteHitTolerance(0.0),
mbHit(false),
mbHitToleranceUsed(false),
- mbUseHitTestPrimitiveContent(true),
+ mbUseInvisiblePrimitiveContent(true),
mbHitTextOnly(bHitTextOnly)
{
// init hit tolerance
@@ -247,7 +247,7 @@ namespace drawinglayer
if(!getHit())
{
// empty 3D scene; Check for border hit
- basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aOutline(basegfx::tools::createUnitPolygon());
aOutline.transform(rCandidate.getObjectTransformation());
mbHit = checkHairlineHitWithTolerance(aOutline, getDiscreteHitTolerance());
@@ -420,10 +420,10 @@ namespace drawinglayer
break;
}
- case PRIMITIVE2D_ID_ALPHAPRIMITIVE2D :
+ case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D :
{
// sub-transparence group
- const primitive2d::AlphaPrimitive2D& rTransCandidate(static_cast< const primitive2d::AlphaPrimitive2D& >(rCandidate));
+ const primitive2d::TransparencePrimitive2D& rTransCandidate(static_cast< const primitive2d::TransparencePrimitive2D& >(rCandidate));
// Currently the transparence content is not taken into account; only
// the children are recursively checked for hit. This may be refined for
@@ -499,7 +499,7 @@ namespace drawinglayer
// will be used for HitTest currently.
//
// This may be refined in the future, e.g:
- // - For Bitamps, the mask and/or alpha information may be used
+ // - For Bitamps, the mask and/or transparence information may be used
// - For MetaFiles, the MetaFile content may be used
const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
@@ -512,15 +512,20 @@ namespace drawinglayer
break;
}
- case PRIMITIVE2D_ID_HITTESTPRIMITIVE2D :
+ case PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D :
{
- // HitTest primitive; the default decomposition would return an empty seqence,
+ // HiddenGeometryPrimitive2D; the default decomposition would return an empty seqence,
// so force this primitive to process it's children directly if the switch is set
// (which is the default). Else, ignore invisible content
- if(getUseHitTestPrimitiveContent())
+ const primitive2d::HiddenGeometryPrimitive2D& rHiddenGeometry(static_cast< const primitive2d::HiddenGeometryPrimitive2D& >(rCandidate));
+ const primitive2d::Primitive2DSequence& rChildren = rHiddenGeometry.getChildren();
+
+ if(rChildren.hasElements())
{
- const primitive2d::HitTestPrimitive2D& rHitTestCandidate(static_cast< const primitive2d::HitTestPrimitive2D& >(rCandidate));
- process(rHitTestCandidate.getChildren());
+ if(getUseInvisiblePrimitiveContent())
+ {
+ process(rChildren);
+ }
}
break;
diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
index 9d63bd5c7df6..a1e6373f1557 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
@@ -123,7 +123,7 @@ namespace drawinglayer
if(bDoSaveForVisualControl)
{
- SvFileStream aNew((const String&)String(ByteString( "c:\\alpha.bmp" ), RTL_TEXTENCODING_UTF8), STREAM_WRITE|STREAM_TRUNC);
+ SvFileStream aNew((const String&)String(ByteString( "c:\\transparence.bmp" ), RTL_TEXTENCODING_UTF8), STREAM_WRITE|STREAM_TRUNC);
aNew << aAlphaMask.GetBitmap();
}
@@ -170,7 +170,7 @@ namespace drawinglayer
return *mpMask;
}
- VirtualDevice& impBufferDevice::getAlpha()
+ VirtualDevice& impBufferDevice::getTransparence()
{
if(!mpAlpha)
{
diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.hxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.hxx
index f987585249ad..02a0faffa06c 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.hxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.hxx
@@ -67,7 +67,7 @@ namespace drawinglayer
bool isVisible() const { return !maDestPixel.IsEmpty(); }
VirtualDevice& getContent() { return maContent; }
VirtualDevice& getMask();
- VirtualDevice& getAlpha();
+ VirtualDevice& getTransparence();
};
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/processor2d/vclhelpergradient.cxx b/drawinglayer/source/processor2d/vclhelpergradient.cxx
index 25d7513006fa..753ccfd7140d 100644
--- a/drawinglayer/source/processor2d/vclhelpergradient.cxx
+++ b/drawinglayer/source/processor2d/vclhelpergradient.cxx
@@ -225,7 +225,7 @@ namespace drawinglayer
}
else
{
- aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0));
+ aUnitPolygon = basegfx::tools::createUnitPolygon();
}
// make sure steps is not too high/low
diff --git a/drawinglayer/source/processor2d/vclhelpergradient.hxx b/drawinglayer/source/processor2d/vclhelpergradient.hxx
index e1671dbb87b2..a86256105c90 100644
--- a/drawinglayer/source/processor2d/vclhelpergradient.hxx
+++ b/drawinglayer/source/processor2d/vclhelpergradient.hxx
@@ -36,7 +36,8 @@
#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLHELPERGRADIENT_HXX
#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLHELPERGRADIENT_HXX
-#include <drawinglayer/attribute/fillattribute.hxx>
+#include <sal/types.h>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index a99115a095c4..687bb751ca20 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -41,7 +41,6 @@
#include <vcl/virdev.hxx>
#include <vcl/gdimtf.hxx>
#include <vcl/gradient.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
@@ -52,8 +51,8 @@
#include <basegfx/polygon/b2dpolygonclipper.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/UnifiedTransparencePrimitive2D.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx>
#include <drawinglayer/processor2d/vclpixelprocessor2d.hxx>
#include <tools/stream.hxx>
@@ -73,8 +72,8 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
#include <helperchartrenderer.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
#include <drawinglayer/primitive2d/epsprimitive2d.hxx>
+#include <basegfx/polygon/b2dlinegeometry.hxx>
//////////////////////////////////////////////////////////////////////////////
// for PDFExtOutDevData Graphic support
@@ -160,7 +159,7 @@ namespace drawinglayer
{
if(bIsTransparenceGradient)
{
- // it's about alpha channel intensities (black/white), do not use color modifier
+ // it's about transparence channel intensities (black/white), do not use color modifier
o_rVCLGradient.SetStartColor(Color(rFiGrAtt.getStartColor()));
o_rVCLGradient.SetEndColor(Color(rFiGrAtt.getEndColor()));
}
@@ -444,13 +443,13 @@ namespace drawinglayer
fills. Thus, users have the choice to use the SvtGraphicFill info or the created output
actions.
Even for XFillTransparenceItem it is used, thus it may need to be supported in
- UnifiedAlphaPrimitive2D, too, when interpreted as normally filled PolyPolygon.
+ UnifiedTransparencePrimitive2D, too, when interpreted as normally filled PolyPolygon.
Implemented for:
PRIMITIVE2D_ID_POLYPOLYGONBITMAPPRIMITIVE2D,
PRIMITIVE2D_ID_POLYPOLYGONHATCHPRIMITIVE2D,
PRIMITIVE2D_ID_POLYPOLYGONGRADIENTPRIMITIVE2D,
PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D,
- and for PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D when detected unified alpha
+ and for PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D when detected unified transparence
XPATHSTROKE_SEQ_BEGIN, XPATHSTROKE_SEQ_END:
@@ -1483,138 +1482,166 @@ namespace drawinglayer
RenderModifiedColorPrimitive2D(static_cast< const primitive2d::ModifiedColorPrimitive2D& >(rCandidate));
break;
}
- case PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D :
+ case PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D :
+ {
+ // HiddenGeometryPrimitive2D; to rebuilt the old MetaFile creation, it is necessary to
+ // not ignore them (as it was thought), but to add a MetaFile entry for them.
+ basegfx::B2DRange aInvisibleRange(rCandidate.getB2DRange(getViewInformation2D()));
+
+ if(!aInvisibleRange.isEmpty())
+ {
+ aInvisibleRange.transform(maCurrentTransformation);
+ const Rectangle aRectLogic(
+ (sal_Int32)floor(aInvisibleRange.getMinX()), (sal_Int32)floor(aInvisibleRange.getMinY()),
+ (sal_Int32)ceil(aInvisibleRange.getMaxX()), (sal_Int32)ceil(aInvisibleRange.getMaxY()));
+
+ mpOutputDevice->SetFillColor();
+ mpOutputDevice->SetLineColor();
+ mpOutputDevice->DrawRect(aRectLogic);
+ }
+
+ break;
+ }
+ case PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D :
{
// for metafile: Need to examine what the pure vcl version is doing here actually
// - uses DrawTransparent with metafile for content and a gradient
// - uses DrawTransparent for single PolyPoylgons directly. Can be detected by
// checking the content for single PolyPolygonColorPrimitive2D
- const primitive2d::UnifiedAlphaPrimitive2D& rUniAlphaCandidate = static_cast< const primitive2d::UnifiedAlphaPrimitive2D& >(rCandidate);
- const primitive2d::Primitive2DSequence rContent = rUniAlphaCandidate.getChildren();
+ const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate = static_cast< const primitive2d::UnifiedTransparencePrimitive2D& >(rCandidate);
+ const primitive2d::Primitive2DSequence rContent = rUniTransparenceCandidate.getChildren();
if(rContent.hasElements())
{
- // try to identify a single PolyPolygonColorPrimitive2D in the
- // content part of the alpha primitive
- const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = 0;
- static bool bForceToMetafile(false);
-
- if(!bForceToMetafile && 1 == rContent.getLength())
+ if(0.0 == rUniTransparenceCandidate.getTransparence())
{
- const primitive2d::Primitive2DReference xReference(rContent[0]);
- pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get());
+ // not transparent at all, use content
+ process(rUniTransparenceCandidate.getChildren());
}
-
- // PolyPolygonGradientPrimitive2D, PolyPolygonHatchPrimitive2D and
- // PolyPolygonBitmapPrimitive2D are derived from PolyPolygonColorPrimitive2D.
- // Check also for correct ID to exclude derived implementations
- if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID())
+ else if(rUniTransparenceCandidate.getTransparence() > 0.0 && rUniTransparenceCandidate.getTransparence() < 1.0)
{
- // single transparent PolyPolygon identified, use directly
- const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor()));
- basegfx::B2DPolyPolygon aLocalPolyPolygon(pPoPoColor->getB2DPolyPolygon());
- aLocalPolyPolygon.transform(maCurrentTransformation);
-
- // XPATHFILL_SEQ_BEGIN/XPATHFILL_SEQ_END support
- SvtGraphicFill* pSvtGraphicFill = 0;
+ // try to identify a single PolyPolygonColorPrimitive2D in the
+ // content part of the transparence primitive
+ const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = 0;
+ static bool bForceToMetafile(false);
- if(!mnSvtGraphicFillCount && aLocalPolyPolygon.count())
+ if(!bForceToMetafile && 1 == rContent.getLength())
{
- // setup simple color with transparence fill stuff like in impgrfll
- pSvtGraphicFill = new SvtGraphicFill(
- PolyPolygon(aLocalPolyPolygon),
- Color(aPolygonColor),
- rUniAlphaCandidate.getAlpha(),
- SvtGraphicFill::fillEvenOdd,
- SvtGraphicFill::fillSolid,
- SvtGraphicFill::Transform(),
- false,
- SvtGraphicFill::hatchSingle,
- Color(),
- SvtGraphicFill::gradientLinear,
- Color(),
- Color(),
- 0,
- Graphic());
+ const primitive2d::Primitive2DReference xReference(rContent[0]);
+ pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get());
}
- // set line and fill color
- const sal_uInt16 nTransPercentVcl((sal_uInt16)basegfx::fround(rUniAlphaCandidate.getAlpha() * 100.0));
- mpOutputDevice->SetFillColor(Color(aPolygonColor));
- mpOutputDevice->SetLineColor();
+ // PolyPolygonGradientPrimitive2D, PolyPolygonHatchPrimitive2D and
+ // PolyPolygonBitmapPrimitive2D are derived from PolyPolygonColorPrimitive2D.
+ // Check also for correct ID to exclude derived implementations
+ if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID())
+ {
+ // single transparent PolyPolygon identified, use directly
+ const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor()));
+ basegfx::B2DPolyPolygon aLocalPolyPolygon(pPoPoColor->getB2DPolyPolygon());
+ aLocalPolyPolygon.transform(maCurrentTransformation);
- // call VCL directly; encapsulate with SvtGraphicFill
- impStartSvtGraphicFill(pSvtGraphicFill);
- mpOutputDevice->DrawTransparent(
- PolyPolygon(aLocalPolyPolygon),
- nTransPercentVcl);
- impEndSvtGraphicFill(pSvtGraphicFill);
- }
- else
- {
- // svae old mfCurrentUnifiedTransparence and set new one
- // so that contained SvtGraphicStroke may use the current one
- const double fLastCurrentUnifiedTransparence(mfCurrentUnifiedTransparence);
- // #i105377# paint the content metafile opaque as the transparency gets
- // split of into the gradient below
- // mfCurrentUnifiedTransparence = rUniAlphaCandidate.getAlpha();
- mfCurrentUnifiedTransparence = 0;
+ // XPATHFILL_SEQ_BEGIN/XPATHFILL_SEQ_END support
+ SvtGraphicFill* pSvtGraphicFill = 0;
- // various content, create content-metafile
- GDIMetaFile aContentMetafile;
- const Rectangle aPrimitiveRectangle(impDumpToMetaFile(rContent, aContentMetafile));
-
- // restore mfCurrentUnifiedTransparence; it may have been used
- // while processing the sub-content in impDumpToMetaFile
- mfCurrentUnifiedTransparence = fLastCurrentUnifiedTransparence;
+ if(!mnSvtGraphicFillCount && aLocalPolyPolygon.count())
+ {
+ // setup simple color with transparence fill stuff like in impgrfll
+ pSvtGraphicFill = new SvtGraphicFill(
+ PolyPolygon(aLocalPolyPolygon),
+ Color(aPolygonColor),
+ rUniTransparenceCandidate.getTransparence(),
+ SvtGraphicFill::fillEvenOdd,
+ SvtGraphicFill::fillSolid,
+ SvtGraphicFill::Transform(),
+ false,
+ SvtGraphicFill::hatchSingle,
+ Color(),
+ SvtGraphicFill::gradientLinear,
+ Color(),
+ Color(),
+ 0,
+ Graphic());
+ }
- // create uniform VCL gradient for uniform transparency
- Gradient aVCLGradient;
- const sal_uInt8 nTransPercentVcl((sal_uInt8)basegfx::fround(rUniAlphaCandidate.getAlpha() * 255.0));
- const Color aTransColor(nTransPercentVcl, nTransPercentVcl, nTransPercentVcl);
-
- aVCLGradient.SetStyle(GRADIENT_LINEAR);
- aVCLGradient.SetStartColor(aTransColor);
- aVCLGradient.SetEndColor(aTransColor);
- aVCLGradient.SetAngle(0);
- aVCLGradient.SetBorder(0);
- aVCLGradient.SetOfsX(0);
- aVCLGradient.SetOfsY(0);
- aVCLGradient.SetStartIntensity(100);
- aVCLGradient.SetEndIntensity(100);
- aVCLGradient.SetSteps(2);
+ // set line and fill color
+ const sal_uInt16 nTransPercentVcl((sal_uInt16)basegfx::fround(rUniTransparenceCandidate.getTransparence() * 100.0));
+ mpOutputDevice->SetFillColor(Color(aPolygonColor));
+ mpOutputDevice->SetLineColor();
- // render it to VCL
- mpOutputDevice->DrawTransparent(
- aContentMetafile, aPrimitiveRectangle.TopLeft(),
- aPrimitiveRectangle.GetSize(), aVCLGradient);
+ // call VCL directly; encapsulate with SvtGraphicFill
+ impStartSvtGraphicFill(pSvtGraphicFill);
+ mpOutputDevice->DrawTransparent(
+ PolyPolygon(aLocalPolyPolygon),
+ nTransPercentVcl);
+ impEndSvtGraphicFill(pSvtGraphicFill);
+ }
+ else
+ {
+ // svae old mfCurrentUnifiedTransparence and set new one
+ // so that contained SvtGraphicStroke may use the current one
+ const double fLastCurrentUnifiedTransparence(mfCurrentUnifiedTransparence);
+ // #i105377# paint the content metafile opaque as the transparency gets
+ // split of into the gradient below
+ // mfCurrentUnifiedTransparence = rUniTransparenceCandidate.getTransparence();
+ mfCurrentUnifiedTransparence = 0;
+
+ // various content, create content-metafile
+ GDIMetaFile aContentMetafile;
+ const Rectangle aPrimitiveRectangle(impDumpToMetaFile(rContent, aContentMetafile));
+
+ // restore mfCurrentUnifiedTransparence; it may have been used
+ // while processing the sub-content in impDumpToMetaFile
+ mfCurrentUnifiedTransparence = fLastCurrentUnifiedTransparence;
+
+ // create uniform VCL gradient for uniform transparency
+ Gradient aVCLGradient;
+ const sal_uInt8 nTransPercentVcl((sal_uInt8)basegfx::fround(rUniTransparenceCandidate.getTransparence() * 255.0));
+ const Color aTransColor(nTransPercentVcl, nTransPercentVcl, nTransPercentVcl);
+
+ aVCLGradient.SetStyle(GRADIENT_LINEAR);
+ aVCLGradient.SetStartColor(aTransColor);
+ aVCLGradient.SetEndColor(aTransColor);
+ aVCLGradient.SetAngle(0);
+ aVCLGradient.SetBorder(0);
+ aVCLGradient.SetOfsX(0);
+ aVCLGradient.SetOfsY(0);
+ aVCLGradient.SetStartIntensity(100);
+ aVCLGradient.SetEndIntensity(100);
+ aVCLGradient.SetSteps(2);
+
+ // render it to VCL
+ mpOutputDevice->DrawTransparent(
+ aContentMetafile, aPrimitiveRectangle.TopLeft(),
+ aPrimitiveRectangle.GetSize(), aVCLGradient);
+ }
}
}
break;
}
- case PRIMITIVE2D_ID_ALPHAPRIMITIVE2D :
+ case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D :
{
// for metafile: Need to examine what the pure vcl version is doing here actually
// - uses DrawTransparent with metafile for content and a gradient
// i can detect this here with checking the gradient part for a single
// FillGradientPrimitive2D and reconstruct the gradient.
- // If that detection goes wrong, i have to create an alpha-blended bitmap. Eventually
- // do that in stripes, else RenderAlphaPrimitive2D may just be used
- const primitive2d::AlphaPrimitive2D& rAlphaCandidate = static_cast< const primitive2d::AlphaPrimitive2D& >(rCandidate);
- const primitive2d::Primitive2DSequence rContent = rAlphaCandidate.getChildren();
- const primitive2d::Primitive2DSequence rAlpha = rAlphaCandidate.getAlpha();
+ // If that detection goes wrong, i have to create an transparence-blended bitmap. Eventually
+ // do that in stripes, else RenderTransparencePrimitive2D may just be used
+ const primitive2d::TransparencePrimitive2D& rTransparenceCandidate = static_cast< const primitive2d::TransparencePrimitive2D& >(rCandidate);
+ const primitive2d::Primitive2DSequence rContent = rTransparenceCandidate.getChildren();
+ const primitive2d::Primitive2DSequence rTransparence = rTransparenceCandidate.getTransparence();
- if(rContent.hasElements() && rAlpha.hasElements())
+ if(rContent.hasElements() && rTransparence.hasElements())
{
// try to identify a single FillGradientPrimitive2D in the
- // alpha part of the primitive
+ // transparence part of the primitive
const primitive2d::FillGradientPrimitive2D* pFiGradient = 0;
static bool bForceToBigTransparentVDev(false);
- if(!bForceToBigTransparentVDev && 1 == rAlpha.getLength())
+ if(!bForceToBigTransparentVDev && 1 == rTransparence.getLength())
{
- const primitive2d::Primitive2DReference xReference(rAlpha[0]);
+ const primitive2d::Primitive2DReference xReference(rTransparence[0]);
pFiGradient = dynamic_cast< const primitive2d::FillGradientPrimitive2D* >(xReference.get());
}
@@ -1646,7 +1673,7 @@ namespace drawinglayer
// Okay, basic implementation finished and tested. The DPI stuff was hard
// and not easy to find out that it's needed.
// Since this will not yet happen normally (as long as noone constructs
- // alpha primitives with non-trivial alpha content) i will for now not
+ // transparence primitives with non-trivial transparence content) i will for now not
// refine to tiling here.
basegfx::B2DRange aViewRange(primitive2d::getB2DRangeFromPrimitive2DSequence(rContent, getViewInformation2D()));
@@ -1697,9 +1724,9 @@ namespace drawinglayer
aBufferProcessor.process(rContent);
const Bitmap aBmContent(aBufferDevice.GetBitmap(aEmptyPoint, aSizePixel));
- // draw alpha using pixel renderer
+ // draw transparence using pixel renderer
aBufferDevice.Erase();
- aBufferProcessor.process(rAlpha);
+ aBufferProcessor.process(rTransparence);
const AlphaMask aBmAlpha(aBufferDevice.GetBitmap(aEmptyPoint, aSizePixel));
#ifdef DBG_UTIL
@@ -1785,27 +1812,6 @@ namespace drawinglayer
break;
}
- case PRIMITIVE2D_ID_HITTESTPRIMITIVE2D :
- {
- // #i99123#
- // invisible primitive; to rebuilt the old MetaFile creation, it is necessary to
- // not ignore them (as it was thought), but to add a MetaFile entry for them.
- basegfx::B2DRange aInvisibleRange(rCandidate.getB2DRange(getViewInformation2D()));
-
- if(!aInvisibleRange.isEmpty())
- {
- aInvisibleRange.transform(maCurrentTransformation);
- const Rectangle aRectLogic(
- (sal_Int32)floor(aInvisibleRange.getMinX()), (sal_Int32)floor(aInvisibleRange.getMinY()),
- (sal_Int32)ceil(aInvisibleRange.getMaxX()), (sal_Int32)ceil(aInvisibleRange.getMaxY()));
-
- mpOutputDevice->SetFillColor();
- mpOutputDevice->SetLineColor();
- mpOutputDevice->DrawRect(aRectLogic);
- }
-
- break;
- }
case PRIMITIVE2D_ID_EPSPRIMITIVE2D :
{
RenderEpsPrimitive2D(static_cast< const primitive2d::EpsPrimitive2D& >(rCandidate));
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 5a74b0471b7f..aed085a0bc9a 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -47,14 +47,14 @@
#include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <drawinglayer/primitive2d/markerarrayprimitive2d.hxx>
#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
#include <drawinglayer/primitive2d/wrongspellprimitive2d.hxx>
#include <drawinglayer/primitive2d/controlprimitive2d.hxx>
#include <com/sun/star/awt/XWindow2.hpp>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/UnifiedTransparencePrimitive2D.hxx>
#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
#include <drawinglayer/primitive2d/chartprimitive2d.hxx>
#include <helperchartrenderer.hxx>
@@ -264,50 +264,62 @@ namespace drawinglayer
RenderModifiedColorPrimitive2D(static_cast< const primitive2d::ModifiedColorPrimitive2D& >(rCandidate));
break;
}
- case PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D :
+ case PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D :
{
// Detect if a single PolyPolygonColorPrimitive2D is contained; in that case,
// use the faster OutputDevice::DrawTransparent method
- const primitive2d::UnifiedAlphaPrimitive2D& rUniAlphaCandidate = static_cast< const primitive2d::UnifiedAlphaPrimitive2D& >(rCandidate);
- const primitive2d::Primitive2DSequence rContent = rUniAlphaCandidate.getChildren();
- bool bDrawTransparentUsed(false);
+ const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate = static_cast< const primitive2d::UnifiedTransparencePrimitive2D& >(rCandidate);
+ const primitive2d::Primitive2DSequence rContent = rUniTransparenceCandidate.getChildren();
- // since DEV300 m33 DrawTransparent is supported in VCL (for some targets
- // natively), so i am now enabling this shortcut
- static bool bAllowUsingDrawTransparent(true);
-
- if(bAllowUsingDrawTransparent && rContent.hasElements() && 1 == rContent.getLength())
+ if(rContent.hasElements())
{
- const primitive2d::Primitive2DReference xReference(rContent[0]);
- const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get());
-
- if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID())
+ if(0.0 == rUniTransparenceCandidate.getTransparence())
+ {
+ // not transparent at all, use content
+ process(rUniTransparenceCandidate.getChildren());
+ }
+ else if(rUniTransparenceCandidate.getTransparence() > 0.0 && rUniTransparenceCandidate.getTransparence() < 1.0)
{
- // single transparent PolyPolygon identified, use directly
- const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor()));
- mpOutputDevice->SetFillColor(Color(aPolygonColor));
- mpOutputDevice->SetLineColor();
+ bool bDrawTransparentUsed(false);
- basegfx::B2DPolyPolygon aLocalPolyPolygon(pPoPoColor->getB2DPolyPolygon());
- aLocalPolyPolygon.transform(maCurrentTransformation);
+ // since DEV300 m33 DrawTransparent is supported in VCL (for some targets
+ // natively), so i am now enabling this shortcut
+ static bool bAllowUsingDrawTransparent(true);
- mpOutputDevice->DrawTransparent(aLocalPolyPolygon, rUniAlphaCandidate.getAlpha());
- bDrawTransparentUsed = true;
- }
- }
+ if(bAllowUsingDrawTransparent && 1 == rContent.getLength())
+ {
+ const primitive2d::Primitive2DReference xReference(rContent[0]);
+ const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get());
+
+ if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID())
+ {
+ // single transparent PolyPolygon identified, use directly
+ const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor()));
+ mpOutputDevice->SetFillColor(Color(aPolygonColor));
+ mpOutputDevice->SetLineColor();
+
+ basegfx::B2DPolyPolygon aLocalPolyPolygon(pPoPoColor->getB2DPolyPolygon());
+ aLocalPolyPolygon.transform(maCurrentTransformation);
+
+ mpOutputDevice->DrawTransparent(aLocalPolyPolygon, rUniTransparenceCandidate.getTransparence());
+ bDrawTransparentUsed = true;
+ }
+ }
- if(!bDrawTransparentUsed)
- {
- // unified sub-transparence. Draw to VDev first.
- RenderUnifiedAlphaPrimitive2D(rUniAlphaCandidate);
+ if(!bDrawTransparentUsed)
+ {
+ // unified sub-transparence. Draw to VDev first.
+ RenderUnifiedTransparencePrimitive2D(rUniTransparenceCandidate);
+ }
+ }
}
break;
}
- case PRIMITIVE2D_ID_ALPHAPRIMITIVE2D :
+ case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D :
{
// sub-transparence group. Draw to VDev first.
- RenderAlphaPrimitive2D(static_cast< const primitive2d::AlphaPrimitive2D& >(rCandidate));
+ RenderTransparencePrimitive2D(static_cast< const primitive2d::TransparencePrimitive2D& >(rCandidate));
break;
}
case PRIMITIVE2D_ID_TRANSFORMPRIMITIVE2D :
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index e9de4199026b..1c1865c13f75 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -44,7 +44,6 @@
#include <vclhelperbitmaprender.hxx>
#include <drawinglayer/attribute/sdrfillbitmapattribute.hxx>
#include <drawinglayer/primitive2d/fillbitmapprimitive2d.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <vclhelpergradient.hxx>
#include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
@@ -52,8 +51,8 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <vclhelperbufferdevice.hxx>
#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/UnifiedTransparencePrimitive2D.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <drawinglayer/primitive2d/markerarrayprimitive2d.hxx>
#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
@@ -380,7 +379,7 @@ namespace drawinglayer
{
// 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)));
+ basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon());
aPolygon.transform(aLocalTransform);
mpOutputDevice->SetFillColor(Color(aModifiedColor));
@@ -454,7 +453,7 @@ namespace drawinglayer
{
// 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)));
+ basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon());
aPolygon.transform(aLocalTransform);
mpOutputDevice->SetFillColor(Color(aModifiedColor));
@@ -610,7 +609,7 @@ namespace drawinglayer
else
{
// try to catch cases where the bitmap will be color-modified to a single
- // color (e.g. shadow). This would NOT be optimizable with an alpha channel
+ // color (e.g. shadow). This would NOT be optimizable with an transparence channel
// at the Bitmap which we do not have here. When this should change, this
// optimization has to be reworked accordingly.
const sal_uInt32 nBColorModifierStackCount(maBColorModifierStack.count());
@@ -883,10 +882,10 @@ namespace drawinglayer
if(getOptionsDrawinglayer().IsAntiAliasing())
{
// with AA, use 8bit AlphaMask to get nice borders
- VirtualDevice& rAlpha = aBufferDevice.getAlpha();
- rAlpha.SetLineColor();
- rAlpha.SetFillColor(COL_BLACK);
- rAlpha.DrawPolyPolygon(aMask);
+ VirtualDevice& rTransparence = aBufferDevice.getTransparence();
+ rTransparence.SetLineColor();
+ rTransparence.SetFillColor(COL_BLACK);
+ rTransparence.DrawPolyPolygon(aMask);
// dump buffer to outdev
aBufferDevice.paint();
@@ -919,7 +918,7 @@ namespace drawinglayer
}
// unified sub-transparence. Draw to VDev first.
- void VclProcessor2D::RenderUnifiedAlphaPrimitive2D(const primitive2d::UnifiedAlphaPrimitive2D& rTransCandidate)
+ void VclProcessor2D::RenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rTransCandidate)
{
static bool bForceToDecomposition(false);
@@ -932,14 +931,14 @@ namespace drawinglayer
}
else
{
- if(0.0 == rTransCandidate.getAlpha())
+ if(0.0 == rTransCandidate.getTransparence())
{
// no transparence used, so just use the content
process(rTransCandidate.getChildren());
}
- else if(rTransCandidate.getAlpha() > 0.0 && rTransCandidate.getAlpha() < 1.0)
+ else if(rTransCandidate.getTransparence() > 0.0 && rTransCandidate.getTransparence() < 1.0)
{
- // alpha is in visible range
+ // transparence is in visible range
basegfx::B2DRange aRange(primitive2d::getB2DRangeFromPrimitive2DSequence(rTransCandidate.getChildren(), getViewInformation2D()));
aRange.transform(maCurrentTransformation);
impBufferDevice aBufferDevice(*mpOutputDevice, aRange, true);
@@ -956,8 +955,8 @@ namespace drawinglayer
// back to old OutDev
mpOutputDevice = pLastOutputDevice;
- // dump buffer to outdev using given alpha
- aBufferDevice.paint(rTransCandidate.getAlpha());
+ // dump buffer to outdev using given transparence
+ aBufferDevice.paint(rTransCandidate.getTransparence());
}
}
}
@@ -965,7 +964,7 @@ namespace drawinglayer
}
// sub-transparence group. Draw to VDev first.
- void VclProcessor2D::RenderAlphaPrimitive2D(const primitive2d::AlphaPrimitive2D& rTransCandidate)
+ void VclProcessor2D::RenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D& rTransCandidate)
{
if(rTransCandidate.getChildren().hasElements())
{
@@ -983,14 +982,14 @@ namespace drawinglayer
process(rTransCandidate.getChildren());
// set to mask
- mpOutputDevice = &aBufferDevice.getAlpha();
+ mpOutputDevice = &aBufferDevice.getTransparence();
- // when painting alpha masks, reset the color stack
+ // when painting transparence masks, reset the color stack
basegfx::BColorModifierStack aLastBColorModifierStack(maBColorModifierStack);
maBColorModifierStack = basegfx::BColorModifierStack();
- // paint mask to it (always with alpha intensities, evtl. with AA)
- process(rTransCandidate.getAlpha());
+ // paint mask to it (always with transparence intensities, evtl. with AA)
+ process(rTransCandidate.getTransparence());
// back to old color stack
maBColorModifierStack = aLastBColorModifierStack;
diff --git a/drawinglayer/source/processor3d/cutfindprocessor3d.cxx b/drawinglayer/source/processor3d/cutfindprocessor3d.cxx
index 42e2e1565803..305a575a50d9 100644
--- a/drawinglayer/source/processor3d/cutfindprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/cutfindprocessor3d.cxx
@@ -40,11 +40,11 @@
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
#include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx>
-#include <drawinglayer/primitive3d/hittestprimitive3d.hxx>
#include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
#include <basegfx/polygon/b3dpolygon.hxx>
#include <basegfx/polygon/b3dpolygontools.hxx>
#include <basegfx/polygon/b3dpolypolygontools.hxx>
+#include <drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -61,7 +61,8 @@ namespace drawinglayer
maBack(rBack),
maResult(),
maCombinedTransform(),
- mbAnyHit(bAnyHit)
+ mbAnyHit(bAnyHit),
+ mbUseInvisiblePrimitiveContent(true)
{
}
@@ -132,13 +133,46 @@ namespace drawinglayer
process(rPrimitive.getChildren());
break;
}
- case PRIMITIVE3D_ID_HITTESTPRIMITIVE3D :
+ case PRIMITIVE3D_ID_HIDDENGEOMETRYPRIMITIVE3D :
{
- // HitTestPrimitive3D, force usage due to we are doing a hit test and this
- // primitive only gets generated on 3d objects without fill, exactly for this
- // purpose
- const primitive3d::HitTestPrimitive3D& rPrimitive = static_cast< const primitive3d::HitTestPrimitive3D& >(rCandidate);
- process(rPrimitive.getChildren());
+ // HiddenGeometryPrimitive3D; the default decomposition would return an empty seqence,
+ // so force this primitive to process it's children directly if the switch is set
+ // (which is the default). Else, ignore invisible content
+ const primitive3d::HiddenGeometryPrimitive3D& rHiddenGeometry(static_cast< const primitive3d::HiddenGeometryPrimitive3D& >(rCandidate));
+ const primitive3d::Primitive3DSequence& rChildren = rHiddenGeometry.getChildren();
+
+ if(rChildren.hasElements())
+ {
+ if(getUseInvisiblePrimitiveContent())
+ {
+ process(rChildren);
+ }
+ }
+
+ break;
+ }
+ case PRIMITIVE3D_ID_UNIFIEDTRANSPARENCETEXTUREPRIMITIVE3D :
+ {
+ const primitive3d::UnifiedTransparenceTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::UnifiedTransparenceTexturePrimitive3D& >(rCandidate);
+ const primitive3d::Primitive3DSequence rChildren = rPrimitive.getChildren();
+
+ if(rChildren.getLength())
+ {
+ if(1.0 <= rPrimitive.getTransparence())
+ {
+ // not visible, but use for HitTest
+ if(getUseInvisiblePrimitiveContent())
+ {
+ process(rChildren);
+ }
+ }
+ else if(rPrimitive.getTransparence() >= 0.0 && rPrimitive.getTransparence() < 1.0)
+ {
+ // visible; use content
+ process(rChildren);
+ }
+ }
+
break;
}
case PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D :
diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
index 509a8e5db2ba..da179b546cf9 100644
--- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
@@ -48,9 +48,11 @@
#include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
#include <basegfx/polygon/b3dpolypolygontools.hxx>
#include <com/sun/star/drawing/ShadeMode.hpp>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
+#include <vcl/bitmapex.hxx>
+#include <drawinglayer/attribute/sdrsceneattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -493,10 +495,10 @@ namespace drawinglayer
impRenderBitmapTexturePrimitive3D(rPrimitive);
break;
}
- case PRIMITIVE3D_ID_ALPHATEXTUREPRIMITIVE3D :
+ case PRIMITIVE3D_ID_TRANSPARENCETEXTUREPRIMITIVE3D :
{
- // AlphaTexturePrimitive3D
- const primitive3d::AlphaTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::AlphaTexturePrimitive3D& >(rBasePrimitive);
+ // TransparenceTexturePrimitive3D
+ const primitive3d::TransparenceTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::TransparenceTexturePrimitive3D& >(rBasePrimitive);
mnTransparenceCounter++;
impRenderGradientTexturePrimitive3D(rPrimitive, true);
mnTransparenceCounter--;
diff --git a/drawinglayer/source/processor3d/geometry2dextractor.cxx b/drawinglayer/source/processor3d/geometry2dextractor.cxx
index c2e1c73b5181..29ff433c5af8 100644
--- a/drawinglayer/source/processor3d/geometry2dextractor.cxx
+++ b/drawinglayer/source/processor3d/geometry2dextractor.cxx
@@ -135,8 +135,8 @@ namespace drawinglayer
case PRIMITIVE3D_ID_GRADIENTTEXTUREPRIMITIVE3D :
case PRIMITIVE3D_ID_HATCHTEXTUREPRIMITIVE3D :
case PRIMITIVE3D_ID_BITMAPTEXTUREPRIMITIVE3D :
- case PRIMITIVE3D_ID_ALPHATEXTUREPRIMITIVE3D :
- case PRIMITIVE3D_ID_UNIFIEDALPHATEXTUREPRIMITIVE3D :
+ case PRIMITIVE3D_ID_TRANSPARENCETEXTUREPRIMITIVE3D :
+ case PRIMITIVE3D_ID_UNIFIEDTRANSPARENCETEXTUREPRIMITIVE3D :
{
// TexturePrimitive3D: Process children, do not try to decompose
const primitive3d::TexturePrimitive3D& rTexturePrimitive = static_cast< const primitive3d::TexturePrimitive3D& >(rCandidate);
diff --git a/drawinglayer/source/processor3d/shadow3dextractor.cxx b/drawinglayer/source/processor3d/shadow3dextractor.cxx
index 5e6678fc3a8e..6e7b6a587b1e 100644
--- a/drawinglayer/source/processor3d/shadow3dextractor.cxx
+++ b/drawinglayer/source/processor3d/shadow3dextractor.cxx
@@ -39,7 +39,7 @@
#include <drawinglayer/processor3d/shadow3dextractor.hxx>
#include <drawinglayer/primitive3d/shadowprimitive3d.hxx>
#include <drawinglayer/primitive2d/shadowprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/UnifiedTransparencePrimitive2D.hxx>
#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
#include <drawinglayer/primitive3d/polygonprimitive3d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
@@ -99,7 +99,7 @@ namespace drawinglayer
{
// create simpleTransparencePrimitive, add created primitives
const primitive2d::Primitive2DSequence aNewTransPrimitiveVector(&xRef, 1L);
- const primitive2d::Primitive2DReference xRef2(new primitive2d::UnifiedAlphaPrimitive2D(aNewTransPrimitiveVector, rPrimitive.getShadowTransparence()));
+ const primitive2d::Primitive2DReference xRef2(new primitive2d::UnifiedTransparencePrimitive2D(aNewTransPrimitiveVector, rPrimitive.getShadowTransparence()));
primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(*mpPrimitive2DSequence, xRef2);
}
else
diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
index 9346958f6b69..4ccefddcb100 100644
--- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
@@ -43,7 +43,6 @@
#include <basegfx/raster/bzpixelraster.hxx>
#include <drawinglayer/attribute/materialattribute3d.hxx>
#include <drawinglayer/texture/texture.hxx>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
#include <drawinglayer/primitive3d/textureprimitive3d.hxx>
#include <drawinglayer/primitive3d/polygonprimitive3d.hxx>
@@ -51,6 +50,7 @@
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <basegfx/polygon/b3dpolygontools.hxx>
#include <basegfx/polygon/b3dpolypolygontools.hxx>
+#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx
index 0e103ad385c9..d11dc5978d47 100644
--- a/drawinglayer/source/texture/texture3d.cxx
+++ b/drawinglayer/source/texture/texture3d.cxx
@@ -38,7 +38,6 @@
#include <drawinglayer/texture/texture3d.hxx>
#include <vcl/bmpacc.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx>
//////////////////////////////////////////////////////////////////////////////