CFx SDK Documentation  2023 SP0
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__
tol
Definition: DimVarDefs.h:2287
unsigned int OdUInt32
Surface * copy(Body &to) const
Type type() const
OdUInt32 m_approximation2
Definition: FMMdlSurface.h:152
double tanAngle() const
void normal(const FacetModeler::Vertex &atV, const Face &atF, OdGeVector3d &normal) const
int compare(const Surface *pOther, double e) const
double topRadius() const
double radius() const
OdUInt32 approximation() const
OdUInt32 m_approximation
Definition: FMMdlSurface.h:151
Cone(const OdGeLine3d &axis, const OdGeVector3d &startDir, double radius1, double radius2, OdUInt32 approx)
void transform(const OdGeMatrix3d &x)
Surface * copy(Body &to) const
int compare(const Surface *pOther, double eps) const
Cylinder(const OdGeLine3d &lAxis, const OdGeVector3d &vStartDirection, double dRadius, OdUInt32 iAppriximation)
double radius() const
void normal(const FacetModeler::Vertex &atV, const Face &atF, OdGeVector3d &normal) const
void transform(const OdGeMatrix3d &x)
OdUInt32 approximation() const
Revolution(const OdGeLine3d &axis, const OdGeVector3d &startDir)
const OdGeLine3d & axis() const
int compare(const Surface *pOther, double eps) const
const OdGeVector3d & startDir() const
void transform(const OdGeMatrix3d &x)
const OdGePoint3d & center() const
int compare(const Surface *pOther, double eps) const
OdGePoint3d m_center
Definition: FMMdlSurface.h:110
void transform(const OdGeMatrix3d &x)
Sphere(const OdGePoint3d &center, double radius, OdUInt32 approximation)
Surface * copy(Body &to) const
double radius() const
void normal(const FacetModeler::Vertex &atV, const Face &atF, OdGeVector3d &normal) const
OdUInt32 approximation() const
virtual Surface * clone(Body &to) const
Surface * next() const
virtual Surface * copy(Body &to) const
int surface_compare(const Surface *pOther, double eps) const
bool isEqivalent(const Surface *pTo, const OdGeTol &tol) const
virtual int compare(const Surface *pOther, double eps) const
virtual Type type() const
virtual bool _isEqivalent(const Surface &to, const OdGeTol &tol) const
virtual void normal(const FacetModeler::Vertex &atV, const Face &atF, OdGeVector3d &normal) const
virtual void transform(const OdGeMatrix3d &x)
void transform(const OdGeMatrix3d &x)
double minorRadius() const
int compare(const Surface *pOther, double e) const
OdUInt32 minorApproximation() const
Torus(const OdGeLine3d &axis, const OdGeVector3d &startDir, double majorRadius, double minorRadius, OdUInt32 majorApprox, OdUInt32 minorApprox)
double majorRadius() const
void normal(const FacetModeler::Vertex &atV, const Face &atF, OdGeVector3d &normal) const
OdUInt32 majorApproximation() const
Surface * copy(Body &to) const
Type type() const
Definition: GeTol.h:49
GLfloat x
Definition: gles2_ext.h:314
@ kCylinder
Definition: AveDefs.h:120
@ kSphere
Definition: AveDefs.h:121