Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
10 #include "DgnPlatform.h"
11 #include "ClipPrimitive.h"
16 typedef bvector <ClipPrimitivePtr> T_ClipPrimitiveVector;
18 /*=================================================================================**/
22 struct ClipVector : RefCounted <T_ClipPrimitiveVector>
23 {
24 private:
25  ClipVector () { }
26  ClipVector (ClipPrimitivePtr primitive);
27  ClipVector (GPArrayCR gpa, double chordTolerance, double angleTolerance, double* zLow, double* zHigh, TransformCP transform);
29 public:
30  DGNPLATFORM_EXPORT static ClipVectorPtr Create ();
31  DGNPLATFORM_EXPORT static ClipVectorPtr CreateFromPrimitive (ClipPrimitivePtr primitive);
32  DGNPLATFORM_EXPORT static ClipVectorPtr CreateFromGPA (GPArrayCR gpa, double chordTolerance, double angleTolerance, double* zLow, double* zHigh, TransformCP transform);
33  DGNPLATFORM_EXPORT static ClipVectorPtr CreateFromCurveVector (CurveVectorCR curveVector, double chordTolerance, double angleTolerance, double* zLow = NULL, double* zHigh = NULL);
34  DGNPLATFORM_EXPORT static ClipVectorPtr CreateFromElement (ElementHandleCR eh, DgnModelP modelRef, ViewportP viewport = NULL, ClipVolumePass pass = ClipVolumePass::Inside, DynamicViewSettingsCP dvSettings = NULL, bool displayCutGeometry = true);
35  DGNPLATFORM_EXPORT static ClipVectorPtr CreateFromModelRef (DgnModelRefR modelRef, ViewportP viewport, TransformCP transform);
36  DGNPLATFORM_EXPORT static ClipVectorPtr CreateCopy (ClipVectorCR vector);
38  DGNPLATFORM_EXPORT bool PointInside (DPoint3dCR point, double onTolerance = 0.0) const;
39  DGNPLATFORM_EXPORT bool SphereInside (DPoint3dCR point, double radius) const;
40  DGNPLATFORM_EXPORT BentleyStatus TransformInPlace (TransformCR transform);
42  DGNPLATFORM_EXPORT void AppendCopy (ClipVectorCR clip);
43  DGNPLATFORM_EXPORT StatusInt ClipPolyface (PolyfaceQueryCR polyface, struct PolyfaceQuery::IClipToPlaneSetOutput& output, bool triangulateOutput) const;
44  DGNPLATFORM_EXPORT void SetInvisible (bool invisible);
45  DGNPLATFORM_EXPORT void ExtractBoundaryLoops (int *nLoops, int nLoopPoints[], DPoint2dP loopPoints[], ClipMask* clipMaskP, double* zFrontP, double* zBackP, TransformP transformP, DPoint2dP pointBuffer, size_t nPoints) const;
46  DGNPLATFORM_EXPORT bool GetRange (DRange3dR range, TransformCP transform) const;
47  DGNPLATFORM_EXPORT static BentleyStatus AppendShape (ClipVectorPtr& clip, DPoint2dCP points, size_t nPoints, bool outside, double const* zLow, double const* zHigh, TransformCP transform, bool invisible = false);
48  DGNPLATFORM_EXPORT static BentleyStatus AppendPlanes (ClipVectorPtr& clip, ClipPlaneSetCR planes, bool invisible = false);
49  DGNPLATFORM_EXPORT void ParseClipPlanes ();
50  DGNPLATFORM_EXPORT void ExpandClipPlanes (double distance);
51  DGNPLATFORM_EXPORT BentleyStatus ApplyCameraToPlanes (double focalLength);
52  DGNPLATFORM_EXPORT ClipPlaneContainment ClassifyPointContainment (DPoint3dCP points, size_t nPoints, bool ignoreMasks = false) const;
54 }; // ClipVector
struct ClipPlaneSet const & ClipPlaneSetCR
Definition: msgeomstructs_typedefs.h:94
struct PolyfaceQuery const & PolyfaceQueryCR
Definition: msgeomstructs_typedefs.h:178
Output processor for ClipToPlaneSetIntersection.
Definition: Polyface.h:931
struct Bentley::GPArray const & GPArrayCR
Definition: DgnPlatform.h:140
Definition: DgnPlatformBaseType.r.h:69
struct DPoint3d const * DPoint3dCP
Definition: msgeomstructs_typedefs.h:79
Open for both read and write.
Definition: DgnPlatform.h:1439
struct DgnPlatform::ClipVector const & ClipVectorCR
Definition: DgnPlatform.h:178
struct CurveVector const & CurveVectorCR
Definition: msgeomstructs_typedefs.h:172
Definition: DgnPlatform/ExportMacros.h:58
Template to simplify the task of writing a class that implements the reference-counting pattern...
Definition: RefCounted.h:90
#define NULL
Definition: Bentley.h:157
Definition: DgnPlatform.h:1064
A DgnModel represents a DgnModel in memory.
Definition: DgnModel.h:236
Definition: ClipVector.h:22
Definition: Bentley.h:208
A DgnModelRef provides access to a model in a Bentley::DgnPlatform::DgnFile.
Definition: DgnModelRef.h:172
struct Transform const * TransformCP
Definition: msgeomstructs_typedefs.h:134
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
struct DgnPlatform::DynamicViewSettings const * DynamicViewSettingsCP
Definition: DgnPlatform.h:253
Definition: ClipPlaneSet.h:16
Definition: DgnPlatformBaseType.r.h:68
struct Transform const & TransformCR
Definition: msgeomstructs_typedefs.h:134
int StatusInt
Definition: Bentley.h:222
3x4 matrix for defining coordinate frames and affine transformations.
Definition: transform.h:22
bvector< ClipPrimitivePtr > T_ClipPrimitiveVector
Definition: ClipVector.h:16
struct DPoint3d const & DPoint3dCR
Definition: msgeomstructs_typedefs.h:79
struct DgnPlatform::ElementHandle const & ElementHandleCR
Definition: DgnPlatform.h:260
struct DPoint2d const * DPoint2dCP
Definition: msgeomstructs_typedefs.h:78
A 3d low and high corner pair for range boxes.
Definition: drange3d.h:20
2d point coordinates.
Definition: dpoint2d.h:23
Definition: DgnViewport.h:186

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.