1 #ifndef GPM_ConwayGraph_H
2 #define GPM_ConwayGraph_H
232 inline static SP::GPM_ConwayGraph
New() {
241 int index=i+j*mWidth;
247 int index=i+j*mWidth;
252 inline void setSize(
const int& width,
const int& height) {
259 for (
int i=0;i<2;i++) mPixelSize[i]=pixelSize[i];
264 mPixelSize[0]=pw;mPixelSize[1]=ph;
274 const vector<vector<vector<tVertexIID> > >& fmappings)
const;
314 void createGrid(
const int& n,
const int& p,
GPM_ConwayGraph& grid)
const;
317 int getStateColor(
const tFlag& state)
const;
320 tFlag getState(
const int& color)
const;
void setSize(const int &width, const int &height)
set size
Definition: GPM_ConwayGraph.h:252
tBoolean loadFromImageFile(const tString &fileName)
load the graph from the image
Definition: GPM_ConwayGraph.h:307
static SP::GPM_ConwayGraph New()
create a test class
Definition: GPM_ConwayGraph.h:232
This class consist in modeling conway problem.
Definition: GPM_ConwayGraph.h:190
GPM_Node * getCell(const int &i, const int &j)
get the cell at index i,j
Definition: GPM_ConwayGraph.h:240
virtual void patternsMappingSignalEmit(const SVC::GPM_PatternFunction patternFunction, const vector< vector< vector< tVertexIID > > > &fmappings) const
signal emmiting when the matching of patterns is done
Definition: GPM_ConwayGraph.cpp:214
SP::GPM_PortGraph createPatternGraph() const
create a pattern graph
Definition: GPM_ConwayGraph.cpp:127
static const tFlag DEAD
Definition: GPM_ConwayGraph.h:197
tBoolean saveToImageFile(const tString &fileName) const
save the graph to image
Definition: GPM_ConwayGraph.h:299
GPM_ConwayGraph(void)
create
Definition: GPM_ConwayGraph.cpp:15
static const tFlag ALIVE
Definition: GPM_ConwayGraph.h:198
#define tBoolean
Definition: types.h:35
tBoolean loadFromImageFile(const int &pw, const int &ph, const tString &fileName)
load the graph from the image
Definition: GPM_ConwayGraph.cpp:100
tBoolean createPatternFunctions(SV::GPM_PatternFunction &patternFunctions) const
create the pattern functions for rewriting graph
Definition: GPM_ConwayGraph.cpp:219
tBoolean saveToImageFile(const int &pw, const int &ph, const tString &fileName) const
save the graph to image
Definition: GPM_ConwayGraph.cpp:75
DEFINE_SPTR(GPM_ConwayGraph)
void setPixelSize(const int &pw, const int &ph)
set pixel size
Definition: GPM_ConwayGraph.h:263
static const tFlag UNDEFINED
Definition: GPM_ConwayGraph.h:196
virtual tBoolean saveGraph(const tString &path, const tString &prefix, const int &iterations) const
save the graph during running
Definition: GPM_ConwayGraph.cpp:68
static const tFlag DEAD_OR_ALIVE
Definition: GPM_ConwayGraph.h:199
SP::GPM_Vertex getVertex(const tVertexIID &iid) const
get vertex with internal id
Definition: GPM_Graph.cpp:330
void createGraph(const int &n, const int &p)
create an initial graph
Definition: GPM_ConwayGraph.cpp:135
#define tString
Definition: types.h:36
This class describes a graph which is a list of vertices, ports & edges.
Definition: GPM_PortGraph.h:22
virtual ~GPM_ConwayGraph(void)
destroy
Definition: GPM_ConwayGraph.cpp:39
void setPixelSize(const int pixelSize[2])
set pixel size
Definition: GPM_ConwayGraph.h:258
SP::GPM_ConwayFunction createPatternFunction(SP::GPM_PortGraph pattern) const
create pattern function
Definition: GPM_ConwayGraph.cpp:205
const GPM_Node * getCell(const int &i, const int &j) const
get the cell at index i,j
Definition: GPM_ConwayGraph.h:246
This class describes a node.
Definition: GPM_Node.h:14
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106
#define tFlag
Definition: types.h:14