1 -- Created on: 1999-04-15
2 -- Created by: Roman LYGIN
3 -- Copyright (c) 1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
23 class WireDivide from ShapeUpgrade inherits Tool from ShapeUpgrade
25 ---Purpose: Divides edges in the wire lying on the face or free wires or
26 -- free edges with a criterion.
27 -- Splits 3D curve and pcurve(s) of the edge on the face.
28 -- Other pcurves which may be associated with the edge are simply
30 -- If 3D curve is splitted then pcurve on the face is splitted as
31 -- well, and wice-versa.
32 -- Input shape is not modified.
33 -- The modifications made are recorded in external context
34 -- (ShapeBuild_ReShape). This tool is applied to all edges
35 -- before splitting them in order to keep sharing.
44 SplitCurve3d from ShapeUpgrade,
45 SplitCurve2d from ShapeUpgrade,
46 TransferParameters from ShapeAnalysis,
47 Status from ShapeExtend,
48 HSequenceOfReal from TColStd,
49 EdgeDivide from ShapeUpgrade,
50 FixSmallCurves from ShapeUpgrade
53 Create returns mutable WireDivide from ShapeUpgrade;
54 ---Purpose: Empty constructor
56 Init (me: mutable; W: Wire from TopoDS; F: Face from TopoDS);
57 ---Purpose: Initializes by wire and face
59 Init (me: mutable; W: Wire from TopoDS;
60 S: Surface from Geom);
61 ---Purpose: Initializes by wire and surface
63 Load (me: mutable; W: Wire from TopoDS);
64 ---Purpose: Loads working wire
66 Load (me: mutable; E: Edge from TopoDS);
67 ---Purpose: Creates wire of one edge and calls Load for wire
69 SetFace (me: mutable; F: Face from TopoDS);
70 ---Purpose: Sets supporting surface by face
72 SetSurface (me: mutable; S: Surface from Geom);
73 ---Purpose: Sets supporting surface
75 SetSurface (me: mutable; S: Surface from Geom; L: Location from TopLoc);
76 ---Purpose: Sets supporting surface with location
79 Perform (me: mutable) is virtual;
80 ---Purpose: Computes the resulting wire by splitting all the edges
81 -- according to splitting criteria.
82 -- All the modifications made are recorded in context
83 -- (ShapeBuild_ReShape). This tool is applied to all edges
84 -- before splitting them in order to keep sharings.
85 -- If no supporting face or surface is defined, only 3d
86 -- splitting criteria are used.
88 Wire (me) returns Wire from TopoDS;
89 ---C++: return const &
90 ---Purpose: Gives the resulting Wire (equal to initial one if not done
91 -- or Null if not loaded)
93 Status (me; status: Status from ShapeExtend) returns Boolean;
94 ---Purpose: Queries status of last call to Perform()
95 -- OK - no edges were splitted, wire left untouched
96 -- DONE1 - some edges were splitted
97 -- FAIL1 - some edges have no 3d curve (skipped)
98 -- FAIL2 - some edges have no pcurve (skipped)
102 SetSplitCurve3dTool(me: mutable; splitCurve3dTool: SplitCurve3d from ShapeUpgrade);
103 ---Purpose: Sets the tool for splitting 3D curves.
105 SetSplitCurve2dTool(me: mutable; splitCurve2dTool: SplitCurve2d from ShapeUpgrade);
106 ---Purpose: Sets the tool for splitting pcurves.
108 SetTransferParamTool(me: mutable; TransferParam: TransferParameters from ShapeAnalysis);
109 ---Purpose: Sets the tool for Transfer parameters between curves and pcurves.
111 GetSplitCurve3dTool(me) returns SplitCurve3d from ShapeUpgrade
112 is virtual protected;
113 ---Purpose: Returns the tool for splitting 3D curves.
114 ---Remark: here TopoDS_Edge can be used to transfer some specific information (tolerance, etc)
116 GetSplitCurve2dTool(me) returns SplitCurve2d from ShapeUpgrade
117 is virtual protected;
118 ---Purpose: Returns the tool for splitting pcurves.
120 SetEdgeDivideTool (me: mutable; edgeDivideTool: EdgeDivide from ShapeUpgrade);
121 ---Purpose: Sets tool for splitting edge
123 GetEdgeDivideTool (me) returns EdgeDivide from ShapeUpgrade
125 ---Purpose: returns tool for splitting edges
127 GetTransferParamTool(me:mutable) returns TransferParameters from ShapeAnalysis
129 ---Purpose: Returns the tool for Transfer of parameters.
131 SetEdgeMode(me : mutable;EdgeMode : Integer);
132 ---Purpose:Sets mode for splitting 3d curves from edges.
133 -- 0 - only curve 3d from free edges.
134 -- 1 - only curve 3d from shared edges.
137 SetFixSmallCurveTool(me : mutable; FixSmallCurvesTool : FixSmallCurves from ShapeUpgrade);
138 ---Purpose:Sets tool for fixing small curves with specified min tolerance;
140 GetFixSmallCurveTool(me) returns FixSmallCurves from ShapeUpgrade;
141 ---Purpose:Returns tool for fixing small curves
145 mySplitCurve3dTool: SplitCurve3d from ShapeUpgrade;
146 mySplitCurve2dTool: SplitCurve2d from ShapeUpgrade;
147 myEdgeDivide : EdgeDivide from ShapeUpgrade;
148 myTransferParamTool : TransferParameters from ShapeAnalysis;
149 myFace : Face from TopoDS is protected; -- supporting face
150 myWire : Wire from TopoDS is protected; -- wire being splitted
151 myStatus: Integer is protected;
152 myEdgeMode : Integer is protected;
153 myFixSmallCurveTool : FixSmallCurves from ShapeUpgrade;