Rhino C++ API  8.6
Public Types | Public Member Functions | Static Public Member Functions | List of all members
IRhRdkDecal Class Referenceabstract

#include <IRhRdkDecal.h>

Inheritance diagram for IRhRdkDecal:
IRhRdkDecal2

Public Types

enum  eMapping {
  mapUnset =-1, mapPlanar = 0, mapCylindrical = 1, mapSpherical = 2,
  mapUV = 3, mapForce32bit = 0xFFFFFFFF
}
 
enum  eProjection {
  projUnset =-1, projForward = 0, projBackward = 1, projBoth = 2,
  projForce32bit = 0xFFFFFFFF
}
 

Public Member Functions

virtual ~IRhRdkDecal ()
 
virtual bool Color (const ON_3dPoint &ptPoint, const ON_3dVector &vecNormal, CRhRdkColor &colInOut, ON_2dPoint &uvOut) const =0
 
virtual RDK_DECAL_CRC CRC (void) const =0
 
virtual const IRhRdk_XMLSectionCustomData (void) const =0
 
virtual void * EVF (const wchar_t *, void *)=0
 
virtual void GetHorzSweep (double &sta, double &end) const =0
 
virtual void GetVertSweep (double &sta, double &end) const =0
 
virtual double Height (void) const =0
 
virtual RDK_DEPRECATED RDK_DECAL_CRC Id (void) const
 
virtual RDK_DEPRECATED double LatEnd (void) const
 
virtual RDK_DEPRECATED double LatStart (void) const
 
virtual RDK_DEPRECATED double LonEnd (void) const
 
virtual RDK_DEPRECATED double LonStart (void) const
 
virtual eMapping Mapping (void) const =0
 
virtual bool MapToInside (void) const =0
 
virtual ON_3dPoint Origin (void) const =0
 
virtual eProjection Projection (void) const =0
 
virtual double Radius (void) const =0
 
virtual void SetTexture (const CRhRdkTexture *pTexture)=0
 
virtual const CRhRdkTextureTexture (void) const =0
 
virtual UUID TextureInstanceId (void) const
 
virtual double Transparency (void) const =0
 
virtual void UVBounds (double &dMinUOut, double &dMinVOut, double &dMaxUOut, double &dMaxVOut) const =0
 
virtual ON_3dVector VectorAcross (void) const =0
 
virtual ON_3dVector VectorUp (void) const =0
 

Static Public Member Functions

static bool GetTextureMapping (const IRhRdkDecal &decal, ON_TextureMapping &mappingOut)
 

Detailed Description

This interface allows RDK clients to access decals that are attached to Rhino objects.

See also
CRhRdkObjectDataAccess

Member Enumeration Documentation

◆ eMapping

Enumerator
mapUnset 
mapPlanar 
mapCylindrical 
mapSpherical 
mapUV 
mapForce32bit 

◆ eProjection

Enumerator
projUnset 
projForward 
projBackward 
projBoth 
projForce32bit 

Constructor & Destructor Documentation

◆ ~IRhRdkDecal()

virtual IRhRdkDecal::~IRhRdkDecal ( )
inlinevirtual

Member Function Documentation

◆ Color()

virtual bool IRhRdkDecal::Color ( const ON_3dPoint ptPoint,
const ON_3dVector vecNormal,
CRhRdkColor colInOut,
ON_2dPoint uvOut 
) const
pure virtual

Blend color with the decal color at a given point.

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

◆ CRC()

virtual RDK_DECAL_CRC IRhRdkDecal::CRC ( void  ) const
pure virtual

The decal CRC identifies a decal by its state. Multiple decals which would be exactly the same would have the same CRC and are culled from the system. If you store this value with the intention of using it to find the decal again later, you must update your stored value whenever the decal state changes. You can detect when a decal changes by watching for the OnUserDataTransformed event. \See CRhRdkEventWatcher

◆ CustomData()

virtual const IRhRdk_XMLSection* IRhRdkDecal::CustomData ( void  ) const
pure virtual

Get custom data associated with this decal.

Returns
A pointer to an interface from which you can retrieve custom data, or NULL if no custom data exists on the decal for the current Rhino renderer.

◆ EVF()

virtual void* IRhRdkDecal::EVF ( const wchar_t *  ,
void *   
)
pure virtual

Emergency virtual function for future expansion.

◆ GetHorzSweep()

virtual void IRhRdkDecal::GetHorzSweep ( double &  sta,
double &  end 
) const
pure virtual

Gets the start and end angles of the decal's 'horizontal sweep' (these are angles of longitude in radians).

Note
These correspond to the old methods LatStart() and LatEnd() which were badly named. Only used when mapping is cylindrical or spherical.

◆ GetTextureMapping()

static bool IRhRdkDecal::GetTextureMapping ( const IRhRdkDecal decal,
ON_TextureMapping mappingOut 
)
static

◆ GetVertSweep()

virtual void IRhRdkDecal::GetVertSweep ( double &  sta,
double &  end 
) const
pure virtual

Gets the start and end angles of the decal's 'vertical sweep' (these are angles of latitude in radians).

Note
These correspond to the old methods LonStart() and LonEnd() which were badly named. Only used when mapping is spherical.

◆ Height()

virtual double IRhRdkDecal::Height ( void  ) const
pure virtual
Returns
The height of the decal. Only used when mapping is cylindrical.

◆ Id()

virtual RDK_DEPRECATED RDK_DECAL_CRC IRhRdkDecal::Id ( void  ) const
inlinevirtual

This method is deprecated because the name is misleading. The decal 'id' is not an identifier at all, it's a CRC which changes when the decal changes. Please change your code to call CRC() instead.

◆ LatEnd()

virtual RDK_DEPRECATED double IRhRdkDecal::LatEnd ( void  ) const
virtual

This method is deprecated in favor of GetHorzSweep().

See also
GetHorzSweep().

◆ LatStart()

virtual RDK_DEPRECATED double IRhRdkDecal::LatStart ( void  ) const
virtual

This method is deprecated in favor of GetHorzSweep().

See also
GetHorzSweep().

◆ LonEnd()

virtual RDK_DEPRECATED double IRhRdkDecal::LonEnd ( void  ) const
virtual

This method is deprecated in favor of GetVertSweep().

See also
GetVertSweep().

◆ LonStart()

virtual RDK_DEPRECATED double IRhRdkDecal::LonStart ( void  ) const
virtual

This method is deprecated in favor of GetVertSweep().

See also
GetVertSweep().

◆ Mapping()

virtual eMapping IRhRdkDecal::Mapping ( void  ) const
pure virtual
Returns
The decal's mapping.

◆ MapToInside()

virtual bool IRhRdkDecal::MapToInside ( void  ) const
pure virtual
Returns
true if texture is mapped to inside of sphere or cylinder, else false. Used only when mapping is cylindrical or spherical.

◆ Origin()

virtual ON_3dPoint IRhRdkDecal::Origin ( void  ) const
pure virtual
Returns
The origin of the decal in world space. Not used when the mapping is UV.

◆ Projection()

virtual eProjection IRhRdkDecal::Projection ( void  ) const
pure virtual
Returns
The decal's projection. Used only when mapping is planar.

◆ Radius()

virtual double IRhRdkDecal::Radius ( void  ) const
pure virtual
Returns
The radius of the decal. Only used when mapping is cylindrical or spherical.

◆ SetTexture()

virtual void IRhRdkDecal::SetTexture ( const CRhRdkTexture pTexture)
pure virtual

Set the decal's texture. The decal copies the texture and this copy will subsequently be returned by Texture().

◆ Texture()

virtual const CRhRdkTexture* IRhRdkDecal::Texture ( void  ) const
pure virtual
Returns
The decal's texture or null on failure.
Note
The returned texture is temporary and only exists as long as the decal object, so you should not store this pointer. You should also not store the instance id. If you need the texture again, you should construct a new decal object and call Texture() each time.

◆ TextureInstanceId()

virtual UUID IRhRdkDecal::TextureInstanceId ( void  ) const
virtual
Returns
The decal texture's instance id.

◆ Transparency()

virtual double IRhRdkDecal::Transparency ( void  ) const
pure virtual
Returns
The decal's transparency in the range 0 to 1.

◆ UVBounds()

virtual void IRhRdkDecal::UVBounds ( double &  dMinUOut,
double &  dMinVOut,
double &  dMaxUOut,
double &  dMaxVOut 
) const
pure virtual

The UV bounds of the decal. Only used when mapping is UV.

◆ VectorAcross()

virtual ON_3dVector IRhRdkDecal::VectorAcross ( void  ) const
pure virtual
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.

◆ VectorUp()

virtual ON_3dVector IRhRdkDecal::VectorUp ( void  ) const
pure virtual
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.