LibreOffice Module vcl (master)  1
regionband.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 #ifndef INCLUDED_VCL_INC_REGIONBAND_HXX
20 #define INCLUDED_VCL_INC_REGIONBAND_HXX
21 
22 #include <vcl/region.hxx>
23 
24 #include "regband.hxx"
25 
26 #ifdef DBG_UTIL
27 const char* ImplDbgTestRegionBand(const void*);
28 #endif
29 
31 {
32 private:
33  friend const char* ImplDbgTestRegionBand(const void*);
34 
35  ImplRegionBand* mpFirstBand; // root of the list with y-bands
37 
38  void implReset();
39  [[nodiscard]] bool CheckConsistency() const;
40 
41 public:
42  RegionBand();
43  RegionBand(const RegionBand&);
46  ~RegionBand();
47 
48  bool operator==(const RegionBand& rRegionBand) const;
49 
50  [[nodiscard]] bool load(SvStream& rIStrm);
51  void save(SvStream& rIStrm) const;
52 
53  bool isSingleRectangle() const;
55  void ImplAddMissingBands(const tools::Long nTop, const tools::Long nBottom);
56  void InsertBand(ImplRegionBand* pPreviousBand, ImplRegionBand* pBandToInsert);
57  void processPoints();
58  void CreateBandRange(tools::Long nYTop, tools::Long nYBottom);
59  void InsertLine(const Point& rStartPt, const Point& rEndPt, tools::Long nLineId);
60  void InsertPoint(const Point& rPoint, tools::Long nLineID, bool bEndPoint, LineType eLineType);
61  bool OptimizeBandList();
62  void Move(tools::Long nHorzMove, tools::Long nVertMove);
63  void Scale(double fScaleX, double fScaleY);
64  void InsertBands(tools::Long nTop, tools::Long nBottom);
65  static bool InsertSingleBand(ImplRegionBand* pBand, tools::Long nYBandPosition);
66  void Union(tools::Long nLeft, tools::Long nTop, tools::Long nRight, tools::Long nBottom);
67  void Intersect(tools::Long nLeft, tools::Long nTop, tools::Long nRight, tools::Long nBottom);
68  void Union(const RegionBand& rSource);
69  void Exclude(tools::Long nLeft, tools::Long nTop, tools::Long nRight, tools::Long nBottom);
70  void XOr(tools::Long nLeft, tools::Long nTop, tools::Long nRight, tools::Long nBottom);
71  void Intersect(const RegionBand& rSource);
72  bool Exclude(const RegionBand& rSource);
73  void XOr(const RegionBand& rSource);
75  bool IsInside(const Point& rPoint) const;
76  sal_uInt32 getRectangleCount()
77  const; // only users are Region::Intersect, Region::IsRectangle and PSWriter::ImplBmp
78  void GetRegionRectangles(RectangleVector& rTarget) const;
79 };
80 
81 #endif // INCLUDED_VCL_INC_REGIONBAND_HXX
82 
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void ImplAddMissingBands(const tools::Long nTop, const tools::Long nBottom)
This function is similar to the RegionBand::InsertBands() method.
Definition: regionband.cxx:376
ImplRegionBand * mpFirstBand
Definition: regionband.hxx:35
void Intersect(tools::Long nLeft, tools::Long nTop, tools::Long nRight, tools::Long nBottom)
Definition: regionband.cxx:917
void implReset()
Definition: regionband.cxx:87
bool IsInside(const Point &rPoint) const
long Long
void InsertBand(ImplRegionBand *pPreviousBand, ImplRegionBand *pBandToInsert)
Definition: regionband.cxx:334
void Union(tools::Long nLeft, tools::Long nTop, tools::Long nRight, tools::Long nBottom)
Definition: regionband.cxx:881
std::vector< tools::Rectangle > RectangleVector
Definition: region.hxx:37
sal_uInt32 getRectangleCount() const
void CreateBandRange(tools::Long nYTop, tools::Long nYBottom)
Definition: regionband.cxx:420
void XOr(tools::Long nLeft, tools::Long nTop, tools::Long nRight, tools::Long nBottom)
void save(SvStream &rIStrm) const
Definition: regionband.cxx:287
bool isSingleRectangle() const
Definition: regionband.cxx:319
bool load(SvStream &rIStrm)
Definition: regionband.cxx:203
void Move(tools::Long nHorzMove, tools::Long nVertMove)
Definition: regionband.cxx:670
bool CheckConsistency() const
void Exclude(tools::Long nLeft, tools::Long nTop, tools::Long nRight, tools::Long nBottom)
Definition: regionband.cxx:977
bool OptimizeBandList()
Definition: regionband.cxx:591
RegionBand & operator=(const RegionBand &)
Definition: regionband.cxx:42
const char * ImplDbgTestRegionBand(const void *)
void processPoints()
Definition: regionband.cxx:359
static bool InsertSingleBand(ImplRegionBand *pBand, tools::Long nYBandPosition)
Definition: regionband.cxx:799
void InsertBands(tools::Long nTop, tools::Long nBottom)
Definition: regionband.cxx:718
void InsertPoint(const Point &rPoint, tools::Long nLineID, bool bEndPoint, LineType eLineType)
Definition: regionband.cxx:540
void GetRegionRectangles(RectangleVector &rTarget) const
void Scale(double fScaleX, double fScaleY)
Definition: regionband.cxx:694
tools::Rectangle GetBoundRect() const
void InsertLine(const Point &rStartPt, const Point &rEndPt, tools::Long nLineId)
Definition: regionband.cxx:445
bool operator==(const RegionBand &rRegionBand) const
Definition: regionband.cxx:107
ImplRegionBand * mpLastCheckedBand
Definition: regionband.hxx:36
ImplRegionBand * ImplGetFirstRegionBand() const
Definition: regionband.hxx:54
LineType
friend const char * ImplDbgTestRegionBand(const void *)