42cf5bc1 |
1 | // Created on: 1998-12-16 |
2 | // Created by: Roman LYGIN |
3 | // Copyright (c) 1998-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_IGESBoundary_HeaderFile |
18 | #define _IGESToBRep_IGESBoundary_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <IGESToBRep_CurveAndSurface.hxx> |
24 | #include <TopoDS_Face.hxx> |
25 | #include <gp_Trsf2d.hxx> |
26 | #include <Standard_Real.hxx> |
27 | #include <Standard_Integer.hxx> |
25e59720 |
28 | #include <Standard_Transient.hxx> |
42cf5bc1 |
29 | #include <Standard_Boolean.hxx> |
30 | #include <IGESData_HArray1OfIGESEntity.hxx> |
31 | class IGESData_IGESEntity; |
32 | class ShapeExtend_WireData; |
33 | class IGESToBRep_CurveAndSurface; |
34 | class TopoDS_Face; |
35 | class gp_Trsf2d; |
36 | |
37 | |
38 | class IGESToBRep_IGESBoundary; |
25e59720 |
39 | DEFINE_STANDARD_HANDLE(IGESToBRep_IGESBoundary, Standard_Transient) |
42cf5bc1 |
40 | |
41 | //! This class is intended to translate IGES boundary entity |
42 | //! (142-CurveOnSurface, 141-Boundary or 508-Loop) into the wire. |
43 | //! Methods Transfer are virtual and are redefined in Advanced |
44 | //! Data Exchange to optimize the translation and take into |
45 | //! account advanced parameters. |
25e59720 |
46 | class IGESToBRep_IGESBoundary : public Standard_Transient |
42cf5bc1 |
47 | { |
48 | |
49 | public: |
50 | |
51 | |
52 | //! Empty constructor |
53 | Standard_EXPORT IGESToBRep_IGESBoundary(); |
54 | |
55 | //! Empty constructor |
56 | Standard_EXPORT IGESToBRep_IGESBoundary(const IGESToBRep_CurveAndSurface& CS); |
57 | |
58 | //! Inits the object with parameters common for all |
59 | //! types of IGES boundaries. |
60 | //! <CS>: object to be used for retrieving translation parameters |
61 | //! and sending messages, |
62 | //! <entity>: boundary entity to be processed, |
63 | //! <face>, <trans>, <uFact>: as for IGESToBRep_TopoCurve |
64 | //! <filepreference>: preferred representation (2 or 3) given |
65 | //! in the IGES file |
66 | 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); |
67 | |
68 | //! Returns the resulting wire |
69 | Handle(ShapeExtend_WireData) WireData() const; |
70 | |
71 | //! Returns the wire from 3D curves (edges contain 3D curves |
72 | //! and may contain pcurves) |
73 | Handle(ShapeExtend_WireData) WireData3d() const; |
74 | |
75 | //! Returns the the wire from 2D curves (edges contain pcurves |
76 | //! only) |
77 | Handle(ShapeExtend_WireData) WireData2d() const; |
78 | |
79 | //! Translates 141 and 142 entities. |
80 | //! Returns True if the curve has been successfully translated, |
81 | //! otherwise returns False. |
82 | //! <okCurve..>: flags that indicate whether corresponding |
83 | //! representation has been successfully translated |
84 | //! (must be set to True before first call), |
85 | //! <curve3d>: model space curve for 142 and current model space |
86 | //! curve for 141, |
87 | //! <toreverse3d>: False for 142 and current orientation flag |
88 | //! for 141, |
89 | //! <curves2d>: 1 parameter space curve for 142 or list of |
90 | //! them for current model space curves for 141, |
91 | //! <number>: 1 for 142 and rank number of model space curve for 141. |
92 | 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); |
93 | |
94 | //! Translates 508 entity. |
95 | //! Returns True if the curve has been successfully translated, |
96 | //! otherwise returns False. |
97 | //! Input object IGESBoundary must be created and initialized |
98 | //! before. |
99 | //! <okCurve..>: flags that indicate whether corresponding |
100 | //! representation has been successfully translated |
101 | //! (must be set to True before first call), |
102 | //! <curve3d>: result of translation of current edge, |
103 | //! <curves2d>: list of parameter space curves for edge, |
104 | //! <toreverse2d>: orientation flag of current edge in respect |
105 | //! to its model space curve, |
106 | //! <number>: rank number of edge, |
107 | //! <lsewd>: returns the result of translation of current edge. |
108 | 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); |
109 | |
110 | //! Checks result of translation of IGES boundary entities |
111 | //! (types 141, 142 or 508). |
112 | //! Checks consistency of 2D and 3D representations and keeps |
113 | //! only one if they are inconsistent. |
114 | //! <result>: result of translation (returned by Transfer), |
115 | //! <checkclosure>: False for 142 without parent 144 entity, |
116 | //! otherwise True, |
117 | //! <okCurve3d>, <okCurve2d>: those returned by Transfer. |
118 | Standard_EXPORT virtual void Check (const Standard_Boolean result, const Standard_Boolean checkclosure, const Standard_Boolean okCurve3d, const Standard_Boolean okCurve2d); |
119 | |
120 | |
121 | |
122 | |
25e59720 |
123 | DEFINE_STANDARD_RTTIEXT(IGESToBRep_IGESBoundary,Standard_Transient) |
42cf5bc1 |
124 | |
125 | protected: |
126 | |
127 | |
128 | //! Methods called by both Transfer methods. |
129 | 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); |
130 | |
131 | Standard_EXPORT static void ReverseCurves3d (const Handle(ShapeExtend_WireData)& sewd); |
132 | |
133 | Standard_EXPORT static void ReverseCurves2d (const Handle(ShapeExtend_WireData)& sewd, const TopoDS_Face& face); |
134 | |
135 | IGESToBRep_CurveAndSurface myCS; |
136 | Handle(IGESData_IGESEntity) myentity; |
137 | Handle(ShapeExtend_WireData) mysewd; |
138 | Handle(ShapeExtend_WireData) mysewd3d; |
139 | Handle(ShapeExtend_WireData) mysewd2d; |
140 | TopoDS_Face myface; |
141 | gp_Trsf2d mytrsf; |
142 | Standard_Real myuFact; |
143 | Standard_Integer myfilepreference; |
144 | |
145 | |
146 | private: |
147 | |
148 | |
149 | |
150 | |
151 | }; |
152 | |
153 | |
154 | #include <IGESToBRep_IGESBoundary.lxx> |
155 | |
156 | |
157 | |
158 | |
159 | |
160 | #endif // _IGESToBRep_IGESBoundary_HeaderFile |