]> Creatis software - bbtkGEditor.git/blob - lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.h
4a3f7e1a090320646cb33313b6bb03d9af1075e8
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsKernelEditorGraphic / wxVtkSceneManager.h
1 /*=========================================================================                                                                               
2 Program:   bbtk
3 Module:    $RCSfile$
4 Language:  C++
5 Date:      $Date$
6 Version:   $Revision$
7 =========================================================================*/
8
9 /* ---------------------------------------------------------------------
10
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
13 *
14 *  This software is governed by the CeCILL-B license under French law and 
15 *  abiding by the rules of distribution of free software. You can  use, 
16 *  modify and/ or redistribute the software under the terms of the CeCILL-B 
17 *  license as circulated by CEA, CNRS and INRIA at the following URL 
18 *  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
19 *  or in the file LICENSE.txt.
20 *
21 *  As a counterpart to the access to the source code and  rights to copy,
22 *  modify and redistribute granted by the license, users are provided only
23 *  with a limited warranty  and the software's author,  the holder of the
24 *  economic rights,  and the successive licensors  have only  limited
25 *  liability. 
26 *
27 *  The fact that you are presently reading this means that you have had
28 *  knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */                                                                         
30
31
32
33 /**
34 *  \file 
35 *  \brief Class bbtk::BlackBox : abstract black-box interface. 
36 */
37
38 /**
39 * \class bbtk::wxVtkSceneManager
40 * \brief 
41 */
42
43 #ifndef __wxVtkSceneManager_h__
44 #define __wxVtkSceneManager_h__
45
46 //Includes same project
47 #include "GObjectsMVCFactory.h"
48 #include "Observer.h"
49 #include "GPortModel.h"
50 #include "GConnectorView.h"
51 #include "GConnectorModel.h"
52 #include "GConnectorController.h"
53 #include "vtkGPortView.h"
54 #include "manualConnectorContourView.h"
55 #include "manualConnectorContourController.h"
56
57 //Includes bbtk
58 #include <bbtkBlackBoxInputDescriptor.h>
59 #include <bbtkBlackBoxDescriptor.h>
60
61 //Includes creaMaracasVisu
62 #include <wxVtk3DBaseView.h>
63 #include <InteractorStyleMaracas.h>
64 #include <vtkInteractorStyleBaseView2D.h>
65 #include <manualContourControler.h>
66 #include <manualContourModel.h>
67
68 //Includes vtk
69 #include <vtkRenderWindow.h>
70 #include <vtkRenderWindowInteractor.h>
71 #include <vtkRenderer.h>
72 #include <vtkInteractorStyleImage.h>
73
74
75 //Includes std
76 #include <iostream>
77 #include <map>
78
79
80 namespace bbtk
81 {
82
83         class wxVtkSceneManager : public InteractorStyleMaracas , public Observer
84         {
85         public: 
86                 wxVtkSceneManager(wxDropTarget *parent, wxVtk3DBaseView *baseView, int idManager);
87                 ~wxVtkSceneManager();
88
89                 void configureBaseView();
90                 void createGBlackBox(int x, int y,std::string packageName, std::string boxName);
91                 void createGPort(int portType, int posinBox,GBlackBoxModel *blackBox);
92                 void createGInputPort(int portType, int posinBox,GBlackBoxModel *blackBox, BlackBoxInputDescriptor *desc);
93                 void createGOutputPort(int portType, int posinBox,GBlackBoxModel *blackBox, BlackBoxOutputDescriptor *desc);
94                 void createGConnector(GPortModel* startPort);
95
96                 void registerController(InteractorStyleMaracas *param);
97
98                 vtkRenderWindow* getRenderWindow();
99                 vtkRenderer* getRenderer();
100
101                 void disconnectDrop();
102                 
103                 virtual bool OnMouseMove();
104
105                 virtual void update(int idController,int command);
106                 
107         private:
108
109                 // Last controller created
110                 int _idLastController;
111
112                 // Id of the manager, the same of the panel
113                 int _idManager;
114
115                 // Boxes number in the scene
116                 int _numBoxes;
117
118                 wxVtk3DBaseView *_baseView;
119
120                 int _worldState;
121
122                 std::map<int,GObjectController*> _controllers;
123
124         protected:
125
126         };
127
128
129 }
130 // namespace bbtk
131 #endif
132