b311480e |
1 | -- Created on: 1993-03-24 |
2 | -- Created by: JCV |
3 | -- Copyright (c) 1993-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 | -- |
973c2be1 |
8 | -- This library is free software; you can redistribute it and / or modify it |
9 | -- under the terms of the GNU Lesser General Public 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. |
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 | deferred class Geometry from Geom2d inherits TShared from MMgt |
18 | |
19 | --- Purpose : |
20 | -- The general abstract class Geometry in 2D space describes |
21 | -- the common behaviour of all the geometric entities. |
22 | -- |
23 | -- All the objects derived from this class can be move with a |
24 | -- geometric transformation. Only the transformations which |
25 | -- doesn't modify the nature of the geometry are available in |
26 | -- this package. |
27 | -- The method Transform which defines a general transformation |
28 | -- is deferred. The other specifics transformations used the |
29 | -- method Transform. |
30 | -- All the following transformations modify the object itself. |
31 | -- Warning |
32 | -- Only transformations which do not modify the nature |
33 | -- of the geometry can be applied to Geom2d objects: |
34 | -- this is the case with translations, rotations, |
35 | -- symmetries and scales; this is also the case with |
36 | -- gp_Trsf2d composite transformations which are |
37 | -- used to define the geometric transformations applied |
38 | -- using the Transform or Transformed functions. |
39 | -- Note: Geometry defines the "prototype" of the |
40 | -- abstract method Transform which is defined for each |
41 | -- concrete type of derived object. All other |
42 | -- transformations are implemented using the Transform method. |
43 | |
44 | uses Ax2d from gp, |
45 | Pnt2d from gp, |
46 | Trsf2d from gp, |
47 | Vec2d from gp |
48 | |
49 | raises ConstructionError from Standard |
50 | |
51 | is |
52 | |
53 | |
54 | |
55 | Mirror (me : mutable; P : Pnt2d) |
56 | --- Purpose : Performs the symmetrical transformation of a Geometry |
57 | -- with respect to the point P which is the center of the |
58 | -- symmetry and assigns the result to this geometric object. |
59 | is static; |
60 | |
61 | |
62 | Mirror (me : mutable; A : Ax2d) |
63 | --- Purpose : Performs the symmetrical transformation of a Geometry |
64 | -- with respect to an axis placement which is the axis of the symmetry. |
65 | is static; |
66 | |
67 | |
68 | |
69 | Rotate (me : mutable; P : Pnt2d; Ang : Real) |
70 | --- Purpose : Rotates a Geometry. P is the center of the rotation. |
71 | -- Ang is the angular value of the rotation in radians. |
72 | is static; |
73 | |
74 | |
75 | Scale (me : mutable; P : Pnt2d; S : Real) |
76 | --- Purpose : Scales a Geometry. S is the scaling value. |
77 | is static; |
78 | |
79 | |
80 | Translate (me : mutable; V : Vec2d) |
81 | --- Purpose : Translates a Geometry. V is the vector of the tanslation. |
82 | is static; |
83 | |
84 | Translate (me : mutable; P1, P2 : Pnt2d) |
85 | --- Purpose : Translates a Geometry from the point P1 to the point P2. |
86 | is static; |
87 | |
88 | Transform (me : mutable; T : Trsf2d) |
89 | --- Purpose : Transformation of a geometric object. This tansformation |
90 | -- can be a translation, a rotation, a symmetry, a scaling |
91 | -- or a complex transformation obtained by combination of |
92 | -- the previous elementaries transformations. |
93 | -- (see class Transformation of the package Geom2d). |
94 | is deferred; |
95 | |
96 | |
97 | |
98 | |
99 | --- Purpose : The following transformations have the same properties |
100 | -- as the previous ones but they don't modified the object |
101 | -- itself. A copy of the object is returned. |
102 | |
103 | |
104 | |
105 | Mirrored (me; P : Pnt2d) returns mutable like me |
106 | is static; |
107 | |
108 | Mirrored (me; A : Ax2d) returns mutable like me |
109 | is static; |
110 | |
111 | Rotated (me; P : Pnt2d; Ang : Real) returns mutable like me |
112 | is static; |
113 | |
114 | Scaled (me; P : Pnt2d; S : Real) returns mutable like me |
115 | is static; |
116 | |
117 | Transformed (me; T : Trsf2d) returns mutable like me |
118 | is static; |
119 | |
120 | Translated (me; V : Vec2d) returns mutable like me |
121 | is static; |
122 | |
123 | Translated (me; P1, P2 : Pnt2d) returns mutable like me |
124 | is static; |
125 | |
126 | Copy (me) returns mutable like me is deferred; |
127 | |
128 | |
129 | end; |