0026323: Tolerance computing unification
[occt.git] / src / IntTools / IntTools_SurfaceRangeLocalizeData.hxx
CommitLineData
42cf5bc1 1// Created on: 2005-10-14
2// Created by: Mikhail KLOKOV
3// Copyright (c) 2005-2014 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _IntTools_SurfaceRangeLocalizeData_HeaderFile
17#define _IntTools_SurfaceRangeLocalizeData_HeaderFile
18
19#include <Standard.hxx>
20#include <Standard_DefineAlloc.hxx>
21#include <Standard_Handle.hxx>
22
23#include <Standard_Integer.hxx>
24#include <Standard_Real.hxx>
25#include <IntTools_MapOfSurfaceSample.hxx>
26#include <IntTools_DataMapOfSurfaceSampleBox.hxx>
27#include <TColStd_HArray1OfReal.hxx>
28#include <TColgp_HArray2OfPnt.hxx>
29#include <Standard_Boolean.hxx>
30#include <IntTools_ListOfSurfaceRangeSample.hxx>
31class IntTools_SurfaceRangeSample;
32class Bnd_Box;
33class gp_Pnt;
34
35
36
37class IntTools_SurfaceRangeLocalizeData
38{
39public:
40
41 DEFINE_STANDARD_ALLOC
42
43
44 Standard_EXPORT IntTools_SurfaceRangeLocalizeData();
45
46 Standard_EXPORT IntTools_SurfaceRangeLocalizeData(const Standard_Integer theNbSampleU, const Standard_Integer theNbSampleV, const Standard_Real theMinRangeU, const Standard_Real theMinRangeV);
47
48 Standard_EXPORT IntTools_SurfaceRangeLocalizeData(const IntTools_SurfaceRangeLocalizeData& Other);
49
50 Standard_EXPORT IntTools_SurfaceRangeLocalizeData& Assign (const IntTools_SurfaceRangeLocalizeData& Other);
51IntTools_SurfaceRangeLocalizeData& operator = (const IntTools_SurfaceRangeLocalizeData& Other)
52{
53 return Assign(Other);
54}
55
56 Standard_Integer GetNbSampleU() const;
57
58 Standard_Integer GetNbSampleV() const;
59
60 Standard_Real GetMinRangeU() const;
61
62 Standard_Real GetMinRangeV() const;
63
64 Standard_EXPORT void AddOutRange (const IntTools_SurfaceRangeSample& theRange);
65
66 Standard_EXPORT void AddBox (const IntTools_SurfaceRangeSample& theRange, const Bnd_Box& theBox);
67
68 Standard_EXPORT Standard_Boolean FindBox (const IntTools_SurfaceRangeSample& theRange, Bnd_Box& theBox) const;
69
70 Standard_EXPORT Standard_Boolean IsRangeOut (const IntTools_SurfaceRangeSample& theRange) const;
71
72 Standard_EXPORT void ListRangeOut (IntTools_ListOfSurfaceRangeSample& theList) const;
73
74 Standard_EXPORT void RemoveRangeOutAll();
75
76 //! Set the grid deflection.
77 void SetGridDeflection (const Standard_Real theDeflection);
78
79 //! Query the grid deflection.
80 Standard_Real GetGridDeflection() const;
81
82 //! Set the range U of the grid of points.
83 Standard_EXPORT void SetRangeUGrid (const Standard_Integer theNbUGrid);
84
85 //! Query the range U of the grid of points.
86 Standard_Integer GetRangeUGrid() const;
87
88 //! Set the U parameter of the grid points at that index.
89 void SetUParam (const Standard_Integer theIndex, const Standard_Real theUParam);
90
91 //! Query the U parameter of the grid points at that index.
92 Standard_Real GetUParam (const Standard_Integer theIndex) const;
93
94 //! Set the range V of the grid of points.
95 Standard_EXPORT void SetRangeVGrid (const Standard_Integer theNbVGrid);
96
97 //! Query the range V of the grid of points.
98 Standard_Integer GetRangeVGrid() const;
99
100 //! Set the V parameter of the grid points at that index.
101 void SetVParam (const Standard_Integer theIndex, const Standard_Real theVParam);
102
103 //! Query the V parameter of the grid points at that index.
104 Standard_Real GetVParam (const Standard_Integer theIndex) const;
105
106 //! Set the grid point.
107 void SetGridPoint (const Standard_Integer theUIndex, const Standard_Integer theVIndex, const gp_Pnt& thePoint);
108
109 //! Set the grid point.
110 const gp_Pnt& GetGridPoint (const Standard_Integer theUIndex, const Standard_Integer theVIndex) const;
111
112 //! Sets the frame area. Used to work with grid points.
113 Standard_EXPORT void SetFrame (const Standard_Real theUMin, const Standard_Real theUMax, const Standard_Real theVMin, const Standard_Real theVMax);
114
115 //! Returns the number of grid points on U direction in frame.
116 Standard_Integer GetNBUPointsInFrame() const;
117
118 //! Returns the number of grid points on V direction in frame.
119 Standard_Integer GetNBVPointsInFrame() const;
120
121 //! Returns the grid point in frame.
122 Standard_EXPORT const gp_Pnt& GetPointInFrame (const Standard_Integer theUIndex, const Standard_Integer theVIndex) const;
123
124 //! Query the U parameter of the grid points
125 //! at that index in frame.
126 Standard_EXPORT Standard_Real GetUParamInFrame (const Standard_Integer theIndex) const;
127
128 //! Query the V parameter of the grid points
129 //! at that index in frame.
130 Standard_EXPORT Standard_Real GetVParamInFrame (const Standard_Integer theIndex) const;
131
132 //! Clears the grid of points.
133 Standard_EXPORT void ClearGrid();
134
135
136
137
138protected:
139
140
141
142
143
144private:
145
146
147
148 Standard_Integer myNbSampleU;
149 Standard_Integer myNbSampleV;
150 Standard_Real myMinRangeU;
151 Standard_Real myMinRangeV;
152 IntTools_MapOfSurfaceSample myMapRangeOut;
153 IntTools_DataMapOfSurfaceSampleBox myMapBox;
154 Handle(TColStd_HArray1OfReal) myUParams;
155 Handle(TColStd_HArray1OfReal) myVParams;
156 Handle(TColgp_HArray2OfPnt) myGridPoints;
157 Standard_Integer myUIndMin;
158 Standard_Integer myUIndMax;
159 Standard_Integer myVIndMin;
160 Standard_Integer myVIndMax;
161 Standard_Real myDeflection;
162
163
164};
165
166
167#include <IntTools_SurfaceRangeLocalizeData.lxx>
168
169
170
171
172
173#endif // _IntTools_SurfaceRangeLocalizeData_HeaderFile