| 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 |
| 5 | // |
| 6 | // This file is part of Open CASCADE Technology software library. |
| 7 | // |
| 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. |
| 13 | // |
| 14 | // Alternatively, this file may be used under the terms of Open CASCADE |
| 15 | // commercial license or contractual agreement. |
| 16 | |
| 17 | #ifndef _IGESToBRep_CurveAndSurface_HeaderFile |
| 18 | #define _IGESToBRep_CurveAndSurface_HeaderFile |
| 19 | |
| 20 | #include <Standard.hxx> |
| 21 | #include <Standard_DefineAlloc.hxx> |
| 22 | #include <Standard_Handle.hxx> |
| 23 | |
| 24 | #include <Standard_Real.hxx> |
| 25 | #include <Standard_Boolean.hxx> |
| 26 | #include <Standard_Integer.hxx> |
| 27 | class Geom_Surface; |
| 28 | class IGESData_IGESModel; |
| 29 | class Transfer_TransientProcess; |
| 30 | class TopoDS_Shape; |
| 31 | class IGESData_IGESEntity; |
| 32 | class Message_Msg; |
| 33 | |
| 34 | |
| 35 | //! Provides methods to transfer CurveAndSurface from IGES to CASCADE. |
| 36 | class IGESToBRep_CurveAndSurface |
| 37 | { |
| 38 | public: |
| 39 | |
| 40 | DEFINE_STANDARD_ALLOC |
| 41 | |
| 42 | |
| 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(); |
| 47 | |
| 48 | //! Creates a tool CurveAndSurface ready to run and sets its |
| 49 | //! fields as CS's. |
| 50 | Standard_EXPORT IGESToBRep_CurveAndSurface(const IGESToBRep_CurveAndSurface& CS); |
| 51 | |
| 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); |
| 54 | |
| 55 | //! Initializes the field of the tool CurveAndSurface with |
| 56 | //! default creating values. |
| 57 | Standard_EXPORT void Init(); |
| 58 | |
| 59 | //! Changes the value of "myEps" |
| 60 | void SetEpsilon (const Standard_Real eps); |
| 61 | |
| 62 | //! Returns the value of "myEps" |
| 63 | Standard_Real GetEpsilon() const; |
| 64 | |
| 65 | //! Changes the value of "myEpsCoeff" |
| 66 | void SetEpsCoeff (const Standard_Real eps); |
| 67 | |
| 68 | //! Returns the value of "myEpsCoeff" |
| 69 | Standard_Real GetEpsCoeff() const; |
| 70 | |
| 71 | //! Changes the value of "myEpsGeom" |
| 72 | Standard_EXPORT void SetEpsGeom (const Standard_Real eps); |
| 73 | |
| 74 | //! Returns the value of "myEpsGeom" |
| 75 | Standard_Real GetEpsGeom() const; |
| 76 | |
| 77 | //! Changes the value of "myMinTol" |
| 78 | void SetMinTol (const Standard_Real mintol); |
| 79 | |
| 80 | //! Changes the value of "myMaxTol" |
| 81 | void SetMaxTol (const Standard_Real maxtol); |
| 82 | |
| 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(); |
| 89 | |
| 90 | //! Returns the value of "myMinTol" |
| 91 | Standard_Real GetMinTol() const; |
| 92 | |
| 93 | //! Returns the value of "myMaxTol" |
| 94 | Standard_Real GetMaxTol() const; |
| 95 | |
| 96 | //! Changes the value of "myModeApprox" |
| 97 | void SetModeApprox (const Standard_Boolean mode); |
| 98 | |
| 99 | //! Returns the value of "myModeApprox" |
| 100 | Standard_Boolean GetModeApprox() const; |
| 101 | |
| 102 | //! Changes the value of "myModeIsTopo" |
| 103 | void SetModeTransfer (const Standard_Boolean mode); |
| 104 | |
| 105 | //! Returns the value of "myModeIsTopo" |
| 106 | Standard_Boolean GetModeTransfer() const; |
| 107 | |
| 108 | //! Changes the value of "myContIsOpti" |
| 109 | void SetOptimized (const Standard_Boolean optimized); |
| 110 | |
| 111 | //! Returns the value of "myContIsOpti" |
| 112 | Standard_Boolean GetOptimized() const; |
| 113 | |
| 114 | //! Returns the value of " myUnitFactor" |
| 115 | Standard_Real GetUnitFactor() const; |
| 116 | |
| 117 | //! Changes the value of "mySurfaceCurve" |
| 118 | void SetSurfaceCurve (const Standard_Integer ival); |
| 119 | |
| 120 | //! Returns the value of " mySurfaceCurve" 0 = value in |
| 121 | //! file , 2 = kepp 2d and compute 3d 3 = keep 3d and |
| 122 | //! compute 2d |
| 123 | Standard_Integer GetSurfaceCurve() const; |
| 124 | |
| 125 | //! Set the value of "myModel" |
| 126 | Standard_EXPORT void SetModel (const Handle(IGESData_IGESModel)& model); |
| 127 | |
| 128 | //! Returns the value of "myModel" |
| 129 | Handle(IGESData_IGESModel) GetModel() const; |
| 130 | |
| 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); |
| 136 | |
| 137 | //! Returns the value of "myContinuity" |
| 138 | Standard_Integer GetContinuity() const; |
| 139 | |
| 140 | //! Set the value of "myMsgReg" |
| 141 | void SetTransferProcess (const Handle(Transfer_TransientProcess)& TP); |
| 142 | |
| 143 | //! Returns the value of "myMsgReg" |
| 144 | Handle(Transfer_TransientProcess) GetTransferProcess() const; |
| 145 | |
| 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); |
| 150 | |
| 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); |
| 155 | |
| 156 | //! Records a new Fail message |
| 157 | void SendFail (const Handle(IGESData_IGESEntity)& start, const Message_Msg& amsg); |
| 158 | |
| 159 | //! Records a new Warning message |
| 160 | void SendWarning (const Handle(IGESData_IGESEntity)& start, const Message_Msg& amsg); |
| 161 | |
| 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); |
| 165 | |
| 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; |
| 169 | |
| 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; |
| 173 | |
| 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); |
| 176 | |
| 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; |
| 180 | |
| 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; |
| 184 | |
| 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); |
| 188 | |
| 189 | Standard_EXPORT void SetSurface (const Handle(Geom_Surface)& theSurface); |
| 190 | |
| 191 | Standard_EXPORT Handle(Geom_Surface) Surface() const; |
| 192 | |
| 193 | Standard_EXPORT Standard_Real GetUVResolution(); |
| 194 | |
| 195 | |
| 196 | |
| 197 | |
| 198 | protected: |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | |
| 204 | private: |
| 205 | |
| 206 | |
| 207 | |
| 208 | Standard_Real myEps; |
| 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; |
| 224 | |
| 225 | |
| 226 | }; |
| 227 | |
| 228 | |
| 229 | #include <IGESToBRep_CurveAndSurface.lxx> |
| 230 | |
| 231 | |
| 232 | |
| 233 | |
| 234 | |
| 235 | #endif // _IGESToBRep_CurveAndSurface_HeaderFile |