|
||||
File indexing completed on 2025-01-18 10:03:33
0001 // Created on: 1993-03-24 0002 // Created by: JCV 0003 // Copyright (c) 1993-1999 Matra Datavision 0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS 0005 // 0006 // This file is part of Open CASCADE Technology software library. 0007 // 0008 // This library is free software; you can redistribute it and/or modify it under 0009 // the terms of the GNU Lesser General Public License version 2.1 as published 0010 // by the Free Software Foundation, with special exception defined in the file 0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 0012 // distribution for complete text of the license and disclaimer of any warranty. 0013 // 0014 // Alternatively, this file may be used under the terms of Open CASCADE 0015 // commercial license or contractual agreement. 0016 0017 #ifndef _Geom2d_Geometry_HeaderFile 0018 #define _Geom2d_Geometry_HeaderFile 0019 0020 #include <Standard.hxx> 0021 #include <Standard_Type.hxx> 0022 0023 #include <Standard_Transient.hxx> 0024 #include <Standard_Real.hxx> 0025 class gp_Pnt2d; 0026 class gp_Ax2d; 0027 class gp_Vec2d; 0028 class gp_Trsf2d; 0029 0030 0031 class Geom2d_Geometry; 0032 DEFINE_STANDARD_HANDLE(Geom2d_Geometry, Standard_Transient) 0033 0034 0035 //! The general abstract class Geometry in 2D space describes 0036 //! the common behaviour of all the geometric entities. 0037 //! 0038 //! All the objects derived from this class can be move with a 0039 //! geometric transformation. Only the transformations which 0040 //! doesn't modify the nature of the geometry are available in 0041 //! this package. 0042 //! The method Transform which defines a general transformation 0043 //! is deferred. The other specifics transformations used the 0044 //! method Transform. 0045 //! All the following transformations modify the object itself. 0046 //! Warning 0047 //! Only transformations which do not modify the nature 0048 //! of the geometry can be applied to Geom2d objects: 0049 //! this is the case with translations, rotations, 0050 //! symmetries and scales; this is also the case with 0051 //! gp_Trsf2d composite transformations which are 0052 //! used to define the geometric transformations applied 0053 //! using the Transform or Transformed functions. 0054 //! Note: Geometry defines the "prototype" of the 0055 //! abstract method Transform which is defined for each 0056 //! concrete type of derived object. All other 0057 //! transformations are implemented using the Transform method. 0058 class Geom2d_Geometry : public Standard_Transient 0059 { 0060 0061 public: 0062 0063 0064 //! Performs the symmetrical transformation of a Geometry 0065 //! with respect to the point P which is the center of the 0066 //! symmetry and assigns the result to this geometric object. 0067 Standard_EXPORT void Mirror (const gp_Pnt2d& P); 0068 0069 //! Performs the symmetrical transformation of a Geometry 0070 //! with respect to an axis placement which is the axis of the symmetry. 0071 Standard_EXPORT void Mirror (const gp_Ax2d& A); 0072 0073 //! Rotates a Geometry. P is the center of the rotation. 0074 //! Ang is the angular value of the rotation in radians. 0075 Standard_EXPORT void Rotate (const gp_Pnt2d& P, const Standard_Real Ang); 0076 0077 //! Scales a Geometry. S is the scaling value. 0078 Standard_EXPORT void Scale (const gp_Pnt2d& P, const Standard_Real S); 0079 0080 //! Translates a Geometry. V is the vector of the translation. 0081 Standard_EXPORT void Translate (const gp_Vec2d& V); 0082 0083 //! Translates a Geometry from the point P1 to the point P2. 0084 Standard_EXPORT void Translate (const gp_Pnt2d& P1, const gp_Pnt2d& P2); 0085 0086 //! Transformation of a geometric object. This tansformation 0087 //! can be a translation, a rotation, a symmetry, a scaling 0088 //! or a complex transformation obtained by combination of 0089 //! the previous elementaries transformations. 0090 //! (see class Transformation of the package Geom2d). 0091 //! The following transformations have the same properties 0092 //! as the previous ones but they don't modified the object 0093 //! itself. A copy of the object is returned. 0094 Standard_EXPORT virtual void Transform (const gp_Trsf2d& T) = 0; 0095 0096 Standard_NODISCARD Standard_EXPORT Handle(Geom2d_Geometry) Mirrored (const gp_Pnt2d& P) const; 0097 0098 Standard_NODISCARD Standard_EXPORT Handle(Geom2d_Geometry) Mirrored (const gp_Ax2d& A) const; 0099 0100 Standard_NODISCARD Standard_EXPORT Handle(Geom2d_Geometry) Rotated (const gp_Pnt2d& P, const Standard_Real Ang) const; 0101 0102 Standard_NODISCARD Standard_EXPORT Handle(Geom2d_Geometry) Scaled (const gp_Pnt2d& P, const Standard_Real S) const; 0103 0104 Standard_NODISCARD Standard_EXPORT Handle(Geom2d_Geometry) Transformed (const gp_Trsf2d& T) const; 0105 0106 Standard_NODISCARD Standard_EXPORT Handle(Geom2d_Geometry) Translated (const gp_Vec2d& V) const; 0107 0108 Standard_NODISCARD Standard_EXPORT Handle(Geom2d_Geometry) Translated (const gp_Pnt2d& P1, const gp_Pnt2d& P2) const; 0109 0110 Standard_EXPORT virtual Handle(Geom2d_Geometry) Copy() const = 0; 0111 0112 //! Dumps the content of me into the stream 0113 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const; 0114 0115 0116 0117 0118 DEFINE_STANDARD_RTTIEXT(Geom2d_Geometry,Standard_Transient) 0119 0120 protected: 0121 0122 0123 0124 0125 private: 0126 0127 0128 0129 0130 }; 0131 0132 0133 0134 0135 0136 0137 0138 #endif // _Geom2d_Geometry_HeaderFile
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |