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 #ifndef _SV_REGIONBAND_HXX 23*b1cdbd2cSJim Jagielski #define _SV_REGIONBAND_HXX 24*b1cdbd2cSJim Jagielski 25*b1cdbd2cSJim Jagielski #include <vcl/regband.hxx> 26*b1cdbd2cSJim Jagielski #include <vcl/region.hxx> 27*b1cdbd2cSJim Jagielski 28*b1cdbd2cSJim Jagielski #ifdef DBG_UTIL 29*b1cdbd2cSJim Jagielski const char* ImplDbgTestRegionBand(const void*); 30*b1cdbd2cSJim Jagielski #endif 31*b1cdbd2cSJim Jagielski 32*b1cdbd2cSJim Jagielski ////////////////////////////////////////////////////////////////////////////// 33*b1cdbd2cSJim Jagielski 34*b1cdbd2cSJim Jagielski class RegionBand 35*b1cdbd2cSJim Jagielski { 36*b1cdbd2cSJim Jagielski private: 37*b1cdbd2cSJim Jagielski friend const char* ImplDbgTestRegionBand(const void*); 38*b1cdbd2cSJim Jagielski 39*b1cdbd2cSJim Jagielski ImplRegionBand* mpFirstBand; // root of the list with y-bands 40*b1cdbd2cSJim Jagielski ImplRegionBand* mpLastCheckedBand; 41*b1cdbd2cSJim Jagielski 42*b1cdbd2cSJim Jagielski void implReset(); 43*b1cdbd2cSJim Jagielski 44*b1cdbd2cSJim Jagielski public: 45*b1cdbd2cSJim Jagielski RegionBand(); 46*b1cdbd2cSJim Jagielski RegionBand(const RegionBand&); 47*b1cdbd2cSJim Jagielski RegionBand& operator=(const RegionBand&); 48*b1cdbd2cSJim Jagielski RegionBand(const Rectangle&); 49*b1cdbd2cSJim Jagielski ~RegionBand(); 50*b1cdbd2cSJim Jagielski 51*b1cdbd2cSJim Jagielski bool operator==( const RegionBand& rRegionBand ) const; operator !=(const RegionBand & rRegionBand) const52*b1cdbd2cSJim Jagielski bool operator!=( const RegionBand& rRegionBand ) const { return !(RegionBand::operator==( rRegionBand )); } 53*b1cdbd2cSJim Jagielski 54*b1cdbd2cSJim Jagielski void load(SvStream& rIStrm); 55*b1cdbd2cSJim Jagielski void save(SvStream& rIStrm) const; 56*b1cdbd2cSJim Jagielski 57*b1cdbd2cSJim Jagielski bool isSingleRectangle() const; ImplGetFirstRegionBand() const58*b1cdbd2cSJim Jagielski ImplRegionBand* ImplGetFirstRegionBand() const { return mpFirstBand; } 59*b1cdbd2cSJim Jagielski void ImplAddMissingBands(const long nTop, const long nBottom); 60*b1cdbd2cSJim Jagielski void InsertBand(ImplRegionBand* pPreviousBand, ImplRegionBand* pBandToInsert); 61*b1cdbd2cSJim Jagielski void processPoints(); 62*b1cdbd2cSJim Jagielski void CreateBandRange(long nYTop, long nYBottom); 63*b1cdbd2cSJim Jagielski bool InsertLine(const Point& rStartPt, const Point& rEndPt, long nLineId); 64*b1cdbd2cSJim Jagielski bool InsertPoint(const Point &rPoint, long nLineID, bool bEndPoint, LineType eLineType); 65*b1cdbd2cSJim Jagielski bool OptimizeBandList(); 66*b1cdbd2cSJim Jagielski void Move(long nHorzMove, long nVertMove); 67*b1cdbd2cSJim Jagielski void Scale(double fScaleX, double fScaleY); 68*b1cdbd2cSJim Jagielski void InsertBands(long nTop, long nBottom); 69*b1cdbd2cSJim Jagielski bool InsertSingleBand(ImplRegionBand* pBand, long nYBandPosition); 70*b1cdbd2cSJim Jagielski void Union(long nLeft, long nTop, long nRight, long nBottom); 71*b1cdbd2cSJim Jagielski void Intersect(long nLeft, long nTop, long nRight, long nBottom); 72*b1cdbd2cSJim Jagielski void Union(const RegionBand& rSource); 73*b1cdbd2cSJim Jagielski void Exclude(long nLeft, long nTop, long nRight, long nBottom); 74*b1cdbd2cSJim Jagielski void XOr(long nLeft, long nTop, long nRight, long nBottom); 75*b1cdbd2cSJim Jagielski void Intersect(const RegionBand& rSource); 76*b1cdbd2cSJim Jagielski bool Exclude(const RegionBand& rSource); 77*b1cdbd2cSJim Jagielski void XOr(const RegionBand& rSource); 78*b1cdbd2cSJim Jagielski Rectangle GetBoundRect() const; 79*b1cdbd2cSJim Jagielski bool IsInside(const Point& rPoint) const; 80*b1cdbd2cSJim Jagielski sal_uInt32 getRectangleCount() const; // only users are Region::Intersect and PSWriter::ImplBmp 81*b1cdbd2cSJim Jagielski void GetRegionRectangles(RectangleVector& rTarget) const; 82*b1cdbd2cSJim Jagielski }; 83*b1cdbd2cSJim Jagielski 84*b1cdbd2cSJim Jagielski #endif // _SV_REGIONBAND_HXX 85*b1cdbd2cSJim Jagielski 86*b1cdbd2cSJim Jagielski ////////////////////////////////////////////////////////////////////////////// 87*b1cdbd2cSJim Jagielski //eof 88