C++ main module for gpm Package  1.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
GPMG_Project Class Reference

This class describes a project. More...

#include <GPMG_Project.h>

Inheritance diagram for GPMG_Project:
Inheritance graph
[legend]
Collaboration diagram for GPMG_Project:
Collaboration graph
[legend]

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_ModelClassFactorygetClassFactory () 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 tRealgetMinPoint () const
 get the min point of the graphs More...
 
const tRealgetMaxPoint () 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_ModelGraphgetInitGraph ()
 get the init graph of the project More...
 
const GPM_ModelGraphgetInitGraph () 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_CompositorFunctiongetGlobalFunction (const int &i) const
 get the function at index i More...
 
GPM_CompositorFunctiongetGlobalFunction (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...
 

Detailed Description

This class describes a project.

Author
Stéphane Despréaux
Version
1.0

Constructor & Destructor Documentation

GPMG_Project::GPMG_Project ( void  )
protected

create an object

References EXPRTK, and GPM_ModelGraph::New().

Here is the call graph for this function:

GPMG_Project::~GPMG_Project ( void  )
protectedvirtual

destroy an object.

Member Function Documentation

void GPMG_Project::addToEnvironment ( const tFlag index,
const tString name,
const tFlag  type,
const int &  card,
const double *  value 
)
inline

add variable to environment

Parameters
indexindex of the environment in {NODE_ENVIRONMENT,PORT_ENVIRONMENT,EDGE_ENVIRONMENT}
namevariable name
type: variable type in {STRING,REAL,INTEGER,BOOLEAN}
cardsize of the variable
valuedefault value of size card

References GPM_Variable::New().

Referenced by addToEnvironment().

Here is the call graph for this function:

Here is the caller graph for this function:

void GPMG_Project::addToEnvironment ( const tFlag index,
const tString name,
const double &  value 
)
inline

add a double variable to environment

Parameters
indexindex of the environment in {NODE_ENVIRONMENT,PORT_ENVIRONMENT,EDGE_ENVIRONMENT}
namevariable name
valuevalue of the variable

References addToEnvironment(), and GPM_Variable::New().

Here is the call graph for this function:

void GPMG_Project::addToEnvironment ( const tFlag index,
const tString name,
const tString value 
)
inline

add a string variable to environment

Parameters
indexindex of the environment in {NODE_ENVIRONMENT,PORT_ENVIRONMENT,EDGE_ENVIRONMENT}
namevariable name
valuevalue of the variable

References addToEnvironment(), and GPM_Variable::New().

Here is the call graph for this function:

void GPMG_Project::addToEnvironment ( const tFlag index,
const tString name,
const int &  n,
const double *  value 
)
inline

add an array of double to environment

Parameters
indexindex of the environment in {NODE_ENVIRONMENT,PORT_ENVIRONMENT,EDGE_ENVIRONMENT}
namevariable name
nsize of the array
valuen values of the variable

References addToEnvironment(), and GPM_Variable::New().

Here is the call graph for this function:

void GPMG_Project::addToEnvironment ( const tFlag index,
const tString name,
SP::GPM_Variable  var 
)

add a variable to environment

Parameters
indexindex of the environment in {NODE_ENVIRONMENT,PORT_ENVIRONMENT,EDGE_ENVIRONMENT}
namevariable name
varvariable

References GLOBAL_ENVIRONMENT.

tBoolean GPMG_Project::areCompositorFunctionsAvailabled ( )
inline

References null.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void GPMG_Project::clearEnvironment ( const tFlag index)

set the expression type

clear the default environment of NODE, EDGE or PORT environment

Parameters
indexindex of the environment in {NODE_ENVIRONMENT,PORT_ENVIRONMENT,EDGE_ENVIRONMENT}
void GPMG_Project::clearInitGraph ( )

clear the init graph

Referenced by GPMG_ActionGraph::toDo().

Here is the caller graph for this function:

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.

const map<tString,tReal*>& GPMG_Project::getBoundsValue ( ) const
inline

get the bounds

Referenced by GPMG_MovieGraphWindow::showGraphFiles().

Here is the caller graph for this function:

const GPM_ModelClassFactory& GPMG_Project::getClassFactory ( ) const
inline

set the class factory

Referenced by GPMG_GraphElementWindow::componentClicked(), and GPMG_FunctionWindow::componentClicked().

Here is the caller graph for this function:

const map< tString, SP::GPM_Variable > & GPMG_Project::getEnvironment ( const tFlag index) const
tFlag GPMG_Project::getExpressionType ( )
inline

set the expression type

const GPM_CompositorFunction* GPMG_Project::getGlobalFunction ( const int &  i) const
inline

get the function at index i

References null.

GPM_CompositorFunction* GPMG_Project::getGlobalFunction ( const int &  i)
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().

Here is the caller graph for this function:

const SV::GPM_CompositorFunction & GPMG_Project::getGlobalFunctions ( ) const

get the function at index

int GPMG_Project::getGlobalFunctionsNumber ( ) const
inline

get the function number

const map<tString,SP::GPM_Variable>& GPMG_Project::getGlobalVariables ( ) const
inline

get the default port variables

References GLOBAL_ENVIRONMENT.

Referenced by GPMG_GraphElementWindow::componentClicked().

Here is the caller graph for this function:

GPM_ModelGraph* GPMG_Project::getInitGraph ( )
inline

get the init graph of the project

Referenced by GPMG_MainWindow::showAllWindows(), GPMG_MainWindow::showGraphWindow(), GPMG_ActionGraph::toDo(), and GPMG_MenuPanel::updateStateMenus().

Here is the caller graph for this function:

const GPM_ModelGraph* GPMG_Project::getInitGraph ( ) const
inline

get the init graph of the project

int GPMG_Project::getIterationsDone ( ) const
inline

get the iterations done

int GPMG_Project::getIterationsNumber ( ) const
inline

get the iterations number

const tReal* GPMG_Project::getMaxPoint ( ) const
inline

get the max point of the graphs

Referenced by GPMG_MovieGraphWindow::showGraphFiles().

Here is the caller graph for this function:

const tReal* GPMG_Project::getMinPoint ( ) const
inline

get the min point of the graphs

Referenced by GPMG_MovieGraphWindow::showGraphFiles().

Here is the caller graph for this function:

const vector<tString>& GPMG_Project::getResultGraphFiles ( ) const
inline

get the result graph files

Referenced by GPMG_MovieGraphWindow::showGraphFiles().

Here is the caller graph for this function:

const SV::GPM_ModelFunction& GPMG_Project::getRules ( ) const
inline

get the rules for reading

Referenced by GPMG_MainWindow::showAllWindows().

Here is the caller graph for this function:

SV::GPM_ModelFunction& GPMG_Project::getRules ( )
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.

tBoolean GPMG_Project::loadData ( const tString projectFile)
void GPMG_Project::loadFromUIClass ( const UI_Class &  mclass)
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().

Here is the call graph for this function:

tBoolean GPMG_Project::loadInitGraph ( const tString fn,
CORE_Out io 
)
inline

load the iint graph of themodel

References GPM_ModelGraph::New(), null, and tBoolean.

Referenced by GPMG_ActionGraph::toDo().

Here is the call graph for this function:

Here is the caller graph for this function:

static SP::GPMG_Project GPMG_Project::New ( )
inlinestatic

create a new instance of class

Referenced by GPMG_Application::loadModelFile(), GPMG_ClassFactory::NewInstance(), GPMG_ActionGraph::toDo(), and GPMG_ActionMovie::toDo().

Here is the caller graph for this function:

int GPMG_Project::run ( const tString projectFile,
const int &  iter0,
const int &  iterationsNumber,
CORE_Out io,
GPMG_MovieGraphWindow visualizer,
tString errorMessage,
tBoolean succeeds 
)
tBoolean GPMG_Project::saveData ( const tString projectFile)
tBoolean GPMG_Project::saveInitGraph ( const tString fn) const
inline

load the iit graph of themodel

Referenced by GPMG_ActionGraph::toDo().

Here is the caller graph for this function:

void GPMG_Project::saveToUIClass ( UI_Class &  mclass) const
virtual

how to save the object from a mate model class

References N_ENVIRONMENTS, null, CORE_Integer::toString(), tString, and GPM_Object::turnBodyTextToLine().

Here is the call graph for this function:

void GPMG_Project::setClassFactory ( SP::GPM_ModelClassFactory  cf)
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().

Here is the call graph for this function:

void GPMG_Project::setIterationsNumber ( const int &  n)
inline

set the iterations number

void GPMG_Project::setResultGraphFiles ( const vector< tString > &  files)

get the result graph files :

Parameters
filesthe file name of the graphs.

References tString.

Referenced by loadFromUIClass(), and GPMG_ActionMovie::toDo().

Here is the caller graph for this function:

void GPMG_Project::updateGraphsEnvironments ( )
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().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

const tFlag GPMG_Project::EDGE_ENVIRONMENT =2
static
const tFlag GPMG_Project::EXPR =0
static
const tFlag GPMG_Project::EXPRTK =1
static

Referenced by GPMG_Project().

const tFlag GPMG_Project::GLOBAL_ENVIRONMENT =3
static
const tFlag GPMG_Project::INIT_GRAPH =3
static
const tFlag GPMG_Project::N_ENVIRONMENTS =4
static

Referenced by loadFromUIClass(), and saveToUIClass().

const tFlag GPMG_Project::NODE_ENVIRONMENT =0
static
const tFlag GPMG_Project::PATTERN_GRAPH =1
static
const tFlag GPMG_Project::PORT_ENVIRONMENT =1
static
const tFlag GPMG_Project::PT_CONNECTION =5
static
const tFlag GPMG_Project::RESULT_GRAPH =4
static
const tFlag GPMG_Project::TRANSFORMER_GRAPH =2
static
const tFlag GPMG_Project::UNKNOWN_GRAPH =0
static

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