Public Types | Public Member Functions | Static Public Member Functions | List of all members

A CurveVector is a collection of curve primitives. More...

#include <CurveVector.h>

Inheritance diagram for CurveVector:
bvector< ICurvePrimitivePtr >

Public Types

enum  BoundaryType {
  BOUNDARY_TYPE_None = 0, BOUNDARY_TYPE_Open = 1, BOUNDARY_TYPE_Outer = 2, BOUNDARY_TYPE_Inner = 3,
  BOUNDARY_TYPE_ParityRegion = 4, BOUNDARY_TYPE_UnionRegion = 5
}
 Classification of expected structure within a CurveVector. More...
 
enum  InOutClassification { INOUT_Unknown = 0, INOUT_In = 1, INOUT_Out = 2, INOUT_On = 3 }
 Classification of a point wrt a closed shape. More...
 
- Public Types inherited from bvector< ICurvePrimitivePtr >
typedef ICurvePrimitivePtr value_type
 
typedef _Allocator allocator_type
 
typedef allocator_type::size_type size_type
 
typedef
allocator_type::difference_type 
difference_type
 
typedef allocator_type::reference reference
 
typedef
allocator_type::const_reference 
const_reference
 
typedef allocator_type::pointer pointer
 
typedef
allocator_type::const_pointer 
const_pointer
 
typedef
BC__RW::__rw_debug_iter
< bvector, pointer, pointer
iterator
 
typedef
BC__RW::__rw_debug_iter
< bvector, const_pointer,
pointer
const_iterator
 
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
 
typedef std::reverse_iterator
< iterator
reverse_iterator
 

Public Member Functions

ICurvePrimitive::CurvePrimitiveType HasSingleCurvePrimitive () const
 Return true if the curve vector has a single element and that element is a primitive. More...
 
BoundaryType GetBoundaryType () const
 Return the type code indicating whether the vector is a path, outer boundary, inner boundary, or higher level grouping. More...
 
bool IsOpenPath () const
 Query: Is this an open path? More...
 
bool IsClosedPath () const
 Query: Is this (single) closed path? More...
 
bool IsParityRegion () const
 Query: Is this a collection of loops with parity rules? More...
 
bool IsUnionRegion () const
 Query: is this a collection of areas with union rules? More...
 
bool IsAnyRegionType () const
 Query: is this any closed area type (single, parity, union) More...
 
bool AreStartEndAlmostEqual () const
 Query: Does this have start and end points and are the points almost equal? More...
 
bool IsEllipticDisk (DEllipse3dR ellipse) const
 Query: Is this an outer loop with an ellipse as its only curve? More...
 
bool IsPhysicallyClosedPath () const
 Query: Is this a nominally open path but with matching start and end? More...
 
bool IsRectangle (TransformR localToWorld, TransformR worldToLocal) const
 Query: Is this a rectangle? More...
 
bool SwapAt (size_t index0, size_t index1)
 Swap the entries at given indices. Return false if either index is out of bounds. More...
 
void SwapContents (CurveVectorR other)
 Swap bvectors and type. More...
 
CurveVectorPtr Clone () const
 Return a "deep copy". More...
 
CurveVectorPtr CloneDereferenced (bool allowExtrapolation=false, bool maximumDeref=true) const
 Return a "deep copy" with PartialCurve primitives replaced by full curves. More...
 
CurveVectorPtr CloneWithFillets (double radius) const
 return a (deep) clone with fillets inserted between successive curves. More...
 
CurveVectorPtr CloneWithGapsClosed (CurveGapOptionsCR options) const
 return a (deep) clone with endpoint gaps closed. More...
 
size_t AddPrimitives (CurveVectorCR source)
 recurse through source. append all leaf primitives to this. Return number added. More...
 
void Add (ICurvePrimitivePtr child)
 add single curve primitive More...
 
void Add (CurveVectorPtr child)
 wrap as child curve primitive and add to this vector More...
 
CurveVectorPtr CloneWithBlends (BlendType, double radiusA, double radiusB) const
 return a (deep) clone with fillets inserted between successive curves. More...
 
CurveVectorPtr CloneOffsetCurvesXY (CurveOffsetOptionsCR options)
 return a (deep) clone with all curves offset by signed distance. More...
 
CurveVectorPtr AreaOffset (CurveOffsetOptionsCR options) const
 return a (deep) clone with all areas increased or decreased according to the offset distance. More...
 
size_t CountPrimitivesOfType (ICurvePrimitive::CurvePrimitiveType targetType) const
 Count primitives of specified type. More...
 
CurveVectorPtr CloneWithSplits (CurveVectorCR splitterCurves, bool primitivesOnly=false)
 Return a curve vector that is a clone, but with all primitives split at intersections with any splitter curve. More...
 
void AppendSplitCurvesByRegion (CurveVectorCR region, CurveVectorP insideCollector, CurveVectorP outsideCollector, CurveVectorP onCollector)
 Return curves (not regions) that are inside, outside, or on a region. More...
 
void AppendSplitCurvesByPlane (DPlane3dCR plane, CurveVectorP belowCollector, CurveVectorP aboveCollector, CurveVectorP onCollector)
 Return curves (not regions) that are below, above, and on a plane. More...
 
CurveVectorPtr CloneWithExplodedLinestrings () const
 Return a curve vector that is a clone, but with all polylines split into individual line segments. More...
 
bool WireCentroid (double &length, DPoint3dR centroid) const
 Return the centroid of the contained curves, considered as wires. More...
 
bool CentroidNormalArea (DPoint3dR centroid, DVec3dR normal, double &area) const
 Return the centroid, normal and area of the curve vector. More...
 
bool ComputeSecondMomentAreaProducts (DMatrix4dR products) const
 Return the area, centroid, orientation, and principal moments, treating this as a thin planar sheet. More...
 
bool ComputeSecondMomentDifferentialAreaRotationProducts (DRay3dCR rotationAxis, TransformR rotationToWorld, DMatrix4dR products) const
 Return the moment products [xx,xy,xz,xw; etc] of the area as a differential rotational slice. More...
 
bool ComputeSecondMomentDifferentialWireRotationProducts (DRay3dCR rotationAxis, TransformR rotationToWorld, DMatrix4dR products) const
 Return the moment products [xx,xy,xz,xw; etc] of the wire as a differential rotational contribution. More...
 
bool ComputeSecondMomentWireProducts (DMatrix4dR products) const
 Return the area, centroid, orientation, and principal moments, treating this as a wire. More...
 
bool CentroidAreaXY (DPoint3dR centroid, double &area) const
 Return the centroid and area of the curve vector as viewed in the xy plane. More...
 
DRange1d ProjectedParameterRange (DRay3dCR ray) const
 Return the range of ray parameters when contents of the CurveVector are projected to a ray. More...
 
CurveVectorPtr CloneInLocalCoordinates (LocalCoordinateSelect frameType, TransformR localToWorld, TransformR worldToLocal, DRange3dR localRange) const
 Return curve copy and transforms for a local coordinate system related to the curves. More...
 
bool GetAnyFrenetFrame (TransformR frame) const
 Deep search for any curve primitive that has a well defined coordinate frame. More...
 
bool GetAnyFrenetFrame (TransformR frame, int searchPreference) const
 Deep search for any curve primitive that has a well defined coordinate frame. More...
 
bool TryUVFractionToXYZ (double uFraction, double vFraction, DPoint3dR xyz, DVec3dR dXdu, DVec3dR dXdv) const
 convert u,v fraction to xyz and derivatives. More...
 
CurveVectorPtr CloneAsBsplines () const
 Return a "deep copy" with primitives replaced by bsplines The tree upper levels of the tree structure are retained – i.e. More...
 
CurveVectorPtr Stroke (IFacetOptionsR options) const
 Return a "deep copy" with primitives replaced by strokes. More...
 
void AddStrokePoints (bvector< DPoint3d > &points, IFacetOptionsR options) const
 Add stroke points form all children to output. More...
 
bool CollectLinearGeometry (bvector< bvector< bvector< DPoint3d >>> &regionsPoints) const
 Add all strokes from the structure. More...
 
bool AddSpacedPoints (bvector< double > const &distances, bvector< CurveLocationDetail > &locations) const
 Compute points at (many) specified distances along the (many) curves in the CurveVector. More...
 
BentleyStatus ToBsplineCurve (MSBsplineCurveR curve) const
 Represent a curve vector that denotes an open or closed path as a single bspline curve. More...
 
MSBsplineCurvePtr GetBsplineCurve () const
 Represent a curve vector that denotes an open or closed path as a single bspline curve. More...
 
bool ClosestPointBounded (DPoint3dCR spacePoint, CurveLocationDetailR location) const
 Search for the closest point on any contained curve. More...
 
bool ClosestPointBounded (DPoint3dCR spacePoint, CurveLocationDetailR location, bool extend0, bool extend1) const
 Search for the closest point on any contained curve. More...
 
bool ClosestPointBoundedXY (DPoint3dCR spacePoint, DMatrix4dCP worldToLocal, CurveLocationDetailR location) const
 Search for the closest point on any contained curve, using only xy (viewed) coordinates. More...
 
bool ClosestPointBoundedXY (DPoint3dCR spacePoint, DMatrix4dCP worldToLocal, CurveLocationDetailR location, bool extend0, bool extend1) const
 Search for the closest point on any contained curve, using only xy (viewed) coordinates, optionally allowing extensions from free ends of lines and arcs. More...
 
CurveVector::InOutClassification ClosestCurveOrRegionPoint (DPoint3dCR spacePoint, DPoint3dR curveOrRegionPoint) const
 Search for closest point on curve. More...
 
void AnnounceKeyPoints (DPoint3dCR spacePoint, CurveKeyPointCollector &collector, bool extend0, bool extend1) const
 Search for various keypoints (as requested by the collector) During recursion, extension bits are changed to false for interior points of paths. More...
 
bool GetStartEnd (DPoint3dR pointA, DPoint3dR pointB) const
 Return first/last among children. More...
 
bool GetStartEnd (DPoint3dR pointA, DPoint3dR pointB, DVec3dR unitTangentA, DVec3dR unitTangentB) const
 Return start and end points and the (normalized!) tangents among children. More...
 
bool GetStartPoint (DPoint3dR point) const
 Return start point of the primitive (or first primitive in deep search) More...
 
double Length () const
 Sum lengths of contained curves. More...
 
double Length (RotMatrixCP worldToLocal) const
 Sum lengths of contained curves with transform applied. More...
 
double FastLength () const
 Sum lengths of contained curves, using fast method that may overestimate the length but is reasonable for setting tolerances. More...
 
double MaxGapWithinPath () const
 Maximum gap distance between end of primitive and start of its successor within Open, outer, or Inner loop. More...
 
double FastMaxAbs () const
 Return a fast estimate of the maximum absoluted value in any coordinate. This will examine all curves, but is allowed to use safe approximations like bspline pole coordinates instead of exact curve calculations. More...
 
bool IsSameStructure (CurveVectorCR other) const
 Recursive check for structural match (tree structure and leaf type) with the other curve vector. More...
 
bool IsSameStructureAndGeometry (CurveVectorCR other, double tolerance=0.0) const
 Recursive check for match (tree structure. More...
 
bool GetRange (DRange3dR range) const
 Return the xyz range of contained curves. More...
 
bool GetRange (DRange3dR range, TransformCR transform) const
 Compute range of transformed structure. More...
 
bool IsPlanar (TransformR localToWorld, TransformR worldToLocal, DRange3dR range) const
 Test if the contained curves are planar. More...
 
bool IsPlanarWithDefaultNormal (TransformR localToWorld, TransformR worldToLocal, DRange3dR range, DVec3dCP normal) const
 Test if the contained curves are planar. More...
 
size_t CyclicIndex (int index) const
 return mod of index with vector length, properly corrected for negatives. More...
 
ICurvePrimitivePtr GetCyclic (ptrdiff_t index) const
 return child at cyclic index, propertly corrected for negatives. More...
 
size_t CurveLocationDetailIndex (CurveLocationDetail const &location) const
 return index of curve location detail in vector (only valid for a vector that is a single open or closed path). More...
 
size_t FindIndexOfPrimitive (ICurvePrimitiveCP primitive) const
 return index of primitive in vector (only valid for a vector that is a single open or closed path). More...
 
CurveVectorPtr FindParentOfPrimitive (ICurvePrimitiveCP primitive) const
 Search the tree (below the calling instance) for the curve vector which is the immediate parent of given primitive. More...
 
int CurveLocationDetailCompare (CurveLocationDetail const &location0, CurveLocationDetail const &location1) const
 return 0 of locations are equal, -1 if location 0 is less than location 1, and 1 if location 0 > location 1. More...
 
double ResolveTolerance (double tolerance) const
 return larger of given tolerance and default tolerance based on FastMasAbs of contents ... More...
 
void FindPrimitivesWithNearbyStartEnd (bvector< CurveLocationDetail > &data, DPoint3dCR xyz, double tolerance) const
 Search for children whose start or end is close to a search point. More...
 
CurveVectorPtr CloneBetweenCyclicIndexedFractions (int index0, double fraction0, int index1, double fraction1) const
 Return a new vector containing curves from index0,fraction0 to index1,fraction1 with the (signed int!!) indices interpretted cyclically. More...
 
CurveVectorPtr CloneBetweenDirectedFractions (int index0, double fraction0, int index1, double fraction1, bool allowExtrapolation) const
 Return a new vector containing curves from index0,fraction0 to index1,fraction1 with the (signed int!!) indices restricted to array bounds. More...
 
CurveVectorPtr CloneReversed () const
 Return a new curve vector that has all components reversed. More...
 
CurveVectorPtr GenerateAllParts (int indexA, double fractionA, int indexB, double fractionB) const
 Return a CurveVector (BOUNDARY_TYPE_None) which is a collection of open CurveVectors that collectively contain all parts of the input For (indexA,fractionA) prededing (indexB,fractionB) the output traces the input in the forward direction and has the following possibilities (of which null ones are skipped) ul> li> BOUNDARY_TYPE_Open - (A B), (B to end), (start to A) li> BOUNDARY_TYPE_Inner or BOUNDARY_TYPE_Outer - (A B), (B to where A appears in the next period) li> BOUNDARY_TYPE_ParityRegion, BOUNDARY_TYPE_UnionRegion, BOUNDARY_TYPE_None – no output. More...
 
bool ContainsNonLinearPrimitive () const
 Return true if CurveVector has a component that is not a line or linestring. More...
 
void AppendCurvePlaneIntersections (DPlane3dCR plane, bvector< CurveLocationDetailPair > &intersections, double tolerance=0.0) const
 Compute simple points of intersection of the curve with a plane. More...
 
bool AppendClosedCurvePlaneIntersections (DPlane3dCR plane, bvector< CurveLocationDetailPair > &intersections, double tolerance=0.0) const
 Compute intersections of closed CurveVector with a plane and organize as start end pairs by parity rules. More...
 
ICurvePrimitivePtr PlaneSection (DPlane3dCR plane, double tolerance=0.0) const
 Compute intersections of closed CurveVector with a plane and organize as start end pairs by parity rules. More...
 
CurveVector::InOutClassification PointInOnOutXY (DPoint3dCR xyz) const
 Test if a point is in, on, or outside when looking at xy plane. More...
 
CurveVector::InOutClassification RayPierceInOnOut (DRay3dCR ray, SolidLocationDetailR hitDetail) const
 Test for a ray hit in the curve vector's planar region. More...
 
bool TransformInPlace (TransformCR transform)
 Apply a transform to all contained curves. More...
 
bool ReverseCurvesInPlace ()
 Recursively reverse. More...
 
void ConsolidateAdjacentPrimitives ()
 Inplace update to consolidate contiguous parts. More...
 
void ConsolidateAdjacentPrimitives (bool doSimplifyLinestrings)
 Inplace update to consolidate contiguous parts. More...
 
void SimplifyLinestrings (double distanceTol, bool eliminateOverdraw, bool wrap)
 Inplace update to consolidate colinear interior points of linestrings. More...
 
bool FixupXYOuterInner (bool fullGeometryCheck=false)
 Update order, boundary type, and direction of contained loops. More...
 
double ReorderForSmallGaps ()
 Reorder curve primitives to produce small head-to-tail gaps. More...
 
CurveVectorPtr AssembleChains ()
 Join curve primitives head to tail. More...
 
- Public Member Functions inherited from bvector< ICurvePrimitivePtr >
iterator _C_make_iter (pointer __ptr)
 
const_iterator _C_make_iter (pointer __ptr) const
 
 bvector (const allocator_type &__alloc=allocator_type())
 
 bvector (size_type __n, const_reference __x=value_type(), const allocator_type &__alloc=allocator_type())
 
 bvector (_InputIter __first, _InputIter __last, const allocator_type &__alloc=allocator_type())
 
 bvector (const bvector &__rhs)
 
 bvector (bvector &&rhs)
 
bvectoroperator= (bvector &&rhs)
 
bvectoroperator= (const bvector &)
 
 ~bvector ()
 
void assign (_InputIter __first, _InputIter __last)
 
void assign (size_type __n, const_reference __x)
 
allocator_type get_allocator () const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
size_type size () const
 
size_type max_size () const
 
void resize (size_type, value_type=value_type())
 
size_type capacity () const
 
bool empty () const
 
void reserve (size_type)
 
reference operator[] (size_type)
 
const_reference operator[] (size_type) const
 
reference at (size_type)
 
const_reference at (size_type __n) const
 
reference front ()
 
const_reference front () const
 
pointer data ()
 
const_pointer data () const
 
reference back ()
 
const_reference back () const
 
void push_back (const_reference)
 
void pop_back ()
 
iterator insert (iterator, const_reference)
 
void insert (iterator __it, _InputIter __first, _InputIter __last)
 
void insert (iterator __it, size_type __n, const_reference __x)
 
iterator erase (iterator)
 
iterator erase (iterator, iterator)
 
void swap (bvector &)
 
void clear ()
 

Static Public Member Functions

static CurveVectorPtr Create (BoundaryType boundaryType)
 Create a curve vector with given boundary type and no members. More...
 
static CurveVectorPtr Create (BoundaryType boundaryType, ICurvePrimitivePtr primitive)
 Create a curve vector with a single primitive and given boundary type. More...
 
static CurveVectorPtr CreateLinear (bvector< DPoint3d > const &points, BoundaryType boundaryType=CurveVector::BOUNDARY_TYPE_Open, bool forceXYOrientation=false)
 Create a linestring or polygon from xyz data. More...
 
static CurveVectorPtr CreateLinear (DPoint3dCP points, size_t numPoints, BoundaryType boundaryType=CurveVector::BOUNDARY_TYPE_Open, bool forceXYOrientation=false)
 Create a linestring or polygon from xyz data. More...
 
static CurveVectorPtr CreateLinear (DPoint2dCP points, size_t numPoints, BoundaryType boundaryType=CurveVector::BOUNDARY_TYPE_Open, bool forceXYOrientation=false)
 Create a linestring or polygon from xyz data. More...
 
static CurveVectorPtr CreateRectangle (double x0, double y0, double x1, double y1, double z, BoundaryType boundaryType=CurveVector::BOUNDARY_TYPE_Outer)
 Create a rectangle from xy corners. More...
 
static CurveVectorPtr Create (bvector< DSegment3d > const &segments)
 Create a BOUNDARY_TYPE_None with line segments. More...
 
static CurveVectorPtr CreateDisk (DEllipse3dCR arc, BoundaryType boundaryType=CurveVector::BOUNDARY_TYPE_Outer, bool forceXYOrientation=false)
 Create a (deep) curve vector structure for a complete elliptic (circular) disk. More...
 
static CurveVectorPtr Create (ICurvePrimitivePtr child, BoundaryType boundaryType=CurveVector::BOUNDARY_TYPE_Open)
 Create a single level curve vector structure with a single primitive. More...
 
static CurveVectorPtr AreaUnion (CurveVectorCR regionA, CurveVectorCR regionB, CurvePrimitivePtrPairVector *newToOld=NULL)
 Return a curve vector containing the union of input areas. More...
 
static CurveVectorPtr AreaDifference (CurveVectorCR regionA, CurveVectorCR regionB, CurvePrimitivePtrPairVector *newToOld=NULL)
 Return a curve vector containing the difference of input areas. More...
 
static CurveVectorPtr AreaIntersection (CurveVectorCR regionA, CurveVectorCR regionB, CurvePrimitivePtrPairVector *newToOld=NULL)
 Return a curve vector containing the intersection of input areas. More...
 
static CurveVectorPtr AreaParity (CurveVectorCR regionA, CurveVectorCR regionB, CurvePrimitivePtrPairVector *newToOld=NULL)
 Return a curve vector containing the parity of input areas. More...
 
static CurveVectorPtr AreaAnalysis (CurveVectorCR region, AreaSelect select1, BoolSelect select2, bool reverse)
 Return a curve vector containing the "inside" areas by various conditions. More...
 
static CurveVectorPtr ReduceToCCWAreas (CurveVectorCR regionA)
 Return a curve vector containing only clockwise areas. More...
 
static CurveVectorPtr CreateXYHatch (CurveVectorCR boundary, DPoint3dCR startPoint, double angleRadians, double spacing, int selection=0)
 Return a curve vector (of type BOUNDARY_TYPE_None) containing hatch sticks. More...
 
static CurveVectorPtr CreateSpiralLineToLineShift (int transitionType, DPoint3dCR pointA, DPoint3dCR shoulderB, DPoint3dCR shoulderC, DPoint3dCR pointD)
 Return a curveVector with spiral transition between two lines, with shoulder points controlling the spiral max curvatures. More...
 
static CurveVectorPtr ConstructSpiralArcSpiralTransition (DPoint3dCR xyz0, DPoint3dCR xyz1, DPoint3dCR xyz2, double arcRadius, double spiralLength)
 Return a curveVector with spiral-arc-spiral transtion between two lines, subject to: ul> li>specified arcRadiius for central part li>specified spiralLength for both entry and exit. More...
 
static CurveVectorPtr ConstructSpiralArcSpiralTransitionPseudoOffset (DPoint3dCR primaryPoint0, DPoint3dCR primaryPoint1, DPoint3dCR primaryPoint2, double primaryRadius, double primarySpiralLength, double offsetDistance)
 Construct a spiral-arc-spiral transition that is an (approximate) offset of a primary transition. More...
 

Detailed Description

A CurveVector is a collection of curve primitives.

The collection has a type code that indicates whether it acts as an open chain, single loop (inner or outer), or a parent of multiple loops.

This can represent paths, loops, multiloop parity regions, and multi-region collections.

A CurveVector is a refcounted structure. At point of creation, a curve vector is addressed via a CurveVectorPtr. Inputs to methods can be passed as simple references and pointers.

Example tree structures for CurveVector

Parity Regions

A parity region is a collection of unordered loops. A point moving in the plane transitions from "in" to "out" (or vice versa) any time it crosses a curve.

This definition of inside and outside is well defined even if ( a) the loops cross each other, ( b) self-intersection within a loop, ( c) any order of presentation of the loops.

In the usual case wheret here is a single outer loop and one or more hole loops, it is customary to store the outer loop first followed by holes, with the outer loop counterclockwise and inner loops clockwise.

Warning: Computational code that requires signed loops (e.g. area calculations) assumes that the largest loop is outer and others are inner.

Member Enumeration Documentation

Classification of expected structure within a CurveVector.

Enumerator
BOUNDARY_TYPE_None 

no specific properties expected for contained curves or points.

Remarks
Use of BOUNDARY_TYPE_None is discouraged for representing anything except point strings and RSC font glyphs. Do not create a CurveVector of BOUNDARY_TYPE_None and expect it to be treated as anything more than a collection of disjoint ICurvePrimitives. A collection of un-related curves are better represented as a bvector of CurveVectorPtr and not as a single CurveVector of BOUNDARY_TYPE_None.
BOUNDARY_TYPE_Open 

Curves should join head to tail in a single path. The path is not expected to be closed.

BOUNDARY_TYPE_Outer 

Curves should join head to tail in a single closed path; this area expected to be an outer (or only) loop.

BOUNDARY_TYPE_Inner 

Curves should join head to tail in a single closed path; this area is expected to be an inner loop.

BOUNDARY_TYPE_ParityRegion 

Expected to contain (only) multiple CurveVectors, all of which are either BOUNDARY_TYPE_Open or BOUNDARY_TYPE_inner.

(No individual curves or open paths). These are to be analyzed by partity rules.

BOUNDARY_TYPE_UnionRegion 

Expected to contain (only) multiple CurveVectors, all of which have area.

(No individual curves or open paths). These are to be analyzed by union rules.

Classification of a point wrt a closed shape.

Enumerator
INOUT_Unknown 
INOUT_In 
INOUT_Out 
INOUT_On 

Member Function Documentation

void Add ( ICurvePrimitivePtr  child)

add single curve primitive

void Add ( CurveVectorPtr  child)

wrap as child curve primitive and add to this vector

size_t AddPrimitives ( CurveVectorCR  source)

recurse through source. append all leaf primitives to this. Return number added.

bool AddSpacedPoints ( bvector< double > const &  distances,
bvector< CurveLocationDetail > &  locations 
) const

Compute points at (many) specified distances along the (many) curves in the CurveVector.

Intervals between successive distances can "jump" from one curve to the next. If curves to not connect head to tail, the gap is NOT filled – measurement just picks up after the gap.

Parameters
[in]distancesvector of distances, all measured from the start of the first primitive.
[out]locationsvector of locations. (This is NOT cleared at start – points are just added.)
void AddStrokePoints ( bvector< DPoint3d > &  points,
IFacetOptionsR  options 
) const

Add stroke points form all children to output.

Strokes from all children are concatenated into the same vector, separated only by DISCONNECT points. Use Stroke() to get structured strokes.

Parameters
[in,out]pointsgrowing vector of strokes.
[in]optionsoptiosn for stroke density. chordTolerance, angleTolerance, and maxEdgeLength will be used.
void AnnounceKeyPoints ( DPoint3dCR  spacePoint,
CurveKeyPointCollector collector,
bool  extend0,
bool  extend1 
) const

Search for various keypoints (as requested by the collector) During recursion, extension bits are changed to false for interior points of paths.

Parameters
[in]spacePointpoint to project
[in]collectorobject to receive keypoint announcements
[in]extend0true to extend from start.
[in]extend1true to extend from end.
bool AppendClosedCurvePlaneIntersections ( DPlane3dCR  plane,
bvector< CurveLocationDetailPair > &  intersections,
double  tolerance = 0.0 
) const

Compute intersections of closed CurveVector with a plane and organize as start end pairs by parity rules.

Intersectoins are reported as CurveLocationDetailPairs for start and end of segments.

Parameters
[in]plane
[out]intersectionsintersection details
[in]tolerancefor on-plane decisions. If 0, a tolerance is computed based on the coordinates in the curve.
void AppendCurvePlaneIntersections ( DPlane3dCR  plane,
bvector< CurveLocationDetailPair > &  intersections,
double  tolerance = 0.0 
) const

Compute simple points of intersection of the curve with a plane.

Single point intersection appears as a CurveLocationDetailPair with identical locations for both parts of the pair (SameCurveAndFraction) Curve-on-plane appears as CurveLocationDetailPair with curve,fraction data for start and end of on-plane sections.

Parameters
[in]plane
[out]intersectionsintersection details
[in]tolerancefor on-plane decisions. If 0, a tolerance is computed based on the coordinates in the curve.
void AppendSplitCurvesByPlane ( DPlane3dCR  plane,
CurveVectorP  belowCollector,
CurveVectorP  aboveCollector,
CurveVectorP  onCollector 
)

Return curves (not regions) that are below, above, and on a plane.

void AppendSplitCurvesByRegion ( CurveVectorCR  region,
CurveVectorP  insideCollector,
CurveVectorP  outsideCollector,
CurveVectorP  onCollector 
)

Return curves (not regions) that are inside, outside, or on a region.

static CurveVectorPtr AreaAnalysis ( CurveVectorCR  region,
AreaSelect  select1,
BoolSelect  select2,
bool  reverse 
)
static

Return a curve vector containing the "inside" areas by various conditions.

Parameters
[in]regionRegion that may have loops back over its area.
[in]select1Rule for classifying single area: one of AreaSelect_Parity, AreaSelect_CCWPositiveWindingNumber, AreaSelect_CCWNonzeroWindingNumber, AreaSelect_CCWNegativeWindingNumber
[in]select2Rule for combining leaf left results: One of BoolSelect_Parity, BoolSelect_Union, BoolSelect_Sum_Parity, BoolSelect_CCWPositiveWindingNumber, BoolSelect_CCWNonzeroWindingNumber, BoolSelect_CCWNegativeWindingNumber
[in]reverseto return the opposite set of faces.
static CurveVectorPtr AreaDifference ( CurveVectorCR  regionA,
CurveVectorCR  regionB,
CurvePrimitivePtrPairVector newToOld = NULL 
)
static

Return a curve vector containing the difference of input areas.

Parameters
[in]regionAleft operand
[in]regionBright operand
[in,out]newToOld(optional) pointer to bvector to receive paring of new and old curves.
static CurveVectorPtr AreaIntersection ( CurveVectorCR  regionA,
CurveVectorCR  regionB,
CurvePrimitivePtrPairVector newToOld = NULL 
)
static

Return a curve vector containing the intersection of input areas.

Parameters
[in]regionAleft operand
[in]regionBright operand
[in,out]newToOld(optional) pointer to bvector to receive paring of new and old curves.
CurveVectorPtr AreaOffset ( CurveOffsetOptionsCR  options) const

return a (deep) clone with all areas increased or decreased according to the offset distance.

Remarks
A positive offset is to the right of the curve (i.e. CCW outer loop offsets to a larger area)
static CurveVectorPtr AreaParity ( CurveVectorCR  regionA,
CurveVectorCR  regionB,
CurvePrimitivePtrPairVector newToOld = NULL 
)
static

Return a curve vector containing the parity of input areas.

Parameters
[in]regionAleft operand
[in]regionBright operand
[in,out]newToOld(optional) pointer to bvector to receive paring of new and old curves.
static CurveVectorPtr AreaUnion ( CurveVectorCR  regionA,
CurveVectorCR  regionB,
CurvePrimitivePtrPairVector newToOld = NULL 
)
static

Return a curve vector containing the union of input areas.

Parameters
[in]regionAleft operand
[in]regionBright operand
[in,out]newToOld(optional) pointer to bvector to receive paring of new and old curves.
bool AreStartEndAlmostEqual ( ) const

Query: Does this have start and end points and are the points almost equal?

CurveVectorPtr AssembleChains ( )

Join curve primitives head to tail.

Return a top level BOUNDARY_TYPE_None containing the various BOUNDARY_TYPE_Open and BOUNDARY_TYPE_Outer

bool CentroidAreaXY ( DPoint3dR  centroid,
double &  area 
) const

Return the centroid and area of the curve vector as viewed in the xy plane.

return false if the CurveVector is not one of the area types (union region, parity region, or closed loop)

Remarks
Union region moments are the simple sum of constituents (i.e overlap is not determined)
Parity region moments are signed sum per area, assuming largest is outer and all others are inner (subtractive)
Parameters
[out]centroidcurve centroid
[out]areaarea of region.
bool CentroidNormalArea ( DPoint3dR  centroid,
DVec3dR  normal,
double &  area 
) const

Return the centroid, normal and area of the curve vector.

return false if the CurveVector is not one of the area types (union region, parity region, or closed loop)

Remarks
Union region moments are the simple sum of constituents (i.e overlap is not determined)
Parity region moments are signed sum per area, assuming largest is outer and all others are inner (subtractive)
If curves are non-planar, the centroid and normal are approximations with no particular guarantees.
Parameters
[out]centroidcurve centroid
[out]normalcurve normal
[out]areaarea of region.
CurveVectorPtr Clone ( ) const

Return a "deep copy".

CurveVectorPtr CloneAsBsplines ( ) const

Return a "deep copy" with primitives replaced by bsplines The tree upper levels of the tree structure are retained – i.e.

the output contains corresponding tree structure ParityRegion, UnionRegion, OuterLoop, and InnerLoop ul> li>UnionRegion and ParityRegion vectors: Create a new CurveVector of the same type. Recursively create children. li>OuterLoop, InnerLoop, OpenPath: Create a new curve vector of the same type. li>Primitives: Each primtitive is copied as a bspline curve primitive. /ul>

CurveVectorPtr CloneBetweenCyclicIndexedFractions ( int  index0,
double  fraction0,
int  index1,
double  fraction1 
) const

Return a new vector containing curves from index0,fraction0 to index1,fraction1 with the (signed int!!) indices interpretted cyclically.

CurveVectorPtr CloneBetweenDirectedFractions ( int  index0,
double  fraction0,
int  index1,
double  fraction1,
bool  allowExtrapolation 
) const

Return a new vector containing curves from index0,fraction0 to index1,fraction1 with the (signed int!!) indices restricted to array bounds.

CurveVectorPtr CloneDereferenced ( bool  allowExtrapolation = false,
bool  maximumDeref = true 
) const

Return a "deep copy" with PartialCurve primitives replaced by full curves.

Parameters
[in]maximumDereftrue to recurse through all steps of PartialCurve chains
[in]allowExtrapolationtrue to allow extension before/after endpoints.
CurveVectorPtr CloneInLocalCoordinates ( LocalCoordinateSelect  frameType,
TransformR  localToWorld,
TransformR  worldToLocal,
DRange3dR  localRange 
) const

Return curve copy and transforms for a local coordinate system related to the curves.

The local x and y axes are parallel to the x and y axes of the frenet frame at the curve start.

Returns
curves transformed to local system.
Parameters
[out]localToWorldlocal to world transform
[out]worldToLocalworldTolocal transform
[out]localRangecurve vector range in the local frame.
[in]frameTypeSelects how the geometry size is represented in the scale. ul> li>LOCAL_COORDINATE_SCALE_UnitAxesAtStart – x,y,z columns in the transform are unit vectors. localRange values are true geometry sizes. origin is at start point of first primitive. li>LOCAL_COORDINATE_SCALE_UnitAxesAtLowerLeft – x,y,z columns in the transform are unit vectors. localRange values are true geometry sizes. origin is at lower left of range. li>LOCAL_COORDINATE_SCALE_01RangeBothAxes – x column is a vector spanning the x range from min to max. y column is a vector spanning the y range from min to max. localRange values are 0..1 (inclusive) in both directions. origin is at lower left of range. li>LOCAL_COORDINATE_SCALE_01RangeLargerAxis – x and y columns have the same length, large enough to span the larger direction. localRange values are 0..1 in the larger direction, 0..f in the smaller direction, where f is that direction's size as a fraction of the larger direction. origin is at lower left of range. /ul>
CurveVectorPtr CloneOffsetCurvesXY ( CurveOffsetOptionsCR  options)

return a (deep) clone with all curves offset by signed distance.

This is a curve operation, and may result in self-intersecting offset curves.

Remarks
A positive offset is to the right of the curve (i.e. CCW outer loop offsets to a larger area)
CurveVectorPtr CloneReversed ( ) const

Return a new curve vector that has all components reversed.

CurveVectorPtr CloneWithBlends ( BlendType  ,
double  radiusA,
double  radiusB 
) const

return a (deep) clone with fillets inserted between successive curves.

CurveVectorPtr CloneWithExplodedLinestrings ( ) const

Return a curve vector that is a clone, but with all polylines split into individual line segments.

CurveVectorPtr CloneWithFillets ( double  radius) const

return a (deep) clone with fillets inserted between successive curves.

CurveVectorPtr CloneWithGapsClosed ( CurveGapOptionsCR  options) const

return a (deep) clone with endpoint gaps closed.

When gaps are found larger than gapTolerance, line segments are added. The options that will be used are: 1) options.SetEqualPointTolerance(value): Gaps smaller than this are acceptable. This Suggested value: around 1e-7 in master units. 2) options.SetMaxDirectAdjustTolerance: gaps this small may be closed by directly moving endopints of lines or linestrings. SuggestedValue: 10 to 1000 times the equal point tolerance 3) options.SetRemovePriorGapPrimitives(true): primitives marked as gaps are purged. (And the gaps are re-closed) Suggested value: true. (default is true) 4) options.SetMaxAdjustAlongPrimitive: points may move this far if the final point is on the extended element.

CurveVectorPtr CloneWithSplits ( CurveVectorCR  splitterCurves,
bool  primitivesOnly = false 
)

Return a curve vector that is a clone, but with all primitives split at intersections with any splitter curve.

Optionally omit tree structure and only copy primitives.

CurveVector::InOutClassification ClosestCurveOrRegionPoint ( DPoint3dCR  spacePoint,
DPoint3dR  curveOrRegionPoint 
) const

Search for closest point on curve.

If CV is a region type, also look for projection onto interior of the region.

Parameters
[in]spacePointfixed point of search
[out]curveOrRegionPointcomputed point on curve or region interior.
Returns
INOUT_On if the point is a curve point. INOUT_In if the point is a projection to the region interior. INOUT_Unknown for empty curve vector.
bool ClosestPointBounded ( DPoint3dCR  spacePoint,
CurveLocationDetailR  location 
) const

Search for the closest point on any contained curve.

bool ClosestPointBounded ( DPoint3dCR  spacePoint,
CurveLocationDetailR  location,
bool  extend0,
bool  extend1 
) const

Search for the closest point on any contained curve.

bool ClosestPointBoundedXY ( DPoint3dCR  spacePoint,
DMatrix4dCP  worldToLocal,
CurveLocationDetailR  location 
) const

Search for the closest point on any contained curve, using only xy (viewed) coordinates.

bool ClosestPointBoundedXY ( DPoint3dCR  spacePoint,
DMatrix4dCP  worldToLocal,
CurveLocationDetailR  location,
bool  extend0,
bool  extend1 
) const

Search for the closest point on any contained curve, using only xy (viewed) coordinates, optionally allowing extensions from free ends of lines and arcs.

bool CollectLinearGeometry ( bvector< bvector< bvector< DPoint3d >>> &  regionsPoints) const

Add all strokes from the structure.

This is intended to be called on structures with only lines and linestrings. The outer curve vector may be a single loop, parity region, or union region. AddLinearLoops recurses The regionsPoints[i] is an array of loops. regionsPoints[i][j] is loop j of regionsPoints[i].

Returns
false if unexpected structure – e.g. curves. — was encountered.
bool ComputeSecondMomentAreaProducts ( DMatrix4dR  products) const

Return the area, centroid, orientation, and principal moments, treating this as a thin planar sheet.

Parameters
[out]productsintegrated [xx xy xz x; xy yy yz y; xz yz zz z; x y z 1] dA
bool ComputeSecondMomentDifferentialAreaRotationProducts ( DRay3dCR  rotationAxis,
TransformR  rotationToWorld,
DMatrix4dR  products 
) const

Return the moment products [xx,xy,xz,xw; etc] of the area as a differential rotational slice.

Parameters
[in]rotationAxisthe origin and z axis of the rotation.
[out]rotationToWorldtransformation from rotation system (origin on rotation axis) to world. The products are base don local coordinates in the system.
[out]productsproducts in the rotation system.
Returns
false if invalid area for rotational sweep.
bool ComputeSecondMomentDifferentialWireRotationProducts ( DRay3dCR  rotationAxis,
TransformR  rotationToWorld,
DMatrix4dR  products 
) const

Return the moment products [xx,xy,xz,xw; etc] of the wire as a differential rotational contribution.

Parameters
[in]rotationAxisthe origin and z axis of the rotation.
[out]rotationToWorldtransformation from rotation system (origin on rotation axis) to world. The products are base don local coordinates in the system.
[out]productsproducts in the rotation system.
Returns
false if invalid area for rotational sweep.
bool ComputeSecondMomentWireProducts ( DMatrix4dR  products) const

Return the area, centroid, orientation, and principal moments, treating this as a wire.

Parameters
[out]productsintegrated [xx xy xz x; xy yy yz y; xz yz zz z; x y z 1] dA
void ConsolidateAdjacentPrimitives ( )

Inplace update to consolidate contiguous parts.

Adjacent lines and linestrings become a single linestring. Interior colinear points of linestrings are eliminated. Adjacent and compatible arcs become single arc.

void ConsolidateAdjacentPrimitives ( bool  doSimplifyLinestrings)

Inplace update to consolidate contiguous parts.

Adjacent lines and linestrings become a single linestring. Adjacent and compatible arcs become single arc.

Parameters
[in]doSimplifyLinestringstrue to eliminate colinear interior points of linestrings.
static CurveVectorPtr ConstructSpiralArcSpiralTransition ( DPoint3dCR  xyz0,
DPoint3dCR  xyz1,
DPoint3dCR  xyz2,
double  arcRadius,
double  spiralLength 
)
static

Return a curveVector with spiral-arc-spiral transtion between two lines, subject to: ul> li>specified arcRadiius for central part li>specified spiralLength for both entry and exit.

li>the spiral-to-line tangency can float along the respective straight line parts /ul>

Parameters
[in]xyz0PI prior to this transition
[in]xyz1PI for this transition
[in]xyz2PI after this transition
[in]arcRadiusradius of arc portion
[in]spiralLengthlength of spiral
static CurveVectorPtr ConstructSpiralArcSpiralTransitionPseudoOffset ( DPoint3dCR  primaryPoint0,
DPoint3dCR  primaryPoint1,
DPoint3dCR  primaryPoint2,
double  primaryRadius,
double  primarySpiralLength,
double  offsetDistance 
)
static

Construct a spiral-arc-spiral transition that is an (approximate) offset of a primary transition.

ul> li>The offset is a constructSpiralArcSpiralTransition for a simple offset of the 3 point alignments. li>The radius differs from the primaryRadius by (exactly) offsetDistance. li>The spiral length is adjusted so that the tangency point for the line-to-spiral is exactly at the offset of the corresponding line-spiral li>specified spiralLength for both entry and exit. li>the spiral-to-line tangency can float along the respective straight line parts li>offsets at all distances maintain the spiral-arc-spiral structure. Because the true "rolling ball" offset of a spiral is not a spiral, the result is only an approximation of a true "rolling ball" offset. /ul>

Parameters
[in]primaryPoint0primary path PI prior to this transition
[in]primaryPoint1primary path PI for this transition
[in]primaryPoint2primary path PI after this transition
[in]primaryRadiusradius of primary path
[in]primarySpiralLengthprimary path spiral length
[in]offsetDistanceoffset distance. Positive is to the left of the primary path
bool ContainsNonLinearPrimitive ( ) const

Return true if CurveVector has a component that is not a line or linestring.

size_t CountPrimitivesOfType ( ICurvePrimitive::CurvePrimitiveType  targetType) const

Count primitives of specified type.

Parameters
[in]targetTypeprimitive type to count.
static CurveVectorPtr Create ( BoundaryType  boundaryType)
static

Create a curve vector with given boundary type and no members.

static CurveVectorPtr Create ( BoundaryType  boundaryType,
ICurvePrimitivePtr  primitive 
)
static

Create a curve vector with a single primitive and given boundary type.

static CurveVectorPtr Create ( bvector< DSegment3d > const &  segments)
static

Create a BOUNDARY_TYPE_None with line segments.

static CurveVectorPtr Create ( ICurvePrimitivePtr  child,
BoundaryType  boundaryType = CurveVector::BOUNDARY_TYPE_Open 
)
static

Create a single level curve vector structure with a single primitive.

Parameters
[in]childchild primitive.
[in]boundaryType
static CurveVectorPtr CreateDisk ( DEllipse3dCR  arc,
BoundaryType  boundaryType = CurveVector::BOUNDARY_TYPE_Outer,
bool  forceXYOrientation = false 
)
static

Create a (deep) curve vector structure for a complete elliptic (circular) disk.

Parameters
[in]arcboundary ellipse
[in]boundaryTypeis one of
  • BOUNDARY_TYPE_Outer: force to counterclockwise and positive area as seen looking at xy plane.
  • BOUNDARY_TYPE_Inner: force to clockwise and negative area as seen looking at xy plane.
  • BOUNDARY_TYPE_Open, BOUNDARY_TYPE_None: ellipse inserted with its own direction.
  • BOUNDARY_TYPE_UnionRegion, BOUNDARY_TYPE_ParityRegion create two-level structure with arc at second level with BOUNDARY_TYPE_Outer
[in]forceXYOrientationif true, reverse arc sweep so it acts as requested inner/outer in xy view.
static CurveVectorPtr CreateLinear ( bvector< DPoint3d > const &  points,
BoundaryType  boundaryType = CurveVector::BOUNDARY_TYPE_Open,
bool  forceXYOrientation = false 
)
static

Create a linestring or polygon from xyz data.

Parameters
[in]pointsvertex coordinates points.
[in]boundaryTypeis one of
  • BOUNDARY_TYPE_Outer, or BOUNDARY_TYPE_INNER: Duplication forced on first/last point. Orientation optionally enforced.
  • BOUNDARY_TYPE_Open, BOUNDARY_TYPE_None: points copied unchanged.
  • BOUNDARY_TYPE_UnionRegion, BOUNDARY_TYPE_ParityRegion create two-level structure with polygonat second level with BOUNDARY_TYPE_Outer.
[in]forceXYOrientationtrue to force outer and inner loops to have correct (CCW/CW) order.
static CurveVectorPtr CreateLinear ( DPoint3dCP  points,
size_t  numPoints,
BoundaryType  boundaryType = CurveVector::BOUNDARY_TYPE_Open,
bool  forceXYOrientation = false 
)
static

Create a linestring or polygon from xyz data.

Parameters
[in]pointsvertex coordinates points.
[in]numPointsnumber of coordinates.
[in]boundaryTypeis one of
  • BOUNDARY_TYPE_Outer, or BOUNDARY_TYPE_INNER: Duplication forced on first/last point. Orientation optionally enforced.
  • BOUNDARY_TYPE_Open, BOUNDARY_TYPE_None: points copied unchanged.
  • BOUNDARY_TYPE_UnionRegion, BOUNDARY_TYPE_ParityRegion create two-level structure with polygonat second level with BOUNDARY_TYPE_Outer.
[in]forceXYOrientationtrue to force outer and inner loops to have correct (CCW/CW) order.
static CurveVectorPtr CreateLinear ( DPoint2dCP  points,
size_t  numPoints,
BoundaryType  boundaryType = CurveVector::BOUNDARY_TYPE_Open,
bool  forceXYOrientation = false 
)
static

Create a linestring or polygon from xyz data.

Parameters
[in]pointsvertex coordinates points.
[in]numPointsnumber of coordinates.
[in]boundaryTypeis one of
  • BOUNDARY_TYPE_Outer, or BOUNDARY_TYPE_INNER: Duplication forced on first/last point. Orientation optionally enforced.
  • BOUNDARY_TYPE_Open, BOUNDARY_TYPE_None: points copied unchanged.
  • BOUNDARY_TYPE_UnionRegion, BOUNDARY_TYPE_ParityRegion create two-level structure with polygonat second level with BOUNDARY_TYPE_Outer.
[in]forceXYOrientationtrue to force outer and inner loops to have correct (CCW/CW) order.
static CurveVectorPtr CreateRectangle ( double  x0,
double  y0,
double  x1,
double  y1,
double  z,
BoundaryType  boundaryType = CurveVector::BOUNDARY_TYPE_Outer 
)
static

Create a rectangle from xy corners.

Parameters
[in]x0start point x coordinate
[in]y0start point y coordinate
[in]x1opposite corner x coordinate
[in]y1opposite corner y coordinate
[in]zz value for all points.
[in]boundaryTypeis one of
  • BOUNDARY_TYPE_Outer: force to counterclockwise and positive area
  • BOUNDARY_TYPE_Inner: force to clockwise and negative area
  • BOUNDARY_TYPE_Open, BOUNDARY_TYPE_None: point order (x0,y0)(x1,y0),(x1,y1),(x0,y1)
  • BOUNDARY_TYPE_UnionRegion, BOUNDARY_TYPE_ParityRegion create two-level structure with rectangle at second level with BOUNDARY_TYPE_Outer
static CurveVectorPtr CreateSpiralLineToLineShift ( int  transitionType,
DPoint3dCR  pointA,
DPoint3dCR  shoulderB,
DPoint3dCR  shoulderC,
DPoint3dCR  pointD 
)
static

Return a curveVector with spiral transition between two lines, with shoulder points controlling the spiral max curvatures.

ul> li>Initial spiral starts at pointA, heading towards shoulderB with zero curvature. li>initial spiral turns towards shoulderC. li>initial spiral ends and has curvature-continuous change to a spiral unwinding to a tangency with line shoulderB to shoulderC li>straight line along shoulderB to shoulderC until li>second pair of spirals to transition to pointD with tangent to the direction from shoulderC to pointD /ul>

If pointA,shoulderB, shoulderC is degnerate (all colinear), the initial spiral pair is omitted and the intermediate line starts at pointA. If shoulderB, shoulderC,pointD is degenerate (all colinear), the final spiral pair is omitted and the intermediate line ends at pointD.

Parameters
[in]transitionTypetransition type
[in]pointAstart point
[in]shoulderBfirst target point
[in]shoulderCsecond target point
[in]pointDend point
static CurveVectorPtr CreateXYHatch ( CurveVectorCR  boundary,
DPoint3dCR  startPoint,
double  angleRadians,
double  spacing,
int  selection = 0 
)
static

Return a curve vector (of type BOUNDARY_TYPE_None) containing hatch sticks.

Parameters
[in]boundaryboundary curves.
[in]startPointStart point for hatch lines
[in]angleRadiansangle from X axis.
[in]spacingspacing perpendicular to hatch direction
selection0 for parity rules, 1 for longest possible strokes (first to last crossings), 2 for leftmsot and rightmost of parity set.
int CurveLocationDetailCompare ( CurveLocationDetail const &  location0,
CurveLocationDetail const &  location1 
) const

return 0 of locations are equal, -1 if location 0 is less than location 1, and 1 if location 0 > location 1.

This is a lexical comparison using (only) the curve index and the fraction.

size_t CurveLocationDetailIndex ( CurveLocationDetail const &  location) const

return index of curve location detail in vector (only valid for a vector that is a single open or closed path).

Returns SIZE_MAX if not found.

size_t CyclicIndex ( int  index) const

return mod of index with vector length, properly corrected for negatives.

double FastLength ( ) const

Sum lengths of contained curves, using fast method that may overestimate the length but is reasonable for setting tolerances.

double FastMaxAbs ( ) const

Return a fast estimate of the maximum absoluted value in any coordinate. This will examine all curves, but is allowed to use safe approximations like bspline pole coordinates instead of exact curve calculations.

size_t FindIndexOfPrimitive ( ICurvePrimitiveCP  primitive) const

return index of primitive in vector (only valid for a vector that is a single open or closed path).

Returns SIZE_MAX if not found.

CurveVectorPtr FindParentOfPrimitive ( ICurvePrimitiveCP  primitive) const

Search the tree (below the calling instance) for the curve vector which is the immediate parent of given primitive.

void FindPrimitivesWithNearbyStartEnd ( bvector< CurveLocationDetail > &  data,
DPoint3dCR  xyz,
double  tolerance 
) const

Search for children whose start or end is close to a search point.

Parameters
[out]dataarray recording index, fraction (0 or 1), coordinate, and distance of start or end within tolerance
[in]xyzsearch point
[in]tolerancedistance tolerance
bool FixupXYOuterInner ( bool  fullGeometryCheck = false)

Update order, boundary type, and direction of contained loops.

Loop A is considered "inside" loop B if (a) loop A has smaller area and (b) the start point of loop A is inside loop B. A loop that is "inside" and ODD number of other loops is considered to be a "hole" (inner loop) within the containing loop that has smallest area. Any other loop is considered an outer loop.

  • If there is a single outer loop, the (modified) curve vector is marked as a parity region. The outer loop is moved first and the inner loops follows.
  • If there are mulitple outer loops, the (modified) curve vector is marked as a union region. Within the UnionRegion
    • Outer loops with no contained loops are present as simple Outer loops.
    • Outer loops with holes are parity regions.
Parameters
[in]fullGeometryCheckif true, perform all (expensive) tests for intersections among curves. When this is enabled, the returned curve vector is typically a (possibly significantly modfied) clone of the original.
CurveVectorPtr GenerateAllParts ( int  indexA,
double  fractionA,
int  indexB,
double  fractionB 
) const

Return a CurveVector (BOUNDARY_TYPE_None) which is a collection of open CurveVectors that collectively contain all parts of the input For (indexA,fractionA) prededing (indexB,fractionB) the output traces the input in the forward direction and has the following possibilities (of which null ones are skipped) ul> li> BOUNDARY_TYPE_Open - (A B), (B to end), (start to A) li> BOUNDARY_TYPE_Inner or BOUNDARY_TYPE_Outer - (A B), (B to where A appears in the next period) li> BOUNDARY_TYPE_ParityRegion, BOUNDARY_TYPE_UnionRegion, BOUNDARY_TYPE_None – no output.

/ul> For (indexA,fractionA) prededing (indexB,fractionB) the output traces the input in the reverse direction and has the following possibilities (of which null ones are skipped) ul> li> BOUNDARY_TYPE_Open - (A backwards to B), (B backwards to start), (end backwards to A) li> BOUNDARY_TYPE_Inner or BOUNDARY_TYPE_Outer - (A backwards to B), (B backwards to where A appears in the previous period.) li> BOUNDARY_TYPE_ParityRegion, BOUNDARY_TYPE_UnionRegion, BOUNDARY_TYPE_None – no output. /ul>

bool GetAnyFrenetFrame ( TransformR  frame) const

Deep search for any curve primitive that has a well defined coordinate frame.

Parameters
[out]framecoordinate frame with origin on a primitive.
Returns
true if a primitive was found.
bool GetAnyFrenetFrame ( TransformR  frame,
int  searchPreference 
) const

Deep search for any curve primitive that has a well defined coordinate frame.

Parameters
[out]framecoordinate frame with origin on a primitive.
[in]searchPreferencepre> ul> li>0 to favor use of directions as soon as possible from the begninning. li>1 to use start point, start tangent, and end tangent and accept that "no matter what" (i.e. accept default fixups if those are parallel) li>2 to use start point, start tangent, and end tangent but default to searchPreference=0 if they are parallel. /ul> /pre>
Returns
true if a primitive was found.
BoundaryType GetBoundaryType ( ) const

Return the type code indicating whether the vector is a path, outer boundary, inner boundary, or higher level grouping.

MSBsplineCurvePtr GetBsplineCurve ( ) const

Represent a curve vector that denotes an open or closed path as a single bspline curve.

ICurvePrimitivePtr GetCyclic ( ptrdiff_t  index) const

return child at cyclic index, propertly corrected for negatives.

bool GetRange ( DRange3dR  range) const

Return the xyz range of contained curves.

bool GetRange ( DRange3dR  range,
TransformCR  transform 
) const

Compute range of transformed structure.

Parameters
[out]transformtransform to target coordinates
[out]rangerange of transformed curve.
Returns
true if range computed.
bool GetStartEnd ( DPoint3dR  pointA,
DPoint3dR  pointB 
) const

Return first/last among children.

Parameters
[out]pointAstart point
[out]pointBend point
bool GetStartEnd ( DPoint3dR  pointA,
DPoint3dR  pointB,
DVec3dR  unitTangentA,
DVec3dR  unitTangentB 
) const

Return start and end points and the (normalized!) tangents among children.

Parameters
[out]pointAstart point
[out]pointBend point
[out]unitTangentAnormalized tangent (forward) at pointA.
[out]unitTangentBnormalized tangent (forward) at pointB.
bool GetStartPoint ( DPoint3dR  point) const

Return start point of the primitive (or first primitive in deep search)

Parameters
[out]pointstart point.
ICurvePrimitive::CurvePrimitiveType HasSingleCurvePrimitive ( ) const

Return true if the curve vector has a single element and that element is a primitive.

bool IsAnyRegionType ( ) const

Query: is this any closed area type (single, parity, union)

bool IsClosedPath ( ) const

Query: Is this (single) closed path?

bool IsEllipticDisk ( DEllipse3dR  ellipse) const

Query: Is this an outer loop with an ellipse as its only curve?

bool IsOpenPath ( ) const

Query: Is this an open path?

bool IsParityRegion ( ) const

Query: Is this a collection of loops with parity rules?

bool IsPhysicallyClosedPath ( ) const

Query: Is this a nominally open path but with matching start and end?

bool IsPlanar ( TransformR  localToWorld,
TransformR  worldToLocal,
DRange3dR  range 
) const

Test if the contained curves are planar.

If so, return transforms transforms and local range.

Parameters
[out]localToWorldA coordinate frame somewhere on the curves. The curves are on the xy plane.
[out]worldToLocalInverse of localToWorld.
[out]rangerange of the curves when worldToLocal is applied.
Returns
true if range is computed and has small z component.
Remarks
returns true (planar!!) for a single line. Test the local range with IsAlmostZeroY to identify this condition.
bool IsPlanarWithDefaultNormal ( TransformR  localToWorld,
TransformR  worldToLocal,
DRange3dR  range,
DVec3dCP  normal 
) const

Test if the contained curves are planar.

If so, return transforms transforms and local range.

Parameters
[out]localToWorldA coordinate frame somewhere on the curves. The curves are on the xy plane.
[out]worldToLocalInverse of localToWorld.
[out]rangerange of the curves when worldToLocal is applied.
[in]normaloptional normal to resolve ambiguous cases. If this is NULL, any perpendicular to an ambiguous line will be used.
Returns
true if range is computed and has small z component.
bool IsRectangle ( TransformR  localToWorld,
TransformR  worldToLocal 
) const

Query: Is this a rectangle?

Parameters
[out]localToWorldtransform with origin at start, x and y vectors to adjacent points, z vector unit normal. (i.e. the x and y vector lengths are the side lengths)
[out]worldToLocaltransorm to map rectangle to 0..1 in each direction.
bool IsSameStructure ( CurveVectorCR  other) const

Recursive check for structural match (tree structure and leaf type) with the other curve vector.

bool IsSameStructureAndGeometry ( CurveVectorCR  other,
double  tolerance = 0.0 
) const

Recursive check for match (tree structure.

leaf type, and geometry) with a peer.

Parameters
otherpeer for comparison
tolerancedistance tolerance. (See DoubleOps::AlmostEqual ())
bool IsUnionRegion ( ) const

Query: is this a collection of areas with union rules?

double Length ( ) const

Sum lengths of contained curves.

double Length ( RotMatrixCP  worldToLocal) const

Sum lengths of contained curves with transform applied.

double MaxGapWithinPath ( ) const

Maximum gap distance between end of primitive and start of its successor within Open, outer, or Inner loop.

ICurvePrimitivePtr PlaneSection ( DPlane3dCR  plane,
double  tolerance = 0.0 
) const

Compute intersections of closed CurveVector with a plane and organize as start end pairs by parity rules.

Return as a single curve primitive (which may be child vector of multiple primitives) If there are no intersections the smart pointer is empty (IsValid () returns false)

Parameters
[in]plane
[in]tolerancefor on-plane decisions. If 0, a tolerance is computed based on the coordinates in the curve.
CurveVector::InOutClassification PointInOnOutXY ( DPoint3dCR  xyz) const

Test if a point is in, on, or outside when looking at xy plane.

return INOUT_Unknown if the CurveVector is not an area. (i.e. type BOUNDARY_TYPE_Outer, BOUNDARY_TYPE_Inner, BOUNDARY_TYPE_ParityRegion, or BOUNDARY_TYPE_Union

Parameters
[in]xyztest point
DRange1d ProjectedParameterRange ( DRay3dCR  ray) const

Return the range of ray parameters when contents of the CurveVector are projected to a ray.

return DRange1d with range data.

Parameters
[in]raytest ray.
Remarks
If the ray's direction vector is a unit vector, the projected parameters are physical distances.
If the ray's direction vector is NOT a unit vector, the projected parameters are fractions of the ray's direction vector.
If the CurveVector has no curves, the returned range returns true on the DRange1d::IsNull() predicate.
CurveVector::InOutClassification RayPierceInOnOut ( DRay3dCR  ray,
SolidLocationDetailR  hitDetail 
) const

Test for a ray hit in the curve vector's planar region.

return INOUT_Unknown if the CurveVector is not an area. (i.e. type BOUNDARY_TYPE_Outer, BOUNDARY_TYPE_Inner, BOUNDARY_TYPE_ParityRegion, or BOUNDARY_TYPE_Union

Parameters
[in]rayray to intersect witht the region
[out]hitDetailhit point with parameters relative to the region's local coordinates.
static CurveVectorPtr ReduceToCCWAreas ( CurveVectorCR  regionA)
static

Return a curve vector containing only clockwise areas.

Loops within parity regions are fixed first. Then multiple regions in a union are combined.

Parameters
[in]regionAinput areas
double ReorderForSmallGaps ( )

Reorder curve primitives to produce small head-to-tail gaps.

reordering is applied only within boundary types None, Open, and Closed. other types are updated recursively. Return the largest gap.

double ResolveTolerance ( double  tolerance) const

return larger of given tolerance and default tolerance based on FastMasAbs of contents ...

bool ReverseCurvesInPlace ( )

Recursively reverse.

All leaf curves are reversed. Primitive order within path types (_Outer, _Inner, _Open) is reversed. All others (_Union, _Parity, _None) are unchanged.

void SimplifyLinestrings ( double  distanceTol,
bool  eliminateOverdraw,
bool  wrap 
)

Inplace update to consolidate colinear interior points of linestrings.

If distance tolerance is nonpositive a tolerance will be assigned from the range.

CurveVectorPtr Stroke ( IFacetOptionsR  options) const

Return a "deep copy" with primitives replaced by strokes.

The tree upper levels of the tree structure are retained – i.e. the output contains corresponding tree structure ParityRegion, UnionRegion, OuterLoop, and InnerLoop ul> li>UnionRegion and ParityRegion vectors: Create a new CurveVector of the same type. Recursively create children. li>OuterLoop, InnerLoop, OpenPath: Create a new curve vector of the same type. Stroke all curve primitives into a single linestring with the child curves' AddStrokes method. /ul>

bool SwapAt ( size_t  index0,
size_t  index1 
)

Swap the entries at given indices. Return false if either index is out of bounds.

void SwapContents ( CurveVectorR  other)

Swap bvectors and type.

BentleyStatus ToBsplineCurve ( MSBsplineCurveR  curve) const

Represent a curve vector that denotes an open or closed path as a single bspline curve.

bool TransformInPlace ( TransformCR  transform)

Apply a transform to all contained curves.

bool TryUVFractionToXYZ ( double  uFraction,
double  vFraction,
DPoint3dR  xyz,
DVec3dR  dXdu,
DVec3dR  dXdv 
) const

convert u,v fraction to xyz and derivatives.

This is an expensive operation. It has to call CloneInLocalCoordinates before it can multiply uv by the localToWorld transformation. To do this efficiently many times, call CloneInLocalCoordinates once and reuse the localToWorld transform.

Parameters
[in]uFractionfractional coordinate in u direction.
[in]vFractionfractional coordinate in v direction.
[out]xyzpoint on face.
[out]dXduderivative of face point wrt uFraction.
[out]dXdvderivative of face point wrt vFraction.
bool WireCentroid ( double &  length,
DPoint3dR  centroid 
) const

Return the centroid of the contained curves, considered as wires.

(Isolated points are not considered.) (Bounded area centroids are not computed. The boundary curves are used as wires.) return false if no curves are found.

Parameters
[out]lengthcurve length
[out]centroidcurve centroid

The documentation for this struct was generated from the following file:

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