xref: /aoo41x/main/tools/inc/poly.h (revision 514f4c20)
1*514f4c20SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*514f4c20SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*514f4c20SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*514f4c20SAndrew Rist  * distributed with this work for additional information
6*514f4c20SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*514f4c20SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*514f4c20SAndrew Rist  * "License"); you may not use this file except in compliance
9*514f4c20SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*514f4c20SAndrew Rist  *
11*514f4c20SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*514f4c20SAndrew Rist  *
13*514f4c20SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*514f4c20SAndrew Rist  * software distributed under the License is distributed on an
15*514f4c20SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*514f4c20SAndrew Rist  * KIND, either express or implied.  See the License for the
17*514f4c20SAndrew Rist  * specific language governing permissions and limitations
18*514f4c20SAndrew Rist  * under the License.
19*514f4c20SAndrew Rist  *
20*514f4c20SAndrew Rist  *************************************************************/
21*514f4c20SAndrew Rist 
22*514f4c20SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _POLY_H
25cdf0e10cSrcweir #define _POLY_H
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <tools/gen.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #define MAX_64KPOINTS       ((((sal_uInt16)0xFFFF)-32)/sizeof(Point))
30cdf0e10cSrcweir 
31cdf0e10cSrcweir // -------------------
32cdf0e10cSrcweir // - ImplPolygonData -
33cdf0e10cSrcweir // -------------------
34cdf0e10cSrcweir 
35cdf0e10cSrcweir class ImplPolygonData
36cdf0e10cSrcweir {
37cdf0e10cSrcweir public:
38cdf0e10cSrcweir     Point*          mpPointAry;
39cdf0e10cSrcweir     sal_uInt8*           mpFlagAry;
40cdf0e10cSrcweir     sal_uInt16          mnPoints;
41cdf0e10cSrcweir     sal_uIntPtr           mnRefCount;
42cdf0e10cSrcweir };
43cdf0e10cSrcweir 
44cdf0e10cSrcweir // ---------------
45cdf0e10cSrcweir // - ImplPolygon -
46cdf0e10cSrcweir // ---------------
47cdf0e10cSrcweir 
48cdf0e10cSrcweir class ImplPolygon  : public ImplPolygonData
49cdf0e10cSrcweir {
50cdf0e10cSrcweir public:
51cdf0e10cSrcweir                     ImplPolygon( sal_uInt16 nInitSize, sal_Bool bFlags = sal_False );
52cdf0e10cSrcweir                     ImplPolygon( sal_uInt16 nPoints, const Point* pPtAry, const sal_uInt8* pInitFlags = NULL );
53cdf0e10cSrcweir                     ImplPolygon( const ImplPolygon& rImplPoly );
54cdf0e10cSrcweir                     ~ImplPolygon();
55cdf0e10cSrcweir 
56cdf0e10cSrcweir     void            ImplSetSize( sal_uInt16 nSize, sal_Bool bResize = sal_True );
57cdf0e10cSrcweir     void            ImplCreateFlagArray();
58cdf0e10cSrcweir     void            ImplSplit( sal_uInt16 nPos, sal_uInt16 nSpace, ImplPolygon* pInitPoly = NULL );
59cdf0e10cSrcweir     void            ImplRemove( sal_uInt16 nPos, sal_uInt16 nCount );
60cdf0e10cSrcweir };
61cdf0e10cSrcweir 
62cdf0e10cSrcweir // -------------------
63cdf0e10cSrcweir // - ImplPolyPolygon -
64cdf0e10cSrcweir // -------------------
65cdf0e10cSrcweir 
66cdf0e10cSrcweir #define MAX_POLYGONS        ((sal_uInt16)0x3FF0)
67cdf0e10cSrcweir 
68cdf0e10cSrcweir class Polygon;
69cdf0e10cSrcweir typedef Polygon* SVPPOLYGON;
70cdf0e10cSrcweir 
71cdf0e10cSrcweir class ImplPolyPolygon
72cdf0e10cSrcweir {
73cdf0e10cSrcweir public:
74cdf0e10cSrcweir     SVPPOLYGON*     mpPolyAry;
75cdf0e10cSrcweir     sal_uIntPtr           mnRefCount;
76cdf0e10cSrcweir     sal_uInt16          mnCount;
77cdf0e10cSrcweir     sal_uInt16          mnSize;
78cdf0e10cSrcweir     sal_uInt16          mnResize;
79cdf0e10cSrcweir 
ImplPolyPolygon(sal_uInt16 nInitSize,sal_uInt16 nResize)80cdf0e10cSrcweir                     ImplPolyPolygon( sal_uInt16 nInitSize, sal_uInt16 nResize )
81cdf0e10cSrcweir                         { mpPolyAry = NULL; mnCount = 0; mnRefCount = 1;
82cdf0e10cSrcweir                           mnSize = nInitSize; mnResize = nResize; }
83cdf0e10cSrcweir                     ImplPolyPolygon( sal_uInt16 nInitSize );
84cdf0e10cSrcweir                     ImplPolyPolygon( const ImplPolyPolygon& rImplPolyPoly );
85cdf0e10cSrcweir                     ~ImplPolyPolygon();
86cdf0e10cSrcweir };
87cdf0e10cSrcweir 
88cdf0e10cSrcweir #endif // _SV_POLY_H
89