CFx SDK Documentation  2020SP3
FMMdlUtils.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 #ifndef __FMMDL_UTILS_H__
24 #define __FMMDL_UTILS_H__
25 
26 #include "Modeler/FMMdlBase.h"
27 #include "Ge/GeCircArc3d.h"
28 #include "FMContour3D.h"
29 #include "FMProfile3D.h"
30 #include "Modeler/FMMdlFace.h"
31 #include "Modeler/FMMdlEdge.h"
32 
33 namespace FacetModeler
34 {
35 
36 struct PathNode {
39  enum {
41  };
44  pArcData = 0;
45  flags = 0;
46  }
47 };
48 
49 enum {
54 };
55 
56 FMGEOMETRY_API Body extrude(
57  const Profile2D& base,
58  const DeviationParams& deviation,
59  OdUInt32 n,
60  const PathNode* path,
61  OdUInt32 flags = 0 );
62 
63 FMGEOMETRY_API void getBaseFaces(const Profile2D& rProfile, std::vector<Profile2D>& aBaseFaces, const DeviationParams& devDeviation);
64 
66 {
67  FMGEOMETRY_API_STATIC static const double kDefaultTol;
68  FMGEOMETRY_API_STATIC static const double kSplitTol;
69  FMGEOMETRY_API_STATIC static const double kZeroTol;
70 };
71 
73 {
74  bool operator() ( const Edge* pE1, const Edge* pE2 ) const
75  {
76  Vertex* pV11 = pE1->vertex();
77  Vertex* pV12 = pE1->next()->vertex();
78 
79  Vertex* pV21 = pE2->vertex();
80  Vertex* pV22 = pE2->next()->vertex();
81 
82  if ( pV11 > pV12 ) std::swap( pV11, pV12 );
83  if ( pV21 > pV22 ) std::swap( pV21, pV22 );
84 
85  if ( pV11 == pV21 && pV12 == pV22 )
86  return false;
87 
88  if ( pV11 != pV21 )
89  {
90  return pV11 < pV21;
91  }
92 
93  return pV12 < pV22;
94  }
95 
96  static bool isEqual( const Edge* pE1, const Edge* pE2 )
97  {
98  EdgeSortForPairRegen cComparer;
99  return (!cComparer( pE1, pE2 )) && (!cComparer( pE2, pE1 ));
100  }
101 };
102 
103 }
104 
105 #endif // __FMMDL_UTILS_H__
FMProfile3D.h
FacetModeler::getBaseFaces
FMGEOMETRY_API void getBaseFaces(const Profile2D &rProfile, std::vector< Profile2D > &aBaseFaces, const DeviationParams &devDeviation)
FacetModeler::MdlTolerance
Definition: FMMdlUtils.h:66
FacetModeler::EdgeSortForPairRegen::isEqual
static bool isEqual(const Edge *pE1, const Edge *pE2)
Definition: FMMdlUtils.h:96
FacetModeler::PathNode::kSmoothAtThisNode
@ kSmoothAtThisNode
Definition: FMMdlUtils.h:40
FMMdlFace.h
FacetModeler::PathNode::flags
OdUInt32 flags
Definition: FMMdlUtils.h:42
FacetModeler
Definition: FMContour2D.h:35
FacetModeler::extrude
FMGEOMETRY_API Body extrude(const Profile2D &base, const DeviationParams &deviation, OdUInt32 n, const PathNode *path, OdUInt32 flags=0)
FacetModeler::MdlTolerance::kDefaultTol
static FMGEOMETRY_API_STATIC const double kDefaultTol
Definition: FMMdlUtils.h:67
FacetModeler::PathNode
Definition: FMMdlUtils.h:36
GeCircArc3d.h
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdGeMatrix3d
Definition: GeMatrix3d.h:73
slimsig::swap
void swap(signal< Handler, SignalTraits, Allocator > &lhs, signal< Handler, SignalTraits, Allocator > &rhs)
FacetModeler::kExtrudeSmoothAlongPath
@ kExtrudeSmoothAlongPath
Definition: FMMdlUtils.h:51
FacetModeler::Body
Definition: FMMdlBody.h:47
FacetModeler::Edge
Definition: FMMdlEdge.h:43
FacetModeler::MdlTolerance::kZeroTol
static FMGEOMETRY_API_STATIC const double kZeroTol
Definition: FMMdlUtils.h:69
FacetModeler::Edge::vertex
FacetModeler::Vertex * vertex() const
FacetModeler::kExtrudeSmoothAlongProfile
@ kExtrudeSmoothAlongProfile
Definition: FMMdlUtils.h:52
FacetModeler::kExtrudeSingleArcProfile
@ kExtrudeSingleArcProfile
Definition: FMMdlUtils.h:53
FacetModeler::Edge::next
Edge * next() const
FacetModeler::DeviationParams
Definition: FMGeometry.h:43
FacetModeler::kExtrudeClosedPath
@ kExtrudeClosedPath
Definition: FMMdlUtils.h:50
FMContour3D.h
FacetModeler::PathNode::cs
OdGeMatrix3d cs
Definition: FMMdlUtils.h:37
FacetModeler::EdgeSortForPairRegen
Definition: FMMdlUtils.h:73
FacetModeler::Vertex
Definition: FMMdlVertex.h:42
FacetModeler::MdlTolerance::kSplitTol
static FMGEOMETRY_API_STATIC const double kSplitTol
Definition: FMMdlUtils.h:68
FMMdlEdge.h
FacetModeler::PathNode::pArcData
const OdGeCircArc3d * pArcData
Definition: FMMdlUtils.h:38
FacetModeler::Profile2D
Definition: FMProfile2D.h:39
FacetModeler::PathNode::PathNode
PathNode()
Definition: FMMdlUtils.h:43
FMMdlBase.h
FacetModeler::EdgeSortForPairRegen::operator()
bool operator()(const Edge *pE1, const Edge *pE2) const
Definition: FMMdlUtils.h:74
OdGeCircArc3d
Definition: GeCircArc3d.h:48