summaryrefslogtreecommitdiff
path: root/drawinglayer/inc
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2010-01-21 13:49:22 +0100
committerMathias Bauer <mba@openoffice.org>2010-01-21 13:49:22 +0100
commitd5d854cc42815ff0bbe0347be4e28c8896048b8d (patch)
tree29000ef0d8c19f47b31d81dbca2fa3205e0ad3c7 /drawinglayer/inc
parentd668e9b58922429c5e16abc698520efdc32c7af8 (diff)
parent3b3e144c13a85b21b32904f245f44256c63e10e5 (diff)
resync to DEV300_m70
Diffstat (limited to 'drawinglayer/inc')
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx12
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx129
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx37
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx123
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx31
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx239
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx21
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx33
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx6
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx51
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx93
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx6
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx57
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/epsprimitive2d.hxx96
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx31
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx55
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx31
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx35
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx38
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx49
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx38
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx39
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx13
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx33
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx25
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx31
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx37
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx25
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx51
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx28
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx125
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx196
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/primitivetools2d.hxx137
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx97
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx33
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/structuretagprimitive2d.hxx28
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx132
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx44
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textenumsprimitive2d.hxx119
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx94
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx55
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textlineprimitive2d.hxx99
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx133
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx167
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx29
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx26
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/wallpaperprimitive2d.hxx102
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx30
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx158
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx36
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx29
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx43
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx15
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx45
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx34
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx22
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx17
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx1
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx10
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx38
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx40
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx25
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx24
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx20
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx20
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx93
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx19
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx2
68 files changed, 2888 insertions, 942 deletions
diff --git a/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx
index 4e316232bd81..376e1d626927 100644
--- a/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx
@@ -36,7 +36,7 @@
#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX
-#include <vcl/bitmap.hxx>
+#include <vcl/bitmapex.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/vector/b2dvector.hxx>
@@ -56,7 +56,7 @@ namespace drawinglayer
{
class FillBitmapAttribute
{
- Bitmap maBitmap;
+ BitmapEx maBitmapEx;
basegfx::B2DPoint maTopLeft;
basegfx::B2DVector maSize;
@@ -64,11 +64,15 @@ namespace drawinglayer
unsigned mbTiling : 1;
public:
- FillBitmapAttribute(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize, bool bTiling);
+ FillBitmapAttribute(
+ const BitmapEx& rBitmapEx,
+ const basegfx::B2DPoint& rTopLeft,
+ const basegfx::B2DVector& rSize,
+ bool bTiling);
bool operator==(const FillBitmapAttribute& rCandidate) const;
// data access
- const Bitmap& getBitmap() const { return maBitmap; }
+ 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; }
diff --git a/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
new file mode 100644
index 000000000000..d8eed659f5e7
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: strokeattribute.hxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * 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_FONTATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FONTATTRIBUTE_HXX
+
+#include <sal/config.h>
+#include <sal/types.h>
+#include <tools/string.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ /** FontAttribute class
+
+ This attribute class is able to hold all parameters needed/used
+ to completely define the parametrisation of a text portion.
+ */
+ 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
+
+ public:
+ /// constructor
+ FontAttribute(
+ const String& rFamilyName,
+ const String& rStyleName,
+ sal_uInt16 nWeight,
+ bool bSymbol = false,
+ bool bVertical = false,
+ 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)
+ {
+ }
+
+ FontAttribute()
+ : maFamilyName(),
+ maStyleName(),
+ mnWeight(0),
+ mbSymbol(false),
+ mbVertical(false),
+ mbItalic(false),
+ mbOutline(false),
+ mbRTL(false),
+ mbBiDiStrong(false)
+ {
+ }
+
+ /// compare operator
+ bool operator==(const FontAttribute& rCompare) 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; }
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FONTATTRIBUTE_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx
index 6fdf3200543c..10288b70bd1b 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx
@@ -44,23 +44,52 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** AlphaPrimitive2D 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.
+
+ 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
+ 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
+ accordingly.
+ */
class AlphaPrimitive2D : public GroupPrimitive2D
{
private:
- Primitive2DSequence maAlpha; // transparence sequence
+ /// The Alpha-Mask who's RGB-Values are interpreted as Luminance
+ Primitive2DSequence maAlpha;
public:
+ /** constructor
+
+ @param rChildren
+ 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
+ will be interpreted as mask by interpreting as gray values
+ using the common RGB_to_luminance definitions
+ */
AlphaPrimitive2D(
const Primitive2DSequence& rChildren,
const Primitive2DSequence& rAlpha);
- // get data
+ /// data read access
const Primitive2DSequence& getAlpha() const { return maAlpha; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx
index 41ae18b30fc9..cd6133dc54d8 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx
@@ -38,6 +38,7 @@
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -51,50 +52,59 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** AnimatedSwitchPrimitive2D class
+
+ This is the basic class for simple, animated primitives. The basic idea
+ is to have an animation definition (AnimationEntry) who's basic
+ functionality is to return a state value for any given animation time in
+ the range of [0.0 .. 1.0]. Depending on the state, the decomposition
+ calculates an index, which of the members of the child vector is to
+ be visualized.
+
+ An example: For blinking, the Child vector should exist of two entries;
+ for values of [0.0 .. 0.5] the first, else the last entry will be used.
+ This mechanism is not limited to two entries, though.
+ */
class AnimatedSwitchPrimitive2D : public GroupPrimitive2D
{
private:
- // the animation definition which allows translation of a point in time
- // to an animation state [0.0 .. 1.0]. This member contains a cloned
- // definition and is owned by this implementation
+ /**
+ The animation definition which allows translation of a point in time
+ to an animation state [0.0 .. 1.0]. This member contains a cloned
+ definition and is owned by this implementation.
+ */
animation::AnimationEntry* mpAnimationEntry;
- // the last remembered decompose time, created and used by getDecomposition() for
- // buffering purposes
- double mfDecomposeViewTime;
-
- // bitfield
- // flag if this is a text or graphic animation. Necessary since SdrViews need to differentiate
- // between both types if they are on/off
+ /// bitfield
+ /** flag if this is a text or graphic animation. Necessary since SdrViews need to differentiate
+ between both types if they are on/off
+ */
unsigned mbIsTextAnimation : 1;
- protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
-
public:
+ /// constructor
AnimatedSwitchPrimitive2D(
const animation::AnimationEntry& rAnimationEntry,
const Primitive2DSequence& rChildren,
bool bIsTextAnimation);
+
+ /// destructor - needed due to mpAnimationEntry
virtual ~AnimatedSwitchPrimitive2D();
- // get data
+ /// data read access
const animation::AnimationEntry& getAnimationEntry() const { return *mpAnimationEntry; }
bool isTextAnimation() const { return mbIsTextAnimation; }
bool isGraphicAnimation() const { return !isTextAnimation(); }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
- virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
-
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
- // The getDecomposition is overloaded here since the decompose is dependent of the point in time,
- // so the default implementation is nut useful here, it needs to be handled locally
+ /** The getDecomposition is overloaded here since the decompose is dependent of the point in time,
+ so the default implementation is nut useful here, it needs to be handled locally
+ */
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
@@ -106,84 +116,63 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** AnimatedBlinkPrimitive2D class
+
+ Basically the same mechanism as in AnimatedSwitchPrimitive2D, but the
+ decomposition is specialized in delivering the children in the
+ range [0.0.. 0.5] and an empty sequence else
+ */
class AnimatedBlinkPrimitive2D : public AnimatedSwitchPrimitive2D
{
protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
-
public:
+ /// constructor
AnimatedBlinkPrimitive2D(
const animation::AnimationEntry& rAnimationEntry,
const Primitive2DSequence& rChildren,
bool bIsTextAnimation);
- // provide unique ID
+ /// create local decomposition
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
-// helper class for AnimatedInterpolatePrimitive2D
namespace drawinglayer
{
namespace primitive2d
{
- class BufferedMatrixDecompose
- {
- private:
- // the matrix itself
- basegfx::B2DHomMatrix maB2DHomMatrix;
-
- // the decomposition
- basegfx::B2DVector maScale;
- basegfx::B2DVector maTranslate;
- double mfRotate;
- double mfShearX;
-
- // flag if already decomposed, used by ensureDecompose()
- bool mbDecomposed;
+ /** AnimatedInterpolatePrimitive2D class
- public:
- BufferedMatrixDecompose(const basegfx::B2DHomMatrix& rMatrix);
- void ensureDecompose() const;
-
- // data access
- const basegfx::B2DHomMatrix& getB2DHomMatrix() const { return maB2DHomMatrix; }
- const basegfx::B2DVector& getScale() const { return maScale; }
- const basegfx::B2DVector& getTranslate() const { return maTranslate; }
- double getRotate() const { return mfRotate; }
- double getShearX() const { return mfShearX; }
- };
- } // end of anonymous namespace
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace primitive2d
- {
+ Specialized on multi-step animations based on matrix transformations. The
+ Child sequelce will be embedded in a matrix transformation. That transformation
+ will be linearly combined from the decomposed values and the animation value
+ to allow a smooth animation.
+ */
class AnimatedInterpolatePrimitive2D : public AnimatedSwitchPrimitive2D
{
private:
- // the transformations
- std::vector< BufferedMatrixDecompose > maMatrixStack;
+ /// the transformations
+ std::vector< basegfx::tools::B2DHomMatrixBufferedDecompose > maMatrixStack;
protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
-
public:
+ /// constructor
AnimatedInterpolatePrimitive2D(
const std::vector< basegfx::B2DHomMatrix >& rmMatrixStack,
const animation::AnimationEntry& rAnimationEntry,
const Primitive2DSequence& rChildren,
bool bIsTextAnimation);
- // provide unique ID
+ /// create local decomposition
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
index 65977cfd4241..85cf5e236d4f 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
@@ -46,35 +46,48 @@ namespace drawinglayer
{
namespace primitive2d
{
- class BackgroundColorPrimitive2D : public BasePrimitive2D
+ /** BackgroundColorPrimitive2D class
+
+ This primitive is defined to fill the whole visible Viewport with
+ the given color (and thus decomposes to a filled polygon). This
+ makes it a view-depnendent primitive by definition. It only has
+ a valid decomposition if a valid Viewport is given in the
+ ViewInformation2D at decomposition time.
+
+ It will try to buffer it's last decomposition using maLastViewport
+ to detect changes in the get2DDecomposition call.
+ */
+ class BackgroundColorPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the fill color to use
basegfx::BColor maBColor;
- // the last used viewInformation, used from getDecomposition for buffering
+ /// the last used viewInformation, used from getDecomposition for buffering
basegfx::B2DRange maLastViewport;
protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
BackgroundColorPrimitive2D(
const basegfx::BColor& rBColor);
- // get data
+ /// data read access
const basegfx::BColor& getBColor() const { return maBColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get 2d range
+ /// get B2Drange
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
- // Overload standard getDecomposition call to be view-dependent here
+ /// Overload standard getDecomposition call to be view-dependent here
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx
index b05c60394ecd..6cf45ffefe54 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx
@@ -43,16 +43,17 @@
#include <basegfx/range/b2drange.hxx>
//////////////////////////////////////////////////////////////////////////////
-// defines for DeclPrimitrive2DIDBlock and ImplPrimitrive2DIDBlock
-// Added to be able to simply change identification stuff later, e.g. add
-// a identification string and/or ID to the interface and to the implementation
-// ATM used to delclare implement getPrimitiveID()
+/** defines for DeclPrimitrive2DIDBlock and ImplPrimitrive2DIDBlock
+ Added to be able to simply change identification stuff later, e.g. add
+ a identification string and/or ID to the interface and to the implementation
+ ATM used to delclare implement getPrimitive2DID()
+*/
#define DeclPrimitrive2DIDBlock() \
- virtual sal_uInt32 getPrimitiveID() const;
+ virtual sal_uInt32 getPrimitive2DID() const;
#define ImplPrimitrive2DIDBlock(TheClass, TheID) \
- sal_uInt32 TheClass::getPrimitiveID() const { return TheID; }
+ sal_uInt32 TheClass::getPrimitive2DID() const { return TheID; }
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -61,6 +62,13 @@ namespace drawinglayer { namespace geometry {
class ViewInformation2D;
}}
+namespace drawinglayer { namespace primitive2d {
+ /// typedefs for basePrimitive2DImplBase, Primitive2DSequence and Primitive2DReference
+ typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitive2D > BasePrimitive2DImplBase;
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > Primitive2DReference;
+ typedef ::com::sun::star::uno::Sequence< Primitive2DReference > Primitive2DSequence;
+}}
+
//////////////////////////////////////////////////////////////////////////////
// basePrimitive2D class
@@ -68,101 +76,222 @@ namespace drawinglayer
{
namespace primitive2d
{
- // typedefs for basePrimitive2DImplBase, Primitive2DSequence and Primitive2DReference
- typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitive2D > BasePrimitive2DImplBase;
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > Primitive2DReference;
- typedef ::com::sun::star::uno::Sequence< Primitive2DReference > Primitive2DSequence;
-
- // base class for all C++ implementations of com::sun::star::graphic::XPrimitive2D. This class
- // is strongly virtual due to the lack of getPrimitiveID() implementation. This is by purpose, this
- // base class shall not be incarnated and be used directly as a XPrimitive2D.
+ /** BasePrimitive2D class
+
+ Baseclass for all C++ implementations of com::sun::star::graphic::XPrimitive2D
+
+ This class is strongly virtual due to the lack of getPrimitiveID() implementation.
+ This is by purpose, this base class shall not be incarnated and be used directly as
+ a XPrimitive2D.
+
+ Is is derived from boost::noncopyable to make clear that a primitive is a read-only
+ instance and copying or changing values is not intended. The idea is to hold all data
+ needed for visualisation of this primitive in unchangeable form.
+
+ It is derived from comphelper::OBaseMutex to have a Mutex at hand; in a base
+ implementation this may not be needed, but e.g. when buffering at last decomposition
+ in a local member, multiple threads may try to decompose at the same time, so locking
+ is needed to avoid race conditions seen from the UNO object implementation.
+
+ A method to get a simplified representation is provided by get2DDecomposition. The
+ default implementation returns an empty sequence. The idea is that processors
+ using this primitive and do not know it, may get the decomposition and process
+ these instead. An example is e.g. a fat line, who's decomposition may contain
+ the geometric representation of that line using filled polygon prmimitives. When
+ the renderer knows how to handle fat lines, he may proccess this primitive directly;
+ if not he can use the decomposition. With this functionality, renderers may operate by
+ knowing only a small set of primitives.
+
+ When a primitive does not implement get2DDecomposition, it is called a 'Basic Primitive' and
+ belongs to the set of primitives which a processor should be able to handle. Practice
+ will define this minimal sets of primitives. When defined and the concept is prooved,
+ unique UNO APIs may be defined/implemented for these set to allow more intense work
+ with primitives using UNO.
+
+ Current Basic 2D Primitives are:
+
+ - BitmapPrimitive2D (bitmap data, evtl. with alpha)
+ - MetafilePrimitive2D (VCL Metafile, currently no decomposition, but planned, so may vanish)
+ - PointArrayPrimitive2D (single points)
+ - PolygonHairlinePrimitive2D (hairline curves/polygons)
+ - PolyPolygonColorPrimitive2D (colored polygons)
+
+ All other implemented primitives have a defined decomposition and can thus be
+ decomposed downt 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
+ which are representated by GroupPrimitive2D derivations, see groupprimitive2d.hxx
+
+ To support getting the geometric BoundRect, getB2DRange is used. The default
+ implementation will use the get2DDecomposition result and merge a range from the
+ entries. Thus, an implementation is only necessary for the Basic Primitives, but
+ of course speedups are possible (and are used) by implementing the method at higher-level
+ primitives.
+
+ For primitive identification, getPrimitiveID is used currently in this implementations
+ to allow a fast switch/case processing. This needs a unique identifier mechanism which
+ currently uses defines (see drawinglayer_primitivetypes2d.hxx). For UNO prmitive API
+ it will be needed to add a unique descriptor (Name?) later to the API.
+
+ This base implementation provides mappings from the methods from XPrimitive2D
+ (getDecomposition/getRange) to the appropriate methods in the C++ implementations
+ (get2DDecomposition/getB2DRange). The PropertyValue ViewParameters is converted to
+ the appropriate C++ implementation class ViewInformation2D.
+
+ This base class does not implement any buffering; e.g. buffering the decompositon
+ and/or the range. These may be buffered anytime since the definition is that the primitive
+ is read-only and thus unchangeable. This implies that the decomposition and/or getting
+ the range will lead to the same result as last time, under the precondition that
+ the parameter ViewInformation2D is the same as the last one. This is usually the case
+ for view-independent primitives which are defined by not using ViewInformation2D
+ in their get2DDecomposition/getB2DRange implementations.
+ */
class BasePrimitive2D
: private boost::noncopyable,
protected comphelper::OBaseMutex,
public BasePrimitive2DImplBase
{
private:
- // a sequence used for buffering the last createLocalDecomposition() result. Use
- // the protected access methods to change. Only implementations of getDecomposition()
- // should make use.
- Primitive2DSequence maLocalDecomposition;
-
protected:
- // access methods to maLocalDecomposition. The usage of this methods may allow
- // later thread-safe stuff to be added if needed. Only to be used by getDecomposition()
- // implementations for buffering the last decomposition.
- const Primitive2DSequence& getLocalDecomposition() const { return maLocalDecomposition; }
- void setLocalDecomposition(const Primitive2DSequence& rNew) { maLocalDecomposition = rNew; }
-
- // method which is to be used to implement the local decomposition of a 2D primitive. The default
- // implementation will just return an empty decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
-
public:
- // constructor
+ // constructor/destructor
BasePrimitive2D();
+ virtual ~BasePrimitive2D();
- // the ==operator is mainly needed to allow testing newly-created primitives against their last
- // incarnation which buffers/holds the made decompositions. The default implementation
- // uses getPrimitiveID()-calls to test if it's the same ID at last. Overloaded implementation are then
- // based on this implementation
+ /** the ==operator is mainly needed to allow testing newly-created primitives against their last
+ incarnation which buffers/holds the made decompositions. The default implementation
+ uses getPrimitive2DID()-calls to test if it's the same ID at last. Overloaded implementation are then
+ based on this implementation
+ */
virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
bool operator!=( const BasePrimitive2D& rPrimitive ) const { return !operator==(rPrimitive); }
- // The default implementation will use getDecomposition results to create the range
+ /// The default implementation will use getDecomposition results to create the range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID for fast identifying of known primitive implementations in renderers. These use
- // the the defines from primitivetypes2d.hxx to define unique IDs.
- // This method is normally defined using DeclPrimitrive2DIDBlock()
- virtual sal_uInt32 getPrimitiveID() const = 0;
+ /** provide unique ID for fast identifying of known primitive implementations in renderers. These use
+ the the defines from primitivetypes2d.hxx to define unique IDs.
+ This method is normally defined using DeclPrimitrive2DIDBlock()
+ */
+ virtual sal_uInt32 getPrimitive2DID() const = 0;
- // The getDecomposition default implementation will on demand use createLocalDecomposition() if maLocalDecomposition is empty.
- // It will set maLocalDecomposition to this obtained decomposition to buffer it.
- // If the decomposition is also ViewInformation2D-dependent, this method needs to be overloaded and the
- // ViewInformation2D for the last decomposition need to be remembered, too, and be used in the next call to decide if
- // the buffered decomposition may be reused or not.
+ /// The default implementation will return an empty sequence
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
//
// Methods from XPrimitive2D
//
- // The getDecomposition implementation for UNO API will use getDecomposition from this implementation. It
- // will construct a ViewInformation2D from the ViewParameters for that purpose
+ /** The getDecomposition implementation for UNO API will use getDecomposition from this implementation. It
+ will construct a ViewInformation2D from the ViewParameters for that purpose
+ */
virtual Primitive2DSequence SAL_CALL getDecomposition( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters ) throw ( ::com::sun::star::uno::RuntimeException );
- // The getRange implementation for UNO API will use getRange from this implementation. It
- // will construct a ViewInformation2D from the ViewParameters for that purpose
+ /** The getRange implementation for UNO API will use getRange from this implementation. It
+ will construct a ViewInformation2D from the ViewParameters for that purpose
+ */
virtual ::com::sun::star::geometry::RealRectangle2D SAL_CALL getRange( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters ) throw ( ::com::sun::star::uno::RuntimeException );
};
} // end of namespace primitive2d
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
+// BufferedDecompositionPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** BufferedDecompositionPrimitive2D class
+
+ Baseclass for all C++ implementations of com::sun::star::graphic::XPrimitive2D
+ which want to buffer the decomoposition result
+
+ Buffering the decomposition is the most-used buffering and is thus used my most
+ primitive implementations which support a decomposition as base class.
+
+ The buffering is done by holding the last decomposition in the local parameter
+ maBuffered2DDecomposition. The default implementation of get2DDecomposition checks
+ if maBuffered2DDecomposition is empty. If yes, it uses create2DDecomposition
+ to create the content. In all cases, maBuffered2DDecomposition is returned.
+
+ For view-dependent primitives derived from Primitive2DBufferDecomposition more needs
+ to be done when the decomposition depends on parts of the parameter ViewInformation2D.
+ This defines a standard method for processing these:
+
+ Implement a view-dependent get2DDecomposition doing te following steps:
+ (a) Locally extract needed parameters from ViewInformation2D to new, local parameters
+ (this may be a complete local copy of ViewInformation2D)
+ (b) If a buffered decomposition exists, ckeck if one of the new local parameters
+ differs from the corresponding locally remembered (as member) ones. If yes,
+ clear maBuffered2DDecomposition
+ (d) call baseclass::get2DDecomposition which will use create2DDecomposition
+ to fill maBuffered2DDecomposition if it's empty
+ (e) copy the new local parameters to the corresponding locally remembered ones
+ to identify if a new decomposition is needed at the next call
+ (f) return maBuffered2DDecomposition
+ */
+ class BufferedDecompositionPrimitive2D
+ : public BasePrimitive2D
+ {
+ private:
+ /// a sequence used for buffering the last create2DDecomposition() result
+ Primitive2DSequence maBuffered2DDecomposition;
+
+ protected:
+ /** access methods to maBuffered2DDecomposition. The usage of this methods may allow
+ later thread-safe stuff to be added if needed. Only to be used by getDecomposition()
+ implementations for buffering the last decomposition.
+ */
+ const Primitive2DSequence& getBuffered2DDecomposition() const { return maBuffered2DDecomposition; }
+ void setBuffered2DDecomposition(const Primitive2DSequence& rNew) { maBuffered2DDecomposition = rNew; }
+
+ /** method which is to be used to implement the local decomposition of a 2D primitive. The default
+ implementation will just return an empty decomposition
+ */
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ // constructor/destructor
+ BufferedDecompositionPrimitive2D();
+
+ /** The getDecomposition default implementation will on demand use create2DDecomposition() if
+ maBuffered2DDecomposition is empty. It will set maBuffered2DDecomposition to this obtained decomposition
+ to buffer it. If the decomposition is also ViewInformation2D-dependent, this method needs to be
+ overloaded and the ViewInformation2D for the last decomposition need to be remembered, too, and
+ be used in the next call to decide if the buffered decomposition may be reused or not.
+ */
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
// tooling
namespace drawinglayer
{
namespace primitive2d
{
- // get B2DRange from a given Primitive2DReference
+ /// get B2DRange from a given Primitive2DReference
basegfx::B2DRange getB2DRangeFromPrimitive2DReference(const Primitive2DReference& rCandidate, const geometry::ViewInformation2D& aViewInformation);
- // get B2DRange from a given Primitive2DSequence
+ /// get B2DRange from a given Primitive2DSequence
basegfx::B2DRange getB2DRangeFromPrimitive2DSequence(const Primitive2DSequence& rCandidate, const geometry::ViewInformation2D& aViewInformation);
- // compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D)
- // and using compare operator
+ /** compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D)
+ and using compare operator
+ */
bool arePrimitive2DReferencesEqual(const Primitive2DReference& rA, const Primitive2DReference& rB);
- // compare two Primitive2DReferences for equality, uses arePrimitive2DReferencesEqual internally
+ /// compare two Primitive2DReferences for equality, uses arePrimitive2DReferencesEqual internally
bool arePrimitive2DSequencesEqual(const Primitive2DSequence& rA, const Primitive2DSequence& rB);
- // concatenate sequence
+ /// concatenate sequence
void appendPrimitive2DSequenceToPrimitive2DSequence(Primitive2DSequence& rDest, const Primitive2DSequence& rSource);
- // concatenate single Primitive2D
+ /// concatenate single Primitive2D
void appendPrimitive2DReferenceToPrimitive2DSequence(Primitive2DSequence& rDest, const Primitive2DReference& rSource);
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx
index d295c6ab4b89..f5de130febf9 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx
@@ -47,28 +47,41 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** BitmapPrimitive2D class
+
+ This class is the central primitive for Bitmap-based primitives.
+ It provides RGBA-based bitmaps, currently using a BitmapEx from VCL.
+ This may change in the future to any other, maybe more general base
+ class providing 24bit RGBA.
+ */
class BitmapPrimitive2D : public BasePrimitive2D
{
private:
+ /// the RGBA Bitmap-data
BitmapEx maBitmapEx;
+
+ /** the object transformation from unit coordinates, defining
+ size, shear, rotate and position
+ */
basegfx::B2DHomMatrix maTransform;
public:
+ /// constructor
BitmapPrimitive2D(
const BitmapEx& rBitmapEx,
const basegfx::B2DHomMatrix& rTransform);
- // get data
+ /// data read access
const BitmapEx& getBitmapEx() const { return maBitmapEx; }
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx
index 504ada20f8ac..b13528184f3b 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx
@@ -46,25 +46,41 @@ namespace drawinglayer
{
namespace primitive2d
{
- class BorderLinePrimitive2D : public BasePrimitive2D
+ /** BorderLinePrimitive2D class
+
+ This is the basic primitive to build frames around objects, e.g. tables.
+ It defines a single or double line from Start to nd using the LeftWidth,
+ Distance and RightWidth definitions.
+ The LineStart/End overlap is defined by the Extend(Inner|Outer)(Start|End)
+ definitions.
+ */
+ class BorderLinePrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the line definition
basegfx::B2DPoint maStart;
basegfx::B2DPoint maEnd;
+
+ /// the widths of single/double line
double mfLeftWidth;
double mfDistance;
double mfRightWidth;
+
+ /// edge overlap sizes
double mfExtendInnerStart;
double mfExtendInnerEnd;
double mfExtendOuterStart;
double mfExtendOuterEnd;
+
+ /// the line color
basegfx::BColor maRGBColor;
- // bitfield
+ /// bitfield
+ /// flags to influence inside/outside creation
unsigned mbCreateInside : 1;
unsigned mbCreateOutside : 1;
- // helpers
+ /// local helpers
double getCorrectedLeftWidth() const
{
return basegfx::fTools::equal(1.0, mfLeftWidth) ? 0.0 : mfLeftWidth;
@@ -106,10 +122,11 @@ namespace drawinglayer
}
protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
BorderLinePrimitive2D(
const basegfx::B2DPoint& rStart,
const basegfx::B2DPoint& rEnd,
@@ -124,7 +141,7 @@ namespace drawinglayer
bool bCreateOutside,
const basegfx::BColor& rRGBColor);
- // get data
+ /// data read access
const basegfx::B2DPoint& getStart() const { return maStart; }
const basegfx::B2DPoint& getEnd() const { return maEnd; }
double getLeftWidth() const { return mfLeftWidth; }
@@ -138,10 +155,10 @@ namespace drawinglayer
bool getCreateOutside() const { return mbCreateOutside; }
const basegfx::BColor& getRGBColor() const { return maRGBColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx
index 95c53347debb..b153e04ee1cb 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx
@@ -46,6 +46,12 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** ChartPrimitive2D class
+
+ This is a helper primitive which decomposes to the ChartMetaFile
+ visualisation. It is used to allow specific renderers to do something
+ direct for visualising the chart.
+ */
class ChartPrimitive2D : public GroupPrimitive2D
{
private:
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx
index 0e69cb7bdfc0..5dd55405adf7 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx
@@ -47,63 +47,74 @@ namespace drawinglayer
{
namespace primitive2d
{
- class ControlPrimitive2D : public BasePrimitive2D
+ /** ControlPrimitive2D class
+
+ Base class for ControlPrimitive handling. It decoposes to a
+ graphical representation (Bitmap data) of the control. This
+ representation is limited to a quadratic pixel maximum defined
+ in the applicatin settings.
+ */
+ class ControlPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
- // object's base data
+ /// object's base data
basegfx::B2DHomMatrix maTransform;
com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > mxControlModel;
- // the created an cached awt::XControl
+ /// the created an cached awt::XControl
com::sun::star::uno::Reference< com::sun::star::awt::XControl > mxXControl;
- // the last used scaling, used from getDecomposition for buffering
+ /// the last used scaling, used from getDecomposition for buffering
basegfx::B2DVector maLastViewScaling;
- // used from getXControl() to create a local awt::XControl which is remembered in mxXControl
- // and from thereon always used and returned by getXControl()
+ /** used from getXControl() to create a local awt::XControl which is remembered in mxXControl
+ and from thereon always used and returned by getXControl()
+ */
void createXControl();
- // single local decompositions, used from createLocalDecomposition()
+ /// single local decompositions, used from create2DDecomposition()
Primitive2DReference createBitmapDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
Primitive2DReference createPlaceholderDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
protected:
- // local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
ControlPrimitive2D(
const basegfx::B2DHomMatrix& rTransform,
const com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& rxControlModel);
- // constructor with an additional XControl as parameter to allow to hand it over at incarnation time
- // if it exists. This will avoid to create a 2nd one on demand in createXControl()
- // and thus double the XControls.
+ /** constructor with an additional XControl as parameter to allow to hand it over at incarnation time
+ if it exists. This will avoid to create a 2nd one on demand in createXControl()
+ and thus double the XControls.
+ */
ControlPrimitive2D(
const basegfx::B2DHomMatrix& rTransform,
const com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& rxControlModel,
const com::sun::star::uno::Reference< com::sun::star::awt::XControl >& rxXControl);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
const com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& getControlModel() const { return mxControlModel; }
- // mxControl access. This will on demand create the awt::XControl using createXControl()
- // if it does not exist. It may already have been created or even handed over at
- // incarnation
+ /** mxControl access. This will on demand create the awt::XControl using createXControl()
+ if it does not exist. It may already have been created or even handed over at
+ incarnation
+ */
const com::sun::star::uno::Reference< com::sun::star::awt::XControl >& getXControl() const;
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
- // Overload standard getDecomposition call to be view-dependent here
+ /// Overload standard getDecomposition call to be view-dependent here
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx
new file mode 100644
index 000000000000..04ddb73460fa
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: bitmapprimitive2d.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_PRIMITIVE2D_DISCRETEBITMAPPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_DISCRETEBITMAPPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/primitivetools2d.hxx>
+#include <vcl/bitmapex.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// DiscreteBitmapPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** DiscreteBitmapPrimitive2D class
+
+ This class defines a view-dependent BitmapPrimitive which has a
+ logic position for the top-left position and is always to be
+ painted in 1:1 pixel resolution. It will never be sheared, rotated
+ or scaled with the view.
+ */
+ class DiscreteBitmapPrimitive2D : public ObjectAndViewTransformationDependentPrimitive2D
+ {
+ private:
+ /// the RGBA Bitmap-data
+ BitmapEx maBitmapEx;
+
+ /** the top-left object position */
+ basegfx::B2DPoint maTopLeft;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ DiscreteBitmapPrimitive2D(
+ const BitmapEx& rBitmapEx,
+ const basegfx::B2DPoint& rTopLeft);
+
+ /// data read access
+ const BitmapEx& getBitmapEx() const { return maBitmapEx; }
+ const basegfx::B2DPoint& getTopLeft() const { return maTopLeft; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_DISCRETEBITMAPPRIMITIVE2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
index 8d5d089f5800..d287482389b5 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
@@ -103,6 +103,12 @@
#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)
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx
index e0da8a36c3f5..c27b6874891f 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx
@@ -42,52 +42,65 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
//////////////////////////////////////////////////////////////////////////////
-// BackgroundColorPrimitive2D class
+// Embedded3DPrimitive2D class
namespace drawinglayer
{
namespace primitive2d
{
- class Embedded3DPrimitive2D : public BasePrimitive2D
+ /** Embedded3DPrimitive2D class
+
+ This is a helper primitive which allows embedding of single 3D
+ primitives to the 2D primitive logic. It will get the scene it's
+ involved and thus the 3D transformation. With this information it
+ is able to provide 2D range data for a 3D primitive.
+
+ This primitive will not be visualized and decomposes to a yellow
+ 2D rectangle to visualize that this should never be visualized
+ */
+ class Embedded3DPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
- // the sequence of 3d primitives
+ /// the sequence of 3d primitives
primitive3d::Primitive3DSequence mxChildren3D;
- // the 2D scene object transformation
+ /// the 2D scene object transformation
basegfx::B2DHomMatrix maObjectTransformation;
- // the 3D transformations
+ /// the 3D transformations
geometry::ViewInformation3D maViewInformation3D;
- // if the embedded 3D primitives contain shadow, these parameters are needed
- // to extract the shadow wich is a sequence od 2D primitives and may expand
- // the 2D range. Since every single 3D object in a scene may individually
- // have shadow or not, these values need to be provided and prepared. The shadow
- // distance itself (a 2D transformation) is part of the 3D shadow definition
+ /** if the embedded 3D primitives contain shadow, these parameters are needed
+ to extract the shadow wich is a sequence od 2D primitives and may expand
+ the 2D range. Since every single 3D object in a scene may individually
+ have shadow or not, these values need to be provided and prepared. The shadow
+ distance itself (a 2D transformation) is part of the 3D shadow definition
+ */
basegfx::B3DVector maLightNormal;
double mfShadowSlant;
basegfx::B3DRange maScene3DRange;
- // the primitiveSequence for on-demand created shadow primitives (see mbShadow3DChecked)
+ /// the primitiveSequence for on-demand created shadow primitives (see mbShadow3DChecked)
Primitive2DSequence maShadowPrimitives;
- // #i96669# add simple range buffering for this primitive
+ /// #i96669# add simple range buffering for this primitive
basegfx::B2DRange maB2DRange;
- // bitfield
- // flag if given 3D geometry is already cheched for shadow definitions and 2d shadows
- // are created in maShadowPrimitives
+ /// bitfield
+ /** flag if given 3D geometry is already cheched for shadow definitions and 2d shadows
+ are created in maShadowPrimitives
+ */
unsigned mbShadow3DChecked : 1;
- // private helpers
+ /// private helpers
bool impGetShadow3D(const geometry::ViewInformation2D& rViewInformation) const;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
Embedded3DPrimitive2D(
const primitive3d::Primitive3DSequence& rxChildren3D,
const basegfx::B2DHomMatrix& rObjectTransformation,
@@ -96,7 +109,7 @@ namespace drawinglayer
double fShadowSlant,
const basegfx::B3DRange& rScene3DRange);
- // get data
+ /// get data
const primitive3d::Primitive3DSequence& getChildren3D() const { return mxChildren3D; }
const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
const geometry::ViewInformation3D& getViewInformation3D() const { return maViewInformation3D; }
@@ -104,13 +117,13 @@ namespace drawinglayer
double getShadowSlant() const { return mfShadowSlant; }
const basegfx::B3DRange& getScene3DRange() const { return maScene3DRange; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/epsprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/epsprimitive2d.hxx
new file mode 100644
index 000000000000..0ebb29e153ec
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/epsprimitive2d.hxx
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: backgroundcolorprimitive2d.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_PRIMITIVE2D_EPSPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_EPSPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <vcl/gfxlink.hxx>
+#include <vcl/gdimtf.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** EpsPrimitive2D class */
+ class EpsPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the geometry definition
+ basegfx::B2DHomMatrix maEpsTransform;
+
+ /// the Eps content definition
+ GfxLink maGfxLink;
+
+ /// the replacement content definition
+ GDIMetaFile maMetaFile;
+
+ protected:
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ EpsPrimitive2D(
+ const basegfx::B2DHomMatrix& rEpsTransform,
+ const GfxLink& rGfxLink,
+ const GDIMetaFile& rMetaFile);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getEpsTransform() const { return maEpsTransform; }
+ const GfxLink& getGfxLink() const { return maGfxLink; }
+ const GDIMetaFile& getMetaFile() const { return maMetaFile; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get B2Drange
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_EPSPRIMITIVE2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx
index 1811b9bfaad9..7d2b084a9356 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx
@@ -47,32 +47,49 @@ namespace drawinglayer
{
namespace primitive2d
{
- class FillBitmapPrimitive2D : public BasePrimitive2D
+ /** FillBitmapPrimitive2D class
+
+ This class defines a bitmap filling for a rectangular area. The
+ Range is defined by the Transformation, the fill by the FillBitmapAttribute.
+ There, the fill consists of a Bitmap (not transparent) defining the fill data
+ and a Point/Vector pair defining the relative position/size [0.0 .. 1.0]
+ inside the area where the bitmap is positioned. A flag defines then if this
+ is tiled or not.
+
+ Renderers should handle this primitive; it has a geometrically correct
+ decomposition, but on pixel oututs the areas where the tiled pieces are
+ aligned tend to show up (one overlapping or empty pixel)
+ */
+ class FillBitmapPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the geometric definition
basegfx::B2DHomMatrix maTransformation;
+
+ /// the fill attributes
attribute::FillBitmapAttribute maFillBitmap;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
FillBitmapPrimitive2D(
const basegfx::B2DHomMatrix& rTransformation,
const attribute::FillBitmapAttribute& rFillBitmap);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
const attribute::FillBitmapAttribute& getFillBitmap() const { return maFillBitmap; }
- // compare operator
+ /// compare operator
virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
index ef5a52c6ddcf..0fd084c6fad0 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
@@ -40,38 +40,77 @@
#include <drawinglayer/attribute/fillattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
-// FillbitmapPrimitive2D class
+// predefines
+
+namespace basegfx { class B2DPolygon; }
+
+//////////////////////////////////////////////////////////////////////////////
+// FillGradientPrimitive2D class
namespace drawinglayer
{
namespace primitive2d
{
- class FillGradientPrimitive2D : public BasePrimitive2D
+ /** FillGradientPrimitive2D class
+
+ This class defines a gradient filling for a rectangular area. The
+ Range is defined by the Transformation, the gradient by the FillGradientAttribute.
+
+ The decomposition will deliver the decomposed gradient, e.g. for an ellipse
+ gradient the various ellipses in various color steps will be created.
+
+ I have added functionality to create both versions of filled decompositions:
+ Those who overlap and non-overlapping ones. The overlapping version is the
+ default one since it works with and without AntiAliasing. The non-overlapping
+ version is used in the MetafilePrimitive2D decomposition when the old XOR
+ paint was recorded.
+ */
+ class FillGradientPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the geometric definition
basegfx::B2DRange maObjectRange;
+
+ /// the gradient definition
attribute::FillGradientAttribute maFillGradient;
+ /// local helpers
+ void generateMatricesAndColors(
+ std::vector< basegfx::B2DHomMatrix >& rMatrices,
+ std::vector< basegfx::BColor >& rColors) const;
+ Primitive2DSequence createOverlappingFill(
+ const std::vector< basegfx::B2DHomMatrix >& rMatrices,
+ const std::vector< basegfx::BColor >& rColors,
+ const basegfx::B2DPolygon& rUnitPolygon) const;
+ Primitive2DSequence createNonOverlappingFill(
+ const std::vector< basegfx::B2DHomMatrix >& rMatrices,
+ const std::vector< basegfx::BColor >& rColors,
+ const basegfx::B2DPolygon& rUnitPolygon) const;
+
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local helper
+ Primitive2DSequence createFill(bool bOverlapping) const;
+
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
FillGradientPrimitive2D(
const basegfx::B2DRange& rObjectRange,
const attribute::FillGradientAttribute& rFillGradient);
- // get data
+ /// data read access
const basegfx::B2DRange& getObjectRange() const { return maObjectRange; }
const attribute::FillGradientAttribute& getFillGradient() const { return maFillGradient; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
index 04410429d4a3..1df3bb103eb0 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
@@ -40,41 +40,56 @@
#include <drawinglayer/attribute/fillattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
-// FillbitmapPrimitive2D class
+// FillHatchPrimitive2D class
namespace drawinglayer
{
namespace primitive2d
{
- class FillHatchPrimitive2D : public BasePrimitive2D
+ /** FillHatchPrimitive2D class
+
+ This class defines a hatch filling for a rectangular area. The
+ Range is defined by the Transformation, the hatch by the FillHatchAttribute.
+ If the background is to be filled, a flag in FillHatchAttribute is set and
+ the BColor defines the background color.
+
+ The decomposition will deliver the hatch lines.
+ */
+ class FillHatchPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the geometric definition
basegfx::B2DRange maObjectRange;
+
+ /// the hatch definition
attribute::FillHatchAttribute maFillHatch;
+
+ /// hatch background color (if used)
basegfx::BColor maBColor;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
FillHatchPrimitive2D(
const basegfx::B2DRange& rObjectRange,
const basegfx::BColor& rBColor,
const attribute::FillHatchAttribute& rFillHatch);
- // get data
+ /// data read access
const basegfx::B2DRange& getObjectRange() const { return maObjectRange; }
const attribute::FillHatchAttribute& getFillHatch() const { return maFillHatch; }
const basegfx::BColor& getBColor() const { return maBColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx
index 4d020a3ab1c5..6d3c0ebf702a 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx
@@ -46,18 +46,39 @@ namespace drawinglayer
{
namespace primitive2d
{
- class GraphicPrimitive2D : public BasePrimitive2D
+ /** GraphicPrimitive2D class
+
+ Primitive to hold graphics defined by GraphicObject and GraphicAttr
+ combination. This includes MetaFiles and diverse pixel-oriented graphic
+ formats. It even includes animated GIFs, Croppings and other changes
+ defined in GraphicAttr.
+
+ This makes the decomposition contain a wide variety of possibilites,
+ too. From a simple BitmapPrimitive over AnimatedSwitchPrimitive2D,
+ MetafilePrimitive2D (with and without embedding in a masking when e.g.
+ the Metafile is bigger than the geometry) and embeddings in
+ TransformPrimitive2D and MaskPrimitive2D for croppings.
+
+ The primitive geometry area is defined by Transform.
+ */
+ class GraphicPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the geometric definition
basegfx::B2DHomMatrix maTransform;
+
+ /// the GraphicObject with all it's content possibilities
GraphicObject maGraphicObject;
+
+ /// The GraphicAttr with all it's modification possibilities
GraphicAttr maGraphicAttr;
protected:
- // local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor(s)
GraphicPrimitive2D(
const basegfx::B2DHomMatrix& rTransform,
const GraphicObject& rGraphicObject,
@@ -66,19 +87,19 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& rTransform,
const GraphicObject& rGraphicObject);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
const GraphicObject& getGraphicObject() const { return maGraphicObject; }
const GraphicAttr& getGraphicAttr() const { return maGraphicAttr; }
bool isTransparent() const;
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx
index f0aad415bfce..4ba83fc75c88 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx
@@ -48,29 +48,47 @@ namespace drawinglayer
{
namespace primitive2d
{
- class GridPrimitive2D : public BasePrimitive2D
+ /** GridPrimitive2D class
+
+ This primitive is specialized to Grid visualisation. The graphic definition
+ (Transform) contains the whole grid area, but will of course be combined
+ with the visible area (Viewport) when decomposed. Also a reolution-dependent
+ point reduction is used to not create too much grid visualisation data. This
+ makes this primitive highly view-dependent and it dynamically buffers
+ the last decomposition dependent from the Viewport used.
+ */
+ class GridPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// The geometry definition for the grid area
basegfx::B2DHomMatrix maTransform;
+
+ /// grid layout definitions
double mfWidth;
double mfHeight;
double mfSmallestViewDistance;
double mfSmallestSubdivisionViewDistance;
sal_uInt32 mnSubdivisionsX;
sal_uInt32 mnSubdivisionsY;
+
+ /// Grid color for single-pixel grid points
basegfx::BColor maBColor;
+
+ /// The Bitmap (with alpha) for grid cross points
BitmapEx maCrossMarker;
- // the last used object to view transformtion and the last Viewport,
- // used from getDecomposition for decide buffering
+ /** the last used object to view transformtion and the last Viewport,
+ used from getDecomposition for decide buffering
+ */
basegfx::B2DHomMatrix maLastObjectToViewTransformation;
basegfx::B2DRange maLastViewport;
protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
GridPrimitive2D(
const basegfx::B2DHomMatrix& rTransform,
double fWidth,
@@ -82,7 +100,7 @@ namespace drawinglayer
const basegfx::BColor& rBColor,
const BitmapEx& rCrossMarker);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
double getWidth() const { return mfWidth; }
double getHeight() const { return mfHeight; }
@@ -93,16 +111,16 @@ namespace drawinglayer
const basegfx::BColor& getBColor() const { return maBColor; }
const BitmapEx& getCrossMarker() const { return maCrossMarker; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get 2d range
+ /// get 2d range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
- // Overload standard getDecomposition call to be view-dependent here
+ /// Overload standard getDecomposition call to be view-dependent here
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx
index 855e65ba98f8..89b49420a3e7 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx
@@ -45,27 +45,58 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** GroupPrimitive2D class
+
+ Baseclass for all grouping 2D primitives
+
+ The grouping primitive in it's basic form is capable of holding
+ a child primitive content and returns it on decomposition on default.
+ It is used for two main purposes, but more may apply:
+
+ - to transport extended information, e.g. for text classification,
+ see e.g. TextHierarchy*Primitive2D implementations. Since they
+ decompose to their child content, renderers not aware/interested
+ in that extra information will just ignore these primitives
+
+ - to encapsulate common geometry, e.g. the ShadowPrimitive2D implements
+ applying a generic shadow to a child sequence by adding the needed
+ offset and color stuff in the decomposition
+
+ In most cases the decomposition is straightforward, so by default
+ this primitive will not buffer the result and is not derived from
+ BufferedDecompositionPrimitive2D, but from BasePrimitive2D.
+
+ A renderer has to take GroupPrimitive2D derivations into account which
+ are used to hold a state.
+
+ Current Basic 2D StatePrimitives are:
+
+ - AlphaPrimitive2D (objects with freely defined transparence)
+ - InvertPrimitive2D (for XOR)
+ - MaskPrimitive2D (for masking)
+ - ModifiedColorPrimitive2D (for a stack of color modifications)
+ - TransformPrimitive2D (for a transformation stack)
+ */
class GroupPrimitive2D : public BasePrimitive2D
{
private:
- // the children. Declared private since this shall never be changed at all after construction
+ /// the children. Declared private since this shall never be changed at all after construction
Primitive2DSequence maChildren;
- protected:
- // local decomposition. Implementation will just return children
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
-
public:
- // constructor
+ /// constructor
GroupPrimitive2D(const Primitive2DSequence& rChildren);
- // data access
+ /// data read access
const Primitive2DSequence& getChildren() const { return maChildren; }
- // compare operator
+ /// compare operator
virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
- // provide unique ID
+ /// local decomposition. Implementation will just return children
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx
index 4e8357a3eac1..a1171cb846e0 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx
@@ -47,32 +47,52 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** HelplineStyle2D definition
+
+ The available styles of Helplines
+ */
enum HelplineStyle2D
{
HELPLINESTYLE2D_POINT,
HELPLINESTYLE2D_LINE
};
- class HelplinePrimitive2D : public BasePrimitive2D
+ /** HelplinePrimitive2D class
+
+ This primitive provides a view-dependent helpline definition. The Helpline
+ is defined by a line equation (Point and vector) and a style. When the style
+ is a line, dependent from Viewport the visible part of that Helpline is
+ constructed. For Point, a cross is constructed. This primitive is highly
+ view-dependent.
+
+ The visualisation uses the two given colors to create a dashed line with
+ the given dash length.
+ */
+ class HelplinePrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// Helpline geometry definition
basegfx::B2DPoint maPosition;
basegfx::B2DVector maDirection;
HelplineStyle2D meStyle;
+
+ /// Helpline style definition
basegfx::BColor maRGBColA;
basegfx::BColor maRGBColB;
double mfDiscreteDashLength;
- // the last used object to view transformtion and the last Viewport,
- // used from getDecomposition for decide buffering
+ /** the last used object to view transformtion and the last Viewport,
+ used from getDecomposition for decide buffering
+ */
basegfx::B2DHomMatrix maLastObjectToViewTransformation;
basegfx::B2DRange maLastViewport;
protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
HelplinePrimitive2D(
const basegfx::B2DPoint& rPosition,
const basegfx::B2DVector& rDirection,
@@ -81,7 +101,7 @@ namespace drawinglayer
const basegfx::BColor& aRGBColB,
double fDiscreteDashLength);
- // get data
+ /// data read access
const basegfx::B2DPoint getPosition() const { return maPosition; }
const basegfx::B2DVector getDirection() const { return maDirection; }
HelplineStyle2D getStyle() const { return meStyle; }
@@ -89,13 +109,13 @@ namespace drawinglayer
const basegfx::BColor& getRGBColB() const { return maRGBColB; }
double getDiscreteDashLength() const { return mfDiscreteDashLength; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
- // Overload standard getDecomposition call to be view-dependent here
+ /// Overload standard getDecomposition call to be view-dependent here
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx
index 2bbcad315eb3..3b69c685c985 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx
@@ -44,30 +44,35 @@ namespace drawinglayer
{
namespace primitive2d
{
- // 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.
+ /** 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
{
- protected:
- // local decomposition. Implementation will return empty Primitive2DSequence
- // since this is no visualisation data
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
-
public:
+ /// constructor
HitTestPrimitive2D(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 invisible replacement geometry, so
+ the local implementation will return the children's range
+ */
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /** local decomposition. Implementation will return empty Primitive2DSequence
+ since this is no visualisation data
+ */
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx
index ae7a316e03da..85f1c6510c5a 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx
@@ -44,12 +44,23 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** InvertPrimitive2D class
+
+ This is a helper class which encapsulates geometry that should be
+ painted XOR, e.g. old cursor visualisations. It decomposes to
+ it's content, so when not supporting it, the contained geometry
+ will be visualized normally.
+ Unfortunately this is still needed, but hard to support on various
+ systems. XOR painting needs read access to the target, so modern
+ graphic systems tend to not support it anymore.
+ */
class InvertPrimitive2D : public GroupPrimitive2D
{
public:
+ /// constructor
InvertPrimitive2D(const Primitive2DSequence& rChildren);
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx
index 350471f4aff3..cc4c054f8bb3 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx
@@ -41,38 +41,55 @@
#include <vcl/bitmapex.hxx>
//////////////////////////////////////////////////////////////////////////////
-// MarkerPrimitive2D class
+// MarkerArrayPrimitive2D class
namespace drawinglayer
{
namespace primitive2d
{
- class MarkerArrayPrimitive2D : public BasePrimitive2D
+ /** MarkerArrayPrimitive2D class
+
+ This primtive defines an array of markers. Their size is defined
+ in pixels and independent from the view transformation which makes
+ this primitive highly view-dependent. It is also transformation
+ 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
+ positions.
+ It decomposes to the needed number of BitmapPrimitive2D's, so it would
+ be efficient to handle it directly in a renderer.
+ */
+ class MarkerArrayPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the positions for the marker
std::vector< basegfx::B2DPoint > maPositions;
+
+ /// the marker definintion to visualize
BitmapEx maMarker;
protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
MarkerArrayPrimitive2D(
const std::vector< basegfx::B2DPoint >& rPositions,
const BitmapEx& rMarker);
- // get data
+ /// data read access
const std::vector< basegfx::B2DPoint >& getPositions() const { return maPositions; }
const BitmapEx& getMarker() const { return maMarker; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx
index 9be17376941e..e5cb12e6e87c 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx
@@ -45,23 +45,42 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** MaskPrimitive2D class
+
+ This is the central masking primitive. It's a grouping
+ primitive and contains a PolyPolygon which defines the visible
+ area. Only visualisation parts of the Child primitive sequence
+ inside of the mask PolyPolygon is defined to be visible.
+
+ This primitive should be handled by a renderer. If it is not handled,
+ it decomposes to it's Child content, and thus the visualisation would
+ contaiun no clips.
+
+ The geometrc range of this primitive is completely defined by the Mask
+ PolyPolygon since by definition nothing outside of the mask is visible.
+ */
class MaskPrimitive2D : public GroupPrimitive2D
{
private:
+ /// the mask PolyPolygon
basegfx::B2DPolyPolygon maMask;
public:
+ /// constructor
MaskPrimitive2D(
const basegfx::B2DPolyPolygon& rMask,
const Primitive2DSequence& rChildren);
- // get data
+ /// data read access
const basegfx::B2DPolyPolygon& getMask() const { return maMask; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx
index 019fdc69bd3f..e5f884f09294 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx
@@ -46,38 +46,55 @@ namespace drawinglayer
{
namespace primitive2d
{
- class MediaPrimitive2D : public BasePrimitive2D
+ /** MediaPrimitive2D class
+
+ This is a unified primitive for Media visualisation, e.g. animations
+ or sounds. It's geometry is defined by Transform. For conveinience,
+ it also contains a discrete border size (aka Pixels) which will be added
+ if used. This makes it a view-dependent primitive. It also gets a filled
+ background and the decomposition will try to create a graphic representation
+ if te content (defined by the URL), e.g. a still frome for animated stuff.
+ */
+ class MediaPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the geometry definition
basegfx::B2DHomMatrix maTransform;
+
+ /// the content definition
rtl::OUString maURL;
+
+ /// style: background color
basegfx::BColor maBackgroundColor;
+
+ /// discrete border (in 'pixels')
sal_uInt32 mnDiscreteBorder;
protected:
- // local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
MediaPrimitive2D(
const basegfx::B2DHomMatrix& rTransform,
const rtl::OUString& rURL,
const basegfx::BColor& rBackgroundColor,
sal_uInt32 nDiscreteBorder);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
const rtl::OUString& getURL() const { return maURL; }
const basegfx::BColor& getBackgroundColor() const { return maBackgroundColor; }
sal_uInt32 getDiscreteBorder() const { return mnDiscreteBorder; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx
index 23eb5dd1b36e..0cbd7e4628cb 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx
@@ -47,28 +47,55 @@ namespace drawinglayer
{
namespace primitive2d
{
- class MetafilePrimitive2D : public BasePrimitive2D
+ /** MediaPrimitive2D class
+
+ This is the MetaFile representing primitive. It's geometry is defined
+ by MetaFileTransform. The content (defined by MetaFile) will be scaled
+ to the geometric definiton by using PrefMapMode and PrefSize of the
+ Metafile.
+
+ It has shown that this not always guarantees that all Metafile content
+ is inside the geometric definition, but this primitive defines that this
+ is the case to allow a getB2DRange implementation. If it cannot be
+ guaranteed that the Metafile is inside the geometric definition, it should
+ be embedded to a MaskPrimitive2D.
+
+ This primitive has no decomposition yet, so when not supported by a renderer,
+ it will not be visualized.
+
+ In the future, a decomposition implementation would be appreciated and would
+ have many advantages; Metafile would no longer have to be rendered by
+ sub-systems and a standard way for converting Metafiles would exist.
+ */
+ class MetafilePrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the geometry definition
basegfx::B2DHomMatrix maMetaFileTransform;
+
+ /// the content definition
GDIMetaFile maMetaFile;
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
MetafilePrimitive2D(
const basegfx::B2DHomMatrix& rMetaFileTransform,
const GDIMetaFile& rMetaFile);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getTransform() const { return maMetaFileTransform; }
const GDIMetaFile& getMetaFile() const { return maMetaFile; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx
index 903ba89c9a5b..e93dd523e0b7 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx
@@ -45,23 +45,42 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** ModifiedColorPrimitive2D class
+
+ This primitive is a grouping primitive and allows to define
+ how the colors of it's child content shall be modified for
+ visualisation. This can be (and is) used e.g. for generic shadow
+ visualisation by forcing all color usages of the contained
+ sub-content to the shadow color.
+
+ For the possibilities of color modifications, please refer
+ to the basegfx::BColorModifier definitions in basegfx. For
+ processing there is tooling in basegfx to build a stack of
+ BColorModifiers to always be able to proccess the correct
+ colors.
+
+ If a renderer does not handle this primitive, the content will
+ be visualized unchanged.
+ */
class ModifiedColorPrimitive2D : public GroupPrimitive2D
{
private:
+ /// The ColorModifier to use
basegfx::BColorModifier maColorModifier;
public:
+ /// constructor
ModifiedColorPrimitive2D(
const Primitive2DSequence& rChildren,
const basegfx::BColorModifier& rColorModifier);
- // get data
+ /// data read access
const basegfx::BColorModifier& getColorModifier() const { return maColorModifier; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx
index edba5455ff0a..5eca0ac2ab13 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx
@@ -36,7 +36,7 @@
#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PAGEPREVIEWPRIMITIVE2D_HXX
#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PAGEPREVIEWPRIMITIVE2D_HXX
-#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <basegfx/matrix/b2dhommatrix.hxx>
@@ -46,57 +46,66 @@ namespace drawinglayer
{
namespace primitive2d
{
- // This primitive is needed to have the correct XDrawPage as ViewInformation for decomposing
- // the page contents (given as childs of the GroupPrimitive2D here) if these contain e.g.
- // view-dependent (in this case XDrawPage-dependent) text fields like PageNumber. If You want
- // those primitives to be visualized correctly, Your renderer needs to locally correct it's
- // ViewInformation2D to reference the new XDrawPage.
- class PagePreviewPrimitive2D : public GroupPrimitive2D
+ /** PagePreviewPrimitive2D class
+
+ This primitive is needed to have the correct XDrawPage as ViewInformation for decomposing
+ the page contents (given as PageContent here) if these contain e.g.
+ view-dependent (in this case XDrawPage-dependent) text fields like PageNumber. If You want
+ those primitives to be visualized correctly, Your renderer needs to locally correct it's
+ ViewInformation2D to reference the new XDrawPage.
+ */
+ class PagePreviewPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
- // the XDrawPage visualized by this primitive. When we go forward with primitives
- // this will not only be used by the renderers to provide the correct decompose
- // graphic attribute context, but also to completely create the page's sub-content.
+ /** the XDrawPage visualized by this primitive. When we go forward with primitives
+ this will not only be used by the renderers to provide the correct decompose
+ graphic attribute context, but also to completely create the page's sub-content.
+ */
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > mxDrawPage;
- // the own geometry
+ /// the PageContent
+ Primitive2DSequence maPageContent;
+
+ /// the own geometry
basegfx::B2DHomMatrix maTransform;
- // content width and height
+ /// content width and height
double mfContentWidth;
double mfContentHeight;
- // bitfield
- // flag to allow keeping the aspect ratio
+ /// bitfield
+ /// flag to allow keeping the aspect ratio
unsigned mbKeepAspectRatio : 1;
protected:
- // local decomposition. Implementation will just return children
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition. Implementation will just return children
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PagePreviewPrimitive2D(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& rxDrawPage,
const basegfx::B2DHomMatrix& rTransform,
double fContentWidth,
double fContentHeight,
- const Primitive2DSequence& rChildren,
+ const Primitive2DSequence& rPageContent,
bool bKeepAspectRatio);
- // get data
+ /// data read access
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& getXDrawPage() const { return mxDrawPage; }
+ const Primitive2DSequence& getPageContent() const { return maPageContent; }
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
double getContentWidth() const { return mfContentWidth; }
double getContentHeight() const { return mfContentHeight; }
bool getKeepAspectRatio() const { return mbKeepAspectRatio; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // own getB2DRange
+ /// own getB2DRange
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
index bdd4142b0584..793c96444bac 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
@@ -40,37 +40,51 @@
#include <basegfx/color/bcolor.hxx>
//////////////////////////////////////////////////////////////////////////////
-// MarkerPrimitive2D class
+// PointArrayPrimitive2D class
namespace drawinglayer
{
namespace primitive2d
{
+ /** PointArrayPrimitive2D class
+
+ This primitive defines single,discrete 'pixels' for the given
+ positions in the given color. This makes it view-dependent since
+ the logic size of a 'pixel' depends on the view transformation.
+
+ This is one of the non-decomposable primitives, so a renderer
+ should proccess it (Currently it is only used for grid visualisation,
+ but this may change).
+ */
class PointArrayPrimitive2D : public BasePrimitive2D
{
private:
+ /// the array of positions
std::vector< basegfx::B2DPoint > maPositions;
+
+ /// the color to use
basegfx::BColor maRGBColor;
- // #i96669# add simple range buffering for this primitive
- basegfx::B2DRange maB2DRange;
+ /// #i96669# add simple range buffering for this primitive
+ basegfx::B2DRange maB2DRange;
public:
+ /// constructor
PointArrayPrimitive2D(
const std::vector< basegfx::B2DPoint >& rPositions,
const basegfx::BColor& rRGBColor);
- // get data
+ /// data read access
const std::vector< basegfx::B2DPoint >& getPositions() const { return maPositions; }
const basegfx::BColor& getRGBColor() const { return maRGBColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx
index 48ec5e80aa09..4c6f5b49bf01 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx
@@ -49,26 +49,40 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** PolygonHairlinePrimitive2D class
+
+ This primitive defines a Hairline. Since hairlines are view-dependent,
+ this primitive is view-dependent, too.
+
+ This is one of the non-decomposable primitives, so a renderer
+ should proccess it.
+ */
class PolygonHairlinePrimitive2D : public BasePrimitive2D
{
private:
+ /// the hairline geometry
basegfx::B2DPolygon maPolygon;
+
+ /// the hairline color
basegfx::BColor maBColor;
public:
- PolygonHairlinePrimitive2D(const basegfx::B2DPolygon& rPolygon, const basegfx::BColor& rBColor);
+ /// constructor
+ PolygonHairlinePrimitive2D(
+ const basegfx::B2DPolygon& rPolygon,
+ const basegfx::BColor& rBColor);
- // get data
+ /// data read access
const basegfx::B2DPolygon& getB2DPolygon() const { return maPolygon; }
const basegfx::BColor& getBColor() const { return maBColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -81,44 +95,59 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolygonMarkerPrimitive2D : public BasePrimitive2D
+ /** PolygonMarkerPrimitive2D class
+
+ This primitive defines a two-colored marker hairline which is
+ dashed with the given dash length. Since hairlines are view-dependent,
+ this primitive is view-dependent, too.
+
+ It will be decomposed to the needed PolygonHairlinePrimitive2D if
+ not handled directly by a renderer.
+ */
+ class PolygonMarkerPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the marker hairline geometry
basegfx::B2DPolygon maPolygon;
+
+ /// the two colors
basegfx::BColor maRGBColorA;
basegfx::BColor maRGBColorB;
+
+ /// the dash distance in 'pixels'
double mfDiscreteDashLength;
- // decomposition is view-dependent, remember last InverseObjectToViewTransformation
+ /// decomposition is view-dependent, remember last InverseObjectToViewTransformation
basegfx::B2DHomMatrix maLastInverseObjectToViewTransformation;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolygonMarkerPrimitive2D(
const basegfx::B2DPolygon& rPolygon,
const basegfx::BColor& rRGBColorA,
const basegfx::BColor& rRGBColorB,
double fDiscreteDashLength);
- // get data
+ /// data read access
const basegfx::B2DPolygon& getB2DPolygon() const { return maPolygon; }
const basegfx::BColor& getRGBColorA() const { return maRGBColorA; }
const basegfx::BColor& getRGBColorB() const { return maRGBColorB; }
double getDiscreteDashLength() const { return mfDiscreteDashLength; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // get local decomposition. Overloaded since this decomposition is view-dependent
+ /// get local decomposition. Overloaded since this decomposition is view-dependent
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -131,39 +160,52 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolygonStrokePrimitive2D : public BasePrimitive2D
+ /** PolygonStrokePrimitive2D class
+
+ This primitive defines a line with line width, line join, line color
+ and stroke attributes. It will be decomposed dependent on the definition
+ to the needed primitives, e.g. filled PolyPolygons for fat lines.
+ */
+ class PolygonStrokePrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the line geometry
basegfx::B2DPolygon maPolygon;
+
+ /// the line attributes like width, join and color
attribute::LineAttribute maLineAttribute;
+
+ /// the line stroking (if used)
attribute::StrokeAttribute maStrokeAttribute;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolygonStrokePrimitive2D(
const basegfx::B2DPolygon& rPolygon,
const attribute::LineAttribute& rLineAttribute,
const attribute::StrokeAttribute& rStrokeAttribute);
+ /// constructor without stroking
PolygonStrokePrimitive2D(
const basegfx::B2DPolygon& rPolygon,
const attribute::LineAttribute& rLineAttribute);
- // get data
+ /// data read access
basegfx::B2DPolygon getB2DPolygon() const { return maPolygon; }
const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; }
const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -176,17 +218,24 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** PolygonWavePrimitive2D class
+
+ This primitive defines a waveline based on a PolygonStrokePrimitive2D
+ where the wave is defined by wave width and wave length.
+ */
class PolygonWavePrimitive2D : public PolygonStrokePrimitive2D
{
private:
+ /// wave definition
double mfWaveWidth;
double mfWaveHeight;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolygonWavePrimitive2D(
const basegfx::B2DPolygon& rPolygon,
const attribute::LineAttribute& rLineAttribute,
@@ -194,23 +243,24 @@ namespace drawinglayer
double fWaveWidth,
double fWaveHeight);
+ /// constructor without stroking
PolygonWavePrimitive2D(
const basegfx::B2DPolygon& rPolygon,
const attribute::LineAttribute& rLineAttribute,
double fWaveWidth,
double fWaveHeight);
- // get data
+ /// data read access
double getWaveWidth() const { return mfWaveWidth; }
double getWaveHeight() const { return mfWaveHeight; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -223,17 +273,25 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** PolygonStrokeArrowPrimitive2D class
+
+ This primitive defines a PolygonStrokePrimitive2D which is extended
+ eventually by start and end definitions which are normally used for
+ arrows.
+ */
class PolygonStrokeArrowPrimitive2D : public PolygonStrokePrimitive2D
{
private:
+ /// geometric definitions for line start and end
attribute::LineStartEndAttribute maStart;
attribute::LineStartEndAttribute maEnd;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolygonStrokeArrowPrimitive2D(
const basegfx::B2DPolygon& rPolygon,
const attribute::LineAttribute& rLineAttribute,
@@ -241,23 +299,24 @@ namespace drawinglayer
const attribute::LineStartEndAttribute& rStart,
const attribute::LineStartEndAttribute& rEnd);
+ /// constructor without stroking
PolygonStrokeArrowPrimitive2D(
const basegfx::B2DPolygon& rPolygon,
const attribute::LineAttribute& rLineAttribute,
const attribute::LineStartEndAttribute& rStart,
const attribute::LineStartEndAttribute& rEnd);
- // get data
+ /// data read access
const attribute::LineStartEndAttribute& getStart() const { return maStart; }
const attribute::LineStartEndAttribute& getEnd() const { return maEnd; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
index 9991a3109e10..187e89f42e97 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
@@ -51,30 +51,40 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolyPolygonHairlinePrimitive2D : public BasePrimitive2D
+ /** PolyPolygonHairlinePrimitive2D class
+
+ This primitive defines a multi-PolygonHairlinePrimitive2D and is
+ just for convenience. The definition is not different from the single
+ defined PolygonHairlinePrimitive2Ds.
+ */
+ class PolyPolygonHairlinePrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the hairline geometry
basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the hairline color
basegfx::BColor maBColor;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolyPolygonHairlinePrimitive2D(const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::BColor& rBColor);
- // get data
+ /// data read access
basegfx::B2DPolyPolygon getB2DPolyPolygon() const { return maPolyPolygon; }
const basegfx::BColor& getBColor() const { return maBColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -87,38 +97,50 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolyPolygonMarkerPrimitive2D : public BasePrimitive2D
+ /** PolyPolygonMarkerPrimitive2D class
+
+ This primitive defines a multi-PolygonMarkerPrimitive2D and is
+ just for convenience. The definition is not different from the single
+ defined PolygonMarkerPrimitive2Ds.
+ */
+ class PolyPolygonMarkerPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the marker hairline geometry
basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the two colors
basegfx::BColor maRGBColorA;
basegfx::BColor maRGBColorB;
+
+ /// the dash distance in 'pixels'
double mfDiscreteDashLength;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolyPolygonMarkerPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
const basegfx::BColor& rRGBColorA,
const basegfx::BColor& rRGBColorB,
double fDiscreteDashLength);
- // get data
+ // data read access
basegfx::B2DPolyPolygon getB2DPolyPolygon() const { return maPolyPolygon; }
const basegfx::BColor& getRGBColorA() const { return maRGBColorA; }
const basegfx::BColor& getRGBColorB() const { return maRGBColorB; }
double getDiscreteDashLength() const { return mfDiscreteDashLength; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -131,39 +153,52 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolyPolygonStrokePrimitive2D : public BasePrimitive2D
+ /** PolyPolygonStrokePrimitive2D class
+
+ This primitive defines a multi-PolygonStrokePrimitive2D and is
+ just for convenience. The definition is not different from the single
+ defined PolygonStrokePrimitive2Ds.
+ */
+ class PolyPolygonStrokePrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the line geometry
basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the line attributes like width, join and color
attribute::LineAttribute maLineAttribute;
+
+ /// the line stroking (if used)
attribute::StrokeAttribute maStrokeAttribute;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolyPolygonStrokePrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
const attribute::LineAttribute& rLineAttribute,
const attribute::StrokeAttribute& rStrokeAttribute);
+ /// constructor without stroking
PolyPolygonStrokePrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
const attribute::LineAttribute& rLineAttribute);
- // get data
+ /// data read access
basegfx::B2DPolyPolygon getB2DPolyPolygon() const { return maPolyPolygon; }
const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; }
const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -176,17 +211,25 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** PolyPolygonStrokePrimitive2D class
+
+ This primitive defines a multi-PolygonStrokeArrowPrimitive2D and is
+ just for convenience. The definition is not different from the single
+ defined PolygonStrokeArrowPrimitive2Ds.
+ */
class PolyPolygonStrokeArrowPrimitive2D : public PolyPolygonStrokePrimitive2D
{
private:
+ /// geometric definitions for line start and end
attribute::LineStartEndAttribute maStart;
attribute::LineStartEndAttribute maEnd;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolyPolygonStrokeArrowPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
const attribute::LineAttribute& rLineAttribute,
@@ -194,23 +237,24 @@ namespace drawinglayer
const attribute::LineStartEndAttribute& rStart,
const attribute::LineStartEndAttribute& rEnd);
+ /// constructor without stroking
PolyPolygonStrokeArrowPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
const attribute::LineAttribute& rLineAttribute,
const attribute::LineStartEndAttribute& rStart,
const attribute::LineStartEndAttribute& rEnd);
- // get data
+ /// data read access
const attribute::LineStartEndAttribute& getStart() const { return maStart; }
const attribute::LineStartEndAttribute& getEnd() const { return maEnd; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -223,28 +267,38 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** PolyPolygonColorPrimitive2D class
+
+ This primitive defines a PolyPolygon filled with a single color.
+ This is one of the non-decomposable primitives, so a renderer
+ should proccess it.
+ */
class PolyPolygonColorPrimitive2D : public BasePrimitive2D
{
private:
+ /// the PolyPolygon geometry
basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the polygon fill color
basegfx::BColor maBColor;
public:
+ /// constructor
PolyPolygonColorPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
const basegfx::BColor& rBColor);
- // get data
+ /// data read access
const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
const basegfx::BColor& getBColor() const { return maBColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -257,28 +311,39 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolyPolygonGradientPrimitive2D : public PolyPolygonColorPrimitive2D
+ /** PolyPolygonColorPrimitive2D class
+
+ This primitive defines a PolyPolygon filled with a gradient. The
+ decomosition will create a MaskPrimitive2D containing a
+ FillGradientPrimitive2D.
+ */
+ class PolyPolygonGradientPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the PolyPolygon geometry
+ basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the gradient definition
attribute::FillGradientAttribute maFillGradient;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolyPolygonGradientPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
- const basegfx::BColor& rBColor,
const attribute::FillGradientAttribute& rFillGradient);
- // get data
+ /// data read access
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
const attribute::FillGradientAttribute& getFillGradient() const { return maFillGradient; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -291,28 +356,44 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolyPolygonHatchPrimitive2D : public PolyPolygonColorPrimitive2D
+ /** PolyPolygonHatchPrimitive2D class
+
+ This primitive defines a PolyPolygon filled with a hatch. The
+ decomosition will create a MaskPrimitive2D containing a
+ FillHatchPrimitive2D.
+ */
+ class PolyPolygonHatchPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the PolyPolygon geometry
+ basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the hatch background color (if used)
+ basegfx::BColor maBackgroundColor;
+
+ /// the hatch definition
attribute::FillHatchAttribute maFillHatch;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolyPolygonHatchPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
- const basegfx::BColor& rBColor,
+ const basegfx::BColor& rBackgroundColor,
const attribute::FillHatchAttribute& rFillHatch);
- // get data
+ /// data read access
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
+ const basegfx::BColor& getBackgroundColor() const { return maBackgroundColor; }
const attribute::FillHatchAttribute& getFillHatch() const { return maFillHatch; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -325,28 +406,39 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolyPolygonBitmapPrimitive2D : public PolyPolygonColorPrimitive2D
+ /** PolyPolygonBitmapPrimitive2D class
+
+ This primitive defines a PolyPolygon filled with bitmap data
+ (including alpha). The decomosition will create a MaskPrimitive2D
+ containing a FillBitmapPrimitive2D.
+ */
+ class PolyPolygonBitmapPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the PolyPolygon geometry
+ basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the bitmap fill definition (may include tiling)
attribute::FillBitmapAttribute maFillBitmap;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolyPolygonBitmapPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
- const basegfx::BColor& rBColor,
const attribute::FillBitmapAttribute& rFillBitmap);
- // get data
+ /// data read access
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
const attribute::FillBitmapAttribute& getFillBitmap() const { return maFillBitmap; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/primitivetools2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/primitivetools2d.hxx
index bd561cbab21a..a095c558ba12 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/primitivetools2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/primitivetools2d.hxx
@@ -37,70 +37,163 @@
#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVE2DTOOLS_HXX
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
//////////////////////////////////////////////////////////////////////////////
-// tooling class for BasePrimitive2D baseed classes which are view-dependent
-// regarding the size of a discrete unit. The implementation of get2DDecomposition
-// guards the buffered local decomposition and ensures that a createLocalDecomposition
-// implementation may use an up-to-date DiscreteUnit accessible using getDiscreteUnit()
namespace drawinglayer
{
namespace primitive2d
{
- class DiscreteMetricDependentPrimitive2D : public BasePrimitive2D
+ /** DiscreteMetricDependentPrimitive2D class
+
+ tooling class for BufferedDecompositionPrimitive2D baseed classes which are view-dependent
+ regarding the size of a discrete unit. The implementation of get2DDecomposition
+ guards the buffered local decomposition and ensures that a create2DDecomposition
+ implementation may use an up-to-date DiscreteUnit accessible using getDiscreteUnit()
+ */
+ class DiscreteMetricDependentPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
- // the last used fDiscreteUnit definitions for decomposition. Since this
- // is checked and updated from get2DDecomposition() it will be current and
- // usable in createLocalDecomposition()
+ /** the last used fDiscreteUnit definitions for decomposition. Since this
+ is checked and updated from get2DDecomposition() it will be current and
+ usable in create2DDecomposition()
+ */
double mfDiscreteUnit;
public:
+ /// constructor
DiscreteMetricDependentPrimitive2D()
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
mfDiscreteUnit(0.0)
{
}
- // data access
+ /// data read access
double getDiscreteUnit() const { return mfDiscreteUnit; }
- // get local decomposition. Overloaded since this decomposition is view-dependent
+ /// get local decomposition. Overloaded since this decomposition is view-dependent
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
-// tooling class for BasePrimitive2D baseed classes which are view-dependent
-// regarding the viewport. The implementation of get2DDecomposition
-// guards the buffered local decomposition and ensures that a createLocalDecomposition
-// implementation may use an up-to-date Viewport accessible using getViewport()
namespace drawinglayer
{
namespace primitive2d
{
- class ViewportDependentPrimitive2D : public BasePrimitive2D
+ /** ViewportDependentPrimitive2D class
+
+ tooling class for BufferedDecompositionPrimitive2D baseed classes which are view-dependent
+ regarding the viewport. The implementation of get2DDecomposition
+ guards the buffered local decomposition and ensures that a create2DDecomposition
+ implementation may use an up-to-date Viewport accessible using getViewport()
+ */
+ class ViewportDependentPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
- // the last used Viewport definition for decomposition. Since this
- // is checked and updated from get2DDecomposition() it will be current and
- // usable in createLocalDecomposition()
+ /** the last used Viewport definition for decomposition. Since this
+ is checked and updated from get2DDecomposition() it will be current and
+ usable in create2DDecomposition()
+ */
basegfx::B2DRange maViewport;
public:
+ /// constructor
ViewportDependentPrimitive2D()
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maViewport()
{
}
- // data access
+ /// data read access
const basegfx::B2DRange& getViewport() const { return maViewport; }
- // get local decomposition. Overloaded since this decomposition is view-dependent
+ /// get local decomposition. Overloaded since this decomposition is view-dependent
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** ViewTransformationDependentPrimitive2D class
+
+ tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
+ regarding the complete Viewtransformation. The implementation of get2DDecomposition
+ guards the buffered local decomposition and ensures that a create2DDecomposition
+ implementation may use an up-to-date ViewTransformation accessible using getViewTransformation()
+ */
+ class ViewTransformationDependentPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /** the last used ViewTransformation definition for decomposition. Since this
+ is checked and updated from get2DDecomposition() it will be current and
+ usable in create2DDecomposition()
+ */
+ basegfx::B2DHomMatrix maViewTransformation;
+
+ public:
+ /// constructor
+ ViewTransformationDependentPrimitive2D()
+ : BufferedDecompositionPrimitive2D(),
+ maViewTransformation()
+ {
+ }
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getViewTransformation() const { return maViewTransformation; }
+
+ /// get local decomposition. Overloaded since this decomposition is view-dependent
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** ObjectAndViewTransformationDependentPrimitive2D class
+
+ tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
+ and Object-Transform dependent. The implementation of get2DDecomposition
+ guards the buffered local decomposition and ensures that a create2DDecomposition
+ implementation may use an up-to-date ViewTransformation accessible using getViewTransformation()
+ and an object transformation via getObjectTransformation()
+ */
+ class ObjectAndViewTransformationDependentPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /** the last used ViewTransformation and the last ObjectTransformation
+ definition for decomposition. Since this is checked and updated from
+ get2DDecomposition() it will be current and usable in create2DDecomposition()
+ */
+ basegfx::B2DHomMatrix maViewTransformation;
+ basegfx::B2DHomMatrix maObjectTransformation;
+
+ public:
+ /// constructor
+ ObjectAndViewTransformationDependentPrimitive2D()
+ : BufferedDecompositionPrimitive2D(),
+ maViewTransformation(),
+ maObjectTransformation()
+ {
+ }
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getViewTransformation() const { return maViewTransformation; }
+ const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
+
+ /// get local decomposition. Overloaded since this decomposition is view-dependent
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
index 8ffc9a332e5c..65d2bdf67f92 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
@@ -49,33 +49,60 @@ namespace drawinglayer
{
namespace primitive2d
{
- class ScenePrimitive2D : public BasePrimitive2D
+ /** ScenePrimitive2D class
+
+ This primitive defines a 3D scene as a 2D primitive and is the anchor point
+ for a 3D visualisation. The decomposition is view-dependent and will try to
+ re-use already rendered 3D content.
+
+ The rendering is done using the default-3D renderer from basegfx which supports
+ AntiAliasing.
+
+ The 2D primitive's geometric range is defined completely by the
+ ObjectTransformation combined with evtl. 2D shadows from the 3D objects. The
+ shadows of 3D objects are 2D polygons, projected with the 3D transformation.
+
+ This is the class a renderer may process directly when he wants to implement
+ an own (e.g. system-specific) 3D renderer.
+ */
+ class ScenePrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
- primitive3d::Primitive3DSequence mxChildren3D; // the 3d sub-primitives
- attribute::SdrSceneAttribute maSdrSceneAttribute; // 3d scene attribute set
- attribute::SdrLightingAttribute maSdrLightingAttribute; // lighting attribute set
- basegfx::B2DHomMatrix maObjectTransformation; // object transformation for scene for 2d definition
- geometry::ViewInformation3D maViewInformation3D; // scene transformation set and object transformation
+ /// the 3D geometry definition
+ primitive3d::Primitive3DSequence mxChildren3D;
+
+ /// 3D scene attribute set
+ attribute::SdrSceneAttribute maSdrSceneAttribute;
+
+ /// lighting attribute set
+ attribute::SdrLightingAttribute maSdrLightingAttribute;
+
+ /// object transformation for scene for 2D definition
+ basegfx::B2DHomMatrix maObjectTransformation;
+
+ /// scene transformation set and object transformation
+ geometry::ViewInformation3D maViewInformation3D;
- // the primitiveSequence for on-demand created shadow primitives (see mbShadow3DChecked)
+ /// the primitiveSequence for on-demand created shadow primitives (see mbShadow3DChecked)
Primitive2DSequence maShadowPrimitives;
- // bitfield
- // flag if given 3D geometry is already cheched for shadow definitions and 2d shadows
- // are created in maShadowPrimitives
+ /// bitfield
+ /** flag if given 3D geometry is already cheched for shadow definitions and 2d shadows
+ are created in maShadowPrimitives
+ */
unsigned mbShadow3DChecked : 1;
- // the last used NewDiscreteSize and NewUnitVisiblePart definitions for decomposition
+ /// the last used NewDiscreteSize and NewUnitVisiblePart definitions for decomposition
double mfOldDiscreteSizeX;
double mfOldDiscreteSizeY;
basegfx::B2DRange maOldUnitVisiblePart;
- // the last created BitmapEx, e.g. for fast HitTest. This does not really need
- // memory since BitmapEx is internally RefCounted
+ /** the last created BitmapEx, e.g. for fast HitTest. This does not really need
+ memory since BitmapEx is internally RefCounted
+ */
BitmapEx maOldRenderedBitmap;
- // private helpers
+ /// private helpers
bool impGetShadow3D(const geometry::ViewInformation2D& rViewInformation) const;
void calculateDiscreteSizes(
const geometry::ViewInformation2D& rViewInformation,
@@ -84,28 +111,30 @@ namespace drawinglayer
basegfx::B2DRange& rUnitVisibleRange) const;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
- // public helpers
- // Geometry extractor. Shadow will be added as in createLocalDecomposition, but
- // the 3D content is not converted to a bitmap visualisation but to projected 2D gemetry. This
- // helper is useful e.g. for Contour extraction or HitTests.
+ /// public helpers
+ /** Geometry extractor. Shadow will be added as in create2DDecomposition, but
+ the 3D content is not converted to a bitmap visualisation but to projected 2D gemetry. This
+ helper is useful e.g. for Contour extraction or HitTests.
+ */
Primitive2DSequence getGeometry2D() const;
Primitive2DSequence getShadow2D(const geometry::ViewInformation2D& rViewInformation) const;
- // Fast HitTest which uses the last buffered BitmapEx from the last
- // rendered area if available. The return value describes if the check
- // could be done with the current information, so do NOT use o_rResult
- // when it returns false. o_rResult will be changed on return true and
- // then contains a definitive answer if content of this scene is hit or
- // not. On return false, it is normally necessary to use the geometric
- // HitTest (see CutFindProcessor usages). The given HitPoint
- // has to be in logic coordinates in scene's ObjectCoordinateSystem.
+ /** Fast HitTest which uses the last buffered BitmapEx from the last
+ rendered area if available. The return value describes if the check
+ could be done with the current information, so do NOT use o_rResult
+ when it returns false. o_rResult will be changed on return true and
+ then contains a definitive answer if content of this scene is hit or
+ not. On return false, it is normally necessary to use the geometric
+ HitTest (see CutFindProcessor usages). The given HitPoint
+ has to be in logic coordinates in scene's ObjectCoordinateSystem.
+ */
bool tryToCheckLastVisualisationDirectHit(const basegfx::B2DPoint& rLogicHitPoint, bool& o_rResult) const;
- // constructor/destructor
+ /// constructor
ScenePrimitive2D(
const primitive3d::Primitive3DSequence& rxChildren3D,
const attribute::SdrSceneAttribute& rSdrSceneAttribute,
@@ -113,23 +142,23 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& rObjectTransformation,
const geometry::ViewInformation3D& rViewInformation3D);
- // get data
+ /// data ead access
const primitive3d::Primitive3DSequence& getChildren3D() const { return mxChildren3D; }
const attribute::SdrSceneAttribute& getSdrSceneAttribute() const { return maSdrSceneAttribute; }
const attribute::SdrLightingAttribute& getSdrLightingAttribute() const { return maSdrLightingAttribute; }
const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
const geometry::ViewInformation3D& getViewInformation3D() const { return maViewInformation3D; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
- // get local decomposition. Overloaded since this decomposition is view-dependent
+ /// get local decomposition. Overloaded since this decomposition is view-dependent
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx
index b749000ee566..0e3f7258441a 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx
@@ -46,33 +46,50 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** ShadowPrimitive2D class
+
+ This primitive defines a generic shadow geometry construction
+ for 2D objects. It decomposes to a TransformPrimitive2D embedded
+ into a ModifiedColorPrimitive2D.
+
+ It's for primtive usage convenience, so that not everyone has
+ to implement the generic shadow construction by himself.
+
+ The same geometry as sequence of primitives is used as geometry and
+ as shadow. Since these are RefCounted Uno-Api objects, no extra objects
+ are needed for the shadow itself; all the local decompositions of the
+ original geometry can be reused from the renderer for shadow visualisation.
+ */
class ShadowPrimitive2D : public GroupPrimitive2D
{
private:
+ /// the shadow transformation, normally just an offset
basegfx::B2DHomMatrix maShadowTransform;
- basegfx::BColor maShadowColor;
- protected:
- // create decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// the shadow color to which all geometry is to be forced
+ basegfx::BColor maShadowColor;
public:
+ /// constructor
ShadowPrimitive2D(
const basegfx::B2DHomMatrix& rShadowTransform,
const basegfx::BColor& rShadowColor,
const Primitive2DSequence& rChildren);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getShadowTransform() const { return maShadowTransform; }
const basegfx::BColor& getShadowColor() const { return maShadowColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// create decomposition
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/structuretagprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/structuretagprimitive2d.hxx
index 9ccb91e7bebd..c86e4c91bb86 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/structuretagprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/structuretagprimitive2d.hxx
@@ -45,30 +45,34 @@ namespace drawinglayer
{
namespace primitive2d
{
- // This class is used to provode simple support for adding grouped
- // pdf writer structured element information like used in sd from
- // unomodel.cxx where a ViewObjectContactRedirector is used to add
- // such information for diverse objects.
- // This primitive encapsulates these and the VCLPdfRenderer uses it
- // to apply the needed infos directly to the pdf export in a compatible
- // way.
- // If a renderer ignores this, it just decomposes to it's child
- // content.
+ /** StructureTagPrimitive2D class
+
+ This class is used to provode simple support for adding grouped
+ pdf writer structured element information like used in sd from
+ unomodel.cxx where a ViewObjectContactRedirector is used to add
+ such information for diverse objects.
+ This primitive encapsulates these and the VCLPdfRenderer uses it
+ to apply the needed infos directly to the pdf export in a compatible
+ way.
+ If a renderer ignores this, it just decomposes to it's child
+ content.
+ */
class StructureTagPrimitive2D : public GroupPrimitive2D
{
private:
- // the PDF structure element this grouping represents
+ /// the PDF structure element this grouping represents
vcl::PDFWriter::StructElement maStructureElement;
public:
+ /// constructor
StructureTagPrimitive2D(
const vcl::PDFWriter::StructElement& rStructureElement,
const Primitive2DSequence& rChildren);
- // data access
+ /// data read access
const vcl::PDFWriter::StructElement& getStructureElement() const { return maStructureElement; }
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
index 69023873760a..fe41c2e1824a 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
@@ -37,13 +37,14 @@
#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTDECORATEDPRIMITIVE2D_HXX
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textenumsprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
// predeclarations
-namespace basegfx {
- class DecomposedB2DHomMatrixContainer;
-} // end of namespace basegfx
+namespace basegfx { namespace tools {
+ class B2DHomMatrixBufferedOnDemandDecompose;
+}}
namespace com { namespace sun { namespace star { namespace i18n {
struct Boundary;
@@ -55,153 +56,102 @@ namespace drawinglayer
{
namespace primitive2d
{
- // This is used for both underline and overline
- enum FontUnderline
- {
- FONT_UNDERLINE_NONE,
- FONT_UNDERLINE_SINGLE,
- FONT_UNDERLINE_DOUBLE,
- FONT_UNDERLINE_DOTTED,
- FONT_UNDERLINE_DASH,
- FONT_UNDERLINE_LONGDASH,
- FONT_UNDERLINE_DASHDOT,
- FONT_UNDERLINE_DASHDOTDOT,
- FONT_UNDERLINE_SMALLWAVE,
- FONT_UNDERLINE_WAVE,
- FONT_UNDERLINE_DOUBLEWAVE,
- FONT_UNDERLINE_BOLD,
- FONT_UNDERLINE_BOLDDOTTED,
- FONT_UNDERLINE_BOLDDASH,
- FONT_UNDERLINE_BOLDLONGDASH,
- FONT_UNDERLINE_BOLDDASHDOT,
- FONT_UNDERLINE_BOLDDASHDOTDOT,
- FONT_UNDERLINE_BOLDWAVE
- };
-
- enum FontStrikeout
- {
- FONT_STRIKEOUT_NONE,
- FONT_STRIKEOUT_SINGLE,
- FONT_STRIKEOUT_DOUBLE,
- FONT_STRIKEOUT_BOLD,
- FONT_STRIKEOUT_SLASH,
- FONT_STRIKEOUT_X
- };
-
- enum FontEmphasisMark
- {
- FONT_EMPHASISMARK_NONE,
- FONT_EMPHASISMARK_DOT,
- FONT_EMPHASISMARK_CIRCLE,
- FONT_EMPHASISMARK_DISC,
- FONT_EMPHASISMARK_ACCENT
- };
-
- enum FontRelief
- {
- FONT_RELIEF_NONE,
- FONT_RELIEF_EMBOSSED,
- FONT_RELIEF_ENGRAVED
- };
+ /** TextDecoratedPortionPrimitive2D class
+ This primitive expands the TextSimplePortionPrimitive2D by common
+ decorations used in the office. It can be decomposed and will create
+ a TextSimplePortionPrimitive2D and all the contained decorations (if used)
+ as geometry.
+ */
class TextDecoratedPortionPrimitive2D : public TextSimplePortionPrimitive2D
{
private:
+ /// decoration definitions
basegfx::BColor maOverlineColor;
basegfx::BColor maTextlineColor;
- FontUnderline meFontOverline;
- FontUnderline meFontUnderline;
- FontStrikeout meFontStrikeout;
- FontEmphasisMark meFontEmphasisMark;
- FontRelief meFontRelief;
+ TextLine meFontOverline;
+ TextLine meFontUnderline;
+ TextStrikeout meTextStrikeout;
+ TextEmphasisMark meTextEmphasisMark;
+ TextRelief meTextRelief;
- // bitfield
+ /// bitfield
unsigned mbUnderlineAbove : 1;
unsigned mbWordLineMode : 1;
unsigned mbEmphasisMarkAbove : 1;
unsigned mbEmphasisMarkBelow : 1;
unsigned mbShadow : 1;
- // helper methods
- void impCreateTextLine(
- std::vector< Primitive2DReference >& rTarget,
- basegfx::DecomposedB2DHomMatrixContainer& rDecTrans,
- const basegfx::B2DHomMatrix &rUnscaledTransform,
- FontUnderline eLineStyle,
- double fLineOffset,
- double fLineHeight,
- double fLineWidth,
- const basegfx::BColor& rLineColor) const;
-
+ /// helper methods
void impCreateGeometryContent(
std::vector< Primitive2DReference >& rTarget,
- basegfx::DecomposedB2DHomMatrixContainer& rDecTrans,
+ basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans,
const String& rText,
xub_StrLen aTextPosition,
xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray,
- const FontAttributes& rFontAttributes) const;
+ const attribute::FontAttribute& rFontAttribute) const;
void impCorrectTextBoundary(
::com::sun::star::i18n::Boundary& rNextWordBoundary) const;
void impSplitSingleWords(
std::vector< Primitive2DReference >& rTarget,
- basegfx::DecomposedB2DHomMatrixContainer& rDecTrans) const;
+ basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans) const;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
TextDecoratedPortionPrimitive2D(
- // TextSimplePortionPrimitive2D parameters
+ /// TextSimplePortionPrimitive2D parameters
const basegfx::B2DHomMatrix& rNewTransform,
const String& rText,
xub_StrLen aTextPosition,
xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray,
- const FontAttributes& rFontAttributes,
+ const attribute::FontAttribute& rFontAttribute,
const ::com::sun::star::lang::Locale& rLocale,
const basegfx::BColor& rFontColor,
- // local parameters
+ /// local parameters
const basegfx::BColor& rOverlineColor,
const basegfx::BColor& rTextlineColor,
- FontUnderline eFontOverline = FONT_UNDERLINE_NONE,
- FontUnderline eFontUnderline = FONT_UNDERLINE_NONE,
+ TextLine eFontOverline = TEXT_LINE_NONE,
+ TextLine eFontUnderline = TEXT_LINE_NONE,
bool bUnderlineAbove = false,
- FontStrikeout eFontStrikeout = FONT_STRIKEOUT_NONE,
+ TextStrikeout eTextStrikeout = TEXT_STRIKEOUT_NONE,
bool bWordLineMode = false,
- FontEmphasisMark eFontEmphasisMark = FONT_EMPHASISMARK_NONE,
+ TextEmphasisMark eTextEmphasisMark = TEXT_EMPHASISMARK_NONE,
bool bEmphasisMarkAbove = true,
bool bEmphasisMarkBelow = false,
- FontRelief eFontRelief = FONT_RELIEF_NONE,
+ TextRelief eTextRelief = TEXT_RELIEF_NONE,
bool bShadow = false);
- // get data
- FontUnderline getFontOverline() const { return meFontOverline; }
- FontUnderline getFontUnderline() const { return meFontUnderline; }
- FontStrikeout getFontStrikeout() const { return meFontStrikeout; }
- FontEmphasisMark getFontEmphasisMark() const { return meFontEmphasisMark; }
- FontRelief getFontRelief() const { return meFontRelief; }
+ /// data read access
+ TextLine getFontOverline() const { return meFontOverline; }
+ TextLine getFontUnderline() const { return meFontUnderline; }
+ TextStrikeout getTextStrikeout() const { return meTextStrikeout; }
+ TextEmphasisMark getTextEmphasisMark() const { return meTextEmphasisMark; }
+ TextRelief getTextRelief() const { return meTextRelief; }
basegfx::BColor getOverlineColor() const { return maOverlineColor; }
basegfx::BColor getTextlineColor() const { return maTextlineColor; }
-
bool getUnderlineAbove() const { return mbUnderlineAbove; }
bool getWordLineMode() const { return mbWordLineMode; }
bool getEmphasisMarkAbove() const { return mbEmphasisMarkAbove; }
bool getEmphasisMarkBelow() const { return mbEmphasisMarkBelow; }
bool getShadow() const { return mbShadow; }
- // compare operator
+ /// compare operator
virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx
index 128b1ea5a210..77b64d16ea24 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx
@@ -36,7 +36,7 @@
#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTEFFECTPRIMITIVE2D_HXX
#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTEFFECTPRIMITIVE2D_HXX
-#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -45,6 +45,7 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** TextEffectStyle2D definition */
enum TextEffectStyle2D
{
TEXTEFFECTSTYLE2D_RELIEF_EMBOSSED_DEFAULT,
@@ -54,46 +55,59 @@ namespace drawinglayer
TEXTEFFECTSTYLE2D_OUTLINE
};
- class TextEffectPrimitive2D : public GroupPrimitive2D
+ /** TextEffectPrimitive2D class
+
+ This primitive embeds text primitives (normally, as can be seen can
+ also be used for any other primitives) which have some TextEffect applied
+ and create the needed geometry and embedding on decomposition.
+ */
+ class TextEffectPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
- // the style to apply, the direction and the rotation center
+ /// the text (or other) content
+ Primitive2DSequence maTextContent;
+
+ /// the style to apply, the direction and the rotation center
const basegfx::B2DPoint maRotationCenter;
double mfDirection;
TextEffectStyle2D meTextEffectStyle2D;
- // the last used object to view transformtion used from getDecomposition
- // for decide buffering
+ /** the last used object to view transformtion used from getDecomposition
+ for decide buffering
+ */
basegfx::B2DHomMatrix maLastObjectToViewTransformation;
protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// construcor
TextEffectPrimitive2D(
- const Primitive2DSequence& rChildren,
+ const Primitive2DSequence& rTextContent,
const basegfx::B2DPoint& rRotationCenter,
double fDirection,
TextEffectStyle2D eTextEffectStyle2D);
- // get data
+ /// data read access
+ const Primitive2DSequence& getTextContent() const { return maTextContent; }
const basegfx::B2DPoint& getRotationCenter() const { return maRotationCenter; }
double getDirection() const { return mfDirection; }
TextEffectStyle2D getTextEffectStyle2D() const { return meTextEffectStyle2D; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // own get range implementation to solve more effective. Content is by definition displaced
- // by a fixed discrete unit, thus the contained geometry needs only once be asked for it's
- // own basegfx::B2DRange
+ /** own get range implementation to solve more effective. Content is by definition displaced
+ by a fixed discrete unit, thus the contained geometry needs only once be asked for it's
+ own basegfx::B2DRange
+ */
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
- // Overload standard getDecomposition call to be view-dependent here
+ /// Overload standard getDecomposition call to be view-dependent here
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textenumsprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textenumsprimitive2d.hxx
new file mode 100644
index 000000000000..b0e7dc8c241e
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textenumsprimitive2d.hxx
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: wrongspellprimitive2d.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:17 $
+ *
+ * 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_TEXTENUMSPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTENUMSPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <vcl/vclenum.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** TextLine definition
+
+ This is used for both underline and overline
+ */
+ enum TextLine
+ {
+ TEXT_LINE_NONE,
+ TEXT_LINE_SINGLE,
+ TEXT_LINE_DOUBLE,
+ TEXT_LINE_DOTTED,
+ TEXT_LINE_DASH,
+ TEXT_LINE_LONGDASH,
+ TEXT_LINE_DASHDOT,
+ TEXT_LINE_DASHDOTDOT,
+ TEXT_LINE_SMALLWAVE,
+ TEXT_LINE_WAVE,
+ TEXT_LINE_DOUBLEWAVE,
+ TEXT_LINE_BOLD,
+ TEXT_LINE_BOLDDOTTED,
+ TEXT_LINE_BOLDDASH,
+ TEXT_LINE_BOLDLONGDASH,
+ TEXT_LINE_BOLDDASHDOT,
+ TEXT_LINE_BOLDDASHDOTDOT,
+ TEXT_LINE_BOLDWAVE
+ };
+
+ /** helper to convert LineStyle */
+ TextLine mapFontUnderlineToTextLine(FontUnderline eLineStyle);
+ FontUnderline mapTextLineToFontUnderline(TextLine eLineStyle);
+
+ /** FontStrikeout definition */
+ enum TextStrikeout
+ {
+ TEXT_STRIKEOUT_NONE,
+ TEXT_STRIKEOUT_SINGLE,
+ TEXT_STRIKEOUT_DOUBLE,
+ TEXT_STRIKEOUT_BOLD,
+ TEXT_STRIKEOUT_SLASH,
+ TEXT_STRIKEOUT_X
+ };
+
+ /** helper to convert FontStrikeout */
+ TextStrikeout mapFontStrikeoutToTextStrikeout(::FontStrikeout eFontStrikeout);
+ ::FontStrikeout mapTextStrikeoutToFontStrikeout(TextStrikeout eFontStrikeout);
+
+ /** TextEmphasisMark definition */
+ enum TextEmphasisMark
+ {
+ TEXT_EMPHASISMARK_NONE,
+ TEXT_EMPHASISMARK_DOT,
+ TEXT_EMPHASISMARK_CIRCLE,
+ TEXT_EMPHASISMARK_DISC,
+ TEXT_EMPHASISMARK_ACCENT
+ };
+
+ /** TextRelief definition */
+ enum TextRelief
+ {
+ TEXT_RELIEF_NONE,
+ TEXT_RELIEF_EMBOSSED,
+ TEXT_RELIEF_ENGRAVED
+ };
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTENUMSPRIMITIVE2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx
index 1160704c0fa3..3f9c02b6e9bd 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx
@@ -45,17 +45,23 @@ namespace drawinglayer
{
namespace primitive2d
{
- // text format hierarchy helper class. It decomposes to it's
- // content, so all direct renderers may ignore it. If You need
- // to know more about line hierarchies You may react on it and
- // also need to take care that the source of data uses it.
+ /** TextHierarchyLinePrimitive2D class
+
+ Text format hierarchy helper class. It decomposes to it's
+ content, so all direct renderers may ignore it. If You need
+ to know more about line hierarchies You may react on it and
+ also need to take care that the source of data uses it.
+
+ This primitive encapsulates text lines.
+ */
class TextHierarchyLinePrimitive2D : public GroupPrimitive2D
{
private:
public:
+ /// constructor
TextHierarchyLinePrimitive2D(const Primitive2DSequence& rChildren);
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -67,14 +73,18 @@ namespace drawinglayer
{
namespace primitive2d
{
- // see TextHierarchyLinePrimitive2D comment
+ /** TextHierarchyBulletPrimitive2D class
+
+ This primitive encapsulates text bullets.
+ */
class TextHierarchyBulletPrimitive2D : public GroupPrimitive2D
{
private:
public:
+ /// constructor
TextHierarchyBulletPrimitive2D(const Primitive2DSequence& rChildren);
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -86,14 +96,18 @@ namespace drawinglayer
{
namespace primitive2d
{
- // see TextHierarchyLinePrimitive2D comment
+ /** TextHierarchyParagraphPrimitive2D class
+
+ This primitive encapsulates text paragraphs.
+ */
class TextHierarchyParagraphPrimitive2D : public GroupPrimitive2D
{
private:
public:
+ /// constructor
TextHierarchyParagraphPrimitive2D(const Primitive2DSequence& rChildren);
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -105,14 +119,18 @@ namespace drawinglayer
{
namespace primitive2d
{
- // see TextHierarchyLinePrimitive2D comment
+ /** TextHierarchyBlockPrimitive2D class
+
+ This primitive encapsulates text blocks.
+ */
class TextHierarchyBlockPrimitive2D : public GroupPrimitive2D
{
private:
public:
+ /// constructor
TextHierarchyBlockPrimitive2D(const Primitive2DSequence& rChildren);
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -124,19 +142,28 @@ namespace drawinglayer
{
namespace primitive2d
{
- // type enum
+ /** FieldType definition */
enum FieldType
{
- FIELD_TYPE_COMMON, // unspecified. If more info is needed for a FieldType,
- // create a new type and it's handling
- FIELD_TYPE_PAGE, // uses "FIELD_SEQ_BEGIN;PageField" -> special handling
- FIELD_TYPE_URL // uses URL as string -> special handling
+ /** unspecified. If more info is needed for a FieldType,
+ create a new type and it's handling
+ */
+ FIELD_TYPE_COMMON,
+
+ /** uses "FIELD_SEQ_BEGIN;PageField" -> special handling */
+ FIELD_TYPE_PAGE,
+
+ /** uses URL as string -> special handling */
+ FIELD_TYPE_URL
};
- // see TextHierarchyLinePrimitive2D comment.
- // Also: This type uses a type enum to transport the encapsulated field
- // type. Also added is a String which is type-dependent. E.g. for URL
- // fields, it contains the URL.
+ /** TextHierarchyFieldPrimitive2D class
+
+ This primitive encapsulates text fields.
+ Also: This type uses a type enum to transport the encapsulated field
+ type. Also added is a String which is type-dependent. E.g. for URL
+ fields, it contains the URL.
+ */
class TextHierarchyFieldPrimitive2D : public GroupPrimitive2D
{
private:
@@ -144,19 +171,20 @@ namespace drawinglayer
rtl::OUString maString;
public:
+ /// constructor
TextHierarchyFieldPrimitive2D(
const Primitive2DSequence& rChildren,
const FieldType& rFieldType,
const rtl::OUString& rString);
- // get data
+ /// data read access
FieldType getType() const { return meType; }
const rtl::OUString& getString() const { return maString; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -168,20 +196,24 @@ namespace drawinglayer
{
namespace primitive2d
{
- // #i97628#
- // Primitive to encapsulate text from an active text edit; some
- // renderers need to suppress this output due to painting the
- // edited text in e.g. an OutlinerEditView. It's derived from
- // GroupPrimitive2D, so the implicit decomposition will use the
- // content. To suppress, this primitive needs to be parsed by
- // the renderer without taking any action
+ /** TextHierarchyEditPrimitive2D class
+
+ #i97628#
+ Primitive to encapsulate text from an active text edit; some
+ renderers need to suppress this output due to painting the
+ edited text in e.g. an OutlinerEditView. It's derived from
+ GroupPrimitive2D, so the implicit decomposition will use the
+ content. To suppress, this primitive needs to be parsed by
+ the renderer without taking any action.
+ */
class TextHierarchyEditPrimitive2D : public GroupPrimitive2D
{
private:
public:
+ /// constructor
TextHierarchyEditPrimitive2D(const Primitive2DSequence& rChildren);
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx
index df09718a7582..f3de43c22fd7 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx
@@ -49,9 +49,10 @@ class VirtualDevice;
class Font;
class String;
class OutputDevice;
+class GDIMetaFile;
-namespace drawinglayer { namespace primitive2d {
- class FontAttributes;
+namespace drawinglayer { namespace attribute {
+ class FontAttribute;
}}
namespace basegfx {
@@ -66,18 +67,27 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** TextLayouterDevice class
+
+ This helper class exists to isolate all accesses to VCL
+ text formatting/handling functionality for primitive implementations.
+ When in the future FontHandling may move to an own library independent
+ from VCL, primitives will be prepared.
+ */
class TextLayouterDevice
{
- // internally used VirtualDevice
+ /// internally used VirtualDevice
VirtualDevice& mrDevice;
public:
+ /// constructor/destructor
TextLayouterDevice();
~TextLayouterDevice();
+ /// tooling methods
void setFont(const Font& rFont);
- void setFontAttributes(
- const FontAttributes& rFontAttributes,
+ void setFontAttribute(
+ const attribute::FontAttribute& rFontAttribute,
double fFontScaleX,
double fFontScaleY,
const ::com::sun::star::lang::Locale & rLocale);
@@ -105,6 +115,15 @@ namespace drawinglayer
const String& rText,
xub_StrLen nIndex,
xub_StrLen nLength) const;
+
+ double getFontAscent() const;
+ double getFontDescent() const;
+
+ void addTextRectActions(
+ const Rectangle& rRectangle,
+ const String& rText,
+ sal_uInt16 nStyle,
+ GDIMetaFile& rGDIMetaFile);
};
} // end of namespace primitive2d
} // end of namespace drawinglayer
@@ -116,23 +135,25 @@ namespace drawinglayer
{
namespace primitive2d
{
- // Create a VCL-Font based on the definitions in FontAttributes
- // and the given FontScaling. The FontScaling defines the FontHeight
- // (fFontScaleY) and the FontWidth (fFontScaleX). The combination of
- // both defines FontStretching, where no stretching happens at
- // fFontScaleY == fFontScaleX
- Font getVclFontFromFontAttributes(
- const FontAttributes& rFontAttributes,
+ /** Create a VCL-Font based on the definitions in FontAttribute
+ and the given FontScaling. The FontScaling defines the FontHeight
+ (fFontScaleY) and the FontWidth (fFontScaleX). The combination of
+ both defines FontStretching, where no stretching happens at
+ fFontScaleY == fFontScaleX
+ */
+ Font getVclFontFromFontAttribute(
+ const attribute::FontAttribute& rFontAttribute,
double fFontScaleX,
double fFontScaleY,
double fFontRotation,
const ::com::sun::star::lang::Locale & rLocale);
- // Generate FontAttributes DataSet derived from the given VCL-Font.
- // The FontScaling with fFontScaleY, fFontScaleX relationship (see
- // above) will be set in return parameter o_rSize to allow further
- // processing
- FontAttributes getFontAttributesFromVclFont(
+ /** Generate FontAttribute DataSet derived from the given VCL-Font.
+ The FontScaling with fFontScaleY, fFontScaleX relationship (see
+ above) will be set in return parameter o_rSize to allow further
+ processing
+ */
+ attribute::FontAttribute getFontAttributeFromVclFont(
basegfx::B2DVector& o_rSize,
const Font& rFont,
bool bRTL,
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textlineprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textlineprimitive2d.hxx
new file mode 100644
index 000000000000..a103d607e85f
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textlineprimitive2d.hxx
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: textdecoratedprimitive2d.hxx,v $
+ *
+ * $Revision: 1.6 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:17 $
+ *
+ * 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_TEXTLINEPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTLINEPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textenumsprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/color/bcolor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class TextLinePrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// geometric definitions
+ basegfx::B2DHomMatrix maObjectTransformation;
+ double mfWidth;
+ double mfOffset;
+ double mfHeight;
+
+ /// decoration definitions
+ TextLine meTextLine;
+ basegfx::BColor maLineColor;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ TextLinePrimitive2D(
+ const basegfx::B2DHomMatrix& rObjectTransformation,
+ double fWidth,
+ double fOffset,
+ double fHeight,
+ TextLine eTextLine,
+ const basegfx::BColor& rLineColor);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
+ double getWidth() const { return mfWidth; }
+ double getOffset() const { return mfOffset; }
+ double getHeight() const { return mfHeight; }
+ TextLine getTextLine() const { return meTextLine; }
+ const basegfx::BColor& getLineColor() const { return maLineColor; }
+
+ /// compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTLINEPRIMITIVE2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
index d7f9bdb1e89a..bbcd8e335e23 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
@@ -43,6 +43,7 @@
#include <basegfx/color/bcolor.hxx>
#include <vector>
#include <com/sun/star/lang/Locale.hpp>
+#include <drawinglayer/attribute/fontattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -60,123 +61,91 @@ namespace drawinglayer
{
namespace primitive2d
{
- class FontAttributes
+ /** TextSimplePortionPrimitive2D class
+
+ This is the basic primitive for representing a text portion. It contains
+ all needed information. If it is not handled by a renderer, it's decomposition
+ will provide the text PolyPolygon outlines as filled polygons, correctly
+ transformed.
+
+ To get better text quality, it is suggested to handle tis primitive directly
+ in a renderer. In that case, e.g. hintings on the system can be supported.
+ */
+ class TextSimplePortionPrimitive2D : public BufferedDecompositionPrimitive2D
{
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
+ /// text range transformation from unit range ([0.0 .. 1.0]) to text range
+ basegfx::B2DHomMatrix maTextTransform;
- public:
- FontAttributes(
- const String& rFamilyName,
- const String& rStyleName,
- sal_uInt16 nWeight,
- bool bSymbol = false,
- bool bVertical = false,
- 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)
- {
- }
-
- // compare operator
- bool operator==(const FontAttributes& rCompare) const;
-
- // data 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; }
- };
- } // end of namespace primitive2d
-} // end of namespace drawinglayer
+ /// The text, used from maTextPosition up to maTextPosition + maTextLength
+ String maText;
-//////////////////////////////////////////////////////////////////////////////
+ /// The index from where on maText is used
+ xub_StrLen maTextPosition;
-namespace drawinglayer
-{
- namespace primitive2d
- {
- class TextSimplePortionPrimitive2D : public BasePrimitive2D
- {
- private:
- basegfx::B2DHomMatrix maTextTransform; // text range transformation from unit range ([0.0 .. 1.0]) to text range
- String maText; // the text, used from maTextPosition up to maTextPosition + maTextLength
- xub_StrLen maTextPosition; // the index from where on maText is used
- xub_StrLen maTextLength; // the length for maText usage, starting from maTextPosition
- ::std::vector< double > maDXArray; // the DX array scale-independent in unit coordinates
- FontAttributes maFontAttributes; // the font to use
- ::com::sun::star::lang::Locale maLocale; // the Locale for the text
- basegfx::BColor maFontColor; // font color
-
- // #i96669# add simple range buffering for this primitive
+ /// The length for maText usage, starting from maTextPosition
+ xub_StrLen maTextLength;
+
+ /// The DX array scale-independent in unit coordinates
+ ::std::vector< double > maDXArray;
+
+ /// The font to use
+ attribute::FontAttribute maFontAttribute;
+
+ /// The Locale for the text
+ ::com::sun::star::lang::Locale maLocale;
+
+ /// font color
+ basegfx::BColor maFontColor;
+
+ /// #i96669# add simple range buffering for this primitive
basegfx::B2DRange maB2DRange;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
TextSimplePortionPrimitive2D(
const basegfx::B2DHomMatrix& rNewTransform,
const String& rText,
xub_StrLen aTextPosition,
xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray,
- const FontAttributes& rFontAttributes,
+ const attribute::FontAttribute& rFontAttribute,
const ::com::sun::star::lang::Locale& rLocale,
const basegfx::BColor& rFontColor);
- // helpers
- // get text outlines as polygons and their according ObjectTransformation. Handles all
- // the necessary VCL outline extractins, scaling adaptions and other stuff.
+ /// helpers
+ /** get text outlines as polygons and their according ObjectTransformation. Handles all
+ the necessary VCL outline extractins, scaling adaptions and other stuff.
+ */
void getTextOutlinesAndTransformation(basegfx::B2DPolyPolygonVector& rTarget, basegfx::B2DHomMatrix& rTransformation) const;
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getTextTransform() const { return maTextTransform; }
const String& getText() const { return maText; }
xub_StrLen getTextPosition() const { return maTextPosition; }
xub_StrLen getTextLength() const { return maTextLength; }
const ::std::vector< double >& getDXArray() const { return maDXArray; }
- const FontAttributes& getFontAttributes() const { return maFontAttributes; }
+ const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; }
const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; }
const basegfx::BColor& getFontColor() const { return maFontColor; }
- // compare operator
+ /// compare operator
virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
+
+ /// small helper to have a compare operator for Locale
+ bool LocalesAreEqual(const ::com::sun::star::lang::Locale& rA, const ::com::sun::star::lang::Locale& rB);
+
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx
new file mode 100644
index 000000000000..34d7d31fb93a
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx
@@ -0,0 +1,167 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: textdecoratedprimitive2d.hxx,v $
+ *
+ * $Revision: 1.6 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:17 $
+ *
+ * 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_TEXTSTRIKEOUTPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textenumsprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <drawinglayer/attribute/fontattribute.hxx>
+#include <com/sun/star/lang/Locale.hpp>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class BaseTextStrikeoutPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// geometric definitions
+ basegfx::B2DHomMatrix maObjectTransformation;
+ double mfWidth;
+
+ /// decoration definitions
+ basegfx::BColor maFontColor;
+
+ public:
+ /// constructor
+ BaseTextStrikeoutPrimitive2D(
+ const basegfx::B2DHomMatrix& rObjectTransformation,
+ double fWidth,
+ const basegfx::BColor& rFontColor);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
+ double getWidth() const { return mfWidth; }
+ const basegfx::BColor& getFontColor() const { return maFontColor; }
+
+ /// compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class TextCharacterStrikeoutPrimitive2D : public BaseTextStrikeoutPrimitive2D
+ {
+ private:
+ sal_Unicode maStrikeoutChar;
+ attribute::FontAttribute maFontAttribute;
+ ::com::sun::star::lang::Locale maLocale;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ TextCharacterStrikeoutPrimitive2D(
+ const basegfx::B2DHomMatrix& rObjectTransformation,
+ double fWidth,
+ const basegfx::BColor& rFontColor,
+ sal_Unicode aStrikeoutChar,
+ const attribute::FontAttribute& rFontAttribute,
+ const ::com::sun::star::lang::Locale& rLocale);
+
+ /// data read access
+ sal_Unicode getStrikeoutChar() const { return maStrikeoutChar; }
+ const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; }
+ const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; }
+
+ /// compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class TextGeometryStrikeoutPrimitive2D : public BaseTextStrikeoutPrimitive2D
+ {
+ private:
+ double mfHeight;
+ double mfOffset;
+ TextStrikeout meTextStrikeout;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ TextGeometryStrikeoutPrimitive2D(
+ const basegfx::B2DHomMatrix& rObjectTransformation,
+ double fWidth,
+ const basegfx::BColor& rFontColor,
+ double fHeight,
+ double fOffset,
+ TextStrikeout eTextStrikeout);
+
+ /// data read access
+ double getHeight() const { return mfHeight; }
+ double getOffset() const { return mfOffset; }
+ TextStrikeout getTextStrikeout() const { return meTextStrikeout; }
+
+ /// compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx
index 1646667342af..1723cc708ea8 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx
@@ -45,26 +45,47 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** TransformPrimitive2D class
+
+ This is one of the basic grouping primitives and it provides
+ embedding a sequence of primitives (a geometry) into a
+ transformation. All renderers have to handle this, usually by
+ building a current transformation stack (linear combination)
+ and applying this to all to-be-rendered geometry. If not handling
+ this, the output will be mostly wrong since this primitive is
+ widely used.
+
+ It does transform by embedding an existing geometry into a
+ transformation as Child-content. This allows re-usage of the
+ refcounted Uno-Api primitives and their existung, buffered
+ decompositions.
+
+ It could e.g. be used to show a single object geometry in 1000
+ different, transformed states without the need to create those
+ thousand primitive contents.
+ */
class TransformPrimitive2D : public GroupPrimitive2D
{
private:
+ // the transformation to apply to the child geometry
basegfx::B2DHomMatrix maTransformation;
public:
+ /// constructor
TransformPrimitive2D(
const basegfx::B2DHomMatrix& rTransformation,
const Primitive2DSequence& rChildren);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx
index 44f3f738b67e..6e8970e7bee5 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx
@@ -44,27 +44,37 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** UnifiedAlphaPrimitive2D class
+
+ This primitive encapsualtes a child hierarchy and defines
+ that it shall be visualized with the given transparency. That
+ transparency is unique for all contained geometry, so that
+ e.g. overlapping polygons in the child geometry will not show
+ regions of combined transparency, but be all rendered with the
+ defined, single transparency.
+ */
class UnifiedAlphaPrimitive2D : public GroupPrimitive2D
{
private:
- double mfAlpha; // unified transparence
-
- protected:
- // create decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// the unified alpha transparence
+ double mfAlpha;
public:
+ /// constructor
UnifiedAlphaPrimitive2D(
const Primitive2DSequence& rChildren,
double fAlpha);
- // get data
+ /// data read access
double getAlpha() const { return mfAlpha; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// create decomposition
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/wallpaperprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/wallpaperprimitive2d.hxx
new file mode 100644
index 000000000000..ffe47cfe1b72
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/wallpaperprimitive2d.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: bitmapprimitive2d.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_PRIMITIVE2D_WALLPAPERPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WALLPAPERPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/primitivetools2d.hxx>
+#include <vcl/bitmapex.hxx>
+#include <vcl/wall.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** WallpaperBitmapPrimitive2D class
+
+ This is a specialized primtive for the Wallpaper definitions included in
+ VCL and Metafiles. The extraordinary about the bitmap definition part of
+ the Wallpaper is that it uses PIXEL size of the given Bitmap and not
+ the logic and/or discrete size derived by PrefMapMode/PrefSize methods.
+ To emulate this, a ViewTransformation dependent primitive is needed which
+ takes over the correct scaling(s).
+
+ Since a specialized primitive is needed anyways, i opted to also add the
+ layouting which is dependent from WallpaperStyle; thus it does not need
+ to be handled anywhere else in the future.
+ */
+ class WallpaperBitmapPrimitive2D : public ViewTransformationDependentPrimitive2D
+ {
+ private:
+ basegfx::B2DRange maObjectRange;
+ BitmapEx maBitmapEx;
+ WallpaperStyle meWallpaperStyle;
+
+ protected:
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ WallpaperBitmapPrimitive2D(
+ const basegfx::B2DRange& rObjectRange,
+ const BitmapEx& rBitmapEx,
+ WallpaperStyle eWallpaperStyle);
+
+ /// data read access
+ const basegfx::B2DRange& getLocalObjectRange() const { return maObjectRange; }
+ const BitmapEx& getBitmapEx() const { return maBitmapEx ; }
+ WallpaperStyle getWallpaperStyle() const { return meWallpaperStyle; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get B2Drange
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WALLPAPERPRIMITIVE2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx
index 8bd739298059..3ceae01ed3b2 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx
@@ -47,35 +47,53 @@ namespace drawinglayer
{
namespace primitive2d
{
- class WrongSpellPrimitive2D : public BasePrimitive2D
+ /** WrongSpellPrimitive2D class
+
+ This is a helper primitive to hold evtl. WrongSpell visualisations
+ in the sequence of primitives. The primitive holds this information
+ separated form the TextPortions to where it belongs to tot expand the
+ TextSimplePortionPrimitive2D more as needed.
+
+ A renderer who does not want to visualize this (if contained at all)
+ can detect and ignore this primitive. If it's decomposition is used,
+ it will be visualized as red wavelines.
+
+ The geometric definition defines a line on the X-Axis (no Y-coordinates)
+ which will when transformed by Transformation, create the coordinate data.
+ */
+ class WrongSpellPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// geometry definition
basegfx::B2DHomMatrix maTransformation;
double mfStart;
double mfStop;
+
+ /// color (usually red)
basegfx::BColor maColor;
protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
WrongSpellPrimitive2D(
const basegfx::B2DHomMatrix& rTransformation,
double fStart,
double fStop,
const basegfx::BColor& rColor);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
double getStart() const { return mfStart; }
double getStop() const { return mfStop; }
const basegfx::BColor& getColor() const { return maColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx
index faeac28b0c0c..9bf56edb2c53 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx
@@ -43,16 +43,17 @@
#include <basegfx/range/b3drange.hxx>
//////////////////////////////////////////////////////////////////////////////
-// defines for DeclPrimitrive3DIDBlock and ImplPrimitrive3DIDBlock
-// Added to be able to simply change identification stuff later, e.g. add
-// a identification string and/or ID to the interface and to the implementation
-// ATM used to delclare implement getPrimitiveID()
+/** defines for DeclPrimitrive3DIDBlock and ImplPrimitrive3DIDBlock
+ Added to be able to simply change identification stuff later, e.g. add
+ a identification string and/or ID to the interface and to the implementation
+ ATM used to delclare implement getPrimitive3DID()
+ */
#define DeclPrimitrive3DIDBlock() \
- virtual sal_uInt32 getPrimitiveID() const;
+ virtual sal_uInt32 getPrimitive3DID() const;
#define ImplPrimitrive3DIDBlock(TheClass, TheID) \
- sal_uInt32 TheClass::getPrimitiveID() const { return TheID; }
+ sal_uInt32 TheClass::getPrimitive3DID() const { return TheID; }
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -61,6 +62,13 @@ namespace drawinglayer { namespace geometry {
class ViewInformation3D;
}}
+namespace drawinglayer { namespace primitive3d {
+ /// typedefs for basePrimitive3DImplBase, Primitive3DSequence and Primitive3DReference
+ typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitive3D > BasePrimitive3DImplBase;
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive3D > Primitive3DReference;
+ typedef ::com::sun::star::uno::Sequence< Primitive3DReference > Primitive3DSequence;
+}}
+
//////////////////////////////////////////////////////////////////////////////
// basePrimitive3D class
@@ -68,99 +76,145 @@ namespace drawinglayer
{
namespace primitive3d
{
- // typedefs for basePrimitive3DImplBase, Primitive3DSequence and Primitive3DReference
- typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitive3D > BasePrimitive3DImplBase;
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive3D > Primitive3DReference;
- typedef ::com::sun::star::uno::Sequence< Primitive3DReference > Primitive3DSequence;
+ /** BasePrimitive3D class
+
+ Baseclass for all C++ implementations of com::sun::star::graphic::XPrimitive2D
+
+ The description/functionality is identical with the 2D case in baseprimitive2d.hxx,
+ please see there for detailed information.
+ Current Basic 3D Primitives are:
+
+ - PolygonHairlinePrimitive3D (for 3D hairlines)
+ - PolyPolygonMaterialPrimitive3D (for 3D filled plane polygons)
+
+ That's all for 3D!
+ */
class BasePrimitive3D
: private boost::noncopyable,
protected comphelper::OBaseMutex,
public BasePrimitive3DImplBase
{
private:
- // a sequence used for buffering the last createLocalDecomposition() result. Use
- // the protected access methods to change. Only implementations of getDecomposition()
- // should make use.
- Primitive3DSequence maLocalDecomposition;
-
protected:
- // access methods to maLocalDecomposition. The usage of this methods may allow
- // later thread-safe stuff to be added if needed. Only to be used by getDecomposition()
- // implementations for buffering the last decomposition.
- const Primitive3DSequence& getLocalDecomposition() const { return maLocalDecomposition; }
- void setLocalDecomposition(const Primitive3DSequence& rNew) { maLocalDecomposition = rNew; }
-
- // method which is to be used to implement the local decomposition of a 2D primitive. The default
- // implementation will just return an empty decomposition
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
-
public:
- // constructor
+ // constructor/destructor
BasePrimitive3D();
+ virtual ~BasePrimitive3D();
- // the ==operator is mainly needed to allow testing newly-created high level primitives against their last
- // incarnation which buffers/holds the decompositionsThe default implementation
- // uses getPrimitiveID()-calls to test if it's the same ID at last. Overloaded implementation are then
- // based on this implementation
+ /** the ==operator is mainly needed to allow testing newly-created high level primitives against their last
+ incarnation which buffers/holds the decompositionsThe default implementation
+ uses getPrimitive3DID()-calls to test if it's the same ID at last. Overloaded implementation are then
+ based on this implementation.
+ */
virtual bool operator==( const BasePrimitive3D& rPrimitive ) const;
bool operator!=( const BasePrimitive3D& rPrimitive ) const { return !operator==(rPrimitive); }
- // This method is for places where using the C++ implementation directly is possible. The subprocessing
- // and range merging is more efficient when working directly on basegfx::B3DRange. The default implementation
- // will use getDecomposition results to create the range
+ /** This method is for places where using the C++ implementation directly is possible. The subprocessing
+ and range merging is more efficient when working directly on basegfx::B3DRange. The default implementation
+ will use getDecomposition results to create the range
+ */
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID for fast identifying of known primitive implementations in renderers. These use
- // the the defines from primitivetypes3d.hxx to define unique IDs.
- virtual sal_uInt32 getPrimitiveID() const = 0;
+ /** provide unique ID for fast identifying of known primitive implementations in renderers. These use
+ the the defines from primitivetypes3d.hxx to define unique IDs.
+ */
+ virtual sal_uInt32 getPrimitive3DID() const = 0;
- // The getDecomposition default implementation will on demand use createLocalDecomposition() if maLocalDecomposition is empty.
- // It will set maLocalDecomposition to this obtained decomposition to buffer it.
- // If the decomposition is also ViewInformation-dependent, this method needs to be overloaded and the
- // ViewInformation for the last decomposition needs to be remembered, too, and be used in the next call to decide if
- // the buffered decomposition may be reused or not.
+ /// The default implementation returns an empty sequence
virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
//
// Methods from XPrimitive3D
//
- // The getDecomposition implementation for UNO API will use getDecomposition from this implementation. It
- // will get the ViewInformation from the ViewParameters for that purpose
+ /** The getDecomposition implementation for UNO API will use getDecomposition from this implementation. It
+ will get the ViewInformation from the ViewParameters for that purpose
+ */
virtual Primitive3DSequence SAL_CALL getDecomposition( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters ) throw ( ::com::sun::star::uno::RuntimeException );
- // the getRange default implemenation will use getDecomposition to create the range information from merging
- // getRange results from the single local decomposition primitives.
+ /** the getRange default implemenation will use getDecomposition to create the range information from merging
+ getRange results from the single local decomposition primitives.
+ */
virtual ::com::sun::star::geometry::RealRectangle3D SAL_CALL getRange( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters ) throw ( ::com::sun::star::uno::RuntimeException );
};
} // end of namespace primitive3d
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
+// BufferedDecompositionPrimitive3D class
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** BufferedDecompositionPrimitive3D class
+
+ Baseclass for all C++ implementations of com::sun::star::graphic::XPrimitive2D
+
+ The description/functionality is identical with the 2D case in baseprimitive2d.hxx,
+ please see there for detailed information
+ */
+ class BufferedDecompositionPrimitive3D
+ : public BasePrimitive3D
+ {
+ private:
+ /// a sequence used for buffering the last create3DDecomposition() result
+ Primitive3DSequence maBuffered3DDecomposition;
+
+ protected:
+ /** access methods to maBuffered3DDecomposition. The usage of this methods may allow
+ later thread-safe stuff to be added if needed. Only to be used by getDecomposition()
+ implementations for buffering the last decomposition.
+ */
+ const Primitive3DSequence& getBuffered3DDecomposition() const { return maBuffered3DDecomposition; }
+ void setBuffered3DDecomposition(const Primitive3DSequence& rNew) { maBuffered3DDecomposition = rNew; }
+
+ /** method which is to be used to implement the local decomposition of a 2D primitive. The default
+ implementation will just return an empty decomposition
+ */
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ public:
+ // constructor
+ BufferedDecompositionPrimitive3D();
+
+ /** The getDecomposition default implementation will on demand use create3DDecomposition() if
+ maBuffered3DDecomposition is empty. It will set maBuffered3DDecomposition to this obtained decomposition
+ to buffer it. If the decomposition is also ViewInformation-dependent, this method needs to be
+ overloaded and the ViewInformation for the last decomposition needs to be remembered, too, and
+ be used in the next call to decide if the buffered decomposition may be reused or not.
+ */
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
// tooling
namespace drawinglayer
{
namespace primitive3d
{
- // get B3DRange from a given Primitive3DReference
+ /// get B3DRange from a given Primitive3DReference
basegfx::B3DRange getB3DRangeFromPrimitive3DReference(const Primitive3DReference& rCandidate, const geometry::ViewInformation3D& aViewInformation);
- // get range3D from a given Primitive3DSequence
+ /// get range3D from a given Primitive3DSequence
basegfx::B3DRange getB3DRangeFromPrimitive3DSequence(const Primitive3DSequence& rCandidate, const geometry::ViewInformation3D& aViewInformation);
- // compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D)
- // and using compare operator
+ /** compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D)
+ and using compare operator
+ */
bool arePrimitive3DReferencesEqual(const Primitive3DReference& rA, const Primitive3DReference& rB);
- // compare two Primitive3DReferences for equality, uses arePrimitive3DReferencesEqual internally
+ /// compare two Primitive3DReferences for equality, uses arePrimitive3DReferencesEqual internally
bool arePrimitive3DSequencesEqual(const Primitive3DSequence& rA, const Primitive3DSequence& rB);
- // concatenate sequence
+ /// concatenate sequence
void appendPrimitive3DSequenceToPrimitive3DSequence(Primitive3DSequence& rDest, const Primitive3DSequence& rSource);
- // concatenate single Primitive3D
+ /// concatenate single Primitive3D
void appendPrimitive3DReferenceToPrimitive3DSequence(Primitive3DSequence& rDest, const Primitive3DReference& rSource);
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx
index 029b4c664fe2..69e406c75d67 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx
@@ -44,27 +44,45 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** GroupPrimitive3D class
+
+ Baseclass for all grouping 3D primitives
+
+ The description/functionality is identical with the 2D case in groupprimitive2d.hxx,
+ please see there for detailed information.
+
+ Current Basic 3D StatePrimitives are:
+
+ - ModifiedColorPrimitive3D (for a stack of color modifications)
+ - ShadowPrimitive3D (for 3D objects with shadow; this is a special case
+ since the shadow of a 3D primitive is a 2D primitive set)
+ - TexturePrimitive3D (with the following variations)
+ - GradientTexturePrimitive3D (for 3D gradient fill)
+ - BitmapTexturePrimitive3D (for 3D Bitmap fill)
+ - AlphaTexturePrimitive3D (for 3D transparence)
+ - HatchTexturePrimitive3D (for 3D hatch fill)
+ - TransformPrimitive3D (for a transformation stack)
+ */
class GroupPrimitive3D : public BasePrimitive3D
{
private:
- // the children. Declared private since this shall never be changed at all after construction
+ /// the children. Declared private since this shall never be changed at all after construction
Primitive3DSequence maChildren;
- protected:
- // local decomposition. Implementation will just return children
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
-
public:
- // constructor
+ /// constructor
GroupPrimitive3D(const Primitive3DSequence& rChildren);
- // data access
+ /// data read access
Primitive3DSequence getChildren() const { return maChildren; }
- // compare operator
+ /// compare operator
virtual bool operator==( const BasePrimitive3D& rPrimitive ) const;
- // provide unique ID
+ /// local decomposition. Implementation will just return children
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx
index c1feccaaa10c..2675a1284779 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx
@@ -44,16 +44,32 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** HatchTexturePrimitive3D class
+
+ HatchTexturePrimitive3D is derived from GroupPrimitive3D, but implements
+ a decomposition which is complicated enough for buffering. Since the group
+ primitive has no default buffering, it is necessary here to add a local
+ buffering mechanism for the decomposition
+ */
class HatchTexturePrimitive3D : public TexturePrimitive3D
{
private:
+ /// the hatch definition
attribute::FillHatchAttribute maHatch;
+ /// the buffered decomposed hatch
+ Primitive3DSequence maBuffered3DDecomposition;
+
protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ /// helper: local decomposition
+ Primitive3DSequence impCreate3DDecomposition() const;
+
+ /// local access methods to maBufferedDecomposition
+ const Primitive3DSequence& getBuffered3DDecomposition() const { return maBuffered3DDecomposition; }
+ void setBuffered3DDecomposition(const Primitive3DSequence& rNew) { maBuffered3DDecomposition = rNew; }
public:
+ /// constructor
HatchTexturePrimitive3D(
const attribute::FillHatchAttribute& rHatch,
const Primitive3DSequence& rChildren,
@@ -61,13 +77,16 @@ namespace drawinglayer
bool bModulate,
bool bFilter);
- // get data
+ /// data read access
const attribute::FillHatchAttribute& getHatch() const { return maHatch; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // provide unique ID
+ /// local decomposition.
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx
index 28029f223b1b..4779241033b0 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx
@@ -44,32 +44,37 @@ namespace drawinglayer
{
namespace primitive3d
{
- // 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.
+ /** 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
{
- protected:
- // local decomposition. Implementation will return empty Primitive3DSequence
- // since this is no visualisation data
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
-
public:
+ /// constructor
HitTestPrimitive3D(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 invisible replacement geometry, so
+ the local implementation will return the children's range
+ */
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID
+ /** local decomposition. Implementation will return empty Primitive3DSequence
+ since this is no visualisation data
+ */
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx
index 0771e8117fc5..3840bf71a397 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx
@@ -45,23 +45,32 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** ModifiedColorPrimitive3D class
+
+ This primitive is a grouping primitive and allows to define
+ how the colors of it's child content shall be modified for
+ visualisation. Please see the ModifiedColorPrimitive2D
+ description for more info.
+ */
class ModifiedColorPrimitive3D : public GroupPrimitive3D
{
private:
+ /// The ColorModifier to use
basegfx::BColorModifier maColorModifier;
public:
+ /// constructor
ModifiedColorPrimitive3D(
const Primitive3DSequence& rChildren,
const basegfx::BColorModifier& rColorModifier);
- // get data
+ /// data read access
const basegfx::BColorModifier& getColorModifier() const { return maColorModifier; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx
index 9de2dc5949e7..c73850e4f794 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx
@@ -48,28 +48,40 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** PolygonHairlinePrimitive3D class
+
+ This primitive defines a Hairline in 3D. Since hairlines are view-dependent,
+ this primitive is view-dependent, too.
+
+ This is one of the non-decomposable 3D primitives, so a renderer
+ should proccess it.
+ */
class PolygonHairlinePrimitive3D : public BasePrimitive3D
{
private:
+ /// the hairline geometry
basegfx::B3DPolygon maPolygon;
+
+ /// the hairline color
basegfx::BColor maBColor;
public:
+ /// constructor
PolygonHairlinePrimitive3D(
const basegfx::B3DPolygon& rPolygon,
const basegfx::BColor& rBColor);
- // get data
+ /// data read access
const basegfx::B3DPolygon& getB3DPolygon() const { return maPolygon; }
const basegfx::BColor& getBColor() const { return maBColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
@@ -81,36 +93,49 @@ namespace drawinglayer
{
namespace primitive3d
{
- class PolygonStrokePrimitive3D : public BasePrimitive3D
+ /** PolygonStrokePrimitive3D class
+
+ This primitive defines a 3D line with line width, line join, line color
+ and stroke attributes. It will be decomposed dependent on the definition
+ to the needed primitives, e.g. filled Tubes for fat lines.
+ */
+ class PolygonStrokePrimitive3D : public BufferedDecompositionPrimitive3D
{
private:
+ /// the line geometry
basegfx::B3DPolygon maPolygon;
+
+ /// the line attributes like width, join and color
attribute::LineAttribute maLineAttribute;
+
+ /// the line stroking (if used)
attribute::StrokeAttribute maStrokeAttribute;
protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
public:
+ /// constructor
PolygonStrokePrimitive3D(
const basegfx::B3DPolygon& rPolygon,
const attribute::LineAttribute& rLineAttribute,
const attribute::StrokeAttribute& rStrokeAttribute);
+ /// constructor without stroking
PolygonStrokePrimitive3D(
const basegfx::B3DPolygon& rPolygon,
const attribute::LineAttribute& rLineAttribute);
- // get data
+ /// data read access
basegfx::B3DPolygon getB3DPolygon() const { return maPolygon; }
const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; }
const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx
index 8a9b293a8c5e..f5d45f7c1639 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx
@@ -52,19 +52,38 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** PolygonStrokePrimitive3D class
+
+ This 3D primitive extends a 3D hairline to a 3D tube which is
+ e.g. used for fat lines in 3D. It's decomposition will create all
+ 3D objects needed for the line tubes and the edge roundings
+ in full 3D.
+ */
class PolygonTubePrimitive3D : public PolygonHairlinePrimitive3D
{
private:
+ /// hold the last decompositon since it's expensive
+ Primitive3DSequence maLast3DDecomposition;
+
+ /// visualisation parameters
double mfRadius;
double mfDegreeStepWidth;
double mfMiterMinimumAngle;
basegfx::B2DLineJoin maLineJoin;
protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ /** access methods to maLast3DDecomposition. The usage of this methods may allow
+ later thread-safe stuff to be added if needed. Only to be used by getDecomposition()
+ implementations for buffering the last decomposition.
+ */
+ const Primitive3DSequence& getLast3DDecomposition() const { return maLast3DDecomposition; }
+ void setLast3DDecomposition(const Primitive3DSequence& rNew) { maLast3DDecomposition = rNew; }
+
+ /// local decomposition.
+ Primitive3DSequence impCreate3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
public:
+ /// constructor
PolygonTubePrimitive3D(
const basegfx::B3DPolygon& rPolygon,
const basegfx::BColor& rBColor,
@@ -72,16 +91,21 @@ namespace drawinglayer
double fDegreeStepWidth = 10.0 * F_PI180,
double fMiterMinimumAngle = 15.0 * F_PI180);
- // get data
+ /// data read access
double getRadius() const { return mfRadius; }
double getDegreeStepWidth() const { return mfDegreeStepWidth; }
double getMiterMinimumAngle() const { return mfMiterMinimumAngle; }
basegfx::B2DLineJoin getLineJoin() const { return maLineJoin; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // provide unique ID
+ /** local decomposition. Use own buffering since we are not derived from
+ BufferedDecompositionPrimitive3D
+ */
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx
index 1c5b9e400bbb..091e8181e38f 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx
@@ -46,33 +46,45 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** PolyPolygonMaterialPrimitive3D class
+
+ This primitive defines a planar 3D PolyPolygon filled with a single color.
+ This is one of the non-decomposable primitives, so a renderer
+ should proccess it.
+
+ It is assumed here that the PolyPolgon is a single plane in 3D.
+ */
class PolyPolygonMaterialPrimitive3D : public BasePrimitive3D
{
private:
+ /// the PolyPolygon geometry
basegfx::B3DPolyPolygon maPolyPolygon;
+
+ /// the fill parameters
attribute::MaterialAttribute3D maMaterial;
- // bitfield
+ /// bitfield
unsigned mbDoubleSided : 1;
public:
+ /// constructor
PolyPolygonMaterialPrimitive3D(
const basegfx::B3DPolyPolygon& rPolyPolygon,
const attribute::MaterialAttribute3D& rMaterial,
bool bDoubleSided);
- // get data
+ /// data read access
const basegfx::B3DPolyPolygon& getB3DPolyPolygon() const { return maPolyPolygon; }
const attribute::MaterialAttribute3D& getMaterial() const { return maMaterial; }
bool getDoubleSided() const { return mbDoubleSided; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx
index 57f31a46a557..b3a57f2677dc 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx
@@ -44,26 +44,33 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** SdrCubePrimitive3D class
+
+ This 3D primitive expands the SdrPrimitive3D to a 3D cube definition.
+ The cube is implicitely in unit coordinates and the given transformation
+ defines it's geometry in space.
+ */
class SdrCubePrimitive3D : public SdrPrimitive3D
{
protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
public:
+ /// constructor
SdrCubePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute);
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx
index 772e030781fe..5b793a6928f8 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx
@@ -42,6 +42,7 @@
//////////////////////////////////////////////////////////////////////////////
// predefines
+
namespace basegfx {
class B3DPolygon;
class B3DPolyPolygon;
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx
index 43ae13d4625f..b80198d127d2 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx
@@ -53,7 +53,7 @@ namespace drawinglayer
{
namespace primitive3d
{
- // Slice3D types
+ /** SliceType3D definition */
enum SliceType3D
{
SLICETYPE3D_REGULAR, // normal geoemtry Slice3D
@@ -61,7 +61,7 @@ namespace drawinglayer
SLICETYPE3D_BACKCAP // back cap
};
- // class to hold one Slice3D
+ /// class to hold one Slice3D
class Slice3D
{
protected:
@@ -92,10 +92,10 @@ namespace drawinglayer
SliceType3D getSliceType() const { return maSliceType; }
};
- // typedef for a group of Slice3Ds
+ /// typedef for a group of Slice3Ds
typedef ::std::vector< Slice3D > Slice3DVector;
- // helpers for creation
+ /// helpers for creation
void createLatheSlices(
Slice3DVector& rSliceVector,
const basegfx::B2DPolyPolygon& rSource,
@@ -117,7 +117,7 @@ namespace drawinglayer
bool bCloseFront,
bool bCloseBack);
- // helpers for geometry extraction
+ /// helpers for geometry extraction
basegfx::B3DPolyPolygon extractHorizontalLinesFromSlice(const Slice3DVector& rSliceVector, bool bCloseHorLines);
basegfx::B3DPolyPolygon extractVerticalLinesFromSlice(const Slice3DVector& rSliceVector);
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx
index a6d386bf194a..a810e0f5ec8e 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx
@@ -45,23 +45,34 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** SdrExtrudePrimitive3D class
+
+ This 3D primitive expands the SdrPrimitive3D to a 3D extrude definition.
+ The given 2D PolyPolygon geometry is imagined as lying on the XY-plane in 3D
+ and gets extruded in Z-Direction by Depth.
+
+ Various possibilities e.g. for creating diagonals (edge roudings in 3D)
+ and similar are given.
+
+ The decomposition will create all necessary 3D planes for visualisation.
+ */
class SdrExtrudePrimitive3D : public SdrPrimitive3D
{
private:
- // geometry helper for slices
+ /// geometry helper for slices
basegfx::B2DPolyPolygon maCorrectedPolyPolygon;
Slice3DVector maSlices;
- // primitive data
+ /// primitive geometry data
basegfx::B2DPolyPolygon maPolyPolygon;
double mfDepth;
double mfDiagonal;
double mfBackScale;
- // decomposition data when ReducedLineGeometry is used, see get3DDecomposition
+ /// decomposition data when ReducedLineGeometry is used, see get3DDecomposition
geometry::ViewInformation3D* mpLastRLGViewInformation;
- // bitfield
+ /// bitfield
unsigned mbSmoothNormals : 1; // Plane self
unsigned mbSmoothHorizontalNormals : 1; // always
unsigned mbSmoothLids : 1; // Front/back
@@ -69,17 +80,18 @@ namespace drawinglayer
unsigned mbCloseFront : 1;
unsigned mbCloseBack : 1;
- // create slices
+ /// create slices
void impCreateSlices();
- // get (evtl. create) slices
+ /// get (evtl. create) slices
const Slice3DVector& getSlices() const;
protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
public:
+ /// constructor
SdrExtrudePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
@@ -97,7 +109,7 @@ namespace drawinglayer
bool bCloseBack);
virtual ~SdrExtrudePrimitive3D();
- // data access
+ /// data read access
const basegfx::B2DPolyPolygon& getPolyPolygon() const { return maPolyPolygon; }
double getDepth() const { return mfDepth; }
double getDiagonal() const { return mfDiagonal; }
@@ -109,16 +121,16 @@ namespace drawinglayer
bool getCloseFront() const { return mbCloseFront; }
bool getCloseBack() const { return mbCloseBack; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // Overloaded to allow for reduced line mode to decide if to buffer decomposition or not
+ /// Overloaded to allow for reduced line mode to decide if to buffer decomposition or not
virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx
index 99d06e256431..084ce5bce35e 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx
@@ -45,14 +45,25 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** SdrLathePrimitive3D class
+
+ This 3D primitive expands the SdrPrimitive3D to a 3D rotation definition.
+ The given 2D PolyPolygon geometry is imagined as lying on the XY-plane in 3D
+ and gets rotated around the Y-Axis.
+
+ Various possibilities e.g. for creating diagonals (edge roudings in 3D)
+ and similar are given.
+
+ The decomposition will create all necessary 3D planes for visualisation.
+ */
class SdrLathePrimitive3D : public SdrPrimitive3D
{
private:
- // geometry helper for slices
+ /// geometry helper for slices
basegfx::B2DPolyPolygon maCorrectedPolyPolygon;
Slice3DVector maSlices;
- // primitive data
+ /// primitive geometry data
basegfx::B2DPolyPolygon maPolyPolygon;
sal_uInt32 mnHorizontalSegments;
sal_uInt32 mnVerticalSegments;
@@ -60,10 +71,10 @@ namespace drawinglayer
double mfBackScale;
double mfRotation;
- // decomposition data when ReducedLineGeometry is used, see get3DDecomposition
+ /// decomposition data when ReducedLineGeometry is used, see get3DDecomposition
geometry::ViewInformation3D* mpLastRLGViewInformation;
- // bitfield
+ /// bitfield
unsigned mbSmoothNormals : 1; // Plane self
unsigned mbSmoothHorizontalNormals : 1; // always
unsigned mbSmoothLids : 1; // Front/back
@@ -71,14 +82,14 @@ namespace drawinglayer
unsigned mbCloseFront : 1;
unsigned mbCloseBack : 1;
- // create slices
+ /// create slices
void impCreateSlices();
- // get (evtl. create) slices
+ /// get (evtl. create) slices
const Slice3DVector& getSlices() const;
protected:
- // local helpers
+ /// local helpers
void impCreateOutlines(
const geometry::ViewInformation3D& rViewInformation,
const basegfx::B3DPolygon& rLoopA,
@@ -90,10 +101,11 @@ namespace drawinglayer
const basegfx::B2DPoint& rStart,
const basegfx::B2DPoint& rEnd) const;
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
public:
+ /// constructor
SdrLathePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
@@ -113,7 +125,7 @@ namespace drawinglayer
bool bCloseBack);
virtual ~SdrLathePrimitive3D();
- // data access
+ /// data read access
const basegfx::B2DPolyPolygon& getPolyPolygon() const { return maPolyPolygon; }
sal_uInt32 getHorizontalSegments() const { return mnHorizontalSegments; }
sal_uInt32 getVerticalSegments() const { return mnVerticalSegments; }
@@ -127,16 +139,16 @@ namespace drawinglayer
bool getCloseFront() const { return mbCloseFront; }
bool getCloseBack() const { return mbCloseBack; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // Overloaded to allow for reduced line mode to decide if to buffer decomposition or not
+ /// Overloaded to allow for reduced line mode to decide if to buffer decomposition or not
virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx
index 4eec829afeb5..a6c68bd16da8 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx
@@ -44,17 +44,28 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** SdrPolyPolygonPrimitive3D class
+
+ This 3D primitive defines a PolyPolgon in space which may have
+ Line- and FillStyles and extra 3D surface attributes. It is assumed
+ that the given 3D PolyPolgon (which may contain texture and normal
+ information) is planar in 3D.
+
+ The decomposition will include all needed 3D data for visualisation,
+ including FatLines and fill styles.
+ */
class SdrPolyPolygonPrimitive3D : public SdrPrimitive3D
{
private:
- // the polyPolygon evtl with normals and texture coordinates
+ /// the planar polyPolygon evtl with normals and texture coordinates
basegfx::B3DPolyPolygon maPolyPolygon3D;
protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
public:
+ /// constructor
SdrPolyPolygonPrimitive3D(
const basegfx::B3DPolyPolygon& rPolyPolygon3D,
const basegfx::B3DHomMatrix& rTransform,
@@ -62,16 +73,16 @@ namespace drawinglayer
const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute);
- // data access
+ /// data access
const basegfx::B3DPolyPolygon& getPolyPolygon3D() const { return maPolyPolygon3D; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx
index 6b381445716e..4dd620848387 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx
@@ -47,39 +47,49 @@
namespace drawinglayer
{
+ /** SdrPrimitive3D class
+
+ Base class for the more complicated geometric primitives, so
+ derive from buffered primitive to allow overloading of
+ create3DDecomposition there.
+ */
namespace primitive3d
{
- class SdrPrimitive3D : public BasePrimitive3D
+ class SdrPrimitive3D : public BufferedDecompositionPrimitive3D
{
private:
+ /// object surface attributes
basegfx::B3DHomMatrix maTransform;
basegfx::B2DVector maTextureSize;
attribute::SdrLineFillShadowAttribute maSdrLFSAttribute;
attribute::Sdr3DObjectAttribute maSdr3DObjectAttribute;
protected:
- // Standard implementation for primitive3D which
- // will use maTransform as range and expand by evtl. line width / 2
+ /** Standard implementation for primitive3D which
+ will use maTransform as range and expand by evtl. line width / 2
+ */
basegfx::B3DRange getStandard3DRange() const;
- // implementation for primitive3D which
- // will use given Slice3Ds and expand by evtl. line width / 2
+ /** implementation for primitive3D which
+ will use given Slice3Ds and expand by evtl. line width / 2
+ */
basegfx::B3DRange get3DRangeFromSlices(const Slice3DVector& rSlices) const;
public:
+ /// constructor
SdrPrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute);
- // data access
+ /// 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::Sdr3DObjectAttribute getSdr3DObjectAttribute() const { return maSdr3DObjectAttribute; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx
index 358298e30456..52e646e6b4dc 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx
@@ -44,17 +44,25 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** SdrSpherePrimitive3D class
+
+ This 3D primitive expands the SdrPrimitive3D to a 3D sphere definition.
+ The sphere is implicitely in unit coordinates and the given transformation
+ defines it's geometry in space.
+ */
class SdrSpherePrimitive3D : public SdrPrimitive3D
{
private:
+ /// additional geometry definitions
sal_uInt32 mnHorizontalSegments;
sal_uInt32 mnVerticalSegments;
protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
public:
+ /// constructor
SdrSpherePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
@@ -63,17 +71,17 @@ namespace drawinglayer
sal_uInt32 nHorizontalSegments,
sal_uInt32 nVerticalSegments);
- // data access
+ /// data read access
sal_uInt32 getHorizontalSegments() const { return mnHorizontalSegments; }
sal_uInt32 getVerticalSegments() const { return mnVerticalSegments; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx
index d511c89a9998..cb8e9cd385d0 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx
@@ -46,17 +46,29 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** ShadowPrimitive3D class
+
+ This 3D grouping primitive is used to define a shadow for
+ 3d geometry by embedding it. The shadow of 3D objects are
+ 2D polygons, so the shadow transformation is a 2D transformation.
+
+ If the Shadow3D flag is set, the shadow definition has to be
+ combined with the scene and camera definition to create the correct
+ projected shadow 2D-Polygons.
+ */
class ShadowPrimitive3D : public GroupPrimitive3D
{
protected:
+ /// 2D shadow definition
basegfx::B2DHomMatrix maShadowTransform;
basegfx::BColor maShadowColor;
double mfShadowTransparence;
- // bitfield
+ /// bitfield
unsigned mbShadow3D : 1;
public:
+ /// constructor
ShadowPrimitive3D(
const basegfx::B2DHomMatrix& rShadowTransform,
const basegfx::BColor& rShadowColor,
@@ -64,16 +76,16 @@ namespace drawinglayer
bool bShadow3D,
const Primitive3DSequence& rChildren);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getShadowTransform() const { return maShadowTransform; }
const basegfx::BColor& getShadowColor() const { return maShadowColor; }
double getShadowTransparence() const { return mfShadowTransparence; }
bool getShadow3D() const { return mbShadow3D; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx
index 15b8e1265709..f8b81e357ea5 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx
@@ -47,31 +47,39 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** TexturePrimitive3D class
+
+ This 3D grouping primitive is used to define a texture for
+ 3d geometry by embedding it. It is used as bae class for
+ extended texture definitions
+ */
class TexturePrimitive3D : public GroupPrimitive3D
{
private:
+ /// texture geometry definition
basegfx::B2DVector maTextureSize;
- // bitfield
- // flag if texture shall be modulated with white interpolated color
+ /// bitfield
+ /// flag if texture shall be modulated with white interpolated color
unsigned mbModulate : 1;
- // flag if texture shall be filtered
+ /// flag if texture shall be filtered
unsigned mbFilter : 1;
public:
+ /// constructor
TexturePrimitive3D(
const Primitive3DSequence& rChildren,
const basegfx::B2DVector& rTextureSize,
bool bModulate,
bool bFilter);
- // get data
+ /// data read access
const basegfx::B2DVector& getTextureSize() const { return maTextureSize; }
bool getModulate() const { return mbModulate; }
bool getFilter() const { return mbFilter; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
};
} // end of namespace primitive3d
@@ -83,27 +91,34 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** UnifiedAlphaTexturePrimitive3D class
+
+ This 3D primitive expands TexturePrimitive3D to a unified
+ alpha (transparence) texture definition. All 3D primitives
+ embedded here will be shown with the given transparency.
+ */
class UnifiedAlphaTexturePrimitive3D : public TexturePrimitive3D
{
private:
+ /// transparency definition
double mfTransparence;
- protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
-
public:
+ /// constructor
UnifiedAlphaTexturePrimitive3D(
double fTransparence,
const Primitive3DSequence& rChildren);
- // get data
+ /// data read access
double getTransparence() const { return mfTransparence; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // provide unique ID
+ /// local decomposition.
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
@@ -115,16 +130,20 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** GradientTexturePrimitive3D class
+
+ This 3D primitive expands TexturePrimitive3D to a gradient texture
+ definition. All 3D primitives embedded here will be shown with the
+ defined gradient.
+ */
class GradientTexturePrimitive3D : public TexturePrimitive3D
{
private:
+ /// the gradient definition
attribute::FillGradientAttribute maGradient;
- protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
-
public:
+ /// constructor
GradientTexturePrimitive3D(
const attribute::FillGradientAttribute& rGradient,
const Primitive3DSequence& rChildren,
@@ -132,13 +151,13 @@ namespace drawinglayer
bool bModulate,
bool bFilter);
- // get data
+ /// data read access
const attribute::FillGradientAttribute& getGradient() const { return maGradient; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
@@ -150,30 +169,34 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** BitmapTexturePrimitive3D class
+
+ This 3D primitive expands TexturePrimitive3D to a bitmap texture
+ definition. All 3D primitives embedded here will be shown with the
+ defined bitmap (maybe tiled if defined).
+ */
class BitmapTexturePrimitive3D : public TexturePrimitive3D
{
private:
- attribute::FillBitmapAttribute maBitmap;
-
- protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ /// bitmap fill attribute
+ attribute::FillBitmapAttribute maFillBitmapAttribute;
public:
+ /// constructor
BitmapTexturePrimitive3D(
- const attribute::FillBitmapAttribute& rBitmap,
+ const attribute::FillBitmapAttribute& rFillBitmapAttribute,
const Primitive3DSequence& rChildren,
const basegfx::B2DVector& rTextureSize,
bool bModulate,
bool bFilter);
- // get data
- const attribute::FillBitmapAttribute& getBitmap() const { return maBitmap; }
+ /// data read access
+ const attribute::FillBitmapAttribute& getFillBitmapAttribute() const { return maFillBitmapAttribute; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
@@ -185,18 +208,26 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** AlphaTexturePrimitive3D 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
+ primitives embedded here will be shown with the defined transparence.
+ */
class AlphaTexturePrimitive3D : public GradientTexturePrimitive3D
{
public:
+ /// constructor
AlphaTexturePrimitive3D(
const attribute::FillGradientAttribute& rGradient,
const Primitive3DSequence& rChildren,
const basegfx::B2DVector& rTextureSize);
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx
index 720f28445dec..bbf2b8444969 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx
@@ -45,26 +45,37 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** TransformPrimitive3D class
+
+ This is one of the basic grouping 3D primitives and it provides
+ embedding a sequence of primitives (a geometry) into a
+ 3D transformation.
+
+ Please see the description for TransformPrimitive2D since these
+ primitives are pretty similar.
+ */
class TransformPrimitive3D : public GroupPrimitive3D
{
private:
+ // the 3D transformation to apply
basegfx::B3DHomMatrix maTransformation;
public:
+ /// constructor
TransformPrimitive3D(
const basegfx::B3DHomMatrix& rTransformation,
const Primitive3DSequence& rChildren);
- // get data
+ /// data read access
const basegfx::B3DHomMatrix& getTransformation() const { return maTransformation; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
index 66ca140c2e56..ff77cc3fd5d0 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
@@ -64,6 +64,7 @@ namespace drawinglayer { namespace primitive2d {
class PolygonStrokePrimitive2D;
class ControlPrimitive2D;
class PagePreviewPrimitive2D;
+ class EpsPrimitive2D;
}}
//////////////////////////////////////////////////////////////////////////////
@@ -113,6 +114,7 @@ namespace drawinglayer
void RenderMarkerArrayPrimitive2D(const primitive2d::MarkerArrayPrimitive2D& rMarkerArrayCandidate);
void RenderPointArrayPrimitive2D(const primitive2d::PointArrayPrimitive2D& rPointArrayCandidate);
void RenderPolygonStrokePrimitive2D(const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokeCandidate);
+ void RenderEpsPrimitive2D(const primitive2d::EpsPrimitive2D& rEpsPrimitive2D);
/////////////////////////////////////////////////////////////////////////////
// DrawMode adaption support