FacetOptions.h
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
9 
10 //#include <Bentley/RefCounted.h>
11 //#include <Bentley/NonCopyableClass.h>
12 //#include <Bentley/bvector.h>
15 
18 {
25 };
26 
27 
28 
29 typedef RefCountedPtr<IFacetOptions> IFacetOptionsPtr;
30 
31 
34 struct IFacetOptions : public RefCountedBase
35 {
36 private:
37  virtual void MakeClassAbstract() = 0;
38 public:
39 public:
40 
42 GEOMDLLIMPEXP void SetChordTolerance (double chordTolerance);
44 GEOMDLLIMPEXP double GetChordTolerance () const;
45 
47 GEOMDLLIMPEXP void SetMaxFacetWidth (double maxWidth);
49 GEOMDLLIMPEXP double GetMaxFacetWidth () const;
50 
52 GEOMDLLIMPEXP void SetMaxEdgeLength (double maxEdgeLength);
54 GEOMDLLIMPEXP double GetMaxEdgeLength () const;
55 
57 GEOMDLLIMPEXP void SetAngleTolerance (double normalAngleTolerance);
59 GEOMDLLIMPEXP double GetAngleTolerance () const;
60 
62 GEOMDLLIMPEXP void SetMaxPerBezier (int maxPerBezier);
64 GEOMDLLIMPEXP int GetMaxPerBezier () const;
65 
67 GEOMDLLIMPEXP void SetMinPerBezier (int minPerBezier);
69 GEOMDLLIMPEXP int GetMinPerBezier () const;
70 
72 GEOMDLLIMPEXP void SetMaxPerFace (int maxPerFace);
74 GEOMDLLIMPEXP int GetMaxPerFace () const;
75 
77 GEOMDLLIMPEXP void SetEdgeHiding (bool edgeHiding);
79 GEOMDLLIMPEXP bool GetEdgeHiding () const;
80 
82 GEOMDLLIMPEXP void SetNormalsRequired (bool normalsRequired);
84 GEOMDLLIMPEXP bool GetNormalsRequired () const;
85 
87 GEOMDLLIMPEXP void SetParamsRequired (bool paramsRequired);
89 GEOMDLLIMPEXP bool GetParamsRequired () const;
90 
92 GEOMDLLIMPEXP void SetEdgeChainsRequired (bool edgeChainsRequired);
94 GEOMDLLIMPEXP bool GetEdgeChainsRequired () const;
95 
97 GEOMDLLIMPEXP void SetSmoothTriangleFlowRequired (bool value);
99 GEOMDLLIMPEXP bool GetSmoothTriangleFlowRequired () const;
100 
102 GEOMDLLIMPEXP void SetBSurfSmoothTriangleFlowRequired (bool value);
104 GEOMDLLIMPEXP bool GetBSurfSmoothTriangleFlowRequired () const;
105 
107 GEOMDLLIMPEXP void SetDoSpatialLaplaceSmoothing (bool value);
109 GEOMDLLIMPEXP bool GetDoSpatialLaplaceSmoothing () const;
110 
112 GEOMDLLIMPEXP void SetCurvatureWeightFactor (double value);
114 GEOMDLLIMPEXP double GetCurvatureWeightFactor () const;
115 
117 GEOMDLLIMPEXP void SetCurveParameterMapping (CurveParameterMapping curveParameterMapping);
119 GEOMDLLIMPEXP CurveParameterMapping GetCurveParameterMapping () const;
120 
122 GEOMDLLIMPEXP void SetVertexColorsRequired (bool vertexColorsRequired);
124 GEOMDLLIMPEXP bool GetVertexColorsRequired () const;
125 
127 GEOMDLLIMPEXP void SetSilhouetteDirection (DVec3d silhouetteDirection);
129 GEOMDLLIMPEXP DVec3d GetSilhouetteDirection () const;
130 
132 GEOMDLLIMPEXP void SetSilhouetteOrigin (DPoint3d silhouetteOrigin);
134 GEOMDLLIMPEXP DPoint3d GetSilhouetteOrigin () const;
135 
137 GEOMDLLIMPEXP void SetSilhouetteType (int silhouetteType);
139 GEOMDLLIMPEXP int GetSilhouetteType () const;
140 
142 GEOMDLLIMPEXP void SetSilhouetteToleranceDivisor (double silhouetteToleranceDivisor);
144 GEOMDLLIMPEXP double GetSilhouetteToleranceDivisor () const;
145 
147 GEOMDLLIMPEXP void SetCurvedSurfaceMaxPerFace (int curveSurfaceMaxPerFace);
149 GEOMDLLIMPEXP int GetCurvedSurfaceMaxPerFace () const;
150 
152 GEOMDLLIMPEXP void SetCombineFacets (bool combineFacets);
154 GEOMDLLIMPEXP bool GetCombineFacets () const;
155 
157 GEOMDLLIMPEXP void SetConvexFacetsRequired (bool convexFacetsRequired);
159 GEOMDLLIMPEXP bool GetConvexFacetsRequired () const;
160 
162 GEOMDLLIMPEXP void SetParamMode (FacetParamMode paramMode);
164 GEOMDLLIMPEXP FacetParamMode GetParamMode () const;
165 
167 GEOMDLLIMPEXP void SetParamDistanceScale (double paramDistanceScale);
169 GEOMDLLIMPEXP double GetParamDistanceScale () const;
170 
172 GEOMDLLIMPEXP void SetToleranceDistanceScale (double toleranceDistanceScale);
174 GEOMDLLIMPEXP double GetToleranceDistanceScale () const;
175 
177 GEOMDLLIMPEXP void SetIgnoreFaceMaterialAttachments (bool ignoreFaceAttachments);
179 GEOMDLLIMPEXP bool GetIgnoreFaceMaterialAttachments () const;
180 
181 
183 GEOMDLLIMPEXP void SetHideSmoothEdgesWhenGeneratingNormals (bool hideSmoothEdgesWhenGeneratingNormals);
185 GEOMDLLIMPEXP bool GetHideSmoothEdgesWhenGeneratingNormals () const;
186 
188 GEOMDLLIMPEXP void SetDefaults ();
189 
192 GEOMDLLIMPEXP void SetCurveDefaults ();
193 
195 GEOMDLLIMPEXP IFacetOptionsPtr Clone() const;
196 
198 static GEOMDLLIMPEXP IFacetOptionsPtr New ();
199 
201 static GEOMDLLIMPEXP IFacetOptionsPtr Create ();
202 
204 static GEOMDLLIMPEXP IFacetOptionsPtr CreateForCurves ();
205 
207 GEOMDLLIMPEXP bool BezierStrokeCount (DPoint4dCP poles, size_t order, size_t &count) const;
209 GEOMDLLIMPEXP bool BezierStrokeCount (bvector<DPoint4d> const &poles, size_t index0, int order, size_t &count) const;
211 GEOMDLLIMPEXP size_t SegmentStrokeCount (DSegment3dCR segment) const;
213 GEOMDLLIMPEXP size_t DistanceStrokeCount (double distance) const;
215 GEOMDLLIMPEXP size_t DistanceAndTurnStrokeCount (double distance, double turnRadians) const;
217 GEOMDLLIMPEXP size_t FullEllipseStrokeCount (DEllipse3dCR ellipse) const;
219 GEOMDLLIMPEXP size_t EllipseStrokeCount (DEllipse3dCR ellipse) const;
221 GEOMDLLIMPEXP size_t BsplineCurveStrokeCount (MSBsplineCurveCR curve) const;
223 GEOMDLLIMPEXP size_t LineStringStrokeCount (bvector<DPoint3d> const &points) const;
224 
225 }; // IFacetOptions
226 
227 
228 
231 typedef RefCountedPtr<IPolyfaceConstruction> IPolyfaceConstructionPtr;
232 
235 
236 
239 struct IPolyfaceConstruction : public RefCountedBase
240 {
241 
242 private:
243  virtual void MakeClassAbstract() = 0;
244 public:
245 public:
246 
248 GEOMDLLIMPEXP void SetFaceIndex (size_t index);
250 GEOMDLLIMPEXP size_t GetFaceIndex () const;
253 GEOMDLLIMPEXP size_t IncrementFaceIndex ();
255 GEOMDLLIMPEXP FacetFaceData GetFaceData () const;
257 GEOMDLLIMPEXP void SetFaceData (FacetFaceDataCR data);
259 GEOMDLLIMPEXP void SetCurrentFaceParamDistanceRange (DRange2dCR range);
260 
262 GEOMDLLIMPEXP void CollectCurrentFaceRanges ();
263 
265 GEOMDLLIMPEXP void EndFace ();
266 
268 GEOMDLLIMPEXP void Clear ( );
269 
271 GEOMDLLIMPEXP size_t FindOrAddPoint (DPoint3dCR point);
272 
274 GEOMDLLIMPEXP size_t FindOrAddNormal (DVec3dCR normal);
275 
277 GEOMDLLIMPEXP size_t FindOrAddParam (DPoint2dCR param);
278 
280 GEOMDLLIMPEXP size_t FindOrAddDoubleColor (RgbFactor const & color);
281 
283 GEOMDLLIMPEXP size_t AddPointIndex (size_t zeroBasedIndex, bool visible);
284 
286 GEOMDLLIMPEXP size_t AddNormalIndex (size_t zeroBasedIndex);
287 
289 GEOMDLLIMPEXP size_t AddParamIndex (size_t zeroBasedIndex);
290 
292 GEOMDLLIMPEXP size_t AddColorIndex (size_t zeroBasedIndex);
293 
295 GEOMDLLIMPEXP size_t AddSignedOneBasedPointIndex (int zeroBasedIndex);
296 
298 GEOMDLLIMPEXP size_t AddSignedOneBasedNormalIndex (int zeroBasedIndex);
299 
301 GEOMDLLIMPEXP size_t AddSignedOneBasedParamIndex (int zeroBasedIndex);
302 
304 GEOMDLLIMPEXP size_t AddSignedOneBasedColorIndex (int zeroBasedIndex);
305 
306 
308 GEOMDLLIMPEXP size_t AddFaceIndex (size_t zeroBasedIndex);
309 
311 GEOMDLLIMPEXP size_t AddPointIndexTerminator ( );
312 
314 GEOMDLLIMPEXP size_t AddNormalIndexTerminator ( );
315 
317 GEOMDLLIMPEXP size_t AddParamIndexTerminator ( );
318 
320 GEOMDLLIMPEXP size_t AddColorIndexTerminator ( );
321 
322 
324 GEOMDLLIMPEXP PolyfaceHeaderPtr GetClientMeshPtr ();
325 
327 GEOMDLLIMPEXP IFacetOptionsR GetFacetOptionsR ( );
328 
330 GEOMDLLIMPEXP size_t AddPointIndexTriangle (size_t index0, bool visible0, size_t index1, bool visible1, size_t index2, bool visible2);
331 
333 GEOMDLLIMPEXP size_t AddNormalIndexTriangle (size_t index0, size_t index1, size_t index2);
334 
336 GEOMDLLIMPEXP size_t AddParamIndexTriangle (size_t index0, size_t index1, size_t index2);
337 
339 GEOMDLLIMPEXP size_t AddColorIndexTriangle (size_t index0, size_t index1, size_t index2);
340 
342 GEOMDLLIMPEXP size_t AddPointIndexQuad (size_t index0, bool visible0, size_t index1, bool visible1, size_t index2, bool visible2, size_t index3, bool visible3);
343 
345 GEOMDLLIMPEXP size_t AddNormalIndexQuad (size_t index0, size_t index1, size_t index2, size_t index3);
346 
348 GEOMDLLIMPEXP size_t AddParamIndexQuad (size_t index0, size_t index1, size_t index2, size_t index3);
349 
351 GEOMDLLIMPEXP size_t AddColorIndexQuad (size_t index0, size_t index1, size_t index2, size_t index3);
352 
354 GEOMDLLIMPEXP bool AddPolyface (PolyfaceQueryCR polyface, size_t drawMethodIndex=0);
355 
356 
358 GEOMDLLIMPEXP bool NeedNormals ();
360 GEOMDLLIMPEXP bool NeedParams ();
361 
362 
363 
365 GEOMDLLIMPEXP void InitializeConstructionStateAndStack ();
367 GEOMDLLIMPEXP void InitializeCurrentConstructionState ();
368 
369 
372 GEOMDLLIMPEXP bool GetReverseNewFacetIndexOrder () const;
374 GEOMDLLIMPEXP bool GetReverseNewNormals () const;
375 
376 
380 GEOMDLLIMPEXP bool GetWorldToLocal (TransformR transform) const;
383 GEOMDLLIMPEXP bool IsTransformed () const;
387 GEOMDLLIMPEXP bool GetLocalToWorld (TransformR transform) const;
391 GEOMDLLIMPEXP bool SetLocalToWorld (TransformCR transform);
394 GEOMDLLIMPEXP bool ApplyLocalToWorld (TransformCR relativeTransform);
395 
398 GEOMDLLIMPEXP DPoint3d MultiplyByLocalToWorld (DPoint3dCR localPoint) const;
399 
403 GEOMDLLIMPEXP DVec3d MultiplyNormalByLocalToWorld (DVec3dCR localNormal) const;
404 
408 GEOMDLLIMPEXP void PushState (bool initializeCurrentState = false);
411 GEOMDLLIMPEXP bool PopState ();
412 
414 GEOMDLLIMPEXP void SetReverseNewFacetIndexOrder (bool reverse);
416 GEOMDLLIMPEXP void SetReverseNewNormals (bool reverse);
417 
421 GEOMDLLIMPEXP bool GetLocalToWorldNormals (RotMatrixR matrix) const;
422 
423 
425 GEOMDLLIMPEXP void ToggleIndexOrderAndNormalReversal ();
426 
429 GEOMDLLIMPEXP double GetLocalToWorldScale () const;
432 GEOMDLLIMPEXP double GetWorldToLocalScale () const;
433 
435 GEOMDLLIMPEXP void AddRuled (DEllipse3dR ellipse0, DEllipse3dR ellipse1, bool cap);
437 GEOMDLLIMPEXP void Add (MSBsplineSurfaceCR surface);
438 
440 GEOMDLLIMPEXP void AddSmoothed (MSBsplineSurfaceCR surface);
441 
442 
444 GEOMDLLIMPEXP void AddRowMajorQuadGrid (DPoint3dCP points, DVec3dCP normals, DPoint2dCP params, size_t numPerRow, size_t numRow, bool forceTriangles = false);
451 GEOMDLLIMPEXP void AddTriStrip(DPoint3dCP points, DVec3dCP normals, DPoint2dCP params, size_t numPoint, bool firstTriangle012);
452 
463 GEOMDLLIMPEXP void AddTubeMesh
464 (
465 MSBsplineCurveCR centerlineCurve,
466 double radius,
467 int numEdgePerSection,
468 int numSectionEdge
469 );
470 
471 
475 GEOMDLLIMPEXP void AddLinearSweep (bvector<DPoint3d> &pointA, bvector<DVec3d> &tangentA, DVec3dCR step);
479 GEOMDLLIMPEXP void AddLinearSweep (bvector<DPoint3d> &pointA, bvector<DVec3d> *tangentA, DVec3dCR step, bool capped);
480 
482 GEOMDLLIMPEXP bool AddRuledBetweenCorrespondingCurves (bvector<CurveVectorPtr> const &contours, bool capped);
484 GEOMDLLIMPEXP void AddRotationalSweep (CurveVectorPtr, DPoint3dCR center, DVec3dCR axis, double totalSweep, bool capped);
485 
487 GEOMDLLIMPEXP void AddRegion (CurveVectorCR region);
491 GEOMDLLIMPEXP bool StrokeWithDoubledPointsAtCorners(CurveVectorCR curves, bvector<DPoint3d> &points, bvector<DVec3d>&tangents, size_t &numLoop);
492 
493 
497 GEOMDLLIMPEXP bool StrokeWithDoubledPointsAtCorners(
498 CurveVectorCR curves,
499 bvector<bvector<DPoint3d> >&points,
500 bvector<bvector<DVec3d> >&tangents,
501 bvector<double> &curveLengths
502 );
503 
507 GEOMDLLIMPEXP bool Stroke (CurveVectorCR curves, bvector<DPoint3d> &points, size_t &numLoop);
508 
510 GEOMDLLIMPEXP bool AddTriangulation (bvector<DPoint3d> &points);
511 
513 GEOMDLLIMPEXP void AddTriangulationPair (bvector<DPoint3d> &pointA, bool reverseA, bvector<DPoint3d> &pointB, bool reverseB);
514 
516 GEOMDLLIMPEXP bool AddPolygon(bvector<DPoint3d> &points);
517 
531 GEOMDLLIMPEXP void AddRotationalSweepLoop
532 (
533 bvector<DPoint3d> &pointA,
534 bvector<DVec3d> &tangentA,
535 DPoint3dCR center,
536 DVec3dCR rotationAxis,
537 double totalSweepRadians,
538 bool reverse,
539 double nominalBaseCurveLength,
540 bvector<DPoint3d> *startCapPointAccumulator,
541 bvector<DPoint3d> *endCapPointAccumulator
542 );
543 
544 
549 GEOMDLLIMPEXP void AddFullDisk (DEllipse3dCR ellipse, size_t numPerQuadrant = 0);
550 
555 GEOMDLLIMPEXP void AddFullDiskTriangles (DEllipse3dCR ellipse, size_t numPerQuadrant = 0);
556 
557 
563 GEOMDLLIMPEXP void AddFullSphere (DPoint3dCR center, double radius, size_t numPerQuadrantEW = 0, size_t numPerQuadrantNS = 0);
564 
578 GEOMDLLIMPEXP void AddEllipsoidPatch (DPoint3dCR center,
579  double radiusX,
580  double radiusY,
581  double radiusPole,
582  size_t numEastWestEdge = 0,
583  size_t numNorthSouthEdge = 0,
584  double longitudeStart = 0.0,
585  double longitudeSweep = msGeomConst_2pi,
586  double latitudeStart = -msGeomConst_piOver2,
587  double latitudeSweep = msGeomConst_pi,
588  bool capped = false,
589  int orientationSelect = 1
590  );
591 
599 GEOMDLLIMPEXP bool AddSweptNGon (size_t n, double rOuter, double z0, double z1,
600  bool bottomCap,
601  bool topCap
602  );
603 
605 GEOMDLLIMPEXP void FindOrAddPoints (bvector<DPoint3d> &point, size_t n, size_t numWrap, bvector<size_t> &index);
607 GEOMDLLIMPEXP void FindOrAddNormals (bvector<DVec3d> &normal, size_t n, size_t numWrap, bvector<size_t> &index);
609 GEOMDLLIMPEXP void FindOrAddParams (bvector<DPoint2d> &param, size_t n, size_t numWrap, bvector<size_t> &index);
611 GEOMDLLIMPEXP void FindOrAddPoints (DPoint3dCP points, size_t n, bvector<size_t> &index);
613 GEOMDLLIMPEXP void FindOrAddNormals (DVec3dCP normals, size_t n, bvector<size_t> &index);
615 GEOMDLLIMPEXP void FindOrAddParams (DPoint2dCP params, size_t n, bvector<size_t> &index);
618 GEOMDLLIMPEXP void AddPointIndexFan (size_t centerIndex, bvector<size_t> &index, size_t numChord, bool reverse);
619 
621 GEOMDLLIMPEXP void AddPointIndexFan
622 (
623 size_t centerIndex,
624 bvector<size_t> &index,
625 size_t numChord,
626 bool reverse,
627 bool spokesVisible,
628 bool visibleBoundary
629 );
630 
631 
633 GEOMDLLIMPEXP void AddPointIndexStrip
634 (
635 bool visibleLeft,
636 bvector<size_t> &indexA,
637 bool visibleA,
638 bvector<size_t> &indexB,
639 bool visibleB,
640 bool visibleRight,
641 size_t numQuad,
642 bool reverse);
643 
645 GEOMDLLIMPEXP void AddNormalIndexFan (size_t centerIndex, bvector<size_t> &index, size_t numChord, bool reverse);
647 GEOMDLLIMPEXP void AddNormalIndexPlanarFan (DVec3dCR vectorA, DVec3dCR vectorB, bool reverse, size_t numChord);
649 GEOMDLLIMPEXP void AddNormalIndexPlanarFan (size_t normalIndex, size_t numChord);
651 GEOMDLLIMPEXP void AddNormalIndexPlanarStrip (size_t index, size_t numQuad);
652 
653 
655 GEOMDLLIMPEXP void AddParamIndexFan (size_t centerIndex, bvector<size_t> &index, size_t numChord, bool reverse);
657 GEOMDLLIMPEXP void AddParamIndexStrip (bvector<size_t> &indexA, bvector<size_t> &indexB, size_t numQuad, bool reverse);
658 
660 GEOMDLLIMPEXP bool AddSolidPrimitive (ISolidPrimitiveCR primitive);
662 GEOMDLLIMPEXP bool Add (DgnConeDetailCR cone);
664 GEOMDLLIMPEXP bool Add (DgnSphereDetailCR sphere);
666 GEOMDLLIMPEXP bool Add (DgnBoxDetailCR box);
668 GEOMDLLIMPEXP bool Add (DgnTorusPipeDetailCR torus);
670 GEOMDLLIMPEXP bool Add (DgnExtrusionDetailCR extrusion);
672 GEOMDLLIMPEXP bool Add (DgnRotationalSweepDetailCR sweep);
674 GEOMDLLIMPEXP bool Add (DgnRuledSweepDetailCR sweep);
675 
685 GEOMDLLIMPEXP bool RemapPseudoDistanceParams
686 (
687 bvector<DPoint2d>&params,
688 DRange2dR distanceRange,
689 DRange2dR paramRange,
690 double xDistanceFactor,
691 double yDistanceFactor,
692 Transform *transform
693 );
694 
695 GEOMDLLIMPEXP bool RemapPseudoDistanceParams
696 (
697 bvector<DPoint2d>&params,
698 DRange2dR distanceRange,
699 DRange2dR paramRange,
700 double xDistanceFactor = 1.0,
701 double yDistanceFactor = 1.0
702 )
703  {
704  return RemapPseudoDistanceParams (params, distanceRange, paramRange, xDistanceFactor, yDistanceFactor, nullptr);
705  }
706 
707 
708 
710 GEOMDLLIMPEXP bool Add (PolyfaceHeaderR polyface);
711 
712 
714 GEOMDLLIMPEXP static IPolyfaceConstructionPtr Create (IFacetOptionsR options);
715 
716 };
717 
721 {
722 private:
723  virtual void MakeClassAbstract() = 0;
724 public:
725 
726 public:
729 };
bool GetEdgeHiding() const
Get the EdgeHiding facet control.
struct DVec3d const * DVec3dCP
Definition: msgeomstructs_typedefs.h:89
bool GetConvexFacetsRequired() const
Get the ConvexFacetsRequired facet control.
void AddRowMajorQuadGrid(DPoint3dCP points, DVec3dCP normals, DPoint2dCP params, size_t numPerRow, size_t numRow, bool forceTriangles=false)
Add square grid with normal, param at each point.
struct PolyfaceQuery const & PolyfaceQueryCR
Definition: msgeomstructs_typedefs.h:178
bool GetLocalToWorldNormals(RotMatrixR matrix) const
Get the local to world matrix for surface normals.
int GetCurvedSurfaceMaxPerFace() const
Get the CurvedSurfaceMaxPerFace facet control.
void SetDefaults()
Set all parameters to default values.
void AddLinearSweep(bvector< DPoint3d > &pointA, bvector< DVec3d > &tangentA, DVec3dCR step)
Make a linear sweep from base points.
void SetSilhouetteToleranceDivisor(double silhouetteToleranceDivisor)
Set the SilhouetteToleranceDivisor facet control.
int GetSilhouetteType() const
Get the SilhouetteType facet control.
bool GetHideSmoothEdgesWhenGeneratingNormals() const
Get whether mooth edges between facets are marked as hidden when normals are genereted for a polyface...
void AddNormalIndexFan(size_t centerIndex, bvector< size_t > &index, size_t numChord, bool reverse)
Add normal triangles from a center index to multiple edges.
void SetMinPerBezier(int minPerBezier)
Set the MinPerBezier facet control.
struct RotMatrix & RotMatrixR
Definition: msgeomstructs_typedefs.h:135
void SetReverseNewFacetIndexOrder(bool reverse)
Set the current facet index reversal state.
void AddRegion(CurveVectorCR region)
Add (triangulation of) the region bounded by a curve vector.
static IPolyfaceConstructionPtr Create(IFacetOptionsR options)
Return a system default facet construction object.
struct IPolyfaceConstruction & IPolyfaceConstructionR
Definition: FacetOptions.h:234
size_t AddParamIndexTriangle(size_t index0, size_t index1, size_t index2)
Add a triangle to the param index table. Return the (0-based) position in the ParamIndex array...
size_t AddPointIndexTerminator()
Add a terminator to the point index table. Return the (0-based) position in the PointIndex array...
size_t AddSignedOneBasedNormalIndex(int zeroBasedIndex)
Add a normal index, directly, i.e. caller is responsible for providing a one based index...
struct DRange2d const & DRange2dCR
Definition: msgeomstructs_typedefs.h:110
double GetLocalToWorldScale() const
Get the (average) scale factor of the local to world transform.
void SetParamMode(FacetParamMode paramMode)
Set the ParamMode facet control.
struct DPoint3d const * DPoint3dCP
Definition: msgeomstructs_typedefs.h:79
size_t SegmentStrokeCount(DSegment3dCR segment) const
Compute the number of strokes needed for a line segment.
void Clear()
Clear client mesh and all construction support.
DVec3d MultiplyNormalByLocalToWorld(DVec3dCR localNormal) const
Multiply a surface normal by the local to world effects and renormalize.
void SetEdgeChainsRequired(bool edgeChainsRequired)
Set the EdgeChainsRequired facet control.
void FindOrAddNormals(bvector< DVec3d > &normal, size_t n, size_t numWrap, bvector< size_t > &index)
Find or add n indices. Return the n indices plus numWrap additional wraparounds.
size_t LineStringStrokeCount(bvector< DPoint3d > const &points) const
Comptue the number of strokes needed for a linestring. This is the sum of counts on individual segmen...
void InitializeConstructionStateAndStack()
Clear the construction state stack and set current state.
size_t DistanceStrokeCount(double distance) const
Compute the number of strokes needed for a distance.
int GetMaxPerFace() const
Get the MaxPerFace facet control.
size_t AddColorIndex(size_t zeroBasedIndex)
Add a color index, adjusted to 1-based indexing Return the (0-based) position in the ParamIndex array...
RefCountedPtr< IFacetOptions > IFacetOptionsPtr
Definition: FacetOptions.h:29
bool GetBSurfSmoothTriangleFlowRequired() const
Get the SmoothTriangleFlow facet control – bspline surfaces only.
double GetMaxFacetWidth() const
Gets the maximum facet width.
struct DgnConeDetail const & DgnConeDetailCR
Definition: msgeomstructs_typedefs.h:196
bool GetParamsRequired() const
Get the ParamsRequired facet control.
size_t AddParamIndexTerminator()
Add a terminator to the param index table. Return the (0-based) position in the ParamIndex array...
void SetCurrentFaceParamDistanceRange(DRange2dCR range)
Set (only) the paramDistance range part of the current FacetFacetData.
DPoint3d MultiplyByLocalToWorld(DPoint3dCR localPoint) const
Multiply the local to world transform times the input point.
size_t AddParamIndexQuad(size_t index0, size_t index1, size_t index2, size_t index3)
Add a quad to the param index table. Return the (0-based) position in the ParamIndex array...
#define END_BENTLEY_GEOMETRY_NAMESPACE
Definition: Bentley.r.h:30
CurveParameterMapping
Definition: msgeomstructs_typedefs.h:214
void SetFaceIndex(size_t index)
Set the (modal) face index. (And clear the modal parameter range)
#define msGeomConst_2pi
Definition: GeomApi.h:55
size_t AddParamIndex(size_t zeroBasedIndex)
Add a param index, adjusted to 1-based indexing Return the (0-based) position in the ParamIndex array...
void FindOrAddPoints(bvector< DPoint3d > &point, size_t n, size_t numWrap, bvector< size_t > &index)
Find or add n indices. Return the n indices plus numWrap additional wraparounds.
bool AddSweptNGon(size_t n, double rOuter, double z0, double z1, bool bottomCap, bool topCap)
Sweep a regular polygon (parallel to xy plane) from z0 to z1.
size_t EllipseStrokeCount(DEllipse3dCR ellipse) const
Compute the number of strokes needed for a partial ellipse.
void SetMaxPerFace(int maxPerFace)
Set the MaxPerFace facet control.
double GetWorldToLocalScale() const
Get the (average) scale factor of the world to local transform.
void SetCombineFacets(bool combineFacets)
Set the CombineFacets facet control.
bool Stroke(CurveVectorCR curves, bvector< DPoint3d > &points, size_t &numLoop)
Stroke with facet options from the PolyfaceConstruction.
Facet parameters are 0 to 1 in longer physical direction, 0 to smaller fraction in the other directio...
Definition: FacetOptions.h:22
RefCountedPtr< IPolyfaceConstruction > IPolyfaceConstructionPtr
Definition: FacetOptions.h:230
bool AddPolygon(bvector< DPoint3d > &points)
Add a polygon.
void AddEllipsoidPatch(DPoint3dCR center, double radiusX, double radiusY, double radiusPole, size_t numEastWestEdge=0, size_t numNorthSouthEdge=0, double longitudeStart=0.0, double longitudeSweep=msGeomConst_2pi, double latitudeStart=-msGeomConst_piOver2, double latitudeSweep=msGeomConst_pi, bool capped=false, int orientationSelect=1)
Add sphere patch with latitude, longitude sweeps.
size_t FindOrAddNormal(DVec3dCR normal)
Find or add a normal. Return the (0-based) index.
size_t BsplineCurveStrokeCount(MSBsplineCurveCR curve) const
Comptue the number of strokes needed for a bspline curve.
IFacetOptionsPtr Clone() const
Create a copy.
void AddFullDisk(DEllipse3dCR ellipse, size_t numPerQuadrant=0)
Add complete disk.
size_t FindOrAddDoubleColor(RgbFactor const &color)
Find or add a color. Return the (0-based) index.
RefCountedPtr< struct CurveVector > CurveVectorPtr
Definition: GeomApi.h:113
void PushState(bool initializeCurrentState=false)
Push the current transform and revesal state.
size_type count(const key_type &__x) const
Definition: stdcxx/bstdmap.h:277
size_t AddNormalIndexQuad(size_t index0, size_t index1, size_t index2, size_t index3)
Add a quad to the normal index table. Return the (0-based) position in the NormalIndex array...
void SetIgnoreFaceMaterialAttachments(bool ignoreFaceAttachments)
Set whether facets returned for BReps are separated by color/material when there is per-face symbolog...
IFacetOptionsR GetFacetOptionsR()
Return the facet controls.
size_t AddPointIndexTriangle(size_t index0, bool visible0, size_t index1, bool visible1, size_t index2, bool visible2)
Add a triangle to the point index table. Return the (0-based) position in the PointIndex array...
void AddNormalIndexPlanarStrip(size_t index, size_t numQuad)
Add quads that share index to the a single normal.
struct CurveVector const & CurveVectorCR
Definition: msgeomstructs_typedefs.h:172
size_t IncrementFaceIndex()
Increment the (modal) face index.
size_t FullEllipseStrokeCount(DEllipse3dCR ellipse) const
Compute the number of strokes needed for a complete ellipse.
void SetConvexFacetsRequired(bool convexFacetsRequired)
Set the ConvexFacetsRequired facet control.
struct Transform & TransformR
Definition: msgeomstructs_typedefs.h:134
FacetOptions carries tolerance and count data to be used in making surface facets and curve chords...
Definition: FacetOptions.h:34
void SetEdgeHiding(bool edgeHiding)
Set the EdgeHiding facet control.
struct DgnTorusPipeDetail const & DgnTorusPipeDetailCR
Definition: msgeomstructs_typedefs.h:195
FacetFaceData GetFaceData() const
Return the current face data.
bool AddTriangulation(bvector< DPoint3d > &points)
Triangulate a space polygon and add to mesh. Disconnect points separate multiple loops.
bool IsTransformed() const
Ask if the local to world transform is nontrivial.
#define msGeomConst_piOver2
Definition: GeomApi.h:53
void SetBSurfSmoothTriangleFlowRequired(bool value)
Set the SmoothTriangleFlow facet control – bspline surfaces only. A true unqualified SetSmoothTriang...
void SetNormalsRequired(bool normalsRequired)
Set the NormalsRequired facet control.
size_t AddColorIndexTerminator()
Add a terminator to the color index table. Return the (0-based) position in the ColorIndex array...
DPoint3d GetSilhouetteOrigin() const
Get the SilhouetteOrigin facet control.
size_t FindOrAddParam(DPoint2dCR param)
Find or add a param. Return the (0-based) index.
struct DgnRotationalSweepDetail const & DgnRotationalSweepDetailCR
Definition: msgeomstructs_typedefs.h:200
struct IFacetOptions & IFacetOptionsR
Definition: msgeomstructs_typedefs.h:162
struct MSBsplineSurface const & MSBsplineSurfaceCR
Definition: msgeomstructs_typedefs.h:159
struct DRange2d & DRange2dR
Definition: msgeomstructs_typedefs.h:110
void Add(MSBsplineSurfaceCR surface)
Add bspline surface mesh.
void SetToleranceDistanceScale(double toleranceDistanceScale)
Set the ToleranceDistanceScale facet control.
bool NeedParams()
Ask if params are needed.
PolyfaceHeaderPtr GetClientMeshPtr()
Return the client polyface mesh.
bool GetReverseNewFacetIndexOrder() const
Ask if facets are to be reversed as received.
void AddRotationalSweep(CurveVectorPtr, DPoint3dCR center, DVec3dCR axis, double totalSweep, bool capped)
Add rotational sweep from curves.
struct DEllipse3d & DEllipse3dR
Definition: msgeomstructs_typedefs.h:114
struct MSBsplineCurve const & MSBsplineCurveCR
Definition: msgeomstructs_typedefs.h:139
double GetCurvatureWeightFactor() const
Get the CurvatureWeightFactor control.
void SetVertexColorsRequired(bool vertexColorsRequired)
Set the VertexColorsRequired facet control.
bool AddSolidPrimitive(ISolidPrimitiveCR primitive)
Add facets for all faces of a solid primitive.
void SetCurvedSurfaceMaxPerFace(int curveSurfaceMaxPerFace)
Set the CurvedSurfaceMaxPerFace facet control.
bool GetLocalToWorld(TransformR transform) const
Get the local to world placement transform.
FacetParamMode
Enumeration of requested range of facet parameters.
Definition: FacetOptions.h:17
static IFacetOptionsPtr New()
Return a (smart pointer) implementation of the interface. Depreated – use Create() or CreateForCurve...
void AddFullDiskTriangles(DEllipse3dCR ellipse, size_t numPerQuadrant=0)
Add complete disk.
void AddFullSphere(DPoint3dCR center, double radius, size_t numPerQuadrantEW=0, size_t numPerQuadrantNS=0)
Add complete sphere.
size_t AddNormalIndex(size_t zeroBasedIndex)
Add a normal index, adjusted to 1-based indexing. Return the (0-based) position in the NormalIndex ar...
void SetCurveParameterMapping(CurveParameterMapping curveParameterMapping)
Set the CurveParameterMapping facet control.
struct PolyfaceHeader & PolyfaceHeaderR
Definition: msgeomstructs_typedefs.h:177
double GetParamDistanceScale() const
Get the ParamDistanceScale facet control.
size_t AddFaceIndex(size_t zeroBasedIndex)
Add a face index, adjusted to 1-based indexing Return the (0-based) position in the FaceIndex array...
bool AddPolyface(PolyfaceQueryCR polyface, size_t drawMethodIndex=0)
Add polyface mesh.
bool BezierStrokeCount(DPoint4dCP poles, size_t order, size_t &count) const
Compute the number of strokes needed for a (weighted) bezier.
void SetMaxFacetWidth(double maxWidth)
Sets maximum facet width. As of now, only bodies faceted by Parasolid use this parameter.
void SetChordTolerance(double chordTolerance)
Set the ChordTolerance facet control.
void SetCurveDefaults()
Set all parameters to default values for curves.
#define msGeomConst_pi
Definition: GeomApi.h:54
void AddPointIndexStrip(bool visibleLeft, bvector< size_t > &indexA, bool visibleA, bvector< size_t > &indexB, bool visibleB, bool visibleRight, size_t numQuad, bool reverse)
Add point quads between EQUAL LENGTH index vectors.
struct DgnExtrusionDetail const & DgnExtrusionDetailCR
Definition: msgeomstructs_typedefs.h:199
bool GetEdgeChainsRequired() const
Get the EdgeChainsRequired facet control.
struct DPoint2d const & DPoint2dCR
Definition: msgeomstructs_typedefs.h:78
A Bentley supplied implementation std::vector.
Definition: stdcxx/bvector.h:77
size_t AddColorIndexQuad(size_t index0, size_t index1, size_t index2, size_t index3)
Add a quad to the color index table. Return the (0-based) position in the ColorIndex array...
void AddTriStrip(DPoint3dCP points, DVec3dCP normals, DPoint2dCP params, size_t numPoint, bool firstTriangle012)
Add square grid with normal, param at each point.
bool GetIgnoreFaceMaterialAttachments() const
Get whether facets returned for BReps are separated by color/material when there is per-face symbolog...
void AddParamIndexStrip(bvector< size_t > &indexA, bvector< size_t > &indexB, size_t numQuad, bool reverse)
Add parameter quads between same-size indices.
struct IPolyfaceConstruction * IPolyfaceConstructionP
Definition: FacetOptions.h:233
RefCountedPtr< struct PolyfaceHeader > PolyfaceHeaderPtr
Definition: GeomApi.h:122
size_t AddSignedOneBasedParamIndex(int zeroBasedIndex)
Add a param index, directly, i.e. caller is responsible for providing a one based index...
bool ApplyLocalToWorld(TransformCR relativeTransform)
Apply (right multiply) the local to world transform.
size_t AddSignedOneBasedColorIndex(int zeroBasedIndex)
Add a color index, directly, i.e. caller is responsible for providing a one based index...
void AddTubeMesh(MSBsplineCurveCR centerlineCurve, double radius, int numEdgePerSection, int numSectionEdge)
Add facets to a mesh.
int GetMinPerBezier() const
Get the MinPerBezier facet control.
Helper object for constructing polyface mesh.
Definition: FacetOptions.h:239
double GetAngleTolerance() const
Get the AngleTolerance facet control.
size_t AddNormalIndexTerminator()
Add a terminator to the normal index table. Return the (0-based) position in the NormalIndex array...
void SetAngleTolerance(double normalAngleTolerance)
Set the AngleTolerance facet control.
struct DSegment3d const & DSegment3dCR
Definition: msgeomstructs_typedefs.h:115
void AddPointIndexFan(size_t centerIndex, bvector< size_t > &index, size_t numChord, bool reverse)
Add point triangles from a center index to edges of a polyline.
struct ISolidPrimitive const & ISolidPrimitiveCR
Definition: msgeomstructs_typedefs.h:185
CurveParameterMapping GetCurveParameterMapping() const
Get the CurveParameterMapping facet control.
size_t DistanceAndTurnStrokeCount(double distance, double turnRadians) const
Compute the number of strokes needed for distance with turn.
void SetSmoothTriangleFlowRequired(bool value)
Set the SmoothTriangleFlow facet control. (This can apply to both bspline and non-bspline. See.
Helper object for constructing facets from coordinate sources.
Definition: FacetOptions.h:720
void AddNormalIndexPlanarFan(DVec3dCR vectorA, DVec3dCR vectorB, bool reverse, size_t numChord)
Add triangles that share index to the a new normal whose coordinates are the cross product of given v...
struct Transform const & TransformCR
Definition: msgeomstructs_typedefs.h:134
struct DgnRuledSweepDetail const & DgnRuledSweepDetailCR
Definition: msgeomstructs_typedefs.h:201
double GetChordTolerance() const
Get the ChordTolerance facet control.
static IFacetOptionsPtr CreateForCurves()
Return a (smart pointer) implementation of the interface, with tolerances set for typical curves...
struct Bentley::RgbFactor RgbFactor
Red, green, blue color data as doubles.
Definition: msgeomstructs_typedefs.h:226
void EndFace()
Finalize data for the current face.
bool GetWorldToLocal(TransformR transform) const
Get the world to local placement transform.
size_t AddPointIndex(size_t zeroBasedIndex, bool visible)
Add a point index, adjusted to 1-based indexing with visibility in sign. Return the (0-based) positio...
bool RemapPseudoDistanceParams(bvector< DPoint2d > &params, DRange2dR distanceRange, DRange2dR paramRange, double xDistanceFactor, double yDistanceFactor, Transform *transform)
Apply the FacetParamMode to an array of parameters.
void SetSilhouetteOrigin(DPoint3d silhouetteOrigin)
Set the SilhouetteOrigin facet control.
size_t AddSignedOneBasedPointIndex(int zeroBasedIndex)
Add a point index directly, i.e. caller is responsible for providing a one based index with optional ...
void SetMaxEdgeLength(double maxEdgeLength)
Set the MaxEdgeLength facet control.
bool StrokeWithDoubledPointsAtCorners(CurveVectorCR curves, bvector< DPoint3d > &points, bvector< DVec3d > &tangents, size_t &numLoop)
Stroke with facet options from the PolyfaceConstruction.
struct FacetFaceData const & FacetFaceDataCR
Definition: msgeomstructs_typedefs.h:173
void AddSmoothed(MSBsplineSurfaceCR surface)
Add bspline surface mesh, with smoothing effects.
struct DgnBoxDetail const & DgnBoxDetailCR
Definition: msgeomstructs_typedefs.h:197
struct DEllipse3d const & DEllipse3dCR
Definition: msgeomstructs_typedefs.h:114
size_t FindOrAddPoint(DPoint3dCR point)
Find or add a point. Return the (0-based) index.
size_t AddNormalIndexTriangle(size_t index0, size_t index1, size_t index2)
Add a triangle to the normal index table. Return the (0-based) position in the NormalIndex array...
size_t GetFaceIndex() const
Get the (modal) face index.
bool AddRuledBetweenCorrespondingCurves(bvector< CurveVectorPtr > const &contours, bool capped)
Add ruled mesh between each pair of successive contours.
FacetParamMode GetParamMode() const
Get the ParamMode facet control.
bool GetSmoothTriangleFlowRequired() const
Get the SmoothTriangleFlow facet control.
void FindOrAddParams(bvector< DPoint2d > &param, size_t n, size_t numWrap, bvector< size_t > &index)
Find or add n indices. Return the n indices plus numWrap additional wraparounds.
void SetCurvatureWeightFactor(double value)
Set the CurvatureWeightFactor facet control.
#define BEGIN_BENTLEY_GEOMETRY_NAMESPACE
Definition: Bentley.r.h:29
struct DPoint3d const & DPoint3dCR
Definition: msgeomstructs_typedefs.h:79
double GetSilhouetteToleranceDivisor() const
Get the SilhouetteToleranceDivisor facet control.
static IFacetOptionsPtr Create()
Return a (smart pointer) implementation of the interface, with tolerances set for typical surfaces...
void SetDoSpatialLaplaceSmoothing(bool value)
Set the SmoothTriangleFlow facet control – bspline surfaces only. A true unqualified SetSmoothTriang...
void SetReverseNewNormals(bool reverse)
Set the current normal vector reversal state.
bool GetNormalsRequired() const
Get the NormalsRequired facet control.
PolyfaceConstruction(IFacetOptionsR options)
Prefered construction object ...
bool NeedNormals()
Ask if normals are needed.
double GetMaxEdgeLength() const
Get the MaxEdgeLength facet control.
bool SetLocalToWorld(TransformCR transform)
Set the local to world transform.
void AddParamIndexFan(size_t centerIndex, bvector< size_t > &index, size_t numChord, bool reverse)
Add parameter triangles from a center index to edges of a polyline.
struct DVec3d const & DVec3dCR
Definition: msgeomstructs_typedefs.h:89
void AddRuled(DEllipse3dR ellipse0, DEllipse3dR ellipse1, bool cap)
Add ruled facets between ellipses.
Facet parameters are (as best as possible) physical distances.
Definition: FacetOptions.h:24
void ToggleIndexOrderAndNormalReversal()
Toggle both index order and normal.
bool GetReverseNewNormals() const
Get the current normal vector reversal state.
void SetParamDistanceScale(double paramDistanceScale)
Set the ParamDistanceScale facet control.
struct DgnSphereDetail const & DgnSphereDetailCR
Definition: msgeomstructs_typedefs.h:198
struct DPoint2d const * DPoint2dCP
Definition: msgeomstructs_typedefs.h:78
struct DPoint4d const * DPoint4dCP
Definition: msgeomstructs_typedefs.h:96
void CollectCurrentFaceRanges()
Collect point, param, and normal range data in the current face.
void SetFaceData(FacetFaceDataCR data)
Set the current face data.
void AddRotationalSweepLoop(bvector< DPoint3d > &pointA, bvector< DVec3d > &tangentA, DPoint3dCR center, DVec3dCR rotationAxis, double totalSweepRadians, bool reverse, double nominalBaseCurveLength, bvector< DPoint3d > *startCapPointAccumulator, bvector< DPoint3d > *endCapPointAccumulator)
Make a Rotational sweep from base points.
void SetHideSmoothEdgesWhenGeneratingNormals(bool hideSmoothEdgesWhenGeneratingNormals)
Set whether smooth edges between facets are marked as hidden when normals are genereted for a polyfac...
bool GetDoSpatialLaplaceSmoothing() const
Get the SmoothTriangleFlow facet control – bspline surfaces only.
bool PopState()
Pop the current transform and revesal state.
bool GetCombineFacets() const
Get the CombineFacets facet control.
void SetSilhouetteType(int silhouetteType)
Set the SilhouetteType facet control.
int GetMaxPerBezier() const
Get the MaxPerBezier facet control.
DVec3d GetSilhouetteDirection() const
Get the SilhouetteDirection facet control.
bool GetVertexColorsRequired() const
Get the VertexColorsRequired facet control.
void InitializeCurrentConstructionState()
Clear the current construction state, but leave the stack unchanged.
double GetToleranceDistanceScale() const
Get the ToleranceDistanceScale facet control.
void SetMaxPerBezier(int maxPerBezier)
Set the MaxPerBezier facet control.
void SetSilhouetteDirection(DVec3d silhouetteDirection)
Set the SilhouetteDirection facet control.
void SetParamsRequired(bool paramsRequired)
Set the ParamsRequired facet control.
Facet parameters are 0 to 1 in each direction.
Definition: FacetOptions.h:20
size_t AddPointIndexQuad(size_t index0, bool visible0, size_t index1, bool visible1, size_t index2, bool visible2, size_t index3, bool visible3)
Add a quad to the point index table. Return the (0-based) position in the PointIndex array...
void AddTriangulationPair(bvector< DPoint3d > &pointA, bool reverseA, bvector< DPoint3d > &pointB, bool reverseB)
AddTriangulation on 2 sets of points, optionally reversing each.
size_t AddColorIndexTriangle(size_t index0, size_t index1, size_t index2)
Add a triangle to the color index table. Return the (0-based) position in the ColorIndex array...

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