Home Hierarchy Members Alphabetical Related Pages

Fog Class Reference
[Standard Node Types]

#include <fog.h>

Inherits Node.

Inheritance diagram for Fog:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Fog (const char *name="")
virtual ~Fog ()
virtual unsigned int nbFields () const
virtual FieldHandle field (const std::string &n)
virtual FieldHandle field (const unsigned int i)
virtual bool isSetToDefaultValue (const unsigned int i) const
virtual unsigned int nbEventsIn () const
virtual EventInHandle eventIn (const std::string &n)
virtual EventInHandle eventIn (const unsigned int i)
virtual unsigned int nbEventsOut () const
virtual EventOutHandle eventOut (const std::string &n)
virtual EventOutHandle eventOut (const unsigned int i)
const char * typeName () const
virtual Nodeduplicate () const
virtual Nodeduplicate (std::map< const Node *, Node * > &) const

Public Attributes

Exposed Fields
A field that is capable of receiving events via an eventIn to change its value(s), and generating events via an eventOut when its value(s) change.

SFColor color
SFString fogType
SFFloat visibilityRange
Events In
EventIn< SFBoolset_bind
EventIn< SFColorset_color
EventIn< SFStringset_fogType
EventIn< SFFloatset_visibilityRange
Events Out
EventOut< SFBoolisBound
EventOut< SFColorcolor_changed
EventOut< SFStringfogType_changed
EventOut< SFFloatvisibilityRange_changed

Detailed Description

Here is the documentation for this node type, from the ISO standard.

+6.21 Fog

The Fog node provides a way to simulate atmospheric effects by blending objects with the colour specified by the color field based on the distances of the various objects from the viewer. The distances are calculated in the coordinate space of the Fog node. The visibilityRange specifies the distance in metres (in the local coordinate system) at which objects are totally obscured by the fog. Objects located outside the visibilityRange from the viewer are drawn with a constant colour of color. Objects very close to the viewer are blended very little with the fog color. A visibilityRange of 0.0 disables the Fog node. The visibilityRange is affected by the scaling transformations of the Fog node's parents; translations and rotations have no affect on visibilityRange. Values of the visibilityRange field shall be in the range [0, ).

Since Fog nodes are bindable children nodes (see 4.6.10, Bindable children nodes), a Fog node stack exists, in which the top-most Fog node on the stack is currently active. To push a Fog node onto the top of the stack, a TRUE value is sent to the set_bind eventIn. Once active, the Fog node is bound to the browser view. A FALSE value sent to set_bind, pops the Fog node from the stack and unbinds it from the browser viewer. More details on the Fog node stack can be found in 4.6.10, Bindable children nodes.

The fogType field controls how much of the fog colour is blended with the object as a function of distance. If fogType is "LINEAR", the amount of blending is a linear function of the distance, resulting in a depth cueing effect. If fogType is "EXPONENTIAL," an exponential increase in blending is used, resulting in a more natural fog appearance.

The effect of fog on lighting calculations is described in 4.14, Lighting model.

--- VRML separator bar ---


Constructor & Destructor Documentation

Fog const char *  name = ""  ) 
 

Construct a node with all its fields set to default value, which is equivalent to the code below:

  color.setRGB(1,1,1);
  fogType = string("LINEAR");
  visibilityRange = 0;

~Fog  )  [virtual]
 

Virtual destructor, does nothing


Member Function Documentation

wrl::Node * duplicate std::map< const Node *, Node * > &   )  const [virtual]
 

Implements Node.

wrl::Node * duplicate  )  const [virtual]
 

Returns a deep copy of this node, that is a fully independant node with all children (if any) also copied. This is mainly useful for instanciating protos.

Implements Node.

wrl::Node::EventInHandle eventIn const unsigned int  n  )  [virtual]
 

Return a handle on the i th event in of the node or a "unknown" typed handle if there is no such node. Here is how i is related to fields:

  • 0 : set_bind
  • 1 : set_color
  • 2 : set_fogType
  • 3 : set_visibilityRange

This function is useful, with nbEventsIn() if you want to traverse all events in of a Node.

Implements Node.

wrl::Node::EventInHandle eventIn const std::string &  n  )  [virtual]
 

Return a handle on the event in named n of the node or a "unknown" typed handle if there is no such event. Valid names are:

  • set_bind
  • set_color
  • set_fogType
  • set_visibilityRange

Implements Node.

wrl::Node::EventOutHandle eventOut const unsigned int  n  )  [virtual]
 

Return a handle on the i th event out of the node or a "unknown" typed handle if there is no such node. Here is how i is related to fields:

  • 0 : isBound
  • 1 : color_changed
  • 2 : fogType_changed
  • 3 : visibilityRange_changed This function is useful, with nbEventsOut() if you want to traverse all events in of a Node.

Implements Node.

wrl::Node::EventOutHandle eventOut const std::string &  n  )  [virtual]
 

Return a handle on the event out named n of the node or a "unknown" typed handle if there is no such event. Valid names are:

  • isBound
  • color_changed
  • fogType_changed
  • visibilityRange_changed

Implements Node.

wrl::Node::FieldHandle field const unsigned int  n  )  [virtual]
 

Return a handle on the i th field of the node or a "unknown" typed handle if there is no such node. Here is how i is related to fields:

  • 0 : color
  • 1 : fogType
  • 2 : visibilityRange This function is useful, with nbFields() if you want to traverse all fields of a Node.

Implements Node.

wrl::Node::FieldHandle field const std::string &  n  )  [virtual]
 

Return a handle on the field named n of the node or a "unknown" typed handle if there is no such field. Valid names are:

  • color
  • fogType
  • visibilityRange

Implements Node.

bool isSetToDefaultValue const unsigned int  i  )  const [virtual]
 

Implements Node.

unsigned int nbEventsIn  )  const [inline, virtual]
 

Returns the number of events in for this node type.

Implements Node.

unsigned int nbEventsOut  )  const [inline, virtual]
 

Returns the number of events out for this node type.

Implements Node.

unsigned int nbFields  )  const [inline, virtual]
 

Returns the number of fields (exposed or not) for this node type.

Implements Node.

const char * typeName  )  const [inline, virtual]
 

Returns "Fog". Useful for printing.

Implements Node.


Member Data Documentation

SFColor color
 

See Detailed Description for meaning of this field. Default value is set to

       color.setRGB(1,1,1);

EventOut<SFColor> color_changed
 

Changed event associated to exposedField color

SFString fogType
 

See Detailed Description for meaning of this field. Default value is set to

       fogType = string("LINEAR");

EventOut<SFString> fogType_changed
 

Changed event associated to exposedField fogType

EventOut<SFBool> isBound
 

See Detailed Description for meaning of this event.

EventIn<SFBool> set_bind
 

See Detailed Description for meaning of this event.

EventIn<SFColor> set_color
 

Set event associated to exposedField color

EventIn<SFString> set_fogType
 

Set event associated to exposedField fogType

EventIn<SFFloat> set_visibilityRange
 

Set event associated to exposedField visibilityRange

SFFloat visibilityRange
 

See Detailed Description for meaning of this field. Default value is set to

EventOut<SFFloat> visibilityRange_changed
 

Changed event associated to exposedField visibilityRange


Generated on 24 Feb 2005 with doxygen version 1.3.9.1. Valid HTML 4.0! Valid CSS!