All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Protected Member Functions | List of all members
Eegeo::Pins::PinController Class Reference

Controller (in the Model-View-Controller sense) for a set of Pins. More...

#include <PinController.h>

Inheritance diagram for Eegeo::Pins::PinController:
Eegeo::Pins::IPinObserver

Public Member Functions

 PinController (PinRepository &pinRepository, Resources::Terrain::Heights::TerrainHeightProvider &terrainHeightProvider, IPinViewFactory &viewFactory, PinViewRenderer &viewRenderer)
 
void Update (float deltaTime, const Camera::RenderCamera &renderCamera)
 
virtual void OnPinAdded (Pin &pin)
 
virtual void OnPinRemoved (Pin &pin)
 
void GetScreenBoundsForPin (const Pin &pin, Geometry::Bounds2D &outScreenBounds) const
 
bool TryGetPinsIntersectingScreenPoint (const v2 &screenPoint, std::vector< Pin * > &outIntersectingPins) const
 
float GetScaleForPin (const Pin &pin) const
 
void SetScaleForPin (const Pin &pin, float pinScale)
 

Protected Member Functions

virtual void UpdateViews ()
 

Detailed Description

Controller (in the Model-View-Controller sense) for a set of Pins.

This class updates the terrain height for a set of Pins ands maps them to and from PinViews for display and collision detection purposes.

Constructor & Destructor Documentation

Eegeo::Pins::PinController::PinController ( PinRepository pinRepository,
Resources::Terrain::Heights::TerrainHeightProvider terrainHeightProvider,
IPinViewFactory viewFactory,
PinViewRenderer viewRenderer 
)
inline

Create PinController object.

Parameters
pinRepositoryThe repository of Pin model objects to be mapped to/from PinView objects.
terrainHeightProviderThe TerrainHeightProvider to be used for updating the positions of the Pin object with respect to the terrain.
viewFactoryThe factory to be used for creating views to represent the models in the repository.
viewRendererThe renderer that will be used to displat the view objects.
Returns
A new PinController object.

Member Function Documentation

float Eegeo::Pins::PinController::GetScaleForPin ( const Pin pin) const
inline

Retrieve the uniform scale for a given Pin's view.

Parameters
pinThe Pin to retrieve scale for.
Returns
The uniform scale value for the pin.
void Eegeo::Pins::PinController::GetScreenBoundsForPin ( const Pin pin,
Geometry::Bounds2D outScreenBounds 
) const
inline

Retrieve the 2D screen bounds for a given Pin's view.

Parameters
pinThe Pin to retrieve screen bounds for.
outScreenBoundsThe vector to receive the bounds of the given Pin in screen pixel coordinates.
virtual void Eegeo::Pins::PinController::OnPinAdded ( Pin pin)
inlinevirtual

The method to receive notification that a Pin object has been added to the repository.

Parameters
pinThe Pin that has been added to the repository.

Implements Eegeo::Pins::IPinObserver.

virtual void Eegeo::Pins::PinController::OnPinRemoved ( Pin pin)
inlinevirtual

The method to receive notification that a Pin object has been removed from the repository.

Parameters
pinThe Pin that has been removed from the repository.

Implements Eegeo::Pins::IPinObserver.

void Eegeo::Pins::PinController::SetScaleForPin ( const Pin pin,
float  pinScale 
)
inline

Set the uniform scale for a given Pin's view.

Parameters
pinThe Pin to retrieve scale for.
pinScaleThe new uniform scale value for the pin.
bool Eegeo::Pins::PinController::TryGetPinsIntersectingScreenPoint ( const v2 screenPoint,
std::vector< Pin * > &  outIntersectingPins 
) const
inline

Test the Pins in the repository for intersection with a given screen point.

Parameters
screenPointThe screen point (in screen pixel coordinates) to test for intersection with the Pins.
outIntersectingPinsA vector to be populated, in order of increasing distance from the camera, with the Pins whose views intersect screenPoint.
Returns
true if any Pin's views intersected screenPoint, otherwise false.
void Eegeo::Pins::PinController::Update ( float  deltaTime,
const Camera::RenderCamera renderCamera 
)
inline

Update the state of the PinController

Parameters
deltaTimeThe time, in seconds, since this method was last called.
renderCameraThe current active renderCamera

The documentation for this class was generated from the following file: