|
Rhino C++ API
9.0
|
#include <opennurbs_decals.h>
Public Types | |
| enum | Mappings : ON__INT32 { Mappings::None = -1, Mappings::Planar = 0, Mappings::Cylindrical = 1, Mappings::Spherical = 2, Mappings::UV = 3 } |
| enum | Projections : ON__INT32 { Projections::None = -1, Projections::Forward = 0, Projections::Backward = 1, Projections::Both = 2 } |
Public Member Functions | |
| ON_Decal () | |
| Construct a decal with all properties set to defaults. More... | |
| ON_Decal (class ON_DecalCollection &coll, ON_XMLNode &node) | |
| For internal use only. More... | |
| ON_Decal (const ON_Decal &other) | |
| Construct this decal as a copy of another decal. More... | |
| ON_Decal (const ON_XMLNode &node) | |
| Construct a decal passing the const XML node to be used for its storage. This decal is read only. More... | |
| ON_Decal (ON_DecalCollection &coll, const ON_Decal &other) | |
| For internal use only. More... | |
| ON_Decal (ON_XMLNode &node) | |
| Construct a decal passing the XML node to be used for its storage. More... | |
| virtual | ~ON_Decal () |
| void | AppendCustomXML (const ON_XMLNode &) |
| < For internal use only. More... | |
| void | ApplyTransformation (const ON_Xform &xform) |
| Applies a transformation to the decal. This can be used to move it around, scale it, or rotate it. More... | |
| ON_UUID | AssetInstanceId (void) const |
| Returns the decal's asset instance id. This is the instance id of a material or texture. More... | |
| ON__UINT32 | DataCRC (ON__UINT32 current_remainder) const |
| ON_DECAL_CRC | DecalCRC (void) const |
| void | GetCustomXML (const ON_UUID &renderEngineId, ON_XMLNode &custom_param_node) const |
| Get the custom XML for the specified render engine. The format of the XML is described below. More... | |
| void | GetEntireCustomXML (ON_XMLNode &custom_xml) const |
| void | GetHorzSweep (double &sta, double &end) const |
| ON_3dVector | GetOriginOffset (void) const |
| void | GetSavedVectorLengths (double &, double &) const |
| bool | GetTextureMapping (ON_TextureMapping &tm) const |
| void | GetUVBounds (double &min_u, double &min_v, double &max_u, double &max_v) const |
| Returns the UV bounds of the decal. Only used when mapping is UV. More... | |
| void | GetVertSweep (double &sta, double &end) const |
| double | Height (void) const |
| Returns the height of the decal. Only used when mapping is cylindrical. More... | |
| bool | HitTest (const ON_3dPoint &point, const ON_3dVector &normal, ON_2dPoint &uvOut) const |
| ON_UUID | Id (void) const |
| bool | IsTemporary (void) const |
| bool | IsVisible (void) const |
| Returns true if the decal is visible in the rendering. More... | |
| Mappings | Mapping (void) const |
| Returns the decal's mapping. More... | |
| bool | MapToInside (void) const |
| virtual bool | operator!= (const ON_Decal &d) const |
| virtual const ON_Decal & | operator= (const ON_Decal &d) |
| virtual bool | operator== (const ON_Decal &d) const |
| ON_3dPoint | Origin (void) const |
| Returns the origin of the decal in world space. Not used when the mapping is UV. More... | |
| Projections | Projection (void) const |
| Returns the decal's projection. Used only when mapping is planar. More... | |
| double | Radius (void) const |
| Returns the radius of the decal. Only used when mapping is cylindrical or spherical. More... | |
| void | SetAssetInstanceId (const ON_UUID &id) |
| Sets the decal's asset instance id. This is the instance id of a material or texture. More... | |
| void | SetCacheOnly (void) |
| bool | SetCustomXML (const ON_UUID &renderEngineId, const ON_XMLNode &custom_param_node) |
| void | SetHeight (double d) |
| Sets the height of the decal. Only used when mapping is cylindrical. More... | |
| void | SetHorzSweep (double sta, double end) |
| void | SetIsTemporary (bool b) |
| Sets whether or not the decal is temporary. More... | |
| void | SetIsVisible (bool b) |
| Sets whether or not the decal is visible in the rendering. More... | |
| void | SetMapping (Mappings m) |
| Sets the decal's mapping. More... | |
| void | SetMapToInside (bool b) |
| void | SetOrigin (const ON_3dPoint &pt) |
| Sets the origin of the decal in world space. Not used when the mapping is UV. More... | |
| void | SetProjection (Projections p) |
| Sets the decal's projection. Used only when mapping is planar. More... | |
| void | SetRadius (double d) |
| Sets the radius of the decal. Only used when mapping is cylindrical or spherical. More... | |
| void | SetSavedVectorLengths (double, double) |
| ON_DEPRECATED void | SetTextureInstanceId (const ON_UUID &id) |
| This method is deprecated in favor of SetAssetInstanceId(). More... | |
| void | SetTransparency (double d) |
| Sets the decal's transparency (clamped to the range 0..1). More... | |
| void | SetUVBounds (double min_u, double min_v, double max_u, double max_v) |
| Sets the UV bounds of the decal. Only used when mapping is UV. More... | |
| void | SetVectorAcross (const ON_3dVector &vec) |
| Sets the 'across' vector of the decal. Not used when the mapping is UV. More... | |
| void | SetVectorUp (const ON_3dVector &vec) |
| Sets the 'up' vector of the decal. Not used when the mapping is UV. More... | |
| void | SetVertSweep (double sta, double end) |
| ON_DEPRECATED ON_UUID | TextureInstanceId (void) const |
| This method is deprecated in favor of AssetInstanceId(). More... | |
| double | Transparency (void) const |
| Returns the decal's transparency in the range 0..1. More... | |
| ON_3dVector | VectorAcross (void) const |
| ON_3dVector | VectorUp (void) const |
ON_Decal encapsulates a rendering decal which is an image that sticks to the surface of an object like a real-life decal does. Decals are identified by their CRC which is a value generated from the decal's current state. When a property changes, the CRC will also change.
Decals have a choice of mappings:
They also have a choice of projections:
Some of the properties are only used by certain mappings:
The class stores its data as XML but it is optimized with a built-in cache. As each property is requested, it is read from the XML and cached. Thereafter, the cached value is returned and the XML for that property is never read again. On writing to a property, the cache is updated and by default the XML is also updated. However, it is possible to inhibit the XML update for increased performance. See SetCacheOnly() below.
|
strong |
|
strong |
| ON_Decal::ON_Decal | ( | ) |
Construct a decal with all properties set to defaults.
| ON_Decal::ON_Decal | ( | ON_XMLNode & | node | ) |
Construct a decal passing the XML node to be used for its storage.
| ON_Decal::ON_Decal | ( | const ON_XMLNode & | node | ) |
Construct a decal passing the const XML node to be used for its storage. This decal is read only.
| ON_Decal::ON_Decal | ( | class ON_DecalCollection & | coll, |
| ON_XMLNode & | node | ||
| ) |
For internal use only.
| ON_Decal::ON_Decal | ( | const ON_Decal & | other | ) |
Construct this decal as a copy of another decal.
| ON_Decal::ON_Decal | ( | ON_DecalCollection & | coll, |
| const ON_Decal & | other | ||
| ) |
For internal use only.
|
virtual |
| void ON_Decal::AppendCustomXML | ( | const ON_XMLNode & | ) |
< For internal use only.
| void ON_Decal::ApplyTransformation | ( | const ON_Xform & | xform | ) |
Applies a transformation to the decal. This can be used to move it around, scale it, or rotate it.
| ON_UUID ON_Decal::AssetInstanceId | ( | void | ) | const |
Returns the decal's asset instance id. This is the instance id of a material or texture.
| ON__UINT32 ON_Decal::DataCRC | ( | ON__UINT32 | current_remainder | ) | const |
Returns the Data CRC of the decal. This is not necessarily the same as the decal CRC because it allows a starting current remainder. An invalid decal (i.e., a decal whose underlying XML is invalid) will return the incoming 'current_remainder' value.
| ON_DECAL_CRC ON_Decal::DecalCRC | ( | void | ) | const |
Returns the CRC of the decal, if it's valid. An invalid decal (i.e., a decal whose underlying XML is invalid) will return ON_NIL_DECAL_CRC.
| void ON_Decal::GetCustomXML | ( | const ON_UUID & | renderEngineId, |
| ON_XMLNode & | custom_param_node | ||
| ) | const |
Get the custom XML for the specified render engine. The format of the XML is described below.
| void ON_Decal::GetEntireCustomXML | ( | ON_XMLNode & | custom_xml | ) | const |
| void ON_Decal::GetHorzSweep | ( | double & | sta, |
| double & | end | ||
| ) | const |
Gets the start and end angles of the decal's 'horizontal sweep' (these are angles of longitude in radians). Only used when mapping is cylindrical or spherical.
| ON_3dVector ON_Decal::GetOriginOffset | ( | void | ) | const |
| void ON_Decal::GetSavedVectorLengths | ( | double & | , |
| double & | |||
| ) | const |
| bool ON_Decal::GetTextureMapping | ( | ON_TextureMapping & | tm | ) | const |
Gets a texture mapping based on the properties of this decal. Only works and returns true if the decal mapping is Planar, Spherical or Cylindrical. Otherwise returns false.
| void ON_Decal::GetUVBounds | ( | double & | min_u, |
| double & | min_v, | ||
| double & | max_u, | ||
| double & | max_v | ||
| ) | const |
Returns the UV bounds of the decal. Only used when mapping is UV.
| void ON_Decal::GetVertSweep | ( | double & | sta, |
| double & | end | ||
| ) | const |
Gets the start and end angles of the decal's 'vertical sweep' (these are angles of latitude in radians). Only used when mapping is spherical.
| double ON_Decal::Height | ( | void | ) | const |
Returns the height of the decal. Only used when mapping is cylindrical.
| bool ON_Decal::HitTest | ( | const ON_3dPoint & | point, |
| const ON_3dVector & | normal, | ||
| ON_2dPoint & | uvOut | ||
| ) | const |
Checks if the decal has color on a given point with a given face normal. If it has, then uvOut is set to the (u,v) of the point that was hit, and the function returns true. IMPORTANT: If the mapping type is UV, 'point' must be the texture coordinates of the desired point on the object carrying the decal.
| ON_UUID ON_Decal::Id | ( | void | ) | const |
Returns the unique id of the decal. This is a run-time id that is not persistent and is only used for looking decals up in the model.
| bool ON_Decal::IsTemporary | ( | void | ) | const |
Returns true if the decal is temporary. This is used to let the client know that the decal's data is expected to change often. This can let the client know that it is unnecessary to cache the data for example.
| bool ON_Decal::IsVisible | ( | void | ) | const |
Returns true if the decal is visible in the rendering.
| Mappings ON_Decal::Mapping | ( | void | ) | const |
Returns the decal's mapping.
| bool ON_Decal::MapToInside | ( | void | ) | const |
Returns true if the texture is mapped to inside of sphere or cylinder, else false. Used only when mapping is cylindrical or spherical.
|
virtual |
Reimplemented in CRhRdkDocumentAwareDecal.
Reimplemented in CRhRdkDocumentAwareDecal.
|
virtual |
Reimplemented in CRhRdkDocumentAwareDecal.
| ON_3dPoint ON_Decal::Origin | ( | void | ) | const |
Returns the origin of the decal in world space. Not used when the mapping is UV.
| Projections ON_Decal::Projection | ( | void | ) | const |
Returns the decal's projection. Used only when mapping is planar.
| double ON_Decal::Radius | ( | void | ) | const |
Returns the radius of the decal. Only used when mapping is cylindrical or spherical.
| void ON_Decal::SetAssetInstanceId | ( | const ON_UUID & | id | ) |
Sets the decal's asset instance id. This is the instance id of a material or texture.
| void ON_Decal::SetCacheOnly | ( | void | ) |
Call this method to set the decal to be a 'cache-only' decal. This inhibits writing to the XML node in the setters and only updates the cache. It is intended as an optimization for applications that don't need XML at all, such as decals used by the display. XML will only be used once by each getter to initialize the cache.
| bool ON_Decal::SetCustomXML | ( | const ON_UUID & | renderEngineId, |
| const ON_XMLNode & | custom_param_node | ||
| ) |
Set the custom XML for the specified render engine. This XML should have the following format:
<parameters> <param-name type="type">VALUE_HERE</param-name> ... </parameters>
Therefore 'custom_param_node' must have a tag name of "<parameters>". The easiest way to produce such XML is by using ON_XMLParameters. NOTE: Do NOT use ON_XMLParametersV8 for this XML.
| void ON_Decal::SetHeight | ( | double | d | ) |
Sets the height of the decal. Only used when mapping is cylindrical.
| void ON_Decal::SetHorzSweep | ( | double | sta, |
| double | end | ||
| ) |
Sets the start and end angles of the decal's 'horizontal sweep' (these are angles of longitude in radians). Only used when mapping is cylindrical or spherical.
| void ON_Decal::SetIsTemporary | ( | bool | b | ) |
Sets whether or not the decal is temporary.
| void ON_Decal::SetIsVisible | ( | bool | b | ) |
Sets whether or not the decal is visible in the rendering.
| void ON_Decal::SetMapping | ( | Mappings | m | ) |
Sets the decal's mapping.
| void ON_Decal::SetMapToInside | ( | bool | b | ) |
Sets if the texture is mapped to inside of sphere or cylinder. Used only when mapping is cylindrical or spherical.
| void ON_Decal::SetOrigin | ( | const ON_3dPoint & | pt | ) |
Sets the origin of the decal in world space. Not used when the mapping is UV.
| void ON_Decal::SetProjection | ( | Projections | p | ) |
Sets the decal's projection. Used only when mapping is planar.
| void ON_Decal::SetRadius | ( | double | d | ) |
Sets the radius of the decal. Only used when mapping is cylindrical or spherical.
| void ON_Decal::SetSavedVectorLengths | ( | double | , |
| double | |||
| ) |
| ON_DEPRECATED void ON_Decal::SetTextureInstanceId | ( | const ON_UUID & | id | ) |
This method is deprecated in favor of SetAssetInstanceId().
| void ON_Decal::SetTransparency | ( | double | d | ) |
Sets the decal's transparency (clamped to the range 0..1).
| void ON_Decal::SetUVBounds | ( | double | min_u, |
| double | min_v, | ||
| double | max_u, | ||
| double | max_v | ||
| ) |
Sets the UV bounds of the decal. Only used when mapping is UV.
| void ON_Decal::SetVectorAcross | ( | const ON_3dVector & | vec | ) |
Sets the 'across' vector of the decal. Not used when the mapping is UV.
| void ON_Decal::SetVectorUp | ( | const ON_3dVector & | vec | ) |
Sets the 'up' vector of the decal. Not used when the mapping is UV.
| void ON_Decal::SetVertSweep | ( | double | sta, |
| double | end | ||
| ) |
Sets the start and end angles of the decal's 'vertical sweep' (these are angles of latitude in radians). Only used when mapping is spherical.
| ON_DEPRECATED ON_UUID ON_Decal::TextureInstanceId | ( | void | ) | const |
This method is deprecated in favor of AssetInstanceId().
| double ON_Decal::Transparency | ( | void | ) | const |
Returns the decal's transparency in the range 0..1.
| ON_3dVector ON_Decal::VectorAcross | ( | void | ) | const |
Returns the 'across' vector of the decal. For planar mapping the length of the vector is relevant. Not used when the mapping is UV. For cylindrical and spherical mapping, the vector is unitized.
| ON_3dVector ON_Decal::VectorUp | ( | void | ) | const |
Returns the 'up' vector of the decal. For planar mapping the length of the vector is relevant. Not used when the mapping is UV. For cylindrical and spherical mapping, the vector is unitized.
1.8.17