21#include <rtl/math.hxx>
22#include <osl/diagnose.h>
24#include <com/sun/star/rendering/XCanvas.hpp>
25#include <com/sun/star/rendering/PathJoinType.hpp>
26#include <com/sun/star/rendering/PathCapType.hpp>
39 uno::Reference< rendering::XPolyPolygon2D > xPolyPoly ) :
40 CanvasGraphicHelper( rParentCanvas ),
46 rendering::PathCapType::
ROUND,
47 rendering::PathCapType::
ROUND,
48 rendering::PathJoinType::
ROUND ),
49 mbFillColorSet( false ),
50 mbStrokeColorSet( false )
52 OSL_ENSURE(
mxPolyPoly.is(),
"PolyPolygonImpl::PolyPolygonImpl: no valid polygon" );
55 ImplPolyPolygon::~ImplPolyPolygon()
59 void ImplPolyPolygon::setRGBAFillColor(
IntSRGBA aColor )
62 mbFillColorSet =
true;
65 void ImplPolyPolygon::setRGBALineColor(
IntSRGBA aColor )
68 mbStrokeColorSet =
true;
71 IntSRGBA ImplPolyPolygon::getRGBALineColor()
const
76 void ImplPolyPolygon::setStrokeWidth(
const double& rStrokeWidth )
81 double ImplPolyPolygon::getStrokeWidth()
const
86 bool ImplPolyPolygon::draw()
const
90 OSL_ENSURE( pCanvas && pCanvas->getUNOCanvas().is(),
91 "ImplBitmap::draw: invalid canvas" );
94 !pCanvas->getUNOCanvas().is() )
99 rendering::RenderState aLocalState( getRenderState() );
102 pCanvas->getUNOCanvas()->fillPolyPolygon(
mxPolyPoly,
103 pCanvas->getViewState(),
107 if( mbStrokeColorSet )
109 rendering::RenderState aLocalState( getRenderState() );
110 aLocalState.DeviceColor = maStrokeColor;
113 pCanvas->getUNOCanvas()->drawPolyPolygon(
mxPolyPoly,
114 pCanvas->getViewState(),
117 pCanvas->getUNOCanvas()->strokePolyPolygon(
mxPolyPoly,
118 pCanvas->getViewState(),
126 uno::Reference< rendering::XPolyPolygon2D > ImplPolyPolygon::getUNOPolyPolygon()
const
ImplPolyPolygon(const CanvasSharedPtr &rParentCanvas, css::uno::Reference< css::rendering::XPolyPolygon2D > xPolyPoly)
sal_uInt32 IntSRGBA
Color in the sRGB color space, plus alpha channel.
std::shared_ptr< Canvas > CanvasSharedPtr
const uno::Reference< rendering::XPolyPolygon2D > mxPolyPoly
uno::Sequence< double > maFillColor
const rendering::StrokeAttributes maStrokeAttributes