1 // Created on: 2005-10-14
2 // Created by: Mikhail KLOKOV
3 // Copyright (c) 2005-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _IntTools_SurfaceRangeLocalizeData_HeaderFile
17 #define _IntTools_SurfaceRangeLocalizeData_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
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>
31 class IntTools_SurfaceRangeSample;
37 class IntTools_SurfaceRangeLocalizeData
44 Standard_EXPORT IntTools_SurfaceRangeLocalizeData();
46 Standard_EXPORT IntTools_SurfaceRangeLocalizeData(const Standard_Integer theNbSampleU, const Standard_Integer theNbSampleV, const Standard_Real theMinRangeU, const Standard_Real theMinRangeV);
48 Standard_EXPORT IntTools_SurfaceRangeLocalizeData(const IntTools_SurfaceRangeLocalizeData& Other);
50 Standard_EXPORT IntTools_SurfaceRangeLocalizeData& Assign (const IntTools_SurfaceRangeLocalizeData& Other);
51 IntTools_SurfaceRangeLocalizeData& operator = (const IntTools_SurfaceRangeLocalizeData& Other)
56 Standard_Integer GetNbSampleU() const;
58 Standard_Integer GetNbSampleV() const;
60 Standard_Real GetMinRangeU() const;
62 Standard_Real GetMinRangeV() const;
64 Standard_EXPORT void AddOutRange (const IntTools_SurfaceRangeSample& theRange);
66 Standard_EXPORT void AddBox (const IntTools_SurfaceRangeSample& theRange, const Bnd_Box& theBox);
68 Standard_EXPORT Standard_Boolean FindBox (const IntTools_SurfaceRangeSample& theRange, Bnd_Box& theBox) const;
70 Standard_EXPORT Standard_Boolean IsRangeOut (const IntTools_SurfaceRangeSample& theRange) const;
72 Standard_EXPORT void ListRangeOut (IntTools_ListOfSurfaceRangeSample& theList) const;
74 Standard_EXPORT void RemoveRangeOutAll();
76 //! Set the grid deflection.
77 void SetGridDeflection (const Standard_Real theDeflection);
79 //! Query the grid deflection.
80 Standard_Real GetGridDeflection() const;
82 //! Set the range U of the grid of points.
83 Standard_EXPORT void SetRangeUGrid (const Standard_Integer theNbUGrid);
85 //! Query the range U of the grid of points.
86 Standard_Integer GetRangeUGrid() const;
88 //! Set the U parameter of the grid points at that index.
89 void SetUParam (const Standard_Integer theIndex, const Standard_Real theUParam);
91 //! Query the U parameter of the grid points at that index.
92 Standard_Real GetUParam (const Standard_Integer theIndex) const;
94 //! Set the range V of the grid of points.
95 Standard_EXPORT void SetRangeVGrid (const Standard_Integer theNbVGrid);
97 //! Query the range V of the grid of points.
98 Standard_Integer GetRangeVGrid() const;
100 //! Set the V parameter of the grid points at that index.
101 void SetVParam (const Standard_Integer theIndex, const Standard_Real theVParam);
103 //! Query the V parameter of the grid points at that index.
104 Standard_Real GetVParam (const Standard_Integer theIndex) const;
106 //! Set the grid point.
107 void SetGridPoint (const Standard_Integer theUIndex, const Standard_Integer theVIndex, const gp_Pnt& thePoint);
109 //! Set the grid point.
110 const gp_Pnt& GetGridPoint (const Standard_Integer theUIndex, const Standard_Integer theVIndex) const;
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);
115 //! Returns the number of grid points on U direction in frame.
116 Standard_Integer GetNBUPointsInFrame() const;
118 //! Returns the number of grid points on V direction in frame.
119 Standard_Integer GetNBVPointsInFrame() const;
121 //! Returns the grid point in frame.
122 Standard_EXPORT const gp_Pnt& GetPointInFrame (const Standard_Integer theUIndex, const Standard_Integer theVIndex) const;
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;
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;
132 //! Clears the grid of points.
133 Standard_EXPORT void ClearGrid();
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;
167 #include <IntTools_SurfaceRangeLocalizeData.lxx>
173 #endif // _IntTools_SurfaceRangeLocalizeData_HeaderFile