CFx SDK Documentation  2020SP3
FMGeometry.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 __FMGEOMETRY_H__
25 #define __FMGEOMETRY_H__
26 
27 #include <OdaCommon.h>
28 #include "FMBuildSettings.h"
29 #include "FMSTLHelper.h"
30 #include <Ge/GeTol.h>
31 #include <Ge/GePlane.h>
32 #include <Ge/GeMatrix2d.h>
33 #include <Ge/GeLine2d.h>
34 
35 #define FMGE_ANGLE_TO_MINUSPI_PI(x) ( (x>OdaPI)?(x-Oda2PI):(x) )
36 
40 namespace FacetModeler
41 {
42  struct FMGEOMETRY_API DeviationParams
43  {
45  DeviationParams( double deviation, OdUInt16 maxpercircle, OdUInt16 minpercircle );
46 
47  double Deviation;
50  };
51 
56  {
57  eUnion = 0,
60  eXOR = 3,
65  eCustom = 8,
68 
69  eclone = 100,
91  };
92 
97  {
98  eNo = 0,
99  eOn = 1,
100  eInner = 2,
101  eOuter = 3,
102  eSpanning = 4
103  };
104 
113  {
114  efoDefault = 0x00,
115  efoTop = 0x01,
116  efoBottom = 0x02,
117  efoLeft = 0x04,
118  efoRight = 0x08,
119  efoFront = 0x10,
120  efoBack = 0x20,
121  efoDiscard = 0x80
122  };
123 
125  // Substitute for Teigha for .dwg files analog.
126  FMGEOMETRY_API bool isCoplanar( const OdGePlane& plane1, const OdGePlane& plane2 );
127 
128 
130  // Teigha for .dwg files foreign method, should be on OdGeMatrix2d.
131  FMGEOMETRY_API void setToMirroring( OdGeMatrix2d& thisMatrix, const OdGePoint2d& mirrorPoint );
132 
134  // Teigha for .dwg files foreign method, should be on OdGeMatrix2d.
135  FMGEOMETRY_API void setToMirroring( OdGeMatrix2d& thisMatrix, const OdGeLine2d& mirrorLine );
136 
137 // {group:API Auxiliary Classes}
138 struct FMGEOMETRY_API FMGeGbl
139 {
148  FMGEOMETRY_API_STATIC static DeviationParams gDefDev;
149 
156  FMGEOMETRY_API_STATIC static OdGeTol gTol;
157 
162  FMGEOMETRY_API_STATIC static OdUInt16 GetSegmentCount( double dAngle, double dRadius,
163  const DeviationParams& devDeviation );
164 
168  static FaceOrientation PlaneOrientation( const OdGeVector3d& normal );
169 
173  FMGEOMETRY_API_STATIC static FaceOrientation
175 
176 };
177 
179  if ( normal.isParallelTo( OdGeVector3d::kXAxis ) ) {
180  return normal.x > 0. ? efoRight : efoLeft;
181  }
182  else if ( normal.isParallelTo( OdGeVector3d::kYAxis ) ) {
183  return normal.y > 0. ? efoBack : efoFront;
184  }
185  else if ( normal.isParallelTo( OdGeVector3d::kZAxis ) ) {
186  return normal.z > 0. ? efoTop : efoBottom;
187  }
188  return efoDefault;
189 }
190 
191 }
192 
193 #endif //__FMGEOMETRY_H__
FacetModeler::FMGeGbl::gTol
static FMGEOMETRY_API_STATIC OdGeTol gTol
Definition: FMGeometry.h:156
FacetModeler::erevolution2
@ erevolution2
Definition: FMGeometry.h:80
FacetModeler::eTemporary_Extension_byTwoContours
@ eTemporary_Extension_byTwoContours
Definition: FMGeometry.h:88
OdGePlane
Definition: GePlane.h:45
FacetModeler::efoRight
@ efoRight
Definition: FMGeometry.h:118
OdGeVector3d
Definition: GeVector3d.h:54
FacetModeler::esection
@ esection
Definition: FMGeometry.h:84
FacetModeler::eCustom
@ eCustom
Definition: FMGeometry.h:65
FacetModeler::FMGeGbl::GetReversedOrientation
static FMGEOMETRY_API_STATIC FaceOrientation GetReversedOrientation(FaceOrientation eOri)
FacetModeler::ecustomInternal
@ ecustomInternal
Definition: FMGeometry.h:83
FacetModeler::eIntersection
@ eIntersection
Definition: FMGeometry.h:58
OdGeVector3d::x
double x
Definition: GeVector3d.h:601
FacetModeler::FMGeGbl::GetSegmentCount
static FMGEOMETRY_API_STATIC OdUInt16 GetSegmentCount(double dAngle, double dRadius, const DeviationParams &devDeviation)
FacetModeler
Definition: FMContour2D.h:35
FacetModeler::FaceOrientation
FaceOrientation
Definition: FMGeometry.h:113
FacetModeler::DeviationParams::Deviation
double Deviation
Definition: FMGeometry.h:47
FacetModeler::efoBack
@ efoBack
Definition: FMGeometry.h:120
FMSTLHelper.h
FacetModeler::eXOR
@ eXOR
Definition: FMGeometry.h:60
OdGeVector3d::z
double z
Definition: GeVector3d.h:603
FacetModeler::DeviationParams::DeviationParams
DeviationParams()
FacetModeler::FMGeGbl::PlaneOrientation
static FaceOrientation PlaneOrientation(const OdGeVector3d &normal)
Definition: FMGeometry.h:178
OdGeVector3d::kXAxis
static GE_STATIC_EXPORT const OdGeVector3d kXAxis
Definition: GeVector3d.h:89
FacetModeler::DeviationParams::MinPerCircle
OdUInt16 MinPerCircle
Definition: FMGeometry.h:49
FacetModeler::eTemporaryExtensionByTwoContours
@ eTemporaryExtensionByTwoContours
Definition: FMGeometry.h:66
FacetModeler::eExtrusion
@ eExtrusion
Definition: FMGeometry.h:61
FacetModeler::eTemporaryExtensionExtrusionByTrs
@ eTemporaryExtensionExtrusionByTrs
Definition: FMGeometry.h:67
GePlane.h
FacetModeler::eTemporary_Extension_byTwoProfiles
@ eTemporary_Extension_byTwoProfiles
Definition: FMGeometry.h:89
FacetModeler::erevolution1
@ erevolution1
Definition: FMGeometry.h:79
FacetModeler::eTemporary_Extension_extrusionByTrs
@ eTemporary_Extension_extrusionByTrs
Definition: FMGeometry.h:90
OdUInt16
unsigned short OdUInt16
Definition: OdPlatformSettings.h:760
FacetModeler::eOn
@ eOn
Definition: FMGeometry.h:99
FacetModeler::eOuter
@ eOuter
Definition: FMGeometry.h:101
FacetModeler::eextrude
@ eextrude
Definition: FMGeometry.h:87
FacetModeler::eDifference
@ eDifference
Definition: FMGeometry.h:59
FacetModeler::efoFront
@ efoFront
Definition: FMGeometry.h:119
FacetModeler::einsideFrame
@ einsideFrame
Definition: FMGeometry.h:82
FacetModeler::eextrusion3
@ eextrusion3
Definition: FMGeometry.h:78
FacetModeler::ecutWithInfExtrusion
@ ecutWithInfExtrusion
Definition: FMGeometry.h:86
FacetModeler::setToMirroring
FMGEOMETRY_API void setToMirroring(OdGeMatrix2d &thisMatrix, const OdGePoint2d &mirrorPoint)
DOM.
FacetModeler::DeviationParams::MaxPerCircle
OdUInt16 MaxPerCircle
Definition: FMGeometry.h:48
OdGeVector3d::kZAxis
static GE_STATIC_EXPORT const OdGeVector3d kZAxis
Definition: GeVector3d.h:91
OdGeLine2d
Definition: GeLine2d.h:43
FacetModeler::ecutWithExtrusion
@ ecutWithExtrusion
Definition: FMGeometry.h:85
GeMatrix2d.h
OdGeVector3d::isParallelTo
bool isParallelTo(const OdGeVector3d &vect, const OdGeTol &tol=OdGeContext::gTol) const
FacetModeler::enegate
@ enegate
Definition: FMGeometry.h:70
FacetModeler::efoDefault
@ efoDefault
Definition: FMGeometry.h:114
FacetModeler::eclone
@ eclone
Definition: FMGeometry.h:69
FacetModeler::einsideBody
@ einsideBody
Definition: FMGeometry.h:81
FacetModeler::ecombine
@ ecombine
Definition: FMGeometry.h:73
FacetModeler::emergeCoincidentVertices
@ emergeCoincidentVertices
Definition: FMGeometry.h:71
OdaCommon.h
FacetModeler::Classification
Classification
Definition: FMGeometry.h:97
FacetModeler::isCoplanar
FMGEOMETRY_API bool isCoplanar(const OdGePlane &plane1, const OdGePlane &plane2)
DOM.
FacetModeler::FMGeGbl
Definition: FMGeometry.h:139
FacetModeler::eInsideFrame
@ eInsideFrame
Definition: FMGeometry.h:64
FacetModeler::emergeCoplanarEntities
@ emergeCoplanarEntities
Definition: FMGeometry.h:72
FacetModeler::epyramid
@ epyramid
Definition: FMGeometry.h:75
FacetModeler::DeviationParams
Definition: FMGeometry.h:43
FacetModeler::FMGeGbl::gDefDev
static FMGEOMETRY_API_STATIC DeviationParams gDefDev
Definition: FMGeometry.h:148
FacetModeler::eextrusion1
@ eextrusion1
Definition: FMGeometry.h:76
FacetModeler::eNo
@ eNo
Definition: FMGeometry.h:98
FacetModeler::eUnion
@ eUnion
Definition: FMGeometry.h:57
FacetModeler::eRevolution
@ eRevolution
Definition: FMGeometry.h:62
OdGeMatrix2d
Definition: GeMatrix2d.h:73
FMBuildSettings.h
OdGeVector3d::kYAxis
static GE_STATIC_EXPORT const OdGeVector3d kYAxis
Definition: GeVector3d.h:90
FacetModeler::DeviationParams::DeviationParams
DeviationParams(double deviation, OdUInt16 maxpercircle, OdUInt16 minpercircle)
FacetModeler::eInner
@ eInner
Definition: FMGeometry.h:100
GeLine2d.h
FacetModeler::efoLeft
@ efoLeft
Definition: FMGeometry.h:117
OdGeTol
Definition: GeTol.h:49
GeTol.h
OdGeVector3d::y
double y
Definition: GeVector3d.h:602
FacetModeler::eInsideBody
@ eInsideBody
Definition: FMGeometry.h:63
FacetModeler::efoBottom
@ efoBottom
Definition: FMGeometry.h:116
FacetModeler::eSpanning
@ eSpanning
Definition: FMGeometry.h:102
FacetModeler::efoDiscard
@ efoDiscard
Definition: FMGeometry.h:121
FacetModeler::BooleanOperation
BooleanOperation
Definition: FMGeometry.h:56
FacetModeler::eextrusion2
@ eextrusion2
Definition: FMGeometry.h:77
FacetModeler::efoTop
@ efoTop
Definition: FMGeometry.h:115
FacetModeler::ebox
@ ebox
Definition: FMGeometry.h:74
OdGePoint2d
Definition: GePoint2d.h:60