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