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

#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 ()
 
 ON_Decal (class ON_DecalCollection &coll, ON_XMLNode &node)
 
 ON_Decal (const ON_Decal &d)
 
virtual ~ON_Decal ()
 
ON__UINT32 DataCRC (ON__UINT32 current_remainder) const
 
ON__UINT32 DecalCRC (void) const
 Returns the Decal CRC of the decal. More...
 
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 GetHorzSweep (double &sta, double &end) 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...
 
ON_UUID Id (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_Decaloperator= (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...
 
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 SetIsVisible (bool visible)
 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 SetTextureInstanceId (const ON_UUID &id)
 Sets the decal texture's instance id. 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_UUID TextureInstanceId (void) const
 Returns the decal texture's instance id. 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
 

Static Public Member Functions

static ON__UINT32 ComputeDecalCRC (ON__UINT32, const ON_XMLNode &)
 < For internal use only. More...
 

Detailed Description

Copyright (c) 1993-2022 Robert McNeel & Associates. All rights reserved. OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert McNeel & Associates.

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.

For complete openNURBS copyright information see http://www.opennurbs.org.

Member Enumeration Documentation

◆ Mappings

Enumerator
None 
Planar 

Planar mapping. Uses projection, origin, up and across vectors (not unitized).

Cylindrical 

Cylindrical mapping. Uses origin, up, across, height, radius, horz-sweep.

Spherical 

Spherical mapping. Uses origin, up, across, radius, horz-sweep, vert-sweep.

UV 

UV mapping. Uses UV bounds.

◆ Projections

Enumerator
None 
Forward 

Project forward.

Backward 

Project backward.

Both 

Project forward and backward.

Constructor & Destructor Documentation

◆ ON_Decal() [1/3]

ON_Decal::ON_Decal ( )

◆ ON_Decal() [2/3]

ON_Decal::ON_Decal ( class ON_DecalCollection &  coll,
ON_XMLNode node 
)

◆ ON_Decal() [3/3]

ON_Decal::ON_Decal ( const ON_Decal d)

◆ ~ON_Decal()

virtual ON_Decal::~ON_Decal ( )
virtual

Member Function Documentation

◆ ComputeDecalCRC()

static ON__UINT32 ON_Decal::ComputeDecalCRC ( ON__UINT32  ,
const ON_XMLNode  
)
static

< For internal use only.

◆ DataCRC()

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.

◆ DecalCRC()

ON__UINT32 ON_Decal::DecalCRC ( void  ) const

Returns the Decal CRC of the decal.

◆ GetCustomXML()

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.

◆ GetHorzSweep()

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.

◆ GetTextureMapping()

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.

◆ GetUVBounds()

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.

◆ GetVertSweep()

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.

◆ Height()

double ON_Decal::Height ( void  ) const

Returns the height of the decal. Only used when mapping is cylindrical.

◆ Id()

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.

◆ IsVisible()

bool ON_Decal::IsVisible ( void  ) const

Returns true if the decal is visible in the rendering.

◆ Mapping()

Mappings ON_Decal::Mapping ( void  ) const

Returns the decal's mapping.

◆ MapToInside()

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.

◆ operator!=()

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

◆ operator=()

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

◆ operator==()

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

◆ Origin()

ON_3dPoint ON_Decal::Origin ( void  ) const

Returns the origin of the decal in world space. Not used when the mapping is UV.

◆ Projection()

Projections ON_Decal::Projection ( void  ) const

Returns the decal's projection. Used only when mapping is planar.

◆ Radius()

double ON_Decal::Radius ( void  ) const

Returns the radius of the decal. Only used when mapping is cylindrical or spherical.

◆ SetCustomXML()

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"></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.

◆ SetHeight()

void ON_Decal::SetHeight ( double  d)

Sets the height of the decal. Only used when mapping is cylindrical.

◆ SetHorzSweep()

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.

◆ SetIsVisible()

void ON_Decal::SetIsVisible ( bool  visible)

Sets whether or not the decal is visible in the rendering.

◆ SetMapping()

void ON_Decal::SetMapping ( Mappings  m)

Sets the decal's mapping.

◆ SetMapToInside()

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.

◆ SetOrigin()

void ON_Decal::SetOrigin ( const ON_3dPoint pt)

Sets the origin of the decal in world space. Not used when the mapping is UV.

◆ SetProjection()

void ON_Decal::SetProjection ( Projections  p)

Sets the decal's projection. Used only when mapping is planar.

◆ SetRadius()

void ON_Decal::SetRadius ( double  d)

Sets the radius of the decal. Only used when mapping is cylindrical or spherical.

◆ SetTextureInstanceId()

void ON_Decal::SetTextureInstanceId ( const ON_UUID id)

Sets the decal texture's instance id.

◆ SetTransparency()

void ON_Decal::SetTransparency ( double  d)

Sets the decal's transparency (clamped to the range 0..1).

◆ SetUVBounds()

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.

◆ SetVectorAcross()

void ON_Decal::SetVectorAcross ( const ON_3dVector vec)

Sets the 'across' vector of the decal. Not used when the mapping is UV.

◆ SetVectorUp()

void ON_Decal::SetVectorUp ( const ON_3dVector vec)

Sets the 'up' vector of the decal. Not used when the mapping is UV.

◆ SetVertSweep()

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.

◆ TextureInstanceId()

ON_UUID ON_Decal::TextureInstanceId ( void  ) const

Returns the decal texture's instance id.

◆ Transparency()

double ON_Decal::Transparency ( void  ) const

Returns the decal's transparency in the range 0..1.

◆ VectorAcross()

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.

◆ VectorUp()

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.