Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

amire::component::Visible2DComponent Class Reference

Inheritance diagram for amire::component::Visible2DComponent:

amire::component::Component amire::component::Position2DPickingHandler amire::component::Handler amire::component::ActionHandler amire::component::Handler List of all members.

Public Member Functions

virtual ~Visible2DComponent ()
virtual void configurationPropertyModified ()
virtual void reinitializeEngine (MREngine *engine)
virtual void functionalCallback (MREngine *engine)
virtual osg::ref_ptr< const
amire::property::Property
emitOutSlotProperty (int outSlotId)
virtual void receiveInSlotProperty (int inSlotId, const osg::ref_ptr< const amire::property::Property > &property)
virtual bool pickingCallback (MREngine *engine, double x, double y, long pickingMode, double &distance) const
virtual void actionPerformed (const osg::ref_ptr< Action > &action)

Static Public Member Functions

int getMinDepthLevel ()
int getMaxDepthLevel ()
double getMinDepthValue ()
double getMaxDepthValue ()
double getDepthDelta ()

Protected Member Functions

 Visible2DComponent (ComponentManager *componentManager)
void initConfigurationProperty ()
void updateOutAlignmentOffset ()
void beginDisplay (MREngine *engine)
void endDisplay ()
double getDepth () const

Protected Attributes

bool visible
amire::common::Position2D position
amire::common::Dimension2D dimension
amire::common::Alignment2D alignment
amire::common::Rectangle inAlignmentOffset
amire::common::Rectangle outAlignmentOffset
double depth
int visibleInSlotId
int visibleOutSlotId
int alignmentOffsetInSlotId
int alignmentOffsetOutSlotId

Detailed Description

The Visible2DComponent class have to be the base class for a 2D component, if the authoring tools should be able to handle it. It provides several base conventions and functionalities for 2D components. It provides a predefined depth range and a ortogonal projection matrix, which have to be initializes for each frame by calling the method "beginDisplay". Further, this method prevents the environment from sideeffects of this component. After the rendering is completedand and if the rendering has been initialized by the call of "beginDisplay", the "endDisplay" method must be called. Several in- and out-slots are supported by this base class. 1) The visible in-slot sets the visible attribute and is relayed to the visible out-slot 2) The alignmentOffset in-slot provides the position and dimension of a 2D component, to which this 2D component is alligned. Based on this alignment offset and on the alignment setting this 2D component is placed. The position and dimension of this component is emitted on the alignmentOffset out-slot. The depth attribute represents the OpenGL depth value (z-axis) that should be used for the rendering process. To ensure that all required configuration settings are available for this 2D component, the configuration property type have to be derived from "common.Visible2DConfig", which contains the position and dimension settings. The inAlignmentOffset attribute represents the input alignment offset information. The position and diemension attribute represents the configuration settings. The visible attribute indicates if the 2D component is visible or not. The outAlignmentOffset represents the placement of this 2D component. It must be used to render the 2D component at the right place. Changes on this attribute will be overwritten by the updateOutAlignmentOffset method. To change the relative position and/or the dimension, the position and the dimension attribute themself have to be used. Afterward, the method updateOutAlignmentOffset has to be called.


Constructor & Destructor Documentation

virtual amire::component::Visible2DComponent::~Visible2DComponent  )  [virtual]
 

amire::component::Visible2DComponent::Visible2DComponent ComponentManager componentManager  )  [protected]
 


Member Function Documentation

virtual void amire::component::Visible2DComponent::actionPerformed const osg::ref_ptr< Action > &  action  )  [virtual]
 

Is called by the MREngine to forward an action to handler, which has been accepted as the receiver of this action. Nevertheless, it is not guaranted that this handler is the only receiver (more than one receiver may be possible).

Implements amire::component::ActionHandler.

void amire::component::Visible2DComponent::beginDisplay MREngine engine  )  [protected]
 

This method have to be called to intialize the rendering process of this 2D component. It pushed the OpenGL attributes and matrices onto a stack. Therefore, the endDisplay method have to be called to finalize the rendering process.

virtual void amire::component::Visible2DComponent::configurationPropertyModified  )  [virtual]
 

The configurationPropertyModified method is an abstract method that must be implemented by the component implementation class. It is called each time when the configuration property is released, which implies the possibility of a modified configuration property.

Implements amire::component::Component.

virtual osg::ref_ptr<const amire::property::Property> amire::component::Visible2DComponent::emitOutSlotProperty int  outSlotId  )  [virtual]
 

The emitOutSlotProperty method must be implemented to integrate out-slots into the component implementation. It is called, when the out-slot specified by the out-slot id is emitted by the component itself or from outside the component. It must provide the property that should be produced for this emit. An assert exception should be thrown for any failure case.

Reimplemented from amire::component::Component.

void amire::component::Visible2DComponent::endDisplay  )  [protected]
 

This method have to be called to finalize the rendering process of this 2D component. It pops the OpenGL attributes and matrices from a stack. Therefore, the beginDisplay method have to be called to initialize the rendering process.

virtual void amire::component::Visible2DComponent::functionalCallback MREngine engine  )  [virtual]
 

The functionalCallback method must be overwritten by the derived class and provide the functional or logical behaviour of the callback handler. A logical and functionality for example or the setting of a transformation matrix or scene graph at the MR engine for a specific component would be such a functionality. This callback should be used to integrate the functional behaviour into a component. An assert exception should be thrown in any failure case.

Reimplemented from amire::component::Component.

double amire::component::Visible2DComponent::getDepth  )  const [protected]
 

Returns the OpenGL depth value (z-axis) of this 2D component.

double amire::component::Visible2DComponent::getDepthDelta  )  [static]
 

Returns the depth difference value between two depth levels. A range of depth levels are provided to abstract the depth value. The minimal depth level is mapped to the minimal depth value. The maximal depth level is mapped to the maximal depth value. The depth values of the levels inbetween are linear interpolated.

int amire::component::Visible2DComponent::getMaxDepthLevel  )  [static]
 

Returns the maximal depth level of 2D components. A range of depth levels are provided to abstract the depth value. The minimal depth level is mapped to the minimal depth value. The maximal depth level is mapped to the maximal depth value. The depth values of the levels inbetween are linear interpolated.

double amire::component::Visible2DComponent::getMaxDepthValue  )  [static]
 

Returns the maximal depth value of 2D components. A range of depth levels are provided to abstract the depth value. The minimal depth level is mapped to the minimal depth value. The maximal depth level is mapped to the maximal depth value. The depth values of the levels inbetween are linear interpolated.

int amire::component::Visible2DComponent::getMinDepthLevel  )  [static]
 

Returns the minimal depth level of 2D components. A range of depth levels are provided to abstract the depth value. The minimal depth level is mapped to the minimal depth value. The maximal depth level is mapped to the maximal depth value. The depth values of the levels inbetween are linear interpolated.

double amire::component::Visible2DComponent::getMinDepthValue  )  [static]
 

Returns the minimal depth value of 2D components. A range of depth levels are provided to abstract the depth value. The minimal depth level is mapped to the minimal depth value. The maximal depth level is mapped to the maximal depth value. The depth values of the levels inbetween are linear interpolated.

void amire::component::Visible2DComponent::initConfigurationProperty  )  [protected]
 

This method has to be called by the implementation class to setup the configuration property with the predefined value. the configuration property instance itself must be set before this method is called. Otherwise, an exception will be thrown.

virtual bool amire::component::Visible2DComponent::pickingCallback MREngine engine,
double  x,
double  y,
long  pickingMode,
double &  distance
const [virtual]
 

This call-back method has to used accept an action for a 2D picking event. True has to be returned and the distance output argument has to be set to a estimation of the distance between the component and the picking device, if the event has been accepted, false otherwise.

Implements amire::component::Position2DPickingHandler.

virtual void amire::component::Visible2DComponent::receiveInSlotProperty int  inSlotId,
const osg::ref_ptr< const amire::property::Property > &  property
[virtual]
 

The receiveInSlotProperty method must be implemented to integrate in-slots into the component implementation. It is called when the component receives a property at the in-slot specified by its in-slot id. An assert exception should be thrown for any failure case.

Reimplemented from amire::component::Component.

virtual void amire::component::Visible2DComponent::reinitializeEngine MREngine engine  )  [virtual]
 

DEPRECATED: Will be renamed to to reintitialize as soon as possible!!!
The reinitializeEngine method is called by the MR engine to initialize the scene graph of the MR engine. It is called when the component manager of the MR engine has changed. The default implementation does nothing. An assert exception should be thrown in any failure case.

Reimplemented from amire::component::Component.

void amire::component::Visible2DComponent::updateOutAlignmentOffset  )  [protected]
 

This method have to be called whenever the positon or dimension is changed by the implementation class itself. Because the changed position and dimension effects the alignmentOffset out-slot.


Member Data Documentation

amire::common::Alignment2D amire::component::Visible2DComponent::alignment [protected]
 

int amire::component::Visible2DComponent::alignmentOffsetInSlotId [protected]
 

int amire::component::Visible2DComponent::alignmentOffsetOutSlotId [protected]
 

double amire::component::Visible2DComponent::depth [protected]
 

amire::common::Dimension2D amire::component::Visible2DComponent::dimension [protected]
 

amire::common::Rectangle amire::component::Visible2DComponent::inAlignmentOffset [protected]
 

amire::common::Rectangle amire::component::Visible2DComponent::outAlignmentOffset [protected]
 

amire::common::Position2D amire::component::Visible2DComponent::position [protected]
 

bool amire::component::Visible2DComponent::visible [protected]
 

int amire::component::Visible2DComponent::visibleInSlotId [protected]
 

int amire::component::Visible2DComponent::visibleOutSlotId [protected]
 


The documentation for this class was generated from the following file:
Generated on Tue May 20 17:23:57 2003 for AMIRE-Framework by doxygen1.3