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

#include <opennurbs_mesh.h>

Public Member Functions

 ON_SurfaceDraftAngleColorMapping ()=default
 
 ON_SurfaceDraftAngleColorMapping (const ON_SurfaceDraftAngleColorMapping &)=default
 
 ON_SurfaceDraftAngleColorMapping (ON_3dVector up, ON_Interval angle_range_in_radians)
 Construce a ON_SurfaceDraftAngleColorMapping for cnverting a specified range of draft angles to a color. More...
 
 ON_SurfaceDraftAngleColorMapping (ON_3dVector up, ON_Interval angle_range_in_radians, ON_Interval hue_range_in_radians)
 Construce a ON_SurfaceDraftAngleColorMapping for cnverting a specified range of draft angles to a color. More...
 
 ~ON_SurfaceDraftAngleColorMapping ()=default
 
const ON_Interval AngleRangeInRadians () const
 
const ON_Color Color (ON_3dVector surface_normal) const
 Get the color the the settings in this ON_SurfaceDraftAngleColorMapping assign to a surface normal. 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_SurfaceDraftAngleColorMapping. More...
 
const ON_SHA1_Hash Hash () const
 Get a SHA1 hash that uniquely identifies the settings in this ON_SurfaceDraftAngleColorMapping. This hash is ideal for use as a SubD fragment colors hash. More...
 
const ON_Interval HueRangeInRadians () const
 
bool IsSet () const
 
bool IsUnset () const
 
ON_SurfaceDraftAngleColorMappingoperator= (const ON_SurfaceDraftAngleColorMapping &)=default
 
const ON_3dVector Up () const
 

Static Public Attributes

static const ON_Interval DefaultHueRangeRadians
 The default surface draft angle color analysis hue range used by the Rhino DraftAngleAnalysis command is 0 to 4pi/3 (red to blue) More...
 
static const ON_UUID Id
 ///< {F08463F4-22E2-4cf1-B810-F01925446D71} The id ON_SurfaceDraftAngleColorMapping::Id identifies the surface draft angle color analysis used by the Rhino DraftAngleAnalysis command and is used as the id for mapping tags that indicate per vertex colors were set from surface normal draft angles. More...
 
static const ON_SurfaceDraftAngleColorMapping Unset
 

Constructor & Destructor Documentation

◆ ON_SurfaceDraftAngleColorMapping() [1/4]

ON_SurfaceDraftAngleColorMapping::ON_SurfaceDraftAngleColorMapping ( )
default

◆ ~ON_SurfaceDraftAngleColorMapping()

ON_SurfaceDraftAngleColorMapping::~ON_SurfaceDraftAngleColorMapping ( )
default

◆ ON_SurfaceDraftAngleColorMapping() [2/4]

ON_SurfaceDraftAngleColorMapping::ON_SurfaceDraftAngleColorMapping ( const ON_SurfaceDraftAngleColorMapping )
default

◆ ON_SurfaceDraftAngleColorMapping() [3/4]

ON_SurfaceDraftAngleColorMapping::ON_SurfaceDraftAngleColorMapping ( ON_3dVector  up,
ON_Interval  angle_range_in_radians 
)

Construce a ON_SurfaceDraftAngleColorMapping for cnverting a specified range of draft angles to a color.

Parameters
upSpecify the up direction used to caluclate the draft angle. The draft angle of a surface normal N is 0 if N is perpendicular to up, pi/2 (90 degrees) if N an up piont the same direction, and -pi/2 (-90 degrees) if N and up point opposite directions.
angle_range_in_radiansA range that is used to convert draft angles to colors. This interval may be increasing, decreasing, or a singleton. A draft angle equal to angle_range_in_radians[0] is mapped to ON_SurfaceDraftAngleColorMapping::DefaultHueRangeRadians[0]. A draft angle equal to angle_range_in_radians[1] is mapped to ON_SurfaceDraftAngleColorMapping::DefaultHueRangeRadians[1]. A draft angle a in between angle_range_in_radians[0] and angle_range_in_radians[1] is mapped to the saturated color with hue = ON_SurfaceDraftAngleColorMapping::DefaultHueRangeRadians.ParameterAt(angle_range_in_radians.NormalizedParameterAt(a)). Draft angles outside the angle_range_in_radians interval are mapped to the hue assigned to the nearest end of the angle_range_in_radians interval.

◆ ON_SurfaceDraftAngleColorMapping() [4/4]

ON_SurfaceDraftAngleColorMapping::ON_SurfaceDraftAngleColorMapping ( ON_3dVector  up,
ON_Interval  angle_range_in_radians,
ON_Interval  hue_range_in_radians 
)

Construce a ON_SurfaceDraftAngleColorMapping for cnverting a specified range of draft angles to a color.

Parameters
upSpecify the up direction used to caluclate the draft angle. The draft angle of a surface normal N is 0 if N is perpendicular to up, pi/2 (90 degrees) if N an up piont the same direction, and -pi/2 (-90 degrees) if N and up point opposite directions.
angle_range_in_radiansA range that is used to convert draft angles to colors. This interval may be increasing, decreasing, or a singleton. A draft angle equal to angle_range_in_radians[0] is mapped to hue_range_in_radianss[0]. A draft angle equal to angle_range_in_radians[1] is mapped to hue_range_in_radians[1]. A draft angle a in between angle_range_in_radians[0] and angle_range_in_radians[1] is mapped to the saturated color with hue = hue_range_in_radians.ParameterAt(angle_range_in_radians.NormalizedParameterAt(a)). Draft angles outside the angle_range_in_radians interval are mapped to the hue assigned to the nearest end of the angle_range_in_radians interval.
hue_range_in_radiansWhen in doubt, pass ON_SurfaceDraftAngleColorMapping::DefaultHueRangeRadians. This paramter specifies the range of color hues (in radians) assigned to the angle_range_in_radians interval. The hue interval may be increasing or decreasing.

Member Function Documentation

◆ AngleRangeInRadians()

const ON_Interval ON_SurfaceDraftAngleColorMapping::AngleRangeInRadians ( ) const

◆ Color()

const ON_Color ON_SurfaceDraftAngleColorMapping::Color ( ON_3dVector  surface_normal) const

Get the color the the settings in this ON_SurfaceDraftAngleColorMapping assign to a surface normal.

Parameters
surface_normalUnit length normal to the surface.
Returns
If surface_normal is set and this->IsSet() is true, then the color assigned to the resulting draft angle is returned. Otherwise ON_Color::UnsetColor is returned.

◆ ColorMappingTag()

const ON_MappingTag ON_SurfaceDraftAngleColorMapping::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_SurfaceDraftAngleColorMapping::Id, crc = this->CRC32() xform = identity is returned. Otherwise ON_MappingTag::Unset is returned.

◆ CRC32()

ON__UINT32 ON_SurfaceDraftAngleColorMapping::CRC32 ( ) const

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

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

◆ Hash()

const ON_SHA1_Hash ON_SurfaceDraftAngleColorMapping::Hash ( ) const

Get a SHA1 hash that uniquely identifies the settings in this ON_SurfaceDraftAngleColorMapping. 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_SurfaceDraftAngleColorMapping is returned. Otherwise ON_SHA1_Hash::EmptyContentHash() is returned.

◆ HueRangeInRadians()

const ON_Interval ON_SurfaceDraftAngleColorMapping::HueRangeInRadians ( ) const

◆ IsSet()

bool ON_SurfaceDraftAngleColorMapping::IsSet ( ) const
Returns
If the draft angle up, angle range, and hue range are set and valid, then true is returned. Otherwise false is returned.

◆ IsUnset()

bool ON_SurfaceDraftAngleColorMapping::IsUnset ( ) const
Returns
If one or more of the up vector, angle range, and hue range are not set or are not valid, valid, then true is returned. Otherwise false is returned.

◆ operator=()

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

◆ Up()

const ON_3dVector ON_SurfaceDraftAngleColorMapping::Up ( ) const

Member Data Documentation

◆ DefaultHueRangeRadians

const ON_Interval ON_SurfaceDraftAngleColorMapping::DefaultHueRangeRadians
static

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

◆ Id

const ON_UUID ON_SurfaceDraftAngleColorMapping::Id
static

///< {F08463F4-22E2-4cf1-B810-F01925446D71} The id ON_SurfaceDraftAngleColorMapping::Id identifies the surface draft angle color analysis used by the Rhino DraftAngleAnalysis command and is used as the id for mapping tags that indicate per vertex colors were set from surface normal draft angles.

◆ Unset

const ON_SurfaceDraftAngleColorMapping ON_SurfaceDraftAngleColorMapping::Unset
static