H3D API
2.4.1
|
The Appearance node specifies the visual properties of geometry. More...
#include <H3D/Appearance.h>
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, Inst< SFBool > _shadow=0) | |
Constructor. | |
virtual void | render () |
Set up the appearance in OpenGL. More... | |
virtual void | preRender () |
This function will be called by the X3DShapeNode before any rendering of geometry and before the call to the render function. More... | |
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 GLbitfield | getAffectedGLAttribs () |
Returns a bitmask of the OpenGL attrib bits that will be affected by this node. More... | |
virtual void | traverseSG (TraverseInfo &ti) |
Traversing the scene graph. More... | |
virtual bool | isTransparent () |
This function checks the transparency field to determine if the material requires that the geometry is rendered with transparency. | |
virtual bool | hasGeometryShadow () |
This function return true if the appearance has decided that shadow should be cast. More... | |
virtual bool | usingMultiPassTransparency () |
This function checks if multi-pass transparency should be used or not (see RenderProperties_multiPassTransparency) | |
![]() | |
X3DAppearanceNode (Inst< DisplayList > _displayList=0, Inst< SFNode > _metadata=0, Inst< SFSurface > _surface=0) | |
Constructor. | |
virtual string | defaultXMLContainerField () |
Returns the default xml containerField attribute value. More... | |
![]() | |
X3DNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
X3DMetadataObject * | getMetadataByName (const string &_name) |
Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More... | |
![]() | |
Node () | |
Constructor. | |
virtual Node * | clone (bool deepCopy=true, DeepCopyMap *deepCopyMap=NULL) |
Returns a new instance of this node type with the same state as this one. More... | |
virtual | ~Node () |
Destructor. | |
X3DPrototypeInstance * | getProtoInstanceParent () |
If this node is the root node in the proto body of a X3DPrototypeInstance then this will return that node. More... | |
void | setProtoInstanceParent (X3DPrototypeInstance *p) |
Set the X3DPrototypeInstance this node is the the root node if applicaple. | |
virtual bool | lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result) |
Detect intersection between a line segment and the Node. More... | |
virtual void | closestPoint (const Vec3f &p, NodeIntersectResult &result) |
Find closest point on Node to p. More... | |
virtual bool | movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result) |
Detect collision between a moving sphere and the Node. More... | |
virtual Field * | getField (const string &_name) const |
return a pointer to the field specified by name within this instance | |
int | addDestructCallback (void(*func)(Node *, void *), void *args) |
Add a callback function to be run on destruction of node. More... | |
int | removeDestructCallback (void(*func)(Node *, void *), void *args) |
Add a callback function to be run on destruction of node. More... | |
![]() | |
H3DDisplayListObject (Inst< DisplayList > _displayList=0) | |
Constructor. | |
Public Attributes | |
H3DUniquePtr< SFFillProperties > | fillProperties |
If specified it contains a FillProperties node that specifies additional properties to be applied to all polygonal areas. More... | |
H3DUniquePtr< SFLineProperties > | lineProperties |
If specified it contains a LineProperties node that specifies additional properties to be applied to all line geometry. More... | |
H3DUniquePtr< SFMaterialNode > | material |
The material field, if specified, shall contain a Material node. More... | |
H3DUniquePtr< SFTextureNode > | texture |
Contains a X3DTextureNode to be used in the texturing. More... | |
H3DUniquePtr< SFTextureTransformNode > | textureTransform |
Contains a X3DTextureTransformNode that specifies a transformation of texture coordinates. More... | |
H3DUniquePtr< MFShaderNode > | shaders |
The shaders field defines the collection of shaders of various languages in the order of preference. More... | |
H3DUniquePtr< SFRenderProperties > | renderProperties |
The renderProperties field, if specified, shall contain a RenderProperties node. More... | |
H3DUniquePtr< SFBool > | shadow |
The shadow field specifies if the geometry this Appearance is used on should cast a shadow or not. More... | |
![]() | |
H3DUniquePtr< SFSurface > | surface |
Contains the Surface node that will determine how an object will feel haptically. More... | |
![]() | |
H3DUniquePtr< SFNode > | metadata |
Meta data about the node. More... | |
![]() | |
H3DUniquePtr< DisplayList > | displayList |
The DisplayList instance handling the OpenGL caching of this object. | |
Static Public Attributes | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
Additional Inherited Members | |
![]() | |
static void | setDefaultUsingMultiPassTransparency (bool b) |
Set the default value for usage of multi pass transparancy. More... | |
static bool | getDefaultUsingMultiPassTransparency () |
Get the default value for usage of multi pass transparancy. | |
![]() | |
static unsigned int | nrNodesAlive () |
Returns the nr of nodes currently alive, i.e. nodes created but not destructed. | |
static int | nrNodesCreated () |
Returns the number of nodes created in total since the start of the program. | |
![]() | |
void | cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for the clone() method. More... | |
![]() | |
static Node * | getClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for nodes that implement clone() More... | |
![]() | |
static bool | default_using_multi_pass_transparency = true |
The default value to use for multipass transparency, if the inherited appearance node does not contain any information about using multipass transparency. | |
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.
Examples:
|
virtual |
Returns a bitmask of the OpenGL attrib bits that will be affected by this node.
The value can be used in glPushAttrib in order to save the current state.
Reimplemented from H3D::X3DAppearanceNode.
References H3D::X3DShapeNode::disable_lighting_if_no_app, fillProperties, H3D::FillProperties::getAffectedGLAttribs(), H3D::LineProperties::getAffectedGLAttribs(), H3D::RenderProperties::getAffectedGLAttribs(), H3D::X3DAppearanceChildNode::getAffectedGLAttribs(), H3D::X3DAppearanceNode::getAffectedGLAttribs(), H3D::X3DTextureNode::getAffectedGLAttribs(), H3D::X3DShaderNode::isSupported(), lineProperties, material, renderProperties, shaders, texture, and textureTransform.
|
inlinevirtual |
This function return true if the appearance has decided that shadow should be cast.
Reimplemented from H3D::X3DAppearanceNode.
|
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.
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::X3DAppearanceChildNode::preRender(), H3D::X3DAppearanceNode::preRender(), H3D::X3DTextureNode::preRender(), H3D::X3DTextureTransformNode::preRender(), renderProperties, H3D::X3DShaderNode::setSelected(), shaders, texture, and textureTransform.
|
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::Node::render(), H3D::X3DTextureTransformNode::renderForTextureUnit(), H3D::X3DTextureTransformNode::renderForTextureUnits(), renderProperties, shaders, texture, H3D::MultiTexture::texture, and textureTransform.
|
virtual |
Traversing the scene graph.
The current surface will be set to the surface of the X3DAppearanceNode.
ti | The TraverseInfo object containing information about the traversal. |
Reimplemented from H3D::X3DAppearanceNode.
References fillProperties, H3D::NavigationInfo::getActive(), H3D::TraverseInfo::getActiveLightNodes(), H3D::GraphicsHardwareInfo::getInfo(), H3D::NavigationInfo::headlight, H3D::GraphicsHardwareInfo::infoIsInitialized(), lineProperties, material, renderProperties, shaders, H3D::X3DAppearanceNode::surface, texture, textureTransform, H3D::Node::traverseSG(), and H3D::X3DAppearanceNode::traverseSG().
H3DUniquePtr< SFFillProperties > H3D::Appearance::fillProperties |
If specified it contains a FillProperties node that specifies additional properties to be applied to all polygonal areas.
Access type: inputOutput
Referenced by Appearance(), getAffectedGLAttribs(), postRender(), preRender(), render(), and traverseSG().
H3DUniquePtr< SFLineProperties > H3D::Appearance::lineProperties |
If specified it contains a LineProperties node that specifies additional properties to be applied to all line geometry.
Access type: inputOutput
Referenced by Appearance(), getAffectedGLAttribs(), postRender(), preRender(), render(), and traverseSG().
H3DUniquePtr< SFMaterialNode > H3D::Appearance::material |
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
Referenced by Appearance(), getAffectedGLAttribs(), H3D::Scene::idle(), isTransparent(), postRender(), preRender(), render(), and traverseSG().
H3DUniquePtr< SFRenderProperties > H3D::Appearance::renderProperties |
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
Referenced by Appearance(), getAffectedGLAttribs(), H3D::Scene::idle(), postRender(), preRender(), render(), and traverseSG().
H3DUniquePtr< MFShaderNode > H3D::Appearance::shaders |
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
Referenced by Appearance(), getAffectedGLAttribs(), isTransparent(), postRender(), preRender(), render(), and traverseSG().
H3DUniquePtr< SFBool > H3D::Appearance::shadow |
The shadow field specifies if the geometry this Appearance is used on should cast a shadow or not.
Access type: inputOutput Default value: false
Referenced by Appearance().
H3DUniquePtr< SFTextureNode > H3D::Appearance::texture |
Contains a X3DTextureNode to be used in the texturing.
Access type: inputOutput
Referenced by Appearance(), getAffectedGLAttribs(), postRender(), preRender(), render(), and traverseSG().
H3DUniquePtr< SFTextureTransformNode > H3D::Appearance::textureTransform |
Contains a X3DTextureTransformNode that specifies a transformation of texture coordinates.
Access type: inputOutput
Referenced by Appearance(), getAffectedGLAttribs(), postRender(), preRender(), render(), and traverseSG().