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

ICurvePrimitive is a (polymorphic) base class for parametric curves – line segemnt, circular/elliptic arc, bspline curve, spiral. More...

#include <CurvePrimitive.h>

Inheritance diagram for ICurvePrimitive:

Public Types

enum  CurvePrimitiveType {
  CURVE_PRIMITIVE_TYPE_Invalid = 0, CURVE_PRIMITIVE_TYPE_Line = 1, CURVE_PRIMITIVE_TYPE_LineString = 2, CURVE_PRIMITIVE_TYPE_Arc = 3,
  CURVE_PRIMITIVE_TYPE_BsplineCurve = 4, CURVE_PRIMITIVE_TYPE_InterpolationCurve = 5, CURVE_PRIMITIVE_TYPE_AkimaCurve = 6, CURVE_PRIMITIVE_TYPE_PointString = 7,
  CURVE_PRIMITIVE_TYPE_CurveVector = 8, CURVE_PRIMITIVE_TYPE_Spiral = 9, CURVE_PRIMITIVE_TYPE_PartialCurve = 10, CURVE_PRIMITIVE_TYPE_NotClassified = -1
}
 Enumeration of possible curve primitive types. More...
 
enum  CurvePrimitiveMarkerBit { CURVE_PRIMITIVE_BIT_GapCurve = 0x00010000, CURVE_PRIMITIVE_BIT_AllApplicationBits = 0x0000FFFF }
 Bit mask for access to selective parts of an integer tag in each curve primitive. More...
 

Public Member Functions

bool GetMarkerBit (CurvePrimitiveMarkerBit selector) const
 Ask if specified marker bit is on or off. More...
 
void SetMarkerBit (CurvePrimitiveMarkerBit selector, bool value)
 Set the specified marker bit on or off. More...
 
int64_t GetTag () const
 Get the Int64 tag ... More...
 
int GetIntTag () const
 Get the Int64 tag (cast to int) More...
 
void SetTag (int64_t tag)
 Set the Int64 tag. More...
 
void SetTag (int tag)
 Set the Int64 tag from an int. More...
 
CurvePrimitiveIdCP GetId () const
 
CurvePrimitiveType GetCurvePrimitiveType () const
 Return the integer type code for the curve primitive type. More...
 
bool TryGetLine (DSegment3dR segment) const
 If this is a line primitive, copy its coordinate data to a DSegment3d. More...
 
bool TryGetArc (DEllipse3dR arc) const
 If this is a line primitive, copy its coordinate data to a DEllipse3d. More...
 
DSegment3dCP GetLineCP () const
 If this is a line primitive, return const pointer to its coordinate data. Otherwise return NULL. More...
 
bvector< DPoint3d > const * GetLineStringCP () const
 If this is a linestring primitive, return const pointer to its coordinate data array. Otherwise return null. More...
 
bool TryGetSegmentInLineString (DSegment3dR segment, size_t startPointIndex) const
 If this is a linestring and index is valid, get the (single) indexed segment. More...
 
bool TryAddLineStringPoint (DPoint3dCR xyz)
 If this is a linestring, add a point. More...
 
DEllipse3dCP GetArcCP () const
 If this is an arc primitive, return const pointer to its coordinate data. Otherwise return NULL. More...
 
MSBsplineCurveCP GetBsplineCurveCP () const
 If this is a bspline primtiive, return const pointer to its curve. Otherwise return NULL. More...
 
MSBsplineCurvePtr GetBsplineCurvePtr () const
 If this is a bspline primtiive, return ref counted pointer to its curve. Otherwise return NULL. More...
 
MSBsplineCurveCP GetProxyBsplineCurveCP () const
 If available, return a representative bspline curve. More...
 
MSBsplineCurvePtr GetProxyBsplineCurvePtr () const
 If available, return a(refcounted pointer to) a proxy bspline curve. More...
 
MSInterpolationCurveCP GetInterpolationCurveCP () const
 If this is an Interpolation curve, return const pointer to its coordinate data. Otherwise return NULL. More...
 
bvector< DPoint3d > const * GetAkimaCurveCP () const
 If this is an Akima curve, return const pointer to its array of fit points (with extra points at each end to control slope). More...
 
bvector< DPoint3d > const * GetPointStringCP () const
 If this is a point string, return const pointer to its point array. Otherwise return NULL. More...
 
CurveVectorCP GetChildCurveVectorCP () const
 If this is a carrier for a curve vector, return const pointer to the vector. Otherwise return NULL. More...
 
DSpiral2dPlacementCP GetSpiralPlacementCP () const
 If this is s a spiral placement return const pointer to its coordinate data. Otherwise return NULL. More...
 
PartialCurveDetailCP GetPartialCurveDetailCP () const
 If this is a reference to portion of another curve, return detail data. Otherwise return NULL. More...
 
bool TryGetPartialCurveData (double &fractionA, double &fractionB, ICurvePrimitivePtr &parentCurve, int64_t &tag) const
 If this is a reference to portion of another curve, return detail data. Otherwise return NULL. More...
 
ICurvePrimitivePtr Clone () const
 Return a deep copy. More...
 
ICurvePrimitivePtr CloneComponent (ptrdiff_t componentIndex) const
 Return a copy of a component. More...
 
ICurvePrimitivePtr CloneBetweenFractions (double fractionA, double fractionB, bool allowExtrapolation) const
 Return a copy of a subset. More...
 
ICurvePrimitivePtr CloneAsSingleOffsetPrimitiveXY (CurveOffsetOptionsCR options) const
 Return an offset primitive. More...
 
ICurvePrimitivePtr CloneDereferenced (bool allowExtrapolation=false, bool maximumDeref=true) const
 Return a (deep) clone with all partial curves replaced by complete curves. More...
 
bool FractionToPoint (double f, DPoint3dR point) const
 Evaluate curve fractional position within its parameter space. More...
 
bool FractionToPoint (double f, DPoint3dR point, DVec3dR tangent) const
 Evaluate curve fractional position within its parameter space. More...
 
bool FractionToPointWithTwoSidedDerivative (double f, DPoint3dR point, DVec3dR derivativeA, DVec3dR derivativeB) const
 Evaluate curve fractional position within its parameter space. More...
 
bool ComponentFractionToPoint (ptrdiff_t componentIndex, double f, DPoint3dR point) const
 Evaluate curve fractional position within the parameter space of a component. More...
 
bool ComponentFractionToPoint (ptrdiff_t componentIndex, double f, DPoint3dR point, DVec3dR tangent) const
 Evaluate curve fractional position within the parameter space of a component. More...
 
bool FractionToPoint (double f, DRay3dR ray) const
 Evaluate curve fractional position within its parameter space. More...
 
bool FractionToPoint (double f, CurveLocationDetail &detail) const
 Evaluate curve fractional position, and return as a CurveLocationDetail. More...
 
bool FractionToPoint (double f, DPoint3dR point, DVec3dR tangent, DVec3dR derivative2) const
 Evaluate curve point at fractional position within its parameter space. More...
 
bool FractionToPoint (double f, DPoint3dR point, DVec3dR tangent, DVec3dR derivative2, DVec3dR derivative3) const
 Evaluate curve point at fractional position within its parameter space. More...
 
bool FractionToFrenetFrame (double f, TransformR frame) const
 Evaluate curve point at fractional position within its parameter space. More...
 
bool Length (double &length) const
 Compute curve length. More...
 
bool Length (RotMatrixCP worldToLocal, double &length) const
 Compute curve length under effect of a RotMatrix. More...
 
bool FastLength (double &length) const
 Compute a fast approximation of curve length. More...
 
bool GetRange (DRange3dR range) const
 Return range of the primitive. More...
 
bool GetRange (DRange3dR range, TransformCR transform) const
 Return range of the primitive under a transform. More...
 
DRange1d ProjectedParameterRange (DRay3dCR ray, double fraction0, double fraction1) const
 Return the range the primitive projected onto a ray. More...
 
DRange1d ProjectedParameterRange (DRay3dCR ray) const
 Return the range the primitive projected onto a ray. More...
 
double FastMaxAbs () const
 Return a representative large coordinate. More...
 
bool IsSameStructure (ICurvePrimitiveCR other) const
 Recursive check for structural match (tree structure and leaf type) with the other curve primitive. More...
 
bool IsSameStructureAndGeometry (ICurvePrimitiveCR other, double tolerance=0.0) const
 Recursive check for match (tree structure. More...
 
size_t NumComponent () const
 Return the number of components that can be parameterized. More...
 
bool GetBreakFraction (size_t breakFractioniIndex, double &fraction) const
 Return the fractional postion of a point where the curve's continuity has a break. More...
 
bool AdjustFractionToBreakFraction (double fraction, Rounding::RoundingMode mode, size_t &breakIndex, double &adjustedFraction) const
 Move a fraction to the nearest break fraction. More...
 
bool GetMSBsplineCurve (MSBsplineCurveR curve, double fraction0=0.0, double fraction1=1.0) const
 Initialize an MSBsplineCurve form of the curve. More...
 
MSBsplineCurvePtr GetMSBsplineCurvePtr (double fraction0=0.0, double fraction1=1.0) const
 Initialize a (ref coutned) MSBsplineCurve form of the curve. More...
 
bool SignedDistanceBetweenFractions (double startFraction, double endFraction, double &signedDistance) const
 Return distance between fractions. More...
 
bool SignedDistanceBetweenFractions (RotMatrixCP worldToLocal, double startFraction, double endFraction, double &signedDistance) const
 Return distance between fractions. More...
 
bool PointAtSignedDistanceFromFraction (double startFraction, double signedDistance, bool allowExtension, CurveLocationDetailR location) const
 Attempt to move a specified distance from given fraction. More...
 
bool PointAtSignedDistanceFromFraction (RotMatrixCP worldToView, double startFraction, double signedDistance, bool allowExtension, CurveLocationDetailR location) const
 Attempt to move a specified distance from given fraction. More...
 
bool ClosestPointBounded (DPoint3dCR spacePoint, double &fraction, DPoint3dR curvePoint) const
 Find the closest point to a space point. 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 ClosestPointBounded (DPoint3dCR spacePoint, CurveLocationDetailR location, bool extend0, bool extend1) const
 Find the closest point to a space point. More...
 
bool ClosestPointBounded (DPoint3dCR spacePoint, CurveLocationDetailR location) const
 Find the closest point to a space point. More...
 
bool ClosestPointBoundedXY (DPoint3dCR spacePoint, DMatrix4dCP worldToLocal, CurveLocationDetailR location) const
 Find closest point, measuring in xy plane after applying a (possibly perspective) transform to both the curve and space point. More...
 
bool ClosestPointBoundedXY (DPoint3dCR spacePoint, DMatrix4dCP worldToLocal, CurveLocationDetailR location, bool extend0, bool extend1) const
 Find closest point, measuring in xy plane after applying a (possibly perspective) transform to both the curve and space point. More...
 
bool GetStartEnd (DPoint3dR pointA, DPoint3dR pointB) const
 return the start and end points of the curve More...
 
bool GetStartEnd (DPoint3dR pointA, DPoint3dR pointB, DVec3dR unitTangentA, DVec3dR unitTangentB) const
 return start and end points and the (normalized!) tangents. More...
 
bool GetStartPoint (DPoint3dR point) const
 Return first primitive in a deep search. More...
 
bool TrySetStart (DPoint3dCR xyz)
 Modify the start point if possible. More...
 
bool TrySetEnd (DPoint3dCR xyz)
 Modify the end point if possible. More...
 
bool IsExtensibleFractionSpace () const
 Test if fractional queries allow extension. When this is true, the CurvePrimitive recognizes fractions outside of 0..1. More...
 
bool IsMappableFractionSpace () const
 Test if cloned fractional intervals map linearly back to parent fractions. More...
 
bool IsFractionSpace () const
 Test if this is a curve (i.e. not a child vector or point string) More...
 
bool IsPeriodicFractionSpace (double &period) const
 Return true if the curve is part of a (possibly larger) periodic curve. More...
 
bool TransformInPlace (TransformCR transform)
 Transform in place. More...
 
bool ReverseCurvesInPlace ()
 reverse the parameterization in place. More...
 
void AppendCurvePlaneIntersections (DPlane3dCR plane, bvector< CurveLocationDetailPair > &intersections, double tolerance=0.0) const
 Return vector of intersections with a plane. More...
 
void AppendCurveRangeIntersections (LocalRangeCR range, bvector< PartialCurveDetail > &intersections) const
 Return intesections of curve primitive with a range box. More...
 
void AppendCurveBilinearPatchIntersections (DBilinearPatch3dCR patch, bvector< CurveAndSolidLocationDetail > &intersections) const
 Return intesections of curve primitive with a bilinear patch. More...
 
void AppendCurvePlaneIntersections (DPlane3dByVectorsCR plane, UVBoundarySelect bounded, bvector< CurveAndSolidLocationDetail > &intersections) const
 Return intesections of curve primitive with (the plane of) a triangle. More...
 
bool WireCentroid (double &length, DPoint3dR centroid, double fraction0=0.0, double fraction1=1.0) const
 Return the centroid of (a portion of) the curve. More...
 
bool AddStrokes (bvector< DPoint3d > &points, IFacetOptionsR options, bool includeStartPoint=true, double startFraction=0.0, double endFraction=1.0) const
 Stroke the curve and add points to the bvector. More...
 
size_t GetStrokeCount (IFacetOptionsR options, double startFraction=0.0, double endFraction=1.0) const
 Return the number of strokes needed to approximate this curve primitive. More...
 

Static Public Member Functions

static ICurvePrimitivePtr CreateLine (DSegment3dCR segment)
 Allocate and fill a new line segemnt. More...
 
static ICurvePrimitivePtr CreateLineString (DPoint3dCP points, size_t nPoints)
 Allocate and fill a new linestring. More...
 
static ICurvePrimitivePtr CreateLineString (bvector< DPoint3d > const &points)
 Allocate and fill a new linestring. More...
 
static ICurvePrimitivePtr CreateArc (DEllipse3dCR ellipse)
 Allocate and fill a new elliptic arc. More...
 
static ICurvePrimitivePtr CreateBsplineCurve (MSBsplineCurveCR curve)
 Allocate and fill a new bspline curve. More...
 
static ICurvePrimitivePtr CreateBsplineCurveSwapFromSource (MSBsplineCurveR curve)
 Allocate and fill a new bspline curve. More...
 
static ICurvePrimitivePtr CreateBsplineCurve (MSBsplineCurvePtr curve)
 Create curve primitive pointing to the same curve as the input. More...
 
static ICurvePrimitivePtr CreateInterpolationCurve (MSInterpolationCurveCR fitCurve)
 Allocate and fill a new interpolation curve. More...
 
static ICurvePrimitivePtr CreateInterpolationCurveSwapFromSource (MSInterpolationCurveR fitCurve)
 Allocate and fill a new interpolation curve. More...
 
static ICurvePrimitivePtr CreateAkimaCurve (DPoint3dCP points, size_t nPoints)
 Allocate and fill a new akima curve. More...
 
static ICurvePrimitivePtr CreatePointString (DPoint3dCP points, size_t nPoints)
 Allocate and fill a new point string. More...
 
static ICurvePrimitivePtr CreatePointString (bvector< DPoint3d > &points)
 Allocate and fill a new point string. More...
 
static ICurvePrimitivePtr CreateRectangle (double x0, double y0, double x1, double y1, double z, int areaSignPreference=0)
 Create a rectangle from xy corners. More...
 
static ICurvePrimitivePtr CreateSpiral (DSpiral2dBaseCR spiral, TransformCR frame, double fractionA, double fractionB)
 Allocate and fill a spiral curve. More...
 
static ICurvePrimitivePtr CreateSpiralBearingCurvatureBearingCurvature (int transitionType, double startRadians, double startCurvature, double endRadians, double endCurvature, TransformCR frame, double fractionA, double fractionB)
 Allocate and fill a spiral curve. More...
 
static ICurvePrimitivePtr CreateSpiralBearingRadiusBearingRadius (int transitionType, double startRadians, double startRadius, double endRadians, double endRadius, TransformCR frame, double fractionA, double fractionB)
 Allocate and fill a spiral curve. More...
 
static ICurvePrimitivePtr CreateSpiralBearingRadiusLengthRadius (int transitionType, double startRadians, double startRadius, double length, double endRadius, TransformCR frame, double fractionA, double fractionB)
 Allocate and fill a spiral curve. More...
 
static ICurvePrimitivePtr CreateSpiralBearingCurvatureLengthCurvature (int transitionType, double startRadians, double startCurvature, double length, double endCurvature, TransformCR frame, double fractionA, double fractionB)
 Allocate and fill a spiral curve. More...
 
static bool CreateSpiralsStartShoulderTarget (int transitionType, DPoint3dCR pointA, DPoint3dCR pointB, DPoint3dCR pointC, ICurvePrimitivePtr &primitiveA, ICurvePrimitivePtr &primitiveB)
 Create a pair of spirals that act like a "fillet" of a corner defined by start, shoulder and target. More...
 
static ICurvePrimitivePtr CreatePseudoSpiralPointBearingRadiusLengthRadius (int typeCode, DPoint3dCR startPoint, double startRadians, double radiusA, double lengthAB, double radiusB)
 Construct a spiral with start radius, spiral length, and end radius. More...
 
static ICurvePrimitivePtr CreatePartialCurve (ICurvePrimitiveP parentCurve, double fraction0, double fraction1, int64_t index=0)
 Allocate and fill a reference to a portion of a parent curve. More...
 
static ICurvePrimitivePtr CreateInterpolationBetweenCurves (ICurvePrimitiveCR curveA, double fraction, ICurvePrimitiveCR curveB)
 Create a curve that is interpolated between parents. More...
 
static ICurvePrimitivePtr CreateChildCurveVector (CurveVectorPtr source)
 Create a curve primitive with (ref coutnted pointer to preexisting refcounted child. More...
 
static ICurvePrimitivePtr CreateChildCurveVector_CopyFromSource (CurveVectorCR source)
 Create child vector, making deep copy of the source. More...
 
static ICurvePrimitivePtr CreateChildCurveVector_SwapFromSource (CurveVectorR source)
 Create a child vector; contents of source are taken, source itself is cleared. More...
 
static bool AddRuledSurfaceRayIntersections (bvector< struct SolidLocationDetail > &pickData, ICurvePrimitiveCR curveA, ICurvePrimitiveCR curveB, DRay3dCR ray)
 Compute intersections of a ray with a ruled surface between two primitves. More...
 

Detailed Description

ICurvePrimitive is a (polymorphic) base class for parametric curves – line segemnt, circular/elliptic arc, bspline curve, spiral.

An ICurvePrimitive is a refcounted structure. At point of creation, an instance is addressed via a ICurvePrimitivePtr. Inputs to methods can be passed as simple references and pointers.

Primitive type and queries

Each curve vector is marked with an enumerated value indicating how its contents are to be interpretted. The enumerated type can be accessed via cv.GetCurvePrimitiveType ().

enum name represents Remarks
CURVE_PRIMITIVE_TYPE_Invalid error type. Exists only at point of construction
CURVE_PRIMITIVE_TYPE_Line line segment Detail data is DSegment3d
CURVE_PRIMITIVE_TYPE_LineString polyline Detail data is bvector<DPoint3d>
CURVE_PRIMITIVE_TYPE_Arc elliptic arc Detail data is a DEllipse3d
CURVE_PRIMITIVE_TYPE_BsplineCurve bspline curve Detail data is MSBsplienCurve
CURVE_PRIMITIVE_TYPE_InterpolationCurve bspline curve with original interpolation points
CURVE_PRIMITIVE_TYPE_AkimaCurve C1 curve through points. This is a 1970s curve type with very poor smoothness properties.
CURVE_PRIMITIVE_TYPE_PointString unconnected points
CURVE_PRIMITIVE_TYPE_CurveVector placeholder for CurveVector
CURVE_PRIMITIVE_TYPE_Spiral Clothoid or other plane spiral section
CURVE_PRIMITIVE_TYPE_PartialCurve fractional portion of another curve
CURVE_PRIMITIVE_TYPE_NotClassified

Member Enumeration Documentation

Bit mask for access to selective parts of an integer tag in each curve primitive.

Enumerator
CURVE_PRIMITIVE_BIT_GapCurve 
CURVE_PRIMITIVE_BIT_AllApplicationBits 

Enumeration of possible curve primitive types.

Enumerator
CURVE_PRIMITIVE_TYPE_Invalid 
CURVE_PRIMITIVE_TYPE_Line 
CURVE_PRIMITIVE_TYPE_LineString 
CURVE_PRIMITIVE_TYPE_Arc 
CURVE_PRIMITIVE_TYPE_BsplineCurve 
CURVE_PRIMITIVE_TYPE_InterpolationCurve 
CURVE_PRIMITIVE_TYPE_AkimaCurve 
CURVE_PRIMITIVE_TYPE_PointString 
CURVE_PRIMITIVE_TYPE_CurveVector 
CURVE_PRIMITIVE_TYPE_Spiral 
CURVE_PRIMITIVE_TYPE_PartialCurve 
CURVE_PRIMITIVE_TYPE_NotClassified 

Member Function Documentation

static bool AddRuledSurfaceRayIntersections ( bvector< struct SolidLocationDetail > &  pickData,
ICurvePrimitiveCR  curveA,
ICurvePrimitiveCR  curveB,
DRay3dCR  ray 
)
static

Compute intersections of a ray with a ruled surface between two primitves.

Returns
false if primitives are not compatible
Parameters
[out]pickDataarray to receive picks
[in]curveAfirst curve
[in]curveBsecond curve
[in]rayray
bool AddStrokes ( bvector< DPoint3d > &  points,
IFacetOptionsR  options,
bool  includeStartPoint = true,
double  startFraction = 0.0,
double  endFraction = 1.0 
) const

Stroke the curve and add points to the bvector.

return true if this is a strokable primitive – Line, Arc, Bspline, Spiral, Akima, or partial curve. false for non-strokable – i.e. child vector or point vector.

Parameters
[in,out]pointsgrowing vector of strokes.
[in]optionsstroke tolerance.
[in]includeStartPointif false, do NOT put start point in the output.
[in]startFractionstart of partial curve interval.
[in]endFractionend of partial curve interval.
bool AdjustFractionToBreakFraction ( double  fraction,
Rounding::RoundingMode  mode,
size_t &  breakIndex,
double &  adjustedFraction 
) const

Move a fraction to the nearest break fraction.

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
extend0true to extend at start of primitives.
extend1true to extend at end of primitives.
void AppendCurveBilinearPatchIntersections ( DBilinearPatch3dCR  patch,
bvector< CurveAndSolidLocationDetail > &  intersections 
) const

Return intesections of curve primitive with a bilinear patch.

Parameters
[in]patchpatch to intersect
[out]intersectionsintersections
void AppendCurvePlaneIntersections ( DPlane3dCR  plane,
bvector< CurveLocationDetailPair > &  intersections,
double  tolerance = 0.0 
) const

Return vector of intersections 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 AppendCurvePlaneIntersections ( DPlane3dByVectorsCR  plane,
UVBoundarySelect  bounded,
bvector< CurveAndSolidLocationDetail > &  intersections 
) const

Return intesections of curve primitive with (the plane of) a triangle.

Parameters
[in]planeplane to intersect
[in]boundedselects Unbounded, Triangle, or Parallelogram boundaries.
[out]intersectionsintersections
void AppendCurveRangeIntersections ( LocalRangeCR  range,
bvector< PartialCurveDetail > &  intersections 
) const

Return intesections of curve primitive with a range box.

Parameters
[in]rangerange box
[out]intersectionsintersections
ICurvePrimitivePtr Clone ( ) const

Return a deep copy.

ICurvePrimitivePtr CloneAsSingleOffsetPrimitiveXY ( CurveOffsetOptionsCR  options) const

Return an offset primitive.

This operates only on single primtives that can offset to another single primitive.

Parameters
[in]optionscontains tolerance for bspline and ellipse offset.
ICurvePrimitivePtr CloneBetweenFractions ( double  fractionA,
double  fractionB,
bool  allowExtrapolation 
) const

Return a copy of a subset.

The fraction interval may be high to low; fraction clamping respects the interval direction. return null pointer if fraction clamping resulted in zero-length interval.

Parameters
[in]fractionAstart of returned invterval.
[in]fractionBend of returned interval.
[in]allowExtrapolationIf false, out of bounds values are clamped.
ICurvePrimitivePtr CloneComponent ( ptrdiff_t  componentIndex) const

Return a copy of a component.

Component index only applies to linestring. Any invalid index clones entire linestring. All others are complete Clone.

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

Return a (deep) clone with all partial curves replaced by complete curves.

Parameters
[in]maximumDereftrue to recurse through all steps of PartialCurve chains
[in]allowExtrapolationtrue to allow extension before/after endpoints.
bool ClosestPointBounded ( DPoint3dCR  spacePoint,
double &  fraction,
DPoint3dR  curvePoint 
) const

Find the closest point to a space point.

return false if not a simple curve. (EXAMPLE: ChildCurveVector)

Parameters
[in]spacePointreference point.
[out]fractionfractional position at closest point.
[out]curvePointcoordinates on curve
bool ClosestPointBounded ( DPoint3dCR  spacePoint,
CurveLocationDetailR  location,
bool  extend0,
bool  extend1 
) const

Find the closest point to a space point.

return false if not a simple curve. (EXAMPLE: ChildCurveVector)

Parameters
[in]spacePointreference point.
[out]locationdetails of hit:
  • location.curve = curve (e.g. from search within ChildCurveVector)
  • location.fraction = fractional coordinate on location.curve
  • location.point = coordinates on location.curve
  • location.a = distance from space point
  • componentIndex = if location.curve is a linestring, the segment index within the linestring
  • numComponent = if location.curve is a linestring, the number of edges.
  • componentFraction = if location.curve is a linestring, the fractional position within the edge.
[in]extend0true to allow line, linestring, ellipse to extend backwards before start.
[in]extend1true to allow line, linestring, ellipse to extend beyond end.
bool ClosestPointBounded ( DPoint3dCR  spacePoint,
CurveLocationDetailR  location 
) const

Find the closest point to a space point.

return false if not a simple curve. (EXAMPLE: ChildCurveVector)

Parameters
[in]spacePointreference point.
[out]locationdetails of hit:
  • location.curve = curve (e.g. from search within ChildCurveVector)
  • location.fraction = fractional coordinate on location.curve
  • location.point = coordinates on location.curve
  • location.a = distance from space point
  • componentIndex = if location.curve is a linestring, the segment index within the linestring
  • numComponent = if location.curve is a linestring, the number of edges.
  • componentFraction = if location.curve is a linestring, the fractional position within the edge.
bool ClosestPointBoundedXY ( DPoint3dCR  spacePoint,
DMatrix4dCP  worldToLocal,
CurveLocationDetailR  location 
) const

Find closest point, measuring in xy plane after applying a (possibly perspective) transform to both the curve and space point.

Parameters
[in]spacePointreference point.
[in]worldToLocaloptional transform.
[out]locationdetails of closest point. See ClosestPointBounded.
bool ClosestPointBoundedXY ( DPoint3dCR  spacePoint,
DMatrix4dCP  worldToLocal,
CurveLocationDetailR  location,
bool  extend0,
bool  extend1 
) const

Find closest point, measuring in xy plane after applying a (possibly perspective) transform to both the curve and space point.

Parameters
[in]spacePointreference point.
[in]worldToLocaloptional transform.
[out]locationdetails of closest point.
[in]extend0true to extend at beginning
[in]extend1true to extend at end
bool ComponentFractionToPoint ( ptrdiff_t  componentIndex,
double  f,
DPoint3dR  point 
) const

Evaluate curve fractional position within the parameter space of a component.

(For anything except a linestring, componentIndex is ignored and this is equivalent to FractionToPoint) return false if this is not a parameterized curve (EXAMPLE: A ChildCurveVector)

Parameters
[in]componentIndexindex of the component to evaluate.
[in]fevaluation fraction.
[out]pointpoint on curve.
bool ComponentFractionToPoint ( ptrdiff_t  componentIndex,
double  f,
DPoint3dR  point,
DVec3dR  tangent 
) const

Evaluate curve fractional position within the parameter space of a component.

(For anything except a linestring, componentIndex is ignored and this is equivalent to FractionToPoint) return false if this is not a parameterized curve (EXAMPLE: A ChildCurveVector)

Parameters
[in]componentIndexindex of the component to evaluate.
[in]fevaluation fraction.
[out]pointpoint on curve.
[out]tangentfirst derivative with respect to the fractional coordinate. (NOT normalized)
static ICurvePrimitivePtr CreateAkimaCurve ( DPoint3dCP  points,
size_t  nPoints 
)
static

Allocate and fill a new akima curve.

Parameters
[in]pointsakima control points to copy into the primitive. First two and final two points are slope end condition controls. Others are pass-through.
[in]nPointscontrol point count.
static ICurvePrimitivePtr CreateArc ( DEllipse3dCR  ellipse)
static

Allocate and fill a new elliptic arc.

Parameters
[in]ellipsesource ellipse.
static ICurvePrimitivePtr CreateBsplineCurve ( MSBsplineCurveCR  curve)
static

Allocate and fill a new bspline curve.

Parameters
[in]curvesource curve. A copy (clone, repeat allocation of memory) of the curve is placed into the new object. Caller is still responsible for freeing the input curve.
static ICurvePrimitivePtr CreateBsplineCurve ( MSBsplineCurvePtr  curve)
static

Create curve primitive pointing to the same curve as the input.

Parameters
[in]curvesource curve. The ICurvePrimitive will point at the same data. Caller should NOT free the curve when it leaves scope.
static ICurvePrimitivePtr CreateBsplineCurveSwapFromSource ( MSBsplineCurveR  curve)
static

Allocate and fill a new bspline curve.

Parameters
[in]curvesource curve. Bits (including pointers) are copied to the CurvePrimtive. source curve is zeroed – caller has no "free" responsibilities.
static ICurvePrimitivePtr CreateChildCurveVector ( CurveVectorPtr  source)
static

Create a curve primitive with (ref coutnted pointer to preexisting refcounted child.

static ICurvePrimitivePtr CreateChildCurveVector_CopyFromSource ( CurveVectorCR  source)
static

Create child vector, making deep copy of the source.

static ICurvePrimitivePtr CreateChildCurveVector_SwapFromSource ( CurveVectorR  source)
static

Create a child vector; contents of source are taken, source itself is cleared.

static ICurvePrimitivePtr CreateInterpolationBetweenCurves ( ICurvePrimitiveCR  curveA,
double  fraction,
ICurvePrimitiveCR  curveB 
)
static

Create a curve that is interpolated between parents.

Parameters
[in]curveAfirst curve
[in]curveBsecond curve
[in]fractioninterpolation position.
Returns
null curve pointer if curves are not compatible for interpolation.
static ICurvePrimitivePtr CreateInterpolationCurve ( MSInterpolationCurveCR  fitCurve)
static

Allocate and fill a new interpolation curve.

Parameters
[in]fitCurvesource curve. Data is COPIED into the new object. Caller is still responsible for freeing the input fitCurve.
static ICurvePrimitivePtr CreateInterpolationCurveSwapFromSource ( MSInterpolationCurveR  fitCurve)
static

Allocate and fill a new interpolation curve.

Parameters
[in]fitCurvesource curve. Data is swapped into the curve. input fitCurve is zeroed.
static ICurvePrimitivePtr CreateLine ( DSegment3dCR  segment)
static

Allocate and fill a new line segemnt.

Parameters
[in]segmentsource segment.
static ICurvePrimitivePtr CreateLineString ( DPoint3dCP  points,
size_t  nPoints 
)
static

Allocate and fill a new linestring.

Parameters
[in]pointssource coordinates.
[in]nPointspoint count.
static ICurvePrimitivePtr CreateLineString ( bvector< DPoint3d > const &  points)
static

Allocate and fill a new linestring.

Parameters
[in]pointssource coordinates.
static ICurvePrimitivePtr CreatePartialCurve ( ICurvePrimitiveP  parentCurve,
double  fraction0,
double  fraction1,
int64_t  index = 0 
)
static

Allocate and fill a reference to a portion of a parent curve.

Parameters
[in]parentCurvepointer to another curve.
[in]fraction0start of active portion of parent.
[in]fraction1end of active portion of parent.
[in]indexapplication data.
Remarks
fraction0 and fraction1 may be in forward or reverse relationship.
static ICurvePrimitivePtr CreatePointString ( DPoint3dCP  points,
size_t  nPoints 
)
static

Allocate and fill a new point string.

Parameters
[in]pointscoordinates to copy into the primitive
[in]nPointsnumber of points
static ICurvePrimitivePtr CreatePointString ( bvector< DPoint3d > &  points)
static

Allocate and fill a new point string.

Parameters
[in]pointscoordinates to copy into the primitive
static ICurvePrimitivePtr CreatePseudoSpiralPointBearingRadiusLengthRadius ( int  typeCode,
DPoint3dCR  startPoint,
double  startRadians,
double  radiusA,
double  lengthAB,
double  radiusB 
)
static

Construct a spiral with start radius, spiral length, and end radius.

ul> li> The spiral is paralllel to the xy plane. li> This is a special construction for "cubic" approximations. li> The constructed spiral is a fractional subset of another spiral that includes its inflection point (which may be outside the active fractional subset). /ul>

Parameters
[in]typeCodetransition type. This method is intended to work with "cubic" approximations (New South Wales, Australian etc)
[in]startPointstart point of spiral.
[in]startRadiansstart bearing angle in xy plane.
[in]radiusA(signed) radius (or 0 for line) at start.
[in]lengthABlength of spiral between radiusA and radiusB.
[in]radiusB(signed) radius (or 0 for line) at end.
static ICurvePrimitivePtr CreateRectangle ( double  x0,
double  y0,
double  x1,
double  y1,
double  z,
int  areaSignPreference = 0 
)
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]areaSignPreferenceis one of
  • any positive integer to force positive xy areLa.
  • 0 to take order (x0,y0)(x1,y0),(x1,y1),(x0,y1)
  • any negative integer to force negative xy area.
static ICurvePrimitivePtr CreateSpiral ( DSpiral2dBaseCR  spiral,
TransformCR  frame,
double  fractionA,
double  fractionB 
)
static

Allocate and fill a spiral curve.

Parameters
[in]spiralspiral structure (to be cloned – caller still responsible for deallocation)
[in]frameplacement frame
[in]fractionAstart fraction for active portion of curve
[in]fractionBend fraction for active portion of curve
static ICurvePrimitivePtr CreateSpiralBearingCurvatureBearingCurvature ( int  transitionType,
double  startRadians,
double  startCurvature,
double  endRadians,
double  endCurvature,
TransformCR  frame,
double  fractionA,
double  fractionB 
)
static

Allocate and fill a spiral curve.

Parameters
[in]startRadiansbearing at start
[in]startCurvaturecurvature at start (or 0 of flat)
[in]endRadiansbearing at end
[in]endCurvaturecurvature at end (or 0 if flat)
[in]transitionType(see DSpiral2dBase)
[in]frameplacement frame
[in]fractionAstart fraction for active portion of curve
[in]fractionBend fraction for active portion of curve
static ICurvePrimitivePtr CreateSpiralBearingCurvatureLengthCurvature ( int  transitionType,
double  startRadians,
double  startCurvature,
double  length,
double  endCurvature,
TransformCR  frame,
double  fractionA,
double  fractionB 
)
static

Allocate and fill a spiral curve.

Parameters
[in]startRadiansbearing at start
[in]startCurvaturecurvature at start (or 0 if flat)
[in]lengthlength along spiral
[in]endCurvaturecurvature at end (or 0 if flat)
[in]transitionType(see DSpiral2dBase)
[in]frameplacement frame
[in]fractionAstart fraction for active portion of curve
[in]fractionBend fraction for active portion of curve
static ICurvePrimitivePtr CreateSpiralBearingRadiusBearingRadius ( int  transitionType,
double  startRadians,
double  startRadius,
double  endRadians,
double  endRadius,
TransformCR  frame,
double  fractionA,
double  fractionB 
)
static

Allocate and fill a spiral curve.

Parameters
[in]startRadiansbearing at start
[in]startRadiusradius at start (or 0 of flat)
[in]endRadiansbearing at end
[in]endRadiusradius at end (or 0 if flat)
[in]transitionType(see DSpiral2dBase)
[in]frameplacement frame
[in]fractionAstart fraction for active portion of curve
[in]fractionBend fraction for active portion of curve
static ICurvePrimitivePtr CreateSpiralBearingRadiusLengthRadius ( int  transitionType,
double  startRadians,
double  startRadius,
double  length,
double  endRadius,
TransformCR  frame,
double  fractionA,
double  fractionB 
)
static

Allocate and fill a spiral curve.

Parameters
[in]startRadiansbearing at start
[in]startRadiusradius at start (or 0 if flat)
[in]lengthlength along spiral
[in]endRadiusradius at end (or 0 if flat)
[in]transitionType(see DSpiral2dBase)
[in]frameplacement frame
[in]fractionAstart fraction for active portion of curve
[in]fractionBend fraction for active portion of curve
static bool CreateSpiralsStartShoulderTarget ( int  transitionType,
DPoint3dCR  pointA,
DPoint3dCR  pointB,
DPoint3dCR  pointC,
ICurvePrimitivePtr &  primitiveA,
ICurvePrimitivePtr &  primitiveB 
)
static

Create a pair of spirals that act like a "fillet" of a corner defined by start, shoulder and target.

ul> li>Start exactly at pointA. li>Depart towards pointB with zero curvature li>turn towards pointC, reachnig maximum curvature near pointB. li>flatten out to tangency with the line pointB..pointC. /ul>

Parameters
[in]transitionTypetransition type
[in]pointAstart point
[in]pointBtarget point for (both) tangencies
[in]pointCfinal target
[in]primitiveAfirst spiral
[in]primitiveBsecond spiral
bool FastLength ( double &  length) const

Compute a fast approximation of curve length.

return false if no measurable curves.

Parameters
[out]lengthcurve length. For ChildCurveVector, length of contained curves is summed.
double FastMaxAbs ( ) const

Return a representative large coordinate.

This is not required to be a true range limit. For instance, a max abs of a bspline pole range is acceptable.

bool FractionToFrenetFrame ( double  f,
TransformR  frame 
) const

Evaluate curve point at fractional position within its parameter space.

return false if this is not a parameterized curve (EXAMPLE: A ChildCurveVector)

Parameters
[in]fevaluation fraction.
[out]frameCoordinate frame with origin on curve, x direction along curve, y direction in curvature plane, z direction perpendicular.
bool FractionToPoint ( double  f,
DPoint3dR  point 
) const

Evaluate curve fractional position within its parameter space.

return false if this is not a parameterized curve (EXAMPLE: A ChildCurveVector)

Parameters
[in]fevaluation fraction.
[out]pointpoint on curve.
bool FractionToPoint ( double  f,
DPoint3dR  point,
DVec3dR  tangent 
) const

Evaluate curve fractional position within its parameter space.

return false if this is not a parameterized curve (EXAMPLE: A ChildCurveVector)

Parameters
[in]fevaluation fraction.
[out]pointpoint on curve.
[out]tangentfirst derivative with respect to the fractional coordinate. (NOT normalized)
bool FractionToPoint ( double  f,
DRay3dR  ray 
) const

Evaluate curve fractional position within its parameter space.

return false if this is not a parameterized curve (EXAMPLE: A ChildCurveVector)

Parameters
[in]fevaluation fraction.
[out]raypoint and derivative packaged as a ray.
bool FractionToPoint ( double  f,
CurveLocationDetail detail 
) const

Evaluate curve fractional position, and return as a CurveLocationDetail.

return false if this is not a parameterized curve (EXAMPLE: A ChildCurveVector)

Parameters
[in]fevaluation fraction.
[out]detailevaluated point, with fraction and component markup.
bool FractionToPoint ( double  f,
DPoint3dR  point,
DVec3dR  tangent,
DVec3dR  derivative2 
) const

Evaluate curve point at fractional position within its parameter space.

return false if this is not a parameterized curve (EXAMPLE: A ChildCurveVector)

Parameters
[in]fevaluation fraction.
[out]pointpoint on curve.
[out]tangentfirst deriviatve with respect to the fractional coordinate. (NOT normalized)
[out]derivative2second deriviatve with respect to the fractional coordinate. (NOT normalized)
bool FractionToPoint ( double  f,
DPoint3dR  point,
DVec3dR  tangent,
DVec3dR  derivative2,
DVec3dR  derivative3 
) const

Evaluate curve point at fractional position within its parameter space.

return false if this is not a parameterized curve (EXAMPLE: A ChildCurveVector)

Parameters
[in]fevaluation fraction.
[out]pointpoint on curve.
[out]tangentfirst deriviatve with respect to the fractional coordinate. (NOT normalized)
[out]derivative2second deriviatve with respect to the fractional coordinate. (NOT normalized)
[out]derivative3third deriviatve with respect to the fractional coordinate. (NOT normalized)
bool FractionToPointWithTwoSidedDerivative ( double  f,
DPoint3dR  point,
DVec3dR  derivativeA,
DVec3dR  derivativeB 
) const

Evaluate curve fractional position within its parameter space.

  • On a smooth curve, incoming and outgoing derivatives will be identical.
  • Incoming and outgoing derivatives can differ at linestring interior points and bspline knots.

return false if this is not a parameterized curve (EXAMPLE: A ChildCurveVector)

Parameters
[in]fevaluation fraction.
[out]pointpoint on curve.
[out]derivativeAfirst derivative with respect to the fractional coordinate, taken on the inbound (lower parameter) side of the parameter.
[out]derivativeBfirst derivative with respect to the fractional coordinate, taken on the outbound (higher parameter) side of the parameter.
bvector<DPoint3d> const* GetAkimaCurveCP ( ) const

If this is an Akima curve, return const pointer to its array of fit points (with extra points at each end to control slope).

DEllipse3dCP GetArcCP ( ) const

If this is an arc primitive, return const pointer to its coordinate data. Otherwise return NULL.

bool GetBreakFraction ( size_t  breakFractioniIndex,
double &  fraction 
) const

Return the fractional postion of a point where the curve's continuity has a break.

MSBsplineCurveCP GetBsplineCurveCP ( ) const

If this is a bspline primtiive, return const pointer to its curve. Otherwise return NULL.

MSBsplineCurvePtr GetBsplineCurvePtr ( ) const

If this is a bspline primtiive, return ref counted pointer to its curve. Otherwise return NULL.

CurveVectorCP GetChildCurveVectorCP ( ) const

If this is a carrier for a curve vector, return const pointer to the vector. Otherwise return NULL.

CurvePrimitiveType GetCurvePrimitiveType ( ) const

Return the integer type code for the curve primitive type.

CurvePrimitiveIdCP GetId ( ) const
MSInterpolationCurveCP GetInterpolationCurveCP ( ) const

If this is an Interpolation curve, return const pointer to its coordinate data. Otherwise return NULL.

int GetIntTag ( ) const

Get the Int64 tag (cast to int)

DSegment3dCP GetLineCP ( ) const

If this is a line primitive, return const pointer to its coordinate data. Otherwise return NULL.

bvector<DPoint3d> const* GetLineStringCP ( ) const

If this is a linestring primitive, return const pointer to its coordinate data array. Otherwise return null.

bool GetMarkerBit ( CurvePrimitiveMarkerBit  selector) const

Ask if specified marker bit is on or off.

bool GetMSBsplineCurve ( MSBsplineCurveR  curve,
double  fraction0 = 0.0,
double  fraction1 = 1.0 
) const

Initialize an MSBsplineCurve form of the curve.

MSBsplineCurvePtr GetMSBsplineCurvePtr ( double  fraction0 = 0.0,
double  fraction1 = 1.0 
) const

Initialize a (ref coutned) MSBsplineCurve form of the curve.

PartialCurveDetailCP GetPartialCurveDetailCP ( ) const

If this is a reference to portion of another curve, return detail data. Otherwise return NULL.

bvector<DPoint3d> const* GetPointStringCP ( ) const

If this is a point string, return const pointer to its point array. Otherwise return NULL.

MSBsplineCurveCP GetProxyBsplineCurveCP ( ) const

If available, return a representative bspline curve.

MSBsplineCurvePtr GetProxyBsplineCurvePtr ( ) const

If available, return a(refcounted pointer to) a proxy bspline curve.

bool GetRange ( DRange3dR  range) const

Return range of the primitive.

bool GetRange ( DRange3dR  range,
TransformCR  transform 
) const

Return range of the primitive under a transform.

DSpiral2dPlacementCP GetSpiralPlacementCP ( ) const

If this is s a spiral placement return const pointer to its coordinate data. Otherwise return NULL.

bool GetStartEnd ( DPoint3dR  pointA,
DPoint3dR  pointB 
) const

return the start and end points of the curve

Parameters
[out]pointAstart point
[out]pointBend point
Remarks
For ChildCurveVector, the first and last component endpoints are determined.
bool GetStartEnd ( DPoint3dR  pointA,
DPoint3dR  pointB,
DVec3dR  unitTangentA,
DVec3dR  unitTangentB 
) const

return start and end points and the (normalized!) tangents.

Parameters
[out]pointAstart point
[out]pointBend point
[out]unitTangentAnormalized tangent (forward) at pointA.
[out]unitTangentBnormalized tangent (forward) at pointB.
Remarks
For ChildCurveVector, the first and last component endpoints are determined.
bool GetStartPoint ( DPoint3dR  point) const

Return first primitive in a deep search.

Parameters
[out]pointstart point.
size_t GetStrokeCount ( IFacetOptionsR  options,
double  startFraction = 0.0,
double  endFraction = 1.0 
) const

Return the number of strokes needed to approximate this curve primitive.

int64_t GetTag ( ) const

Get the Int64 tag ...

bool IsExtensibleFractionSpace ( ) const

Test if fractional queries allow extension. When this is true, the CurvePrimitive recognizes fractions outside of 0..1.

bool IsFractionSpace ( ) const

Test if this is a curve (i.e. not a child vector or point string)

bool IsMappableFractionSpace ( ) const

Test if cloned fractional intervals map linearly back to parent fractions.

(Not true for linestrings and child curve vectors.

bool IsPeriodicFractionSpace ( double &  period) const

Return true if the curve is part of a (possibly larger) periodic curve.

Parameters
[out]periodperiod as a multiple of the bounded curve's fraction space. For example, a quarter arc has a period of 4.
bool IsSameStructure ( ICurvePrimitiveCR  other) const

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

bool IsSameStructureAndGeometry ( ICurvePrimitiveCR  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 Length ( double &  length) const

Compute curve length.

return false if no measurable curves.

Parameters
[out]lengthcurve length. For ChildCurveVector, length of contained curves is summed.
bool Length ( RotMatrixCP  worldToLocal,
double &  length 
) const

Compute curve length under effect of a RotMatrix.

Note that if you want xy area, the transform must include scaling z parts to zero. Just passing a viewing matrix is not sufficient – the z depth is still present after the multiplication. return false if no measurable curves.

Parameters
[in]worldToLocaltransform to apply to vectors.
[out]lengthcurve length. For ChildCurveVector, length of contained curves is summed.
size_t NumComponent ( ) const

Return the number of components that can be parameterized.

This is ul> li> 1 for all curves except linestrings. li> 0 for child curve vector li> the number of edges in a linestring. /ul>

bool PointAtSignedDistanceFromFraction ( double  startFraction,
double  signedDistance,
bool  allowExtension,
CurveLocationDetailR  location 
) const

Attempt to move a specified distance from given fraction.

Parameters
[in]startFractionstarting position.
[in]signedDistancedistance for attempted move.
[in]allowExtensioncontrols extended behaior of line, arc, and linestring.
[out]locationfraction and point after move. {a} field indicates actual signed distance moved (which may be less than request!!)
Remarks
If extension is not allowed, there are fussy rules for both the input and output. (1) The startFraction is clamped to {0..1} (2) Movement stops at the endpoint in the indicated direction.
bool PointAtSignedDistanceFromFraction ( RotMatrixCP  worldToView,
double  startFraction,
double  signedDistance,
bool  allowExtension,
CurveLocationDetailR  location 
) const

Attempt to move a specified distance from given fraction.

Parameters
[in]startFractionstarting position.
[in]signedDistancedistance for attempted move.
[in]allowExtensioncontrols extended behaior of line, arc, and linestring.
[out]locationfraction and point after move. {a} field indicates actual signed distance moved (which may be less than request!!)
[in]worldToViewvector transformation
Remarks
If extension is not allowed, there are fussy rules for both the input and output. (1) The startFraction is clamped to {0..1} (2) Movement stops at the endpoint in the indicated direction.
DRange1d ProjectedParameterRange ( DRay3dCR  ray,
double  fraction0,
double  fraction1 
) const

Return the range the primitive projected onto a ray.

return DRange1d with range data.

Parameters
[in]raytest ray.
[in]fraction0start fraction of active part.
[in]fraction1end fraction of active part.
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 primitive has no curves, the returned range returns true on the DRange1d::IsNull() predicate.
DRange1d ProjectedParameterRange ( DRay3dCR  ray) const

Return the range the primitive projected onto 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 primitive has no curves, the returned range returns true on the DRange1d::IsNull() predicate.
bool ReverseCurvesInPlace ( )

reverse the parameterization in place.

void SetMarkerBit ( CurvePrimitiveMarkerBit  selector,
bool  value 
)

Set the specified marker bit on or off.

void SetTag ( int64_t  tag)

Set the Int64 tag.

void SetTag ( int  tag)

Set the Int64 tag from an int.

bool SignedDistanceBetweenFractions ( double  startFraction,
double  endFraction,
double &  signedDistance 
) const

Return distance between fractions.

Primitives that do not have extensible fraction spaces will SILENTLY clamp the fractions to 0..1. return false if this is not a parameterized curve (EXAMPLE: A ChildCurveVector)

Parameters
[in]startFractionstarting position for partial curve.
[in]endFractionend position for partial curve.
[out]signedDistancedistance along curve, negative if fraction direction is reversed.
bool SignedDistanceBetweenFractions ( RotMatrixCP  worldToLocal,
double  startFraction,
double  endFraction,
double &  signedDistance 
) const

Return distance between fractions.

Primitives that do not have extensible fraction spaces will SILENTLY clamp the fractions to 0..1. return false if this is not a parameterized curve (EXAMPLE: A ChildCurveVector)

Parameters
[in]startFractionstarting position for partial curve.
[in]endFractionend position for partial curve.
[in]worldToLocalmatrix to apply to vectors.
[out]signedDistancedistance along curve, negative if fraction direction is reversed.
bool TransformInPlace ( TransformCR  transform)

Transform in place.

bool TryAddLineStringPoint ( DPoint3dCR  xyz)

If this is a linestring, add a point.

bool TryGetArc ( DEllipse3dR  arc) const

If this is a line primitive, copy its coordinate data to a DEllipse3d.

bool TryGetLine ( DSegment3dR  segment) const

If this is a line primitive, copy its coordinate data to a DSegment3d.

bool TryGetPartialCurveData ( double &  fractionA,
double &  fractionB,
ICurvePrimitivePtr &  parentCurve,
int64_t tag 
) const

If this is a reference to portion of another curve, return detail data. Otherwise return NULL.

bool TryGetSegmentInLineString ( DSegment3dR  segment,
size_t  startPointIndex 
) const

If this is a linestring and index is valid, get the (single) indexed segment.

bool TrySetEnd ( DPoint3dCR  xyz)

Modify the end point if possible.

bool TrySetStart ( DPoint3dCR  xyz)

Modify the start point if possible.

bool WireCentroid ( double &  length,
DPoint3dR  centroid,
double  fraction0 = 0.0,
double  fraction1 = 1.0 
) const

Return the centroid of (a portion of) the curve.

Parameters
[out]lengthcurve length
[out]centroidcurve centroid
[in]fraction0start fraction of active part of sweep.
[in]fraction1end fraction of active part of sweep.

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

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