X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FAPI_Bilat_Graph2D%2FINC%2Fmodel%2FGraph.h;fp=WCudaMSE%2FAPI_Bilat_Graph2D%2FINC%2Fmodel%2FGraph.h;h=b80bf3751b62cfe38dddaf2ea7ffc38584eea76a;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/API_Bilat_Graph2D/INC/model/Graph.h b/WCudaMSE/API_Bilat_Graph2D/INC/model/Graph.h new file mode 100755 index 0000000..b80bf37 --- /dev/null +++ b/WCudaMSE/API_Bilat_Graph2D/INC/model/Graph.h @@ -0,0 +1,151 @@ +#ifndef GRAPH_H_ +#define GRAPH_H_ +#include "envGraph.h" +#include "GridApparance.h" +#include "Figure.h" +#include "GraphObserver_I.h" + +#include +using std::vector; + +#include +//#include +using std::mutex; + +/*----------------------------------------------------------------------*\ + |* Declaration *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +class CBI_GRAPH Graph + { + public: + /*--------------------------------------*\ + |* Constructor *| + \*-------------------------------------*/ + + Graph(Title title, Domaine domaine, Apparance apparance); + + /** + * L'intervalY du domaine du graph est calcul� automatiquement. + */ + Graph(Title title, Interval intervalX, Apparance apparance); + + Graph(Title title); + + /** + * Graph with title fontType TIMES_ROMAN_24 + */ + Graph(string title); + + Graph(); + + private: + + Graph(const Graph& src); + + /*--------------------------------------*\ + |* Destructor *| + \*-------------------------------------*/ + + public: + virtual ~Graph(); + + /*--------------------------------------*\ + |* Methodes *| + \*-------------------------------------*/ + + public: + + void add(Figure* ptrFigure); + + void remove(Figure* ptrFigure); + + void attach(GraphObserver_I* observer); + + void detach(GraphObserver_I* observer); + + void notifyAddFigure(Figure* ptrFigure); + + void notifyRemoveFigure(Figure* ptrFigure); + + void update(); + /** + * return true if need repaint + */ + virtual bool animationStep(); + + private : + + void computeDomaine(); + + /*--------------------------------------*\ + |* Get *| + \*-------------------------------------*/ + + public : + + /* + * getistFigures fourni une copie du vector de figure + */ + vector getListFigures() const; + + Figure* getFigure(int i); + + GridApparance* getGridApparance() const; + + Apparance* getApparance() const; + + Title* getTitle() const; + + Domaine* getDomaine() const; + + int getFigureSize() const; + + /*--------------------------------------*\ + |* Set *| + \*-------------------------------------*/ + + void setApparance(Apparance apparance); + + /** + * set Title with fontType TIMES_ROMAN_24 + */ + void setTitle(string title); + + void setTitle(Title title); + + void setDomaine(Domaine domaine); + + void setIntervalX(Interval intervalX); + + void setGridApparance(GridApparance gridApparance); + + /*--------------------------------------*\ + |* Attributs *| + \*-------------------------------------*/ + + private: + + // Inputs + Title* title; + Domaine* domaine; + Apparance* apparance; + bool isIntervalYAuto; + + // Tools + GridApparance* gridApparance; + vector listFigures; + vector listObserver; + mutex mutexListObserver; + mutex mutexListFigures; + }; + +#endif + +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/