Warnings on vc14 were eliminated
[occt.git] / src / ShapeUpgrade / ShapeUpgrade_WireDivide.hxx
1 // Created on: 1999-04-15
2 // Created by: Roman LYGIN
3 // Copyright (c) 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 _ShapeUpgrade_WireDivide_HeaderFile
18 #define _ShapeUpgrade_WireDivide_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <TopoDS_Face.hxx>
24 #include <TopoDS_Wire.hxx>
25 #include <Standard_Integer.hxx>
26 #include <ShapeUpgrade_Tool.hxx>
27 #include <Standard_Boolean.hxx>
28 #include <ShapeExtend_Status.hxx>
29 class ShapeUpgrade_SplitCurve3d;
30 class ShapeUpgrade_SplitCurve2d;
31 class ShapeUpgrade_EdgeDivide;
32 class ShapeAnalysis_TransferParameters;
33 class ShapeUpgrade_FixSmallCurves;
34 class TopoDS_Wire;
35 class TopoDS_Face;
36 class Geom_Surface;
37 class TopoDS_Edge;
38 class TopLoc_Location;
39
40
41 class ShapeUpgrade_WireDivide;
42 DEFINE_STANDARD_HANDLE(ShapeUpgrade_WireDivide, ShapeUpgrade_Tool)
43
44 //! Divides edges in the wire lying on the face or free wires or
45 //! free edges with a criterion.
46 //! Splits 3D curve and pcurve(s) of the edge on the face.
47 //! Other pcurves which may be associated with the edge are simply
48 //! copied.
49 //! If 3D curve is splitted then pcurve on the face is splitted as
50 //! well, and wice-versa.
51 //! Input shape is not modified.
52 //! The modifications made are recorded in external context
53 //! (ShapeBuild_ReShape). This tool is applied to all edges
54 //! before splitting them in order to keep sharing.
55 class ShapeUpgrade_WireDivide : public ShapeUpgrade_Tool
56 {
57
58 public:
59
60   
61   //! Empty constructor
62   Standard_EXPORT ShapeUpgrade_WireDivide();
63   
64   //! Initializes by wire and face
65   Standard_EXPORT void Init (const TopoDS_Wire& W, const TopoDS_Face& F);
66   
67   //! Initializes by wire and surface
68   Standard_EXPORT void Init (const TopoDS_Wire& W, const Handle(Geom_Surface)& S);
69   
70   //! Loads working wire
71   Standard_EXPORT void Load (const TopoDS_Wire& W);
72   
73   //! Creates wire of one edge and calls Load for wire
74   Standard_EXPORT void Load (const TopoDS_Edge& E);
75   
76   //! Sets supporting surface by face
77   Standard_EXPORT void SetFace (const TopoDS_Face& F);
78   
79   //! Sets supporting surface
80   Standard_EXPORT void SetSurface (const Handle(Geom_Surface)& S);
81   
82   //! Sets supporting surface with location
83   Standard_EXPORT void SetSurface (const Handle(Geom_Surface)& S, const TopLoc_Location& L);
84   
85   //! Computes the resulting wire by splitting all the edges
86   //! according to splitting criteria.
87   //! All the modifications made are recorded in context
88   //! (ShapeBuild_ReShape). This tool is applied to all edges
89   //! before splitting them in order to keep sharings.
90   //! If no supporting face or surface is defined, only 3d
91   //! splitting criteria are used.
92   Standard_EXPORT virtual void Perform();
93   
94   //! Gives the resulting Wire (equal to initial one if not done
95   //! or Null if not loaded)
96   Standard_EXPORT const TopoDS_Wire& Wire() const;
97   
98   //! Queries status of last call to Perform()
99   //! OK - no edges were splitted, wire left untouched
100   //! DONE1 - some edges were splitted
101   //! FAIL1 - some edges have no 3d curve (skipped)
102   //! FAIL2 - some edges have no pcurve (skipped)
103   Standard_EXPORT Standard_Boolean Status (const ShapeExtend_Status status) const;
104   
105   //! Sets the tool for splitting 3D curves.
106   Standard_EXPORT void SetSplitCurve3dTool (const Handle(ShapeUpgrade_SplitCurve3d)& splitCurve3dTool);
107   
108   //! Sets the tool for splitting pcurves.
109   Standard_EXPORT void SetSplitCurve2dTool (const Handle(ShapeUpgrade_SplitCurve2d)& splitCurve2dTool);
110   
111   //! Sets the tool for Transfer parameters between curves and pcurves.
112   Standard_EXPORT void SetTransferParamTool (const Handle(ShapeAnalysis_TransferParameters)& TransferParam);
113   
114   //! Sets tool for splitting edge
115   Standard_EXPORT void SetEdgeDivideTool (const Handle(ShapeUpgrade_EdgeDivide)& edgeDivideTool);
116   
117   //! returns tool for splitting edges
118   Standard_EXPORT virtual Handle(ShapeUpgrade_EdgeDivide) GetEdgeDivideTool() const;
119   
120   //! Returns the tool for Transfer of parameters.
121   Standard_EXPORT virtual Handle(ShapeAnalysis_TransferParameters) GetTransferParamTool();
122   
123   //! Sets mode for splitting 3d curves from edges.
124   //! 0 - only curve 3d from free edges.
125   //! 1 - only curve 3d from shared edges.
126   //! 2 -  all curve 3d.
127   Standard_EXPORT void SetEdgeMode (const Standard_Integer EdgeMode);
128   
129   //! Sets tool for fixing small curves with specified min tolerance;
130   Standard_EXPORT void SetFixSmallCurveTool (const Handle(ShapeUpgrade_FixSmallCurves)& FixSmallCurvesTool);
131   
132   //! Returns tool for fixing small curves
133   Standard_EXPORT Handle(ShapeUpgrade_FixSmallCurves) GetFixSmallCurveTool() const;
134
135
136
137
138   DEFINE_STANDARD_RTTIEXT(ShapeUpgrade_WireDivide,ShapeUpgrade_Tool)
139
140 protected:
141
142   
143   //! Returns the tool for splitting 3D curves.
144   Standard_EXPORT virtual Handle(ShapeUpgrade_SplitCurve3d) GetSplitCurve3dTool() const;
145   
146   //! Returns the tool for splitting pcurves.
147   Standard_EXPORT virtual Handle(ShapeUpgrade_SplitCurve2d) GetSplitCurve2dTool() const;
148
149   TopoDS_Face myFace;
150   TopoDS_Wire myWire;
151   Standard_Integer myStatus;
152   Standard_Integer myEdgeMode;
153
154
155 private:
156
157
158   Handle(ShapeUpgrade_SplitCurve3d) mySplitCurve3dTool;
159   Handle(ShapeUpgrade_SplitCurve2d) mySplitCurve2dTool;
160   Handle(ShapeUpgrade_EdgeDivide) myEdgeDivide;
161   Handle(ShapeAnalysis_TransferParameters) myTransferParamTool;
162   Handle(ShapeUpgrade_FixSmallCurves) myFixSmallCurveTool;
163
164
165 };
166
167
168
169
170
171
172
173 #endif // _ShapeUpgrade_WireDivide_HeaderFile