Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / API_Bilat_Graph2D / INC / model / Graph.h
diff --git a/WCudaMSE/API_Bilat_Graph2D/INC/model/Graph.h b/WCudaMSE/API_Bilat_Graph2D/INC/model/Graph.h
new file mode 100755 (executable)
index 0000000..b80bf37
--- /dev/null
@@ -0,0 +1,151 @@
+#ifndef GRAPH_H_\r
+#define GRAPH_H_\r
+#include "envGraph.h"\r
+#include "GridApparance.h"\r
+#include "Figure.h"\r
+#include "GraphObserver_I.h"\r
+\r
+#include <vector>\r
+using std::vector;\r
+\r
+#include <mutex>\r
+//#include <boost/thread/mutex.hpp>\r
+using std::mutex;\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |*                    Declaration                                     *|\r
+ \*---------------------------------------------------------------------*/\r
+\r
+/*--------------------------------------*\\r
+ |*            Public                  *|\r
+ \*-------------------------------------*/\r
+\r
+class CBI_GRAPH Graph\r
+    {\r
+    public:\r
+       /*--------------------------------------*\\r
+        |*             Constructor             *|\r
+        \*-------------------------------------*/\r
+\r
+       Graph(Title title, Domaine domaine, Apparance apparance);\r
+\r
+       /**\r
+        * L'intervalY du domaine du graph est calcul� automatiquement.\r
+        */\r
+       Graph(Title title, Interval intervalX, Apparance apparance);\r
+\r
+       Graph(Title title);\r
+\r
+       /**\r
+        * Graph with title fontType TIMES_ROMAN_24\r
+        */\r
+       Graph(string title);\r
+\r
+       Graph();\r
+\r
+    private:\r
+\r
+       Graph(const Graph& src);\r
+\r
+       /*--------------------------------------*\\r
+        |*             Destructor              *|\r
+        \*-------------------------------------*/\r
+\r
+    public:\r
+       virtual ~Graph();\r
+\r
+       /*--------------------------------------*\\r
+        |*             Methodes                *|\r
+        \*-------------------------------------*/\r
+\r
+    public:\r
+\r
+       void add(Figure* ptrFigure);\r
+\r
+       void remove(Figure* ptrFigure);\r
+\r
+       void attach(GraphObserver_I* observer);\r
+\r
+       void detach(GraphObserver_I* observer);\r
+\r
+       void notifyAddFigure(Figure* ptrFigure);\r
+\r
+       void notifyRemoveFigure(Figure* ptrFigure);\r
+\r
+       void update();\r
+       /**\r
+        * return true if need repaint\r
+        */\r
+       virtual bool animationStep();\r
+\r
+    private :\r
+\r
+       void computeDomaine();\r
+\r
+       /*--------------------------------------*\\r
+        |*             Get                     *|\r
+        \*-------------------------------------*/\r
+\r
+    public :\r
+\r
+       /*\r
+        * getistFigures fourni une copie du vector de figure\r
+        */\r
+       vector<Figure*> getListFigures() const;\r
+\r
+       Figure* getFigure(int i);\r
+\r
+       GridApparance* getGridApparance() const;\r
+\r
+       Apparance* getApparance() const;\r
+\r
+       Title* getTitle() const;\r
+\r
+       Domaine* getDomaine() const;\r
+\r
+       int getFigureSize() const;\r
+\r
+       /*--------------------------------------*\\r
+        |*             Set                     *|\r
+        \*-------------------------------------*/\r
+\r
+       void setApparance(Apparance apparance);\r
+\r
+       /**\r
+        * set Title with fontType TIMES_ROMAN_24\r
+        */\r
+       void setTitle(string title);\r
+\r
+       void setTitle(Title title);\r
+\r
+       void setDomaine(Domaine domaine);\r
+\r
+       void setIntervalX(Interval intervalX);\r
+\r
+       void setGridApparance(GridApparance gridApparance);\r
+\r
+       /*--------------------------------------*\\r
+        |*             Attributs               *|\r
+        \*-------------------------------------*/\r
+\r
+    private:\r
+\r
+       // Inputs\r
+       Title* title;\r
+       Domaine* domaine;\r
+       Apparance* apparance;\r
+       bool isIntervalYAuto;\r
+\r
+       // Tools\r
+       GridApparance* gridApparance;\r
+       vector<Figure*> listFigures;\r
+       vector<GraphObserver_I*> listObserver;\r
+       mutex mutexListObserver;\r
+       mutex mutexListFigures;\r
+    };\r
+\r
+#endif \r
+\r
+/*----------------------------------------------------------------------*\\r
+ |*                    End                                             *|\r
+ \*---------------------------------------------------------------------*/\r