1*cdf0e10cSrcweir/************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir#ifndef __com_sun_star_rendering_XBezierPolyPolygon2D_idl__ 28*cdf0e10cSrcweir#define __com_sun_star_rendering_XBezierPolyPolygon2D_idl__ 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__ 31*cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl> 32*cdf0e10cSrcweir#endif 33*cdf0e10cSrcweir#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__ 34*cdf0e10cSrcweir#include <com/sun/star/lang/IndexOutOfBoundsException.idl> 35*cdf0e10cSrcweir#endif 36*cdf0e10cSrcweir#ifndef __com_sun_star_rendering_XPolyPolygon2D_idl__ 37*cdf0e10cSrcweir#include <com/sun/star/rendering/XPolyPolygon2D.idl> 38*cdf0e10cSrcweir#endif 39*cdf0e10cSrcweir#ifndef __com_sun_star_geometry_RealBezierSegment2D_idl__ 40*cdf0e10cSrcweir#include <com/sun/star/geometry/RealBezierSegment2D.idl> 41*cdf0e10cSrcweir#endif 42*cdf0e10cSrcweir 43*cdf0e10cSrcweirmodule com { module sun { module star { module rendering { 44*cdf0e10cSrcweir 45*cdf0e10cSrcweir/** This is a specialized interface for a 2D poly-polygon containing 46*cdf0e10cSrcweir straight line and bezier segments.<p> 47*cdf0e10cSrcweir 48*cdf0e10cSrcweir This poly-polygon can contain polygons consisting of a mixture of 49*cdf0e10cSrcweir cubic bezier curves and straight lines. As the straight line is a 50*cdf0e10cSrcweir special case of a cubic bezier curve (control points collinear 51*cdf0e10cSrcweir with the line through start and end point), this can be expressed 52*cdf0e10cSrcweir uniformly with a sequence of <type>RealBezierSegment2D</type>s.<p> 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir By convention, a <type>RealBezierSegment2D</type> is a straight 55*cdf0e10cSrcweir line segment, if all three contained points are strictly equal.<p> 56*cdf0e10cSrcweir 57*cdf0e10cSrcweir @since OOo 2.0 58*cdf0e10cSrcweir */ 59*cdf0e10cSrcweirpublished interface XBezierPolyPolygon2D : XPolyPolygon2D 60*cdf0e10cSrcweir{ 61*cdf0e10cSrcweir /** Query subset of this poly-polygon.<p> 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir Query subset of this poly-polygon, starting at the given 64*cdf0e10cSrcweir polygon and the given point within that polygon, and 65*cdf0e10cSrcweir containing the specified number of polygons and points in the 66*cdf0e10cSrcweir last polygon.<p> 67*cdf0e10cSrcweir 68*cdf0e10cSrcweir @param nPolygonIndex 69*cdf0e10cSrcweir The index of the polygon to start point retrieval with. This 70*cdf0e10cSrcweir index must be in the range [0,numPolygons-1]. 71*cdf0e10cSrcweir 72*cdf0e10cSrcweir @param nNumberOfPolygons 73*cdf0e10cSrcweir The number of polygons to extract. This value must not exceed 74*cdf0e10cSrcweir numPolygons-nPolygonIndex. 75*cdf0e10cSrcweir 76*cdf0e10cSrcweir @param nPointIndex 77*cdf0e10cSrcweir The index of the first point in the first polygon to 78*cdf0e10cSrcweir extract. This value must not exceed the number of points in 79*cdf0e10cSrcweir this polygon minus one. 80*cdf0e10cSrcweir 81*cdf0e10cSrcweir @param nNumberOfPoints 82*cdf0e10cSrcweir The number of points to extract from the last polygon. This 83*cdf0e10cSrcweir value must not exceed the number of points in this last 84*cdf0e10cSrcweir polygon minus one. 85*cdf0e10cSrcweir 86*cdf0e10cSrcweir @returns the sequence of extracted points. 87*cdf0e10cSrcweir 88*cdf0e10cSrcweir @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type> 89*cdf0e10cSrcweir if one of the given values exceed the permissible range. 90*cdf0e10cSrcweir */ 91*cdf0e10cSrcweir sequence< sequence < ::com::sun::star::geometry::RealBezierSegment2D > > getBezierSegments( [in] long nPolygonIndex, [in] long nNumberOfPolygons, [in] long nPointIndex, [in] long nNumberOfPoints ) 92*cdf0e10cSrcweir raises (com::sun::star::lang::IndexOutOfBoundsException); 93*cdf0e10cSrcweir 94*cdf0e10cSrcweir //------------------------------------------------------------------------- 95*cdf0e10cSrcweir 96*cdf0e10cSrcweir /** Set the specified sequence of bezier segments to the poly-polygon. 97*cdf0e10cSrcweir 98*cdf0e10cSrcweir This method can either set the whole poly-polygon to the new 99*cdf0e10cSrcweir data, or insert the segments at the given index 100*cdf0e10cSrcweir 101*cdf0e10cSrcweir @param nPolygonIndex 102*cdf0e10cSrcweir The index of the polygon to start segment insertion with. This 103*cdf0e10cSrcweir index must be in the range [0,numPolygons], and the insertion 104*cdf0e10cSrcweir will take place <em>before</em> this position (i.e. when 105*cdf0e10cSrcweir specifying 0 here, the given bezier sequence will precede all 106*cdf0e10cSrcweir existing polygons already within the poly-polygon). To append 107*cdf0e10cSrcweir to a poly-polygon, call setPoints() with 108*cdf0e10cSrcweir <member>XBezierPolyPolygon2D::getNumberOfPolygons()</member> 109*cdf0e10cSrcweir as the polygon index. If nPolygonIndex is -1, the given 110*cdf0e10cSrcweir bezier sequence <em>replaces</em> the poly-polygon content, 111*cdf0e10cSrcweir such that after this method completes, it contains exactly the 112*cdf0e10cSrcweir specified bezier segment data. 113*cdf0e10cSrcweir 114*cdf0e10cSrcweir @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type> 115*cdf0e10cSrcweir if one of the given values exceed the permissible range. 116*cdf0e10cSrcweir */ 117*cdf0e10cSrcweir void setBezierSegments( [in] sequence< sequence< ::com::sun::star::geometry::RealBezierSegment2D > > points, [in] long nPolygonIndex ) 118*cdf0e10cSrcweir raises (com::sun::star::lang::IndexOutOfBoundsException); 119*cdf0e10cSrcweir 120*cdf0e10cSrcweir //------------------------------------------------------------------------- 121*cdf0e10cSrcweir 122*cdf0e10cSrcweir /** Get a single point from the poly-polygon. 123*cdf0e10cSrcweir 124*cdf0e10cSrcweir @param nPolygonIndex 125*cdf0e10cSrcweir The index of the polygon where the point to be extract is 126*cdf0e10cSrcweir contained within. This index must be in the range 127*cdf0e10cSrcweir [0,numPolygons-1]. 128*cdf0e10cSrcweir 129*cdf0e10cSrcweir @param nPointIndex 130*cdf0e10cSrcweir The index of the point in the polygon specified by 131*cdf0e10cSrcweir nPolygonIndex, which is to be retrieved. This value must not 132*cdf0e10cSrcweir exceed the number of points in this polygon minus one. 133*cdf0e10cSrcweir 134*cdf0e10cSrcweir @returns the requested point. 135*cdf0e10cSrcweir 136*cdf0e10cSrcweir @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type> 137*cdf0e10cSrcweir if one of the given values exceed the permissible range. 138*cdf0e10cSrcweir 139*cdf0e10cSrcweir */ 140*cdf0e10cSrcweir ::com::sun::star::geometry::RealBezierSegment2D getBezierSegment( [in] long nPolygonIndex, [in] long nPointIndex ) 141*cdf0e10cSrcweir raises (com::sun::star::lang::IndexOutOfBoundsException); 142*cdf0e10cSrcweir 143*cdf0e10cSrcweir //------------------------------------------------------------------------- 144*cdf0e10cSrcweir 145*cdf0e10cSrcweir /** Set a single point on the poly-polygon.<p> 146*cdf0e10cSrcweir 147*cdf0e10cSrcweir The remaining points of the poly-polygon will not be changed by 148*cdf0e10cSrcweir this method. Use 149*cdf0e10cSrcweir <member>XBezierPolyPolygon2D::getNumberOfPolygons()</member> 150*cdf0e10cSrcweir or 151*cdf0e10cSrcweir <member>XBezierPolyPolygon2D::getNumberOfPolygonPoints()</member> 152*cdf0e10cSrcweir to append points or polygons, respectively.<p> 153*cdf0e10cSrcweir 154*cdf0e10cSrcweir @param point 155*cdf0e10cSrcweir The point to be set at the poly-polygon. 156*cdf0e10cSrcweir 157*cdf0e10cSrcweir @param nPolygonIndex 158*cdf0e10cSrcweir The index of the polygon to insert the point in. This index 159*cdf0e10cSrcweir must be in the range [0,numPolygons]. 160*cdf0e10cSrcweir 161*cdf0e10cSrcweir @param nPointIndex 162*cdf0e10cSrcweir The index of the point in the polygon specified by 163*cdf0e10cSrcweir nPolygonIndex, which is to be set. This value must not 164*cdf0e10cSrcweir exceed the number of points in this polygon. 165*cdf0e10cSrcweir 166*cdf0e10cSrcweir @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type> 167*cdf0e10cSrcweir if one of the given values exceed the permissible range. 168*cdf0e10cSrcweir */ 169*cdf0e10cSrcweir void setBezierSegment( [in] ::com::sun::star::geometry::RealBezierSegment2D point, [in] long nPolygonIndex, [in] long nPointIndex ) 170*cdf0e10cSrcweir raises (com::sun::star::lang::IndexOutOfBoundsException); 171*cdf0e10cSrcweir}; 172*cdf0e10cSrcweir 173*cdf0e10cSrcweir}; }; }; }; 174*cdf0e10cSrcweir 175*cdf0e10cSrcweir#endif 176