LibreOffice Module vcl (master) 1
regband.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
20#ifndef INCLUDED_VCL_INC_REGBAND_HXX
21#define INCLUDED_VCL_INC_REGBAND_HXX
22
23/*
24
25class ImplRegionBand
26
27This class handles one y-band of the region. In this band may contain one
28or more separations in x-direction. The y-Band do not contain any
29separation after creation.
30
31The separations are modified with basic clipping functions like Union and
32Intersection - the Class will process the clipping for the actual band.
33
34*/
35
36// element for the list with x-separations
38{
43};
44
46
47// element for the list with x-separations
49{
55};
56
58{
59public:
60 ImplRegionBand* mpNextBand; // pointer to the next element of the list
61 ImplRegionBand* mpPrevBand; // pointer to the previous element of the list (only used temporarily)
62 ImplRegionBandSep* mpFirstSep; // root of the list with x-separations
63 ImplRegionBandPoint* mpFirstBandPoint; // root of the list with lines
64 tools::Long mnYTop; // actual boundary of the band
66
67 bool mbTouched : 1;
68
69 // create y-band with boundaries
70 ImplRegionBand( tools::Long nYTop, tools::Long nYBottom );
84 ImplRegionBand( const ImplRegionBand & theSourceBand,
85 const bool bIgnorePoints = true);
87
90
91 // combine overlapping bands
92 void OptimizeBand();
93
94 // generate separations from lines and process
95 // union with existing separations
96 void ProcessPoints();
97 // insert point in the list for later processing
98 bool InsertPoint( tools::Long nX, tools::Long nLineID,
99 bool bEndPoint, LineType eLineType );
100
101 void Union( tools::Long nXLeft, tools::Long nXRight );
102 void Intersect( tools::Long nXLeft, tools::Long nXRight );
103 void Exclude( tools::Long nXLeft, tools::Long nXRight );
104 void XOr( tools::Long nXLeft, tools::Long nXRight );
105
106 void MoveX( tools::Long nHorzMove );
107 void ScaleX( double fHorzScale );
108
109 bool Contains( tools::Long nX );
110
111 bool IsEmpty() const { return ((!mpFirstSep) && (!mpFirstBandPoint)); }
112
113 bool operator==( const ImplRegionBand& rRegionBand ) const;
114
124 ImplRegionBand* SplitBand (const sal_Int32 nY);
125};
126
127#endif // INCLUDED_VCL_INC_REGBAND_HXX
128
129/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
LineType
void Union(tools::Long nXLeft, tools::Long nXRight)
Definition: regband.cxx:364
void Intersect(tools::Long nXLeft, tools::Long nXRight)
Definition: regband.cxx:436
ImplRegionBand * mpPrevBand
Definition: regband.hxx:61
tools::Long GetXRightBoundary() const
Definition: regband.cxx:823
void ProcessPoints()
Definition: regband.cxx:141
bool IsEmpty() const
Definition: regband.hxx:111
tools::Long mnYBottom
Definition: regband.hxx:65
ImplRegionBandPoint * mpFirstBandPoint
Definition: regband.hxx:63
bool InsertPoint(tools::Long nX, tools::Long nLineID, bool bEndPoint, LineType eLineType)
Definition: regband.cxx:192
bool operator==(const ImplRegionBand &rRegionBand) const
Definition: regband.cxx:835
void XOr(tools::Long nXLeft, tools::Long nXRight)
Definition: regband.cxx:559
void Exclude(tools::Long nXLeft, tools::Long nXRight)
Definition: regband.cxx:481
bool Contains(tools::Long nX)
Definition: regband.cxx:802
bool mbTouched
Definition: regband.hxx:67
void OptimizeBand()
Definition: regband.cxx:325
tools::Long GetXLeftBoundary() const
Definition: regband.cxx:816
void MoveX(tools::Long nHorzMove)
Definition: regband.cxx:300
ImplRegionBand(tools::Long nYTop, tools::Long nYBottom)
Definition: regband.cxx:40
ImplRegionBand * mpNextBand
Definition: regband.hxx:60
ImplRegionBand * SplitBand(const sal_Int32 nY)
Split the called band at the given vertical coordinate.
Definition: regband.cxx:863
tools::Long mnYTop
Definition: regband.hxx:64
void ScaleX(double fHorzScale)
Definition: regband.cxx:312
ImplRegionBandSep * mpFirstSep
Definition: regband.hxx:62
long Long
ImplRegionBandPoint * mpNextBandPoint
Definition: regband.hxx:50
tools::Long mnX
Definition: regband.hxx:51
LineType meLineType
Definition: regband.hxx:54
tools::Long mnLineId
Definition: regband.hxx:52
tools::Long mnXLeft
Definition: regband.hxx:40
ImplRegionBandSep * mpNextSep
Definition: regband.hxx:39
tools::Long mnXRight
Definition: regband.hxx:41