summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorArmin Weiss <aw@openoffice.org>2008-03-13 07:22:03 +0000
committerArmin Weiss <aw@openoffice.org>2008-03-13 07:22:03 +0000
commitbb2e524fed39bf1dc9d8adaa86511816f8170e13 (patch)
tree5ee44363e83327a6db8dff7fd38c9aba248235ec /drawinglayer
parent2145488ff3217b40dc49069d4d91b399c579c3bc (diff)
#i39532# diverse support for chart2
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx9
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx7
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx6
-rw-r--r--drawinglayer/source/attribute/sdrattribute3d.cxx13
-rw-r--r--drawinglayer/source/primitive2d/sceneprimitive2d.cxx13
-rw-r--r--drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx36
-rw-r--r--drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx6
-rw-r--r--drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx6
-rw-r--r--drawinglayer/source/processor2d/vclchartprocessor2d.cxx17
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx6
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx12
11 files changed, 72 insertions, 59 deletions
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx
index b0242b09e40e..ef0bd2162095 100644
--- a/drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sdrattribute3d.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: aw $ $Date: 2006-10-19 10:30:35 $
+ * last change: $Author: aw $ $Date: 2008-03-13 08:21:36 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -102,6 +102,7 @@ namespace drawinglayer
unsigned mbDoubleSided : 1; // surfaces are double sided
unsigned mbShadow3D : 1; // display shadow in 3D (if on), params for that are at scene
unsigned mbTextureFilter : 1; // filter texture to make more smooth
+ unsigned mbReducedLineGeometry : 1; // use reduced line geometry (object specific)
public:
Sdr3DObjectAttribute(
@@ -114,7 +115,8 @@ namespace drawinglayer
bool bNormalsInvert,
bool bDoubleSided,
bool bShadow3D,
- bool bTextureFilter);
+ bool bTextureFilter,
+ bool bReducedLineGeometry);
// compare operator
bool operator==(const Sdr3DObjectAttribute& rCandidate) const;
@@ -130,6 +132,7 @@ namespace drawinglayer
bool getDoubleSided() const { return mbDoubleSided; }
bool getShadow3D() const { return mbShadow3D; }
bool getTextureFilter() const { return mbTextureFilter; }
+ bool getReducedLineGeometry() const { return mbReducedLineGeometry; }
};
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx
index af9ad13932ef..76d767e32fb0 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sdrextrudelathetools3d.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: aw $ $Date: 2006-10-19 10:32:40 $
+ * last change: $Author: aw $ $Date: 2008-03-13 08:21:37 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -123,7 +123,8 @@ namespace drawinglayer
void extractLinesFromSlice(
basegfx::B3DPolyPolygon& rLine,
const Slice3DVector& rSliceVector,
- bool bClosed);
+ bool bClosed,
+ bool bReducedLineGeometry);
void extractPlanesFromSlice(
::std::vector< basegfx::B3DPolyPolygon >& rFill,
diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
index 6b8ca916a1b2..36770939c671 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: vclprocessor2d.hxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: aw $ $Date: 2008-03-05 08:20:15 $
+ * last change: $Author: aw $ $Date: 2008-03-13 08:21:37 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -121,7 +121,7 @@ namespace drawinglayer
void RenderPointArrayPrimitive2D(const primitive2d::PointArrayPrimitive2D& rPointArrayCandidate);
void RenderWrongSpellPrimitive2D(const primitive2d::WrongSpellPrimitive2D& rWrongSpellCandidate);
void RenderPolygonStrokePrimitive2D(const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokeCandidate);
- void RenderChartPrimitive2D(const primitive2d::ChartPrimitive2D& rChartCandidate, bool bCalledFromPixelRenderer);
+ void RenderChartPrimitive2D(const primitive2d::ChartPrimitive2D& rChartCandidate);
/////////////////////////////////////////////////////////////////////////////
// DrawMode adaption support
diff --git a/drawinglayer/source/attribute/sdrattribute3d.cxx b/drawinglayer/source/attribute/sdrattribute3d.cxx
index e88a591f05a6..e2d84aab9376 100644
--- a/drawinglayer/source/attribute/sdrattribute3d.cxx
+++ b/drawinglayer/source/attribute/sdrattribute3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sdrattribute3d.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: aw $ $Date: 2008-03-05 09:15:41 $
+ * last change: $Author: aw $ $Date: 2008-03-13 08:22:00 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -56,7 +56,8 @@ namespace drawinglayer
bool bNormalsInvert,
bool bDoubleSided,
bool bShadow3D,
- bool bTextureFilter)
+ bool bTextureFilter,
+ bool bReducedLineGeometry)
: maNormalsKind(aNormalsKind),
maTextureProjectionX(aTextureProjectionX),
maTextureProjectionY(aTextureProjectionY),
@@ -66,7 +67,8 @@ namespace drawinglayer
mbNormalsInvert(bNormalsInvert),
mbDoubleSided(bDoubleSided),
mbShadow3D(bShadow3D),
- mbTextureFilter(bTextureFilter)
+ mbTextureFilter(bTextureFilter),
+ mbReducedLineGeometry(bReducedLineGeometry)
{
}
@@ -81,7 +83,8 @@ namespace drawinglayer
&& mbNormalsInvert == rCandidate.mbNormalsInvert
&& mbDoubleSided == rCandidate.mbDoubleSided
&& mbShadow3D == rCandidate.mbShadow3D
- && mbTextureFilter == rCandidate.mbTextureFilter);
+ && mbTextureFilter == rCandidate.mbTextureFilter
+ && mbReducedLineGeometry == rCandidate.mbReducedLineGeometry);
}
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index 5d5cf776805d..dd1c73ccd305 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sceneprimitive2d.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: aw $ $Date: 2008-03-05 09:15:43 $
+ * last change: $Author: aw $ $Date: 2008-03-13 08:22:01 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -114,6 +114,15 @@ namespace drawinglayer
{
// use unit range and transform to discrete coordinates
rDiscreteRange = basegfx::B2DRange(0.0, 0.0, 1.0, 1.0);
+
+ {
+ // take a look at object transformation
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ getObjectTransformation().decompose(aScale, aTranslate, fRotate, fShearX);
+ fRotate = 0;
+ }
+
rDiscreteRange.transform(rViewInformation.getViewTransformation() * getObjectTransformation());
// force to discrete expanded bounds (it grows, so expanding works perfectly well)
diff --git a/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx b/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx
index aa817c57f37a..486ce9ec30d8 100644
--- a/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sdrextrudelathetools3d.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: aw $ $Date: 2008-03-05 09:15:44 $
+ * last change: $Author: aw $ $Date: 2008-03-13 08:22:01 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -540,7 +540,8 @@ namespace drawinglayer
void extractLinesFromSlice(
basegfx::B3DPolyPolygon& rLine,
const Slice3DVector& rSliceVector,
- bool bClosed)
+ bool bClosed,
+ bool bReducedLineGeometry)
{
const sal_uInt32 nNumSlices(rSliceVector.size());
@@ -553,25 +554,28 @@ namespace drawinglayer
}
// horizontal
- const basegfx::B3DPolyPolygon& aFirstPolyPolygon(rSliceVector[0L].getB3DPolyPolygon());
- const sal_uInt32 nPolygonCount(aFirstPolyPolygon.count());
-
- for(sal_uInt32 b(0L); b < nPolygonCount; b++)
+ if(!bReducedLineGeometry)
{
- const basegfx::B3DPolygon& aFirstPolygon(aFirstPolyPolygon.getB3DPolygon(0L));
- const sal_uInt32 nPointCount(aFirstPolygon.count());
+ const basegfx::B3DPolyPolygon& aFirstPolyPolygon(rSliceVector[0L].getB3DPolyPolygon());
+ const sal_uInt32 nPolygonCount(aFirstPolyPolygon.count());
- for(sal_uInt32 c(0L); c < nPointCount; c++)
+ for(sal_uInt32 b(0L); b < nPolygonCount; b++)
{
- basegfx::B3DPolygon aNew;
+ const basegfx::B3DPolygon& aFirstPolygon(aFirstPolyPolygon.getB3DPolygon(0L));
+ const sal_uInt32 nPointCount(aFirstPolygon.count());
- for(sal_uInt32 d(0L); d < nNumSlices; d++)
+ for(sal_uInt32 c(0L); c < nPointCount; c++)
{
- aNew.append(rSliceVector[d].getB3DPolyPolygon().getB3DPolygon(b).getB3DPoint(c));
- }
+ basegfx::B3DPolygon aNew;
- aNew.setClosed(bClosed);
- rLine.append(aNew);
+ for(sal_uInt32 d(0L); d < nNumSlices; d++)
+ {
+ aNew.append(rSliceVector[d].getB3DPolyPolygon().getB3DPolygon(b).getB3DPoint(c));
+ }
+
+ aNew.setClosed(bClosed);
+ rLine.append(aNew);
+ }
}
}
}
diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
index 15c9b82ca680..353b8e4f1953 100644
--- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sdrextrudeprimitive3d.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: aw $ $Date: 2008-03-05 09:15:44 $
+ * last change: $Author: aw $ $Date: 2008-03-13 08:22:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -210,7 +210,7 @@ namespace drawinglayer
if(getSdrLFSAttribute().getLine())
{
basegfx::B3DPolyPolygon aLine;
- extractLinesFromSlice(aLine, rSliceVector, false);
+ extractLinesFromSlice(aLine, rSliceVector, false, getSdr3DObjectAttribute().getReducedLineGeometry());
const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aLine, getTransform(), *getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
}
diff --git a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
index a20d8f86b549..261c13c75ebf 100644
--- a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sdrlatheprimitive3d.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: aw $ $Date: 2008-03-05 09:15:44 $
+ * last change: $Author: aw $ $Date: 2008-03-13 08:22:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -204,7 +204,7 @@ namespace drawinglayer
if(getSdrLFSAttribute().getLine())
{
basegfx::B3DPolyPolygon aLine;
- extractLinesFromSlice(aLine, rSliceVector, bClosedRotation);
+ extractLinesFromSlice(aLine, rSliceVector, bClosedRotation, getSdr3DObjectAttribute().getReducedLineGeometry());
const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aLine, getTransform(), *getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
}
diff --git a/drawinglayer/source/processor2d/vclchartprocessor2d.cxx b/drawinglayer/source/processor2d/vclchartprocessor2d.cxx
index d09bd82faaca..359318b00659 100644
--- a/drawinglayer/source/processor2d/vclchartprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclchartprocessor2d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: vclchartprocessor2d.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: aw $ $Date: 2008-03-05 09:15:45 $
+ * last change: $Author: aw $ $Date: 2008-03-13 08:22:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -53,7 +53,7 @@ namespace drawinglayer
{
namespace processor2d
{
- void VclProcessor2D::RenderChartPrimitive2D(const primitive2d::ChartPrimitive2D& rChartCandidate, bool bCalledFromPixelRenderer)
+ void VclProcessor2D::RenderChartPrimitive2D(const primitive2d::ChartPrimitive2D& rChartCandidate)
{
bool bChartRendered(false);
@@ -83,18 +83,7 @@ namespace drawinglayer
(sal_Int32)aObjectRange.getMinX(), (sal_Int32)aObjectRange.getMinY(),
(sal_Int32)aObjectRange.getMaxX(), (sal_Int32)aObjectRange.getMaxY());
- if(bCalledFromPixelRenderer)
- {
- mpOutputDevice->Push(PUSH_MAPMODE);
- mpOutputDevice->SetMapMode(static_cast< VclPixelProcessor2D* >(this)->getOriginalMapMode());
- }
-
bChartRendered = pPrettyPainter->DoPaint(mpOutputDevice, aRectangle);
-
- if(bCalledFromPixelRenderer)
- {
- mpOutputDevice->Pop();
- }
}
}
}
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index cabb402fad17..52c6b77647ff 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: vclmetafileprocessor2d.cxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: aw $ $Date: 2008-03-06 04:36:46 $
+ * last change: $Author: aw $ $Date: 2008-03-13 08:22:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -1719,7 +1719,7 @@ namespace drawinglayer
case PRIMITIVE2D_ID_CHARTPRIMITIVE2D :
{
// point array
- RenderChartPrimitive2D(static_cast< const primitive2d::ChartPrimitive2D& >(rCandidate), false);
+ RenderChartPrimitive2D(static_cast< const primitive2d::ChartPrimitive2D& >(rCandidate));
break;
}
case PRIMITIVE2D_ID_STRUCTURETAGRIMITIVE2D :
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 40d21081e33f..6c0301d5b279 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: vclpixelprocessor2d.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: aw $ $Date: 2008-03-05 09:15:45 $
+ * last change: $Author: aw $ $Date: 2008-03-13 08:22:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -433,8 +433,12 @@ namespace drawinglayer
}
case PRIMITIVE2D_ID_CHARTPRIMITIVE2D :
{
- // chart primitive
- RenderChartPrimitive2D(static_cast< const primitive2d::ChartPrimitive2D& >(rCandidate), true);
+ // chart primitive in pixel renderer; restore original DrawMode during call
+ // since the evtl. used ChartPrettyPainter will use the MapMode
+ mpOutputDevice->Push(PUSH_MAPMODE);
+ mpOutputDevice->SetMapMode(maOriginalMapMode);
+ RenderChartPrimitive2D(static_cast< const primitive2d::ChartPrimitive2D& >(rCandidate));
+ mpOutputDevice->Pop();
break;
}
default :