C++ main module for gpm Package
1.0
|
this class describes a Graph Draw Panel. More...
#include <GPMG_DrawPanel.h>
Public Member Functions | |
virtual void | toDoAfterThisSetting () |
method called after thi ssetting More... | |
void | setIsReadOnly (const tBoolean &isReadOnly) |
set is read only More... | |
void | setAreNodesShown (const tBoolean &v) |
set if the nodes are shown More... | |
void | setArePortsShown (const tBoolean &v) |
set if the ports are shown More... | |
void | setAreEdgesShown (const tBoolean &v) |
set if the edges are shown More... | |
virtual void | setIsMovingEnabled (const tBoolean &v) |
set zoom selection enabled More... | |
void | setSelectedVertex (SP::GPM_Vertex obj) |
set the selected vertex More... | |
void | setSelectedEdge (SP::GPM_Edge obj) |
set the selected edge More... | |
void | resetSelectedVertex () |
reset the selected vertex object More... | |
void | resetSelectedEdge () |
reset the selected edge object More... | |
void | setVertexSize (const int &v) |
set the vertex size More... | |
void | setEdgeWidth (const int &v) |
set the vertex width More... | |
void | setNodeVariableNameToShow (const tString &name) |
set node variable name to show More... | |
void | setPortVariableNameToShow (const tString &name) |
set port variable name to show More... | |
void | setEdgeVariableNameToShow (const tString &name) |
set edge variable name to show More... | |
void | setAreObjectsClickabled (const tBoolean &v) |
set if the object are clickabled More... | |
tString | getNodeStateNameToShow () const |
get the node state to show More... | |
tString | getPortStateNameToShow () const |
get the port state to show More... | |
tString | getEdgeStateNameToShow () const |
get the port state to show More... | |
virtual tFlag | getGraphType (const GPM_Graph *graph) const =0 |
return the graph type of the graph More... | |
SP::CORE_Object | getPopupObject () |
get the popup object More... | |
int | getToNodeEdgeMenuIndex () const |
get the index of the menu item More... | |
int | getToPortEdgeMenuIndex () const |
get the index of the menu item More... | |
int | getEdgeMenuIndex () const |
get the index of the menu item More... | |
int | getTau () const |
get Tau More... | |
int | getEdgeWidth () const |
get edge width More... | |
void | getProjection (tFlag &projX, tFlag &projY) const |
get project More... | |
CORE_Color & | getSelectedObjectColor () const |
get the selected object color More... | |
GPM_Vertex * | getSelectedVertex () const |
get the selected vertex object More... | |
GPM_Edge * | getSelectedEdge () const |
get the selected edge object More... | |
tBoolean | isReadOnly () const |
return true if the read only mode is on More... | |
tBoolean | areNodesShown () const |
get if the nodes are shown More... | |
tBoolean | arePortsShown () const |
get if the ports are shown More... | |
tBoolean | areEdgesShown () const |
get if the edges are shown More... | |
virtual void | createPopupMenus () |
create popup menus More... | |
virtual void | popupMenuClicked (const tString &name, const int &x, const int &y) |
method called when ab item of a popup menu is clicked on component More... | |
virtual GUI_AlonePopupMenu * | getPopupMenu (const int &x, const int &y, GUI2D_Item *item) |
get the popup menu More... | |
virtual void | loadFromUIClass (const UI_Class &mclass) |
how to load the object from a Meta Model class More... | |
virtual void | saveToUIClass (UI_Class &mclass) const |
how to save the object from a mate model class More... | |
Protected Member Functions | |
GPMG_DrawPanel () | |
build a GPMG_DrawPanel More... | |
virtual | ~GPMG_DrawPanel (void) |
destroy a GPMG_DrawPanel More... | |
virtual void | initAttributes () |
init attributes of the draw panel More... | |
virtual tBoolean | paintElements () |
paint the element in the drawing area More... | |
virtual void | computeBoundingBox (GUI2D_Box &box) const |
compute the bounding box of the object to see More... | |
virtual void | mouseHasChanged (SP::GUI_Mouse mouse) |
method called when the mouse changed More... | |
virtual void | computeVertexBounds (double &xMin, double &yMin, double &xMax, double &yMax) const =0 |
recompute the vertex bounds More... | |
void | computeNodesScale (GPM_PortGraph &graph, double &minValue, double &maxValue) |
compute the node scale More... | |
virtual void | computeNodesScale ()=0 |
compute the node scale More... | |
void | computePortsScale (GPM_PortGraph &graph, double &minValue, double &maxValue) |
compute the port scale More... | |
virtual void | computePortsScale ()=0 |
compute the port scale More... | |
void | computeEdgesScale (GPM_PortGraph &graph, double &minValue, double &maxValue) |
compute the edges scale More... | |
virtual void | computeEdgesScale ()=0 |
compute the edges scale More... | |
virtual void | objectIsClickedOn (SP::CORE_Object item) |
method called when the object is double clicked on More... | |
virtual void | objectIsMovedTo (SP::CORE_Object item, const tReal &x, const tReal &y) |
method called when the object is moved to More... | |
void | getCoordinates (const GPM_PortGraph &graph, GPM_Vertex &vertex, tReal &x, tReal &y) |
get the coordinates of the vertex from graph in (x,y) More... | |
void | drawVertex (GPM_Node &node, const CORE_Color &color, const tString &label, const tReal &Cx, const tReal &Cy, const tReal &w, const tReal &h) |
draw a node with color & label at (Cx,Cy) with size (w,h) More... | |
void | drawVertex (GPM_Port &port, const CORE_Color &color, const tString &label, const tReal &Cx, const tReal &Cy, const tReal &w, const tReal &h) |
draw a port with color & label at (Cx,Cy) with size (w,h) More... | |
void | drawEdge (GPM_Edge *edge, const CORE_Color &color, const tString &label, const tReal &Sx, const tReal &Sy, const tReal &Tx, const tReal &Ty, const tReal &width) |
draw an edge with color & label from (Sx,Sy)->(Tx,Ty) More... | |
virtual SP::GPM_Edge | addEdge (SP::GPM_Vertex source, SP::GPM_Vertex target) |
add an edge between source & target vertices into graph More... | |
virtual void | deleteEdge (GPM_Edge &edge) |
delete an edge More... | |
SP::GPM_Vertex | addPort (const tReal &x, const tReal &y, GPM_PortGraph &graph) |
add port in graph More... | |
SP::GPM_Vertex | addNode (const tReal &x, const tReal &y, GPM_PortGraph &graph) |
add port in graph More... | |
virtual void | deleteVertex (GPM_Vertex &vertex) |
delete a vertex More... | |
void | addEdgeToPort (SP::GPM_Vertex source, SP::GPM_Port target) |
draw an edge between source & target vertices from graph More... | |
void | addEdgeToNode (SP::GPM_Vertex source, SP::GPM_Node target) |
draw an edge between source & target vertices from graph More... | |
Static Protected Attributes | |
static const tFlag | X =0 |
static const tFlag | Y =1 |
static const tFlag | Z =2 |
static const tFlag | NODE_COLOR_SCALE =0 |
static const tFlag | PORT_COLOR_SCALE =1 |
static const tFlag | EDGE_COLOR_SCALE =2 |
this class describes a Graph Draw Panel.
It draws data
|
protected |
|
protectedvirtual |
destroy a GPMG_DrawPanel
|
protectedvirtual |
add an edge between source & target vertices into graph
Reimplemented in GPMG_RuleGraphDrawPanel.
References GPM_Graph::addEdgeFromIds(), GPMG_Project::EDGE_ENVIRONMENT, GPM_Graph::getEdge(), GPMG_Project::getEnvironment(), GPM_PortGraph::isEdgeValid(), null, tBoolean, and tString.
Referenced by GPMG_RuleGraphDrawPanel::addEdge(), addEdgeToNode(), addEdgeToPort(), and mouseHasChanged().
|
protected |
draw an edge between source & target vertices from graph
References GPM_Graph::addEdge(), addEdge(), GPM_PortGraph::addPort(), GPMG_Project::EDGE_ENVIRONMENT, GPM_Graph::getEdge(), GPMG_Project::getEnvironment(), GPM_Graph::getVertex(), GPM_Graph::getVertexIID(), null, GPM_Graph::NULL_VERTEX, and GPMG_Project::PORT_ENVIRONMENT.
Referenced by mouseHasChanged().
|
protected |
draw an edge between source & target vertices from graph
References addEdge().
Referenced by mouseHasChanged().
|
protected |
add port in graph
graph | : the graph to add the vertex |
References GPM_Graph::addNode(), GPMG_Project::getEnvironment(), GPM_Graph::getVertex(), GPMG_Project::NODE_ENVIRONMENT, GPM_Graph::NULL_VERTEX, tReal, and X.
Referenced by mouseHasChanged(), GPMG_ShowGraphDrawPanel::popupMenuClicked(), and GPMG_RuleGraphDrawPanel::popupMenuClicked().
|
protected |
add port in graph
graph | : the graph to add the vertex |
References GPM_PortGraph::addPort(), GPMG_Project::getEnvironment(), GPM_Graph::getVertex(), GPM_Graph::NULL_VERTEX, GPMG_Project::PORT_ENVIRONMENT, tReal, and X.
Referenced by mouseHasChanged(), GPMG_ShowGraphDrawPanel::popupMenuClicked(), and GPMG_RuleGraphDrawPanel::popupMenuClicked().
|
inline |
get if the edges are shown
|
inline |
get if the nodes are shown
|
inline |
get if the ports are shown
|
protectedvirtual |
compute the bounding box of the object to see
box | the bounding box of the object to see |
References computeVertexBounds().
|
protected |
compute the edges scale
References EDGE_COLOR_SCALE, GPM_Graph::getEdges(), GPM_GraphElement::getVariableValue(), null, and tString.
|
protectedpure virtual |
compute the edges scale
Implemented in GPMG_MovieGraphDrawPanel, GPMG_RuleGraphDrawPanel, and GPMG_ShowGraphDrawPanel.
Referenced by GPMG_ShowGraphDrawPanel::computeEdgesScale(), GPMG_RuleGraphDrawPanel::computeEdgesScale(), resetSelectedEdge(), and setEdgeVariableNameToShow().
|
protected |
compute the node scale
References GPM_GraphElement::getVariableValue(), GPM_Graph::getVertices(), NODE_COLOR_SCALE, and null.
|
protectedpure virtual |
compute the node scale
Implemented in GPMG_MovieGraphDrawPanel, GPMG_RuleGraphDrawPanel, and GPMG_ShowGraphDrawPanel.
Referenced by GPMG_ShowGraphDrawPanel::computeNodesScale(), GPMG_RuleGraphDrawPanel::computeNodesScale(), resetSelectedVertex(), and setNodeVariableNameToShow().
|
protected |
compute the port scale
References GPM_GraphElement::getVariableValue(), GPM_Graph::getVertices(), null, and PORT_COLOR_SCALE.
|
protectedpure virtual |
compute the port scale
Implemented in GPMG_MovieGraphDrawPanel, GPMG_RuleGraphDrawPanel, and GPMG_ShowGraphDrawPanel.
Referenced by GPMG_ShowGraphDrawPanel::computePortsScale(), GPMG_RuleGraphDrawPanel::computePortsScale(), resetSelectedVertex(), and setPortVariableNameToShow().
|
protectedpure virtual |
recompute the vertex bounds
Implemented in GPMG_MovieGraphDrawPanel, GPMG_RuleGraphDrawPanel, and GPMG_ShowGraphDrawPanel.
Referenced by computeBoundingBox().
|
virtual |
create popup menus
Reimplemented in GPMG_RuleGraphDrawPanel, and GPMG_ShowGraphDrawPanel.
Referenced by GPMG_ShowGraphDrawPanel::createPopupMenus(), GPMG_RuleGraphDrawPanel::createPopupMenus(), and toDoAfterThisSetting().
|
protectedvirtual |
delete an edge
Reimplemented in GPMG_RuleGraphDrawPanel.
References GPM_Graph::getEdgeIID(), GPM_GraphElement::getGraph(), GPM_GraphElement::getId(), null, and GPM_Graph::removeEdge().
Referenced by GPMG_RuleGraphDrawPanel::addEdge(), GPMG_RuleGraphDrawPanel::deleteEdge(), and popupMenuClicked().
|
protectedvirtual |
delete a vertex
Reimplemented in GPMG_RuleGraphDrawPanel.
References GPM_GraphElement::getGraph(), GPM_GraphElement::getId(), GPM_Graph::getVertexIID(), null, GPM_Graph::NULL_VERTEX, and GPM_Graph::removeVertex().
Referenced by GPMG_RuleGraphDrawPanel::deleteVertex(), and popupMenuClicked().
|
protected |
draw an edge with color & label from (Sx,Sy)->(Tx,Ty)
References tReal.
|
protected |
draw a node with color & label at (Cx,Cy) with size (w,h)
|
protected |
draw a port with color & label at (Cx,Cy) with size (w,h)
|
protected |
get the coordinates of the vertex from graph in (x,y)
References GPM_Port::areCoordinatesComputedByDefault(), GPM_PortGraph::getConnectedNodesToPort(), GPM_Vertex::getCoordinates(), GPM_GraphElement::getId(), GPM_Graph::getVertex(), GPM_Graph::getVertexIID(), null, GPM_Graph::NULL_VERTEX, GPM_Vertex::setCoordinates(), and tReal.
|
inline |
get the index of the menu item
|
inline |
get the port state to show
Referenced by GPMG_MovieGraphDrawPanel::computeEdgesScale().
|
inline |
get edge width
return the graph type of the graph
Implemented in GPMG_MovieGraphDrawPanel, GPMG_ShowGraphDrawPanel, and GPMG_RuleGraphDrawPanel.
Referenced by objectIsClickedOn(), and popupMenuClicked().
|
inline |
get the node state to show
Referenced by GPMG_MovieGraphDrawPanel::computeNodesScale().
|
virtual |
get the popup menu
Reimplemented in GPMG_RuleGraphDrawPanel, and GPMG_ShowGraphDrawPanel.
References GPM_Graph::getConnectedVertices(), GPM_GraphElement::getGraph(), GPM_GraphElement::getId(), GPM_Graph::getVertex(), GPM_Graph::getVertexIID(), and null.
Referenced by GPMG_ShowGraphDrawPanel::getPopupMenu(), and GPMG_RuleGraphDrawPanel::getPopupMenu().
|
inline |
get the popup object
Referenced by GPMG_RuleGraphDrawPanel::popupMenuClicked().
|
inline |
get the port state to show
Referenced by GPMG_MovieGraphDrawPanel::computePortsScale().
get project
Referenced by GPMG_ShowGraphDrawPanel::computeVertexBounds(), GPMG_RuleGraphDrawPanel::computeVertexBounds(), GPMG_MovieGraphDrawPanel::computeVertexBounds(), GPMG_ShowGraphDrawPanel::popupMenuClicked(), GPMG_ShowGraphDrawPanel::showGraph(), and GPMG_RuleGraphDrawPanel::showRule().
|
inline |
get the selected edge object
|
inline |
get the selected object color
|
inline |
get the selected vertex object
|
inline |
get Tau
|
inline |
get the index of the menu item
Referenced by GPMG_ShowGraphDrawPanel::getPopupMenu().
|
inline |
get the index of the menu item
Referenced by GPMG_ShowGraphDrawPanel::getPopupMenu().
|
protectedvirtual |
init attributes of the draw panel
Reimplemented in GPMG_MovieGraphDrawPanel, GPMG_RuleGraphDrawPanel, and GPMG_ShowGraphDrawPanel.
References EDGE_COLOR_SCALE, isReadOnly(), CORE_Color::New(), NODE_COLOR_SCALE, PORT_COLOR_SCALE, tBoolean, X, and Y.
Referenced by GPMG_ShowGraphDrawPanel::initAttributes(), GPMG_RuleGraphDrawPanel::initAttributes(), GPMG_MovieGraphDrawPanel::initAttributes(), and toDoAfterThisSetting().
|
inline |
return true if the read only mode is on
Referenced by initAttributes(), GPMG_RuleGraphDrawPanel::objectIsClickedOn(), objectIsClickedOn(), GPMG_RuleGraphDrawPanel::popupMenuClicked(), popupMenuClicked(), setIsMovingEnabled(), and setIsReadOnly().
|
virtual |
how to load the object from a Meta Model class
Reimplemented in GPMG_MovieGraphDrawPanel, GPMG_RuleGraphDrawPanel, and GPMG_ShowGraphDrawPanel.
References tString.
Referenced by GPMG_ShowGraphDrawPanel::loadFromUIClass(), GPMG_RuleGraphDrawPanel::loadFromUIClass(), GPMG_GraphPanel::loadFromUIClass(), and GPMG_MovieGraphDrawPanel::loadFromUIClass().
|
protectedvirtual |
method called when the mouse changed
References addEdge(), addEdgeToNode(), addEdgeToPort(), addNode(), addPort(), and null.
|
protectedvirtual |
method called when the object is double clicked on
Reimplemented in GPMG_RuleGraphDrawPanel.
References getGraphType(), isReadOnly(), null, GPMG_MainWindow::showEdge(), and GPMG_MainWindow::showVertex().
|
protectedvirtual |
method called when the object is moved to
References null, GPM_Vertex::setCoordinates(), and tReal.
|
protectedvirtual |
paint the element in the drawing area
Reimplemented in GPMG_MovieGraphDrawPanel, GPMG_RuleGraphDrawPanel, and GPMG_ShowGraphDrawPanel.
References null.
Referenced by GPMG_ShowGraphDrawPanel::paintElements(), GPMG_RuleGraphDrawPanel::paintElements(), and GPMG_MovieGraphDrawPanel::paintElements().
|
virtual |
method called when ab item of a popup menu is clicked on component
Reimplemented in GPMG_RuleGraphDrawPanel, and GPMG_ShowGraphDrawPanel.
References deleteEdge(), deleteVertex(), getGraphType(), isReadOnly(), null, GPMG_MainWindow::showEdge(), and GPMG_MainWindow::showVertex().
Referenced by GPMG_ShowGraphDrawPanel::popupMenuClicked(), and GPMG_RuleGraphDrawPanel::popupMenuClicked().
|
inline |
reset the selected edge object
References computeEdgesScale().
|
inline |
reset the selected vertex object
References computeNodesScale(), and computePortsScale().
|
virtual |
how to save the object from a mate model class
Reimplemented in GPMG_MovieGraphDrawPanel, GPMG_RuleGraphDrawPanel, and GPMG_ShowGraphDrawPanel.
Referenced by GPMG_ShowGraphDrawPanel::saveToUIClass(), GPMG_RuleGraphDrawPanel::saveToUIClass(), GPMG_GraphPanel::saveToUIClass(), and GPMG_MovieGraphDrawPanel::saveToUIClass().
|
inline |
set if the edges are shown
|
inline |
set if the nodes are shown
|
inline |
set if the object are clickabled
Referenced by GPMG_MovieGraphDrawPanel::initAttributes().
|
inline |
set if the ports are shown
|
inline |
set edge variable name to show
References computeEdgesScale().
|
inline |
set the vertex width
|
virtual |
set zoom selection enabled
References isReadOnly(), null, GPMG_GraphPanel::setIsReadOnly(), and setIsReadOnly().
void GPMG_DrawPanel::setIsReadOnly | ( | const tBoolean & | isReadOnly | ) |
set is read only
References isReadOnly(), null, GPMG_GraphWindowInterface::setIsMovingEnabled(), and tBoolean.
Referenced by setIsMovingEnabled().
|
inline |
set node variable name to show
References computeNodesScale().
|
inline |
set port variable name to show
References computePortsScale().
|
inline |
set the selected edge
|
inline |
set the selected vertex
|
inline |
set the vertex size
|
inlinevirtual |
method called after thi ssetting
Reimplemented in GPMG_MovieGraphDrawPanel, and GPMG_ShowGraphDrawPanel.
References createPopupMenus(), and initAttributes().
Referenced by GPMG_ShowGraphDrawPanel::toDoAfterThisSetting(), and GPMG_MovieGraphDrawPanel::toDoAfterThisSetting().
|
staticprotected |
Referenced by GPMG_MovieGraphDrawPanel::computeEdgesScale(), computeEdgesScale(), and initAttributes().
|
staticprotected |
Referenced by GPMG_MovieGraphDrawPanel::computeNodesScale(), computeNodesScale(), and initAttributes().
|
staticprotected |
Referenced by GPMG_MovieGraphDrawPanel::computePortsScale(), computePortsScale(), and initAttributes().
|
staticprotected |
|
staticprotected |
Referenced by initAttributes(), GPMG_ShowGraphDrawPanel::showGraph(), and GPMG_RuleGraphDrawPanel::showRule().
|
staticprotected |
Referenced by GPMG_ShowGraphDrawPanel::showGraph(), and GPMG_RuleGraphDrawPanel::showRule().