Appearance Class Reference

This reference page is linked to from the following overview topics: Using the C++ Classes.


#include <Appearance.h>

Inheritance diagram for Appearance:
Inheritance graph
[legend]

List of all members.

Public Types

enum   {
  kParameterCategoryUnknown = 0, kParameterCategoryObject, kParameterCategoryMaterial, kParameterCategoryLighting,
  kParameterCategoryAssociations
}
 

These values are mostly used in Python.

More...
enum   DrawProperty {
  kNormalsOnly = 1, kOcclusionOnly = 2, kDrawOnTop = 4, kWireframe = 8,
  kSolid = 16, kSSAO = 32, kNPR = 64
}
enum   StyleType {
  kOff = 0, kFlatColor, kToonColor, kShadedTextures,
  kTech, kRealisticEdges, kScannedStroke, kStrokeAndPencil
}
enum   DirtyFlag { kComponent = 0, kParameter }

Public Member Functions

  Appearance ()
  Appearance (const Appearance &that)
awString::IString  getEffectKey (bool allLayers=true) const
virtual const awString::IString &  getOwnerType () const
virtual const awString::IString &  getOwnedObjectType () const
MaterialRef  getMaterial () const
void  setMaterial (MaterialRef material)
MaterialRef  getTopMaterial () const
  Return the top-most (highest index) layer material, or the base material if there are no layer materials.
int  insertLayerMaterial (MaterialRef material, int index)
MaterialRef  getLayerMaterial (int index)
int  getLayerIndex (MaterialRef material) const
int  deleteLayerMaterial (MaterialRef material)
int  getLayerMaterialCount () const
int  clearLayerMaterials ()
void  setLayerVisible (int index, bool isVisible)
bool  isLayerVisible (int index) const
ObjectAssociationsRef  getObjectAssociations () const
void  setObjectAssociations (ObjectAssociationsRef)
int  setLayerAssociations (ObjectAssociationsRef, int index)
ObjectAssociationsRef  getLayerAssociations (int index)
int  getLayerAssociationsIndex (ObjectAssociationsRef material) const
const ObjectPropertiesRef  getObjectProperties () const
void  setObjectProperties (ObjectPropertiesRef properties)
const StylePropertiesRef  getStyleProperties () const
void  setStyleProperties (StylePropertiesRef properties)
int  setLayerStyleProperties (StylePropertiesRef, int index)
StylePropertiesRef  getLayerStyleProperties (int index)
const LightingRef  getLighting () const
void  setLighting (LightingRef lighting)
const LightingRef  getEnvironmentLighting () const
void  setEnvironmentLighting (LightingRef lighting)
bool  hasShadowing () const
const ShadowReceiverRef  getShadowing (const awString::IString &lightId) const
const ShadowReceiverRef  getEnvShadowing () const
void  addShadowing (ShadowReceiverRef shadowing)
void  removeShadowing (ShadowReceiverRef shadowing)
void  resetShadowing ()
bool  operator== (const Appearance &that) const
bool  operator!= (const Appearance &that) const
Appearance operator= (const Appearance &that)
awSupport::ValueParameterGroupRef  getParameters () const
  Returns an unnamed ValueParameterGroup, with the type of the material, that contains the parameters of the object properties, material, environment light, environment IBL, and lights.
awSupport::ValueParameterGroupRef  getLayerParameters (int i) const
bool  isValid () const
bool  isOnlyStylistic () const
void  setDrawState (DrawProperty property, bool state)
bool  getDrawState (DrawProperty property) const
void  setDrawStates (int drawStates)
int  getDrawStates () const
void  setStyleType (StyleType styleType, bool dirty)
StyleType  getStyleType () const
void  touch (bool notify=true)
void  clearDirtyFlags ()
bool  isFlagDirty (DirtyFlag flag) const
bool  forceObjectProperty (const awString::IString &objectPropertiesName, const awString::IString &objectPropertiesType, const awString::IString &propertyName, awSupport::Parameter::Type propertyType, const awString::IString &propertyValue)
  Shortcuts to create object properties (if not already there), create the parameter (if not already there) and set its value.
bool  forceDrawPropertyD (const awString::IString &name, const double value)
  Shortcut for forcing a double "draw" property.
bool  forceDrawPropertyS (const awString::IString &name, const awString::IString &value)
  Shortcut for forcing a string "draw" property.
bool  forceAssociationProperty (int index, const awString::IString &propertyName, awSupport::Parameter::Type propertyType, const awString::IString &propertyValue)
  Shortcut for forcing association and a matrix association.
bool  forceAssociationMatrixProperty (int index, const awString::IString &name, const awString::IString &value)
void  clearAssociationProperties (int index)
  Remove all association properties.
bool  addLight (const awString::IString &lightId, awSupport::ValueParameterGroupRef &lightParms)
void  removeLight (const awString::IString &lightId)
int  getNumLights () const
awSupport::ValueParameterGroupRef  getLight (const awString::IString &lightId)
const LightIdToParameterGroupMap getLightMap () const
bool  addClipLight (const awString::IString &clipLightId, awSupport::ValueParameterGroupRef &lightParms)
void  removeClipLight (const awString::IString &clipLightId)
int  getNumClipLights () const
void  setClipLightMap (const LightIdToParameterGroupMap &clipLightMap)
awSupport::ValueParameterGroupRef  getClipLight (const awString::IString &clipLightId)
const LightIdToParameterGroupMap getClipLightMap () const

Protected Member Functions

virtual  ~Appearance ()
virtual void  onOwnedObjectDirty (awSupport::OwnedObject *object)
ObjectProperties createObjectProperties (const awString::IString &name, const awString::IString &type)
awString::IString  getLayerKey (int layer) const

Member Enumeration Documentation

anonymous enum

These values are mostly used in Python.

The appearance messages use them to specify which category a particular parameter belongs to, either to break a tie, or to speed the processing up.

Enumerator:
kParameterCategoryUnknown 
kParameterCategoryObject 
kParameterCategoryMaterial 
kParameterCategoryLighting 
kParameterCategoryAssociations 
Enumerator:
kOff 
kFlatColor 
kToonColor 
kShadedTextures 
kTech 
kRealisticEdges 
kScannedStroke 
kStrokeAndPencil 
                 {
        kOff = 0,         // Realistic
        kFlatColor,       // Flat Color
        kToonColor,       // Toon Color
        kShadedTextures,  // Shaded Textures
        kTech,            // Tech
        kRealisticEdges,  // Realistic with edges
        kScannedStroke,   // Scanned stroke with flat color fill
        kStrokeAndPencil  // Scanned stroke and pencil with realistic fill
    } StyleType;

Constructor & Destructor Documentation

Appearance ( const Appearance that )
virtual ~Appearance ( ) [protected, virtual]

Member Function Documentation

awString::IString getEffectKey ( bool  allLayers = true ) const
virtual const awString::IString& getOwnerType ( ) const [virtual]
virtual const awString::IString& getOwnedObjectType ( ) const [virtual]
MaterialRef getMaterial ( ) const
void setMaterial ( MaterialRef  material )
MaterialRef getTopMaterial ( ) const

Return the top-most (highest index) layer material, or the base material if there are no layer materials.

int insertLayerMaterial ( MaterialRef  material,
int  index 
)
MaterialRef getLayerMaterial ( int  index )
int getLayerIndex ( MaterialRef  material ) const
int deleteLayerMaterial ( MaterialRef  material )
int getLayerMaterialCount ( ) const
int clearLayerMaterials ( )
void setLayerVisible ( int  index,
bool  isVisible 
)
bool isLayerVisible ( int  index ) const
ObjectAssociationsRef getObjectAssociations ( ) const
void setObjectAssociations ( ObjectAssociationsRef  )
int setLayerAssociations ( ObjectAssociationsRef  ,
int  index 
)
ObjectAssociationsRef getLayerAssociations ( int  index )
int getLayerAssociationsIndex ( ObjectAssociationsRef  material ) const
const ObjectPropertiesRef getObjectProperties ( ) const
void setObjectProperties ( ObjectPropertiesRef  properties )
const StylePropertiesRef getStyleProperties ( ) const
void setStyleProperties ( StylePropertiesRef  properties )
int setLayerStyleProperties ( StylePropertiesRef  ,
int  index 
)
StylePropertiesRef getLayerStyleProperties ( int  index )
const LightingRef getLighting ( ) const
void setLighting ( LightingRef  lighting )
const LightingRef getEnvironmentLighting ( ) const
void setEnvironmentLighting ( LightingRef  lighting )
bool hasShadowing ( ) const
const ShadowReceiverRef getShadowing ( const awString::IString &  lightId ) const
const ShadowReceiverRef getEnvShadowing ( ) const
void addShadowing ( ShadowReceiverRef  shadowing )
void removeShadowing ( ShadowReceiverRef  shadowing )
void resetShadowing ( )
bool operator== ( const Appearance that ) const
bool operator!= ( const Appearance that ) const
Appearance& operator= ( const Appearance that )
awSupport::ValueParameterGroupRef getParameters ( ) const

Returns an unnamed ValueParameterGroup, with the type of the material, that contains the parameters of the object properties, material, environment light, environment IBL, and lights.

If a parameter exists on more than one of these, the first one is taken, in the order specified above. This ValueParameterGroup is constructed explicitly in this call and does not correspond to one of the groups being held by this class.

The second version is the same as the first, except that the parameters are considered from the layer material at the given index.

awSupport::ValueParameterGroupRef getLayerParameters ( int  i ) const
bool isValid ( ) const
bool isOnlyStylistic ( ) const
void setDrawState ( DrawProperty  property,
bool  state 
)
bool getDrawState ( DrawProperty  property ) const
void setDrawStates ( int  drawStates )
int getDrawStates ( ) const
void setStyleType ( StyleType  styleType,
bool  dirty 
)
StyleType getStyleType ( ) const
void touch ( bool  notify = true )
void clearDirtyFlags ( )
bool isFlagDirty ( DirtyFlag  flag ) const
bool forceObjectProperty ( const awString::IString &  objectPropertiesName,
const awString::IString &  objectPropertiesType,
const awString::IString &  propertyName,
awSupport::Parameter::Type  propertyType,
const awString::IString &  propertyValue 
)

Shortcuts to create object properties (if not already there), create the parameter (if not already there) and set its value.

Return true if the object properties had to be created, false if it just had to be edited.

bool forceDrawPropertyD ( const awString::IString &  name,
const double  value 
)

Shortcut for forcing a double "draw" property.

bool forceDrawPropertyS ( const awString::IString &  name,
const awString::IString &  value 
)

Shortcut for forcing a string "draw" property.

bool forceAssociationProperty ( int  index,
const awString::IString &  propertyName,
awSupport::Parameter::Type  propertyType,
const awString::IString &  propertyValue 
)

Shortcut for forcing association and a matrix association.

If index is -1, put it on the main material, otherwise on the layer.

bool forceAssociationMatrixProperty ( int  index,
const awString::IString &  name,
const awString::IString &  value 
)
void clearAssociationProperties ( int  index )

Remove all association properties.

-1 for object, otherwise index for layered association

bool addLight ( const awString::IString &  lightId,
awSupport::ValueParameterGroupRef lightParms 
)
void removeLight ( const awString::IString &  lightId )
int getNumLights ( ) const
awSupport::ValueParameterGroupRef getLight ( const awString::IString &  lightId )
bool addClipLight ( const awString::IString &  clipLightId,
awSupport::ValueParameterGroupRef lightParms 
)
void removeClipLight ( const awString::IString &  clipLightId )
int getNumClipLights ( ) const
void setClipLightMap ( const LightIdToParameterGroupMap clipLightMap )
awSupport::ValueParameterGroupRef getClipLight ( const awString::IString &  clipLightId )
const LightIdToParameterGroupMap& getClipLightMap ( ) const
virtual void onOwnedObjectDirty ( awSupport::OwnedObject object ) [protected, virtual]

Reimplemented from Owner.

ObjectProperties* createObjectProperties ( const awString::IString &  name,
const awString::IString &  type 
) [protected]
awString::IString getLayerKey ( int  layer ) const [protected]

Appearance Appearance Appearance Appearance Appearance Appearance Appearance Appearance Appearance Appearance
Appearance Appearance Appearance Appearance Appearance Appearance Appearance Appearance Appearance Appearance