Back to home page

EIC code displayed by LXR

 
 

    


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

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