ON_3dPointArray Class Reference

#include <opennurbs_point.h>

Inheritance diagram for ON_3dPointArray:
ON_SimpleArray< ON_3dPoint > ON_Polyline

Public Member Functions

 ON_3dPointArray ()
 see ON_SimpleArray class definition comments for constructor documentation More...
 
 ON_3dPointArray (int)
 
 ON_3dPointArray (const ON_SimpleArray< ON_3dPoint > &)
 
 ON_3dPointArray (const ON_SimpleArray< ON_3fPoint > &)
 
ON_BoundingBox BoundingBox () const
 Get 3d axis aligned bounding box. More...
 
bool Create (int point_dimension, int bRational, int point_count, int point_stride, const double *points)
 Create 3d point list More...
 
bool Create (int point_dimension, int bRational, int point_count, int point_stride, const float *points)
 Create 3d point list More...
 
bool GetBBox (double boxmin[3], double boxmax[3], bool bGrowBox=false) const
 Get axis aligned bounding box. More...
 
bool GetBoundingBox (ON_BoundingBox &bbox, int bGrowBox=false) const
 Get 3d axis aligned bounding box or the union of the input box with the point list's bounding box. More...
 
bool GetClosestPoint (ON_3dPoint P, int *closest_point_index, double maximum_distance=0.0) const
 Get the index of the point in the array that is closest to P. More...
 
bool GetTightBoundingBox (ON_BoundingBox &tight_bbox, bool bGrowBox=false, const ON_Xform *xform=nullptr) const
 Get tight bounding box of the point list. More...
 
ON_3dPointArrayoperator= (const ON_3dPointArray &)
 
ON_3dPointArrayoperator= (const ON_SimpleArray< ON_3fPoint > &)
 
bool Rotate (double sin_angle, double cos_angle, const ON_3dVector &axis_of_rotation, const ON_3dPoint &center_of_rotation)
 Rotate points about a center and axis. A positive angle results in a counter-clockwise rotation about the axis of rotation. More...
 
bool Rotate (double angle_in_radians, const ON_3dVector &axis_of_rotation, const ON_3dPoint &center_of_rotation)
 Rotate points about a center and axis. A positive angle results in a counter-clockwise rotation about the axis of rotation. More...
 
bool SwapCoordinates (int i, int j)
 Swaps point coordinate values with indices i and j. More...
 
bool Transform (const ON_Xform &xform)
 Transform points by applying xform to each point. More...
 
bool Translate (const ON_3dVector &delta)
 Translate a polyline More...
 
- Public Member Functions inherited from ON_SimpleArray< ON_3dPoint >
 ON_SimpleArray () ON_NOEXCEPT
 construction //////////////////////////////////////////////////////// More...
 
 ON_SimpleArray (const ON_SimpleArray< ON_3dPoint > &)
 Copy constructor. More...
 
 ON_SimpleArray (size_t)
 
virtual ~ON_SimpleArray ()
 
void Append (const ON_3dPoint &)
 
void Append (int, const ON_3dPoint *)
 
ON_3dPointAppendNew ()
 array operations //////////////////////////////////////////////////// More...
 
ON_3dPointArray ()
 
const ON_3dPointArray () const
 
ON_3dPointAt (int)
 At(index) returns nullptr if index < 0 or index >= count. More...
 
ON_3dPointAt (unsigned int)
 
ON_3dPointAt (ON__INT64)
 
ON_3dPointAt (ON__UINT64)
 
const ON_3dPointAt (int) const
 
const ON_3dPointAt (unsigned int) const
 
const ON_3dPointAt (ON__INT64) const
 
const ON_3dPointAt (ON__UINT64) const
 
int BinarySearch (const ON_3dPoint *, int(*)(const ON_3dPoint *, const ON_3dPoint *)) const
 
int BinarySearch (const ON_3dPoint *, int(*)(const ON_3dPoint *, const ON_3dPoint *), int) const
 
int Capacity () const
 
int Count () const
 query /////////////////////////////////////////////////////////////// More...
 
ON__UINT32 DataCRC (ON__UINT32 current_remainder) const
 
void Destroy ()
 
void EmergencyDestroy (void)
 emergency bailout /////////////////////////////////////////////////// More...
 
void Empty ()
 
ON_3dPointFirst ()
 
const ON_3dPointFirst () const
 
bool HeapSort (int(*)(const ON_3dPoint *, const ON_3dPoint *))
 
void Insert (int, const ON_3dPoint &)
 
ON_3dPointKeepArray ()
 Expert user tool to take charge of the memory used by the dyanmic array. More...
 
ON_3dPointLast ()
 
const ON_3dPointLast () const
 
void MemSet (unsigned char)
 
int NewCapacity () const
 
 operator const ON_3dPoint * () const
 
 operator ON_3dPoint * ()
 
ON_SimpleArray< ON_3dPoint > & operator= (const ON_SimpleArray< ON_3dPoint > &)
 
ON_3dPointoperator[] (int)
 
ON_3dPointoperator[] (unsigned int)
 
ON_3dPointoperator[] (ON__INT64)
 
ON_3dPointoperator[] (ON__UINT64)
 
const ON_3dPointoperator[] (int) const
 
const ON_3dPointoperator[] (unsigned int) const
 
const ON_3dPointoperator[] (ON__INT64) const
 
const ON_3dPointoperator[] (ON__UINT64) const
 
bool Permute (const int *)
 
bool QuickSort (int(*)(const ON_3dPoint *, const ON_3dPoint *))
 
virtual ON_3dPointRealloc (ON_3dPoint *, int)
 low level memory managment ////////////////////////////////////////// More...
 
void Remove ()
 
virtual void Remove (int)
 
ON_3dPointReserve (size_t)
 memory managment //////////////////////////////////////////////////// More...
 
void Reverse ()
 
int Search (const ON_3dPoint &) const
 
int Search (const ON_3dPoint *, int(*)(const ON_3dPoint *, const ON_3dPoint *)) const
 
void SetArray (ON_3dPoint *)
 Do not use this version of SetArray(). Use the one that takes a pointer, count and capacity. More...
 
void SetArray (ON_3dPoint *, int, int)
 Expert user tool to set the memory used by the dyanmic array. More...
 
ON_3dPointSetCapacity (size_t)
 
void SetCount (int)
 low level memory managment ////////////////////////////////////////// More...
 
void Shrink ()
 
unsigned int SizeOfArray () const
 
unsigned int SizeOfElement () const
 
bool Sort (ON::sort_algorithm sort_algorithm, int *, int(*)(const ON_3dPoint *, const ON_3dPoint *)) const
 Sort() fills in the index[] array so that array[index[i]] <= array[index[i+1]]. The array is not modified. More...
 
bool Sort (ON::sort_algorithm sort_algorithm, int *, int(*)(const ON_3dPoint *, const ON_3dPoint *, void *), void *) const
 Sort() fills in the index[] array so that array[index[i]] <= array[index[i+1]]. The array is not modified. More...
 
void Swap (int, int)
 
unsigned int UnsignedCount () const
 
void Zero ()
 

Additional Inherited Members

- Protected Member Functions inherited from ON_SimpleArray< ON_3dPoint >
void Move (int, int, int)
 implimentation ////////////////////////////////////////////////////// More...
 
- Protected Attributes inherited from ON_SimpleArray< ON_3dPoint >
ON_3dPointm_a
 
int m_capacity
 
int m_count
 

Constructor & Destructor Documentation

◆ ON_3dPointArray() [1/4]

ON_3dPointArray::ON_3dPointArray ( )

see ON_SimpleArray class definition comments for constructor documentation

◆ ON_3dPointArray() [2/4]

ON_3dPointArray::ON_3dPointArray ( int  )

◆ ON_3dPointArray() [3/4]

ON_3dPointArray::ON_3dPointArray ( const ON_SimpleArray< ON_3dPoint > &  )

◆ ON_3dPointArray() [4/4]

ON_3dPointArray::ON_3dPointArray ( const ON_SimpleArray< ON_3fPoint > &  )

Member Function Documentation

◆ BoundingBox()

ON_BoundingBox ON_3dPointArray::BoundingBox ( ) const

Get 3d axis aligned bounding box.

Returns
3d bounding box of point list.

◆ Create() [1/2]

bool ON_3dPointArray::Create ( int  point_dimension,
int  bRational,
int  point_count,
int  point_stride,
const double *  points 
)

Create 3d point list

Parameters
point_dimension[in] dimension of input points (2 or 3)
bRational[in] true if points are in homogenous rational form
point_count[in] number of points
point_stride[in] number of doubles to skip between points
points[in] array of point coordinates

◆ Create() [2/2]

bool ON_3dPointArray::Create ( int  point_dimension,
int  bRational,
int  point_count,
int  point_stride,
const float *  points 
)

Create 3d point list

Parameters
point_dimension[in] dimension of input points (2 or 3)
bRational[in] true if points are in homogenous rational form
point_count[in] number of points
point_stride[in] number of doubles to skip between points
points[in] array of point coordinates

◆ GetBBox()

bool ON_3dPointArray::GetBBox ( double  boxmin[3],
double  boxmax[3],
bool  bGrowBox = false 
) const

Get axis aligned bounding box.

Parameters
boxmin[in/out] array of 3 doubles
boxmax[in/out] array of 3 doubles
bGrowBox[in] (default=false) If true, then the union of the input bounding box and the object's bounding box is returned. If false, the object's bounding box is returned.
Returns
true if object has bounding box and calculation was successful

◆ GetBoundingBox()

bool ON_3dPointArray::GetBoundingBox ( ON_BoundingBox bbox,
int  bGrowBox = false 
) const

Get 3d axis aligned bounding box or the union of the input box with the point list's bounding box.

Parameters
bbox[in/out] 3d axis aligned bounding box
bGrowBox[in] (default=false) If true, then the union of the input bbox and the point list's bounding box is returned in bbox. If false, the point list's bounding box is returned in bbox.
Returns
true if successful.

◆ GetClosestPoint()

bool ON_3dPointArray::GetClosestPoint ( ON_3dPoint  P,
int *  closest_point_index,
double  maximum_distance = 0.0 
) const

Get the index of the point in the array that is closest to P.

Parameters
P[in]
closest_point_index[out]
maximum_distance[in] optional distance constraint. If maximum_distance > 0, then only points Q with |P-Q| <= maximum_distance are returned.
Returns
True if a point is found; in which case *closest_point_index is the index of the point. False if no point is found or the input is not valid.
See also
ON_GetClosestPointInPointList, ON_PointCloud::GetClosestPoint

◆ GetTightBoundingBox()

bool ON_3dPointArray::GetTightBoundingBox ( ON_BoundingBox tight_bbox,
bool  bGrowBox = false,
const ON_Xform xform = nullptr 
) const

Get tight bounding box of the point list.

Parameters
tight_bbox[in/out] tight bounding box
bGrowBox[in] (default=false) If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the tight bounding box of the point list.
xform[in] (default=nullptr) If not nullptr, the tight bounding box of the transformed point list is calculated. The point list is not modified.
Returns
True if the returned tight_bbox is set to a valid bounding box.

◆ operator=() [1/2]

ON_3dPointArray& ON_3dPointArray::operator= ( const ON_3dPointArray )

◆ operator=() [2/2]

ON_3dPointArray& ON_3dPointArray::operator= ( const ON_SimpleArray< ON_3fPoint > &  )

◆ Rotate() [1/2]

bool ON_3dPointArray::Rotate ( double  sin_angle,
double  cos_angle,
const ON_3dVector axis_of_rotation,
const ON_3dPoint center_of_rotation 
)

Rotate points about a center and axis. A positive angle results in a counter-clockwise rotation about the axis of rotation.

Parameters
sin_angle[in] sine of rotation angle
cos_angle[in] cosine of rotation angle
axis_of_rotation[in] axis of rotation
center_of_rotation[in] center (fixed point) of rotation
Returns
true if successful.

◆ Rotate() [2/2]

bool ON_3dPointArray::Rotate ( double  angle_in_radians,
const ON_3dVector axis_of_rotation,
const ON_3dPoint center_of_rotation 
)

Rotate points about a center and axis. A positive angle results in a counter-clockwise rotation about the axis of rotation.

Parameters
angle[in] angle in radians. Polsine of rotation angle
cos_angle[in] cosine of rotation angle
axis_of_rotation[in] axis of rotation
center_of_rotation[in] center (fixed point) of rotation
Returns
true if successful.

◆ SwapCoordinates()

bool ON_3dPointArray::SwapCoordinates ( int  i,
int  j 
)

Swaps point coordinate values with indices i and j.

Parameters
i[in] coordinate index
j[in] coordinate index
Returns
true if successful.
The call SwapCoordinates(0,2) would swap the x and z
coordinates of each point in the array.

◆ Transform()

bool ON_3dPointArray::Transform ( const ON_Xform xform)

Transform points by applying xform to each point.

Parameters
xform[in] transformation matrix
Returns
true if successful.

◆ Translate()

bool ON_3dPointArray::Translate ( const ON_3dVector delta)

Translate a polyline

Parameters
delta[in] translation vectorsine of rotation angle
Returns
true if successful.