1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23#ifndef __com_sun_star_rendering_XBezierPolyPolygon2D_idl__ 24#define __com_sun_star_rendering_XBezierPolyPolygon2D_idl__ 25 26#ifndef __com_sun_star_uno_XInterface_idl__ 27#include <com/sun/star/uno/XInterface.idl> 28#endif 29#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__ 30#include <com/sun/star/lang/IndexOutOfBoundsException.idl> 31#endif 32#ifndef __com_sun_star_rendering_XPolyPolygon2D_idl__ 33#include <com/sun/star/rendering/XPolyPolygon2D.idl> 34#endif 35#ifndef __com_sun_star_geometry_RealBezierSegment2D_idl__ 36#include <com/sun/star/geometry/RealBezierSegment2D.idl> 37#endif 38 39module com { module sun { module star { module rendering { 40 41/** This is a specialized interface for a 2D poly-polygon containing 42 straight line and bezier segments.<p> 43 44 This poly-polygon can contain polygons consisting of a mixture of 45 cubic bezier curves and straight lines. As the straight line is a 46 special case of a cubic bezier curve (control points collinear 47 with the line through start and end point), this can be expressed 48 uniformly with a sequence of <type>RealBezierSegment2D</type>s.<p> 49 50 By convention, a <type>RealBezierSegment2D</type> is a straight 51 line segment, if all three contained points are strictly equal.<p> 52 53 @since OOo 2.0 54 */ 55published interface XBezierPolyPolygon2D : XPolyPolygon2D 56{ 57 /** Query subset of this poly-polygon.<p> 58 59 Query subset of this poly-polygon, starting at the given 60 polygon and the given point within that polygon, and 61 containing the specified number of polygons and points in the 62 last polygon.<p> 63 64 @param nPolygonIndex 65 The index of the polygon to start point retrieval with. This 66 index must be in the range [0,numPolygons-1]. 67 68 @param nNumberOfPolygons 69 The number of polygons to extract. This value must not exceed 70 numPolygons-nPolygonIndex. 71 72 @param nPointIndex 73 The index of the first point in the first polygon to 74 extract. This value must not exceed the number of points in 75 this polygon minus one. 76 77 @param nNumberOfPoints 78 The number of points to extract from the last polygon. This 79 value must not exceed the number of points in this last 80 polygon minus one. 81 82 @returns the sequence of extracted points. 83 84 @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type> 85 if one of the given values exceed the permissible range. 86 */ 87 sequence< sequence < ::com::sun::star::geometry::RealBezierSegment2D > > getBezierSegments( [in] long nPolygonIndex, [in] long nNumberOfPolygons, [in] long nPointIndex, [in] long nNumberOfPoints ) 88 raises (com::sun::star::lang::IndexOutOfBoundsException); 89 90 //------------------------------------------------------------------------- 91 92 /** Set the specified sequence of bezier segments to the poly-polygon. 93 94 This method can either set the whole poly-polygon to the new 95 data, or insert the segments at the given index 96 97 @param nPolygonIndex 98 The index of the polygon to start segment insertion with. This 99 index must be in the range [0,numPolygons], and the insertion 100 will take place <em>before</em> this position (i.e. when 101 specifying 0 here, the given bezier sequence will precede all 102 existing polygons already within the poly-polygon). To append 103 to a poly-polygon, call setPoints() with 104 <member>XBezierPolyPolygon2D::getNumberOfPolygons()</member> 105 as the polygon index. If nPolygonIndex is -1, the given 106 bezier sequence <em>replaces</em> the poly-polygon content, 107 such that after this method completes, it contains exactly the 108 specified bezier segment data. 109 110 @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type> 111 if one of the given values exceed the permissible range. 112 */ 113 void setBezierSegments( [in] sequence< sequence< ::com::sun::star::geometry::RealBezierSegment2D > > points, [in] long nPolygonIndex ) 114 raises (com::sun::star::lang::IndexOutOfBoundsException); 115 116 //------------------------------------------------------------------------- 117 118 /** Get a single point from the poly-polygon. 119 120 @param nPolygonIndex 121 The index of the polygon where the point to be extract is 122 contained within. This index must be in the range 123 [0,numPolygons-1]. 124 125 @param nPointIndex 126 The index of the point in the polygon specified by 127 nPolygonIndex, which is to be retrieved. This value must not 128 exceed the number of points in this polygon minus one. 129 130 @returns the requested point. 131 132 @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type> 133 if one of the given values exceed the permissible range. 134 135 */ 136 ::com::sun::star::geometry::RealBezierSegment2D getBezierSegment( [in] long nPolygonIndex, [in] long nPointIndex ) 137 raises (com::sun::star::lang::IndexOutOfBoundsException); 138 139 //------------------------------------------------------------------------- 140 141 /** Set a single point on the poly-polygon.<p> 142 143 The remaining points of the poly-polygon will not be changed by 144 this method. Use 145 <member>XBezierPolyPolygon2D::getNumberOfPolygons()</member> 146 or 147 <member>XBezierPolyPolygon2D::getNumberOfPolygonPoints()</member> 148 to append points or polygons, respectively.<p> 149 150 @param point 151 The point to be set at the poly-polygon. 152 153 @param nPolygonIndex 154 The index of the polygon to insert the point in. This index 155 must be in the range [0,numPolygons]. 156 157 @param nPointIndex 158 The index of the point in the polygon specified by 159 nPolygonIndex, which is to be set. This value must not 160 exceed the number of points in this polygon. 161 162 @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type> 163 if one of the given values exceed the permissible range. 164 */ 165 void setBezierSegment( [in] ::com::sun::star::geometry::RealBezierSegment2D point, [in] long nPolygonIndex, [in] long nPointIndex ) 166 raises (com::sun::star::lang::IndexOutOfBoundsException); 167}; 168 169}; }; }; }; 170 171#endif 172