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

ON_SubDHash provides a simple way to save a SubD's vertex, edge, and face SHA1 hashes. Typically it is used when a calculation needs to know if the current SubD has is geometrically identical to a previous SubD. When speed is not important, comparing the current value of ON_SubD::GeometryHash() to a previously save value of ON_SubD::GeometryHash() is functionally identical but typically much slower when the SubDs are different. More...

#include <opennurbs_subd.h>

Public Member Functions

 ON_SubDEdgeSharpness ()=default
 
 ON_SubDEdgeSharpness (const ON_SubDEdgeSharpness &)=default
 
 ~ON_SubDEdgeSharpness ()=default
 
double Average () const
 Return the average of the sharpness interval. More...
 
double Delta () const
 
double EndSharpness (int end_index) const
 Get the sharpness at the start or end. More...
 
bool IsConstant () const
 
bool IsConstant (bool bCreaseResult) const
 
bool IsCrease () const
 
bool IsCreaseOrSharp () const
 
bool IsDecreasing () const
 
bool IsIncreasing () const
 
bool IsNotValid () const
 
bool IsNotValid (bool bCreaseResult) const
 
bool IsSharp () const
 
bool IsValid () const
 
bool IsValid (bool bCreaseResult) const
 
bool IsVariable () const
 
bool IsZero () const
 
Returns
True if the sharpness is zero.
More...
 
double MaximumEndSharpness () const
 Return the maximum of the sharpness interval. More...
 
double MinimumEndSharpness () const
 Return the minimum of the sharpness interval. More...
 
ON_SubDEdgeSharpnessoperator= (const ON_SubDEdgeSharpness &)=default
 
double operator[] (int end_index) const
 Get the edge sharpness at the start or end. More...
 
const ON_SubDEdgeSharpness Reversed () const
 
const ON_SubDEdgeSharpness Subdivided (int end_index) const
 Sharpness value for a subdivided edge. More...
 
const ON_wString ToPercentageText (bool bOrderMinToMax) const
 Create a text string describing the sharpness as a percentage. If the sharpness is constant, and single percentage is returned. If the sharpness is variable, percentage range returned. If the sharpness is not valid, a warning sign is returned. More...
 
int Trend () const
 

Static Public Member Functions

static bool EqualDelta (const class ON_SubDEdgePtr &eptr0, const class ON_SubDEdgePtr &eptr1)
 Determine if edges are adjacent, have the same sharpness trend, and equal adjacent sharpness values. More...
 
static bool EqualDelta (ON_SubDEdgeSharpness s0, ON_SubDEdgeSharpness s1)
 
static bool EqualEndSharpness (const class ON_SubDEdgePtr &eptr0, const class ON_SubDEdgePtr &eptr1)
 Determine if edges are adjacent and have equal adjacent sharpness values. More...
 
static bool EqualEndSharpness (ON_SubDEdgeSharpness s0, ON_SubDEdgeSharpness s1)
 
static bool EqualTrend (const class ON_SubDEdgePtr &eptr0, const class ON_SubDEdgePtr &eptr1)
 Determine if edges are adjacent, have the same sharpness trend, and equal adjacent sharpness values. More...
 
static bool EqualTrend (ON_SubDEdgeSharpness s0, ON_SubDEdgeSharpness s1)
 
static const ON_SubDEdgeSharpness FromConstant (double sharpness)
 Create a constant ON_SubDEdgeSharpness; More...
 
static const ON_SubDEdgeSharpness FromInterval (const class ON_Interval &sharpness_interval)
 Create a variable ON_SubDEdgeSharpness; More...
 
static const ON_SubDEdgeSharpness FromInterval (double sharpness0, double sharpness1)
 Create a variable ON_SubDEdgeSharpness; More...
 
static bool IsConstant (const ON_SimpleArray< ON_SubDEdgePtr > &edges, bool bCreaseResult)
 Determine if all the input edges have idential constant sharpeness. More...
 
static bool IsConstant (size_t edge_count, const ON_SubDEdgePtr *edges, bool bCreaseResult)
 Determine if all the input edges have idential constant sharpeness. More...
 
static bool IsValidValue (double candidate_value, bool bCreaseResult)
 Determine if candidate_value is a valid edge end sharpness value. More...
 
static double Sanitize (double sharpness)
 Verify 0 <= sharpness <= ON_SubDEdgeSharpness::MaximumValue and return an integer value when the input sharpenss is within ON_SubDEdgeSharpness::Tolerance of an integer. More...
 
static double Sanitize (double sharpness, double invalid_input_result)
 Verify 0 <= sharpness <= ON_SubDEdgeSharpness::MaximumValue and return an integer value when the input sharpenss is within ON_SubDEdgeSharpness::Tolerance of an integer. More...
 
static unsigned SetEdgeChainSharpness (ON_Interval chain_sharpness_range, unsigned edge_count, ON_SimpleArray< ON_SubDEdgeSharpness > &chain_edge_sharpness)
 Set chain_edge_sharpness to a sequence of evenly changing sharpnesses beginning with chain_sharpness_range[0] and ending with chain_sharpness_range[1]. More...
 
static unsigned SetEdgeChainSharpness (ON_Interval chain_sharpness_range, unsigned edge_count, ON_SubDEdgeSharpness *chain_edge_sharpness)
 Set chain_edge_sharpness to a sequence of evenly changing sharpnesses beginning with chain_sharpness_range[0] and ending with chain_sharpness_range[1]. More...
 
static double SharpnessFromNormalizedValue (double normalized_slider_value)
 Convert a user facing slider value to a SubD edge end sharpness value. More...
 
static double SharpnessFromSliderValue (ON_Interval slider_domain, double slider_value, double invalid_input_result)
 Convert a user facing slider value to a SubD edge end sharpness value. More...
 
static double ToPercentage (double sharpness, double crease_percentage)
 Convert sharpness to a percentage from 0 to 100.0. This is useful in user interface code that experesses sharpness in percentages. More...
 
static const ON_wString ToPercentageText (double sharpness)
 Create a text string describing the sharpness as a percentage. This is useful in user interface code that expresses sharpness in percentages. If 0 <= sharpness <= ON_SubDEdgeSharpness::MaximumValue, valid, a number followed by a percent sign is returned. If sharpness = ON_SubDEdgeSharpness::CreaseValue, "crease" is returned. If the sharpness is not valid, a warning sign is returned. More...
 
static const ON_SubDEdgeSharpness Union (const ON_SubDEdgeSharpness &a, const ON_SubDEdgeSharpness &b)
 Return a sharpness interval that is the union of the nonzero input sharpness intervals. More...
 
static double VertexSharpness (ON_SubDVertexTag vertex_tag, double interior_crease_vertex_sharpness, unsigned sharp_edge_end_count, double maximum_edge_end_sharpness)
 Calculate the vertex sharpness from the attached sharp edge information. Note that vertices with a corner tag always have zero sharpness. More...
 
static double VertexSharpness (ON_SubDVertexTag vertex_tag, unsigned sharp_edge_end_count, double maximum_edge_end_sharpness)
 

Static Public Attributes

static const ON_SubDEdgeSharpness Crease
 An edge sharpness with both end values = ON_SubDEdgeSharpness::CreaseValue. This value is not a valid sharpness value for a sharp edge (A sharp edge a smooth edge with nonzero sharpness). When working with edges, it is sometimes convenient to have an ON_SubDEdgeSharpness value that indicated the edge is a crease. ON_SubDEdgeSharpness::Crease is used for this purpose. More...
 
static const double CreaseValue
 ON_SubDEdgeSharpness::CreaseValue = ON_SubDEdgeSharpness::MaximumValue + 1. Valid SubD edge sharpness values are <= ON_SubDEdgeSharpness::MaximumValue. This value is used when it is convenient to use and ON_SubDEdgeSharpness to indicate an edge has a crease tag. Edges with crease tags always have a sharpness property of ON_SubDEdgeSharpness::Smooth. More...
 
static const ON_SubDEdgeSharpness Maximum
 An edge sharpness with constant value ON_SubDEdgeSharpness::MaximumValue. This is the maximum sharpness that can be applied to an edge. More...
 
static const double MaximumValue
 ON_SubDEdgeSharpness::MaximumValue = 4. SubD edge sharpness values are <= ON_SubDEdgeSharpness::MaximumValue. More...
 
static const ON_SubDEdgeSharpness Nan
 An edge sharpness with both end values = ON_DBL_QNAN. More...
 
static const ON_SubDEdgeSharpness Smooth
 An edge sharpness with constant value 0.0. More...
 
static const double SmoothValue
 ON_SubDEdgeSharpness::SmoothValue = 0.0. Valid SubD edge sharpness values are <= ON_SubDEdgeSharpness::MaximumValue. Smooth edges have a sharpness property of ON_SubDEdgeSharpness::Smooth. More...
 
static const double Tolerance
 ON_SubDEdgeSharpness::Tolerance = 0.01 If an edge has sharpness within ON_SubDEdgeSharpness::Tolerance of an integer value, the sharpness is set to that integer value. More...
 

Detailed Description

ON_SubDHash provides a simple way to save a SubD's vertex, edge, and face SHA1 hashes. Typically it is used when a calculation needs to know if the current SubD has is geometrically identical to a previous SubD. When speed is not important, comparing the current value of ON_SubD::GeometryHash() to a previously save value of ON_SubD::GeometryHash() is functionally identical but typically much slower when the SubDs are different.