#include <opennurbs_bezier.h>
Public Member Functions | |
ON_BezierCage () | |
ON_BezierCage (int dim, bool is_rat, int order0, int order1, int order2) | |
ON_BezierCage (const ON_BoundingBox &bbox, int order0, int order1, int order2) | |
Construct a bezier volume that maps the unit cube to a bounding box. More... | |
ON_BezierCage (const ON_3dPoint *box_corners, int order0, int order1, int order2) | |
Construct a bezier volume that maps the unit cube to an eight sided box. More... | |
ON_BezierCage (const ON_BezierCage &src) | |
~ON_BezierCage () | |
bool | Create (int dim, bool is_rat, int order0, int order1, int order2) |
Creates a bezier volume with specified orders. More... | |
bool | Create (const ON_BoundingBox &bbox, int order0, int order1, int order2) |
Create a Bezier volume with corners defined by a bounding box. More... | |
bool | Create (const ON_3dPoint *box_corners, int order0, int order1, int order2) |
Create a bezier volume from a 3d box More... | |
double * | CV (int i, int j, int k) const |
Expert user function to get a pointer to control vertex memory. If you are not an expert user, please use ON_BezierCage::GetCV( ON_3dPoint& ) or ON_BezierCage::GetCV( ON_4dPoint& ). More... | |
int | CVSize () const |
ON::point_style | CVStyle () const |
Returns the style of control vertices in the m_cv array. More... | |
int | Degree (int) const |
void | Destroy () |
Frees the CV array and sets all members to zero. More... | |
int | Dimension () const |
The dimension of the image of the bazier volume map. This is generally three, but can be any positive integer. More... | |
ON_Interval | Domain (int) const |
void | Dump (ON_TextLog &text_log) const |
void | EmergencyDestroy () |
Sets all members to zero. Does not free the CV array even when m_cv is not nullptr. Generally used when the CVs were allocated from a memory pool that no longer exists and the free done in ~ON_BezierCage would cause a crash. More... | |
bool | Evaluate (double r, double s, double t, int der_count, int v_stride, double *v) const |
returns false if unable to evaluate More... | |
bool | GetBBox (double *boxmin, double *boxmax, bool bGrowBox=false) const |
Gets the axis aligned bounding box that contains the bezier's control points. The bezier volume maps the unit cube into this box. More... | |
bool | GetCV (int i, int j, int k, ON::point_style, double *) const |
bool | GetCV (int i, int j, int k, ON_3dPoint &) const |
bool | GetCV (int i, int j, int k, ON_4dPoint &) const |
bool | IsRational () const |
bool | IsSingular (int) const |
bool | IsValid () const |
Tests class to make sure members are correctly initialized. More... | |
bool | MakeNonRational () |
bool | MakeRational () |
ON_BezierCage & | operator= (const ON_BezierCage &src) |
int | Order (int) const |
ON_3dPoint | PointAt (double r, double s, double t) const |
Evaluates bezer volume map. More... | |
ON_3dPoint | PointAt (ON_3dPoint rst) const |
Evaluates bezer volume map. More... | |
bool | Read (ON_BinaryArchive &archive) |
Reads the definition of this class from an archive previously saved by ON_BezierVolue::Write. More... | |
bool | ReserveCVCapacity (int cv_capacity) |
Tools for managing CV and knot memory. More... | |
bool | Rotate (double sin_angle, double cos_angle, const ON_3dVector &rotation_axis, const ON_3dPoint &rotation_center) |
Rotates the bezier surface about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule). More... | |
bool | Rotate (double rotation_angle, const ON_3dVector &rotation_axis, const ON_3dPoint &rotation_center) |
Rotates the bezier surface about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule). More... | |
bool | Scale (double scale_factor) |
Scales the bezier surface by the specified facotor. The scale is centered at the origin. More... | |
bool | SetCV (int i, int j, int k, ON::point_style, const double *) |
bool | SetCV (int i, int j, int k, const ON_3dPoint &point) |
bool | SetCV (int i, int j, int k, const ON_4dPoint &hpoint) |
bool | SetWeight (int i, int j, int k, double w) |
bool | Transform (const ON_Xform &xform) |
bool | Translate (const ON_3dVector &translation_vector) |
Translates the bezier surface along the specified vector. More... | |
double | Weight (int i, int j, int k) const |
bool | Write (ON_BinaryArchive &archive) const |
Saves the definition of this class in serial binary form that can be read by ON_BezierVolue::Read. More... | |
bool | ZeroCVs () |
Public Attributes | |
double * | m_cv |
int | m_cv_capacity |
int | m_cv_stride [3] |
int | m_dim |
Implementation. More... | |
bool | m_is_rat |
int | m_order [3] |
ON_BezierCage::ON_BezierCage | ( | ) |
ON_BezierCage::ON_BezierCage | ( | int | dim, |
bool | is_rat, | ||
int | order0, | ||
int | order1, | ||
int | order2 | ||
) |
ON_BezierCage::ON_BezierCage | ( | const ON_BoundingBox & | bbox, |
int | order0, | ||
int | order1, | ||
int | order2 | ||
) |
Construct a bezier volume that maps the unit cube to a bounding box.
bbox | [in] target bounding box |
order0 | [in] |
order1 | [in] |
order2 | [in] |
ON_BezierCage::ON_BezierCage | ( | const ON_3dPoint * | box_corners, |
int | order0, | ||
int | order1, | ||
int | order2 | ||
) |
Construct a bezier volume that maps the unit cube to an eight sided box.
box_corners | [in] 8 points that define corners of the target volume. |
7______________6 |\ |\ | \ | \ | \ _____________\ | 4 | 5 | | | | | | | |
3 | –|-------—2 | \ | \ | \ |t \ | s \ | \ | \0_____________\1 r |
order0 | [in] |
order1 | [in] |
order2 | [in] |
ON_BezierCage::~ON_BezierCage | ( | ) |
ON_BezierCage::ON_BezierCage | ( | const ON_BezierCage & | src | ) |
bool ON_BezierCage::Create | ( | int | dim, |
bool | is_rat, | ||
int | order0, | ||
int | order1, | ||
int | order2 | ||
) |
Creates a bezier volume with specified orders.
dim | [in] |
is_rat | [in] |
order0 | [in] |
order1 | [in] |
order2 | [in] |
bool ON_BezierCage::Create | ( | const ON_BoundingBox & | bbox, |
int | order0, | ||
int | order1, | ||
int | order2 | ||
) |
Create a Bezier volume with corners defined by a bounding box.
bbox | [in] target bounding box - the bezier will map the unit cube onto this bounding box. |
order0 | [in] |
order1 | [in] |
order2 | [in] |
bool ON_BezierCage::Create | ( | const ON_3dPoint * | box_corners, |
int | order0, | ||
int | order1, | ||
int | order2 | ||
) |
Create a bezier volume from a 3d box
box_corners | [in] 8 points that define corners of the volume 7______________6 |\ |\ | \ | \ | \ _____________\ | 4 | 5 | | | | | | | |</param>
|
double* ON_BezierCage::CV | ( | int | i, |
int | j, | ||
int | k | ||
) | const |
Expert user function to get a pointer to control vertex memory. If you are not an expert user, please use ON_BezierCage::GetCV( ON_3dPoint& ) or ON_BezierCage::GetCV( ON_4dPoint& ).
cv_index0 | [in] (0 <= cv_index0 < m_order[0]) |
cv_index1 | [in] (0 <= cv_index1 < m_order[1]) |
If the Bezier surface is rational, the format of the returned array is a homogeneos rational point with length m_dim+1. If the Bezier surface is not rational, the format of the returned array is a nonrational euclidean point with length m_dim. See Also ON_BezierCage::CVStyle ON_BezierCage::GetCV ON_BezierCage::Weight
int ON_BezierCage::CVSize | ( | ) | const |
ON::point_style ON_BezierCage::CVStyle | ( | ) | const |
Returns the style of control vertices in the m_cv array.
int ON_BezierCage::Degree | ( | int | ) | const |
void ON_BezierCage::Destroy | ( | ) |
Frees the CV array and sets all members to zero.
int ON_BezierCage::Dimension | ( | ) | const |
The dimension of the image of the bazier volume map. This is generally three, but can be any positive integer.
ON_Interval ON_BezierCage::Domain | ( | int | ) | const |
void ON_BezierCage::Dump | ( | ON_TextLog & | text_log | ) | const |
void ON_BezierCage::EmergencyDestroy | ( | ) |
Sets all members to zero. Does not free the CV array even when m_cv is not nullptr. Generally used when the CVs were allocated from a memory pool that no longer exists and the free done in ~ON_BezierCage would cause a crash.
bool ON_BezierCage::Evaluate | ( | double | r, |
double | s, | ||
double | t, | ||
int | der_count, | ||
int | v_stride, | ||
double * | v | ||
) | const |
returns false if unable to evaluate
bool ON_BezierCage::GetBBox | ( | double * | boxmin, |
double * | boxmax, | ||
bool | bGrowBox = false |
||
) | const |
Gets the axis aligned bounding box that contains the bezier's control points. The bezier volume maps the unit cube into this box.
boxmin | [in] array of Dimension() doubles |
boxmax | [in] array of Dimension() doubles bGrowBox = [in] if true and the input is a valid box then the input box is grown to include this object's bounding box. |
bool ON_BezierCage::GetCV | ( | int | i, |
int | j, | ||
int | k, | ||
ON::point_style | , | ||
double * | |||
) | const |
bool ON_BezierCage::GetCV | ( | int | i, |
int | j, | ||
int | k, | ||
ON_3dPoint & | |||
) | const |
bool ON_BezierCage::GetCV | ( | int | i, |
int | j, | ||
int | k, | ||
ON_4dPoint & | |||
) | const |
bool ON_BezierCage::IsRational | ( | ) | const |
bool ON_BezierCage::IsSingular | ( | int | ) | const |
bool ON_BezierCage::IsValid | ( | ) | const |
Tests class to make sure members are correctly initialized.
bool ON_BezierCage::MakeNonRational | ( | ) |
bool ON_BezierCage::MakeRational | ( | ) |
ON_BezierCage& ON_BezierCage::operator= | ( | const ON_BezierCage & | src | ) |
int ON_BezierCage::Order | ( | int | ) | const |
ON_3dPoint ON_BezierCage::PointAt | ( | double | r, |
double | s, | ||
double | t | ||
) | const |
Evaluates bezer volume map.
rst | [in] |
ON_3dPoint ON_BezierCage::PointAt | ( | ON_3dPoint | rst | ) | const |
Evaluates bezer volume map.
rst | [in] |
bool ON_BezierCage::Read | ( | ON_BinaryArchive & | archive | ) |
Reads the definition of this class from an archive previously saved by ON_BezierVolue::Write.
archive | [in] target archive |
bool ON_BezierCage::ReserveCVCapacity | ( | int | cv_capacity | ) |
Tools for managing CV and knot memory.
cv_capacity - [in] number of doubles to reserve
bool ON_BezierCage::Rotate | ( | double | sin_angle, |
double | cos_angle, | ||
const ON_3dVector & | rotation_axis, | ||
const ON_3dPoint & | rotation_center | ||
) |
Rotates the bezier surface about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule).
sin_angle | [in] sine of rotation angle |
cos_angle | [in] sine of rotation angle |
rotation_axis | [in] direction of the axis of rotation |
rotation_center | [in] point on the axis of rotation |
Uses ON_BezierCage::Transform() function to calculate the result.
bool ON_BezierCage::Rotate | ( | double | rotation_angle, |
const ON_3dVector & | rotation_axis, | ||
const ON_3dPoint & | rotation_center | ||
) |
Rotates the bezier surface about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule).
rotation_angle | [in] angle of rotation in radians |
rotation_axis | [in] direction of the axis of rotation |
rotation_center | [in] point on the axis of rotation |
Uses ON_BezierCage::Transform() function to calculate the result.
bool ON_BezierCage::Scale | ( | double | scale_factor | ) |
Scales the bezier surface by the specified facotor. The scale is centered at the origin.
scale_factor | [in] scale factor |
Uses ON_BezierCage::Transform() function to calculate the result.
bool ON_BezierCage::SetCV | ( | int | i, |
int | j, | ||
int | k, | ||
ON::point_style | , | ||
const double * | |||
) |
bool ON_BezierCage::SetCV | ( | int | i, |
int | j, | ||
int | k, | ||
const ON_3dPoint & | point | ||
) |
bool ON_BezierCage::SetCV | ( | int | i, |
int | j, | ||
int | k, | ||
const ON_4dPoint & | hpoint | ||
) |
bool ON_BezierCage::SetWeight | ( | int | i, |
int | j, | ||
int | k, | ||
double | w | ||
) |
bool ON_BezierCage::Transform | ( | const ON_Xform & | xform | ) |
bool ON_BezierCage::Translate | ( | const ON_3dVector & | translation_vector | ) |
Translates the bezier surface along the specified vector.
translation_vector | [in] translation vector |
Uses ON_BezierCage::Transform() function to calculate the result.
double ON_BezierCage::Weight | ( | int | i, |
int | j, | ||
int | k | ||
) | const |
bool ON_BezierCage::Write | ( | ON_BinaryArchive & | archive | ) | const |
Saves the definition of this class in serial binary form that can be read by ON_BezierVolue::Read.
archive | [in] target archive |
bool ON_BezierCage::ZeroCVs | ( | ) |
double* ON_BezierCage::m_cv |
int ON_BezierCage::m_cv_capacity |
int ON_BezierCage::m_cv_stride[3] |
int ON_BezierCage::m_dim |
Implementation.
bool ON_BezierCage::m_is_rat |
int ON_BezierCage::m_order[3] |