Gtkada.Canvas_View.Models.Rtree_Models

Entities

Generic formal parameters

Tagged Types

Access Types

Subprograms

Description

---------- Rtrees -- ---------- A wrapper around another model, which provides efficient geospatial queries, like finding the smaller enclosing rectangle for all the items, or all the items within a given region. The items are stored in the base model, and the Rtree model adds an extra data structure on top of it to speed up the queries. When new items are added to the model, Refresh_Layout must be called to refresh the internal cache (but this should always be done in any case to refresh the display of links for instance).

Wrapping a model in a Rtree means that the speed of displaying the canvas (and more importantly scrolling it) now depends on the number of items on the screen, not the total number of items in the model). As a result, it is possible to have models with hundreds of thousands of items.

Base_Model_Record

type Base_Model_Record is new Canvas_Model_Record with private;

The underlying implementation of the model (which for instance provides support for Add and Remove), and for which the Rtree is used as a wrapper.

Bounding_Box

function Bounding_Box
  (Self   : not null access Rtree_Model_Record;
   Margin : Model_Coordinate := 0.0)
   return Model_Rectangle
Parameters
Self
Margin
Return Value

For_Each_Item

procedure For_Each_Item
  (Self     : not null access Rtree_Model_Record;
   Callback : not null access procedure
     (Item : not null access Abstract_Item_Record'Class);
   Selected_Only : Boolean := False;
   Filter        : Item_Kind_Filter := Kind_Any;
   In_Area       : Model_Rectangle := No_Rectangle)
Parameters
Self
Callback
Selected_Only
Filter
In_Area

Gtk_New

procedure Gtk_New (Self : out Rtree_Model)

Create a new Rtree model.

Parameters
Self

Initialize

procedure Initialize
   (Self : not null access Rtree_Model_Record'Class)

Create a new Rtree model.

Parameters
Self

Refresh_Layout

procedure Refresh_Layout
   (Self        : not null access Rtree_Model_Record;
    Send_Signal : Boolean := True)
Parameters
Self
Send_Signal

Rtree_Model

type Rtree_Model is access all Rtree_Model_Record'Class;

Rtree_Model_Record

type Rtree_Model_Record is new Base_Model_Record with private;

Toplevel_Item_At

function Toplevel_Item_At
  (Self    : not null access Rtree_Model_Record;
   Point   : Model_Point;
   Context : Draw_Context) return Abstract_Item
Parameters
Self
Point
Context
Return Value