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