1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_drawinglayer.hxx"
26 
27 #include <drawinglayer/processor3d/defaultprocessor3d.hxx>
28 #include <drawinglayer/primitive3d/textureprimitive3d.hxx>
29 #include <drawinglayer/texture/texture.hxx>
30 #include <drawinglayer/texture/texture3d.hxx>
31 #include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx>
32 #include <drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx>
33 #include <drawinglayer/primitive3d/polygonprimitive3d.hxx>
34 #include <basegfx/polygon/b3dpolygontools.hxx>
35 #include <drawinglayer/attribute/materialattribute3d.hxx>
36 #include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
37 #include <basegfx/polygon/b3dpolypolygontools.hxx>
38 #include <com/sun/star/drawing/ShadeMode.hpp>
39 #include <drawinglayer/primitive3d/transformprimitive3d.hxx>
40 #include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
41 #include <vcl/bitmapex.hxx>
42 #include <drawinglayer/attribute/sdrsceneattribute3d.hxx>
43 #include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
44 
45 //////////////////////////////////////////////////////////////////////////////
46 
47 using namespace com::sun::star;
48 
49 //////////////////////////////////////////////////////////////////////////////
50 
51 namespace drawinglayer
52 {
53 	namespace processor3d
54 	{
55 		void DefaultProcessor3D::impRenderGradientTexturePrimitive3D(const primitive3d::GradientTexturePrimitive3D& rPrimitive, bool bTransparence)
56 		{
57 			const primitive3d::Primitive3DSequence& rSubSequence = rPrimitive.getChildren();
58 
59 			if(rSubSequence.hasElements())
60 			{
61 				// rescue values
62 				const bool bOldModulate(getModulate()); mbModulate = rPrimitive.getModulate();
63 				const bool bOldFilter(getFilter()); mbFilter = rPrimitive.getFilter();
64 				const bool bOldSimpleTextureActive(getSimpleTextureActive());
65 				boost::shared_ptr< texture::GeoTexSvx > pOldTex = (bTransparence) ? mpTransparenceGeoTexSvx : mpGeoTexSvx;
66 
67 				// create texture
68 				const attribute::FillGradientAttribute& rFillGradient = rPrimitive.getGradient();
69 				const basegfx::B2DRange aOutlineRange(0.0, 0.0, rPrimitive.getTextureSize().getX(), rPrimitive.getTextureSize().getY());
70 				const attribute::GradientStyle aGradientStyle(rFillGradient.getStyle());
71 				sal_uInt32 nSteps(rFillGradient.getSteps());
72 				const basegfx::BColor aStart(rFillGradient.getStartColor());
73 				const basegfx::BColor aEnd(rFillGradient.getEndColor());
74 				const sal_uInt32 nMaxSteps(sal_uInt32((aStart.getMaximumDistance(aEnd) * 127.5) + 0.5));
75 				boost::shared_ptr< texture::GeoTexSvx > pNewTex;
76 
77 				if(nMaxSteps)
78 				{
79 					// there IS a color distance
80 					if(nSteps == 0L)
81 					{
82 						nSteps = nMaxSteps;
83 					}
84 
85 					if(nSteps < 2L)
86 					{
87 						nSteps = 2L;
88 					}
89 
90 					if(nSteps > nMaxSteps)
91 					{
92 						nSteps = nMaxSteps;
93 					}
94 
95 					switch(aGradientStyle)
96 					{
97 						case attribute::GRADIENTSTYLE_LINEAR:
98 						{
99 							pNewTex.reset(new texture::GeoTexSvxGradientLinear(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getAngle()));
100 							break;
101 						}
102 						case attribute::GRADIENTSTYLE_AXIAL:
103 						{
104 							pNewTex.reset(new texture::GeoTexSvxGradientAxial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getAngle()));
105 							break;
106 						}
107 						case attribute::GRADIENTSTYLE_RADIAL:
108 						{
109 							pNewTex.reset(new texture::GeoTexSvxGradientRadial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY()));
110 							break;
111 						}
112 						case attribute::GRADIENTSTYLE_ELLIPTICAL:
113 						{
114 							pNewTex.reset(new texture::GeoTexSvxGradientElliptical(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), rFillGradient.getAngle()));
115 							break;
116 						}
117 						case attribute::GRADIENTSTYLE_SQUARE:
118 						{
119 							pNewTex.reset(new texture::GeoTexSvxGradientSquare(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), rFillGradient.getAngle()));
120 							break;
121 						}
122 						case attribute::GRADIENTSTYLE_RECT:
123 						{
124 							pNewTex.reset(new texture::GeoTexSvxGradientRect(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), rFillGradient.getAngle()));
125 							break;
126 						}
127 					}
128 
129 					mbSimpleTextureActive = false;
130 				}
131 				else
132 				{
133 					// no color distance -> same color, use simple texture
134 					pNewTex.reset(new texture::GeoTexSvxMono(aStart, 1.0 - aStart.luminance()));
135 					mbSimpleTextureActive = true;
136 				}
137 
138 				// set created texture
139 				if(bTransparence)
140 				{
141 					mpTransparenceGeoTexSvx = pNewTex;
142 				}
143 				else
144 				{
145 					mpGeoTexSvx = pNewTex;
146 				}
147 
148 				// process sub-list
149 				process(rSubSequence);
150 
151 				// restore values
152 				mbModulate = bOldModulate;
153 				mbFilter = bOldFilter;
154 				mbSimpleTextureActive = bOldSimpleTextureActive;
155 
156 				if(bTransparence)
157 				{
158 					mpTransparenceGeoTexSvx = pOldTex;
159 				}
160 				else
161 				{
162 					mpGeoTexSvx = pOldTex;
163 				}
164 			}
165 		}
166 
167 		void DefaultProcessor3D::impRenderHatchTexturePrimitive3D(const primitive3d::HatchTexturePrimitive3D& rPrimitive)
168 		{
169 			const primitive3d::Primitive3DSequence& rSubSequence = rPrimitive.getChildren();
170 
171 			if(rSubSequence.hasElements())
172 			{
173 				// rescue values
174 				const bool bOldModulate(getModulate()); mbModulate = rPrimitive.getModulate();
175 				const bool bOldFilter(getFilter()); mbFilter = rPrimitive.getFilter();
176 				boost::shared_ptr< texture::GeoTexSvx > pOldTex = mpGeoTexSvx;
177 
178 				// calculate logic pixel size in object coordinates. Create transformation view
179 				// to object by inverting ObjectToView
180 				basegfx::B3DHomMatrix aInvObjectToView(getViewInformation3D().getObjectToView());
181 				aInvObjectToView.invert();
182 
183 				// back-project discrete coordinates to object coordinates and extract
184 				// maximum distance
185 				const basegfx::B3DPoint aZero(aInvObjectToView * basegfx::B3DPoint(0.0, 0.0, 0.0));
186 				const basegfx::B3DPoint aOne(aInvObjectToView * basegfx::B3DPoint(1.0, 1.0, 1.0));
187 				const basegfx::B3DVector aLogicPixel(aOne - aZero);
188 				double fLogicPixelSizeWorld(::std::max(::std::max(fabs(aLogicPixel.getX()), fabs(aLogicPixel.getY())), fabs(aLogicPixel.getZ())));
189 
190 				// calculate logic pixel size in texture coordinates
191 				const double fLogicTexSizeX(fLogicPixelSizeWorld / rPrimitive.getTextureSize().getX());
192 				const double fLogicTexSizeY(fLogicPixelSizeWorld / rPrimitive.getTextureSize().getY());
193 				const double fLogicTexSize(fLogicTexSizeX > fLogicTexSizeY ? fLogicTexSizeX : fLogicTexSizeY);
194 
195 				// create texture and set
196 				mpGeoTexSvx.reset(new texture::GeoTexSvxMultiHatch(rPrimitive, fLogicTexSize));
197 
198 				// process sub-list
199 				process(rSubSequence);
200 
201 				// restore values
202 				mbModulate = bOldModulate;
203 				mbFilter = bOldFilter;
204 				mpGeoTexSvx = pOldTex;
205 			}
206 		}
207 
208 		void DefaultProcessor3D::impRenderBitmapTexturePrimitive3D(const primitive3d::BitmapTexturePrimitive3D& rPrimitive)
209 		{
210 			const primitive3d::Primitive3DSequence& rSubSequence = rPrimitive.getChildren();
211 
212 			if(rSubSequence.hasElements())
213 			{
214 				// rescue values
215 				const bool bOldModulate(getModulate()); mbModulate = rPrimitive.getModulate();
216 				const bool bOldFilter(getFilter()); mbFilter = rPrimitive.getFilter();
217 				boost::shared_ptr< texture::GeoTexSvx > pOldTex = mpGeoTexSvx;
218 
219 				// create texture
220 				const attribute::FillBitmapAttribute& rFillBitmapAttribute = rPrimitive.getFillBitmapAttribute();
221 
222 				if(rFillBitmapAttribute.getTiling())
223 				{
224 					mpGeoTexSvx.reset(new texture::GeoTexSvxBitmapTiled(
225 						rFillBitmapAttribute.getBitmapEx().GetBitmap(),
226 						rFillBitmapAttribute.getTopLeft() * rPrimitive.getTextureSize(),
227 						rFillBitmapAttribute.getSize() * rPrimitive.getTextureSize()));
228 				}
229 				else
230 				{
231 					mpGeoTexSvx.reset(new texture::GeoTexSvxBitmap(
232 						rFillBitmapAttribute.getBitmapEx().GetBitmap(),
233 						rFillBitmapAttribute.getTopLeft() * rPrimitive.getTextureSize(),
234 						rFillBitmapAttribute.getSize() * rPrimitive.getTextureSize()));
235 				}
236 
237 				// process sub-list
238 				process(rSubSequence);
239 
240 				// restore values
241 				mbModulate = bOldModulate;
242 				mbFilter = bOldFilter;
243 				mpGeoTexSvx = pOldTex;
244 			}
245 		}
246 
247 		void DefaultProcessor3D::impRenderModifiedColorPrimitive3D(const primitive3d::ModifiedColorPrimitive3D& rModifiedCandidate)
248 		{
249 			const primitive3d::Primitive3DSequence& rSubSequence = rModifiedCandidate.getChildren();
250 
251 			if(rSubSequence.hasElements())
252 			{
253 				// put modifier on stack
254 				maBColorModifierStack.push(rModifiedCandidate.getColorModifier());
255 
256 				// process sub-list
257 				process(rModifiedCandidate.getChildren());
258 
259 				// remove modifier from stack
260 				maBColorModifierStack.pop();
261 			}
262 		}
263 
264 		void DefaultProcessor3D::impRenderPolygonHairlinePrimitive3D(const primitive3d::PolygonHairlinePrimitive3D& rPrimitive)
265 		{
266 			basegfx::B3DPolygon aHairline(rPrimitive.getB3DPolygon());
267 
268 			if(aHairline.count())
269 			{
270 				// hairlines need no extra data, clear it
271 				aHairline.clearTextureCoordinates();
272 				aHairline.clearNormals();
273 				aHairline.clearBColors();
274 
275 				// transform to device coordinates (-1.0 .. 1.0) and check for visibility
276 				aHairline.transform(getViewInformation3D().getObjectToView());
277 				const basegfx::B3DRange a3DRange(basegfx::tools::getRange(aHairline));
278 				const basegfx::B2DRange a2DRange(a3DRange.getMinX(), a3DRange.getMinY(), a3DRange.getMaxX(), a3DRange.getMaxY());
279 
280 				if(a2DRange.overlaps(maRasterRange))
281 				{
282 					const attribute::MaterialAttribute3D aMaterial(maBColorModifierStack.getModifiedColor(rPrimitive.getBColor()));
283 
284 					rasterconvertB3DPolygon(aMaterial, aHairline);
285 				}
286 			}
287 		}
288 
289 		void DefaultProcessor3D::impRenderPolyPolygonMaterialPrimitive3D(const primitive3d::PolyPolygonMaterialPrimitive3D& rPrimitive)
290 		{
291 			basegfx::B3DPolyPolygon aFill(rPrimitive.getB3DPolyPolygon());
292 			basegfx::BColor aObjectColor(rPrimitive.getMaterial().getColor());
293 			bool bPaintIt(aFill.count());
294 
295 			// #i98295# get ShadeMode. Correct early when only flat is possible due to missing normals
296 			const ::com::sun::star::drawing::ShadeMode aShadeMode(
297 				aFill.areNormalsUsed() ?
298 					getSdrSceneAttribute().getShadeMode() : ::com::sun::star::drawing::ShadeMode_FLAT);
299 
300 			if(bPaintIt)
301 			{
302 				// get rid of texture coordinates if there is no texture
303 				if(aFill.areTextureCoordinatesUsed() && !getGeoTexSvx().get() && !getTransparenceGeoTexSvx().get())
304 				{
305 					aFill.clearTextureCoordinates();
306 				}
307 
308 				// #i98295# get rid of normals and color early when not needed
309 				if(::com::sun::star::drawing::ShadeMode_FLAT == aShadeMode)
310 				{
311 					aFill.clearNormals();
312 					aFill.clearBColors();
313 				}
314 
315 				// transform to device coordinates (-1.0 .. 1.0) and check for visibility
316 				aFill.transform(getViewInformation3D().getObjectToView());
317 				const basegfx::B3DRange a3DRange(basegfx::tools::getRange(aFill));
318 				const basegfx::B2DRange a2DRange(a3DRange.getMinX(), a3DRange.getMinY(), a3DRange.getMaxX(), a3DRange.getMaxY());
319 
320 				bPaintIt = a2DRange.overlaps(maRasterRange);
321 			}
322 
323 			// check if it shall be painted regarding hiding of normals (backface culling)
324 			if(bPaintIt && !rPrimitive.getDoubleSided())
325 			{
326 				// get plane normal of polygon in view coordinates (with ZBuffer values),
327 				// left-handed coordinate system
328 				const basegfx::B3DVector aPlaneNormal(aFill.getB3DPolygon(0L).getNormal());
329 
330 				if(aPlaneNormal.getZ() > 0.0)
331 				{
332 					bPaintIt = false;
333 				}
334 			}
335 
336 			if(bPaintIt)
337 			{
338 				// prepare ObjectToEye in NormalTransform
339 				basegfx::B3DHomMatrix aNormalTransform(getViewInformation3D().getOrientation() * getViewInformation3D().getObjectTransformation());
340 
341 				if(getSdrSceneAttribute().getTwoSidedLighting())
342 				{
343 					// get plane normal of polygon in view coordinates (with ZBuffer values),
344 					// left-handed coordinate system
345 					const basegfx::B3DVector aPlaneNormal(aFill.getB3DPolygon(0L).getNormal());
346 
347 					if(aPlaneNormal.getZ() > 0.0)
348 					{
349 						// mirror normals
350 						aNormalTransform.scale(-1.0, -1.0, -1.0);
351 					}
352 				}
353 
354 				switch(aShadeMode)
355 				{
356 					case ::com::sun::star::drawing::ShadeMode_PHONG:
357 					{
358 						// phong shading. Transform normals to eye coor
359 						aFill.transformNormals(aNormalTransform);
360 						break;
361 					}
362 					case ::com::sun::star::drawing::ShadeMode_SMOOTH:
363 					{
364 						// gouraud shading. Transform normals to eye coor
365 						aFill.transformNormals(aNormalTransform);
366 
367 						// prepare color model parameters, evtl. use blend color
368 						const basegfx::BColor aColor(getModulate() ? basegfx::BColor(1.0, 1.0, 1.0) : rPrimitive.getMaterial().getColor());
369 						const basegfx::BColor& rSpecular(rPrimitive.getMaterial().getSpecular());
370 						const basegfx::BColor& rEmission(rPrimitive.getMaterial().getEmission());
371 						const sal_uInt16 nSpecularIntensity(rPrimitive.getMaterial().getSpecularIntensity());
372 
373 						// solve color model for each normal vector, set colors at points. Clear normals.
374 						for(sal_uInt32 a(0L); a < aFill.count(); a++)
375 						{
376 							basegfx::B3DPolygon aPartFill(aFill.getB3DPolygon(a));
377 
378 							for(sal_uInt32 b(0L); b < aPartFill.count(); b++)
379 							{
380 								// solve color model. Transform normal to eye coor
381 								const basegfx::B3DVector aNormal(aPartFill.getNormal(b));
382 								const basegfx::BColor aSolvedColor(getSdrLightingAttribute().solveColorModel(aNormal, aColor, rSpecular, rEmission, nSpecularIntensity));
383 								aPartFill.setBColor(b, aSolvedColor);
384 							}
385 
386 							// clear normals on this part polygon and write it back
387 							aPartFill.clearNormals();
388 							aFill.setB3DPolygon(a, aPartFill);
389 						}
390 						break;
391 					}
392 					case ::com::sun::star::drawing::ShadeMode_FLAT:
393 					{
394 						// flat shading. Get plane vector in eye coordinates
395 						const basegfx::B3DVector aPlaneEyeNormal(aNormalTransform * rPrimitive.getB3DPolyPolygon().getB3DPolygon(0L).getNormal());
396 
397 						// prepare color model parameters, evtl. use blend color
398 						const basegfx::BColor aColor(getModulate() ? basegfx::BColor(1.0, 1.0, 1.0) : rPrimitive.getMaterial().getColor());
399 						const basegfx::BColor& rSpecular(rPrimitive.getMaterial().getSpecular());
400 						const basegfx::BColor& rEmission(rPrimitive.getMaterial().getEmission());
401 						const sal_uInt16 nSpecularIntensity(rPrimitive.getMaterial().getSpecularIntensity());
402 
403 						// solve color model for plane vector and use that color for whole plane
404 						aObjectColor = getSdrLightingAttribute().solveColorModel(aPlaneEyeNormal, aColor, rSpecular, rEmission, nSpecularIntensity);
405 						break;
406 					}
407 					default: // case ::com::sun::star::drawing::ShadeMode_DRAFT:
408 					{
409 						// draft, just use object color which is already set. Delete all other infos
410 						aFill.clearNormals();
411 						aFill.clearBColors();
412 						break;
413 					}
414 				}
415 
416 				// draw it to ZBuffer
417 				const attribute::MaterialAttribute3D aMaterial(
418 					maBColorModifierStack.getModifiedColor(aObjectColor),
419 					rPrimitive.getMaterial().getSpecular(),
420 					rPrimitive.getMaterial().getEmission(),
421 					rPrimitive.getMaterial().getSpecularIntensity());
422 
423 				rasterconvertB3DPolyPolygon(aMaterial, aFill);
424 			}
425 		}
426 
427 		void DefaultProcessor3D::impRenderTransformPrimitive3D(const primitive3d::TransformPrimitive3D& rTransformCandidate)
428 		{
429 			// transform group. Remember current transformations
430 			const geometry::ViewInformation3D aLastViewInformation3D(getViewInformation3D());
431 
432 			// create new transformation; add new object transform from right side
433 			const geometry::ViewInformation3D aNewViewInformation3D(
434 				aLastViewInformation3D.getObjectTransformation() * rTransformCandidate.getTransformation(),
435 				aLastViewInformation3D.getOrientation(),
436 				aLastViewInformation3D.getProjection(),
437 				aLastViewInformation3D.getDeviceToView(),
438 				aLastViewInformation3D.getViewTime(),
439 				aLastViewInformation3D.getExtendedInformationSequence());
440 			updateViewInformation(aNewViewInformation3D);
441 
442 			// let break down recursively
443 			process(rTransformCandidate.getChildren());
444 
445 			// restore transformations
446 			updateViewInformation(aLastViewInformation3D);
447 		}
448 
449 		void DefaultProcessor3D::processBasePrimitive3D(const primitive3d::BasePrimitive3D& rBasePrimitive)
450 		{
451 			// it is a BasePrimitive3D implementation, use getPrimitive3DID() call for switch
452 			switch(rBasePrimitive.getPrimitive3DID())
453 			{
454 				case PRIMITIVE3D_ID_GRADIENTTEXTUREPRIMITIVE3D :
455 				{
456 					// GradientTexturePrimitive3D
457 					const primitive3d::GradientTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::GradientTexturePrimitive3D& >(rBasePrimitive);
458 					impRenderGradientTexturePrimitive3D(rPrimitive, false);
459 					break;
460 				}
461 				case PRIMITIVE3D_ID_HATCHTEXTUREPRIMITIVE3D :
462 				{
463 					// HatchTexturePrimitive3D
464 					static bool bDoHatchDecomposition(false);
465 
466 					if(bDoHatchDecomposition)
467 					{
468 						// let break down
469 						process(rBasePrimitive.get3DDecomposition(getViewInformation3D()));
470 					}
471 					else
472 					{
473 						// hatchTexturePrimitive3D
474 						const primitive3d::HatchTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::HatchTexturePrimitive3D& >(rBasePrimitive);
475 						impRenderHatchTexturePrimitive3D(rPrimitive);
476 					}
477 					break;
478 				}
479 				case PRIMITIVE3D_ID_BITMAPTEXTUREPRIMITIVE3D :
480 				{
481 					// BitmapTexturePrimitive3D
482 					const primitive3d::BitmapTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::BitmapTexturePrimitive3D& >(rBasePrimitive);
483 					impRenderBitmapTexturePrimitive3D(rPrimitive);
484 					break;
485 				}
486 				case PRIMITIVE3D_ID_TRANSPARENCETEXTUREPRIMITIVE3D :
487 				{
488 					// TransparenceTexturePrimitive3D
489 					const primitive3d::TransparenceTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::TransparenceTexturePrimitive3D& >(rBasePrimitive);
490                     mnTransparenceCounter++;
491 					impRenderGradientTexturePrimitive3D(rPrimitive, true);
492                     mnTransparenceCounter--;
493 					break;
494 				}
495 				case PRIMITIVE3D_ID_MODIFIEDCOLORPRIMITIVE3D :
496 				{
497 					// ModifiedColorPrimitive3D
498 					// Force output to unified color.
499 					const primitive3d::ModifiedColorPrimitive3D& rPrimitive = static_cast< const primitive3d::ModifiedColorPrimitive3D& >(rBasePrimitive);
500 					impRenderModifiedColorPrimitive3D(rPrimitive);
501 					break;
502 				}
503 				case PRIMITIVE3D_ID_POLYGONHAIRLINEPRIMITIVE3D :
504 				{
505 					// directdraw of PolygonHairlinePrimitive3D
506 					const primitive3d::PolygonHairlinePrimitive3D& rPrimitive = static_cast< const primitive3d::PolygonHairlinePrimitive3D& >(rBasePrimitive);
507 					impRenderPolygonHairlinePrimitive3D(rPrimitive);
508 					break;
509 				}
510 				case PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D :
511 				{
512 					// directdraw of PolyPolygonMaterialPrimitive3D
513 					const primitive3d::PolyPolygonMaterialPrimitive3D& rPrimitive = static_cast< const primitive3d::PolyPolygonMaterialPrimitive3D& >(rBasePrimitive);
514 					impRenderPolyPolygonMaterialPrimitive3D(rPrimitive);
515 					break;
516 				}
517 				case PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D :
518 				{
519 					// transform group (TransformPrimitive3D)
520 					impRenderTransformPrimitive3D(static_cast< const primitive3d::TransformPrimitive3D& >(rBasePrimitive));
521 					break;
522 				}
523 				default:
524 				{
525 					// process recursively
526 					process(rBasePrimitive.get3DDecomposition(getViewInformation3D()));
527 					break;
528 				}
529 			}
530 		}
531 
532 		DefaultProcessor3D::DefaultProcessor3D(
533 			const geometry::ViewInformation3D& rViewInformation,
534 			const attribute::SdrSceneAttribute& rSdrSceneAttribute,
535 			const attribute::SdrLightingAttribute& rSdrLightingAttribute)
536 		:	BaseProcessor3D(rViewInformation),
537 			mrSdrSceneAttribute(rSdrSceneAttribute),
538 			mrSdrLightingAttribute(rSdrLightingAttribute),
539 			maRasterRange(),
540 			maBColorModifierStack(),
541 			mpGeoTexSvx(),
542 			mpTransparenceGeoTexSvx(),
543             maDrawinglayerOpt(),
544             mnTransparenceCounter(0),
545 			mbModulate(false),
546 			mbFilter(false),
547 			mbSimpleTextureActive(false)
548 		{
549 			// a derivation has to set maRasterRange which is used in the basic render methods.
550 			// Setting to default here ([0.0 .. 1.0] in X,Y) to avoid problems
551 			maRasterRange.expand(basegfx::B2DTuple(0.0, 0.0));
552 			maRasterRange.expand(basegfx::B2DTuple(1.0, 1.0));
553 		}
554 
555 		DefaultProcessor3D::~DefaultProcessor3D()
556 		{
557 		}
558 	} // end of namespace processor3d
559 } // end of namespace drawinglayer
560 
561 //////////////////////////////////////////////////////////////////////////////
562 // eof
563