Package OpenCAGE.GUI.Displays.Graph_Window_Models

Class Graph_Window_Model

extends OpenCAGE.GUI.Displays.Window_Models.Window_Model

This class holds the data needed for the visualization of the graph window. These data consist of a tree of Node_Display and Edge_Display, size of the Graph Area, the position of the Graph Window, the attributes of the state flags in the Graph window, etc.

Attributes

private Boolean Filter_Status 

true, if a filter is used in this window false, if not

private Boolean Userview_Status 

true, if the window is the Current User View false, if it is not

private Boolean Read_Only_Status 

true, if the window is in the Read Only Mode false, if not

private OpenCAGE.GUI.Displays.Object_Display_Containers.Object_Display_Container Selected_Objects 

pointer list of pointers to the Node_Display_List or Edge_Display_List

private OpenCAGE.GUI.Displays.Graph_Window_Models.Node_Display_Lists.Double_List Node_List 

pointer to the Node_List which holds all Objects of the class Node_Display

private OpenCAGE.GUI.Displays.Background_Displays.Background_Display Background 

the Background object of the Graph-Area

private OpenCAGE.GUI.Displays.Graph_Window_Models.Edge_Display_Lists.List Edge_List 

In this List all Edge_Models are saved. In contrast to the Node_List, this Edge_List is not double linked!

private Graphics.Points.Point Upper_Left_Corner 

holds the point of the upper left corner of the area which is needed to display all objects

private Graphics.Points.Point Lower_Right_Corner 

holds the point of the lower right corner of the area which is needed to display all objects

private Graphics.Points.Point Furthest_Upper_Left 

the furthest upper left point of the reserved region of the nodes in the Quad-Tree including the size of the nodes

private Graphics.Points.Point Furthest_Lower_Right 

the furthest lower right point of the reserved region of the nodes in the Quad-Tree including the size of the nodes

private OpenCAGE.GUI.Displays.Root_Quad_Trees.Root_Quad_Tree My_Root_Quad_Tree 

pointer to the wrapper class Root_Quad_Tree of the class Quad_Tree_Component

private OpenCAGE.GIF.Node_Model_Observer Node_Model_Observer 

The Observer connected to the Graph_Display_Controller corresponding to this Graph_Window_Model.

private OpenCAGE.GUI.Displays.Object_Displays.Display_Observer Display_Observer 

The Observer connected to the Graph_Display_Controller corresponding to this Graph_Window_Model.

private OpenCAGE.GUI.Displays.Node_Tables.Node_Table Node_Table 

Hash table with key name of Node_Model and value Node_Display. For faster link between node_model and node_display

private OpenCAGE.GUI.Displays.Edge_Tables.Edge_Table Edge_Table 

Hash table with key name of Node_Model and value Node_Display. For faster link between node_model and node_display

private OpenCAGE.Layouts.Simple_Layouts.Simple_Layout Layout 

Layout of this Window

Operations

public Select_Object( OpenCAGE.GUI.Displays.Object_Displays.Object_Display Object);

Adds an object to the list of selected objects

public Unselect_Object( OpenCAGE.GUI.Displays.Object_Displays.Object_Display Object);

removes the given object from the list of selected objects

public OpenCAGE.GUI.Displays.Graph_Window_Models.Graph_Window_Model Create( Glib.Gint Width, Glib.Gint Height, Natural Depth);

creates the Quad-Tree with a particular central point, a particular width and length and a particular depth

public Traverse(void);

this is a method which is only for debugging use

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

inserts a new Node_Display into the quad_tree and the node_display_list

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

Finds Objects within the visible area (given by the two Points). Then the Visibility Attribute of the Objects is set to true

public OpenCAGE.GUI.Displays.Object_Displays.Object_Display Find_Object( Graphics.Points.Point Clicked);

Returns the Object which is at the Point that was clicked

public Remove_Node( OpenCAGE.GUI.Displays.Node_Displays.Node_Display Old_Node);

removes a node in the Node_List and the Quad-Tree

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

inserts a new Edge_Display into the quad_tree and the node_display_list

public Update_Used_Area(void);

updates the attributes Upper_Left_Corner and Lower_Right_Corner with the values of the area which is needed to display the Node_Displays

public Move_Objects( OpenCAGE.GUI.Displays.Object_Display_Containers.Object_Display_Container Obj, Graphics.Area_Sizes.Area_Size Distance);

corrects the position of the objects by the value of the distance

public Unselect_All_Objects(void);

removes all object from the Container with the selected objects

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

Selects all Objects in the given area (given by the two Points).

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

Unselects all Objects in the given area (given by the two Points).

public Select_All(void);

select all objects in the Graph-Window

public Select_Inv(void);

selects all objects which are not selected and deselects all objects which are selected

public Update_Reserved_Region(void);

updates the reserved region which is covered by the nodes in the Quad-Tree including its size

public FET.Parameter_Pot Get_Pot(void);

This returns a parameter pot containing the data of this model. If objects are selected, their models are put into the pot. If no object is selected, the node model of the background object is put into the pot.

public OpenCAGE.GUI.Displays.Object_Display_Containers.Object_Display_Container Get_Node_Container(void);

Returns a container that holds all nodes. This container is static, it won't be updated when the nodes are changed. It MUST be destroyed after use.

public Remove_Edge( OpenCAGE.GUI.Displays.Edge_Displays.Edge_Display Old_Edge);

removes a Edge_Display from the quad_tree and the node_display_list

public OpenCAGE.GUI.Displays.Node_Displays.Node_Display Get_Node( OpenCAGE.GIF.Node_Model Model);

Returns the Node_Display corresponding to the given Node_Model. Returns null if no appropriate Node_Display exists.

public OpenCAGE.GUI.Displays.Edge_Displays.Edge_Display Get_Edge( OpenCAGE.GIF.Edge_Model Model);

Returns the Edge_Display corresponding to the given Edge_Model. Returns null if no appropriate Edge_Display exists.

public Update_Status(void);

Gets the new values for Filter_Status, Userview_Status, Read_Only_Status from the GIF.