The HOpNetwork class builds a network of nodes and connections. More...

#include <HOpNetwork.h>

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)
 
- Public Member Functions inherited from HBaseOperator
int Capture ()
 Returns whether we are currently in mouse capture mode. See this class' constructor for a more detailed description of what this means. This method has been deprecated.
 
virtual HBaseOperatorClone ()
 
HPoint const GetFirstPoint ()
 Returns the initial selection point.
 
virtual const char * GetName ()
 
HPoint const GetNewPoint ()
 Returns the current selection point.
 
HBaseViewGetView ()
 Returns a pointer to the view that this operator is associated with.
 
 HBaseOperator (HBaseView *view, int DoRepeat=0, int DoCapture=1)
 
virtual int OnKeyDown (HEventInfo &hevent)
 
virtual int OnKeyUp (HEventInfo &hevent)
 
virtual int OnLButtonDblClk (HEventInfo &hevent)
 
virtual int OnLRButtonDownAndMove (HEventInfo &hevent)
 
virtual int OnMButtonDblClk (HEventInfo &hevent)
 
virtual int OnMButtonDown (HEventInfo &hevent)
 
virtual int OnMButtonDownAndMove (HEventInfo &hevent)
 
virtual int OnMButtonUp (HEventInfo &hevent)
 
virtual int OnMouseMove (HEventInfo &hevent)
 
virtual int OnMouseWheel (HEventInfo &hevent)
 
virtual int OnNoButtonDownAndMove (HEventInfo &hevent)
 
virtual int OnRButtonDblClk (HEventInfo &hevent)
 
virtual int OnTimer (HEventInfo &hevent)
 
virtual int OnTouchesDown (HEventInfo &hevent)
 
virtual int OnTouchesMove (HEventInfo &hevent)
 
virtual int OnTouchesUp (HEventInfo &hevent)
 
virtual bool OperatorStarted ()
 Operator has been started if true, and has not been started if false.
 
int Repeat ()
 Returns whether the operation is repeatable. This method has been deprecated.
 
void SetFirstPoint (HPoint const &new_point)
 Sets the initial selection point.
 
void SetMapTouchesToMouseEvents (bool val)
 Touch Events are mapped to mouse events if true, and are not if false.
 
void SetNewPoint (HPoint const &new_point)
 Sets the current selection point.
 
void SetOperatorStarted (bool val)
 Operator has been started if true, and has not been started if false.
 
void SetView (HBaseView *new_view)
 Sets the view that this operator is associated with.
 

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 Member Functions inherited from HBaseOperator
bool IsSpecialKey (HC_KEY key)
 

Protected Attributes

HC_KEY m_NetworkKey
 
HC_KEY m_NodesKey
 
HC_KEY m_SelectedLineKey
 
HC_KEY m_SelectedNodeKey
 
- Protected Attributes inherited from HBaseOperator
bool m_bMapTouchesToMouseEvents
 Indicates if touch events are mapped to mouse events.
 
bool m_bOpStarted
 Indicates whether the operator has already 'started'. More...
 
int m_doCapture
 Integer indicating whether to capture mouse on button down and release on button up. This parameter has been deprecated.
 
int m_doRepeat
 Integer indicating if the operator is repeatable . This parameter has been deprecated.
 
HPoint m_ptFirst
 Initial selection point.
 
HPoint m_ptNew
 Current selection point.
 
HBaseViewm_pView
 The HOOPS view corresponding to this operator.
 
HCutGeometryVisibility m_TempCutGeometryVisibility
 stores original cut geometry visibility
 
HShadowMode m_TempShadowMode
 stores original shadow mode
 

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:

  1. Left Button Down: Place or select a node under the mouse.
  2. Left Button Down and Drag: Reposition the selected node under the mouse and update its connections.
  3. Left Button Up: Set the operator to a default inactive state.
  4. Right Button Down: Select one node and anchor a connection to it.
  5. Right Button Down and Drag: Reposition the other end of the connection.
  6. 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

◆ HOpNetwork()

HOpNetwork::HOpNetwork ( HBaseView view)

Constructs an HOpNetwork object.

Parameters
viewA pointer the HBaseView that this operator is associated with.

Member Function Documentation

◆ Get_Node_Key()

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.

◆ GetNextKey()

HC_KEY HOpNetwork::GetNextKey ( )
protected
Returns
The next available key for this network.

◆ My_Close_Node()

void HOpNetwork::My_Close_Node ( )
protected

This method closes a given node.

Parameters
keyThe key to the node to close.

◆ My_Delete_Line()

void HOpNetwork::My_Delete_Line ( HC_KEY  key)
protected

This method deletes the line and the associated measurement text given a key.

Parameters
keyThe key in which the line exists.

◆ My_Edit_Line()

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
keyThe key to the line.
x1The x coordinate for one end of the line.
y1The y coordinate for one end of the line.
z1The z coordinate for one end of the line.
x2The x coordinate for the other end of the line.
y2The y coordinate for the other end of the line.
z2The z coordinate for the other end of the line.

◆ My_Edit_Node()

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
keyThe key to the node.
xThe x coordinate of the new node position.
yThe y coordinate of the new node position.
zThe z coordinate of the new node position.

◆ My_KInsert_Line()

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
x1The x coordinate for one end of the line.
y1The y coordinate for one end of the line.
z1The z coordinate for one end of the line.
x2The x coordinate for the other end of the line.
y2The y coordinate for the other end of the line.
z2The z coordinate for the other end of the line.
Returns
The key associated with the inserted line.

◆ My_KInsert_Node()

HC_KEY HOpNetwork::My_KInsert_Node ( float  x,
float  y,
float  z 
)
protected

This method inserts a node at the given position.

Parameters
xThe x coordinate of the node position.
yThe y coordinate of the node position.
zThe z coordinate of the node position.
Returns
The key representing the node in the HOOPS database.

◆ My_Line_Common()

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
keyThe key to insert the text measurement.
x1The x coordinate for one end of the line.
y1The y coordinate for one end of the line.
z1The z coordinate for one end of the line.
x2The x coordinate for the other end of the line.
y2The y coordinate for the other end of the line.
z2The z coordinate for the other end of the line.

◆ My_Open_Node()

void HOpNetwork::My_Open_Node ( HC_KEY  key)
protected

This method opens a given node.

Parameters
keyThe key to the node to open.

◆ My_Renumber_Key()

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
keyThe key to renumber.
Returns
The newly renumbered key.

◆ OnLButtonDown()

virtual int HOpNetwork::OnLButtonDown ( HEventInfo hevent)
virtual

This method places and/or select a node. It also sets the operator as active.

Parameters
heventAn HEventInfo object containing information about the current event.
Returns
An HOperatorReturn indicating the status of the event.

Reimplemented from HBaseOperator.

◆ OnLButtonDownAndMove()

virtual int HOpNetwork::OnLButtonDownAndMove ( HEventInfo hevent)
virtual

This method moves the selected node and update its connections.

Parameters
heventAn HEventInfo object containing information about the current event.
Returns
An HOperatorReturn indicating the status of the event.

Reimplemented from HBaseOperator.

◆ OnLButtonUp()

virtual int HOpNetwork::OnLButtonUp ( HEventInfo hevent)
virtual

This method sets the operator as inactive.

Parameters
heventAn HEventInfo object containing information about the current event.
Returns
An HOperatorReturn indicating the status of the event.

Reimplemented from HBaseOperator.

◆ OnRButtonDown()

virtual int HOpNetwork::OnRButtonDown ( HEventInfo hevent)
virtual

If there's a node under the mouse, this method anchors a new connection to it.

Parameters
heventAn HEventInfo object containing information about the current event.
Returns
An HOperatorReturn indicating the status of the event.

Reimplemented from HBaseOperator.

◆ OnRButtonDownAndMove()

virtual int HOpNetwork::OnRButtonDownAndMove ( HEventInfo hevent)
virtual

This method repositions the loose end of the connection.

Parameters
heventAn HEventInfo object containing information about the current event
Returns
An HOperatorReturn indicating the status of the event.

Reimplemented from HBaseOperator.

◆ OnRButtonUp()

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
heventAn HEventInfo object containing information about the current event.
Returns
An HOperatorReturn indicating the status of the event.

Reimplemented from HBaseOperator.

◆ Show_Node_Position()

void HOpNetwork::Show_Node_Position ( HC_KEY  key,
float &  x,
float &  y,
float &  z 
)
protected

This method returns the position of the node.

Parameters
keyThe key to the node.
xReturns the x coordinate of the node position.
yReturns the y coordinate of the node position.
zReturns the z coordinate of the node position.

The documentation for this class was generated from the following file: