18#include <com/sun/star/rendering/ARGBColor.hpp>
32 const ::basegfx::B2DRange& rBounds(aPolyPoly.
getB2DRange());
33 const double nWidth=rBounds.getWidth();
34 const double nHeight=rBounds.getHeight();
35 const ::basegfx::triangulator::B2DTriangleVector rTriangulatedPolygon(
36 ::basegfx::triangulator::triangulate(aPolyPoly));
38 for(
auto const& rTriangulatedPolygonItem : rTriangulatedPolygon )
40 const::basegfx::triangulator::B2DTriangle& rCandidate(rTriangulatedPolygonItem);
42 rCandidate.getA().getX()/nWidth,
43 rCandidate.getA().getY()/nHeight);
45 rCandidate.getA().getX(),
46 rCandidate.getA().getY());
49 rCandidate.getB().getX()/nWidth,
50 rCandidate.getB().getY()/nHeight);
52 rCandidate.getB().getX(),
53 rCandidate.getB().getY());
56 rCandidate.getC().getX()/nWidth,
57 rCandidate.getC().getY()/nHeight);
59 rCandidate.getC().getX(),
60 rCandidate.getC().getY());
74 for( sal_uInt32
i=0;
i<aPolyPoly.
count();
i++ )
76 glBegin(GL_LINE_STRIP);
78 const ::basegfx::B2DPolygon& rPolygon( aPolyPoly.
getB2DPolygon(
i) );
80 const sal_uInt32 nPts=rPolygon.count();
81 const sal_uInt32 nExtPts=nPts +
int(rPolygon.isClosed());
82 for( sal_uInt32 j=0; j<nExtPts; j++ )
84 const ::basegfx::B2DPoint& rPt( rPolygon.getB2DPoint( j % nPts ) );
85 glVertex2d(rPt.getX(), rPt.getY());
92 void setupState( const ::basegfx::B2DHomMatrix& rTransform,
95 const rendering::ARGBColor& rColor )
97 double aGLTransform[] =
99 rTransform.get(0,0), rTransform.get(1,0), 0, 0,
100 rTransform.get(0,1), rTransform.get(1,1), 0, 0,
102 rTransform.get(0,2), rTransform.get(1,2), 0, 1
104 glMultMatrixd(aGLTransform);
107 glBlendFunc(eSrcBlend, eDstBlend);
109 glColor4d(rColor.Red,
122 void renderOSD(
const std::vector<double>& rNumbers,
double scale )
130 for(
double rNumber : rNumbers)
139 aTmp=aTmp*aScaleShear;
void translate(double fX, double fY)
void scale(double fX, double fY)
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
void transform(const basegfx::B2DHomMatrix &rMatrix)
B2DRange getB2DRange() const
bool areControlPointsUsed() const
B2DPolyPolygon getDefaultAdaptiveSubdivision() const
B2DPolyPolygon number2PolyPolygon(double fVal, sal_Int32 nTotalDigits, sal_Int32 nDecPlaces, bool bLitSegments=true)
void renderComplexPolyPolygon(const ::basegfx::B2DPolyPolygon &rPolyPoly)
triangulates polygon before
void renderOSD(const std::vector< double > &rNumbers, double scale)
void setupState(const ::basegfx::B2DHomMatrix &rTransform, GLenum eSrcBlend, GLenum eDstBlend, const rendering::ARGBColor &rColor)
void renderPolyPolygon(const ::basegfx::B2DPolyPolygon &rPolyPoly)
only use this for line polygons.
const wchar_t *typedef int(__stdcall *DllNativeUnregProc)(int