VisComponentStrategy Class Reference

#include <VisComponentStrategy.h>

Collaboration diagram for VisComponentStrategy:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 VisComponentStrategy (void)
virtual ~VisComponentStrategy (void)
void initPropertiesComponent ()
void processComponent ()
void drawComponent (const std::vector< unsigned long > &selectedIds)
void drawForPickingComponent ()
void onEventComponent (LargeDisplayEvent *evt)
void resizeComponent (unsigned int width, unsigned int height)
bool dropComponent (bool parentChanged)
void readPassiveBuffersComponent (const std::vector< unsigned int > &types)
void readAllPassiveBuffersComponent ()
void readAllPickingPassiveBuffersComponent ()
void setComponent (VisComponent *comp)
VisComponentgetComponent ()
void setNextStrategy (VisComponentStrategy *next)
VisComponentStrategygetNextStrategy ()

Protected Member Functions

virtual void initProperties ()
virtual void process ()
virtual void draw (const std::vector< unsigned long > &selectedIds)
virtual void drawForPicking ()
virtual void onEvent (LargeDisplayEvent *evt)
virtual void resize (unsigned int width, unsigned int height)
virtual bool drop (bool parentChanged)
virtual void readPassiveBuffers (const std::vector< unsigned int > &types)
virtual void readAllPassiveBuffers ()
virtual void readAllPickingPassiveBuffers ()

Protected Attributes

VisComponentcomponent
VisComponentStrategynextStrategy

Detailed Description

This class defines the interface of a strategy used for the behavior of a component. Its concrete subclasses determine how to draw the component and how it should respond to events.

Author:
Fabricio Anastacio - fabriciocfa@yahoo.com
Since:
July 2, 2007


Constructor & Destructor Documentation

VisComponentStrategy::VisComponentStrategy ( void   ) 

Constructs this startegy.

VisComponentStrategy::~VisComponentStrategy ( void   )  [virtual]

Destroys this strategy.


Member Function Documentation

void VisComponentStrategy::initPropertiesComponent (  )  [inline]

Initializes the properties (i. e., i-buffers) of the associated component.

void VisComponentStrategy::processComponent (  )  [inline]

Performs an action before drawing the component.

void VisComponentStrategy::drawComponent ( const std::vector< unsigned long > &  selectedIds  )  [inline]

Defines the drawing strategy for the associated component.

Parameters:
selectedIds the list of currently selected ids.

void VisComponentStrategy::drawForPickingComponent (  )  [inline]

Defines the drawing strategy for the associated component to be used for picking.

void VisComponentStrategy::onEventComponent ( LargeDisplayEvent evt  )  [inline]

Handles the given event.

Parameters:
evt the event to be handled.

void VisComponentStrategy::resizeComponent ( unsigned int  width,
unsigned int  height 
) [inline]

Defines the strategy to be used when the associated component is resized.

Parameters:
width the new width of the component.
height the new height of the component.

bool VisComponentStrategy::dropComponent ( bool  parentChanged  )  [inline]

Defines the strategy to be used when the associated component is dropped inside another component/container. Returns true if this call resulted in adding the component to a container with animation.

Parameters:
parentChanged true if the component's parent changed with the dropping.
Returns:
true if this call resulted in adding the component to a container with animation, false otherwise.

void VisComponentStrategy::readPassiveBuffersComponent ( const std::vector< unsigned int > &  types  )  [inline]

Reads the passive buffer(s) specified by the parameter 'type' and makes the proper updates in the state of the associated component. The value of type must be unique for each type of buffer throughout the application. Inconsistences can lead to unexpected behaviors during buffer reading.

Parameters:
types the types of buffers that should be read from the container.

void VisComponentStrategy::readAllPassiveBuffersComponent (  )  [inline]

Reads all the passive buffers for a component specified by its associated strategies. This method is called before drawing the component in order to update its state/properties.

void VisComponentStrategy::readAllPickingPassiveBuffersComponent (  )  [inline]

Reads only the passive buffers for the component strategies that are necessary for picking processing. This method is called before drawing the component for picking in order to update its state/properties.

void VisComponentStrategy::setComponent ( VisComponent comp  )  [inline]

Sets the component associated with this strategy.

Parameters:
comp the VisComponent object associated with this strategy.

VisComponent* VisComponentStrategy::getComponent (  )  [inline]

Returns a pointer to the component associated with this strategy.

Returns:
a pointer to the component associated with this strategy.

void VisComponentStrategy::setNextStrategy ( VisComponentStrategy next  )  [inline]

Sets the next strategy to this one (Decorator Design Pattern).

Parameters:
next the VisComponentStrategy object that is next to this strategy.

VisComponentStrategy* VisComponentStrategy::getNextStrategy (  )  [inline]

Returns a pointer to the strategy that is necxt to this one (Decorator Design Pattern).

Returns:
a pointer to the strategy that is necxt to this one.

virtual void VisComponentStrategy::initProperties (  )  [inline, protected, virtual]

Initializes the properties (i. e., i-buffers) of the associated component.

virtual void VisComponentStrategy::process (  )  [inline, protected, virtual]

Performs a given action before rendering the component.

virtual void VisComponentStrategy::draw ( const std::vector< unsigned long > &  selectedIds  )  [inline, protected, virtual]

Defines the drawing strategy for the associated component.

Parameters:
selectedIds the list of currently selected ids.

virtual void VisComponentStrategy::drawForPicking (  )  [inline, protected, virtual]

Defines the drawing strategy for the associated component that should be used for picking.

virtual void VisComponentStrategy::onEvent ( LargeDisplayEvent evt  )  [inline, protected, virtual]

Handles the given event.

Parameters:
evt the event to be handled.

virtual void VisComponentStrategy::resize ( unsigned int  width,
unsigned int  height 
) [inline, protected, virtual]

Defines the strategy to be used when the associated component is resized.

Parameters:
width the new width of the component.
height the new height of the component.

virtual bool VisComponentStrategy::drop ( bool  parentChanged  )  [inline, protected, virtual]

Defines the strategy to be used when the associated component is "dropped" inside another component (likely, a container). It is called when the component is processed from the manager's update list. It usually defines some "decorative" behavior such as triggering animations, since the composition structure is already managed by the LargeDisplayManager class. Returns true if this call resulted in adding the component to a container with animation.

Parameters:
parentChanged true if the component's parent changed with the dropping.
Returns:
true if this call resulted in adding or keeping the component to a container with animation, false otherwise.

virtual void VisComponentStrategy::readPassiveBuffers ( const std::vector< unsigned int > &  types  )  [inline, protected, virtual]

Reads the passive buffer(s) specified by the parameter 'type' and makes the proper updates in the state of the associated component. The value of type must be unique for each type of buffer throughout the application. Inconsistences can lead to unexpected behaviors during buffer reading.

Parameters:
types the types of buffers that should be read from the container.

virtual void VisComponentStrategy::readAllPassiveBuffers (  )  [inline, protected, virtual]

Reads all the passive buffers for a component strategy. This method is called before drawing the component in order to update its state/properties.

virtual void VisComponentStrategy::readAllPickingPassiveBuffers (  )  [inline, protected, virtual]

Reads only the passive buffers for a component strategy that are necessary for picking processing. This method is called before drawing the component for picking in order to update its state/properties.


Member Data Documentation

VisComponent* VisComponentStrategy::component [protected]

The VisComponent object using this strategy.

VisComponentStrategy* VisComponentStrategy::nextStrategy [protected]

The VisComponentStrategy object that is next to this one in the processing order or that is "decorated" by this one, if any.


The documentation for this class was generated from the following files:
Generated on Fri Dec 21 17:43:51 2007 for LargeDisplayFramework by  doxygen 1.5.2