Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

VgMyStackedLayerAndCameraHandler Class Reference

Inheritance diagram for VgMyStackedLayerAndCameraHandler:
Inheritance graph
[legend]
Collaboration diagram for VgMyStackedLayerAndCameraHandler:
Collaboration graph
[legend]

List of all members.

Public Types

enum  VgMyConfigurableParam {
  eFarAwayHeight, eStackViewHeading, eStackViewPitch, eLayerMaxSize,
  eStackViewDistance, eLayerDistance, eLayerDistanceFromCurrent, eAnimateToDetailCameraDuration,
  eAnimateToGlobalCameraDuration, eAnimateToGlobalLayerDuration, eAnimateToDetailLayerDuration, eAnimateChangeOfLayerDuration,
  eAnimateCancelPinchDuration, eAnimateCancelDragDuration, eAnimateMaxViewPointDuration, eChangeLayerTriggerThreshold,
  eStackNonActiveLayerAngle, eStackActiveLayerAngle, eMaxDoubleParams
}
enum  eFromToViewEnum { eFromStackToDetailedView, eFromDetailedToStackView, eFromGlobalToGlobaView }
typedef enum
VgMyStackedLayerAndCameraHandler::VgMyConfigurableParam 
VgMyConfigurableParam

Public Member Functions

 VgMyStackedLayerAndCameraHandler (VgApplication::VgIApplication *pVgApplication, VgMyLayerAndCameraListener *pListener, unsigned int pViewWidthInPixels, unsigned int pViewHeightInPixels)
virtual ~VgMyStackedLayerAndCameraHandler ()
bool isGlobalView ()
void switchToGlobalView (bool pIsAnimated=true)
 Switches from the detailledView to the global view.
void switchToDetailedView (bool pIsAnimated=true)
 Switches from the global to the detailled view.
const std::string & getFocusedLayerName ()
 Gets the focused layer's name.
void gotoLayer (const std::string &pLayerName, bool pIsAnimated=true)
 Focus a specific layer.
unsigned int getNumberOfLayers ()
 Returns the number of layers.
bool getLayerName (const unsigned int pLayerIndex, std::string &pLayerNameOut)
 Returns the layer name for a given indes.
void gotoLayer (const unsigned int pLayerIndex, bool pIsAnimated=true)
 Focus a specific layer.
void gotoViewpoint (const VgEngine::VgIViewPoint &pViewpoint, const std::string &pLayerName, bool pIsAnimated=true)
 Moves the camera to a specific view point.
void gotoLookAtPosition (const VgEngine::VgPosition &pPosition, const std::string &pLayerName, bool pIsAnimated=true)
 Moves the camera so that it is focused on a given position.
void refreshParameters (unsigned int pWidth, unsigned int pHeight)
 Refreshes the inner parameters.
unsigned int getCurrentLayerIndex () const
VgEngine::VgPosition * getCameraPosition ()
void onLayerSelected ()
void onSelectorReady ()
void animateCameraToViewPoint (const VgEngine::VgIViewPoint &pViewPoint, float pDuration, bool pIsAnimated)
void animateLayersFromCloseToStackView (eFromToViewEnum pDirection, float pDuration, bool pIsAnimated)
VgEngine::VgPosition getPositionForLayerInGlobalView (unsigned int pLayerIndex, unsigned int pFocusedLayer)
 Gets the position for a layer when in global view.
VgEngine::VgPosition getPositionForLayerInDetailedView (unsigned int pLayerIndex, unsigned int pFocusedLayer)
 Gets the position for a layer when in detailed view.
void animateLayerToPositionAndRotation (VgEngine::VgRefPtr< VgEngine::VgLayer >const &pLayer, const VgEngine::VgPosition &pStartPos, const VgEngine::VgPosition &pEndPos, VgEngine::VgRefPtr< VgEngine::VgIAnimationCallback >const &pCallback, float pDuration, float pStartAngle, float pEndAngle)
 Gets the position for a layer when in detailed view.
VgEngine::VgIViewPoint & getStackViewPoint ()
void setStackCenterPosition (const VgEngine::VgPosition &pCenter)
const VgEngine::VgPosition & getStackCenter ()
 Get the stack center.
void refreshStackView ()
void setParam (const VgMyConfigurableParam pParam, const double pDouble)
 Allows application to customise the look and feel of the VgMyStackedLayerAndCameraHandler.
double getParam (const VgMyConfigurableParam pParam)
 Retrieve a parameter value.
void updateManipulatorForGlobalView (bool pIsGlobalView)
 Updates the manipulator, according to the stack state.

Protected Member Functions

VgEngine::VgRefPtr
< VgEngine::VgIAnimationCallback > 
registerCallback (VgEngine::VgRefPtr< VgEngine::VgIAnimationCallback > pCallback, unsigned int pLayerIndex)
void setDefaultStackParams ()
void calculateDynamicStackParams ()
void gotoLayerInGlobalView (const unsigned int pLayerIndex, bool pIsAnimated)
void gotoLayerInDetailedView (const unsigned int pLayerIndex, bool pIsAnimated)

Protected Attributes

bool mUsePinchToSwitchGlobalToDetailed
VgApplication::VgIApplication * mVgApplication
VgMyLayerAndCameraListenermLayerUpdateListener
unsigned int mCurrentLayerIndex
unsigned int mPreviousLayerIndex
bool mIsLayerStackDisplayed
bool mIsViewModeInitialized
VgEngine::VgIViewPoint mCamStartViewPoint
double mParam [eMaxDoubleParams]
VgEngine::VgPosition mStackCenter
VgEngine::VgIViewPoint mCameraGlobalViewPoint
VgEngine::VgRefPtr
< VgEngine::VgIAnimationCallback > 
mCameraCallback
std::vector
< VgEngine::VgRefPtr
< VgEngine::VgIAnimationCallback > > 
mLayersCallback
VgEngine::VgRefPtr
< FloorSelectorManipulator
mManipulatorListener
std::hash_map< std::string, float > mLODsFactors
std::hash_map< std::string, float > mLoadFactors

Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
eFromStackToDetailedView 
eFromDetailedToStackView 
eFromGlobalToGlobaView 
Enumerator:
eFarAwayHeight 
eStackViewHeading 
eStackViewPitch 
eLayerMaxSize 
eStackViewDistance 
eLayerDistance 
eLayerDistanceFromCurrent 
eAnimateToDetailCameraDuration 
eAnimateToGlobalCameraDuration 
eAnimateToGlobalLayerDuration 
eAnimateToDetailLayerDuration 
eAnimateChangeOfLayerDuration 
eAnimateCancelPinchDuration 
eAnimateCancelDragDuration 
eAnimateMaxViewPointDuration 
eChangeLayerTriggerThreshold 
eStackNonActiveLayerAngle 
eStackActiveLayerAngle 
eMaxDoubleParams 

Constructor & Destructor Documentation

VgMyStackedLayerAndCameraHandler::VgMyStackedLayerAndCameraHandler ( VgApplication::VgIApplication *  pVgApplication,
VgMyLayerAndCameraListener pListener,
unsigned int  pViewWidthInPixels,
unsigned int  pViewHeightInPixels 
)
virtual VgMyStackedLayerAndCameraHandler::~VgMyStackedLayerAndCameraHandler (  ) [virtual]

Member Function Documentation

void VgMyStackedLayerAndCameraHandler::animateCameraToViewPoint ( const VgEngine::VgIViewPoint &  pViewPoint,
float  pDuration,
bool  pIsAnimated 
)
void VgMyStackedLayerAndCameraHandler::animateLayersFromCloseToStackView ( eFromToViewEnum  pDirection,
float  pDuration,
bool  pIsAnimated 
)
void VgMyStackedLayerAndCameraHandler::animateLayerToPositionAndRotation ( VgEngine::VgRefPtr< VgEngine::VgLayer >const &  pLayer,
const VgEngine::VgPosition &  pStartPos,
const VgEngine::VgPosition &  pEndPos,
VgEngine::VgRefPtr< VgEngine::VgIAnimationCallback >const &  pCallback,
float  pDuration,
float  pStartAngle,
float  pEndAngle 
)

Gets the position for a layer when in detailed view.

Parameters:
pLayerpointer to layer to manipulate
pStartPosstarting position of layer. If not the same as its current position it will jump.
pEndPosending position of layer.
pCallbackcallback at end of animation.
pDurationduration of animation in seconds.
pStartAnglestart angle of layer, used for carrousel mode, otherwise use 0.0f
pEndAnglestart angle of layer, used for carrousel mode, otherwise use 0.0f
void VgMyStackedLayerAndCameraHandler::calculateDynamicStackParams (  ) [protected]
VgEngine::VgPosition* VgMyStackedLayerAndCameraHandler::getCameraPosition (  )
unsigned int VgMyStackedLayerAndCameraHandler::getCurrentLayerIndex (  ) const
const std::string& VgMyStackedLayerAndCameraHandler::getFocusedLayerName (  ) [virtual]

Gets the focused layer's name.

The "focused" layer is the one that is displayed in the detailled view. if the global view is displayed, the focused layer should be the most visible one.

Returns:
The focused layer's name.

Implements VgMyLayerAndCameraHandler.

bool VgMyStackedLayerAndCameraHandler::getLayerName ( const unsigned int  pLayerIndex,
std::string &  pLayerNameOut 
) [virtual]

Returns the layer name for a given indes.

Parameters:
pLayerIndexLayer index, should be less than getNumberOfLayers().
pLayerNameOutstring to set with layer name.
Returns:
true if name was set, false if pLayerIndex is greater or equal to getNumberOfLayers().

Implements VgMyLayerAndCameraHandler.

unsigned int VgMyStackedLayerAndCameraHandler::getNumberOfLayers (  ) [virtual]

Returns the number of layers.

Implements VgMyLayerAndCameraHandler.

double VgMyStackedLayerAndCameraHandler::getParam ( const VgMyConfigurableParam  pParam )

Retrieve a parameter value.

VgEngine::VgPosition VgMyStackedLayerAndCameraHandler::getPositionForLayerInDetailedView ( unsigned int  pLayerIndex,
unsigned int  pFocusedLayer 
)

Gets the position for a layer when in detailed view.

Parameters:
pLayerIndexThe index of the layer whose position is to be calculated
pFocusedLayer The index of the layer which currently has the stacked view focus.
Returns:
The position for the requested layer.
VgEngine::VgPosition VgMyStackedLayerAndCameraHandler::getPositionForLayerInGlobalView ( unsigned int  pLayerIndex,
unsigned int  pFocusedLayer 
)

Gets the position for a layer when in global view.

Parameters:
pLayerIndexThe index of the layer whose position is to be calculated
pFocusedLayer The index of the layer which currently has the stacked view focus.
Returns:
The position for the requested layer.
const VgEngine::VgPosition& VgMyStackedLayerAndCameraHandler::getStackCenter (  )

Get the stack center.

VgEngine::VgIViewPoint& VgMyStackedLayerAndCameraHandler::getStackViewPoint (  )
void VgMyStackedLayerAndCameraHandler::gotoLayer ( const std::string &  pLayerName,
bool  pIsAnimated = true 
) [virtual]

Focus a specific layer.

Parameters:
pLayerNameLayer that will be focused. keeps current mode.
pIsAnimatedIf true then animates the transition, otherwise does not.

Implements VgMyLayerAndCameraHandler.

void VgMyStackedLayerAndCameraHandler::gotoLayer ( const unsigned int  pLayerIndex,
bool  pIsAnimated = true 
) [virtual]

Focus a specific layer.

Parameters:
pLayerNameLayer index which is associated with the returned list given by VgLayerManager::getLayers(). keeps current mode.
pIsAnimatedIf true then animates the transition, otherwise does not.

Implements VgMyLayerAndCameraHandler.

void VgMyStackedLayerAndCameraHandler::gotoLayerInDetailedView ( const unsigned int  pLayerIndex,
bool  pIsAnimated 
) [protected]
void VgMyStackedLayerAndCameraHandler::gotoLayerInGlobalView ( const unsigned int  pLayerIndex,
bool  pIsAnimated 
) [protected]
void VgMyStackedLayerAndCameraHandler::gotoLookAtPosition ( const VgEngine::VgPosition &  pPosition,
const std::string &  pLayerName,
bool  pIsAnimated = true 
) [virtual]

Moves the camera so that it is focused on a given position.

The camera's view, heading, pitch are always conserved. The altitude of pPosition is automatically set to zero.

If the pLayerName isn't the currently focused layer, then before any camera movement is invoked, pLayerName becomes the focused layer.

Note:
If the stack is in global view, the camera will not change.
Parameters:
pPositionThe position to focus on.
pLayerNameThe name of the layer associated with the position.
pIsAnimatedIf true then animates the transition, otherwise does not.

Implements VgMyLayerAndCameraHandler.

void VgMyStackedLayerAndCameraHandler::gotoViewpoint ( const VgEngine::VgIViewPoint &  pViewPoint,
const std::string &  pLayerName,
bool  pIsAnimated = true 
) [virtual]

Moves the camera to a specific view point.

If the pLayerName isn't the currently focused layer, then before any camera movement is invoked, pLayerName becomes the focused layer.

Note:
If the stack is in global view, the camera will not change.
Parameters:
pViewPointThe view point to associate with the camera
pLayerNameThe layer which should be given the focus.
pIsAnimatedIf true then animates the transition, otherwise does not.

Implements VgMyLayerAndCameraHandler.

bool VgMyStackedLayerAndCameraHandler::isGlobalView (  ) [virtual]
Returns:
TRUE if the Handler displays the global view. FALSE if displaying the detailed view.

Implements VgMyLayerAndCameraHandler.

void VgMyStackedLayerAndCameraHandler::onLayerSelected (  )
void VgMyStackedLayerAndCameraHandler::onSelectorReady (  )
void VgMyStackedLayerAndCameraHandler::refreshParameters ( unsigned int  pWidth,
unsigned int  pHeight 
) [virtual]

Refreshes the inner parameters.

Typically, subclasses can use it to recompute their view parameters when the rendering size changes.

Implements VgMyLayerAndCameraHandler.

void VgMyStackedLayerAndCameraHandler::refreshStackView (  )
VgEngine::VgRefPtr< VgEngine::VgIAnimationCallback > VgMyStackedLayerAndCameraHandler::registerCallback ( VgEngine::VgRefPtr< VgEngine::VgIAnimationCallback >  pCallback,
unsigned int  pLayerIndex 
) [protected]
void VgMyStackedLayerAndCameraHandler::setDefaultStackParams (  ) [protected]
void VgMyStackedLayerAndCameraHandler::setParam ( const VgMyConfigurableParam  pParam,
const double  pDouble 
)

Allows application to customise the look and feel of the VgMyStackedLayerAndCameraHandler.

Parameters:
pParamThe parameter to be set. Please see the VgMyConfigurableParam type to gain an understanding of what each configurable parameter is responsible for.
Note:
If parameters are changed via this method, then it is necessary to call refreshStackView() in order for the global stack view to be updated to reflect the new values.
void VgMyStackedLayerAndCameraHandler::setStackCenterPosition ( const VgEngine::VgPosition &  pCenter )
void VgMyStackedLayerAndCameraHandler::switchToDetailedView ( bool  pIsAnimated = true ) [virtual]

Switches from the global to the detailled view.

Do nothing if alrady in detailled view.

Parameters:
pIsAnimatedIf true then animates the transition, otherwise does not.

Implements VgMyLayerAndCameraHandler.

void VgMyStackedLayerAndCameraHandler::switchToGlobalView ( bool  pIsAnimated = true ) [virtual]

Switches from the detailledView to the global view.

Do nothing if already in global view.

Parameters:
pIsAnimatedIf true then animates the transition, otherwise does not.

Implements VgMyLayerAndCameraHandler.

void VgMyStackedLayerAndCameraHandler::updateManipulatorForGlobalView ( bool  pIsGlobalView )

Updates the manipulator, according to the stack state.

Parameters:
pIsGlobalViewTrue if the stack state is currently the global view. False if the the stack state is detailed view.

Member Data Documentation

VgEngine::VgRefPtr< VgEngine::VgIAnimationCallback > VgMyStackedLayerAndCameraHandler::mCameraCallback [protected]
VgEngine::VgIViewPoint VgMyStackedLayerAndCameraHandler::mCamStartViewPoint [protected]
std::vector<VgEngine::VgRefPtr< VgEngine::VgIAnimationCallback > > VgMyStackedLayerAndCameraHandler::mLayersCallback [protected]
std::hash_map<std::string, float> VgMyStackedLayerAndCameraHandler::mLoadFactors [protected]
std::hash_map<std::string, float> VgMyStackedLayerAndCameraHandler::mLODsFactors [protected]
double VgMyStackedLayerAndCameraHandler::mParam[eMaxDoubleParams] [protected]
VgEngine::VgPosition VgMyStackedLayerAndCameraHandler::mStackCenter [protected]
VgApplication::VgIApplication* VgMyStackedLayerAndCameraHandler::mVgApplication [protected]

The documentation for this class was generated from the following file:
VisioDevKit 2.0, Visioglobe® 2013