1464702f4SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3464702f4SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4464702f4SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5464702f4SAndrew Rist  * distributed with this work for additional information
6464702f4SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7464702f4SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8464702f4SAndrew Rist  * "License"); you may not use this file except in compliance
9464702f4SAndrew Rist  * with the License.  You may obtain a copy of the License at
10464702f4SAndrew Rist  *
11464702f4SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12464702f4SAndrew Rist  *
13464702f4SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14464702f4SAndrew Rist  * software distributed under the License is distributed on an
15464702f4SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16464702f4SAndrew Rist  * KIND, either express or implied.  See the License for the
17464702f4SAndrew Rist  * specific language governing permissions and limitations
18464702f4SAndrew Rist  * under the License.
19464702f4SAndrew Rist  *
20464702f4SAndrew Rist  *************************************************************/
21464702f4SAndrew Rist 
22464702f4SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_drawinglayer.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
28cdf0e10cSrcweir #include <basegfx/polygon/b3dpolygon.hxx>
29cdf0e10cSrcweir #include <drawinglayer/attribute/strokeattribute.hxx>
30cdf0e10cSrcweir #include <drawinglayer/primitive3d/baseprimitive3d.hxx>
31cdf0e10cSrcweir #include <drawinglayer/primitive3d/polygonprimitive3d.hxx>
32cdf0e10cSrcweir #include <basegfx/polygon/b3dpolypolygon.hxx>
33cdf0e10cSrcweir #include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
34cdf0e10cSrcweir #include <vcl/vclenum.hxx>
35035a2f44SArmin Le Grand #include <drawinglayer/attribute/fillgraphicattribute.hxx>
36035a2f44SArmin Le Grand #include <drawinglayer/attribute/sdrfillgraphicattribute.hxx>
37cdf0e10cSrcweir #include <vcl/bmpacc.hxx>
38cdf0e10cSrcweir #include <basegfx/polygon/b3dpolypolygontools.hxx>
39cdf0e10cSrcweir #include <drawinglayer/primitive3d/textureprimitive3d.hxx>
40cdf0e10cSrcweir #include <drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx>
41cdf0e10cSrcweir #include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx>
42cdf0e10cSrcweir #include <drawinglayer/primitive3d/shadowprimitive3d.hxx>
43cdf0e10cSrcweir #include <basegfx/range/b2drange.hxx>
44cdf0e10cSrcweir #include <drawinglayer/attribute/sdrlineattribute.hxx>
45cdf0e10cSrcweir #include <drawinglayer/attribute/sdrobjectattribute3d.hxx>
46cdf0e10cSrcweir #include <drawinglayer/attribute/sdrfillattribute.hxx>
47cdf0e10cSrcweir #include <drawinglayer/attribute/sdrshadowattribute.hxx>
48cdf0e10cSrcweir #include <drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx>
49cdf0e10cSrcweir 
50cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
51cdf0e10cSrcweir 
52cdf0e10cSrcweir namespace drawinglayer
53cdf0e10cSrcweir {
54cdf0e10cSrcweir 	namespace primitive3d
55cdf0e10cSrcweir 	{
getRangeFrom3DGeometry(::std::vector<basegfx::B3DPolyPolygon> & rFill)56cdf0e10cSrcweir 		basegfx::B3DRange getRangeFrom3DGeometry(::std::vector< basegfx::B3DPolyPolygon >& rFill)
57cdf0e10cSrcweir 		{
58cdf0e10cSrcweir 			basegfx::B3DRange aRetval;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir 			for(sal_uInt32 a(0); a < rFill.size(); a++)
61cdf0e10cSrcweir 			{
62cdf0e10cSrcweir 				aRetval.expand(basegfx::tools::getRange(rFill[a]));
63cdf0e10cSrcweir 			}
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 			return aRetval;
66cdf0e10cSrcweir 		}
67cdf0e10cSrcweir 
applyNormalsKindSphereTo3DGeometry(::std::vector<basegfx::B3DPolyPolygon> & rFill,const basegfx::B3DRange & rRange)68cdf0e10cSrcweir 		void applyNormalsKindSphereTo3DGeometry(::std::vector< basegfx::B3DPolyPolygon >& rFill, const basegfx::B3DRange& rRange)
69cdf0e10cSrcweir 		{
70cdf0e10cSrcweir 			// create sphere normals
71cdf0e10cSrcweir 			const basegfx::B3DPoint aCenter(rRange.getCenter());
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 			for(sal_uInt32 a(0); a < rFill.size(); a++)
74cdf0e10cSrcweir 			{
75cdf0e10cSrcweir 				rFill[a] = basegfx::tools::applyDefaultNormalsSphere(rFill[a], aCenter);
76cdf0e10cSrcweir 			}
77cdf0e10cSrcweir 		}
78cdf0e10cSrcweir 
applyNormalsKindFlatTo3DGeometry(::std::vector<basegfx::B3DPolyPolygon> & rFill)79cdf0e10cSrcweir 		void applyNormalsKindFlatTo3DGeometry(::std::vector< basegfx::B3DPolyPolygon >& rFill)
80cdf0e10cSrcweir 		{
81cdf0e10cSrcweir 			for(sal_uInt32 a(0); a < rFill.size(); a++)
82cdf0e10cSrcweir 			{
83cdf0e10cSrcweir 				rFill[a].clearNormals();
84cdf0e10cSrcweir 			}
85cdf0e10cSrcweir 		}
86cdf0e10cSrcweir 
applyNormalsInvertTo3DGeometry(::std::vector<basegfx::B3DPolyPolygon> & rFill)87cdf0e10cSrcweir 		void applyNormalsInvertTo3DGeometry(::std::vector< basegfx::B3DPolyPolygon >& rFill)
88cdf0e10cSrcweir 		{
89cdf0e10cSrcweir 			// invert normals
90cdf0e10cSrcweir 			for(sal_uInt32 a(0); a < rFill.size(); a++)
91cdf0e10cSrcweir 			{
92cdf0e10cSrcweir 				rFill[a] = basegfx::tools::invertNormals(rFill[a]);
93cdf0e10cSrcweir 			}
94cdf0e10cSrcweir 		}
95cdf0e10cSrcweir 
applyTextureTo3DGeometry(::com::sun::star::drawing::TextureProjectionMode eModeX,::com::sun::star::drawing::TextureProjectionMode eModeY,::std::vector<basegfx::B3DPolyPolygon> & rFill,const basegfx::B3DRange & rRange,const basegfx::B2DVector & rTextureSize)96cdf0e10cSrcweir 		void applyTextureTo3DGeometry(
97cdf0e10cSrcweir 			::com::sun::star::drawing::TextureProjectionMode eModeX,
98cdf0e10cSrcweir 			::com::sun::star::drawing::TextureProjectionMode eModeY,
99cdf0e10cSrcweir 			::std::vector< basegfx::B3DPolyPolygon >& rFill,
100cdf0e10cSrcweir 			const basegfx::B3DRange& rRange,
101cdf0e10cSrcweir 			const basegfx::B2DVector& rTextureSize)
102cdf0e10cSrcweir 		{
103cdf0e10cSrcweir 			sal_uInt32 a;
104cdf0e10cSrcweir 
105cdf0e10cSrcweir 			// handle texture coordinates X
106cdf0e10cSrcweir 			const bool bParallelX(::com::sun::star::drawing::TextureProjectionMode_PARALLEL == eModeX);
107cdf0e10cSrcweir 			const bool bSphereX(!bParallelX && (::com::sun::star::drawing::TextureProjectionMode_SPHERE == eModeX));
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 			// handle texture coordinates Y
110cdf0e10cSrcweir 			const bool bParallelY(::com::sun::star::drawing::TextureProjectionMode_PARALLEL == eModeY);
111cdf0e10cSrcweir 			const bool bSphereY(!bParallelY && (::com::sun::star::drawing::TextureProjectionMode_SPHERE == eModeY));
112cdf0e10cSrcweir 
113cdf0e10cSrcweir 			if(bParallelX || bParallelY)
114cdf0e10cSrcweir 			{
115cdf0e10cSrcweir 				// apply parallel texture coordinates in X and/or Y
116cdf0e10cSrcweir 				for(a = 0; a < rFill.size(); a++)
117cdf0e10cSrcweir 				{
118cdf0e10cSrcweir 					rFill[a] = basegfx::tools::applyDefaultTextureCoordinatesParallel(rFill[a], rRange, bParallelX, bParallelY);
119cdf0e10cSrcweir 				}
120cdf0e10cSrcweir 			}
121cdf0e10cSrcweir 
122cdf0e10cSrcweir 			if(bSphereX || bSphereY)
123cdf0e10cSrcweir 			{
124cdf0e10cSrcweir 				// apply spherical texture coordinates in X and/or Y
125cdf0e10cSrcweir 				const basegfx::B3DPoint aCenter(rRange.getCenter());
126cdf0e10cSrcweir 
127cdf0e10cSrcweir 				for(a = 0; a < rFill.size(); a++)
128cdf0e10cSrcweir 				{
129cdf0e10cSrcweir 					rFill[a] = basegfx::tools::applyDefaultTextureCoordinatesSphere(rFill[a], aCenter, bSphereX, bSphereY);
130cdf0e10cSrcweir 				}
131cdf0e10cSrcweir 			}
132cdf0e10cSrcweir 
133cdf0e10cSrcweir 			// transform texture coordinates to texture size
134cdf0e10cSrcweir 			basegfx::B2DHomMatrix aTexMatrix;
135cdf0e10cSrcweir 			aTexMatrix.scale(rTextureSize.getX(), rTextureSize.getY());
136cdf0e10cSrcweir 
137cdf0e10cSrcweir 			for(a = 0; a < rFill.size(); a++)
138cdf0e10cSrcweir 			{
139cdf0e10cSrcweir 				rFill[a].transformTextureCoordiantes(aTexMatrix);
140cdf0e10cSrcweir 			}
141cdf0e10cSrcweir 		}
142cdf0e10cSrcweir 
create3DPolyPolygonLinePrimitives(const basegfx::B3DPolyPolygon & rUnitPolyPolygon,const basegfx::B3DHomMatrix & rObjectTransform,const attribute::SdrLineAttribute & rLine)143cdf0e10cSrcweir 		Primitive3DSequence create3DPolyPolygonLinePrimitives(
144cdf0e10cSrcweir 			const basegfx::B3DPolyPolygon& rUnitPolyPolygon,
145cdf0e10cSrcweir 			const basegfx::B3DHomMatrix& rObjectTransform,
146cdf0e10cSrcweir 			const attribute::SdrLineAttribute& rLine)
147cdf0e10cSrcweir 		{
148cdf0e10cSrcweir 			// prepare fully scaled polyPolygon
149cdf0e10cSrcweir 			basegfx::B3DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
150cdf0e10cSrcweir 			aScaledPolyPolygon.transform(rObjectTransform);
151cdf0e10cSrcweir 
152cdf0e10cSrcweir 			// create line and stroke attribute
1535aaf853bSArmin Le Grand 			const attribute::LineAttribute aLineAttribute(rLine.getColor(), rLine.getWidth(), rLine.getJoin(), rLine.getCap());
154cdf0e10cSrcweir 			const attribute::StrokeAttribute aStrokeAttribute(rLine.getDotDashArray(), rLine.getFullDotDashLen());
155cdf0e10cSrcweir 
156cdf0e10cSrcweir 			// create primitives
157cdf0e10cSrcweir 			Primitive3DSequence aRetval(aScaledPolyPolygon.count());
158cdf0e10cSrcweir 
159cdf0e10cSrcweir 			for(sal_uInt32 a(0L); a < aScaledPolyPolygon.count(); a++)
160cdf0e10cSrcweir 			{
161cdf0e10cSrcweir 				const Primitive3DReference xRef(new PolygonStrokePrimitive3D(aScaledPolyPolygon.getB3DPolygon(a), aLineAttribute, aStrokeAttribute));
162cdf0e10cSrcweir 				aRetval[a] = xRef;
163cdf0e10cSrcweir 			}
164cdf0e10cSrcweir 
165cdf0e10cSrcweir 			if(0.0 != rLine.getTransparence())
166cdf0e10cSrcweir 			{
167cdf0e10cSrcweir 				// create UnifiedTransparenceTexturePrimitive3D, add created primitives and exchange
168cdf0e10cSrcweir 				const Primitive3DReference xRef(new UnifiedTransparenceTexturePrimitive3D(rLine.getTransparence(), aRetval));
169cdf0e10cSrcweir 				aRetval = Primitive3DSequence(&xRef, 1L);
170cdf0e10cSrcweir 			}
171cdf0e10cSrcweir 
172cdf0e10cSrcweir 			return aRetval;
173cdf0e10cSrcweir 		}
174cdf0e10cSrcweir 
create3DPolyPolygonFillPrimitives(const::std::vector<basegfx::B3DPolyPolygon> & r3DPolyPolygonVector,const basegfx::B3DHomMatrix & rObjectTransform,const basegfx::B2DVector & rTextureSize,const attribute::Sdr3DObjectAttribute & aSdr3DObjectAttribute,const attribute::SdrFillAttribute & rFill,const attribute::FillGradientAttribute & rFillGradient)175cdf0e10cSrcweir 		Primitive3DSequence create3DPolyPolygonFillPrimitives(
176cdf0e10cSrcweir 			const ::std::vector< basegfx::B3DPolyPolygon >& r3DPolyPolygonVector,
177cdf0e10cSrcweir 			const basegfx::B3DHomMatrix& rObjectTransform,
178cdf0e10cSrcweir 			const basegfx::B2DVector& rTextureSize,
179cdf0e10cSrcweir 			const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute,
180cdf0e10cSrcweir 			const attribute::SdrFillAttribute& rFill,
181cdf0e10cSrcweir 			const attribute::FillGradientAttribute& rFillGradient)
182cdf0e10cSrcweir 		{
183cdf0e10cSrcweir 			Primitive3DSequence aRetval;
184cdf0e10cSrcweir 
185cdf0e10cSrcweir 			if(r3DPolyPolygonVector.size())
186cdf0e10cSrcweir 			{
187cdf0e10cSrcweir 				// create list of simple fill primitives
188cdf0e10cSrcweir 				aRetval.realloc(r3DPolyPolygonVector.size());
189cdf0e10cSrcweir 
190cdf0e10cSrcweir 				for(sal_uInt32 a(0L); a < r3DPolyPolygonVector.size(); a++)
191cdf0e10cSrcweir 				{
192cdf0e10cSrcweir 					// get scaled PolyPolygon
193cdf0e10cSrcweir 					basegfx::B3DPolyPolygon aScaledPolyPolygon(r3DPolyPolygonVector[a]);
194cdf0e10cSrcweir 					aScaledPolyPolygon.transform(rObjectTransform);
195cdf0e10cSrcweir 
196cdf0e10cSrcweir 					if(aScaledPolyPolygon.areNormalsUsed())
197cdf0e10cSrcweir 					{
198cdf0e10cSrcweir 						aScaledPolyPolygon.transformNormals(rObjectTransform);
199cdf0e10cSrcweir 					}
200cdf0e10cSrcweir 
201cdf0e10cSrcweir 					const Primitive3DReference xRef(new PolyPolygonMaterialPrimitive3D(
202cdf0e10cSrcweir 						aScaledPolyPolygon,
203cdf0e10cSrcweir 						aSdr3DObjectAttribute.getMaterial(),
204cdf0e10cSrcweir 						aSdr3DObjectAttribute.getDoubleSided()));
205cdf0e10cSrcweir 					aRetval[a] = xRef;
206cdf0e10cSrcweir 				}
207cdf0e10cSrcweir 
208cdf0e10cSrcweir 				// look for and evtl. build texture sub-group primitive
209cdf0e10cSrcweir 				if(!rFill.getGradient().isDefault()
210cdf0e10cSrcweir 					|| !rFill.getHatch().isDefault()
211035a2f44SArmin Le Grand 					|| !rFill.getFillGraphic().isDefault())
212cdf0e10cSrcweir 				{
213cdf0e10cSrcweir 					bool bModulate(::com::sun::star::drawing::TextureMode_MODULATE == aSdr3DObjectAttribute.getTextureMode());
214cdf0e10cSrcweir 					bool bFilter(aSdr3DObjectAttribute.getTextureFilter());
215cdf0e10cSrcweir 					BasePrimitive3D* pNewTexturePrimitive3D = 0;
216cdf0e10cSrcweir 
217cdf0e10cSrcweir 					if(!rFill.getGradient().isDefault())
218cdf0e10cSrcweir 					{
219cdf0e10cSrcweir 						// create gradientTexture3D with sublist, add to local aRetval
220cdf0e10cSrcweir 						pNewTexturePrimitive3D = new GradientTexturePrimitive3D(
221cdf0e10cSrcweir                             rFill.getGradient(),
222cdf0e10cSrcweir                             aRetval,
223cdf0e10cSrcweir                             rTextureSize,
224cdf0e10cSrcweir                             bModulate,
225cdf0e10cSrcweir                             bFilter);
226cdf0e10cSrcweir 					}
227cdf0e10cSrcweir 					else if(!rFill.getHatch().isDefault())
228cdf0e10cSrcweir 					{
229cdf0e10cSrcweir 						// create hatchTexture3D with sublist, add to local aRetval
230cdf0e10cSrcweir 						pNewTexturePrimitive3D = new HatchTexturePrimitive3D(
231cdf0e10cSrcweir                             rFill.getHatch(),
232cdf0e10cSrcweir                             aRetval,
233cdf0e10cSrcweir                             rTextureSize,
234cdf0e10cSrcweir                             bModulate,
235cdf0e10cSrcweir                             bFilter);
236cdf0e10cSrcweir 					}
237035a2f44SArmin Le Grand 					else // if(!rFill.getFillGraphic().isDefault())
238cdf0e10cSrcweir 					{
239cdf0e10cSrcweir 						// create bitmapTexture3D with sublist, add to local aRetval
240035a2f44SArmin Le Grand 						const basegfx::B2DRange aTexRange(0.0, 0.0, rTextureSize.getX(), rTextureSize.getY());
241cdf0e10cSrcweir 
242cdf0e10cSrcweir                         pNewTexturePrimitive3D = new BitmapTexturePrimitive3D(
243035a2f44SArmin Le Grand                             rFill.getFillGraphic().createFillGraphicAttribute(aTexRange),
244cdf0e10cSrcweir                             aRetval,
245cdf0e10cSrcweir                             rTextureSize,
246cdf0e10cSrcweir                             bModulate,
247cdf0e10cSrcweir                             bFilter);
248cdf0e10cSrcweir 					}
249cdf0e10cSrcweir 
250cdf0e10cSrcweir 					// exchange aRetval content with texture group
251cdf0e10cSrcweir 					const Primitive3DReference xRef(pNewTexturePrimitive3D);
252cdf0e10cSrcweir 					aRetval = Primitive3DSequence(&xRef, 1L);
253cdf0e10cSrcweir 
254*49c58f9bSArmin Le Grand                     if(::com::sun::star::drawing::TextureKind2_LUMINANCE == aSdr3DObjectAttribute.getTextureKind())
255*49c58f9bSArmin Le Grand                     {
256*49c58f9bSArmin Le Grand                         // use modified color primitive to force textures to gray
257*49c58f9bSArmin Le Grand                         const basegfx::BColorModifierSharedPtr aBColorModifier(
258*49c58f9bSArmin Le Grand                             new basegfx::BColorModifier_gray());
259*49c58f9bSArmin Le Grand                         const Primitive3DReference xRef2(
260*49c58f9bSArmin Le Grand                             new ModifiedColorPrimitive3D(
261*49c58f9bSArmin Le Grand                                 aRetval,
262*49c58f9bSArmin Le Grand                                 aBColorModifier));
263*49c58f9bSArmin Le Grand 
264*49c58f9bSArmin Le Grand                         aRetval = Primitive3DSequence(&xRef2, 1L);
265*49c58f9bSArmin Le Grand                     }
266*49c58f9bSArmin Le Grand                 }
267cdf0e10cSrcweir 
268cdf0e10cSrcweir 				if(0.0 != rFill.getTransparence())
269cdf0e10cSrcweir 				{
270cdf0e10cSrcweir 					// create UnifiedTransparenceTexturePrimitive3D with sublist and exchange
271cdf0e10cSrcweir 					const Primitive3DReference xRef(new UnifiedTransparenceTexturePrimitive3D(rFill.getTransparence(), aRetval));
272cdf0e10cSrcweir 					aRetval = Primitive3DSequence(&xRef, 1L);
273cdf0e10cSrcweir 				}
274cdf0e10cSrcweir 				else if(!rFillGradient.isDefault())
275cdf0e10cSrcweir 				{
276cdf0e10cSrcweir 					// create TransparenceTexturePrimitive3D with sublist and exchange
277cdf0e10cSrcweir 					const Primitive3DReference xRef(new TransparenceTexturePrimitive3D(rFillGradient, aRetval, rTextureSize));
278cdf0e10cSrcweir 					aRetval = Primitive3DSequence(&xRef, 1L);
279cdf0e10cSrcweir 				}
280cdf0e10cSrcweir 			}
281cdf0e10cSrcweir 
282cdf0e10cSrcweir 			return aRetval;
283cdf0e10cSrcweir 		}
284cdf0e10cSrcweir 
createShadowPrimitive3D(const Primitive3DSequence & rSource,const attribute::SdrShadowAttribute & rShadow,bool bShadow3D)285cdf0e10cSrcweir 		Primitive3DSequence createShadowPrimitive3D(
286cdf0e10cSrcweir 			const Primitive3DSequence& rSource,
287cdf0e10cSrcweir 			const attribute::SdrShadowAttribute& rShadow,
288cdf0e10cSrcweir 			bool bShadow3D)
289cdf0e10cSrcweir 		{
290cdf0e10cSrcweir 			// create Shadow primitives. Uses already created primitives
291cdf0e10cSrcweir 			if(rSource.hasElements() && !basegfx::fTools::moreOrEqual(rShadow.getTransparence(), 1.0))
292cdf0e10cSrcweir 			{
293cdf0e10cSrcweir 				// prepare new list for shadow geometry
294cdf0e10cSrcweir 				basegfx::B2DHomMatrix aShadowOffset;
295cdf0e10cSrcweir 				aShadowOffset.set(0, 2, rShadow.getOffset().getX());
296cdf0e10cSrcweir 				aShadowOffset.set(1, 2, rShadow.getOffset().getY());
297cdf0e10cSrcweir 
298cdf0e10cSrcweir 				// create shadow primitive and add primitives
299cdf0e10cSrcweir 				const Primitive3DReference xRef(new ShadowPrimitive3D(aShadowOffset, rShadow.getColor(), rShadow.getTransparence(), bShadow3D, rSource));
300cdf0e10cSrcweir 				return Primitive3DSequence(&xRef, 1L);
301cdf0e10cSrcweir 			}
302cdf0e10cSrcweir 			else
303cdf0e10cSrcweir 			{
304cdf0e10cSrcweir 				return Primitive3DSequence();
305cdf0e10cSrcweir 			}
306cdf0e10cSrcweir 		}
307cdf0e10cSrcweir 
createHiddenGeometryPrimitives3D(const::std::vector<basegfx::B3DPolyPolygon> & r3DPolyPolygonVector,const basegfx::B3DHomMatrix & rObjectTransform,const basegfx::B2DVector & rTextureSize,const attribute::Sdr3DObjectAttribute & aSdr3DObjectAttribute)308cdf0e10cSrcweir         Primitive3DSequence createHiddenGeometryPrimitives3D(
309cdf0e10cSrcweir 			const ::std::vector< basegfx::B3DPolyPolygon >& r3DPolyPolygonVector,
310cdf0e10cSrcweir 			const basegfx::B3DHomMatrix& rObjectTransform,
311cdf0e10cSrcweir 			const basegfx::B2DVector& rTextureSize,
312cdf0e10cSrcweir 			const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute)
313cdf0e10cSrcweir         {
314cdf0e10cSrcweir             // create hidden sub-geometry which can be used for HitTest
315cdf0e10cSrcweir             // and BoundRect calculations, but will not be visualized
316cdf0e10cSrcweir             const attribute::SdrFillAttribute aSimplifiedFillAttribute(
317cdf0e10cSrcweir                 0.0,
318cdf0e10cSrcweir                 basegfx::BColor(),
319cdf0e10cSrcweir                 attribute::FillGradientAttribute(),
320cdf0e10cSrcweir                 attribute::FillHatchAttribute(),
321035a2f44SArmin Le Grand                 attribute::SdrFillGraphicAttribute());
322cdf0e10cSrcweir 
323cdf0e10cSrcweir             const Primitive3DReference aHidden(
324cdf0e10cSrcweir                 new HiddenGeometryPrimitive3D(
325cdf0e10cSrcweir                     create3DPolyPolygonFillPrimitives(
326cdf0e10cSrcweir 		                r3DPolyPolygonVector,
327cdf0e10cSrcweir 		                rObjectTransform,
328cdf0e10cSrcweir 		                rTextureSize,
329cdf0e10cSrcweir 		                aSdr3DObjectAttribute,
330cdf0e10cSrcweir 		                aSimplifiedFillAttribute,
331cdf0e10cSrcweir 		                attribute::FillGradientAttribute())));
332cdf0e10cSrcweir 
333cdf0e10cSrcweir             return Primitive3DSequence(&aHidden, 1);
334cdf0e10cSrcweir         }
335cdf0e10cSrcweir 
336cdf0e10cSrcweir 	} // end of namespace primitive3d
337cdf0e10cSrcweir } // end of namespace drawinglayer
338cdf0e10cSrcweir 
339cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
340cdf0e10cSrcweir // eof
341