Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:04

0001 // Created on: 1994-03-14
0002 // Created by: s:   Christophe GUYOT & Frederic UNTEREINER
0003 // Copyright (c) 1994-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _IGESToBRep_CurveAndSurface_HeaderFile
0018 #define _IGESToBRep_CurveAndSurface_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Integer.hxx>
0025 #include <Message_ProgressRange.hxx>
0026 
0027 class Geom_Surface;
0028 class IGESData_IGESModel;
0029 class Transfer_TransientProcess;
0030 class TopoDS_Shape;
0031 class IGESData_IGESEntity;
0032 class Message_Msg;
0033 
0034 //! Provides methods to transfer CurveAndSurface from IGES to CASCADE.
0035 class IGESToBRep_CurveAndSurface 
0036 {
0037 public:
0038 
0039   DEFINE_STANDARD_ALLOC
0040 
0041   
0042   //! Creates  a tool CurveAndSurface  ready  to  run, with
0043   //! epsilons  set  to  1.E-04,  myModeTopo  to  True,  the
0044   //! optimization of  the continuity to False.
0045   Standard_EXPORT IGESToBRep_CurveAndSurface();
0046   
0047   //! Creates a tool CurveAndSurface ready to run.
0048   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);
0049   
0050   //! Initializes the field of the tool CurveAndSurface with
0051   //! default creating values.
0052   Standard_EXPORT void Init();
0053   
0054   //! Changes the value of "myEps"
0055     void SetEpsilon (const Standard_Real eps);
0056   
0057   //! Returns the value of "myEps"
0058     Standard_Real GetEpsilon() const;
0059   
0060   //! Changes the value of "myEpsCoeff"
0061     void SetEpsCoeff (const Standard_Real eps);
0062   
0063   //! Returns the value of "myEpsCoeff"
0064     Standard_Real GetEpsCoeff() const;
0065   
0066   //! Changes the value of "myEpsGeom"
0067   Standard_EXPORT void SetEpsGeom (const Standard_Real eps);
0068   
0069   //! Returns the value of "myEpsGeom"
0070     Standard_Real GetEpsGeom() const;
0071   
0072   //! Changes the value of "myMinTol"
0073     void SetMinTol (const Standard_Real mintol);
0074   
0075   //! Changes the value of "myMaxTol"
0076     void SetMaxTol (const Standard_Real maxtol);
0077   
0078   //! Sets values of "myMinTol" and "myMaxTol" as follows
0079   //! myMaxTol = Max ("read.maxprecision.val", myEpsGeom * myUnitFactor)
0080   //! myMinTol = Precision::Confusion()
0081   //! Remark:   This method is automatically invoked each time the values
0082   //! of "myEpsGeom" or "myUnitFactor" are changed
0083   Standard_EXPORT void UpdateMinMaxTol();
0084   
0085   //! Returns the value of "myMinTol"
0086     Standard_Real GetMinTol() const;
0087   
0088   //! Returns the value of "myMaxTol"
0089     Standard_Real GetMaxTol() const;
0090   
0091   //! Changes the value of "myModeApprox"
0092     void SetModeApprox (const Standard_Boolean mode);
0093   
0094   //! Returns the value of "myModeApprox"
0095     Standard_Boolean GetModeApprox() const;
0096   
0097   //! Changes the value of "myModeIsTopo"
0098     void SetModeTransfer (const Standard_Boolean mode);
0099   
0100   //! Returns the value of "myModeIsTopo"
0101     Standard_Boolean GetModeTransfer() const;
0102   
0103   //! Changes the value of "myContIsOpti"
0104     void SetOptimized (const Standard_Boolean optimized);
0105   
0106   //! Returns the value of "myContIsOpti"
0107     Standard_Boolean GetOptimized() const;
0108   
0109   //! Returns the value of " myUnitFactor"
0110     Standard_Real GetUnitFactor() const;
0111   
0112   //! Changes the value of "mySurfaceCurve"
0113     void SetSurfaceCurve (const Standard_Integer ival);
0114   
0115   //! Returns the value of  " mySurfaceCurve" 0 = value in
0116   //! file , 2  = kepp 2d   and compute 3d   3 = keep 3d and
0117   //! compute 2d
0118     Standard_Integer GetSurfaceCurve() const;
0119   
0120   //! Set the value of "myModel"
0121   Standard_EXPORT void SetModel (const Handle(IGESData_IGESModel)& model);
0122   
0123   //! Returns the value of "myModel"
0124     Handle(IGESData_IGESModel) GetModel() const;
0125   
0126   //! Changes the value of "myContinuity"
0127   //! if continuity = 0 do nothing else
0128   //! if continuity = 1 try C1
0129   //! if continuity = 2 try C2
0130     void SetContinuity (const Standard_Integer continuity);
0131   
0132   //! Returns the value of "myContinuity"
0133     Standard_Integer GetContinuity() const;
0134   
0135   //! Set the value of "myMsgReg"
0136     void SetTransferProcess (const Handle(Transfer_TransientProcess)& TP);
0137   
0138   //! Returns the value of "myMsgReg"
0139     Handle(Transfer_TransientProcess) GetTransferProcess() const;
0140   
0141   //! Returns the result of the transfert of any IGES Curve
0142   //! or Surface Entity.  If  the transfer has  failed,  this
0143   //! member return a NullEntity.
0144   Standard_EXPORT TopoDS_Shape TransferCurveAndSurface (const Handle(IGESData_IGESEntity)& start,
0145                                                         const Message_ProgressRange& theProgress = Message_ProgressRange());
0146   
0147   //! Returns the result of the transfert the geometry of
0148   //! any IGESEntity.  If  the transfer has  failed,  this
0149   //! member return a NullEntity.
0150   Standard_EXPORT TopoDS_Shape TransferGeometry (const Handle(IGESData_IGESEntity)& start,
0151                                                  const Message_ProgressRange& theProgress = Message_ProgressRange());
0152   
0153   //! Records a new Fail message
0154     void SendFail (const Handle(IGESData_IGESEntity)& start, const Message_Msg& amsg);
0155   
0156   //! Records a new Warning message
0157     void SendWarning (const Handle(IGESData_IGESEntity)& start, const Message_Msg& amsg);
0158   
0159   //! Records a new Information message from the definition
0160   //! of a Msg (Original+Value)
0161     void SendMsg (const Handle(IGESData_IGESEntity)& start, const Message_Msg& amsg);
0162   
0163   //! Returns True if start was already treated and has a result in "myMap"
0164   //! else returns False.
0165   Standard_EXPORT Standard_Boolean HasShapeResult (const Handle(IGESData_IGESEntity)& start) const;
0166   
0167   //! Returns the result of the transfer of the IGESEntity "start" contained
0168   //! in "myMap" . (if HasShapeResult is True).
0169   Standard_EXPORT TopoDS_Shape GetShapeResult (const Handle(IGESData_IGESEntity)& start) const;
0170   
0171   //! set in "myMap" the result of the transfer of the IGESEntity "start".
0172   Standard_EXPORT void SetShapeResult (const Handle(IGESData_IGESEntity)& start, const TopoDS_Shape& result);
0173   
0174   //! Returns the number of shapes results contained in "myMap" for the
0175   //! IGESEntity start ( type VertexList or EdgeList).
0176   Standard_EXPORT Standard_Integer NbShapeResult (const Handle(IGESData_IGESEntity)& start) const;
0177   
0178   //! Returns the numth result of the IGESEntity start (type VertexList or
0179   //! EdgeList) in "myMap". (if NbShapeResult is not null).
0180   Standard_EXPORT TopoDS_Shape GetShapeResult (const Handle(IGESData_IGESEntity)& start, const Standard_Integer num) const;
0181   
0182   //! set in "myMap" the result of the transfer of the entity of the
0183   //! IGESEntity start ( type VertexList or EdgeList).
0184   Standard_EXPORT void AddShapeResult (const Handle(IGESData_IGESEntity)& start, const TopoDS_Shape& result);
0185   
0186   Standard_EXPORT void SetSurface (const Handle(Geom_Surface)& theSurface);
0187   
0188   Standard_EXPORT Handle(Geom_Surface) Surface() const;
0189   
0190   Standard_EXPORT Standard_Real GetUVResolution();
0191 
0192 
0193 
0194 
0195 protected:
0196 
0197 
0198 
0199 
0200 
0201 private:
0202 
0203 
0204 
0205   Standard_Real myEps;
0206   Standard_Real myEpsCoeff;
0207   Standard_Real myEpsGeom;
0208   Standard_Real myMinTol;
0209   Standard_Real myMaxTol;
0210   Standard_Boolean myModeIsTopo;
0211   Standard_Boolean myModeApprox;
0212   Standard_Boolean myContIsOpti;
0213   Standard_Real myUnitFactor;
0214   Standard_Integer mySurfaceCurve;
0215   Standard_Integer myContinuity;
0216   Handle(Geom_Surface) mySurface;
0217   Standard_Real myUVResolution;
0218   Standard_Boolean myIsResolCom;
0219   Handle(IGESData_IGESModel) myModel;
0220   Handle(Transfer_TransientProcess) myTP;
0221 
0222 
0223 };
0224 
0225 
0226 #include <IGESToBRep_CurveAndSurface.lxx>
0227 
0228 
0229 
0230 
0231 
0232 #endif // _IGESToBRep_CurveAndSurface_HeaderFile