C++ main module for gpm Package
1.0
|
This class describes a project. More...
#include <GPMG_Project.h>
Public Member Functions | |
tBoolean | loadData (const tString &projectFile) |
load the data of the model from project file name More... | |
tBoolean | saveData (const tString &projectFile) |
save the data of the model from project file name More... | |
void | setClassFactory (SP::GPM_ModelClassFactory cf) |
set the class factory More... | |
const GPM_ModelClassFactory & | getClassFactory () const |
set the class factory More... | |
void | clearEnvironment (const tFlag &index) |
set the expression type More... | |
void | addToEnvironment (const tFlag &index, const tString &name, const tFlag type, const int &card, const double *value) |
add variable to environment More... | |
void | addToEnvironment (const tFlag &index, const tString &name, const double &value) |
add a double variable to environment More... | |
void | addToEnvironment (const tFlag &index, const tString &name, const tString &value) |
add a string variable to environment More... | |
void | addToEnvironment (const tFlag &index, const tString &name, const int &n, const double *value) |
add an array of double to environment More... | |
void | addToEnvironment (const tFlag &index, const tString &name, SP::GPM_Variable var) |
add a variable to environment More... | |
void | setIterationsNumber (const int &n) |
set the iterations number More... | |
void | getVertexVariableNames (vector< tString > &vars) const |
get the vertex variable names More... | |
tFlag | getExpressionType () |
set the expression type More... | |
int | getIterationsNumber () const |
get the iterations number More... | |
int | getIterationsDone () const |
get the iterations done More... | |
const tReal * | getMinPoint () const |
get the min point of the graphs More... | |
const tReal * | getMaxPoint () const |
get the max point of the graphs More... | |
const map< tString, tReal * > & | getBoundsValue () const |
get the bounds More... | |
const map< tString, SP::GPM_Variable > & | getEnvironment (const tFlag &index) const |
get the default port variables More... | |
const map< tString, SP::GPM_Variable > & | getGlobalVariables () const |
get the default port variables More... | |
GPM_ModelGraph * | getInitGraph () |
get the init graph of the project More... | |
const GPM_ModelGraph * | getInitGraph () const |
get the init graph of the project More... | |
tBoolean | loadInitGraph (const tString &fn, CORE_Out &io) |
load the iint graph of themodel More... | |
tBoolean | saveInitGraph (const tString &fn) const |
load the iit graph of themodel More... | |
void | clearInitGraph () |
clear the init graph More... | |
void | generateQuadInitGraph (const int &nTriangles, const tBoolean &withMiddle, const int &n, const int &m, const tReal &w, const tReal &h, const tReal &xmin, const tReal &ymin) |
generate graph as grid More... | |
void | updateGraphsEnvironments () |
update the environments of initial graph & graphs of rules More... | |
const SV::GPM_ModelFunction & | getRules () const |
get the rules for reading More... | |
SV::GPM_ModelFunction & | getRules () |
get the rules for writing More... | |
void | clearRule (const int &index) |
clear the rule at index More... | |
tBoolean | canBeRun () const |
return true if the project can be run More... | |
void | setResultGraphFiles (const vector< tString > &files) |
get the result graph files : More... | |
const vector< tString > & | getResultGraphFiles () const |
get the result graph files More... | |
int | run (const tString &projectFile, const int &iter0, const int &iterationsNumber, CORE_Out &io, GPMG_MovieGraphWindow *visualizer, tString &errorMessage, tBoolean &succeeds) |
run the project More... | |
virtual void | saveToUIClass (UI_Class &mclass) const |
how to save the object from a mate model class More... | |
virtual void | loadFromUIClass (const UI_Class &mclass) |
how to load the object from a Meta Model class More... | |
int | getGlobalFunctionsNumber () const |
get the function number More... | |
const GPM_CompositorFunction * | getGlobalFunction (const int &i) const |
get the function at index i More... | |
GPM_CompositorFunction * | getGlobalFunction (const int &i) |
get the function at index i More... | |
SV::GPM_CompositorFunction & | getGlobalFunctions () |
get the function at index More... | |
const SV::GPM_CompositorFunction & | getGlobalFunctions () const |
get the function at index More... | |
void | setGlobalFunctions (SV::GPM_CompositorFunction fs) |
get the function at index i by copping functions of fs More... | |
tBoolean | areCompositorFunctionsAvailabled () |
Static Public Member Functions | |
static SP::GPMG_Project | New () |
create a new instance of class More... | |
Static Public Attributes | |
static const tFlag | NODE_ENVIRONMENT =0 |
static const tFlag | EDGE_ENVIRONMENT =2 |
static const tFlag | PORT_ENVIRONMENT =1 |
static const tFlag | GLOBAL_ENVIRONMENT =3 |
static const tFlag | N_ENVIRONMENTS =4 |
static const tFlag | PATTERN_GRAPH =1 |
static const tFlag | TRANSFORMER_GRAPH =2 |
static const tFlag | PT_CONNECTION =5 |
static const tFlag | INIT_GRAPH =3 |
static const tFlag | RESULT_GRAPH =4 |
static const tFlag | UNKNOWN_GRAPH =0 |
static const tFlag | EXPR =0 |
static const tFlag | EXPRTK =1 |
Protected Member Functions | |
GPMG_Project (void) | |
create an object More... | |
virtual | ~GPMG_Project (void) |
destroy an object. More... | |
This class describes a project.
|
protected |
create an object
References EXPRTK, and GPM_ModelGraph::New().
|
protectedvirtual |
destroy an object.
|
inline |
add variable to environment
index | index of the environment in {NODE_ENVIRONMENT,PORT_ENVIRONMENT,EDGE_ENVIRONMENT} |
name | variable name |
type | : variable type in {STRING,REAL,INTEGER,BOOLEAN} |
card | size of the variable |
value | default value of size card |
References GPM_Variable::New().
Referenced by addToEnvironment().
|
inline |
add a double variable to environment
index | index of the environment in {NODE_ENVIRONMENT,PORT_ENVIRONMENT,EDGE_ENVIRONMENT} |
name | variable name |
value | value of the variable |
References addToEnvironment(), and GPM_Variable::New().
|
inline |
add a string variable to environment
index | index of the environment in {NODE_ENVIRONMENT,PORT_ENVIRONMENT,EDGE_ENVIRONMENT} |
name | variable name |
value | value of the variable |
References addToEnvironment(), and GPM_Variable::New().
|
inline |
add an array of double to environment
index | index of the environment in {NODE_ENVIRONMENT,PORT_ENVIRONMENT,EDGE_ENVIRONMENT} |
name | variable name |
n | size of the array |
value | n values of the variable |
References addToEnvironment(), and GPM_Variable::New().
void GPMG_Project::addToEnvironment | ( | const tFlag & | index, |
const tString & | name, | ||
SP::GPM_Variable | var | ||
) |
add a variable to environment
index | index of the environment in {NODE_ENVIRONMENT,PORT_ENVIRONMENT,EDGE_ENVIRONMENT} |
name | variable name |
var | variable |
References GLOBAL_ENVIRONMENT.
tBoolean GPMG_Project::canBeRun | ( | ) | const |
return true if the project can be run
References GPM_PatternFunction::isValid(), null, and tBoolean.
Referenced by GPMG_MenuPanel::updateStateMenus().
void GPMG_Project::clearEnvironment | ( | const tFlag & | index | ) |
set the expression type
clear the default environment of NODE, EDGE or PORT environment
index | index of the environment in {NODE_ENVIRONMENT,PORT_ENVIRONMENT,EDGE_ENVIRONMENT} |
void GPMG_Project::clearInitGraph | ( | ) |
clear the init graph
Referenced by GPMG_ActionGraph::toDo().
void GPMG_Project::clearRule | ( | const int & | index | ) |
clear the rule at index
void GPMG_Project::generateQuadInitGraph | ( | const int & | nTriangles, |
const tBoolean & | withMiddle, | ||
const int & | n, | ||
const int & | m, | ||
const tReal & | w, | ||
const tReal & | h, | ||
const tReal & | xmin, | ||
const tReal & | ymin | ||
) |
generate graph as grid
References EDGE_ENVIRONMENT, NODE_ENVIRONMENT, and PORT_ENVIRONMENT.
get the bounds
Referenced by GPMG_MovieGraphWindow::showGraphFiles().
|
inline |
set the class factory
Referenced by GPMG_GraphElementWindow::componentClicked(), and GPMG_FunctionWindow::componentClicked().
get the default port variables
Referenced by GPMG_RuleGraphDrawPanel::addEdge(), GPMG_DrawPanel::addEdge(), GPMG_DrawPanel::addEdgeToNode(), GPMG_DrawPanel::addNode(), GPMG_DrawPanel::addPort(), and GPMG_GraphPanel::updateEnvironments().
|
inline |
set the expression type
|
inline |
get the function at index i
References null.
|
inline |
get the function at index i
References null.
SV::GPM_CompositorFunction & GPMG_Project::getGlobalFunctions | ( | ) |
get the function at index
Referenced by GPMG_GraphElementWindow::componentClicked().
const SV::GPM_CompositorFunction & GPMG_Project::getGlobalFunctions | ( | ) | const |
get the function at index
|
inline |
get the function number
|
inline |
get the default port variables
References GLOBAL_ENVIRONMENT.
Referenced by GPMG_GraphElementWindow::componentClicked().
|
inline |
get the init graph of the project
Referenced by GPMG_MainWindow::showAllWindows(), GPMG_MainWindow::showGraphWindow(), GPMG_ActionGraph::toDo(), and GPMG_MenuPanel::updateStateMenus().
|
inline |
get the init graph of the project
|
inline |
get the iterations done
|
inline |
get the iterations number
|
inline |
get the max point of the graphs
Referenced by GPMG_MovieGraphWindow::showGraphFiles().
|
inline |
get the min point of the graphs
Referenced by GPMG_MovieGraphWindow::showGraphFiles().
|
inline |
get the result graph files
Referenced by GPMG_MovieGraphWindow::showGraphFiles().
|
inline |
get the rules for reading
Referenced by GPMG_MainWindow::showAllWindows().
|
inline |
get the rules for writing
void GPMG_Project::getVertexVariableNames | ( | vector< tString > & | vars | ) | const |
get the vertex variable names
References NODE_ENVIRONMENT, and PORT_ENVIRONMENT.
load the data of the model from project file name
References CORE_Out::ERROR_MSG, CORE_Out::getOutputString(), GPM_ModelGraph::New(), GPM_ModelFunction::New(), CORE_Out::New(), CORE_Out::println(), CORE_Out::STRING_OUTPUT, tBoolean, CORE_Integer::toString(), tString, and updateGraphsEnvironments().
|
virtual |
how to load the object from a Meta Model class
References GLOBAL_ENVIRONMENT, N_ENVIRONMENTS, GPM_Variable::New(), null, setResultGraphFiles(), CORE_Integer::toString(), tReal, tString, and GPM_Object::turnBodyLineToText().
load the iint graph of themodel
References GPM_ModelGraph::New(), null, and tBoolean.
Referenced by GPMG_ActionGraph::toDo().
|
inlinestatic |
create a new instance of class
Referenced by GPMG_Application::loadModelFile(), GPMG_ClassFactory::NewInstance(), GPMG_ActionGraph::toDo(), and GPMG_ActionMovie::toDo().
int GPMG_Project::run | ( | const tString & | projectFile, |
const int & | iter0, | ||
const int & | iterationsNumber, | ||
CORE_Out & | io, | ||
GPMG_MovieGraphWindow * | visualizer, | ||
tString & | errorMessage, | ||
tBoolean & | succeeds | ||
) |
run the project
References GPMG_MovieGraphWindow::addGraph(), GPM_PortGraph::addPatternFunction(), GPMG_MovieGraphWindow::clearGraphs(), CORE_IO::getPathAndFileName(), CORE_Out::isAborting(), GPM_PortGraph::loadGraph(), GPM_ModelGraph::New(), CORE_Out::New(), null, CORE_Out::printInt(), CORE_Out::println(), GPM_PortGraph::rewrite(), GPM_PortGraph::saveGraph(), CORE_Out::STRING_OUTPUT, CORE_Integer::toString(), tString, and CORE_Out::WARNING_MSG.
save the data of the model from project file name
References CORE_Out::ERROR_MSG, CORE_Out::getOutputString(), GPM_Function::getPatternGraph(), GPM_Function::getTransformerGraph(), CORE_Out::New(), null, CORE_Out::println(), GPM_ModelFunction::saveRulesToFile(), GPM_Graph::saveToFile(), CORE_Out::STRING_OUTPUT, tBoolean, CORE_Integer::toString(), and tString.
Referenced by GPMG_Application::saveModelFile().
load the iit graph of themodel
Referenced by GPMG_ActionGraph::toDo().
|
virtual |
how to save the object from a mate model class
References N_ENVIRONMENTS, null, CORE_Integer::toString(), tString, and GPM_Object::turnBodyTextToLine().
|
inline |
set the class factory
void GPMG_Project::setGlobalFunctions | ( | SV::GPM_CompositorFunction | fs | ) |
get the function at index i by copping functions of fs
References GPM_CompositorFunction::NewInstance().
|
inline |
set the iterations number
void GPMG_Project::setResultGraphFiles | ( | const vector< tString > & | files | ) |
get the result graph files :
files | the file name of the graphs. |
References tString.
Referenced by loadFromUIClass(), and GPMG_ActionMovie::toDo().
|
inline |
update the environments of initial graph & graphs of rules
References GPM_Function::getPatternGraph(), GPM_Function::getTransformerGraph(), null, GPM_ModelFunction::setGlobalFunctions(), GPM_ModelFunction::setGlobalVariables(), and GPM_PortGraph::updateGraphElementsEnvironment().
Referenced by loadData().
|
static |
|
static |
|
static |
Referenced by GPMG_Project().
|
static |
Referenced by addToEnvironment(), getGlobalVariables(), loadFromUIClass(), and GPMG_EnvironmentWindow::setProject().
|
static |
|
static |
Referenced by loadFromUIClass(), and saveToUIClass().
|
static |
|
static |
|
static |
|
static |
|
static |
Referenced by GPMG_MovieGraphDrawPanel::getGraphType().
|
static |
|
static |