Rhino C++ API  9.0
Public Member Functions | Protected Member Functions | List of all members
CRhRdkDocumentAwareDecal Class Reference

#include <RhRdkObjectDataAccess.h>

Inheritance diagram for CRhRdkDocumentAwareDecal:
ON_Decal

Public Member Functions

 CRhRdkDocumentAwareDecal ()
 
 CRhRdkDocumentAwareDecal (unsigned int doc_sn, const ON_Decal &decal)
 
bool Color (const ON_3dPoint &point, const ON_3dVector &normal, IN OUT CRhRdkColor &col_in_out, OUT ON_2dPoint &uv_out) const
 
unsigned int DocSerialNumber (void) const
 
const CRhRdkTextureTexture (void) const
 
CRhRdkTexture::ProjectionModes TextureProjectionMode (void) const
 
- Public Member Functions inherited from ON_Decal
 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
 
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
 

Protected Member Functions

virtual bool operator!= (const ON_Decal &d) const override
 
virtual const ON_Decaloperator= (const ON_Decal &d) override
 
virtual bool operator== (const ON_Decal &d) const override
 

Additional Inherited Members

- Public Types inherited from ON_Decal
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 }
 

Detailed Description

This class associates a document with a decal and provides access to various things that need a document in order to be computed.

Constructor & Destructor Documentation

◆ CRhRdkDocumentAwareDecal() [1/2]

CRhRdkDocumentAwareDecal::CRhRdkDocumentAwareDecal ( )

◆ CRhRdkDocumentAwareDecal() [2/2]

CRhRdkDocumentAwareDecal::CRhRdkDocumentAwareDecal ( unsigned int  doc_sn,
const ON_Decal decal 
)

Member Function Documentation

◆ Color()

bool CRhRdkDocumentAwareDecal::Color ( const ON_3dPoint point,
const ON_3dVector normal,
IN OUT CRhRdkColor col_in_out,
OUT ON_2dPoint uv_out 
) const

Blend color with the decal color at a given point. Checks if the decal has color on a given point with a given face normal. If it has, then 'colInOut' is blended with that color 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.

Parameters
pointis the point in space or, if the decal is uv-mapped, the uv-coordinate of that point.
normalis the face normal of the given point.
colInOutis the color to blend to the decal color.
uvOutis the UV on the texture that the color point was read from.
Returns
true if the given point hits the decal, else false.

◆ DocSerialNumber()

unsigned int CRhRdkDocumentAwareDecal::DocSerialNumber ( void  ) const
Returns
The serial number of the document the decal is associated with.

◆ operator!=()

virtual bool CRhRdkDocumentAwareDecal::operator!= ( const ON_Decal d) const
inlineoverrideprotectedvirtual

Reimplemented from ON_Decal.

◆ operator=()

virtual const ON_Decal& CRhRdkDocumentAwareDecal::operator= ( const ON_Decal d)
inlineoverrideprotectedvirtual

Reimplemented from ON_Decal.

◆ operator==()

virtual bool CRhRdkDocumentAwareDecal::operator== ( const ON_Decal d) const
inlineoverrideprotectedvirtual

Reimplemented from ON_Decal.

◆ Texture()

const CRhRdkTexture* CRhRdkDocumentAwareDecal::Texture ( void  ) const
Returns
a pointer to the texture the decal is using.

◆ TextureProjectionMode()

CRhRdkTexture::ProjectionModes CRhRdkDocumentAwareDecal::TextureProjectionMode ( void  ) const
Returns
The texture projection mode the decal is using.