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

#include <opennurbs_mesh.h>

Public Member Functions

 ON_SurfaceCurvatureColorMapping ()=default
 
 ON_SurfaceCurvatureColorMapping (const ON_SurfaceCurvatureColorMapping &)=default
 
 ON_SurfaceCurvatureColorMapping (ON::curvature_style kappa_style, ON_Interval kappa_range, ON_Interval hue_range_in_radians)
 Construct a ON_SurfaceCurvatureColorMapping for converting a specified range of curvatures to a color. More...
 
 ON_SurfaceCurvatureColorMapping (ON::curvature_style m_kappa_style, ON_Interval kappa_range)
 Construct a ON_SurfaceCurvatureColorMapping for converting a specified range of curvatures to a color. More...
 
 ~ON_SurfaceCurvatureColorMapping ()=default
 
const ON_Color Color (ON_SurfaceCurvature K) const
 Get the color the the settings in this ON_SurfaceCurvatureColorMapping assign to a pair of principal surface curvatures. More...
 
const ON_MappingTag ColorMappingTag () const
 The returned mapping tag is ideal for setting the ON_SubD fragment and ON_Mesh per vertex color tag when the colors are set by calling this->Color() on the per vertex principal surface curvatures. More...
 
ON__UINT32 CRC32 () const
 Get a 32 bit CRC hash that identifies the settings in this ON_SurfaceCurvatureColorMapping. More...
 
const ON_SHA1_Hash Hash () const
 Get a SHA1 hash that uniquely identifies the settings in this ON_SurfaceCurvatureColorMapping. This hash is ideal for use as a SubD fragment colors hash. More...
 
const ON_Interval HueRangeInRadians () const
 
bool IsSet () const
 
bool IsUnset () const
 
const ON_Interval KappaRange () const
 
ON::curvature_style KappaStyle () const
 
ON_SurfaceCurvatureColorMappingoperator= (const ON_SurfaceCurvatureColorMapping &)=default
 

Static Public Attributes

static const ON_Interval DefaultHueRangeRadians
 The default surface curvature color analysis hue range used by the Rhino CurvatureAnalysis command is 0 to 4pi/3 (red to blue) More...
 
static const ON_UUID Id
 {639E9144-1C1A-4bba-8248-D330F50D7B69} The id ON_SurfaceCurvatureColorMapping::Id identifies the surface curvature color analysis used by the Rhino CurvatureAnalysis command and is used as the id for mapping tags that indicate per vertex colors were set from surface principal curvatures. More...
 
static const ON_SurfaceCurvatureColorMapping Unset
 

Constructor & Destructor Documentation

◆ ON_SurfaceCurvatureColorMapping() [1/4]

ON_SurfaceCurvatureColorMapping::ON_SurfaceCurvatureColorMapping ( )
default

◆ ~ON_SurfaceCurvatureColorMapping()

ON_SurfaceCurvatureColorMapping::~ON_SurfaceCurvatureColorMapping ( )
default

◆ ON_SurfaceCurvatureColorMapping() [2/4]

ON_SurfaceCurvatureColorMapping::ON_SurfaceCurvatureColorMapping ( const ON_SurfaceCurvatureColorMapping )
default

◆ ON_SurfaceCurvatureColorMapping() [3/4]

ON_SurfaceCurvatureColorMapping::ON_SurfaceCurvatureColorMapping ( ON::curvature_style  m_kappa_style,
ON_Interval  kappa_range 
)

Construct a ON_SurfaceCurvatureColorMapping for converting a specified range of curvatures to a color.

Parameters
kappa_styleSpecifies what curvature value to used.
kappa_rangeA range that is used to convert kappa values to colors. This interval may be increasing, decreasing, or a singleton. A kappa value equal to kappa_range[0] is mapped to ON_SurfaceCurvatureColorMapping::DefaultHueRangeRadians[0]. A kappa value equal to kappa_range[1] is mapped to ON_SurfaceCurvatureColorMapping::DefaultHueRangeRadians[1]. A kappa value k in between kappa_range[0] and kappa_range[1] is mapped to the saturated color with hue = ON_SurfaceCurvatureColorMapping::DefaultHueRangeRadians.ParameterAt(kappa_range.NormalizedParameterAt(k)). Kappa values outside the kappa_range interval are mapped to the hue assigned to the nearest end of the kappa_range interval.

◆ ON_SurfaceCurvatureColorMapping() [4/4]

ON_SurfaceCurvatureColorMapping::ON_SurfaceCurvatureColorMapping ( ON::curvature_style  kappa_style,
ON_Interval  kappa_range,
ON_Interval  hue_range_in_radians 
)

Construct a ON_SurfaceCurvatureColorMapping for converting a specified range of curvatures to a color.

Parameters
kappa_styleSpecifies what curvature value to used.
kappa_rangeA range that is used to convert kappa values to colors. This interval may be increasing, decreasing, or a singleton. A kappa value equal to kappa_range[0] is mapped to hue_range_in_radians[0]. A kappa value equal to kappa_range[1] is mapped to hue_range_in_radians[1]. A kappa value k in between kappa_range[0] and kappa_range[1] is mapped to the saturated color with hue = hue_range_in_radians.ParameterAt(kappa_range.NormalizedParameterAt(k)). Kappa values outside the kappa_range interval are mapped to the hue assigned to the nearest end of the kappa_range interval.
hue_range_in_radiansWhen in doubt, pass ON_SurfaceCurvatureColorMapping::DefaultHueRangeRadians. This parameter specifies the range of color hues (in radians) assigned to the kappa_range interval. This interval may be increasing or decreasing.

Member Function Documentation

◆ Color()

const ON_Color ON_SurfaceCurvatureColorMapping::Color ( ON_SurfaceCurvature  K) const

Get the color the the settings in this ON_SurfaceCurvatureColorMapping assign to a pair of principal surface curvatures.

Parameters
Kprincipal surface curvatures
Returns
If K and this->IsSet() is true, then the color assigned to the principal curvatures K is returned. Otherwise ON_Color::UnsetColor is returned.

◆ ColorMappingTag()

const ON_MappingTag ON_SurfaceCurvatureColorMapping::ColorMappingTag ( ) const

The returned mapping tag is ideal for setting the ON_SubD fragment and ON_Mesh per vertex color tag when the colors are set by calling this->Color() on the per vertex principal surface curvatures.

Returns
If this->ISSet() is true, a mapping tag with type = ON_TextureMapping::TYPE::false_colors, id = ON_SurfaceCurvatureColorMapping::Id, crc = this->CRC32() xform = identity is returned. Otherwise ON_MappingTag::Unset is returned.

◆ CRC32()

ON__UINT32 ON_SurfaceCurvatureColorMapping::CRC32 ( ) const

Get a 32 bit CRC hash that identifies the settings in this ON_SurfaceCurvatureColorMapping.

Returns
If this->IsSet() is true, this->Hash()CRC32(0) is returned. Otherwise 0 is returned.

◆ Hash()

const ON_SHA1_Hash ON_SurfaceCurvatureColorMapping::Hash ( ) const

Get a SHA1 hash that uniquely identifies the settings in this ON_SurfaceCurvatureColorMapping. This hash is ideal for use as a SubD fragment colors hash.

Returns
If this->IsSet() is true, a SHA1 hash that uniquely identifies the settings in this ON_SurfaceCurvatureColorMapping is returned. Otherwise ON_SHA1_Hash::EmptyContentHash() is returned.

◆ HueRangeInRadians()

const ON_Interval ON_SurfaceCurvatureColorMapping::HueRangeInRadians ( ) const

◆ IsSet()

bool ON_SurfaceCurvatureColorMapping::IsSet ( ) const
Returns
If the curvature type, range, and hure range are set and valid, then true is returned. Otherwise false is returned.

◆ IsUnset()

bool ON_SurfaceCurvatureColorMapping::IsUnset ( ) const
Returns
If one or more of the curvature type, range, and hure range are not set or are not valid, valid, then true is returned. Otherwise false is returned.

◆ KappaRange()

const ON_Interval ON_SurfaceCurvatureColorMapping::KappaRange ( ) const

◆ KappaStyle()

ON::curvature_style ON_SurfaceCurvatureColorMapping::KappaStyle ( ) const

◆ operator=()

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

Member Data Documentation

◆ DefaultHueRangeRadians

const ON_Interval ON_SurfaceCurvatureColorMapping::DefaultHueRangeRadians
static

The default surface curvature color analysis hue range used by the Rhino CurvatureAnalysis command is 0 to 4pi/3 (red to blue)

◆ Id

const ON_UUID ON_SurfaceCurvatureColorMapping::Id
static

{639E9144-1C1A-4bba-8248-D330F50D7B69} The id ON_SurfaceCurvatureColorMapping::Id identifies the surface curvature color analysis used by the Rhino CurvatureAnalysis command and is used as the id for mapping tags that indicate per vertex colors were set from surface principal curvatures.

◆ Unset

const ON_SurfaceCurvatureColorMapping ON_SurfaceCurvatureColorMapping::Unset
static