Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mezzanine::UI::NineBoxStrategy Class Reference

This strategy partitions the screen into 9 area's that track which Quads are in them, allowing a smaller list of quads to be checked. More...

#include <nineboxstrategy.h>

+ Inheritance diagram for Mezzanine::UI::NineBoxStrategy:
+ Collaboration diagram for Mezzanine::UI::NineBoxStrategy:

Public Types

typedef std::vector< PartitionData * > PartitionVec
 Basic container type for PartitionData storage by this class.
 

Public Member Functions

 NineBoxStrategy ()
 Class constructor.
 
virtual ~NineBoxStrategy ()
 Class destructor.
 
WidgetFindHoveredWidget (const Vector2 &MousePos)
 Finds the hovered quad for the parent screen. More...
 
- Public Member Functions inherited from Mezzanine::UI::MouseHoverStrategy
 MouseHoverStrategy ()
 Class constructor.
 
virtual ~MouseHoverStrategy ()
 Class destructor.
 
void _NotifyScreenDirty ()
 Notifies this that it's parent screen was altered. More...
 
void _SetScreen (Screen *Parent)
 Sets the parent screen. More...
 

Protected Member Functions

Rect CalculatePartitionRect (const NineBoxPartition &PartID, const Vector2 &ScreenSize)
 Convenience method for calculating the actual size and position of a single partition. More...
 
PartitionDataGetHoveredPartition (const Vector2 &MousePos)
 Gets the partition that the provided position is in. More...
 
void UpdateCache ()
 Updates the partition cache with the newest quad positions.
 

Protected Attributes

PartitionVec Partitions
 A container storing all the quads that overlap with this screen partition.
 
- Protected Attributes inherited from Mezzanine::UI::MouseHoverStrategy
ScreenParentScreen
 A pointer to the screen this strategy is being used by. More...
 
bool ScreenDirty
 Stores whether or not the parent screen has been updated since the last time this strategys cache was updated. More...
 

Detailed Description

This strategy partitions the screen into 9 area's that track which Quads are in them, allowing a smaller list of quads to be checked.

Definition at line 100 of file nineboxstrategy.h.

Member Function Documentation

Rect Mezzanine::UI::NineBoxStrategy::CalculatePartitionRect ( const NineBoxPartition PartID,
const Vector2 ScreenSize 
)
protected

Convenience method for calculating the actual size and position of a single partition.

Parameters
PartIDThe enum value to calculate the pixel size and position for.
ScreenSizeThe current size of the screen the partition is on.
Returnsa Rect storing the actual size and position of the specified partition.
Returns
Returns a Rect containing the size and position of the partition requested.

Definition at line 132 of file nineboxstrategy.cpp.

Widget * Mezzanine::UI::NineBoxStrategy::FindHoveredWidget ( const Vector2 MousePos)
virtual

Finds the hovered quad for the parent screen.

Parameters
MousePosThe current mouse position.
Returns
Returns a pointer to the hovered quad, or NULL if none.

Implements Mezzanine::UI::MouseHoverStrategy.

Definition at line 161 of file nineboxstrategy.cpp.

PartitionData * Mezzanine::UI::NineBoxStrategy::GetHoveredPartition ( const Vector2 MousePos)
protected

Gets the partition that the provided position is in.

Parameters
MousePosThe screen position used to determine which partition to retrieve.
Returns
Returns a pointer to the PartitionData of the partition the provided mouse position is above.

Definition at line 151 of file nineboxstrategy.cpp.


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