H3D::Appearance Class Reference
[X3D node classes.]

The Appearance node specifies the visual properties of geometry. More...

#include <H3D/Appearance.h>

Inheritance diagram for H3D::Appearance:

Inheritance graph

List of all members.

Public Types

typedef DependentSFNode
< FillProperties, FieldRef
< H3DDisplayListObject,
H3DDisplayListObject::DisplayList,&H3DDisplayListObject::displayList >
, true > 
SFFillProperties
 The SFFillProperties field is dependent on the displayList field of the containing FillProperties node.
typedef DependentSFNode
< LineProperties, FieldRef
< H3DDisplayListObject,
H3DDisplayListObject::DisplayList,&H3DDisplayListObject::displayList >
, true > 
SFLineProperties
 The SFLineProperties field is dependent on the displayList field of the containing LineProperties node.
typedef DependentSFNode
< X3DMaterialNode, FieldRef
< H3DDisplayListObject,
H3DDisplayListObject::DisplayList,&H3DDisplayListObject::displayList >
, true > 
SFMaterialNode
 The SFMaterialNode field is dependent on the displayList field of the containing X3DMaterialNode.
typedef DependentSFNode
< X3DTextureTransformNode,
FieldRef< H3DDisplayListObject,
H3DDisplayListObject::DisplayList,&H3DDisplayListObject::displayList >
, true > 
SFTextureTransformNode
 The SFTextureTransformNode field is dependent on the displayList field of the containing X3DTextureTransformNode node.
typedef DependentSFNode
< X3DTextureNode, FieldRef
< H3DDisplayListObject,
H3DDisplayListObject::DisplayList,&H3DDisplayListObject::displayList >
, true > 
SFTextureNode
 The SFTextureNode field is dependent on the displayList field of the containing X3DTextureNode node.
typedef DependentMFNode
< X3DShaderNode, FieldRef
< H3DDisplayListObject,
H3DDisplayListObject::DisplayList,&H3DDisplayListObject::displayList >
, true > 
MFShaderNode
 The MFShaderNode field is dependent on the displayList field of the containing X3DShaderNode node.
typedef DependentSFNode
< RenderProperties, FieldRef
< H3DDisplayListObject,
H3DDisplayListObject::DisplayList,&H3DDisplayListObject::displayList >
, true > 
SFRenderProperties
 The SFRenderProperties field is dependent on the displayList field of the containing X3DShaderNode node.

Public Member Functions

 Appearance (Inst< DisplayList > _displayList=0, Inst< SFFillProperties > _fillProperties=0, Inst< SFLineProperties > _lineProperties=0, Inst< SFMaterialNode > _material=0, Inst< SFNode > _metadata=0, Inst< SFTextureNode > _texture=0, Inst< SFTextureTransformNode > _textureTransform=0, Inst< SFSurface > _surface=0, Inst< MFShaderNode > _shaders=0, Inst< SFRenderProperties > _renderProperties=0)
 Constructor.
virtual void render ()
 Set up the appearance in OpenGL.
virtual void preRender ()
 This function will be called by the X3DShapeNode before any rendering of geometry and before the call to the render function.
virtual void postRender ()
 This function will be called by the X3DShapeNode after the geometry has been rendered to restore the states to what it was before the call to preRender().
virtual void traverseSG (TraverseInfo &ti)
 Traversing the scene graph.
virtual bool isTransparent ()
 This function checks the transparency field to determine if the material requires that the geometry is rendered with transparency.
virtual bool usingMultiPassTransparency ()
 This function checks if multi-pass transparency should be used or not (see RenderProperties_multiPassTransparency).

Public Attributes

auto_ptr< SFFillPropertiesfillProperties
 If specified it contains a FillProperties node that specifies additional properties to be applied to all polygonal areas.
auto_ptr< SFLinePropertieslineProperties
 If specified it contains a LineProperties node that specifies additional properties to be applied to all line geometry.
auto_ptr< SFMaterialNodematerial
 The material field, if specified, shall contain a Material node.
auto_ptr< SFTextureNodetexture
 Contains a X3DTextureNode to be used in the texturing.
auto_ptr< SFTextureTransformNodetextureTransform
 Contains a X3DTextureTransformNode that specifies a transformation of texture coordinates.
auto_ptr< MFShaderNodeshaders
 The shaders field defines the collection of shaders of various languages in the order of preference.
auto_ptr< SFRenderPropertiesrenderProperties
 The renderProperties field, if specified, shall contain a RenderProperties node.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.


Detailed Description

The Appearance node specifies the visual properties of geometry.

The value for each of the fields in this node may be NULL. However, if the field is non-NULL, it shall contain one node of the appropriate type.

Internal routes:
Appearance.dot

Member Typedef Documentation

The MFShaderNode field is dependent on the displayList field of the containing X3DShaderNode node.

The SFFillProperties field is dependent on the displayList field of the containing FillProperties node.

The SFLineProperties field is dependent on the displayList field of the containing LineProperties node.

The SFMaterialNode field is dependent on the displayList field of the containing X3DMaterialNode.

The SFRenderProperties field is dependent on the displayList field of the containing X3DShaderNode node.

The SFTextureNode field is dependent on the displayList field of the containing X3DTextureNode node.

The SFTextureTransformNode field is dependent on the displayList field of the containing X3DTextureTransformNode node.


Member Function Documentation

void Appearance::postRender (  )  [virtual]

This function will be called by the X3DShapeNode after the geometry has been rendered to restore the states to what it was before the call to preRender().

This function will be called by the X3DShapeNode after the geometry has been rendered to restore the states to what it was before the call to preRender().

Reimplemented from H3D::X3DAppearanceNode.

References H3D::X3DShapeNode::disable_lighting_if_no_app, fillProperties, H3D::X3DShaderNode::isSelected, lineProperties, material, H3D::X3DTextureNode::postRender(), H3D::LineProperties::postRender(), H3D::FillProperties::postRender(), H3D::X3DTextureTransformNode::postRender(), H3D::X3DAppearanceChildNode::postRender(), H3D::RenderProperties::postRender(), renderProperties, shaders, texture, and textureTransform.

void Appearance::preRender (  )  [virtual]

This function will be called by the X3DShapeNode before any rendering of geometry and before the call to the render function.

This function will be called by the X3DShapeNode before any rendering of geometry in order to set up all OpenGL states that are needed to for the appearance of the geometry.

So this is the place to save the states that are going to be changed in render() in order to restore it in postRender().

Reimplemented from H3D::X3DAppearanceNode.

References H3D::X3DShapeNode::disable_lighting_if_no_app, fillProperties, H3DUtil::RefCountedClass::getName(), H3D::X3DShaderNode::isSupported(), H3D::X3DShaderNode::language, lineProperties, material, H3D::RenderProperties::preRender(), H3D::X3DTextureTransformNode::preRender(), H3D::FillProperties::preRender(), H3D::LineProperties::preRender(), H3D::X3DTextureNode::preRender(), H3D::X3DAppearanceChildNode::preRender(), renderProperties, H3D::X3DShaderNode::setSelected(), shaders, texture, and textureTransform.

void Appearance::render (  )  [virtual]

Set up the appearance in OpenGL.

If an RGB, BGR, RGBA or BGRA texture the texture values should not be modulated with diffuseColor according to the X3D spec. So we set the diffuse color to 1 1 1 in order to show the texture values as they are. The alpha value should be the one from material if 3 component texture and the one from the texture if 4-component texture.

Reimplemented from H3D::Node.

References H3D::H3DDisplayListObject::displayList, fillProperties, H3D::X3DTextureNode::getActiveTexture(), H3D::H3DImageObject::image, H3D::X3DShaderNode::isSelected, lineProperties, material, H3DUtil::Image::pixelType(), H3D::X3DTextureTransformNode::renderForTextureUnit(), H3D::X3DTextureTransformNode::renderForTextureUnits(), renderProperties, shaders, H3D::MultiTexture::texture, texture, and textureTransform.

void Appearance::traverseSG ( TraverseInfo ti  )  [virtual]

Traversing the scene graph.

The current surface will be set to the surface of the X3DAppearanceNode.

Parameters:
ti The TraverseInfo object containing information about the traversal.

Reimplemented from H3D::X3DAppearanceNode.

References fillProperties, lineProperties, material, renderProperties, shaders, H3D::X3DAppearanceNode::surface, texture, textureTransform, and H3D::Node::traverseSG().


Member Data Documentation

If specified it contains a FillProperties node that specifies additional properties to be applied to all polygonal areas.

Access type: inputOutput

Appearance_fillProperties.dot

Referenced by Appearance(), postRender(), preRender(), render(), and traverseSG().

If specified it contains a LineProperties node that specifies additional properties to be applied to all line geometry.

Access type: inputOutput

Appearance_lineProperties.dot

Referenced by Appearance(), postRender(), preRender(), render(), and traverseSG().

The material field, if specified, shall contain a Material node.

If the material field is NULL or unspecified, lighting is off (all lights are ignored during rendering of the object that references this Appearance) and the unlit object colour is (1, 1, 1).

Access type: inputOutput

Appearance_material.dot

Referenced by Appearance(), postRender(), preRender(), H3D::H3DWindowNode::render(), render(), and traverseSG().

The renderProperties field, if specified, shall contain a RenderProperties node.

If renderProperties is NULL or unspecified, the renderProperties field has no effect (this field is not part of the X3D specification)

Access type: inputOutput

Appearance_renderProperties.dot

Referenced by Appearance(), postRender(), preRender(), H3D::H3DWindowNode::render(), render(), and traverseSG().

The shaders field defines the collection of shaders of various languages in the order of preference.

The first node declared is the highest preference. If the language is not supported for the current preference level, the X3DShaderNode's isSelected field is set to false, and the next shader is checked.

Access type: inputOutput

Appearance_shaders.dot

Referenced by Appearance(), postRender(), preRender(), render(), and traverseSG().

Contains a X3DTextureNode to be used in the texturing.

Access type: inputOutput

Appearance_texture.dot

Referenced by Appearance(), postRender(), preRender(), render(), and traverseSG().

Contains a X3DTextureTransformNode that specifies a transformation of texture coordinates.

Access type: inputOutput

Appearance_textureTransform.dot

Referenced by Appearance(), postRender(), preRender(), render(), and traverseSG().


The documentation for this class was generated from the following files:

Generated on Fri Nov 7 10:29:12 2008 for H3D API by  doxygen 1.5.7