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 and sets its
50 Standard_EXPORT IGESToBRep_CurveAndSurface(const IGESToBRep_CurveAndSurface& CS);
52 //! Creates a tool CurveAndSurface ready to run.
53 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);
55 //! Initializes the field of the tool CurveAndSurface with
56 //! default creating values.
57 Standard_EXPORT void Init();
59 //! Changes the value of "myEps"
60 void SetEpsilon (const Standard_Real eps);
62 //! Returns the value of "myEps"
63 Standard_Real GetEpsilon() const;
65 //! Changes the value of "myEpsCoeff"
66 void SetEpsCoeff (const Standard_Real eps);
68 //! Returns the value of "myEpsCoeff"
69 Standard_Real GetEpsCoeff() const;
71 //! Changes the value of "myEpsGeom"
72 Standard_EXPORT void SetEpsGeom (const Standard_Real eps);
74 //! Returns the value of "myEpsGeom"
75 Standard_Real GetEpsGeom() const;
77 //! Changes the value of "myMinTol"
78 void SetMinTol (const Standard_Real mintol);
80 //! Changes the value of "myMaxTol"
81 void SetMaxTol (const Standard_Real maxtol);
83 //! Sets values of "myMinTol" and "myMaxTol" as follows
84 //! myMaxTol = Max ("read.maxprecision.val", myEpsGeom * myUnitFactor)
85 //! myMinTol = Precision::Confusion()
86 //! Remark: This method is automatically invoked each time the values
87 //! of "myEpsGeom" or "myUnitFactor" are changed
88 Standard_EXPORT void UpdateMinMaxTol();
90 //! Returns the value of "myMinTol"
91 Standard_Real GetMinTol() const;
93 //! Returns the value of "myMaxTol"
94 Standard_Real GetMaxTol() const;
96 //! Changes the value of "myModeApprox"
97 void SetModeApprox (const Standard_Boolean mode);
99 //! Returns the value of "myModeApprox"
100 Standard_Boolean GetModeApprox() const;
102 //! Changes the value of "myModeIsTopo"
103 void SetModeTransfer (const Standard_Boolean mode);
105 //! Returns the value of "myModeIsTopo"
106 Standard_Boolean GetModeTransfer() const;
108 //! Changes the value of "myContIsOpti"
109 void SetOptimized (const Standard_Boolean optimized);
111 //! Returns the value of "myContIsOpti"
112 Standard_Boolean GetOptimized() const;
114 //! Returns the value of " myUnitFactor"
115 Standard_Real GetUnitFactor() const;
117 //! Changes the value of "mySurfaceCurve"
118 void SetSurfaceCurve (const Standard_Integer ival);
120 //! Returns the value of " mySurfaceCurve" 0 = value in
121 //! file , 2 = kepp 2d and compute 3d 3 = keep 3d and
123 Standard_Integer GetSurfaceCurve() const;
125 //! Set the value of "myModel"
126 Standard_EXPORT void SetModel (const Handle(IGESData_IGESModel)& model);
128 //! Returns the value of "myModel"
129 Handle(IGESData_IGESModel) GetModel() const;
131 //! Changes the value of "myContinuity"
132 //! if continuity = 0 do nothing else
133 //! if continuity = 1 try C1
134 //! if continuity = 2 try C2
135 void SetContinuity (const Standard_Integer continuity);
137 //! Returns the value of "myContinuity"
138 Standard_Integer GetContinuity() const;
140 //! Set the value of "myMsgReg"
141 void SetTransferProcess (const Handle(Transfer_TransientProcess)& TP);
143 //! Returns the value of "myMsgReg"
144 Handle(Transfer_TransientProcess) GetTransferProcess() const;
146 //! Returns the result of the transfert of any IGES Curve
147 //! or Surface Entity. If the transfer has failed, this
148 //! member return a NullEntity.
149 Standard_EXPORT TopoDS_Shape TransferCurveAndSurface (const Handle(IGESData_IGESEntity)& start);
151 //! Returns the result of the transfert the geometry of
152 //! any IGESEntity. If the transfer has failed, this
153 //! member return a NullEntity.
154 Standard_EXPORT TopoDS_Shape TransferGeometry (const Handle(IGESData_IGESEntity)& start);
156 //! Records a new Fail message
157 void SendFail (const Handle(IGESData_IGESEntity)& start, const Message_Msg& amsg);
159 //! Records a new Warning message
160 void SendWarning (const Handle(IGESData_IGESEntity)& start, const Message_Msg& amsg);
162 //! Records a new Information message from the definition
163 //! of a Msg (Original+Value)
164 void SendMsg (const Handle(IGESData_IGESEntity)& start, const Message_Msg& amsg);
166 //! Returns True if start was already treated and has a result in "myMap"
167 //! else returns False.
168 Standard_EXPORT Standard_Boolean HasShapeResult (const Handle(IGESData_IGESEntity)& start) const;
170 //! Returns the result of the transfer of the IGESEntity "start" contained
171 //! in "myMap" . (if HasShapeResult is True).
172 Standard_EXPORT TopoDS_Shape GetShapeResult (const Handle(IGESData_IGESEntity)& start) const;
174 //! set in "myMap" the result of the transfer of the IGESEntity "start".
175 Standard_EXPORT void SetShapeResult (const Handle(IGESData_IGESEntity)& start, const TopoDS_Shape& result);
177 //! Returns the number of shapes results contained in "myMap" for the
178 //! IGESEntity start ( type VertexList or EdgeList).
179 Standard_EXPORT Standard_Integer NbShapeResult (const Handle(IGESData_IGESEntity)& start) const;
181 //! Returns the numth result of the IGESEntity start (type VertexList or
182 //! EdgeList) in "myMap". (if NbShapeResult is not null).
183 Standard_EXPORT TopoDS_Shape GetShapeResult (const Handle(IGESData_IGESEntity)& start, const Standard_Integer num) const;
185 //! set in "myMap" the result of the transfer of the entity of the
186 //! IGESEntity start ( type VertexList or EdgeList).
187 Standard_EXPORT void AddShapeResult (const Handle(IGESData_IGESEntity)& start, const TopoDS_Shape& result);
189 Standard_EXPORT void SetSurface (const Handle(Geom_Surface)& theSurface);
191 Standard_EXPORT Handle(Geom_Surface) Surface() const;
193 Standard_EXPORT Standard_Real GetUVResolution();
209 Standard_Real myEpsCoeff;
210 Standard_Real myEpsGeom;
211 Standard_Real myMinTol;
212 Standard_Real myMaxTol;
213 Standard_Boolean myModeIsTopo;
214 Standard_Boolean myModeApprox;
215 Standard_Boolean myContIsOpti;
216 Standard_Real myUnitFactor;
217 Standard_Integer mySurfaceCurve;
218 Standard_Integer myContinuity;
219 Handle(Geom_Surface) mySurface;
220 Standard_Real myUVResolution;
221 Standard_Boolean myIsResolCom;
222 Handle(IGESData_IGESModel) myModel;
223 Handle(Transfer_TransientProcess) myTP;
229 #include <IGESToBRep_CurveAndSurface.lxx>
235 #endif // _IGESToBRep_CurveAndSurface_HeaderFile