Controller (in the Model-View-Controller sense) for a set of Pins. More...
#include <PinController.h>
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 () |
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.
|
inline |
Create PinController object.
pinRepository | The repository of Pin model objects to be mapped to/from PinView objects. |
terrainHeightProvider | The TerrainHeightProvider to be used for updating the positions of the Pin object with respect to the terrain. |
viewFactory | The factory to be used for creating views to represent the models in the repository. |
viewRenderer | The renderer that will be used to displat the view objects. |
|
inline |
|
inline |
|
inlinevirtual |
The method to receive notification that a Pin object has been added to the repository.
pin | The Pin that has been added to the repository. |
Implements Eegeo::Pins::IPinObserver.
|
inlinevirtual |
The method to receive notification that a Pin object has been removed from the repository.
pin | The Pin that has been removed from the repository. |
Implements Eegeo::Pins::IPinObserver.
|
inline |
|
inline |
Test the Pins in the repository for intersection with a given screen point.
screenPoint | The screen point (in screen pixel coordinates) to test for intersection with the Pins. |
outIntersectingPins | A vector to be populated, in order of increasing distance from the camera, with the Pins whose views intersect screenPoint. |
|
inline |
Update the state of the PinController
deltaTime | The time, in seconds, since this method was last called. |
renderCamera | The current active renderCamera |