Line data Source code
1 : /*
2 : * This file is part of the LibreOffice project.
3 : *
4 : * This Source Code Form is subject to the terms of the Mozilla Public
5 : * License, v. 2.0. If a copy of the MPL was not distributed with this
6 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 : *
8 : * This file incorporates work covered by the following license notice:
9 : *
10 : * Licensed to the Apache Software Foundation (ASF) under one or more
11 : * contributor license agreements. See the NOTICE file distributed
12 : * with this work for additional information regarding copyright
13 : * ownership. The ASF licenses this file to you under the Apache
14 : * License, Version 2.0 (the "License"); you may not use this file
15 : * except in compliance with the License. You may obtain a copy of
16 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
17 : */
18 : #ifndef _SV_REGIONBAND_HXX
19 : #define _SV_REGIONBAND_HXX
20 :
21 : #include <vcl/regband.hxx>
22 : #include <vcl/region.hxx>
23 :
24 : #ifdef DBG_UTIL
25 : const char* ImplDbgTestRegionBand(const void*);
26 : #endif
27 :
28 : //////////////////////////////////////////////////////////////////////////////
29 :
30 : class RegionBand
31 : {
32 : private:
33 : friend const char* ImplDbgTestRegionBand(const void*);
34 :
35 : ImplRegionBand* mpFirstBand; // root of the list with y-bands
36 : ImplRegionBand* mpLastCheckedBand;
37 :
38 : void implReset();
39 :
40 : public:
41 : RegionBand();
42 : RegionBand(const RegionBand&);
43 : RegionBand& operator=(const RegionBand&);
44 : RegionBand(const Rectangle&);
45 : ~RegionBand();
46 :
47 : bool operator==( const RegionBand& rRegionBand ) const;
48 : bool operator!=( const RegionBand& rRegionBand ) const { return !(RegionBand::operator==( rRegionBand )); }
49 :
50 : void load(SvStream& rIStrm);
51 : void save(SvStream& rIStrm) const;
52 :
53 : bool isSingleRectangle() const;
54 120 : ImplRegionBand* ImplGetFirstRegionBand() const { return mpFirstBand; }
55 : void ImplAddMissingBands(const long nTop, const long nBottom);
56 : void InsertBand(ImplRegionBand* pPreviousBand, ImplRegionBand* pBandToInsert);
57 : void processPoints();
58 : void CreateBandRange(long nYTop, long nYBottom);
59 : bool InsertLine(const Point& rStartPt, const Point& rEndPt, long nLineId);
60 : bool InsertPoint(const Point &rPoint, long nLineID, bool bEndPoint, LineType eLineType);
61 : bool OptimizeBandList();
62 : void Move(long nHorzMove, long nVertMove);
63 : void Scale(double fScaleX, double fScaleY);
64 : void InsertBands(long nTop, long nBottom);
65 : bool InsertSingleBand(ImplRegionBand* pBand, long nYBandPosition);
66 : void Union(long nLeft, long nTop, long nRight, long nBottom);
67 : void Intersect(long nLeft, long nTop, long nRight, long nBottom);
68 : void Union(const RegionBand& rSource);
69 : void Exclude(long nLeft, long nTop, long nRight, long nBottom);
70 : void XOr(long nLeft, long nTop, long nRight, long nBottom);
71 : void Intersect(const RegionBand& rSource);
72 : bool Exclude(const RegionBand& rSource);
73 : void XOr(const RegionBand& rSource);
74 : Rectangle GetBoundRect() const;
75 : bool IsInside(const Point& rPoint) const;
76 : sal_uInt32 getRectangleCount() const; // only users are Region::Intersect and PSWriter::ImplBmp
77 : void GetRegionRectangles(RectangleVector& rTarget) const;
78 : };
79 :
80 : #endif // _SV_REGIONBAND_HXX
81 :
82 : //////////////////////////////////////////////////////////////////////////////
83 : //eof
|