Package OpenCAGE.GUI.Displays.Quad_Tree_Components

This package provides all necessary function and structures to manage the Quad_Tree e.g. insert node, remove node ...

Class Quad_Tree_Component

This is a single node in the Quad-Tree which holds a pointer to its childs, a list of pointers to the edge- and node-displays and some other attributes

Attributes

private OpenCAGE.GUI.Displays.Quad_Tree_Components.Quad_Tree_Component Upper_Left 

points to the Quad_Tree_Component which lies hierarchically under the upper left quadrant

private OpenCAGE.GUI.Displays.Quad_Tree_Components.Quad_Tree_Component Upper_Right 

points to the Quad_Tree_Component which lies hierarchically under the upper right quadrant

private OpenCAGE.GUI.Displays.Quad_Tree_Components.Quad_Tree_Component Lower_Left 

points to the Quad_Tree_Component which lies hierarchically under the lower left quadrant

private OpenCAGE.GUI.Displays.Quad_Tree_Components.Quad_Tree_Component Lower_Right 

points to the Quad_Tree_Component which lies hierarchically under the lower right quadrant

private Graphics.Points.Point Center_Point 

describes the central point of the Quad_Tree_Component

private OpenCAGE.GUI.Displays.Node_Displays.Node_Lists.List Node_List 

points to the Node_Tree_List

private Glib.Gint Width 

describes the width in pixel of the Quad_Tree_Component

private Glib.Gint Height 

describes the height of the Quad_Tree_Component

private OpenCAGE.GUI.Displays.Edge_Displays.Edge_Lists.List Edge_List 

Pointer of Edge_Displays to the Edge_Tree_List

Operations

public Boolean Has_Child( OpenCAGE.GUI.Displays.Quad_Tree_Components.Quadrant My_Quadrant);

checks if this Quad_Tree_Component has a child in a particular quadrant

public Traverse( Natural Current_Depth);

This is a debugging methode which prints the Quad_Tree_Component recursivelly to the console

public Insert_Node( OpenCAGE.GUI.Displays.Node_Displays.Node_Display Node);

This method inserts a new object of Node_Display into the Node_List and a pointer into the Quad-Tree which points to the Node_List. This allows a faster access. This method checks if the Node is the area which is covered by the Quad-Tree.

public Set_Objects_Visible( Graphics.Points.Point Up_Left, Graphics.Points.Point Low_Right);

finds all nodes and edges for the root quad-tree and sets the In_Viewport

public Set_Candidates( Graphics.Points.Point Clicked);

This method searches trough a Node_Tree_List. If the Clicked Point is within a Nodes area, the Node's attribute Candidates is set true.

public Set_Child( OpenCAGE.GUI.Displays.Quad_Tree_Components.Quad_Tree_Component Child, OpenCAGE.GUI.Displays.Quad_Tree_Components.Quadrant My_Quadrant);

attach a Quad_Tree_Component as Child

public OpenCAGE.GUI.Displays.Quad_Tree_Components.Quad_Tree_Component Get_Child( OpenCAGE.GUI.Displays.Quad_Tree_Components.Quadrant My_Quadrant);

returns the Quad_Tree_Component which is the child of the given Quad_Tree_Component of a particular quadrant

public Insert_Edge( OpenCAGE.GUI.Displays.Edge_Displays.Edge_Display Edge);

This method inserts a new object of Edge_Display into the Edge_List and a pointer into the Quad-Tree which points to the Edge_List. This allows a faster access.

public OpenCAGE.GUI.Displays.Object_Displays.Object_Lists.List Get_Objects( Graphics.Points.Point Up_Left, Graphics.Points.Point Low_Right);

finds all objects for the root quad-tree and returns them.

public Remove_Node( OpenCAGE.GUI.Displays.Node_Displays.Node_Display Node, Graphics.Points.Point Position);

removes a node of the Quad-Tree by locating the node at the specified position

public OpenCAGE.GUI.Displays.Quad_Tree_Components.Quad_Tree_Component Enhance( OpenCAGE.GUI.Displays.Quad_Tree_Components.Quadrant Quadrant_Of_Child);

enhances the Quadtree by adding a new Quad_Tree_Component as parent of the current Quad_Tree. This method only makes sence if the current Quad_Tree_Component is the root of a Quad_Tree. Returns the pointer to the new root of the Quad_Tree.

public OpenCAGE.GUI.Displays.Edge_Displays.Edge_Display Find_Edge( Graphics.Points.Point Clicked);

returns an Edge near the clicked Point

public Natural Depth(void);

retruns the depth of the Quad_Tree

public Remove_Edge( OpenCAGE.GUI.Displays.Edge_Displays.Edge_Display Edge, Graphics.Points.Point Start_Position, Graphics.Points.Point End_Position);

This method removes a object of Edge_Display from the Quad_Tree by locating the edge at the specified positions.

public Boolean Remove_Node_Everywhere( OpenCAGE.GUI.Displays.Node_Displays.Node_Display Node);

removes a node of the Quad-Tree by traversing all quadrants

public Boolean Remove_Edge_Everywhere( OpenCAGE.GUI.Displays.Edge_Displays.Edge_Display Edge);

This method removes a object of Edge_Display from the Quad_Tree by traversing all quadrants

Class Quadrant

This is an enumeration type which consists of the states upper_left, upper_right, lower_left, lower_right