CFx SDK Documentation  2020SP3
FMMdlSurface.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2015, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2015 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 #ifndef __FMMDL_SURFACE_H__
25 #define __FMMDL_SURFACE_H__
26 
27 #include "Modeler/FMMdlEntity.h"
28 #include "Ge/GeLine3d.h"
29 
33 namespace FacetModeler
34 {
35 
39  class FMGEOMETRY_API Surface : public Entity
40  {
41  public:
46 
47  enum Type {
48  kUndefined = 0,
49  kCylinder = 1,
50  kCone = 2,
51  kSphere = 3,
52  kTorus = 4
53  };
54 
55  virtual Type type() const;
56  virtual void normal( const FacetModeler::Vertex& atV, const Face& atF, OdGeVector3d& normal ) const;
57  virtual void transform( const OdGeMatrix3d& x );
58  virtual int compare( const Surface* pOther, double eps ) const;
59  virtual Surface* copy( Body& to ) const;
60  bool isEqivalent( const Surface* pTo, const OdGeTol& tol ) const;
61 
65  Surface* next() const;
66 
68  protected:
69  int surface_compare( const Surface* pOther, double eps ) const;
70  virtual Surface* clone( Body& to ) const;
71  virtual bool _isEqivalent( const Surface& to, const OdGeTol& tol ) const;
72  private:
73  Surface(const Surface&);
74  Surface& operator=(const Surface&);
75 
76  public:
78 
79  friend class Body;
80  friend class BodyImpl;
81  };
82 
83  class FMGEOMETRY_API Revolution : public Surface {
84  public:
85  Revolution( const OdGeLine3d& axis, const OdGeVector3d& startDir );
86 
87  void transform( const OdGeMatrix3d& x );
88  const OdGeLine3d& axis() const;
89  const OdGeVector3d& startDir() const;
90  int compare( const Surface* pOther, double eps ) const;
91  protected:
94  };
95 
96  class FMGEOMETRY_API Sphere : public Revolution {
97  public:
98  //mku 02/7/17 In fact there is no a default constructor //Sphere();
99  Sphere( const OdGePoint3d& center, double radius, OdUInt32 approximation );
100 
101  Type type() const;
102  const OdGePoint3d& center() const;
103  double radius() const;
105  void normal( const FacetModeler::Vertex& atV, const Face& atF, OdGeVector3d& normal ) const;
106  void transform( const OdGeMatrix3d& x );
107  int compare( const Surface* pOther, double eps ) const;
108  Surface* copy( Body& to ) const;
109  protected:
111  double m_radius;
114  };
115 
116  class FMGEOMETRY_API Cylinder : public Revolution {
117  public:
118  Cylinder( const OdGeLine3d& lAxis, const OdGeVector3d& vStartDirection,
119  double dRadius, OdUInt32 iAppriximation );
120 
121  Type type() const;
122  double radius() const;
124  void normal( const FacetModeler::Vertex& atV, const Face& atF, OdGeVector3d& normal ) const;
125  void transform( const OdGeMatrix3d& x );
126  int compare( const Surface* pOther, double eps ) const;
127  Surface* copy( Body& to ) const;
128  protected:
129  double m_radius;
132  };
133 
134  class FMGEOMETRY_API Cone : public Revolution {
135  public:
136  Cone( const OdGeLine3d& axis, const OdGeVector3d& startDir,
137  double radius1, double radius2, OdUInt32 approx );
138 
139  Type type() const;
140  double radius() const;
141  double topRadius() const;
142  double tanAngle() const;
144  void normal( const FacetModeler::Vertex& atV, const Face& atF, OdGeVector3d& normal ) const;
145  void transform( const OdGeMatrix3d& x );
146  int compare( const Surface* pOther, double e ) const;
147  Surface* copy( Body& to ) const;
148  protected:
149  double m_radius;
150  double m_tanAngle;
153  };
154 
155  class FMGEOMETRY_API Torus : public Revolution {
156  public:
157  Torus( const OdGeLine3d& axis, const OdGeVector3d& startDir,
158  double majorRadius, double minorRadius,
159  OdUInt32 majorApprox, OdUInt32 minorApprox );
160 
161  Type type() const;
162  double majorRadius() const;
163  double minorRadius() const;
166  void normal( const FacetModeler::Vertex& atV, const Face& atF, OdGeVector3d& normal ) const;
167  void transform( const OdGeMatrix3d& x );
168  int compare( const Surface* pOther, double e ) const;
169  Surface* copy( Body& to ) const;
170  protected:
175  };
176 
177 }
178 
179 #endif //__FMMDL_SURFACE_H__
OdGeLine3d
Definition: GeLine3d.h:43
FacetModeler::Torus::compare
int compare(const Surface *pOther, double e) const
OdGeVector3d
Definition: GeVector3d.h:54
FacetModeler::Cylinder::m_approximation
OdUInt32 m_approximation
Definition: FMMdlSurface.h:130
FacetModeler::Cylinder::Cylinder
Cylinder(const OdGeLine3d &lAxis, const OdGeVector3d &vStartDirection, double dRadius, OdUInt32 iAppriximation)
FacetModeler::Cylinder::m_radius
double m_radius
Definition: FMMdlSurface.h:129
FacetModeler::Surface::Surface
Surface()
FacetModeler::Sphere::approximation
OdUInt32 approximation() const
FacetModeler::Cone::transform
void transform(const OdGeMatrix3d &x)
FacetModeler::Sphere::m_approximation2
OdUInt32 m_approximation2
Definition: FMMdlSurface.h:113
FacetModeler::Revolution::startDir
const OdGeVector3d & startDir() const
tol
tol
Definition: DimVarDefs.h:2287
FacetModeler
Definition: FMContour2D.h:35
FacetModeler::Surface::next
Surface * next() const
FacetModeler::Cone::m_tanAngle
double m_tanAngle
Definition: FMMdlSurface.h:150
FacetModeler::Cylinder::normal
void normal(const FacetModeler::Vertex &atV, const Face &atF, OdGeVector3d &normal) const
FacetModeler::Torus::copy
Surface * copy(Body &to) const
FacetModeler::Sphere::normal
void normal(const FacetModeler::Vertex &atV, const Face &atF, OdGeVector3d &normal) const
FacetModeler::Cylinder::compare
int compare(const Surface *pOther, double eps) const
FacetModeler::Revolution::m_startDir
OdGeVector3d m_startDir
Definition: FMMdlSurface.h:93
FacetModeler::Surface::isEqivalent
bool isEqivalent(const Surface *pTo, const OdGeTol &tol) const
FacetModeler::Cone::m_approximation
OdUInt32 m_approximation
Definition: FMMdlSurface.h:151
GeLine3d.h
FacetModeler::Cylinder::approximation
OdUInt32 approximation() const
FacetModeler::Sphere::type
Type type() const
FacetModeler::Torus::m_majorApprox
OdUInt32 m_majorApprox
Definition: FMMdlSurface.h:173
FacetModeler::Torus::majorApproximation
OdUInt32 majorApproximation() const
x
GLfloat x
Definition: gles2_ext.h:314
FacetModeler::Torus::m_minorRadius
double m_minorRadius
Definition: FMMdlSurface.h:172
FacetModeler::Cone::copy
Surface * copy(Body &to) const
FacetModeler::Revolution::axis
const OdGeLine3d & axis() const
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdGeMatrix3d
Definition: GeMatrix3d.h:73
FacetModeler::Cylinder::type
Type type() const
FacetModeler::Cone::tanAngle
double tanAngle() const
FacetModeler::Torus::minorApproximation
OdUInt32 minorApproximation() const
FacetModeler::Cone::m_radius
double m_radius
Definition: FMMdlSurface.h:149
FacetModeler::Revolution::Revolution
Revolution(const OdGeLine3d &axis, const OdGeVector3d &startDir)
FacetModeler::Surface
Definition: FMMdlSurface.h:40
FacetModeler::Body
Definition: FMMdlBody.h:47
FacetModeler::Cone
Definition: FMMdlSurface.h:134
OdGePoint3d
Definition: GePoint3d.h:55
OdAve::kCylinder
@ kCylinder
Definition: AveDefs.h:120
FacetModeler::Torus::majorRadius
double majorRadius() const
FacetModeler::Sphere::Sphere
Sphere(const OdGePoint3d &center, double radius, OdUInt32 approximation)
FacetModeler::Cone::approximation
OdUInt32 approximation() const
FacetModeler::Revolution
Definition: FMMdlSurface.h:83
FacetModeler::Sphere::transform
void transform(const OdGeMatrix3d &x)
FacetModeler::Torus::type
Type type() const
FacetModeler::Cone::normal
void normal(const FacetModeler::Vertex &atV, const Face &atF, OdGeVector3d &normal) const
FacetModeler::Surface::copy
virtual Surface * copy(Body &to) const
OdAve::kSphere
@ kSphere
Definition: AveDefs.h:121
FacetModeler::Surface::normal
virtual void normal(const FacetModeler::Vertex &atV, const Face &atF, OdGeVector3d &normal) const
FMMdlEntity.h
FacetModeler::Surface::transform
virtual void transform(const OdGeMatrix3d &x)
FacetModeler::Sphere
Definition: FMMdlSurface.h:96
FacetModeler::Surface::surface_compare
int surface_compare(const Surface *pOther, double eps) const
FacetModeler::Torus::Torus
Torus(const OdGeLine3d &axis, const OdGeVector3d &startDir, double majorRadius, double minorRadius, OdUInt32 majorApprox, OdUInt32 minorApprox)
FacetModeler::Cylinder::radius
double radius() const
FacetModeler::Torus::normal
void normal(const FacetModeler::Vertex &atV, const Face &atF, OdGeVector3d &normal) const
FacetModeler::Torus::m_majorRadius
double m_majorRadius
Definition: FMMdlSurface.h:171
FacetModeler::Surface::~Surface
~Surface()
FacetModeler::Surface::Type
Type
Definition: FMMdlSurface.h:47
FacetModeler::Cone::m_approximation2
OdUInt32 m_approximation2
Definition: FMMdlSurface.h:152
FacetModeler::Revolution::compare
int compare(const Surface *pOther, double eps) const
FacetModeler::Cone::topRadius
double topRadius() const
FacetModeler::Sphere::m_center
OdGePoint3d m_center
Definition: FMMdlSurface.h:110
FacetModeler::Surface::_isEqivalent
virtual bool _isEqivalent(const Surface &to, const OdGeTol &tol) const
FacetModeler::Sphere::copy
Surface * copy(Body &to) const
FacetModeler::Cone::radius
double radius() const
FacetModeler::Surface::m_pNext
Surface * m_pNext
Definition: FMMdlSurface.h:77
FacetModeler::Surface::clone
virtual Surface * clone(Body &to) const
FacetModeler::Cylinder::m_approximation2
OdUInt32 m_approximation2
Definition: FMMdlSurface.h:131
FacetModeler::Face
Definition: FMMdlFace.h:47
FacetModeler::Vertex
Definition: FMMdlVertex.h:42
FacetModeler::Revolution::transform
void transform(const OdGeMatrix3d &x)
FacetModeler::Sphere::radius
double radius() const
FacetModeler::Cylinder
Definition: FMMdlSurface.h:116
FacetModeler::Revolution::m_axis
OdGeLine3d m_axis
Definition: FMMdlSurface.h:92
FacetModeler::Sphere::m_radius
double m_radius
Definition: FMMdlSurface.h:111
FacetModeler::Sphere::m_approximation1
OdUInt32 m_approximation1
Definition: FMMdlSurface.h:112
FacetModeler::Sphere::center
const OdGePoint3d & center() const
FacetModeler::Torus::transform
void transform(const OdGeMatrix3d &x)
FacetModeler::Sphere::compare
int compare(const Surface *pOther, double eps) const
FacetModeler::Cone::compare
int compare(const Surface *pOther, double e) const
FacetModeler::Cylinder::copy
Surface * copy(Body &to) const
OdGeTol
Definition: GeTol.h:49
FacetModeler::Cylinder::transform
void transform(const OdGeMatrix3d &x)
FacetModeler::Torus
Definition: FMMdlSurface.h:155
FacetModeler::Surface::compare
virtual int compare(const Surface *pOther, double eps) const
FacetModeler::Surface::type
virtual Type type() const
FacetModeler::Cone::Cone
Cone(const OdGeLine3d &axis, const OdGeVector3d &startDir, double radius1, double radius2, OdUInt32 approx)
FacetModeler::Entity
Definition: FMMdlEntity.h:41
FacetModeler::Cone::type
Type type() const
FacetModeler::Torus::minorRadius
double minorRadius() const
FacetModeler::Torus::m_minorApprox
OdUInt32 m_minorApprox
Definition: FMMdlSurface.h:174