20#include <com/sun/star/lang/IllegalArgumentException.hpp>
38 maPolyPoly(
std::move( aPolyPoly )),
39 meFillRule( rendering::FillRule_EVEN_ODD )
44 const geometry::RealPoint2D& position,
45 const uno::Reference< rendering::XPolyPolygon2D >& polyPolygon )
47 std::unique_lock
const guard(
m_aMutex );
54 const sal_Int32 nPolys( polyPolygon->getNumberOfPolygons() );
56 if( !polyPolygon.is() || !nPolys )
76 uno::Reference< rendering::XBezierPolyPolygon2D > xBezierPoly(
80 if( xBezierPoly.is() )
83 xBezierPoly->getBezierSegments( 0,
90 uno::Reference< rendering::XLinePolyPolygon2D > xLinePoly(
97 throw lang::IllegalArgumentException(
98 "UnoPolyPolygon::addPolyPolygon(): Invalid input "
99 "poly-polygon, cannot retrieve vertex data",
103 xLinePoly->getPoints( 0,
125 std::unique_lock
const guard(
m_aMutex );
132 std::unique_lock
const guard(
m_aMutex );
140 std::unique_lock
const guard(
m_aMutex );
145 rendering::FillRule fillRule )
147 std::unique_lock
const guard(
m_aMutex );
156 std::unique_lock
const guard(
m_aMutex );
166 std::unique_lock
const guard(
m_aMutex );
188 sal_Int32 nPolygonIndex,
189 sal_Int32 nNumberOfPolygons,
190 sal_Int32 nPointIndex,
191 sal_Int32 nNumberOfPoints )
201 const uno::Sequence< uno::Sequence< geometry::RealPoint2D > >& points,
202 sal_Int32 nPolygonIndex )
204 std::unique_lock
const guard(
m_aMutex );
210 if( nPolygonIndex == -1 )
223 sal_Int32 nPolygonIndex,
224 sal_Int32 nPointIndex )
226 std::unique_lock
const guard(
m_aMutex );
232 throw lang::IndexOutOfBoundsException();
238 const geometry::RealPoint2D& point,
239 sal_Int32 nPolygonIndex,
240 sal_Int32 nPointIndex )
242 std::unique_lock
const guard(
m_aMutex );
249 throw lang::IndexOutOfBoundsException();
257 sal_Int32 nPolygonIndex,
258 sal_Int32 nNumberOfPolygons,
259 sal_Int32 nPointIndex,
260 sal_Int32 nNumberOfPoints )
270 const uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > >& points,
271 sal_Int32 nPolygonIndex )
273 std::unique_lock
const guard(
m_aMutex );
278 if( nPolygonIndex == -1 )
291 sal_Int32 nPointIndex )
293 std::unique_lock
const guard(
m_aMutex );
297 const sal_uInt32 nPointCount(rPoly.
count());
300 throw lang::IndexOutOfBoundsException();
306 return geometry::RealBezierSegment2D( rPt.
getX(),
315 sal_Int32 nPolygonIndex,
316 sal_Int32 nPointIndex )
318 std::unique_lock
const guard(
m_aMutex );
323 const sal_uInt32 nPointCount(aPoly.
count());
326 throw lang::IndexOutOfBoundsException();
332 B2DPoint(segment.C1x, segment.C1y));
334 B2DPoint(segment.C2x, segment.C2y));
340 sal_Int32 nPolygonIndex,
341 sal_Int32 nNumberOfPolygons,
342 sal_Int32 nPointIndex,
343 sal_Int32 nNumberOfPoints )
const
345 std::unique_lock
const guard(
m_aMutex );
351 if( !nPolygonIndex &&
353 nNumberOfPolygons == nPolyCount &&
354 nNumberOfPoints == -1 )
363 for( sal_Int32
i=nPolygonIndex;
i<nNumberOfPolygons; ++
i )
369 sal_Int32 nFirstPoint(0);
370 sal_Int32 nLastPoint(nPolyCount-1);
372 if( nPointIndex &&
i==nPolygonIndex )
380 throw lang::IndexOutOfBoundsException();
382 nFirstPoint = nPointIndex;
385 if(
i==nNumberOfPolygons-1 && nNumberOfPoints != -1 )
392 throw lang::IndexOutOfBoundsException();
394 nLastPoint = nFirstPoint+nNumberOfPoints;
401 aSubsetPoly.
append( rCurrPoly );
405 if( nFirstPoint < 0 || nFirstPoint >= nPolyCount )
406 throw lang::IndexOutOfBoundsException();
408 if( nLastPoint < 0 || nLastPoint >= nPolyCount )
409 throw lang::IndexOutOfBoundsException();
412 for( sal_Int32 j=nFirstPoint; j<nLastPoint; ++j )
415 aSubsetPoly.
append( aTmp );
424 return "gfx::internal::UnoPolyPolygon";
434 return {
"com.sun.star.rendering.PolyPolygon2D" };
439 std::unique_lock
const guard(
m_aMutex );
Base Point class with two double values.
void insert(sal_uInt32 nIndex, const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
void setB2DPolygon(sal_uInt32 nIndex, const B2DPolygon &rPolygon)
void transform(const basegfx::B2DHomMatrix &rMatrix)
void setClosed(bool bNew)
void setB2DPoint(sal_uInt32 nIndex, const basegfx::B2DPoint &rValue)
void setPrevControlPoint(sal_uInt32 nIndex, const basegfx::B2DPoint &rValue)
bool isClosed() const
closed state interface
basegfx::B2DPoint const & getB2DPoint(sal_uInt32 nIndex) const
Coordinate interface.
void setNextControlPoint(sal_uInt32 nIndex, const basegfx::B2DPoint &rValue)
basegfx::B2DPoint getPrevControlPoint(sal_uInt32 nIndex) const
Basic ControlPoint interface.
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
sal_uInt32 count() const
member count
void setClosed(bool bNew)
basegfx::B2DPoint getNextControlPoint(sal_uInt32 nIndex) const
A two-dimensional interval over doubles.
B2DPoint getMinimum() const
get lower bound of the set. returns arbitrary values for empty sets.
Base Point class with two double values.
TYPE getX() const
Get X-Coordinate of 2D Tuple.
TYPE getY() const
Get Y-Coordinate of 2D Tuple.
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
B2DRange getRange(const B2DPolygon &rCandidate)
Get the range of a polygon.
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)