xref: /aoo42x/main/svx/inc/xpolyimp.hxx (revision 3334a7e6)
1*3334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*3334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*3334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*3334a7e6SAndrew Rist  * distributed with this work for additional information
6*3334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*3334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*3334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
9*3334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*3334a7e6SAndrew Rist  *
11*3334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*3334a7e6SAndrew Rist  *
13*3334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*3334a7e6SAndrew Rist  * software distributed under the License is distributed on an
15*3334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*3334a7e6SAndrew Rist  * specific language governing permissions and limitations
18*3334a7e6SAndrew Rist  * under the License.
19*3334a7e6SAndrew Rist  *
20*3334a7e6SAndrew Rist  *************************************************************/
21*3334a7e6SAndrew Rist 
22*3334a7e6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _XPOLYIMP_HXX
25cdf0e10cSrcweir #define _XPOLYIMP_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <tools/gen.hxx>
28cdf0e10cSrcweir #include <svx/xpoly.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir /*************************************************************************
31cdf0e10cSrcweir |*
32cdf0e10cSrcweir |*    class ImpXPolygon
33cdf0e10cSrcweir |*
34cdf0e10cSrcweir |*    Beschreibung
35cdf0e10cSrcweir |*    Ersterstellung       08.11.94
36cdf0e10cSrcweir |*    Letzte Aenderung Joe 26.09.95
37cdf0e10cSrcweir |*
38cdf0e10cSrcweir *************************************************************************/
39cdf0e10cSrcweir class ImpXPolygon
40cdf0e10cSrcweir {
41cdf0e10cSrcweir public:
42cdf0e10cSrcweir 	Point*          pPointAry;
43cdf0e10cSrcweir 	sal_uInt8*           pFlagAry;
44cdf0e10cSrcweir 	Point*          pOldPointAry;
45cdf0e10cSrcweir 	sal_Bool            bDeleteOldPoints;
46cdf0e10cSrcweir 	sal_uInt16          nSize;
47cdf0e10cSrcweir 	sal_uInt16          nResize;
48cdf0e10cSrcweir 	sal_uInt16          nPoints;
49cdf0e10cSrcweir 	sal_uInt16          nRefCount;
50cdf0e10cSrcweir 
51cdf0e10cSrcweir 	ImpXPolygon( sal_uInt16 nInitSize = 16, sal_uInt16 nResize=16 );
52cdf0e10cSrcweir 	ImpXPolygon( const ImpXPolygon& rImpXPoly );
53cdf0e10cSrcweir 	~ImpXPolygon();
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 	bool operator==(const ImpXPolygon& rImpXPoly) const;
operator !=(const ImpXPolygon & rImpXPoly) const56cdf0e10cSrcweir 	bool operator!=(const ImpXPolygon& rImpXPoly) const { return !operator==(rImpXPoly); }
57cdf0e10cSrcweir 
CheckPointDelete()58cdf0e10cSrcweir 	void CheckPointDelete()
59cdf0e10cSrcweir 	{
60cdf0e10cSrcweir 		if ( bDeleteOldPoints )
61cdf0e10cSrcweir 		{
62cdf0e10cSrcweir 			delete[] (char*)pOldPointAry;
63cdf0e10cSrcweir 			bDeleteOldPoints = sal_False;
64cdf0e10cSrcweir 		}
65cdf0e10cSrcweir 	}
66cdf0e10cSrcweir 
67cdf0e10cSrcweir 	void Resize( sal_uInt16 nNewSize, sal_Bool bDeletePoints = sal_True );
68cdf0e10cSrcweir 	void InsertSpace( sal_uInt16 nPos, sal_uInt16 nCount );
69cdf0e10cSrcweir 	void Remove( sal_uInt16 nPos, sal_uInt16 nCount );
70cdf0e10cSrcweir };
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 
73cdf0e10cSrcweir /*************************************************************************
74cdf0e10cSrcweir |*
75cdf0e10cSrcweir |*    class ImpXPolyPolygon
76cdf0e10cSrcweir |*
77cdf0e10cSrcweir |*    Beschreibung
78cdf0e10cSrcweir |*    Ersterstellung          08.11.94
79cdf0e10cSrcweir |*    Letzte Aenderung  Joe 26-09-1995
80cdf0e10cSrcweir |*
81cdf0e10cSrcweir *************************************************************************/
82cdf0e10cSrcweir DECLARE_LIST( XPolygonList, XPolygon* )
83cdf0e10cSrcweir 
84cdf0e10cSrcweir class ImpXPolyPolygon
85cdf0e10cSrcweir {
86cdf0e10cSrcweir public:
87cdf0e10cSrcweir 	XPolygonList aXPolyList;
88cdf0e10cSrcweir 	sal_uInt16       nRefCount;
89cdf0e10cSrcweir 
ImpXPolyPolygon(sal_uInt16 nInitSize=16,sal_uInt16 nResize=16)90cdf0e10cSrcweir 				 ImpXPolyPolygon( sal_uInt16 nInitSize = 16, sal_uInt16 nResize = 16 ) :
91cdf0e10cSrcweir 					aXPolyList( 1024, nInitSize, nResize )
92cdf0e10cSrcweir 					{ nRefCount = 1; }
93cdf0e10cSrcweir 				ImpXPolyPolygon( const ImpXPolyPolygon& rImpXPolyPoly );
94cdf0e10cSrcweir 				~ImpXPolyPolygon();
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 	bool operator==(const ImpXPolyPolygon& rImpXPolyPoly) const;
operator !=(const ImpXPolyPolygon & rImpXPolyPoly) const97cdf0e10cSrcweir 	bool operator!=(const ImpXPolyPolygon& rImpXPolyPoly) const { return !operator==(rImpXPolyPoly); }
98cdf0e10cSrcweir };
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 
101cdf0e10cSrcweir 
102cdf0e10cSrcweir #endif      // _XPOLYIMP_HXX
103