1 // Created on: 1993-03-09
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Geom_Geometry_HeaderFile
18 #define _Geom_Geometry_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Transient.hxx>
24 #include <Standard_Real.hxx>
25 class Standard_ConstructionError;
34 DEFINE_STANDARD_HANDLE(Geom_Geometry, Standard_Transient)
36 //! The abstract class Geometry for 3D space is the root
37 //! class of all geometric objects from the Geom
38 //! package. It describes the common behavior of these objects when:
39 //! - applying geometric transformations to objects, and
40 //! - constructing objects by geometric transformation (including copying).
42 //! Only transformations which do not modify the nature
43 //! of the geometry can be applied to Geom objects: this
44 //! is the case with translations, rotations, symmetries
45 //! and scales; this is also the case with gp_Trsf
46 //! composite transformations which are used to define
47 //! the geometric transformations applied using the
48 //! Transform or Transformed functions.
49 //! Note: Geometry defines the "prototype" of the
50 //! abstract method Transform which is defined for each
51 //! concrete type of derived object. All other
52 //! transformations are implemented using the Transform method.
53 class Geom_Geometry : public Standard_Transient
60 //! Performs the symmetrical transformation of a Geometry
61 //! with respect to the point P which is the center of the
63 Standard_EXPORT void Mirror (const gp_Pnt& P);
66 //! Performs the symmetrical transformation of a Geometry
67 //! with respect to an axis placement which is the axis of the
69 Standard_EXPORT void Mirror (const gp_Ax1& A1);
72 //! Performs the symmetrical transformation of a Geometry
73 //! with respect to a plane. The axis placement A2 locates
74 //! the plane of the symmetry : (Location, XDirection, YDirection).
75 Standard_EXPORT void Mirror (const gp_Ax2& A2);
78 //! Rotates a Geometry. A1 is the axis of the rotation.
79 //! Ang is the angular value of the rotation in radians.
80 Standard_EXPORT void Rotate (const gp_Ax1& A1, const Standard_Real Ang);
83 //! Scales a Geometry. S is the scaling value.
84 Standard_EXPORT void Scale (const gp_Pnt& P, const Standard_Real S);
87 //! Translates a Geometry. V is the vector of the translation.
88 Standard_EXPORT void Translate (const gp_Vec& V);
91 //! Translates a Geometry from the point P1 to the point P2.
92 Standard_EXPORT void Translate (const gp_Pnt& P1, const gp_Pnt& P2);
95 //! Transformation of a geometric object. This tansformation
96 //! can be a translation, a rotation, a symmetry, a scaling
97 //! or a complex transformation obtained by combination of
98 //! the previous elementaries transformations.
99 //! (see class Transformation of the package Geom).
100 Standard_EXPORT virtual void Transform (const gp_Trsf& T) = 0;
102 Standard_NODISCARD Standard_EXPORT Handle(Geom_Geometry) Mirrored (const gp_Pnt& P) const;
104 Standard_NODISCARD Standard_EXPORT Handle(Geom_Geometry) Mirrored (const gp_Ax1& A1) const;
106 Standard_NODISCARD Standard_EXPORT Handle(Geom_Geometry) Mirrored (const gp_Ax2& A2) const;
108 Standard_NODISCARD Standard_EXPORT Handle(Geom_Geometry) Rotated (const gp_Ax1& A1, const Standard_Real Ang) const;
110 Standard_NODISCARD Standard_EXPORT Handle(Geom_Geometry) Scaled (const gp_Pnt& P, const Standard_Real S) const;
112 Standard_NODISCARD Standard_EXPORT Handle(Geom_Geometry) Transformed (const gp_Trsf& T) const;
114 Standard_NODISCARD Standard_EXPORT Handle(Geom_Geometry) Translated (const gp_Vec& V) const;
116 Standard_NODISCARD Standard_EXPORT Handle(Geom_Geometry) Translated (const gp_Pnt& P1, const gp_Pnt& P2) const;
118 //! Creates a new object which is a copy of this geometric object.
119 Standard_EXPORT virtual Handle(Geom_Geometry) Copy() const = 0;
121 //! Dumps the content of me into the stream
122 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
127 DEFINE_STANDARD_RTTIEXT(Geom_Geometry,Standard_Transient)
147 #endif // _Geom_Geometry_HeaderFile