# Layout

class `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 `Assign`(Layout const &in_that)
  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

    Parameters: | in_view – The View to be attached to this Layer. in_position – A Rectangle describing the position this View occupies with respect to the window.

  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

    Parameters: | in_view – The View to be attached to this Layer. in_position – A Rectangle describing the position this View occupies with respect to the window.

  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 `Delete`()

    Deletes this Layout. If the Layout has Views attached, they are not destroyed.

  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.

  bool `Equals`(Layout const &in_that) const
  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.

  View `GetFrontView`() const

    Returns the View assigned to the layer shown on top of the window

  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.

  size_t `GetLayerCount`() const

    Returns the number of Layers currently associated with this Layout

  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.

  UTF8 `GetName`() const

    Get the name used when creating this Layout.

  CanvasArray `GetOwningCanvases`()

    Returns an array containing the Canvas this Layout is included in.

  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`()
  `Layout`(Layout const &that)
  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.

  bool `operator!=`(Layout const &in_that) const
  Layout &`operator=`(Layout const &in_that)
  bool `operator==`(Layout const &in_that) const
  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

Hello I'm HOOPSY!

HOOPSY BETA

Hello I am HOOPSY! your Docs generative AI assistant.

Ask me anything about HOOPS Visualize HPS or choose a sample question below to start a conversation:

Additional info

HOOPSY may store chats to provide and maintain the service according to OpenAI's data policy.

This feature is currently experimental. While we are continually enhancing its performance and quality, the underlying AI model may generate inaccurate or fabricated responses, especially if prompted to do so.

New Conversation
Continue generating