Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-11 08:33:32

0001 // Created on: 1998-12-16
0002 // Created by: Roman LYGIN
0003 // Copyright (c) 1998-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_IGESBoundary_HeaderFile
0018 #define _IGESToBRep_IGESBoundary_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <IGESToBRep_CurveAndSurface.hxx>
0024 #include <TopoDS_Face.hxx>
0025 #include <gp_Trsf2d.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <Standard_Transient.hxx>
0028 #include <IGESData_HArray1OfIGESEntity.hxx>
0029 class IGESData_IGESEntity;
0030 class ShapeExtend_WireData;
0031 
0032 class IGESToBRep_IGESBoundary;
0033 DEFINE_STANDARD_HANDLE(IGESToBRep_IGESBoundary, Standard_Transient)
0034 
0035 //! This class is intended to translate IGES boundary entity
0036 //! (142-CurveOnSurface, 141-Boundary or 508-Loop) into the wire.
0037 //! Methods Transfer are virtual and are redefined in Advanced
0038 //! Data Exchange to optimize the translation and take into
0039 //! account advanced parameters.
0040 class IGESToBRep_IGESBoundary : public Standard_Transient
0041 {
0042 
0043 public:
0044   //! Empty constructor
0045   Standard_EXPORT IGESToBRep_IGESBoundary();
0046 
0047   //! Empty constructor
0048   Standard_EXPORT IGESToBRep_IGESBoundary(const IGESToBRep_CurveAndSurface& CS);
0049 
0050   //! Inits the object with parameters common for all
0051   //! types of IGES boundaries.
0052   //! <CS>: object to be used for retrieving translation parameters
0053   //! and sending messages,
0054   //! <entity>: boundary entity to be processed,
0055   //! <face>, <trans>, <uFact>: as for IGESToBRep_TopoCurve
0056   //! <filepreference>: preferred representation (2 or 3) given
0057   //! in the IGES file
0058   Standard_EXPORT void Init(const IGESToBRep_CurveAndSurface&  CS,
0059                             const Handle(IGESData_IGESEntity)& entity,
0060                             const TopoDS_Face&                 face,
0061                             const gp_Trsf2d&                   trans,
0062                             const Standard_Real                uFact,
0063                             const Standard_Integer             filepreference);
0064 
0065   //! Returns the resulting wire
0066   Handle(ShapeExtend_WireData) WireData() const;
0067 
0068   //! Returns the wire from 3D curves (edges contain 3D curves
0069   //! and may contain pcurves)
0070   Handle(ShapeExtend_WireData) WireData3d() const;
0071 
0072   //! Returns the wire from 2D curves (edges contain pcurves
0073   //! only)
0074   Handle(ShapeExtend_WireData) WireData2d() const;
0075 
0076   //! Translates 141 and 142 entities.
0077   //! Returns True if the curve has been successfully translated,
0078   //! otherwise returns False.
0079   //! <okCurve..>: flags that indicate whether corresponding
0080   //! representation has been successfully translated
0081   //! (must be set to True before first call),
0082   //! <curve3d>: model space curve for 142 and current model space
0083   //! curve for 141,
0084   //! <toreverse3d>: False for 142 and current orientation flag
0085   //! for 141,
0086   //! <curves2d>: 1 parameter space curve for 142 or list of
0087   //! them for current model space curves for 141,
0088   //! <number>: 1 for 142 and rank number of model space curve for 141.
0089   Standard_EXPORT Standard_Boolean Transfer(Standard_Boolean&                           okCurve,
0090                                             Standard_Boolean&                           okCurve3d,
0091                                             Standard_Boolean&                           okCurve2d,
0092                                             const Handle(IGESData_IGESEntity)&          curve3d,
0093                                             const Standard_Boolean                      toreverse3d,
0094                                             const Handle(IGESData_HArray1OfIGESEntity)& curves2d,
0095                                             const Standard_Integer                      number);
0096 
0097   //! Translates 508 entity.
0098   //! Returns True if the curve has been successfully translated,
0099   //! otherwise returns False.
0100   //! Input object IGESBoundary must be created and initialized
0101   //! before.
0102   //! <okCurve..>: flags that indicate whether corresponding
0103   //! representation has been successfully translated
0104   //! (must be set to True before first call),
0105   //! <curve3d>: result of translation of current edge,
0106   //! <curves2d>: list of parameter space curves for edge,
0107   //! <toreverse2d>: orientation flag of current edge in respect
0108   //! to its model space curve,
0109   //! <number>: rank number of edge,
0110   //! <lsewd>: returns the result of translation of current edge.
0111   Standard_EXPORT Standard_Boolean Transfer(Standard_Boolean&                           okCurve,
0112                                             Standard_Boolean&                           okCurve3d,
0113                                             Standard_Boolean&                           okCurve2d,
0114                                             const Handle(ShapeExtend_WireData)&         curve3d,
0115                                             const Handle(IGESData_HArray1OfIGESEntity)& curves2d,
0116                                             const Standard_Boolean                      toreverse2d,
0117                                             const Standard_Integer                      number,
0118                                             Handle(ShapeExtend_WireData)&               lsewd);
0119 
0120   //! Checks result of translation of IGES boundary entities
0121   //! (types 141, 142 or 508).
0122   //! Checks consistency of 2D and 3D representations and keeps
0123   //! only one if they are inconsistent.
0124   //! <result>: result of translation (returned by Transfer),
0125   //! <checkclosure>: False for 142 without parent 144 entity,
0126   //! otherwise True,
0127   //! <okCurve3d>, <okCurve2d>: those returned by Transfer.
0128   Standard_EXPORT virtual void Check(const Standard_Boolean result,
0129                                      const Standard_Boolean checkclosure,
0130                                      const Standard_Boolean okCurve3d,
0131                                      const Standard_Boolean okCurve2d);
0132 
0133   DEFINE_STANDARD_RTTIEXT(IGESToBRep_IGESBoundary, Standard_Transient)
0134 
0135 protected:
0136   //! Methods called by both Transfer methods.
0137   Standard_EXPORT virtual Standard_Boolean Transfer(
0138     Standard_Boolean&                           okCurve,
0139     Standard_Boolean&                           okCurve3d,
0140     Standard_Boolean&                           okCurve2d,
0141     const Handle(IGESData_IGESEntity)&          icurve3d,
0142     const Handle(ShapeExtend_WireData)&         scurve3d,
0143     const Standard_Boolean                      usescurve,
0144     const Standard_Boolean                      toreverse3d,
0145     const Handle(IGESData_HArray1OfIGESEntity)& curves2d,
0146     const Standard_Boolean                      toreverse2d,
0147     const Standard_Integer                      number,
0148     Handle(ShapeExtend_WireData)&               lsewd);
0149 
0150   Standard_EXPORT static void ReverseCurves3d(const Handle(ShapeExtend_WireData)& sewd);
0151 
0152   Standard_EXPORT static void ReverseCurves2d(const Handle(ShapeExtend_WireData)& sewd,
0153                                               const TopoDS_Face&                  face);
0154 
0155   IGESToBRep_CurveAndSurface   myCS;
0156   Handle(IGESData_IGESEntity)  myentity;
0157   Handle(ShapeExtend_WireData) mysewd;
0158   Handle(ShapeExtend_WireData) mysewd3d;
0159   Handle(ShapeExtend_WireData) mysewd2d;
0160   TopoDS_Face                  myface;
0161   gp_Trsf2d                    mytrsf;
0162   Standard_Real                myuFact;
0163   Standard_Integer             myfilepreference;
0164 
0165 private:
0166 };
0167 
0168 #include <IGESToBRep_IGESBoundary.lxx>
0169 
0170 #endif // _IGESToBRep_IGESBoundary_HeaderFile