b311480e |
1 | -- Created on: 1995-04-19 |
2 | -- Created by: Yves FRICAUD |
3 | -- Copyright (c) 1995-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class OffsetWire from BRepFill |
18 | |
19 | ---Purpose: Constructs a Offset Wire to a spine (wire or face) |
20 | -- on the left of spine. |
ff8178ef |
21 | -- The Wire or the Face must be planar. |
7fd59977 |
22 | uses |
23 | |
24 | Face from TopoDS, |
25 | Shape from TopoDS, |
26 | JoinType from GeomAbs, |
27 | ListOfShape from TopTools, |
c19dd45e |
28 | SequenceOfShape from TopTools, |
29 | SequenceOfPnt from TColgp, |
7fd59977 |
30 | DataMapOfShapeShape from TopTools, |
86b3805f |
31 | IndexedDataMapOfOrientedShapeListOfShape from BRepFill, |
c19dd45e |
32 | DataMapOfOrientedShapeListOfShape from BRepFill, |
7fd59977 |
33 | BisectingLocus from BRepMAT2d, |
c19dd45e |
34 | LinkTopoBilo from BRepMAT2d, |
35 | Bisec from Bisector, |
36 | TrimEdgeTool from BRepFill |
7fd59977 |
37 | |
38 | raises |
39 | ConstructionError from Standard, |
40 | NoSuchObject from Standard |
41 | |
42 | is |
43 | |
44 | Create returns OffsetWire from BRepFill; |
45 | |
46 | Create ( Spine : Face from TopoDS; |
6a442250 |
47 | Join : JoinType from GeomAbs = GeomAbs_Arc; |
48 | IsOpenResult : Boolean from Standard = Standard_False) |
7fd59977 |
49 | returns OffsetWire from BRepFill; |
50 | |
51 | Init ( me : in out; |
52 | Spine : Face from TopoDS; |
6a442250 |
53 | Join : JoinType from GeomAbs = GeomAbs_Arc; |
54 | IsOpenResult : Boolean from Standard = Standard_False) |
7fd59977 |
55 | ---Purpose: Initialize the evaluation of Offseting. |
56 | raises |
57 | ConstructionError from Standard |
58 | is static; |
59 | |
60 | Perform (me : in out; |
61 | Offset : Real from Standard; |
62 | Alt : Real from Standard = 0.0) |
63 | ---Purpose: Performs an OffsetWire at an altitude <Alt> from |
64 | -- the face ( According to the orientation of the |
65 | -- face) |
66 | raises |
67 | ConstructionError from Standard |
68 | is static; |
69 | |
70 | PerformWithBiLo (me : in out; |
71 | WSP : Face from TopoDS; |
72 | Offset : Real from Standard; |
73 | Locus : BisectingLocus from BRepMAT2d; |
74 | Link : in out LinkTopoBilo from BRepMAT2d; |
75 | Join : JoinType from GeomAbs = GeomAbs_Arc; |
76 | Alt : Real from Standard = 0.0) |
77 | ---Purpose: Performs an OffsetWire |
78 | raises |
79 | ConstructionError from Standard |
80 | is static; |
81 | |
82 | IsDone ( me) |
83 | returns Boolean from Standard |
84 | is static; |
85 | |
86 | Spine(me) |
87 | returns Face from TopoDS |
88 | ---C++: return const & |
89 | is static; |
90 | |
91 | |
92 | Shape(me) returns Shape from TopoDS |
93 | ---Purpose: returns the generated shape. |
94 | ---C++ : return const & |
95 | is static; |
96 | |
97 | GeneratedShapes (me : in out ; SpineShape : Shape from TopoDS) |
98 | ---Purpose: Returns the shapes created from a subshape |
99 | -- <SpineShape> of the spine. |
100 | -- Returns the last computed Offset. |
101 | -- |
102 | ---C++ : return const & |
103 | returns ListOfShape from TopTools |
104 | is static; |
105 | |
106 | JoinType (me) returns JoinType from GeomAbs |
107 | is static; |
108 | |
109 | Generated (me : in out ) |
110 | ---C++: return & |
86b3805f |
111 | returns IndexedDataMapOfOrientedShapeListOfShape from BRepFill |
7fd59977 |
112 | is static private; |
113 | |
114 | PrepareSpine (me : in out) |
115 | ---Purpose: Prepare the spine as follow |
116 | -- - Cut the spine-Edges at the extrema of curvature and |
117 | -- at the inflexion points. |
118 | is static private; |
119 | |
120 | Add(me : in out; Other : OffsetWire from BRepFill) |
121 | ---Purpose: Add the OffsetWire <Other> to <me> and update <myMap> |
122 | is static private; |
123 | |
c19dd45e |
124 | UpdateDetromp (me; Detromp : in out DataMapOfOrientedShapeListOfShape from BRepFill; |
125 | Shape1, Shape2 : Shape from TopoDS; |
126 | Vertices : SequenceOfShape from TopTools; |
127 | Params : SequenceOfPnt from TColgp; |
128 | Bisec : Bisec from Bisector; |
129 | SOnE : Boolean from Standard; |
130 | EOnE : Boolean from Standard; |
131 | Trim : TrimEdgeTool from BRepFill) |
132 | is static private; |
133 | |
7fd59977 |
134 | MakeWires (me : in out) |
135 | ---Purpose: Constructs the wires with the trimmed offset edges. |
136 | is static private; |
137 | |
138 | FixHoles (me : in out) |
139 | ---Purpose: Fix holes between open wires where it is possible |
140 | is static private; |
141 | |
142 | fields |
143 | |
144 | mySpine : Face from TopoDS; |
145 | myWorkSpine : Face from TopoDS; |
146 | myOffset : Real from Standard; -- >0 ; |
6a442250 |
147 | myIsOpenResult : Boolean from Standard; |
7fd59977 |
148 | myShape : Shape from TopoDS; |
149 | myIsDone : Boolean from Standard; |
150 | myJoinType : JoinType from GeomAbs; |
86b3805f |
151 | myMap : IndexedDataMapOfOrientedShapeListOfShape from BRepFill; |
7fd59977 |
152 | myBilo : BisectingLocus from BRepMAT2d; |
153 | myLink : LinkTopoBilo from BRepMAT2d; |
154 | myMapSpine : DataMapOfShapeShape from TopTools; |
155 | myCallGen : Boolean from Standard; |
156 | |
157 | end OffsetWire; |