C++ main module for gpm Package
1.0
|
This class describes an element of a graph. More...
#include <GPM_GraphElement.h>
Public Member Functions | |
virtual SP::GPM_GraphElement | NewInstance () const =0 |
create a new instance More... | |
void | setGraph (SP::GPM_Graph graph) |
set the attached graph More... | |
void | setGraph (GPM_Graph &graph) |
set the attached graph More... | |
void | setGraph (GPM_Graph *graph) |
set the attached graph More... | |
GPM_Graph * | getGraph () const |
set the attached graph More... | |
virtual void | copy (const GPM_GraphElement &node) |
copy More... | |
void | setEnvironment (const map< tString, SP::GPM_Variable > &env) |
set the environment More... | |
virtual void | updateEnvironment (const map< tString, SP::GPM_Variable > &env) |
update environment More... | |
SV::GPM_Variable | addToVariables (const tString &variableName, SP::GPM_Variable var) |
add a value of variable in the variable with multiple cardinality whose name is variableName More... | |
GPM_Variable & | initVariable (const tString &variableName) |
init the variable corresponding to name: create a variable with 1 value More... | |
void | setVariable (const tString &variableName, const GPM_Variable &var) |
set a value of variable in the variable with single cardinality whose name is variableName More... | |
void | setVariable (const tString &variableName, SP::GPM_Variable var) |
set a value of variable in the variable with single cardinality whose name is variableName More... | |
void | setVariableValue (const tString &variableName, const tString &value) |
set the string value of a variable with single cardinality whose name is variableName More... | |
void | setVariableValue (const tString &variableName, const double &value) |
set the double value of a variable with single cardinality whose name is variableName More... | |
void | setVariableValue (const tString &variableName, const int &n, const double *value) |
set the double list value of a variable with single cardinality whose name is variableName More... | |
void | setVariableValue (const tString &variableName, const tFlag &type, const int &n, const double *value) |
set the double list value of a variable with single cardinality whose name is variableName & set the type More... | |
tBoolean | setVariableValuesFromString (const tString &variableName, const tFlag &type, const tString &values) |
set multiple values of variable from a string representation & set the variable type More... | |
void | removeVariable (const tString &varName) |
remove the variable More... | |
void | getVariableNames (vector< tString > &names) const |
get the variable names More... | |
tBoolean | getVariables (const tString &variableName, SV::GPM_Variable &variable) const |
get variables More... | |
tString | getVariableValuesToString (const tString &variableName) const |
get variables into a string representation More... | |
SP::GPM_Variable | getVariable (const tString &variableName) const |
get variable More... | |
tBoolean | getVariableValue (const tString &variableName, tString &value) const |
get the variable value More... | |
tBoolean | getVariableValue (const tString &variableName, double &value) const |
set the variable More... | |
tBoolean | getVariableValue (const tString &variableName, int &n, double *value) const |
set the variable More... | |
tFlag | getVariableType (const tString &variableName) const |
get the variable type More... | |
virtual void | clearVariables () |
clear the variables More... | |
virtual tString | getGroupTypeName () const =0 |
get the default group type name More... | |
void | setGroupName (const tString &v) |
set group name More... | |
tString | getGroupName () const |
set group name More... | |
virtual tBoolean | setTopologicalAction (const tFlag &action) |
set topological action More... | |
tFlag | getTopologicalAction () const |
get toppologial action More... | |
tBoolean | hasTriggerCutAction () const |
return true if the element has a trigger cut action More... | |
virtual tBoolean | setTriggerGroupNameAction (const tFlag &action, const tString &value) |
set group name action More... | |
virtual tBoolean | setTriggerAction (const tFlag &action, const tString &varName, SP::GPM_Variable var) |
set variable action More... | |
virtual tBoolean | setTriggerAction (const tFlag &action, const tString &varName, const tString &value) |
set variable action More... | |
virtual tBoolean | setTriggerAction (const tFlag &action, const tString &varName, const double &value) |
set variable action More... | |
virtual tBoolean | setTriggerAction (const tFlag &action, const tString &varName, const int &n, const double *value) |
set variable action More... | |
virtual tBoolean | setTriggerAction (const tFlag &action, const tString &varName, const tFlag &type, const int &n, const double *value) |
set variable action More... | |
tBoolean | getTriggerActionValues (const tString &variableName, SV::GPM_Variable &variable) const |
get action variables More... | |
tFlag | getTriggerAction (const tString &varName) const |
get the variable action More... | |
virtual void | clearActions () |
clear actions More... | |
virtual void | executeTriggerActions () |
execute trigger actions More... | |
void | setId (const int &id) |
set graph More... | |
int | getId () const |
get id More... | |
tBoolean | parseValues (tString &f, vector< tString > &values) const |
parse the value sof the form {variableValue1;variableValue2;...} return false if the f string is not encapsulated by {} More... | |
virtual void | saveToStream (ofstream &f) const |
virtual tBoolean | loadFromStream (tString &f) |
virtual tString | toString () const |
turn the class to string More... | |
void | getSharedPointer (SP::CORE_Object &p) |
get the shared pointer of this class into p More... | |
void | getSharedPointer (SPC::CORE_Object &p) const |
get the shared pointer of this class into p More... | |
tString | getClassName () const |
return the class name of the object More... | |
tString | getIdentityString () const |
return the identity string of the object of the form className_at_address More... | |
tString | getPointerAddress () const |
return the identity string of the object More... | |
template<class T > | |
tBoolean | isInstanceOf () const |
return true if the object is an instance of T More... | |
virtual void | print () |
print the class More... | |
virtual ostream & | print (ostream &out) const |
print the class More... | |
virtual void | print (const tString &message) |
print the class More... | |
virtual void | print (const tInteger &str) |
print More... | |
virtual void | print (const tRelativeInteger &str) |
print More... | |
virtual void | print (const tReal &str) |
print More... | |
virtual void | print (const int &str) |
print More... | |
Static Public Member Functions | |
static void | turnBodyTextToLine (tString &bdy) |
static void | turnBodyLineToText (tString &bdy) |
static tString | getClassName (const tString &identityString) |
return the class name of the object using only the identity string More... | |
template<class T > | |
static tString | getTypeName () |
get type name More... | |
static tBoolean | is64Architecture () |
return true if the machine is a 64 bits machine More... | |
static tBoolean | is32Architecture () |
return true if the machine is a 32 bits machine More... | |
static tString | pointer2String (const void *obj) |
return the string represantation of a pointer More... | |
static void | setOutput (ostream &out) |
set output More... | |
static ostream & | getOutput () |
get output More... | |
static void | printObjectsInMemory () |
print object in memory More... | |
static ostream & | print (ostream &out, const tString &message) |
print the class More... | |
static void | outputPrint (const tString &message) |
Static Public Attributes | |
static tBoolean | mIsMemoryTesting =false |
indicator to store all classes created and deleted only for debuging version More... | |
Protected Member Functions | |
GPM_GraphElement (void) | |
create an object More... | |
virtual | ~GPM_GraphElement (void) |
destroy an object. More... | |
virtual void | toDoAfterThisSetting () |
method called after This setting More... | |
void | setThis (SP::CORE_Object p) |
set this weak shared pointer called toDoAfterThis setting method More... | |
virtual void | setType (tString type) |
set the type of the object More... | |
This class describes an element of a graph.
|
protected |
|
protectedvirtual |
destroy an object.
SV::GPM_Variable GPM_GraphElement::addToVariables | ( | const tString & | variableName, |
SP::GPM_Variable | var | ||
) |
add a value of variable in the variable with multiple cardinality whose name is variableName
Referenced by copy(), loadFromStream(), and setVariableValuesFromString().
|
virtual |
clear actions
Reimplemented in GPM_Vertex.
Referenced by GPM_Vertex::clearActions(), and loadFromStream().
|
inlinevirtual |
clear the variables
Reimplemented in GPM_Node.
Referenced by GPM_Node::clearVariables(), copy(), loadFromStream(), and setEnvironment().
|
virtual |
copy
Reimplemented in GPM_Node, GPM_Port, GPM_ModelEdge, GPM_ModelPort, GPM_ModelNode, and GPM_Vertex.
References addToVariables(), clearVariables(), getGraph(), getGroupName(), getId(), CORE_Object::getSharedPointer(), getVariableNames(), getVariables(), initVariable(), GPM_Variable::New(), null, setGraph(), setGroupName(), and setVariable().
Referenced by GPM_Graph::addSubGraph(), GPM_Vertex::copy(), GPM_ModelEdge::copy(), and GPM_Graph::copy().
|
virtual |
execute trigger actions
Reimplemented in GPM_Vertex.
References setGroupName(), tFlag, and tString.
Referenced by GPM_Vertex::executeTriggerActions().
return the class name of the object using only the identity string
Referenced by CORE_Object::printObjectsInMemory().
|
inherited |
return the class name of the object
References tString.
Referenced by CORE_Object::getIdentityString().
GPM_Graph * GPM_GraphElement::getGraph | ( | ) | const |
set the attached graph
Referenced by copy(), GPMG_RuleGraphDrawPanel::deleteEdge(), GPMG_DrawPanel::deleteEdge(), GPMG_RuleGraphDrawPanel::deleteVertex(), GPMG_DrawPanel::deleteVertex(), GPMG_RuleGraphDrawPanel::getPopupMenu(), and GPMG_DrawPanel::getPopupMenu().
|
inline |
|
pure virtual |
get the default group type name
Implemented in GPM_Node, GPM_Edge, and GPM_Port.
Referenced by GPM_Vertex::canMerge(), and toString().
|
inline |
get id
Referenced by GPM_Rule::buildEnvironment(), copy(), GPMG_DrawPanel::deleteEdge(), GPMG_RuleGraphDrawPanel::deleteVertex(), GPMG_DrawPanel::deleteVertex(), GPMG_DrawPanel::getCoordinates(), GPMG_ShowGraphDrawPanel::getPopupMenu(), GPMG_RuleGraphDrawPanel::getPopupMenu(), GPMG_DrawPanel::getPopupMenu(), GPM_PortGraph::isEdgeValid(), GPM_ModelFunction::saveRulesToFile(), GPM_ModelFunction::toString(), GPM_ModelFunction::updatePatternGraphStates(), GPM_ModelFunction::updateTransformerGraphStates(), and GPMG_VertexWindow::updateTriggerVariables().
|
inlineinherited |
return the identity string of the object of the form className_at_address
References CORE_Object::getClassName(), CORE_Object::pointer2String(), and tString.
Referenced by CORE_Object::toString().
|
inlinestaticinherited |
get output
|
inlineinherited |
return the identity string of the object
References CORE_Object::pointer2String().
|
inlineinherited |
get the shared pointer of this class into p
Referenced by MATH_ParentExpression::addArgument(), GPMG_EnvironmentPanel::componentClicked(), copy(), CORE_Map< Key, Value >::getSharedPointer(), CORE_Array< T >::getSharedPointer(), CORE_Vector< T >::getSharedPointer(), CORE_Matrix< T >::getSharedPointer(), CORE_Object::printObjectsInMemory(), MATH_ParentExpression::setArgument(), GPMG_EnvironmentPanel::setEnvironment(), setGraph(), GPMG_GraphElementWindow::setGraphElement(), GPMG_ShowGraphDrawPanel::showGraph(), and GPMG_RuleGraphDrawPanel::showRule().
|
inlineinherited |
get the shared pointer of this class into p
|
inline |
get toppologial action
get the variable action
Referenced by setTriggerAction().
|
inlinestaticinherited |
get type name
References tString.
SP::GPM_Variable GPM_GraphElement::getVariable | ( | const tString & | variableName | ) | const |
get variable
Referenced by GPM_Rule::buildEnvironment(), GPM_PortGraph::buildEnvironments(), getVariableType(), getVariableValue(), and GPM_PortGraph::initGroupNames().
|
inline |
get the variable names
Referenced by GPM_Rule::buildEnvironment(), GPM_PortGraph::buildEnvironments(), GPM_Vertex::canMerge(), copy(), and toString().
|
inline |
get variables
Referenced by GPM_Vertex::canMerge(), copy(), and getVariableValuesToString().
get the variable type
References GPM_Variable::getType(), getVariable(), null, and GPM_Variable::REAL.
Referenced by GPM_ModelFunction::updatePatternGraphStates(), and GPM_ModelFunction::updateTransformerGraphStates().
get the variable value
References getVariable(), null, and GPM_Variable::STRING.
Referenced by GPMG_DrawPanel::computeEdgesScale(), GPMG_DrawPanel::computeNodesScale(), and GPMG_DrawPanel::computePortsScale().
set the variable
References getVariable(), null, and GPM_Variable::STRING.
tBoolean GPM_GraphElement::getVariableValue | ( | const tString & | variableName, |
int & | n, | ||
double * | value | ||
) | const |
set the variable
References getVariable(), null, and GPM_Variable::STRING.
get variables into a string representation
References getVariables(), and tString.
Referenced by toString().
|
inline |
return true if the element has a trigger cut action
GPM_Variable & GPM_GraphElement::initVariable | ( | const tString & | variableName | ) |
init the variable corresponding to name: create a variable with 1 value
References GPM_Variable::New(), and setVariable().
Referenced by copy(), setVariable(), and setVariableValue().
|
inlinestaticinherited |
return true if the machine is a 32 bits machine
References CORE_Object::is64Architecture().
|
staticinherited |
return true if the machine is a 64 bits machine
Referenced by CORE_Object::is32Architecture().
|
inlineinherited |
return true if the object is an instance of T
References null.
Referenced by MATH_BinaryOperator::insertInTree(), MATH_UnaryOperator::insertInTree(), and MATH_EndBlock::insertInTree().
brief save the port into stream
Reimplemented in GPM_Vertex, GPM_Edge, and GPM_Port.
References addToVariables(), clearActions(), clearVariables(), GPM_Variable::New(), parseValues(), setGroupName(), setVariable(), tBoolean, and tString.
Referenced by GPM_Edge::loadFromStream(), and GPM_Vertex::loadFromStream().
|
pure virtual |
create a new instance
Implemented in GPM_Edge, GPM_ModelEdge, GPM_Port, GPM_Node, GPM_ModelPort, and GPM_ModelNode.
Referenced by GPM_Graph::copy().
|
staticinherited |
print on output
References null, and CORE_Object::print().
Referenced by CORE_Exception::CORE_Exception().
parse the value sof the form {variableValue1;variableValue2;...} return false if the f string is not encapsulated by {}
References tString.
Referenced by GPM_Port::loadFromStream(), loadFromStream(), and setVariableValuesFromString().
|
staticinherited |
return the string represantation of a pointer
References tString.
Referenced by CORE_Object::CORE_Object(), CORE_Object::getIdentityString(), CORE_Object::getPointerAddress(), and CORE_Object::~CORE_Object().
|
inlinevirtualinherited |
print the class
References CORE_Object::toString().
Referenced by CORE_Object::outputPrint(), CORE_Out::print(), CORE_Object::print(), CORE_Out::printInt(), CORE_Out::println(), CORE_Out::printReal(), CORE_Out::printString(), and CORE_Out::setAction().
|
inlinevirtualinherited |
print the class
References CORE_Object::print(), and CORE_Object::toString().
|
virtualinherited |
print the class
Reimplemented in CORE_Out.
References null, and CORE_Object::print().
|
virtualinherited |
References null.
|
virtualinherited |
References null.
|
inlinestaticinherited |
print the class
|
staticinherited |
print object in memory
References CORE_Object::getClassName(), CORE_Object::getSharedPointer(), and CORE_Object::mIsMemoryTesting.
Referenced by main().
|
inline |
remove the variable
|
virtual |
brief save the port into stream
OUT | f: file to write on |
Reimplemented in GPM_Vertex, and GPM_Edge.
References toString().
void GPM_GraphElement::setEnvironment | ( | const map< tString, SP::GPM_Variable > & | env | ) |
set the environment
References clearVariables(), GPM_Variable::New(), and null.
|
inline |
set the attached graph
Referenced by GPMG_ShowGraphDrawPanel::computeVertexBounds(), GPMG_RuleGraphDrawPanel::computeVertexBounds(), copy(), GPM_PortGraph::generateQuadGraph(), setGraph(), GPMG_ShowGraphDrawPanel::showGraph(), and GPMG_RuleGraphDrawPanel::showRule().
void GPM_GraphElement::setGraph | ( | GPM_Graph & | graph | ) |
set the attached graph
References CORE_Object::getSharedPointer(), and setGraph().
void GPM_GraphElement::setGraph | ( | GPM_Graph * | graph | ) |
set the attached graph
References CORE_Object::getSharedPointer(), null, and setGraph().
|
inline |
set group name
Referenced by copy(), executeTriggerActions(), GPM_PortGraph::initGroupNames(), and loadFromStream().
|
inline |
set graph
get graph
set id
|
inlinestaticinherited |
set output
|
inlineprotectedinherited |
set this weak shared pointer called toDoAfterThis setting method
References CORE_Object::toDoAfterThisSetting().
set topological action
References tBoolean.
|
virtual |
set variable action
References getTriggerAction(), getTriggerActionValues(), tBoolean, and tFlag.
Referenced by setTriggerAction(), GPM_Snow3DFunction::updatePatternGraphStates(), and GPM_ModelFunction::updatePatternGraphStates().
|
virtual |
set variable action
References GPM_Variable::New(), and setTriggerAction().
|
virtual |
set variable action
References GPM_Variable::New(), and setTriggerAction().
|
virtual |
set variable action
References GPM_Variable::New(), and setTriggerAction().
|
virtual |
set variable action
References GPM_Variable::New(), and setTriggerAction().
|
virtual |
set group name action
References tBoolean.
|
inlineprotectedvirtualinherited |
set the type of the object
Referenced by CORE_CommandLine::CORE_CommandLine(), CORE_IO::CORE_IO(), GPM_2DSnowGraph::GPM_2DSnowGraph(), GPM_BGLTest::GPM_BGLTest(), GPM_ClassFactory::GPM_ClassFactory(), GPM_ConwayFunction::GPM_ConwayFunction(), GPM_ConwayGraph::GPM_ConwayGraph(), GPM_CoreRun::GPM_CoreRun(), GPM_CoreTest::GPM_CoreTest(), GPM_Edge::GPM_Edge(), GPM_ExamplesRun::GPM_ExamplesRun(), GPM_Function::GPM_Function(), GPM_Graph::GPM_Graph(), GPM_GraphElement(), GPM_ModelGraph::GPM_ModelGraph(), GPM_Node::GPM_Node(), GPM_Object::GPM_Object(), GPM_PatternFunction::GPM_PatternFunction(), GPM_Port::GPM_Port(), GPM_PortGraph::GPM_PortGraph(), GPM_Snow2DFunction::GPM_Snow2DFunction(), GPM_Snow3DFunction::GPM_Snow3DFunction(), GPM_Vertex::GPM_Vertex(), and MATH_ExpressionRun::MATH_ExpressionRun().
void GPM_GraphElement::setVariable | ( | const tString & | variableName, |
const GPM_Variable & | var | ||
) |
set a value of variable in the variable with single cardinality whose name is variableName
References GPM_Variable::copy(), and initVariable().
Referenced by copy(), initVariable(), loadFromStream(), and setVariableValuesFromString().
void GPM_GraphElement::setVariable | ( | const tString & | variableName, |
SP::GPM_Variable | var | ||
) |
set a value of variable in the variable with single cardinality whose name is variableName
set the string value of a variable with single cardinality whose name is variableName
References initVariable(), and GPM_Variable::setValue().
Referenced by GPM_ModelFunction::updateTransformerGraphStates().
void GPM_GraphElement::setVariableValue | ( | const tString & | variableName, |
const double & | value | ||
) |
set the double value of a variable with single cardinality whose name is variableName
References initVariable(), and GPM_Variable::setValue().
void GPM_GraphElement::setVariableValue | ( | const tString & | variableName, |
const int & | n, | ||
const double * | value | ||
) |
set the double list value of a variable with single cardinality whose name is variableName
References initVariable(), and GPM_Variable::setValue().
void GPM_GraphElement::setVariableValue | ( | const tString & | variableName, |
const tFlag & | type, | ||
const int & | n, | ||
const double * | value | ||
) |
set the double list value of a variable with single cardinality whose name is variableName & set the type
References initVariable(), and GPM_Variable::setValue().
tBoolean GPM_GraphElement::setVariableValuesFromString | ( | const tString & | variableName, |
const tFlag & | type, | ||
const tString & | values | ||
) |
set multiple values of variable from a string representation & set the variable type
References addToVariables(), GPM_Variable::New(), parseValues(), setVariable(), tBoolean, and tString.
|
inlineprotectedvirtual |
method called after This setting
Reimplemented from CORE_Object.
References CORE_Object::toDoAfterThisSetting().
|
virtual |
turn the class to string
Reimplemented from CORE_Object.
Reimplemented in GPM_Vertex, GPM_Edge, GPM_Port, and GPM_Node.
References getGroupTypeName(), getVariableNames(), getVariableValuesToString(), and tString.
Referenced by GPM_Edge::saveToStream(), saveToStream(), GPM_Edge::toString(), and GPM_Vertex::toString().
|
inlinestaticinherited |
brief turn the body from the line to text
References CORE_String::replaceAll().
Referenced by GPMG_Project::loadFromUIClass(), and GPM_ModelFunction::readRulesFromFile().
|
inlinestaticinherited |
brief turn the body from the text to line
References CORE_String::replaceAll().
Referenced by GPM_ModelFunction::saveRulesToFile(), and GPMG_Project::saveToUIClass().
|
virtual |
update environment
Reimplemented in GPM_ModelEdge, GPM_ModelPort, and GPM_ModelNode.
References GPM_Variable::New(), tBoolean, tFlag, and tString.
Referenced by GPM_ModelNode::updateEnvironment(), GPM_ModelPort::updateEnvironment(), GPM_ModelEdge::updateEnvironment(), and GPM_PortGraph::updateGraphElementsEnvironment().
|
staticinherited |
indicator to store all classes created and deleted only for debuging version
Referenced by CORE_Object::CORE_Object(), main(), CORE_Object::printObjectsInMemory(), and CORE_Object::~CORE_Object().