GBE::GEnergyFormAgent Class Reference

Modifies the form according to the energy attributes. More...

#include <GEnergyFormAgent.h>

Inheritance diagram for GBE::GEnergyFormAgent:

Inheritance graph
[legend]
Collaboration diagram for GBE::GEnergyFormAgent:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GEnergyFormAgent ()
virtual ~GEnergyFormAgent ()
void initRangeMin (double energy_level_min)
void initRangeMax (double energy_level_max)
void initAlpha (double alpha_colour_component)
void initSizeFactor (const GCS::GVector3 &size_factor)
void initColourEnabled (bool enabled)
void initSizeFactorEnabled (bool enabled)

Protected Member Functions

virtual void run ()

Detailed Description

Modifies the form according to the energy attributes.

Author:
Raphael Langerhorst
The form of the element is modified according to energy. The energy level is represented by form colour, the energy amount is represented by form radius.

The colour ranges from dark blue to yellow-white between LevelRangeMin and LevelRangeMax.

The sizefactor is directly reflected in the form's ellipsoid attribute.

Adds the following xml data to the element data:

  <appearance>
    <energyrange>
      <minlevel>double value</minlevel>
      <maxlevel>double value</maxlevel>
    </energyrange>
    <colour>  <!-- periodically updated in the run() method of the agent -->
      <enabled>bool</enabled> <!-- if false then the whole colour tag can be ignored -->
      <r>double value</r>
      <g>double value</g>
      <b>double value</b>
      <a>double value</a> <!-- not updated, but set with initAlpha() -->
    </colour>
  </appearance>
  <form>
    <sizefactor>
      <enabled>bool</enabled> <!-- if false then the whole form sizefactor can be ignored -->
      <x>double value</x>
      <y>double value</y>
      <z>double value</z>
    </sizefactor>
  </form>


Constructor & Destructor Documentation

GBE::GEnergyFormAgent::GEnergyFormAgent (  ) 

Constructor.

GBE::GEnergyFormAgent::~GEnergyFormAgent (  )  [virtual]

Destructor.


Member Function Documentation

void GBE::GEnergyFormAgent::initAlpha ( double  alpha_colour_component  ) 

Initializes alpha colour value in the element data.

The alpha component of the colour is not updated by the agent, it can be set here and won't be changed afterwards.

void GBE::GEnergyFormAgent::initColourEnabled ( bool  enabled  ) 

Enables or disables colour updating based on energy level. Enabled by default.

void GBE::GEnergyFormAgent::initRangeMax ( double  energy_level_max  ) 

Initializes energy range min in the element data. The minimum energy level is used to determine where the appearance should be dark.

void GBE::GEnergyFormAgent::initRangeMin ( double  energy_level_min  ) 

Initializes energy range max in the element data.

The maximum energy level is used to determine where the appearance should be light.

void GBE::GEnergyFormAgent::initSizeFactor ( const GCS::GVector3 size_factor  ) 

Initializes size factor in the element data.

The radius of the form is determined by the energy amount multiplied with given factors.

void GBE::GEnergyFormAgent::initSizeFactorEnabled ( bool  enabled  ) 

Enables or disables form size updating based on energy amount. Enabled by default.

void GBE::GEnergyFormAgent::run (  )  [protected, virtual]

Periodically updates the form of the element according to the current energy.

Reimplemented from GCS::GAgent.


The documentation for this class was generated from the following files:
Generated on Thu Nov 16 07:49:20 2006 for G System by  doxygen 1.4.7