xref: /trunk/main/basegfx/source/raster/rasterconvert3d.cxx (revision 18e39f1b61b4f1cbad5dde1ff548849e2cddffe7)
109dbbe93SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
309dbbe93SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
409dbbe93SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
509dbbe93SAndrew Rist  * distributed with this work for additional information
609dbbe93SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
709dbbe93SAndrew Rist  * to you under the Apache License, Version 2.0 (the
809dbbe93SAndrew Rist  * "License"); you may not use this file except in compliance
909dbbe93SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
1109dbbe93SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
1309dbbe93SAndrew Rist  * Unless required by applicable law or agreed to in writing,
1409dbbe93SAndrew Rist  * software distributed under the License is distributed on an
1509dbbe93SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1609dbbe93SAndrew Rist  * KIND, either express or implied.  See the License for the
1709dbbe93SAndrew Rist  * specific language governing permissions and limitations
1809dbbe93SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
2009dbbe93SAndrew Rist  *************************************************************/
2109dbbe93SAndrew Rist 
22cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
23cdf0e10cSrcweir #include "precompiled_basegfx.hxx"
24cdf0e10cSrcweir 
25cdf0e10cSrcweir #include <basegfx/raster/rasterconvert3d.hxx>
26cdf0e10cSrcweir #include <basegfx/polygon/b3dpolygon.hxx>
27cdf0e10cSrcweir #include <basegfx/polygon/b3dpolypolygon.hxx>
28cdf0e10cSrcweir #include <basegfx/point/b3dpoint.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir // implementations of the 3D raster converter
31cdf0e10cSrcweir 
32cdf0e10cSrcweir namespace basegfx
33cdf0e10cSrcweir {
addArea(const B3DPolygon & rFill,const B3DHomMatrix * pViewToEye)34cdf0e10cSrcweir     void RasterConverter3D::addArea(const B3DPolygon& rFill, const B3DHomMatrix* pViewToEye)
35cdf0e10cSrcweir     {
36cdf0e10cSrcweir         const sal_uInt32 nPointCount(rFill.count());
37cdf0e10cSrcweir 
38cdf0e10cSrcweir         for(sal_uInt32 a(0); a < nPointCount; a++)
39cdf0e10cSrcweir         {
40cdf0e10cSrcweir             addEdge(rFill, a, (a + 1) % nPointCount, pViewToEye);
41cdf0e10cSrcweir         }
42cdf0e10cSrcweir     }
43cdf0e10cSrcweir 
addArea(const B3DPolyPolygon & rFill,const B3DHomMatrix * pViewToEye)44cdf0e10cSrcweir     void RasterConverter3D::addArea(const B3DPolyPolygon& rFill, const B3DHomMatrix* pViewToEye)
45cdf0e10cSrcweir     {
46cdf0e10cSrcweir         const sal_uInt32 nPolyCount(rFill.count());
47cdf0e10cSrcweir 
48cdf0e10cSrcweir         for(sal_uInt32 a(0); a < nPolyCount; a++)
49cdf0e10cSrcweir         {
50cdf0e10cSrcweir             addArea(rFill.getB3DPolygon(a), pViewToEye);
51cdf0e10cSrcweir         }
52cdf0e10cSrcweir     }
53cdf0e10cSrcweir 
RasterConverter3D()54cdf0e10cSrcweir     RasterConverter3D::RasterConverter3D()
55cdf0e10cSrcweir     :   InterpolatorProvider3D(),
56cdf0e10cSrcweir         maLineEntries()
57cdf0e10cSrcweir     {}
58cdf0e10cSrcweir 
~RasterConverter3D()59cdf0e10cSrcweir     RasterConverter3D::~RasterConverter3D()
60cdf0e10cSrcweir     {}
61cdf0e10cSrcweir 
rasterconvertB3DArea(sal_Int32 nStartLine,sal_Int32 nStopLine)62cdf0e10cSrcweir     void RasterConverter3D::rasterconvertB3DArea(sal_Int32 nStartLine, sal_Int32 nStopLine)
63cdf0e10cSrcweir     {
64cdf0e10cSrcweir         if(maLineEntries.size())
65cdf0e10cSrcweir         {
66cdf0e10cSrcweir             OSL_ENSURE(nStopLine >= nStartLine, "nStopLine is bigger than nStartLine (!)");
67cdf0e10cSrcweir 
68cdf0e10cSrcweir             // sort global entries by Y, X once. After this, the vector
69cdf0e10cSrcweir             // is seen as frozen. Pointers to it's entries will be used in the following code.
70cdf0e10cSrcweir             ::std::sort(maLineEntries.begin(), maLineEntries.end());
71cdf0e10cSrcweir 
72cdf0e10cSrcweir             // local parameters
73cdf0e10cSrcweir             ::std::vector< RasterConversionLineEntry3D >::iterator aCurrentEntry(maLineEntries.begin());
74cdf0e10cSrcweir             ::std::vector< RasterConversionLineEntry3D* > aCurrentLine;
75cdf0e10cSrcweir             ::std::vector< RasterConversionLineEntry3D* > aNextLine;
76cdf0e10cSrcweir             ::std::vector< RasterConversionLineEntry3D* >::iterator aRasterConversionLineEntry3D;
77cdf0e10cSrcweir             sal_uInt32 nPairCount(0);
78cdf0e10cSrcweir 
79cdf0e10cSrcweir             // get scanlines first LineNumber as start
80cdf0e10cSrcweir             sal_Int32 nLineNumber(::std::max(aCurrentEntry->getY(), nStartLine));
81cdf0e10cSrcweir 
82cdf0e10cSrcweir             while((aCurrentLine.size() || aCurrentEntry != maLineEntries.end()) && (nLineNumber < nStopLine))
83cdf0e10cSrcweir             {
84cdf0e10cSrcweir                 // add all entries which start at current line to current scanline
85cdf0e10cSrcweir                 while(aCurrentEntry != maLineEntries.end())
86cdf0e10cSrcweir                 {
87cdf0e10cSrcweir                     const sal_Int32 nCurrentLineNumber(aCurrentEntry->getY());
88cdf0e10cSrcweir 
89cdf0e10cSrcweir                     if(nCurrentLineNumber > nLineNumber)
90cdf0e10cSrcweir                     {
91cdf0e10cSrcweir                         // line is below current one, done (since array is sorted)
92cdf0e10cSrcweir                         break;
93cdf0e10cSrcweir                     }
94cdf0e10cSrcweir                     else
95cdf0e10cSrcweir                     {
96cdf0e10cSrcweir                         // less or equal. Line is above or at current one. Advance it exactly to
97cdf0e10cSrcweir                         // current line
98cdf0e10cSrcweir                         const sal_uInt32 nStep(nLineNumber - nCurrentLineNumber);
99cdf0e10cSrcweir 
100cdf0e10cSrcweir                         if(!nStep || aCurrentEntry->decrementRasterConversionLineEntry3D(nStep))
101cdf0e10cSrcweir                         {
102*18e39f1bSmseidel                             // add when exactly on current line or when increment to it did not
103cdf0e10cSrcweir                             // completely consume it
104cdf0e10cSrcweir                             if(nStep)
105cdf0e10cSrcweir                             {
106cdf0e10cSrcweir                                 aCurrentEntry->incrementRasterConversionLineEntry3D(nStep, *this);
107cdf0e10cSrcweir                             }
108cdf0e10cSrcweir 
109cdf0e10cSrcweir                             aCurrentLine.push_back(&(*(aCurrentEntry)));
110cdf0e10cSrcweir                         }
111cdf0e10cSrcweir                     }
112cdf0e10cSrcweir 
113cdf0e10cSrcweir                     aCurrentEntry++;
114cdf0e10cSrcweir                 }
115cdf0e10cSrcweir 
116cdf0e10cSrcweir                 // sort current scanline using comparator. Only X is used there
117cdf0e10cSrcweir                 // since all entries are already in one processed line. This needs to be done
118*18e39f1bSmseidel                 // every time since not only new spans may have been added or old removed,
119cdf0e10cSrcweir                 // but incrementing may also have changed the order
120cdf0e10cSrcweir                 ::std::sort(aCurrentLine.begin(), aCurrentLine.end(), lineComparator());
121cdf0e10cSrcweir 
122cdf0e10cSrcweir                 // process current scanline
123cdf0e10cSrcweir                 aRasterConversionLineEntry3D = aCurrentLine.begin();
124cdf0e10cSrcweir                 aNextLine.clear();
125cdf0e10cSrcweir                 nPairCount = 0;
126cdf0e10cSrcweir 
127cdf0e10cSrcweir                 while(aRasterConversionLineEntry3D != aCurrentLine.end())
128cdf0e10cSrcweir                 {
129cdf0e10cSrcweir                     RasterConversionLineEntry3D& rPrevScanRasterConversionLineEntry3D(**aRasterConversionLineEntry3D++);
130cdf0e10cSrcweir 
131cdf0e10cSrcweir                     // look for 2nd span
132cdf0e10cSrcweir                     if(aRasterConversionLineEntry3D != aCurrentLine.end())
133cdf0e10cSrcweir                     {
134cdf0e10cSrcweir                         // work on span from rPrevScanRasterConversionLineEntry3D to aRasterConversionLineEntry3D, fLineNumber is valid
135cdf0e10cSrcweir                         processLineSpan(rPrevScanRasterConversionLineEntry3D, **aRasterConversionLineEntry3D, nLineNumber, nPairCount++);
136cdf0e10cSrcweir                     }
137cdf0e10cSrcweir 
138cdf0e10cSrcweir                     // increment to next line
139cdf0e10cSrcweir                     if(rPrevScanRasterConversionLineEntry3D.decrementRasterConversionLineEntry3D(1))
140cdf0e10cSrcweir                     {
141cdf0e10cSrcweir                         rPrevScanRasterConversionLineEntry3D.incrementRasterConversionLineEntry3D(1, *this);
142cdf0e10cSrcweir                         aNextLine.push_back(&rPrevScanRasterConversionLineEntry3D);
143cdf0e10cSrcweir                     }
144cdf0e10cSrcweir                 }
145cdf0e10cSrcweir 
146cdf0e10cSrcweir                 // copy back next scanline if count has changed
147cdf0e10cSrcweir                 if(aNextLine.size() != aCurrentLine.size())
148cdf0e10cSrcweir                 {
149cdf0e10cSrcweir                     aCurrentLine = aNextLine;
150cdf0e10cSrcweir                 }
151cdf0e10cSrcweir 
152cdf0e10cSrcweir                 // increment fLineNumber
153cdf0e10cSrcweir                 nLineNumber++;
154cdf0e10cSrcweir             }
155cdf0e10cSrcweir         }
156cdf0e10cSrcweir     }
157cdf0e10cSrcweir 
addEdge(const B3DPolygon & rFill,sal_uInt32 a,sal_uInt32 b,const B3DHomMatrix * pViewToEye)158cdf0e10cSrcweir     void RasterConverter3D::addEdge(const B3DPolygon& rFill, sal_uInt32 a, sal_uInt32 b, const B3DHomMatrix* pViewToEye)
159cdf0e10cSrcweir     {
160cdf0e10cSrcweir         B3DPoint aStart(rFill.getB3DPoint(a));
161cdf0e10cSrcweir         B3DPoint aEnd(rFill.getB3DPoint(b));
162cdf0e10cSrcweir         sal_Int32 nYStart(fround(aStart.getY()));
163cdf0e10cSrcweir         sal_Int32 nYEnd(fround(aEnd.getY()));
164cdf0e10cSrcweir 
165cdf0e10cSrcweir         if(nYStart != nYEnd)
166cdf0e10cSrcweir         {
167cdf0e10cSrcweir             if(nYStart > nYEnd)
168cdf0e10cSrcweir             {
169cdf0e10cSrcweir                 ::std::swap(aStart, aEnd);
170cdf0e10cSrcweir                 ::std::swap(nYStart, nYEnd);
171cdf0e10cSrcweir                 ::std::swap(a, b);
172cdf0e10cSrcweir             }
173cdf0e10cSrcweir 
174cdf0e10cSrcweir             const sal_uInt32 nYDelta(nYEnd - nYStart);
175cdf0e10cSrcweir             const double fInvYDelta(1.0 / nYDelta);
176cdf0e10cSrcweir             maLineEntries.push_back(RasterConversionLineEntry3D(
177cdf0e10cSrcweir                 aStart.getX(), (aEnd.getX() - aStart.getX()) * fInvYDelta,
178cdf0e10cSrcweir                 aStart.getZ(), (aEnd.getZ() - aStart.getZ()) * fInvYDelta,
179cdf0e10cSrcweir                 nYStart, nYDelta));
180cdf0e10cSrcweir 
181cdf0e10cSrcweir             // if extra interpolation data is used, add it to the last created entry
182cdf0e10cSrcweir             RasterConversionLineEntry3D& rEntry = maLineEntries[maLineEntries.size() - 1];
183cdf0e10cSrcweir 
184cdf0e10cSrcweir             if(rFill.areBColorsUsed())
185cdf0e10cSrcweir             {
186cdf0e10cSrcweir                 rEntry.setColorIndex(addColorInterpolator(rFill.getBColor(a), rFill.getBColor(b), fInvYDelta));
187cdf0e10cSrcweir             }
188cdf0e10cSrcweir 
189cdf0e10cSrcweir             if(rFill.areNormalsUsed())
190cdf0e10cSrcweir             {
191cdf0e10cSrcweir                 rEntry.setNormalIndex(addNormalInterpolator(rFill.getNormal(a), rFill.getNormal(b), fInvYDelta));
192cdf0e10cSrcweir             }
193cdf0e10cSrcweir 
194cdf0e10cSrcweir             if(rFill.areTextureCoordinatesUsed())
195cdf0e10cSrcweir             {
196cdf0e10cSrcweir                 if(pViewToEye)
197cdf0e10cSrcweir                 {
198cdf0e10cSrcweir                     const double fEyeA(((*pViewToEye) * aStart).getZ());
199cdf0e10cSrcweir                     const double fEyeB(((*pViewToEye) * aEnd).getZ());
200cdf0e10cSrcweir 
201cdf0e10cSrcweir                     rEntry.setInverseTextureIndex(addInverseTextureInterpolator(
202cdf0e10cSrcweir                         rFill.getTextureCoordinate(a),
203cdf0e10cSrcweir                         rFill.getTextureCoordinate(b),
204cdf0e10cSrcweir                         fEyeA, fEyeB, fInvYDelta));
205cdf0e10cSrcweir                 }
206cdf0e10cSrcweir                 else
207cdf0e10cSrcweir                 {
208cdf0e10cSrcweir                     rEntry.setTextureIndex(addTextureInterpolator(
209cdf0e10cSrcweir                         rFill.getTextureCoordinate(a),
210cdf0e10cSrcweir                         rFill.getTextureCoordinate(b),
211cdf0e10cSrcweir                         fInvYDelta));
212cdf0e10cSrcweir                 }
213cdf0e10cSrcweir             }
214cdf0e10cSrcweir         }
215cdf0e10cSrcweir     }
216cdf0e10cSrcweir 
rasterconvertB3DEdge(const B3DPolygon & rLine,sal_uInt32 nA,sal_uInt32 nB,sal_Int32 nStartLine,sal_Int32 nStopLine,sal_uInt16 nLineWidth)217cdf0e10cSrcweir     void RasterConverter3D::rasterconvertB3DEdge(const B3DPolygon& rLine, sal_uInt32 nA, sal_uInt32 nB, sal_Int32 nStartLine, sal_Int32 nStopLine, sal_uInt16 nLineWidth)
218cdf0e10cSrcweir     {
219cdf0e10cSrcweir         B3DPoint aStart(rLine.getB3DPoint(nA));
220cdf0e10cSrcweir         B3DPoint aEnd(rLine.getB3DPoint(nB));
221cdf0e10cSrcweir         const double fZBufferLineAdd(0x00ff);
222cdf0e10cSrcweir         static bool bForceToPolygon(false);
223cdf0e10cSrcweir 
224cdf0e10cSrcweir         if(nLineWidth > 1 || bForceToPolygon)
225cdf0e10cSrcweir         {
226cdf0e10cSrcweir             // this is not a hairline anymore, in most cases since it's an oversampled
227cdf0e10cSrcweir             // hairline to get e.g. AA for Z-Buffering. Create fill geometry.
228cdf0e10cSrcweir             if(!aStart.equal(aEnd))
229cdf0e10cSrcweir             {
230cdf0e10cSrcweir                 reset();
231cdf0e10cSrcweir                 maLineEntries.clear();
232cdf0e10cSrcweir 
233cdf0e10cSrcweir                 B2DVector aVector(aEnd.getX() - aStart.getX(), aEnd.getY() - aStart.getY());
234cdf0e10cSrcweir                 aVector.normalize();
235cdf0e10cSrcweir                 const B2DVector aPerpend(getPerpendicular(aVector) * ((static_cast<double>(nLineWidth) + 0.5) * 0.5));
236cdf0e10cSrcweir                 const double fZStartWithAdd(aStart.getZ() + fZBufferLineAdd);
237cdf0e10cSrcweir                 const double fZEndWithAdd(aEnd.getZ() + fZBufferLineAdd);
238cdf0e10cSrcweir 
239cdf0e10cSrcweir                 B3DPolygon aPolygon;
240cdf0e10cSrcweir                 aPolygon.append(B3DPoint(aStart.getX() + aPerpend.getX(), aStart.getY() + aPerpend.getY(), fZStartWithAdd));
241cdf0e10cSrcweir                 aPolygon.append(B3DPoint(aEnd.getX() + aPerpend.getX(), aEnd.getY() + aPerpend.getY(), fZEndWithAdd));
242cdf0e10cSrcweir                 aPolygon.append(B3DPoint(aEnd.getX() - aPerpend.getX(), aEnd.getY() - aPerpend.getY(), fZEndWithAdd));
243cdf0e10cSrcweir                 aPolygon.append(B3DPoint(aStart.getX() - aPerpend.getX(), aStart.getY() - aPerpend.getY(), fZStartWithAdd));
244cdf0e10cSrcweir                 aPolygon.setClosed(true);
245cdf0e10cSrcweir 
246cdf0e10cSrcweir                 addArea(aPolygon, 0);
247cdf0e10cSrcweir             }
248cdf0e10cSrcweir         }
249cdf0e10cSrcweir         else
250cdf0e10cSrcweir         {
251cdf0e10cSrcweir             // it's a hairline. Use direct RasterConversionLineEntry creation to
252cdf0e10cSrcweir             // rasterconvert lines as similar to areas as possible to avoid Z-Fighting
253cdf0e10cSrcweir             sal_Int32 nYStart(fround(aStart.getY()));
254cdf0e10cSrcweir             sal_Int32 nYEnd(fround(aEnd.getY()));
255cdf0e10cSrcweir 
256cdf0e10cSrcweir             if(nYStart == nYEnd)
257cdf0e10cSrcweir             {
258cdf0e10cSrcweir                 // horizontal line, check X
259cdf0e10cSrcweir                 const sal_Int32 nXStart(static_cast<sal_Int32>(aStart.getX()));
260cdf0e10cSrcweir                 const sal_Int32 nXEnd(static_cast<sal_Int32>(aEnd.getX()));
261cdf0e10cSrcweir 
262cdf0e10cSrcweir                 if(nXStart != nXEnd)
263cdf0e10cSrcweir                 {
264cdf0e10cSrcweir                     reset();
265cdf0e10cSrcweir                     maLineEntries.clear();
266cdf0e10cSrcweir 
267cdf0e10cSrcweir                     // horizontal line, create vertical entries. These will be sorted by
268cdf0e10cSrcweir                     // X anyways, so no need to distinguish the case here
269cdf0e10cSrcweir                     maLineEntries.push_back(RasterConversionLineEntry3D(
270cdf0e10cSrcweir                         aStart.getX(), 0.0,
271cdf0e10cSrcweir                         aStart.getZ() + fZBufferLineAdd, 0.0,
272cdf0e10cSrcweir                         nYStart, 1));
273cdf0e10cSrcweir                     maLineEntries.push_back(RasterConversionLineEntry3D(
274cdf0e10cSrcweir                         aEnd.getX(), 0.0,
275cdf0e10cSrcweir                         aEnd.getZ() + fZBufferLineAdd, 0.0,
276cdf0e10cSrcweir                         nYStart, 1));
277cdf0e10cSrcweir                 }
278cdf0e10cSrcweir             }
279cdf0e10cSrcweir             else
280cdf0e10cSrcweir             {
281cdf0e10cSrcweir                 reset();
282cdf0e10cSrcweir                 maLineEntries.clear();
283cdf0e10cSrcweir 
284cdf0e10cSrcweir                 if(nYStart > nYEnd)
285cdf0e10cSrcweir                 {
286cdf0e10cSrcweir                     ::std::swap(aStart, aEnd);
287cdf0e10cSrcweir                     ::std::swap(nYStart, nYEnd);
288cdf0e10cSrcweir                 }
289cdf0e10cSrcweir 
290cdf0e10cSrcweir                 const sal_uInt32 nYDelta(static_cast<sal_uInt32>(nYEnd - nYStart));
291cdf0e10cSrcweir                 const double fInvYDelta(1.0 / nYDelta);
292cdf0e10cSrcweir 
29330acf5e8Spfg                 // non-horizontal line, create two parallel entries. These will be sorted by
294cdf0e10cSrcweir                 // X anyways, so no need to distinguish the case here
295cdf0e10cSrcweir                 maLineEntries.push_back(RasterConversionLineEntry3D(
296cdf0e10cSrcweir                     aStart.getX(), (aEnd.getX() - aStart.getX()) * fInvYDelta,
297cdf0e10cSrcweir                     aStart.getZ() + fZBufferLineAdd, (aEnd.getZ() - aStart.getZ()) * fInvYDelta,
298cdf0e10cSrcweir                     nYStart, nYDelta));
299cdf0e10cSrcweir 
300cdf0e10cSrcweir                 RasterConversionLineEntry3D& rEntry = maLineEntries[maLineEntries.size() - 1];
301cdf0e10cSrcweir 
302cdf0e10cSrcweir                 // need to choose a X-Distance for the 2nd edge which guarantees all pixels
303cdf0e10cSrcweir                 // of the line to be set. This is exactly the X-Increment for one Y-Step.
304cdf0e10cSrcweir                 // Same is true for Z, so in both cases, add one increment to them. To also
305cdf0e10cSrcweir                 // guarantee one pixel per line, add a minimum of one for X.
306cdf0e10cSrcweir                 const double fDistanceX(fabs(rEntry.getX().getInc()) >= 1.0 ? rEntry.getX().getInc() : 1.0);
307cdf0e10cSrcweir 
308cdf0e10cSrcweir                 maLineEntries.push_back(RasterConversionLineEntry3D(
309cdf0e10cSrcweir                     rEntry.getX().getVal() + fDistanceX, rEntry.getX().getInc(),
310cdf0e10cSrcweir                     rEntry.getZ().getVal() + rEntry.getZ().getInc(), rEntry.getZ().getInc(),
311cdf0e10cSrcweir                     nYStart, nYDelta));
312cdf0e10cSrcweir             }
313cdf0e10cSrcweir         }
314cdf0e10cSrcweir 
315cdf0e10cSrcweir         if(maLineEntries.size())
316cdf0e10cSrcweir         {
317cdf0e10cSrcweir             rasterconvertB3DArea(nStartLine, nStopLine);
318cdf0e10cSrcweir         }
319cdf0e10cSrcweir     }
320cdf0e10cSrcweir 
rasterconvertB3DPolyPolygon(const B3DPolyPolygon & rFill,const B3DHomMatrix * pViewToEye,sal_Int32 nStartLine,sal_Int32 nStopLine)321cdf0e10cSrcweir     void RasterConverter3D::rasterconvertB3DPolyPolygon(const B3DPolyPolygon& rFill, const B3DHomMatrix* pViewToEye, sal_Int32 nStartLine, sal_Int32 nStopLine)
322cdf0e10cSrcweir     {
323cdf0e10cSrcweir         reset();
324cdf0e10cSrcweir         maLineEntries.clear();
325cdf0e10cSrcweir         addArea(rFill, pViewToEye);
326cdf0e10cSrcweir         rasterconvertB3DArea(nStartLine, nStopLine);
327cdf0e10cSrcweir     }
328cdf0e10cSrcweir 
rasterconvertB3DPolygon(const B3DPolygon & rLine,sal_Int32 nStartLine,sal_Int32 nStopLine,sal_uInt16 nLineWidth)329cdf0e10cSrcweir     void RasterConverter3D::rasterconvertB3DPolygon(const B3DPolygon& rLine, sal_Int32 nStartLine, sal_Int32 nStopLine, sal_uInt16 nLineWidth)
330cdf0e10cSrcweir     {
331cdf0e10cSrcweir         const sal_uInt32 nPointCount(rLine.count());
332cdf0e10cSrcweir 
333cdf0e10cSrcweir         if(nPointCount)
334cdf0e10cSrcweir         {
335cdf0e10cSrcweir             const sal_uInt32 nEdgeCount(rLine.isClosed() ? nPointCount : nPointCount - 1);
336cdf0e10cSrcweir 
337cdf0e10cSrcweir             for(sal_uInt32 a(0); a < nEdgeCount; a++)
338cdf0e10cSrcweir             {
339cdf0e10cSrcweir                 rasterconvertB3DEdge(rLine, a, (a + 1) % nPointCount, nStartLine, nStopLine, nLineWidth);
340cdf0e10cSrcweir             }
341cdf0e10cSrcweir         }
342cdf0e10cSrcweir     }
343cdf0e10cSrcweir } // end of namespace basegfx
344cdf0e10cSrcweir 
345*18e39f1bSmseidel /* vim: set noet sw=4 ts=4: */
346