HOpNetwork Class Reference
The
HOpNetwork class builds a network of nodes and connections.
More...
#include <HOpNetwork.h>
List of all members.
|
Public Member Functions |
| HOpNetwork (HBaseView *view) |
virtual int | OnLButtonDown (HEventInfo &hevent) |
virtual int | OnLButtonDownAndMove (HEventInfo &hevent) |
virtual int | OnLButtonUp (HEventInfo &hevent) |
virtual int | OnRButtonDown (HEventInfo &hevent) |
virtual int | OnRButtonDownAndMove (HEventInfo &hevent) |
virtual int | OnRButtonUp (HEventInfo &hevent) |
Protected Member Functions |
HC_KEY | Get_Node_Key (HC_KEY key) |
HC_KEY | GetNextKey () |
void | My_Close_Node () |
void | My_Delete_Line (HC_KEY key) |
void | My_Edit_Line (HC_KEY key, float x1, float y1, float z1, float x2, float y2, float z2) |
void | My_Edit_Node (HC_KEY key, float x, float y, float z) |
HC_KEY | My_KInsert_Line (float x1, float y1, float z1, float x2, float y2, float z2) |
HC_KEY | My_KInsert_Node (float x, float y, float z) |
void | My_Line_Common (HC_KEY key, float x1, float y1, float z1, float x2, float y2, float z2) |
void | My_Open_Node (HC_KEY key) |
HC_KEY | My_Renumber_Key (HC_KEY key) |
void | Show_Node_Position (HC_KEY key, float &x, float &y, float &z) |
Protected Attributes |
HC_KEY | m_NetworkKey |
HC_KEY | m_NodesKey |
HC_KEY | m_SelectedLineKey |
HC_KEY | m_SelectedNodeKey |
Detailed Description
The
HOpNetwork class builds a network of nodes and connections.
The HOpNetwork class implements the following actions to build a network of nodes and connections:
-
Left Button Down: Place or select a node under the mouse.
-
Left Button Down and Drag: Reposition the selected node under the mouse and update its connections.
-
Left Button Up: Set the operator to a default inactive state.
-
Right Button Down: Select one node and anchor a connection to it.
-
Right Button Down and Drag: Reposition the other end of the connection.
-
Right Button Up: If there's a node under the connection, anchor the loose end of the connection to it. Otherwise, delete the connection.
Constructor & Destructor Documentation
Constructs an HOpNetwork object.
- Parameters:
-
| view | A pointer the HBaseView that this operator is associated with. |
Member Function Documentation
HC_KEY HOpNetwork::Get_Node_Key |
( |
HC_KEY |
key |
) |
[protected] |
- Returns:
- The node (segment) key or -1 if the key doesn't belong to a node.
HC_KEY HOpNetwork::GetNextKey |
( |
|
) |
[protected] |
- Returns:
- The next available key for this network.
void HOpNetwork::My_Close_Node |
( |
|
) |
[protected] |
This method closes a given node.
- Parameters:
-
| key | The key to the node to close. |
void HOpNetwork::My_Delete_Line |
( |
HC_KEY |
key |
) |
[protected] |
This method deletes the line and the associated measurement text given a key.
- Parameters:
-
| key | The key in which the line exists. |
void HOpNetwork::My_Edit_Line |
( |
HC_KEY |
key, |
|
|
float |
x1, |
|
|
float |
y1, |
|
|
float |
z1, |
|
|
float |
x2, |
|
|
float |
y2, |
|
|
float |
z2 | |
|
) |
| | [protected] |
This method edits the line position and measurement text.
- Parameters:
-
| key | The key to the line. |
| x1 | The x coordinate for one end of the line. |
| y1 | The y coordinate for one end of the line. |
| z1 | The z coordinate for one end of the line. |
| x2 | The x coordinate for the other end of the line. |
| y2 | The y coordinate for the other end of the line. |
| z2 | The z coordinate for the other end of the line. |
void HOpNetwork::My_Edit_Node |
( |
HC_KEY |
key, |
|
|
float |
x, |
|
|
float |
y, |
|
|
float |
z | |
|
) |
| | [protected] |
This method move the given node to a new position.
- Parameters:
-
| key | The key to the node. |
| x | The x coordinate of the new node position. |
| y | The y coordinate of the new node position. |
| z | The z coordinate of the new node position. |
HC_KEY HOpNetwork::My_KInsert_Line |
( |
float |
x1, |
|
|
float |
y1, |
|
|
float |
z1, |
|
|
float |
x2, |
|
|
float |
y2, |
|
|
float |
z2 | |
|
) |
| | [protected] |
The method inserts a line and the text measurement of the line in the middle.
- Parameters:
-
| x1 | The x coordinate for one end of the line. |
| y1 | The y coordinate for one end of the line. |
| z1 | The z coordinate for one end of the line. |
| x2 | The x coordinate for the other end of the line. |
| y2 | The y coordinate for the other end of the line. |
| z2 | The z coordinate for the other end of the line. |
- Returns:
- The key associated with the inserted line.
HC_KEY HOpNetwork::My_KInsert_Node |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z | |
|
) |
| | [protected] |
This method inserts a node at the given position.
- Parameters:
-
| x | The x coordinate of the node position. |
| y | The y coordinate of the node position. |
| z | The z coordinate of the node position. |
- Returns:
- The key representing the node in the HOOPS database.
void HOpNetwork::My_Line_Common |
( |
HC_KEY |
key, |
|
|
float |
x1, |
|
|
float |
y1, |
|
|
float |
z1, |
|
|
float |
x2, |
|
|
float |
y2, |
|
|
float |
z2 | |
|
) |
| | [protected] |
This is a helper function for the custom line functions. It calculates the length of the line and inserts the text into the middle.
- Parameters:
-
| key | The key to insert the text measurement. |
| x1 | The x coordinate for one end of the line. |
| y1 | The y coordinate for one end of the line. |
| z1 | The z coordinate for one end of the line. |
| x2 | The x coordinate for the other end of the line. |
| y2 | The y coordinate for the other end of the line. |
| z2 | The z coordinate for the other end of the line. |
void HOpNetwork::My_Open_Node |
( |
HC_KEY |
key |
) |
[protected] |
This method opens a given node.
- Parameters:
-
| key | The key to the node to open. |
HC_KEY HOpNetwork::My_Renumber_Key |
( |
HC_KEY |
key |
) |
[protected] |
This method renumbers the given key locally to help in round tripping the data.
- Parameters:
-
- Returns:
- The newly renumbered key.
virtual int HOpNetwork::OnLButtonDown |
( |
HEventInfo & |
hevent |
) |
[virtual] |
This method places and/or select a node. It also sets the operator as active.
- Parameters:
-
| hevent | An HEventInfo object containing information about the current event. |
- Returns:
- An HOperatorReturn indicating the status of the event.
Reimplemented from HBaseOperator.
virtual int HOpNetwork::OnLButtonDownAndMove |
( |
HEventInfo & |
hevent |
) |
[virtual] |
This method moves the selected node and update its connections.
- Parameters:
-
| hevent | An HEventInfo object containing information about the current event. |
- Returns:
- An HOperatorReturn indicating the status of the event.
Reimplemented from HBaseOperator.
virtual int HOpNetwork::OnLButtonUp |
( |
HEventInfo & |
hevent |
) |
[virtual] |
This method sets the operator as inactive.
- Parameters:
-
| hevent | An HEventInfo object containing information about the current event. |
- Returns:
- An HOperatorReturn indicating the status of the event.
Reimplemented from HBaseOperator.
virtual int HOpNetwork::OnRButtonDown |
( |
HEventInfo & |
hevent |
) |
[virtual] |
If there's a node under the mouse, this method anchors a new connection to it.
- Parameters:
-
| hevent | An HEventInfo object containing information about the current event. |
- Returns:
- An HOperatorReturn indicating the status of the event.
Reimplemented from HBaseOperator.
virtual int HOpNetwork::OnRButtonDownAndMove |
( |
HEventInfo & |
hevent |
) |
[virtual] |
This method repositions the loose end of the connection.
- Parameters:
-
| hevent | An HEventInfo object containing information about the current event |
- Returns:
- An HOperatorReturn indicating the status of the event.
Reimplemented from HBaseOperator.
virtual int HOpNetwork::OnRButtonUp |
( |
HEventInfo & |
hevent |
) |
[virtual] |
If there's a node under the mouse, this method anchors the loose connection to it. If not, then it deletes the connection.
- Parameters:
-
| hevent | An HEventInfo object containing information about the current event. |
- Returns:
- An HOperatorReturn indicating the status of the event.
Reimplemented from HBaseOperator.
void HOpNetwork::Show_Node_Position |
( |
HC_KEY |
key, |
|
|
float & |
x, |
|
|
float & |
y, |
|
|
float & |
z | |
|
) |
| | [protected] |
This method returns the position of the node.
- Parameters:
-
| key | The key to the node. |
| x | Returns the x coordinate of the node position. |
| y | Returns the y coordinate of the node position. |
| z | Returns the z coordinate of the node position. |
The documentation for this class was generated from the following file: