Version: 9.12.0
GEOMUtils_Hatcher.hxx
Go to the documentation of this file.
1 // Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 
23 #ifndef _GEOMUtils_Hatcher_HXX_
24 #define _GEOMUtils_Hatcher_HXX_
25 
26 
27 #include <Geom2dHatch_Hatcher.hxx>
28 #include <GeomAbs_IsoType.hxx>
29 #include <TColStd_HArray1OfInteger.hxx>
30 #include <TColStd_HArray1OfReal.hxx>
31 #include <TopoDS_Face.hxx>
32 
33 
37 namespace GEOMUtils
38 {
39  class Hatcher
40  {
41  public:
42 
46  Standard_EXPORT Hatcher(const TopoDS_Face &theFace);
47 
53  Standard_EXPORT void Init(const Standard_Integer theNbIsos);
54 
61  Standard_EXPORT void Init(const Standard_Integer theNbIsoU,
62  const Standard_Integer theNbIsoV);
63 
70  Standard_EXPORT void Init(const GeomAbs_IsoType theIsoType,
71  const Standard_Real theParameter);
72 
76  Standard_EXPORT void Perform();
77 
84  Standard_Boolean IsDone() const
85  { return myIsDone; }
86 
92  const TopoDS_Face &GetFace() const
93  { return myFace; }
94 
103  Standard_EXPORT Standard_Integer GetNbDomains
104  (const Standard_Integer theHatchingIndex) const;
105 
116  Standard_EXPORT Standard_Boolean GetDomain
117  (const Standard_Integer theHatchingIndex,
118  const Standard_Integer theDomainIndex,
119  Standard_Real &theParam1,
120  Standard_Real &theParam2) const;
121 
130  Standard_EXPORT Standard_Boolean IsDomainInfinite
131  (const Standard_Integer theHatchingIndex,
132  const Standard_Integer theDomainIndex) const;
133 
139  Standard_EXPORT const Geom2dHatch_Hatcher &GetHatcher() const
140  { return myHatcher; }
141 
148  Standard_EXPORT const Handle(TColStd_HArray1OfInteger) &GetUIndices() const
149  { return myUInd; }
150 
157  Standard_EXPORT const Handle(TColStd_HArray1OfInteger) &GetVIndices() const
158  { return myVInd; }
159 
166  Standard_EXPORT const Handle(TColStd_HArray1OfReal) &GetUParams() const
167  { return myUPrm; }
168 
175  Standard_EXPORT const Handle(TColStd_HArray1OfReal) &GetVParams() const
176  { return myVPrm; }
177 
184  Standard_EXPORT const Handle(Geom2d_Curve) &GetHatching
185  (const Standard_Integer theHatchingIndex) const;
186 
187  protected:
188 
192  void Clear();
193 
194  private:
195 
196  Geom2dHatch_Hatcher myHatcher;
197  TopoDS_Face myFace;
198  Standard_Boolean myIsDone;
199  Standard_Real myUMin;
200  Standard_Real myUMax;
201  Standard_Real myVMin;
202  Standard_Real myVMax;
203  Handle(TColStd_HArray1OfReal) myUPrm;
204  Handle(TColStd_HArray1OfReal) myVPrm;
205  Handle(TColStd_HArray1OfInteger) myUInd;
206  Handle(TColStd_HArray1OfInteger) myVInd;
207 
208  };
209 }
210 
211 #endif
Definition: GEOMUtils_Hatcher.hxx:40
Standard_EXPORT const Handle(TColStd_HArray1OfReal) &GetVParams() const
This method returns the array of parameters of V-isoline hatchings.
Definition: GEOMUtils_Hatcher.hxx:175
Handle(TColStd_HArray1OfInteger) myVInd
Standard_Boolean myIsDone
Definition: GEOMUtils_Hatcher.hxx:198
Handle(TColStd_HArray1OfReal) myUPrm
Standard_EXPORT const Geom2dHatch_Hatcher & GetHatcher() const
This method returns the reference to OCCT hatcher.
Definition: GEOMUtils_Hatcher.hxx:139
Handle(TColStd_HArray1OfReal) myVPrm
Standard_Real myVMax
Definition: GEOMUtils_Hatcher.hxx:202
Geom2dHatch_Hatcher myHatcher
Definition: GEOMUtils_Hatcher.hxx:196
Standard_EXPORT const Handle(Geom2d_Curve) &GetHatching(const Standard_Integer theHatchingIndex) const
This method returns a hatching curve by its index.
Standard_EXPORT Hatcher(const TopoDS_Face &theFace)
Constructor.
Definition: GEOMUtils_Hatcher.cxx:49
void Clear()
This method clears all hatchings data.
const TopoDS_Face & GetFace() const
This method returns the initial face.
Definition: GEOMUtils_Hatcher.hxx:92
Standard_Real myUMin
Definition: GEOMUtils_Hatcher.hxx:199
Standard_EXPORT const Handle(TColStd_HArray1OfInteger) &GetUIndices() const
This method returns the array of indices of U-isoline hatchings.
Definition: GEOMUtils_Hatcher.hxx:148
Standard_EXPORT void Perform()
Compute hatching domatins.
Definition: GEOMUtils_Hatcher.cxx:252
Standard_Real myUMax
Definition: GEOMUtils_Hatcher.hxx:200
Standard_EXPORT Standard_Integer GetNbDomains(const Standard_Integer theHatchingIndex) const
This method returns the number of domains for a particular hatching.
Definition: GEOMUtils_Hatcher.cxx:298
Standard_Boolean IsDone() const
This method returns true if at least one hatching's domains are computed successfully.
Definition: GEOMUtils_Hatcher.hxx:84
Standard_EXPORT Standard_Boolean IsDomainInfinite(const Standard_Integer theHatchingIndex, const Standard_Integer theDomainIndex) const
This method returns Standard_True if a domain has infinite first or last parameter.
Definition: GEOMUtils_Hatcher.cxx:352
Standard_Real myVMin
Definition: GEOMUtils_Hatcher.hxx:201
Standard_EXPORT const Handle(TColStd_HArray1OfReal) &GetUParams() const
This method returns the array of parameters of U-isoline hatchings.
Definition: GEOMUtils_Hatcher.hxx:166
Standard_EXPORT Standard_Boolean GetDomain(const Standard_Integer theHatchingIndex, const Standard_Integer theDomainIndex, Standard_Real &theParam1, Standard_Real &theParam2) const
This method returns the domputed domain range computed for a particular hatching.
Definition: GEOMUtils_Hatcher.cxx:314
TopoDS_Face myFace
Definition: GEOMUtils_Hatcher.hxx:197
Standard_EXPORT void Init(const Standard_Integer theNbIsos)
This method initializes the hatcher with hatchings.
Definition: GEOMUtils_Hatcher.cxx:143
Standard_EXPORT const Handle(TColStd_HArray1OfInteger) &GetVIndices() const
This method returns the array of indices of V-isoline hatchings.
Definition: GEOMUtils_Hatcher.hxx:157
Handle(TColStd_HArray1OfInteger) myUInd
Definition: GEOMUtils.hxx:56