CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
FMMdlSurface.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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 Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 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
30namespace FacetModeler
31{
32
37 {
38 public:
43
50 virtual Surface* copy(Body& to) const;
51
55 enum Type {
57 kUndefined = 0,
58
60 kCylinder = 1,
61
63 kCone = 2,
64
66 kSphere = 3,
67
69 kTorus = 4,
70
72 kShaded = 5
73 };
74
80 virtual Type type() const;
81
92 virtual OdGeVector3d normal(const Vertex& atV, const Face& atF) const;
93
102 virtual void transform(const OdGeMatrix3d& x);
103
117 virtual int compare(const Surface* pOther, double eps) const;
118
124 Surface* next() const;
125
131 void setNext(Surface* s);
132
137
138 protected:
139
150 int surface_compare(const Surface* pOther, double eps) const;
151
161 virtual Surface* clone(Body& to) const;
162
163 private:
164
168 Surface(const Surface&);
169
177 Surface& operator=(const Surface& other);
178
179 Surface* m_pNext; // Next Surface pointer.
180
181 //DOM-IGNORE-BEGIN
182 friend class Body;
183 friend class BodyImpl;
184 friend class BodyCustom;
185 //DOM-IGNORE-END
186 };
187
193 public:
199 ShadedSurface(double creaseAngle = 0);
200
206 virtual Type type() const;
207
214 virtual Surface* copy(Body& to) const;
215
222 void findSharpEdges(const Body& body, double angleTol);
223
229 bool belongsToSharpEdge(const Vertex* vertex) const;
230
234 int nSharpEdges() const;
235
239 double creaseAngle() const;
240
241 protected:
245 std::set<const Vertex*> m_setSharpEdge;
246
251 };
252
257 public:
264 Revolution(const OdGeLine3d& axis, const OdGeVector3d& startDir);
265
272
278 const OdGeLine3d& axis() const;
279
285 const OdGeVector3d& startDir() const;
286
300 int compare(const Surface* pOther, double eps) const;
301
302 protected:
303 OdGeLine3d m_axis; // Rotation axis vector.
304 OdGeVector3d m_startDir; // Start direction vector.
305 };
306
311 public:
319 Sphere(const OdGePoint3d& center, double radius, OdUInt32 approx);
320
326 Type type() const;
327
333 const OdGePoint3d& center() const;
334
340 double radius() const;
341
348
359 OdGeVector3d normal(const Vertex& atV, const Face& atF) const;
360
367
381 int compare(const Surface* pOther, double eps) const;
382
389 Surface* copy(Body& to) const;
390
391 protected:
392 OdGePoint3d m_center; // Center point coordinates.
393 double m_radius; // Radius value.
394 OdUInt32 m_approximation; // Approximation.
395 };
396
401 public:
410 Cylinder(const OdGeLine3d& axis, const OdGeVector3d& startDir,
411 double dRadius, OdUInt32 approx);
412
418 Type type() const;
419
425 double radius() const;
426
433
444 OdGeVector3d normal(const Vertex& atV, const Face& atF) const;
445
452
466 int compare(const Surface* pOther, double eps) const;
467
474 Surface* copy(Body& to) const;
475
476 protected:
477 double m_radius; // Radius value.
478 OdUInt32 m_approximation; // Approximation.
479 };
480
485 public:
495 Cone(const OdGeLine3d& axis, const OdGeVector3d& startDir,
496 double bottomRadius, double topRadius, OdUInt32 approx);
497
503 Type type() const;
504
510 double radius() const;
511
517 double topRadius() const;
518
524 double tanAngle() const;
525
532
543 OdGeVector3d normal(const Vertex& atV, const Face& atF) const;
544
551
565 int compare(const Surface* pOther, double e) const;
566
573 Surface* copy(Body& to) const;
574
575 protected:
576 double m_radius; // Radius value.
577 double m_tanAngle; // Angle tangent value.
578 OdUInt32 m_approximation; // Approximation.
579 };
580
585 public:
596 Torus(const OdGeLine3d& axis, const OdGeVector3d& startDir,
597 double majorRadius, double minorRadius,
598 OdUInt32 majorApprox, OdUInt32 minorApprox);
599
605 Type type() const;
606
612 double majorRadius() const;
613
619 double minorRadius() const;
620
627
634
645 OdGeVector3d normal(const Vertex& atV, const Face& atF) const;
646
653
667 int compare(const Surface* pOther, double e) const;
668
675 Surface* copy(Body& to) const;
676
677 protected:
678 double m_majorRadius; // Major radius value.
679 double m_minorRadius; // Minor radius value.
680 OdUInt32 m_majorApprox; // Major approximation.
681 OdUInt32 m_minorApprox; // Minor approximation.
682 };
683
684}
685
686#endif //__FMMDL_SURFACE_H__
#define FMGEOMETRY_API
unsigned int OdUInt32
Type type() const
double tanAngle() const
int compare(const Surface *pOther, double e) const
Surface * copy(Body &to) const
Cone(const OdGeLine3d &axis, const OdGeVector3d &startDir, double bottomRadius, double topRadius, OdUInt32 approx)
double topRadius() const
double radius() const
OdUInt32 approximation() const
OdUInt32 m_approximation
Definition: FMMdlSurface.h:578
OdGeVector3d normal(const Vertex &atV, const Face &atF) const
void transform(const OdGeMatrix3d &x)
Cylinder(const OdGeLine3d &axis, const OdGeVector3d &startDir, double dRadius, OdUInt32 approx)
int compare(const Surface *pOther, double eps) const
double radius() const
Surface * copy(Body &to) const
void transform(const OdGeMatrix3d &x)
OdGeVector3d normal(const Vertex &atV, const Face &atF) const
OdUInt32 approximation() const
const OdGeVector3d & startDir() const
Revolution(const OdGeLine3d &axis, const OdGeVector3d &startDir)
const OdGeLine3d & axis() const
int compare(const Surface *pOther, double eps) const
void transform(const OdGeMatrix3d &x)
virtual Surface * copy(Body &to) const
ShadedSurface(double creaseAngle=0)
std::set< const Vertex * > m_setSharpEdge
Definition: FMMdlSurface.h:245
virtual Type type() const
void findSharpEdges(const Body &body, double angleTol)
bool belongsToSharpEdge(const Vertex *vertex) const
const OdGePoint3d & center() const
Sphere(const OdGePoint3d &center, double radius, OdUInt32 approx)
OdGeVector3d normal(const Vertex &atV, const Face &atF) const
Surface * copy(Body &to) const
int compare(const Surface *pOther, double eps) const
OdGePoint3d m_center
Definition: FMMdlSurface.h:392
void transform(const OdGeMatrix3d &x)
double radius() const
OdUInt32 approximation() const
virtual Surface * clone(Body &to) const
virtual Surface * copy(Body &to) const
virtual OdGeVector3d normal(const Vertex &atV, const Face &atF) const
int surface_compare(const Surface *pOther, double eps) const
virtual int compare(const Surface *pOther, double eps) const
virtual Type type() const
void setNext(Surface *s)
Surface * next() 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
Surface * copy(Body &to) const
Torus(const OdGeLine3d &axis, const OdGeVector3d &startDir, double majorRadius, double minorRadius, OdUInt32 majorApprox, OdUInt32 minorApprox)
double majorRadius() const
OdUInt32 majorApproximation() const
OdGeVector3d normal(const Vertex &atV, const Face &atF) const
Type type() const
GLfloat x
Definition: gles2_ext.h:314