b311480e |
1 | -- Created on: 1994-12-09 |
2 | -- Created by: Jacques GOUSSARD |
3 | -- Copyright (c) 1994-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
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. |
10 | -- |
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. |
13 | -- |
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. |
20 | |
7fd59977 |
21 | |
22 | |
23 | class Transform from BRepBuilderAPI inherits ModifyShape from BRepBuilderAPI |
24 | |
25 | ---Purpose: Geometric transformation on a shape. |
26 | -- The transformation to be applied is defined as a |
27 | -- gp_Trsf transformation, i.e. a transformation which does |
28 | -- not modify the underlying geometry of shapes. |
29 | -- The transformation is applied to: |
30 | -- - all curves which support edges of a shape, and |
31 | -- - all surfaces which support its faces. |
32 | -- A Transform object provides a framework for: |
33 | -- - defining the geometric transformation to be applied, |
34 | -- - implementing the transformation algorithm, and |
35 | -- - consulting the results. |
36 | |
37 | uses |
38 | Trsf from gp, |
39 | Location from TopLoc, |
40 | Shape from TopoDS, |
41 | Face from TopoDS, |
42 | ShapeModification from BRepBuilderAPI, |
43 | ListOfShape from TopTools |
44 | |
45 | raises |
46 | NoSuchObject from Standard |
47 | is |
48 | |
49 | Create(T: Trsf from gp) |
50 | |
51 | returns Transform from BRepBuilderAPI; |
52 | ---Purpose: Constructs a framework for applying the geometric |
53 | -- transformation T to a shape. Use the function Perform |
54 | -- to define the shape to transform. |
55 | |
56 | |
57 | Create(S: Shape from TopoDS; T: Trsf from gp; |
58 | Copy: Boolean from Standard = Standard_False) |
59 | |
60 | returns Transform from BRepBuilderAPI; |
61 | ---Purpose: Creates a transformation from the gp_Trsf <T>, and |
62 | -- applies it to the shape <S>. If the transformation |
63 | -- is direct and isometric (determinant = 1) and |
64 | -- <Copy> = Standard_False, the resulting shape is |
65 | -- <S> on which a new location has been set. |
66 | -- Otherwise, the transformation is applied on a |
67 | -- duplication of <S>. |
68 | |
69 | |
70 | Perform(me: in out; S : Shape from TopoDS; |
71 | Copy: Boolean from Standard = Standard_False) |
72 | |
73 | ---Purpose: pplies the geometric transformation defined at the |
74 | -- time of construction of this framework to the shape S. |
75 | -- - If the transformation T is direct and isometric, in |
76 | -- other words, if the determinant of the vectorial part |
77 | -- of T is equal to 1., and if Copy equals false (the |
78 | -- default value), the resulting shape is the same as |
79 | -- the original but with a new location assigned to it. |
80 | -- - In all other cases, the transformation is applied to a duplicate of S. |
81 | -- Use the function Shape to access the result. |
82 | -- Note: this framework can be reused to apply the same |
83 | -- geometric transformation to other shapes. You only |
84 | -- need to specify them by calling the function Perform again. |
85 | |
86 | is static; |
87 | |
88 | ModifiedShape(me; S: Shape from TopoDS) |
89 | returns Shape from TopoDS |
90 | ---Purpose: Returns the modified shape corresponding to <S>. |
91 | ---C++: return const& |
92 | raises NoSuchObject from Standard |
93 | -- if S is not the initial shape or a sub-shape |
94 | -- of the initial shape. |
95 | is redefined virtual; |
96 | |
97 | Modified (me: in out; S : Shape from TopoDS) |
98 | ---Purpose: Returns the list of shapes modified from the shape |
99 | -- <S>. |
100 | ---C++: return const & |
101 | ---Level: Public |
102 | returns ListOfShape from TopTools |
103 | is redefined virtual; |
104 | |
105 | |
106 | fields |
107 | |
108 | myTrsf : Trsf from gp; |
109 | myLocation : Location from TopLoc; |
110 | myUseModif : Boolean from Standard; |
111 | |
112 | end Transform; |