Rhino C++ API  8.13
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
ON_SubDFaceParameter Class Reference

#include <opennurbs_subd.h>

Public Member Functions

 ON_SubDFaceParameter ()=default
 
 ON_SubDFaceParameter (const ON_SubDFaceParameter &)=default
 
 ON_SubDFaceParameter (ON_SubDFaceCornerDex cdex, double corner_s, double corner_t)
 Create a SubD face parameter that identifies a point on the face. The parameters (0,0) correspond the the corner vertex cdex.Vertex(face). The corner_s parameter runs from the corner vertex to the midpoint of cdex.RightEdge(face). The corner_t parameter runs from the corner vertex to the midpoint of cdex.LeftEdge(face). The parameters (1/2, 1/2) correspond the the center of the face. More...
 
 ~ON_SubDFaceParameter ()=default
 
const bool AtVertex () const
 An evaluation point is at a SubD vertex if IsSet() is true and FaceCornerParameters() = (0,0, 0,0). More...
 
const ON_SubDFaceCornerDex FaceCornerDex () const
 m_cdex identifies face's subdivision quad the s and t parameters apply to. The corner vertex is V = m_cdex.Vertex(face). The edge entering the corner is LE = m_cdex.LeftEdge(face). The edge leaving the corner is RE = m_cdex.RightEdge(face). V = LE.RelativeVertex(1) = RE.RelativeVertex(0). More...
 
const ON_2dPoint FaceCornerParameters () const
 cdex = FaceCornerDex() identifies face's subdivision quad the s and t parameters apply to. The corner vertex is V = cdex.Vertex(face). The edge entering the corner is LE = cdex.LeftEdge(face). The edge leaving the corner is RE = cdex.RightEdge(face). V = LE.RelativeVertex(1) = RE.RelativeVertex(0). More...
 
bool IsNotSet ()
 
Returns
True if all values are not valid.
More...
 
bool IsNotSet () const
 
bool IsSet ()
 
Returns
True if all values are valid.
More...
 
bool IsSet () const
 
const bool OnEdge () const
 An evaluation point is on a subD edge if IsSet() is true and at least one of the values in FaceCornerParameters() is 0.0. More...
 
ON_SubDFaceParameteroperator= (const ON_SubDFaceParameter &)=default
 
const ON_2dPoint QuadFaceParameters () const
 For quad faces, QuadFaceParameters() returns 2 normalized parameters that span the entire quad face. The 2d points (0,0), (1,0), (1,1), (0,1) corresponed to the quad face's vertices face.Vertex(0), face.Vertex(1), face.Vertex(2), face.Vertex(3). More...
 

Static Public Member Functions

static int Compare (const ON_SubDFaceParameter *lhs, const ON_SubDFaceParameter *rhs)
 Well ordered dictionary compare that uses ON_SubDFaceParameter::CompareAll() to compare nonnull values and safely sorts nullptr to the end. More...
 
static int CompareAll (const ON_SubDFaceParameter &lhs, const ON_SubDFaceParameter &rhs)
 Well ordered dictionary compare of m_cdex, m_s, and m_t using ON_SubDFaceCornerDex::CompareAll() and ON_DBL::CompareValue(). Any set value < any unset value. More...
 
static const ON_SubDFaceParameter CreateFromQuadFaceParameteters (double quad_face_s, double quad_face_t)
 Create at ON_SubDFaceParameter the corresponds to the the specified quad face parameters. The quad face parameters for face.Vertex(0) are (0,0). The quad face parameters for face.Vertex(1) are (1,0). The quad face parameters for face.Vertex(2) are (1,1). The quad face parameters for face.Vertex(3) are (0,1). More...
 

Static Public Attributes

static const ON_SubDFaceParameter Nan
 ON_SubDFaceParameter::Nan has face_edge_count=0, corner_index=0, s=ON_DBL_QNAN, t=ON_DBL_QNAN. More...
 

Constructor & Destructor Documentation

◆ ON_SubDFaceParameter() [1/3]

ON_SubDFaceParameter::ON_SubDFaceParameter ( )
default

◆ ~ON_SubDFaceParameter()

ON_SubDFaceParameter::~ON_SubDFaceParameter ( )
default

◆ ON_SubDFaceParameter() [2/3]

ON_SubDFaceParameter::ON_SubDFaceParameter ( const ON_SubDFaceParameter )
default

◆ ON_SubDFaceParameter() [3/3]

ON_SubDFaceParameter::ON_SubDFaceParameter ( ON_SubDFaceCornerDex  cdex,
double  corner_s,
double  corner_t 
)

Create a SubD face parameter that identifies a point on the face. The parameters (0,0) correspond the the corner vertex cdex.Vertex(face). The corner_s parameter runs from the corner vertex to the midpoint of cdex.RightEdge(face). The corner_t parameter runs from the corner vertex to the midpoint of cdex.LeftEdge(face). The parameters (1/2, 1/2) correspond the the center of the face.

Parameters
cdexIdentifies the face's corner subdivison quad.
corner_s0 <= corner_s <= 1/2
corner_t0 <= corner_t <= 1/2

Member Function Documentation

◆ AtVertex()

const bool ON_SubDFaceParameter::AtVertex ( ) const

An evaluation point is at a SubD vertex if IsSet() is true and FaceCornerParameters() = (0,0, 0,0).

Returns
True if the evaluation point is at a SubD vertex.

◆ Compare()

static int ON_SubDFaceParameter::Compare ( const ON_SubDFaceParameter lhs,
const ON_SubDFaceParameter rhs 
)
static

Well ordered dictionary compare that uses ON_SubDFaceParameter::CompareAll() to compare nonnull values and safely sorts nullptr to the end.

Parameters
lhs
rhs
Returns

◆ CompareAll()

static int ON_SubDFaceParameter::CompareAll ( const ON_SubDFaceParameter lhs,
const ON_SubDFaceParameter rhs 
)
static

Well ordered dictionary compare of m_cdex, m_s, and m_t using ON_SubDFaceCornerDex::CompareAll() and ON_DBL::CompareValue(). Any set value < any unset value.

Parameters
lhs
rhs
Returns
-1: lhs < rhs 0: lhs = rhs +1: lhs > rhs

◆ CreateFromQuadFaceParameteters()

static const ON_SubDFaceParameter ON_SubDFaceParameter::CreateFromQuadFaceParameteters ( double  quad_face_s,
double  quad_face_t 
)
static

Create at ON_SubDFaceParameter the corresponds to the the specified quad face parameters. The quad face parameters for face.Vertex(0) are (0,0). The quad face parameters for face.Vertex(1) are (1,0). The quad face parameters for face.Vertex(2) are (1,1). The quad face parameters for face.Vertex(3) are (0,1).

Parameters
quad_face_s0 <= quad_face_s &lt= 1.
quad_face_t0 <= quad_face_t &lt= 1.
Returns
The ON_SubDFaceParameter the references the quad face point.

◆ FaceCornerDex()

const ON_SubDFaceCornerDex ON_SubDFaceParameter::FaceCornerDex ( ) const

m_cdex identifies face's subdivision quad the s and t parameters apply to. The corner vertex is V = m_cdex.Vertex(face). The edge entering the corner is LE = m_cdex.LeftEdge(face). The edge leaving the corner is RE = m_cdex.RightEdge(face). V = LE.RelativeVertex(1) = RE.RelativeVertex(0).

◆ FaceCornerParameters()

const ON_2dPoint ON_SubDFaceParameter::FaceCornerParameters ( ) const

cdex = FaceCornerDex() identifies face's subdivision quad the s and t parameters apply to. The corner vertex is V = cdex.Vertex(face). The edge entering the corner is LE = cdex.LeftEdge(face). The edge leaving the corner is RE = cdex.RightEdge(face). V = LE.RelativeVertex(1) = RE.RelativeVertex(0).

p = FaceCornerParameters(); The p.x parameter runs along half of RE from V to the midpoint of RE. 0 <= p.x < 1/2. The p.y parameter runs along half of LE from V to the midpoint of LE. 0 <= p.y < 1/2. At V, p=(0,0). At the midpoint of RE, p=(1/2,0) At the midpoint of LE, p=(0,1/2) At the center of the face, p=(1/2,1/2).

◆ IsNotSet() [1/2]

bool ON_SubDFaceParameter::IsNotSet ( )

Returns
True if all values are not valid.

◆ IsNotSet() [2/2]

bool ON_SubDFaceParameter::IsNotSet ( ) const

◆ IsSet() [1/2]

bool ON_SubDFaceParameter::IsSet ( )

Returns
True if all values are valid.

◆ IsSet() [2/2]

bool ON_SubDFaceParameter::IsSet ( ) const

◆ OnEdge()

const bool ON_SubDFaceParameter::OnEdge ( ) const

An evaluation point is on a subD edge if IsSet() is true and at least one of the values in FaceCornerParameters() is 0.0.

Returns
True if the evaluation point is on a SubD edge.

◆ operator=()

ON_SubDFaceParameter& ON_SubDFaceParameter::operator= ( const ON_SubDFaceParameter )
default

◆ QuadFaceParameters()

const ON_2dPoint ON_SubDFaceParameter::QuadFaceParameters ( ) const

For quad faces, QuadFaceParameters() returns 2 normalized parameters that span the entire quad face. The 2d points (0,0), (1,0), (1,1), (0,1) corresponed to the quad face's vertices face.Vertex(0), face.Vertex(1), face.Vertex(2), face.Vertex(3).

Returns
If m_cdex.IsQUadFace() is true, then the 2 normalized quad face parameters corresponding to this ON_SubDFaceParameter are returned. Otherwise ON_2dPoint::NanPoint is returned.

Member Data Documentation

◆ Nan

const ON_SubDFaceParameter ON_SubDFaceParameter::Nan
static

ON_SubDFaceParameter::Nan has face_edge_count=0, corner_index=0, s=ON_DBL_QNAN, t=ON_DBL_QNAN.