11 #define BEGIN_BENTLEY_GEOMETRY_INTERNAL_NAMESPACE namespace Bentley { namespace Geom {
12 #define END_BENTLEY_GEOMETRY_INTERNAL_NAMESPACE }}
13 #define BENTLEY_GEOMETRY_INTERNAL_NAMESPACE_NAME Bentley::Geom
14 #define USING_NAMESPACE_BENTLEY_GEOMETRY_INTERNAL using namespace BENTLEY_GEOMETRY_INTERNAL_NAMESPACE_NAME;
15 #define GEOMAPI_PRINTF BeConsole::Printf
16 #define BENTLEYGEOMETRY_MakeGeoPoint2dPublic
18 #define GEOMAPI_VIRTUAL virtual
20 #ifdef jmdlgeom_internal
51 #ifndef msGeomConst_pi
52 #define msGeomConst_piOver4 7.85398163397448280000e-001
53 #define msGeomConst_piOver2 1.57079632679489660000e+000
54 #define msGeomConst_pi 3.14159265358979310000e+000
55 #define msGeomConst_2pi 6.28318530717958620000e+000
56 #define msGeomConst_degreesPerRadian (45.0 / msGeomConst_piOver4)
57 #define msGeomConst_radiansPerDegree (msGeomConst_piOver4 / 45.0)
61 #define PI 3.1415926535897932384626433
65 #define mgds_fc_iang_to_rad (msGeomConst_degreesPerRadian/360000.0)
66 #define mgds_fc_rad_to_iang (msGeomConst_radiansPerDegree*360000.0)
67 #define mgds_fc_miang_to_rad (-1.0*msGeomConst_degreesPerRadian/360000.0)
68 #define mgds_fc_nearZero 1.0e-14
69 #define mgds_fc_condition 1.0e-12
70 #define mgds_fc_epsilon 0.00001
76 #define DISCONNECT (1.7976931348623157e308)
88 RoundingMode_Round = 0,
98 static GEOMDLLIMPEXP
double Round (
double value, RoundingMode mode,
double lowerValue,
double upperValue);
104 struct TaggedPolygon;
127 #ifdef CompileZeroInit
133 template<
typename T>
struct ZeroInit
135 ZeroInit() { std::memset(
this, 0,
sizeof(T)); }
136 ZeroInit(ZeroInit
const&) { std::memset(
this, 0,
sizeof(T)); }
137 ZeroInit(ZeroInit&&) { std::memset(
this, 0,
sizeof(T)); }
138 ZeroInit&
operator=(ZeroInit
const&) =
default;
139 ZeroInit&
operator=(ZeroInit&&) =
default;
146 template <
typename T>
169 size_t GetTag (
bool tagA)
const {
return tagA ? m_tagA : m_tagB;}
178 T
Get ()
const {
return m_value;}
179 T
const &
GetCR ()
const {
return m_value;}
180 void Set (T
const &value) { m_value = value;}
215 std::sort (data.begin (), data.end (), cbCompareTagATagB_LT);
221 std::sort (data.begin (), data.end (), cbCompareTagBTagA_LT);
243 template <
typename T>
303 std::sort (data.begin (), data.end (), cbCompareValueTagATagB_LT);
309 std::sort (data.begin (), data.end (), cbCompareTagAValueTagB_LT);
330 ValidatedValue(T
const &value,
bool isValid) : m_value(value), m_isValid(isValid){}
332 T
const &
Value()
const {
return m_value; }
337 bool IsValid(T &value)
const { value = m_value;
return m_isValid; }
341 operator T (){
return m_value; }
371 size_t numTotal = data.size ();
374 size_t numAccept = 0;
375 for (
size_t candidate = 1; candidate < numTotal; candidate++)
377 if (!SameMember (data[numAccept], data[candidate]))
380 if (candidate > numAccept)
381 data[numAccept] = data[candidate];
384 data.resize (numAccept);
410 virtual void MakeClassAbstract() = 0;
422 GEOMDLLIMPEXP
bool TryGetRange (
DRange3dR range)
const;
423 GEOMDLLIMPEXP
bool TryTransformInPlace (
TransformCR transform);
424 GEOMDLLIMPEXP
bool IsSameStructureAndGeometry (
IGeometryCR other,
double tolerance = 0.0)
const;
443 m_geometry = IGeometry::Create (myPtr);
449 m_geometry = IGeometry::Create (myPtr);
455 m_geometry = IGeometry::Create (myPtr);
461 m_geometry = IGeometry::Create (myPtr);
518 bvector<std::pair<size_t, DPoint3d>>
m_xyz;
524 void Record (
size_t index,
size_t tag) { m_indices.push_back (std::pair<size_t, ptrdiff_t> (index, (ptrdiff_t)tag)); }
525 void Record (
size_t index,
DPoint3dCR tag) { m_xyz.push_back (std::pair<size_t, DPoint3d> (index, tag)); }
526 void Record (
size_t index,
int tag) { m_indices.push_back (std::pair<size_t, ptrdiff_t> (index, (ptrdiff_t)tag)); }
534 bool m_recordAllTestDescriptions;
539 MeshAnnotationVector (
bool recordAllTestDescriptions) : m_recordAllTestDescriptions (recordAllTestDescriptions), m_totalPass (0), m_totalFail (0)
549 size_t FindOrAdd (
Utf8CP key);
551 size_t Assert (
bool condition,
Utf8CP key);
553 void Assert (
bool condition,
Utf8CP key,
size_t index,
size_t tag);
557 void Assert (
bool condition,
Utf8CP key,
size_t index,
int tag);
Contains a UTF-8 encoded string.
Definition: WString.h:275
2d point with x,y coordinates as public members: Bentley::DPoint2d
GeometryType
Definition: GeomApi.h:399
static void SortValueTagATagB(bvector< OrderedValueSizeSize< T > > &data)
Lexical sort on Value, then TagA, then TagB.
Definition: GeomApi.h:301
void SetIsValid(bool value)
update the validit member
Definition: GeomApi.h:339
T const & GetCR() const
Definition: GeomApi.h:179
MSBsplineSurface with IRefCounted support for smart pointers.
Definition: MSBsplineSurface.h:768
Utf8String m_description
Definition: GeomApi.h:514
TaggedPolygonVector * TaggedPolygonVectorP
Definition: GeomApi.h:108
OrderedIGeometryPtr(IGeometryPtr const &target)
Definition: GeomApi.h:438
ValidatedValue(T const &value)
Specified value, marked valid.
Definition: GeomApi.h:328
void Record(size_t index, size_t tag)
Definition: GeomApi.h:524
Forward and inverse 4x4 matrices of an invertible perspective transformation: DMap4d.
static bool cbCompareValue_GT(const OrderedValueSizeSize< T > &dataA, const OrderedValueSizeSize< T > &dataB)
Definition: GeomApi.h:295
size_t GetTag(bool tagA) const
Get selected tag ..
Definition: GeomApi.h:169
RefCountedPtr< struct ICurvePrimitive > ICurvePrimitivePtr
Definition: GeomApi.h:112
ValidatedValue< size_t > ValidatedSize
Definition: GeomApi.h:362
TaggedPolygonVector const & TaggedPolygonVectorCR
Definition: GeomApi.h:107
Geographic Point: Geopoint, Geopoint2d.
size_t m_tagB
Definition: GeomApi.h:152
ValidatedValue< CurveLocationDetail > ValidatedCurveLocationDetail
Definition: GeomApi.h:357
int32_t numPoints
Definition: GeomApi.h:576
ValidatedValue(T const &value, bool isValid)
Specified value, with validity indicated by caller.
Definition: GeomApi.h:330
void Set(T const &value)
Definition: GeomApi.h:180
static bool cbCompareTagATagB_LT(const ValueSizeSize< T > &dataA, const ValueSizeSize< T > &dataB)
Definition: GeomApi.h:183
OrderedIGeometryPtr()
Definition: GeomApi.h:439
Inlinable template for an ordered value of type T with two size_t tags named TagA and TagB...
Definition: GeomApi.h:244
TaggedPolygonVector & TaggedPolygonVectorR
Definition: GeomApi.h:106
Provides Bentley specific Console functions (Bentley/BeConsole.h).
An abstract type implemented by multiple types of parametric curves: ICurvePrimitive.
#define END_BENTLEY_GEOMETRY_NAMESPACE
Definition: Bentley.r.h:30
void SwapTags()
Definition: GeomApi.h:233
size_t GetTagB() const
Install TagB value.
Definition: GeomApi.h:166
An integer 2d point, useful for screen pixel references, but not for real geometry: Point...
ValidatedValue< struct DVec3d > ValidatedDVec3d
Definition: GeomApi.h:344
OrderedIGeometryPtr(CurveVectorPtr const &target)
Definition: GeomApi.h:465
OrderedIGeometryPtr(ISolidPrimitiveCR target)
Definition: GeomApi.h:458
RefCountedPtr< RefCountedMSBsplineCurve > MSBsplineCurvePtr
Definition: GeomApi.h:116
bvector< TaggedPolygon > TaggedPolygonVector
Definition: GeomApi.h:104
OrderedIGeometryPtr(ISolidPrimitivePtr const &target)
Definition: GeomApi.h:466
static class for rounding methods.
Definition: GeomApi.h:79
Start point and direction (NOT necessarily unit) for a 3D ray: DRay3d.
ValidatedValue< DrapeSegment > ValidatedDrapeSegment
Definition: GeomApi.h:361
faceId, edgeId, vertexId, FloatRGB, RgbFactor
RefCountedPtr< struct CurveVector > CurveVectorPtr
Definition: GeomApi.h:113
void swap(basic_string< _CharT, _Traits, _Allocator > &__a, basic_string< _CharT, _Traits, _Allocator > &__b)
Definition: basic_string.h:1396
struct CurveVector const & CurveVectorCR
Definition: msgeomstructs_typedefs.h:172
bvector< std::pair< size_t, DPoint3d > > m_xyz
array of pairs for error occurances.
Definition: GeomApi.h:518
Inlinable template for a value of type T with two size_t tags named TagA and TagB.
Definition: GeomApi.h:147
int int32_t
Definition: Bentley.r.h:92
Class wrapper for static utiliity functions on data structures built around DPoint2d: VectorOps...
ValidatedValue< struct DPlane3d > ValidatedDPlane3d
Definition: GeomApi.h:352
ValueSizeSize()
Definition: GeomApi.h:156
ValidatedValue< double > ValidatedDouble
Definition: GeomApi.h:353
ValidatedValue< struct RotMatrix > ValidatedRotMatrix
Definition: GeomApi.h:346
ValueSizeSize(T const &value, size_t tagA, size_t tagB)
Definition: GeomApi.h:157
A collection of curve primitives: CurveVector, CurveCurve, PathLocationDetail, CurveVectorWithDistanc...
ValidatedValue< struct DVec2d > ValidatedDVec2d
Definition: GeomApi.h:345
size_t GetTotalPass()
Query the total number of tests passed.
Definition: GeomApi.h:542
T & Value()
Definition: GeomApi.h:333
bstdmap & operator=(const bstdmap &__rhs)
Definition: stdcxx/bstdmap.h:170
T m_value
Definition: GeomApi.h:150
OrderedIGeometryPtr(PolyfaceHeaderPtr const &target)
Definition: GeomApi.h:467
RoundingMode
Enumeration of rounding options.
Definition: GeomApi.h:86
RefCountedPtr< ISolidPrimitive > ISolidPrimitivePtr
Definition: SolidPrimitive.h:50
IGeometryPtr m_geometry
Definition: GeomApi.h:437
3d point coordinates: Bentley::DPoint3d
T const & Value() const
explicty query for the "the value", without regard for the validity flag.
Definition: GeomApi.h:332
ValidatedValue< LocalRange > ValidatedLocalRange
Definition: GeomApi.h:364
TaggedPolygonVector const * TaggedPolygonVectorCP
Definition: GeomApi.h:109
bool operator<(const basic_string< _CharT, _Traits, _Allocator > &__lhs, const basic_string< _CharT, _Traits, _Allocator > &__rhs)
Definition: basic_string.h:1326
Templatized type carrying a value type with a boolean indicating if the value is considered valid...
Definition: GeomApi.h:319
Declares the NonCopyableClass.
Structure to record name and other data describing error tests.
Definition: GeomApi.h:512
A 2d low and high corner pair for range boxes: DRange2d.
void Record(size_t index, int tag)
Definition: GeomApi.h:526
void SetTagA(ptrdiff_t tag)
Replace TagA.
Definition: GeomApi.h:171
Detail data for an interval of a parent curve: PartialCurveDetail, CurveLocationDetail, CurveLocationDetailPair, SolidLocationDetail, ICurvePrimitiveInfo, CurveOffsetOptions, CurveGapOptions, BlendDetail, CurvePrimitivePtrPair.
A class that identifies the source of a curvePrimitive: CurvePrimitiveId.
ValidatedValue()
Default value, marked not valid.
Definition: GeomApi.h:326
RefCountedPtr< struct CurveVectorWithDistanceIndex > CurveVectorWithDistanceIndexPtr
Definition: GeomApi.h:114
ValidatedValue< DSegment1d > ValidatedDSegment1d
Definition: GeomApi.h:355
3d point coordinates.
Definition: dpoint3d.h:19
size_t m_tagA
Definition: GeomApi.h:151
Vector of MeshAnnotation structures.
Definition: GeomApi.h:531
bool IsValid(T &value) const
return the validity flag, copy value to parameter.
Definition: GeomApi.h:337
OrderedIGeometryPtr(MSBsplineSurfacePtr const &target)
Definition: GeomApi.h:468
ValidatedValue< struct DRange3d > ValidatedDRange3d
Definition: GeomApi.h:365
OrderedIGeometryPtr(ICurvePrimitivePtr const &target)
Definition: GeomApi.h:464
T Get() const
Return primary value.
Definition: GeomApi.h:178
A Non uniform, rational Bspline curve: MSBsplineCurve, RefCountedMSBsplineCurve.
Strongly typed angle services: Angle, AngleInDegrees, and YawPitchRollAngles.
RefCountedPtr< struct PolyfaceCoordinateAverageContext > PolyfaceCoordinateAverageContextPtr
Definition: GeomApi.h:123
MeshAnnotation(Utf8CP name)
array of pairs for error occurrances.
Definition: GeomApi.h:520
size_t GetTotalFail()
Query the total number of tests failed.
Definition: GeomApi.h:544
Data for face containing facets: FacetFaceData, DSegment3dOnFacets, BlockedVectorInt, FacetLocationDetail, FacetLocationDetailPair, PolyfaceEdgeChain, DirectionalVolumeData, PolyfaceQuery, PolyfaceQuery::IClipToPlaneSetOutput, PolyfaceQueryCarrier, PolyfaceVectors, PolyfaceHeader, PolyfaceVisitor, PolyfaceCoordinateMap.
A vector in xyz space: Bentley::DVec3d.
Start and end points of a line segment: DSegment3d.
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
An interval [x0,x1] on the real line: DSegment1d.
static void SortTagATagB(bvector< ValueSizeSize< T > > &data)
Lexical sort on Value, then TagA, then TagB.
Definition: GeomApi.h:213
ValidatedValue< DRay3d > ValidatedDRay3d
Definition: GeomApi.h:360
ValidatedValue< struct DPoint4d > ValidatedDPoint4d
Definition: GeomApi.h:350
Defines typedefs and constants that can be used across other namespaces. All Bentley-authored C++ sou...
OrderedIGeometryPtr(ICurvePrimitiveCR target)
Definition: GeomApi.h:440
OrderedValueSizeSize< double > DoubleSizeSize
Definition: GeomApi.h:312
ValidatedValue< struct Transform > ValidatedTransform
Definition: GeomApi.h:347
utility classes for statistical data accumulation
MSBsplineCurve with IRefCounted support for smart pointers.
Definition: MSBsplineCurve.h:1147
void IncrementFail()
Definition: GeomApi.h:523
OrderedIGeometryPtr(PolyfaceHeaderCR target)
Definition: GeomApi.h:452
Center, reference vectors, and angular range for elliptic arc: DEllipse3d.
struct Bentley::pointList PointList
RefCountedPtr< struct PolyfaceHeader > PolyfaceHeaderPtr
Definition: GeomApi.h:122
Origin and normal vector for a plane: DPlane3d.
OrderedValueSizeSize(T const &value, ptrdiff_t tagA, ptrdiff_t tagB)
Definition: GeomApi.h:246
struct ICurvePrimitive const & ICurvePrimitiveCR
Definition: msgeomstructs_typedefs.h:166
struct IGeometry const & IGeometryCR
Definition: msgeomstructs_typedefs.h:165
static bool cbCompareValue_LT(const OrderedValueSizeSize< T > &dataA, const OrderedValueSizeSize< T > &dataB)
Definition: GeomApi.h:289
struct PolyfaceHeader const & PolyfaceHeaderCR
Definition: msgeomstructs_typedefs.h:177
Desciption: ConvexClipPlaneSet, ClipPlaneSet.
struct ISolidPrimitive const & ISolidPrimitiveCR
Definition: msgeomstructs_typedefs.h:185
A point with markup fields: GraphicsPoint.
4x4 matrix used for perspective (homogeneous coordinate) calculations: DMatrix4d
static void SortByTags(bvector< ValueSizeSize< T > > &data, bool sortAFirst)
Lexical sort on Value, then TagA, then TagB.
Definition: GeomApi.h:225
bool IsValid() const
return the validity flag.
Definition: GeomApi.h:335
ValidatedValue< DEllipse3d > ValidatedDEllipse3d
Definition: GeomApi.h:359
struct Transform const & TransformCR
Definition: msgeomstructs_typedefs.h:134
Carries passthrough (interpolation) points for a curve: RefCountedMSInterpolationCurve.
A single plane described by normal and distance from origin: ClipPlane.
void SetTagB(ptrdiff_t tag)
Replace TagB.
Definition: GeomApi.h:173
Concrete class that can be used to implement the reference-counting pattern.
Definition: RefCounted.h:109
void IncrementPass()
Definition: GeomApi.h:522
static bool cbCompareTagBTagA_LT(const ValueSizeSize< T > &dataA, const ValueSizeSize< T > &dataB)
Definition: GeomApi.h:198
static void SortTagBTagA(bvector< ValueSizeSize< T > > &data)
Lexical sort on Value, then TagA, then TagB.
Definition: GeomApi.h:219
3x3 matrix commonly used for pure rotations: Bentley::RotMatrix
Utf8Char const * Utf8CP
Definition: Bentley.h:229
A range with transforms between local and world coordinates: MSBsplineSurface, RefCountedMSBsplineSur...
MeshAnnotationVector(bool recordAllTestDescriptions)
Definition: GeomApi.h:539
ValueSizeSize< DPoint3d > DPoint3dSizeSize
Definition: GeomApi.h:314
Definition: GeomApi.h:574
size_t GetTagA() const
Install TagA value.
Definition: GeomApi.h:164
bvector< std::pair< size_t, ptrdiff_t > > m_indices
Definition: GeomApi.h:517
RefCountedPtr< IGeometry > IGeometryPtr
Definition: GeomApi.h:125
DPoint3d * points
Definition: GeomApi.h:577
ValidatedValue< struct DPoint2d > ValidatedDPoint2d
Definition: GeomApi.h:348
#define BEGIN_BENTLEY_GEOMETRY_NAMESPACE
Definition: Bentley.r.h:29
struct DPoint3d const & DPoint3dCR
Definition: msgeomstructs_typedefs.h:79
4d point coordinates: DPoint4d
ValidatedValue< struct DPoint3d > ValidatedDPoint3d
Definition: GeomApi.h:349
static bool cbCompareTagAValueTagB_LT(const OrderedValueSizeSize< T > &dataA, const OrderedValueSizeSize< T > &dataB)
Definition: GeomApi.h:270
static void SortTagAValueTagB(bvector< OrderedValueSizeSize< T > > &data)
Lexical sort on TagA, then Value, then TagB.
Definition: GeomApi.h:307
A 1d interval with low and high values: DRange1d.
RefCounted boject carrying a draw method index and variable size array of size_t: CompoundDrawState...
A 3d low and high corner pair for range boxes: DRange3d.
ValidatedValue< DPlane3dByVectors > ValidatedDPlane3dByVectors
Definition: GeomApi.h:363
Identifies the source of a curve within a larger wireframe entity such as a B-Rep body or SolidPrimit...
ValueSizeSize< DRange3d > DRange3dSizeSize
Definition: GeomApi.h:313
void CompressDuplicates(bvector< T > &data, bool(*SameMember)(T const &memberA, T const &memberB))
Definition: GeomApi.h:369
size_t m_pass
Definition: GeomApi.h:515
void Record(size_t index, DPoint3dCR tag)
Definition: GeomApi.h:525
size_t m_fail
Definition: GeomApi.h:516
OrderedIGeometryPtr(CurveVectorCR target)
Definition: GeomApi.h:446
ValidatedValue< DSegment3d > ValidatedDSegment3d
Definition: GeomApi.h:356
Spline order, closure, and count data: bSplineParam, interpolationParam, bsplineDisplay, and BCurveSegment.
RefCountedPtr< RefCountedMSBsplineSurface > MSBsplineSurfacePtr
Definition: GeomApi.h:119
Class for multiple RefCounted geometry types: ICurvePrimitive, CurveVector, ISolidPrimitive, MSBsplineSurface, PolyfaceHeader.
Definition: GeomApi.h:395
SolidPrimitives: +-ISolidPrimitive, DgnRuledSweepDetail, DgnRotationalSweepDetail, DgnExtrusionDetail, DgnSphereDetail, DgnBoxDetail, DgnConeDetail, DgnTorusPipeDetail.
A 3d low and high corner pair for range boxes.
Definition: drange3d.h:20
Integer x,y rectangle coordinates for GUI: BSIRect.
A CurveVector is a collection of curve primitives.
Definition: CurveVector.h:78
A vector in xy space: Bentley::DVec2d.
static bool cbCompareValueTagATagB_LT(const OrderedValueSizeSize< T > &dataA, const OrderedValueSizeSize< T > &dataB)
Definition: GeomApi.h:251
IGeometryPtr with < operator for sorting on address of the target object.
Definition: GeomApi.h:435