1 // Created on: 1994-03-14
2 // Created by: s: Christophe GUYOT & Frederic UNTEREINER
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _IGESToBRep_CurveAndSurface_HeaderFile
18 #define _IGESToBRep_CurveAndSurface_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Real.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Integer.hxx>
28 class IGESData_IGESModel;
29 class Transfer_TransientProcess;
31 class IGESData_IGESEntity;
35 //! Provides methods to transfer CurveAndSurface from IGES to CASCADE.
36 class IGESToBRep_CurveAndSurface
43 //! Creates a tool CurveAndSurface ready to run, with
44 //! epsilons set to 1.E-04, myModeTopo to True, the
45 //! optimization of the continuity to False.
46 Standard_EXPORT IGESToBRep_CurveAndSurface();
48 //! Creates a tool CurveAndSurface ready to run.
49 Standard_EXPORT IGESToBRep_CurveAndSurface(const Standard_Real eps, const Standard_Real epsGeom, const Standard_Real epsCoeff, const Standard_Boolean mode, const Standard_Boolean modeapprox, const Standard_Boolean optimized);
51 //! Initializes the field of the tool CurveAndSurface with
52 //! default creating values.
53 Standard_EXPORT void Init();
55 //! Changes the value of "myEps"
56 void SetEpsilon (const Standard_Real eps);
58 //! Returns the value of "myEps"
59 Standard_Real GetEpsilon() const;
61 //! Changes the value of "myEpsCoeff"
62 void SetEpsCoeff (const Standard_Real eps);
64 //! Returns the value of "myEpsCoeff"
65 Standard_Real GetEpsCoeff() const;
67 //! Changes the value of "myEpsGeom"
68 Standard_EXPORT void SetEpsGeom (const Standard_Real eps);
70 //! Returns the value of "myEpsGeom"
71 Standard_Real GetEpsGeom() const;
73 //! Changes the value of "myMinTol"
74 void SetMinTol (const Standard_Real mintol);
76 //! Changes the value of "myMaxTol"
77 void SetMaxTol (const Standard_Real maxtol);
79 //! Sets values of "myMinTol" and "myMaxTol" as follows
80 //! myMaxTol = Max ("read.maxprecision.val", myEpsGeom * myUnitFactor)
81 //! myMinTol = Precision::Confusion()
82 //! Remark: This method is automatically invoked each time the values
83 //! of "myEpsGeom" or "myUnitFactor" are changed
84 Standard_EXPORT void UpdateMinMaxTol();
86 //! Returns the value of "myMinTol"
87 Standard_Real GetMinTol() const;
89 //! Returns the value of "myMaxTol"
90 Standard_Real GetMaxTol() const;
92 //! Changes the value of "myModeApprox"
93 void SetModeApprox (const Standard_Boolean mode);
95 //! Returns the value of "myModeApprox"
96 Standard_Boolean GetModeApprox() const;
98 //! Changes the value of "myModeIsTopo"
99 void SetModeTransfer (const Standard_Boolean mode);
101 //! Returns the value of "myModeIsTopo"
102 Standard_Boolean GetModeTransfer() const;
104 //! Changes the value of "myContIsOpti"
105 void SetOptimized (const Standard_Boolean optimized);
107 //! Returns the value of "myContIsOpti"
108 Standard_Boolean GetOptimized() const;
110 //! Returns the value of " myUnitFactor"
111 Standard_Real GetUnitFactor() const;
113 //! Changes the value of "mySurfaceCurve"
114 void SetSurfaceCurve (const Standard_Integer ival);
116 //! Returns the value of " mySurfaceCurve" 0 = value in
117 //! file , 2 = kepp 2d and compute 3d 3 = keep 3d and
119 Standard_Integer GetSurfaceCurve() const;
121 //! Set the value of "myModel"
122 Standard_EXPORT void SetModel (const Handle(IGESData_IGESModel)& model);
124 //! Returns the value of "myModel"
125 Handle(IGESData_IGESModel) GetModel() const;
127 //! Changes the value of "myContinuity"
128 //! if continuity = 0 do nothing else
129 //! if continuity = 1 try C1
130 //! if continuity = 2 try C2
131 void SetContinuity (const Standard_Integer continuity);
133 //! Returns the value of "myContinuity"
134 Standard_Integer GetContinuity() const;
136 //! Set the value of "myMsgReg"
137 void SetTransferProcess (const Handle(Transfer_TransientProcess)& TP);
139 //! Returns the value of "myMsgReg"
140 Handle(Transfer_TransientProcess) GetTransferProcess() const;
142 //! Returns the result of the transfert of any IGES Curve
143 //! or Surface Entity. If the transfer has failed, this
144 //! member return a NullEntity.
145 Standard_EXPORT TopoDS_Shape TransferCurveAndSurface (const Handle(IGESData_IGESEntity)& start);
147 //! Returns the result of the transfert the geometry of
148 //! any IGESEntity. If the transfer has failed, this
149 //! member return a NullEntity.
150 Standard_EXPORT TopoDS_Shape TransferGeometry (const Handle(IGESData_IGESEntity)& start);
152 //! Records a new Fail message
153 void SendFail (const Handle(IGESData_IGESEntity)& start, const Message_Msg& amsg);
155 //! Records a new Warning message
156 void SendWarning (const Handle(IGESData_IGESEntity)& start, const Message_Msg& amsg);
158 //! Records a new Information message from the definition
159 //! of a Msg (Original+Value)
160 void SendMsg (const Handle(IGESData_IGESEntity)& start, const Message_Msg& amsg);
162 //! Returns True if start was already treated and has a result in "myMap"
163 //! else returns False.
164 Standard_EXPORT Standard_Boolean HasShapeResult (const Handle(IGESData_IGESEntity)& start) const;
166 //! Returns the result of the transfer of the IGESEntity "start" contained
167 //! in "myMap" . (if HasShapeResult is True).
168 Standard_EXPORT TopoDS_Shape GetShapeResult (const Handle(IGESData_IGESEntity)& start) const;
170 //! set in "myMap" the result of the transfer of the IGESEntity "start".
171 Standard_EXPORT void SetShapeResult (const Handle(IGESData_IGESEntity)& start, const TopoDS_Shape& result);
173 //! Returns the number of shapes results contained in "myMap" for the
174 //! IGESEntity start ( type VertexList or EdgeList).
175 Standard_EXPORT Standard_Integer NbShapeResult (const Handle(IGESData_IGESEntity)& start) const;
177 //! Returns the numth result of the IGESEntity start (type VertexList or
178 //! EdgeList) in "myMap". (if NbShapeResult is not null).
179 Standard_EXPORT TopoDS_Shape GetShapeResult (const Handle(IGESData_IGESEntity)& start, const Standard_Integer num) const;
181 //! set in "myMap" the result of the transfer of the entity of the
182 //! IGESEntity start ( type VertexList or EdgeList).
183 Standard_EXPORT void AddShapeResult (const Handle(IGESData_IGESEntity)& start, const TopoDS_Shape& result);
185 Standard_EXPORT void SetSurface (const Handle(Geom_Surface)& theSurface);
187 Standard_EXPORT Handle(Geom_Surface) Surface() const;
189 Standard_EXPORT Standard_Real GetUVResolution();
205 Standard_Real myEpsCoeff;
206 Standard_Real myEpsGeom;
207 Standard_Real myMinTol;
208 Standard_Real myMaxTol;
209 Standard_Boolean myModeIsTopo;
210 Standard_Boolean myModeApprox;
211 Standard_Boolean myContIsOpti;
212 Standard_Real myUnitFactor;
213 Standard_Integer mySurfaceCurve;
214 Standard_Integer myContinuity;
215 Handle(Geom_Surface) mySurface;
216 Standard_Real myUVResolution;
217 Standard_Boolean myIsResolCom;
218 Handle(IGESData_IGESModel) myModel;
219 Handle(Transfer_TransientProcess) myTP;
225 #include <IGESToBRep_CurveAndSurface.lxx>
231 #endif // _IGESToBRep_CurveAndSurface_HeaderFile