Layout
-
class HPS::Layout : public HPS::Sprocket
The Layout class is one of the four core display classes used in a Visualize application. It is meant to be used as part of a display hierarchy along with the Canvas, View, and Model objects. The parent of the Layout is the Canvas, and a Layout can have multiple Views. The Layout is meant to describe the way the Views are presented in the Canvas. Like the other three core objects, the Layout is backed by a HPS::SegmentKey.
Public Functions
-
void AttachViewBack(View const &in_view, HPS::Rectangle const &in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f))
Attached a View to this Layout, and places it to the back of the layer list
-
void AttachViewFront(View const &in_view, HPS::Rectangle const &in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f))
Attached a View to this Layout, and places it to the front of the layer list
-
void BringToFront(size_t in_layer)
Brings a Layer to the front of the list, causing to be drawn on top of the other layers.
- Parameters
in_layer – The layer to be moved to the front
-
void DetachLayer(size_t in_layer)
Detaches this Layer from this Layout
- Parameters
in_layer – The Layer to detach.
-
void DetachView(View const &in_view)
Detaches this View from this Layout
- Parameters
in_view – The View to detach.
-
View GetAttachedView(size_t in_layer = 0) const
Returns the View assigned to the specified Layer
- Parameters
in_layer – The Layer of interest.
- Returns
The View associated to in_layer.
-
IncludeKey GetAttachedViewIncludeLink(size_t in_layer) const
Returns the IncludeKey associated with this Layout. The include key links the Layer segment key with the View.
-
size_t GetLayerAt(HPS::WindowPoint const &in_point) const
Returns the position within the layer list of the top layer at a specified position
- Parameters
in_point – A point in Window coordinates.
- Returns
The position within the layer list of the top layer at position in_point.
-
SegmentKey GetLayerSegmentKey(size_t in_layer) const
Returns the backing SegmentKey associated with a given layer. The owner of this key is the layout segment key.
-
CanvasArray const GetOwningCanvases() const
-
Rectangle GetPosition(size_t in_layer) const
Returns the position assigned to the specified Layer
- Parameters
in_layer – The layer of interest.
- Returns
The position of in_layer.
-
SegmentKey GetSegmentKey()
Each of the four display hierarchy objects (HPS::Canvas, HPS::Layout, HPS::View, HPS::Model) are backed by a HPS::SegmentKey. This function returns the HPS::SegmentKey that is associated with this HPS::Layout.
-
SegmentKey const GetSegmentKey() const
-
Layout()
-
inline virtual HPS::Type ObjectType() const
This function returns the type the object, as declared (if the object is derived, this does not give the true type of the derived object).
- Returns
The declared type of the object in question, which may differ from the true, underlying type.
-
void ReassignLayer(size_t in_layer, HPS::View in_view)
Reassigns a Layer to a different View.
- Parameters
in_layer – The layer to be reassigned.
in_view – The View in_layer will be assigned to.
-
void RepositionLayer(size_t in_layer, HPS::Rectangle const &in_position)
Changes the position of layer with respect to its window.
- Parameters
in_layer – The layer to be repositioned.
in_position – The new position for the layer.
-
bool ShowLayerAt(HPS::WindowPoint const &in_point) const
Returns whether a layer is present at the specified position.
- Parameters
in_point – A point in Window coordinates.
- Returns
true if a layer is present at in_point, false otherwise.
-
void Update() const
Redraws the Layout and all Canvases it appears in, including all of its child components.
-
void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const
Redraws the Layout and all Canvases it appears in, including all of its child components using the specified parameters.
- Parameters
in_type – one of the enum values specified by HPS::Window::UpdateType
in_time_limit – the maximum amount of time, in seconds, to spend updating.
-
UpdateNotifier UpdateWithNotifier() const
Redraws the Layout and all Canvases it appears in, including all of its child components using the default options, and also returns a notifier to facilitate tracking the update progress.
- Returns
An UpdateNotifier object used to find out information about the update.
-
UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const
Redraws the Layout and all Canvases it appears in, including all of its child components using the specified, and also returns a notifier to facilitate tracking the update progress.
- Parameters
in_type – one of the enum values specified by HPS::Window::UpdateType
in_time_limit – the maximum amount of time, in seconds, to spend updating this HPS::Canvas
- Returns
HPS::UpdateNotifier to facilitate tracking the update progress.
- Returns
An UpdateNotifier object used to find out information about the update.
-
~Layout()
Public Static Attributes
-
static const HPS::Type staticType = HPS::Type::Layout
-
void AttachViewBack(View const &in_view, HPS::Rectangle const &in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f))