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

#include <opennurbs_subd.h>

Public Member Functions

 ON_SubDVertexSharpnessCalculator ()=default
 
 ON_SubDVertexSharpnessCalculator (const ON_SubDVertex *vertex)
 This constructor completely initializes the class and you may immediately call VertexSharpness() and VertexSharpPoint(). More...
 
 ON_SubDVertexSharpnessCalculator (const ON_SubDVertexSharpnessCalculator &)=default
 
 ON_SubDVertexSharpnessCalculator (ON_SubDVertexTag vertex_tag, ON_3dPoint vertex_control_net_point, double maximum_sharpness_at_interior_crease_vertex)
 This constructor begins the initialization of the class. You must call AddEdgeSharpnessAndControlNetPoint() or AddCreaseEdgeControlNetPoint() for each edge attached to the vertex. This technique is useful when iteratove subdivision calculations are being performed an no explicit ON_SubDVertex exists. More...
 
 ~ON_SubDVertexSharpnessCalculator ()=default
 
bool AddCreaseEdgeControlNetPoint (ON_3dPoint other_end_control_net_point)
 You may call this function if the edge in question is a crease edge attached to the vertex. More...
 
bool AddEdgeSharpnessAndControlNetPoint (double sharpness_at_vertex, ON_3dPoint other_end_control_net_point)
 If this class was created using the constructor that has a vertex tag and that tag was ON_SubDVertexTag::Smooth or ON_SubDVertexTag::Dart, or ON_SubDVertexTag::Crease, then you you must call this function for every sharp edge connected to the vertex. More...
 
unsigned CreaseEdgeCount () const
 
Returns
Number of crease edges attached to the vertex.
More...
 
unsigned EdgeCount () const
 
Returns
Number of edges attached to the vertex.
More...
 
bool IsSharpVertex () const
 
ON_SubDVertexSharpnessCalculatoroperator= (const ON_SubDVertexSharpnessCalculator &)=default
 
bool SetVertex (const ON_SubDVertex *vertex)
 Completely initializes the class and you may immediately call VertexSharpness() and VertexSharpPoint(). More...
 
bool SetVertex (ON_SubDVertexTag vertex_tag, ON_3dPoint vertex_control_net_point, double maximum_sharpness_at_interior_crease_vertex)
 This constructor begins the initialization of the class. You must call AddEdgeSharpnessAndControlNetPoint() or AddCreaseEdgeControlNetPoint() for each edge attached to the vertex. This technique is useful when iteratove subdivision calculations are being performed an no explicit ON_SubDVertex exists. More...
 
unsigned SharpEdgeCount () const
 
Returns
Number of sharp edges attached to the vertex.
More...
 
const ON_3dPoint VertexControlNetPoint () const
 
bool VertexIsSet () const
 
double VertexSharpness () const
 When the vertex sharpness is > 0, the vertex subdivision point is a blend of this->VertexSharpPoint() and the Catmull-Clark subdivision point calculated as if there were no sharpness. More...
 
const ON_3dPoint VertexSharpPoint () const
 
ON_SubDVertexTag VertexTag () const
 

Static Public Attributes

static const ON_SubDVertexSharpnessCalculator Unset
 

Constructor & Destructor Documentation

◆ ON_SubDVertexSharpnessCalculator() [1/4]

ON_SubDVertexSharpnessCalculator::ON_SubDVertexSharpnessCalculator ( )
default

◆ ~ON_SubDVertexSharpnessCalculator()

ON_SubDVertexSharpnessCalculator::~ON_SubDVertexSharpnessCalculator ( )
default

◆ ON_SubDVertexSharpnessCalculator() [2/4]

ON_SubDVertexSharpnessCalculator::ON_SubDVertexSharpnessCalculator ( const ON_SubDVertexSharpnessCalculator )
default

◆ ON_SubDVertexSharpnessCalculator() [3/4]

ON_SubDVertexSharpnessCalculator::ON_SubDVertexSharpnessCalculator ( const ON_SubDVertex vertex)

This constructor completely initializes the class and you may immediately call VertexSharpness() and VertexSharpPoint().

Parameters
vertexVertex where sharpness information is desired.

◆ ON_SubDVertexSharpnessCalculator() [4/4]

ON_SubDVertexSharpnessCalculator::ON_SubDVertexSharpnessCalculator ( ON_SubDVertexTag  vertex_tag,
ON_3dPoint  vertex_control_net_point,
double  maximum_sharpness_at_interior_crease_vertex 
)

This constructor begins the initialization of the class. You must call AddEdgeSharpnessAndControlNetPoint() or AddCreaseEdgeControlNetPoint() for each edge attached to the vertex. This technique is useful when iteratove subdivision calculations are being performed an no explicit ON_SubDVertex exists.

Parameters
vertex_tag
vertex_control_net_point
maximum_sharpness_at_interior_crease_vertexIf the vertex_tag parameter is ON_SubDVertexTag::Crease and the vertex is an interior crease (two crease sectors),
then maximum_sharpness_at_interior_crease_vertex should be the maximum value of the edge sharpnesses of all non-crease edges at this vertex. In all other cases pass 0.0. When vertex_tag is not ON_SubDVertexTag::Crease, this parameter is always ignored.

Member Function Documentation

◆ AddCreaseEdgeControlNetPoint()

bool ON_SubDVertexSharpnessCalculator::AddCreaseEdgeControlNetPoint ( ON_3dPoint  other_end_control_net_point)

You may call this function if the edge in question is a crease edge attached to the vertex.

Parameters
other_end_control_net_pointThe control net point at edge's other vertex.

◆ AddEdgeSharpnessAndControlNetPoint()

bool ON_SubDVertexSharpnessCalculator::AddEdgeSharpnessAndControlNetPoint ( double  sharpness_at_vertex,
ON_3dPoint  other_end_control_net_point 
)

If this class was created using the constructor that has a vertex tag and that tag was ON_SubDVertexTag::Smooth or ON_SubDVertexTag::Dart, or ON_SubDVertexTag::Crease, then you you must call this function for every sharp edge connected to the vertex.

Parameters
sharpness_at_vertexIf the associated edge is a crease, then pass ON_SubDEdgeSharpness::CreaseValue (or call AddCreaseEdge(other_end)). If the associated edge is smooth, then pass the edge sharpness at the the end connect to the vertex in question.
other_end_control_net_pointThe control net point at edge's other vertex.
Returns
True if successful. False otherwise.

◆ CreaseEdgeCount()

unsigned ON_SubDVertexSharpnessCalculator::CreaseEdgeCount ( ) const

Returns
Number of crease edges attached to the vertex.

◆ EdgeCount()

unsigned ON_SubDVertexSharpnessCalculator::EdgeCount ( ) const

Returns
Number of edges attached to the vertex.

◆ IsSharpVertex()

bool ON_SubDVertexSharpnessCalculator::IsSharpVertex ( ) const
Returns
True if the vertex has nonzero sharpness.

◆ operator=()

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

◆ SetVertex() [1/2]

bool ON_SubDVertexSharpnessCalculator::SetVertex ( const ON_SubDVertex vertex)

Completely initializes the class and you may immediately call VertexSharpness() and VertexSharpPoint().

Parameters
vertexVertex where sharpness information is desired.

◆ SetVertex() [2/2]

bool ON_SubDVertexSharpnessCalculator::SetVertex ( ON_SubDVertexTag  vertex_tag,
ON_3dPoint  vertex_control_net_point,
double  maximum_sharpness_at_interior_crease_vertex 
)

This constructor begins the initialization of the class. You must call AddEdgeSharpnessAndControlNetPoint() or AddCreaseEdgeControlNetPoint() for each edge attached to the vertex. This technique is useful when iteratove subdivision calculations are being performed an no explicit ON_SubDVertex exists.

Parameters
vertex_tag
vertex_control_net_point
maximum_sharpness_at_interior_crease_vertexIf the vertex_tag parameter is ON_SubDVertexTag::Crease and the vertex is an interior crease (two crease sectors),
then maximum_sharpness_at_interior_crease_vertex should be the maximum value of the edge sharpnesses of all non-crease edges at this vertex. In all other cases pass 0.0. When vertex_tag is not ON_SubDVertexTag::Crease, this parameter is always ignored.
Returns
True if successful. False otherwise.

◆ SharpEdgeCount()

unsigned ON_SubDVertexSharpnessCalculator::SharpEdgeCount ( ) const

Returns
Number of sharp edges attached to the vertex.

◆ VertexControlNetPoint()

const ON_3dPoint ON_SubDVertexSharpnessCalculator::VertexControlNetPoint ( ) const
Returns
If the vertex has been set, the vertex's control net point is returned. Otherwise, ON_3dPoint::NanPoint is returned.

◆ VertexIsSet()

bool ON_SubDVertexSharpnessCalculator::VertexIsSet ( ) const
Returns
If the vertex has been set, true is returned. Otherwise, false is returned.

◆ VertexSharpness()

double ON_SubDVertexSharpnessCalculator::VertexSharpness ( ) const

When the vertex sharpness is > 0, the vertex subdivision point is a blend of this->VertexSharpPoint() and the Catmull-Clark subdivision point calculated as if there were no sharpness.

Returns
The vertex sharpness.

◆ VertexSharpPoint()

const ON_3dPoint ON_SubDVertexSharpnessCalculator::VertexSharpPoint ( ) const

Returns
If this->VertexSharpness() > 0, then this point must be blended with the Catmull-Clark subdivision point calculated as if there were no sharpness. Otherwise, 0 is returned.

◆ VertexTag()

ON_SubDVertexTag ON_SubDVertexSharpnessCalculator::VertexTag ( ) const
Returns
If the vertex has been set, the vertex's tag is returned. Otherwise, ON_SubDVertexTag::Unset is returned.

Member Data Documentation

◆ m_max_edge_sharpness_at_vertex

double ON_SubDVertexSharpnessCalculator::m_max_edge_sharpness_at_vertex = 0.0

◆ m_vertex_sharpness

double ON_SubDVertexSharpnessCalculator::m_vertex_sharpness

◆ Unset

const ON_SubDVertexSharpnessCalculator ON_SubDVertexSharpnessCalculator::Unset
static