]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.h
#3418 creaMaracasVisu Feature New Normal - ManualPaint_model with openmp
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxMaracasMultipleVolumeRendererManager.h
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 /*=========================================================================
27
28   Program:   wxMaracas
29   Module:    $RCSfile: wxMaracasMultipleVolumeRendererManager.h,v $
30   Language:  C++
31   Date:      $Date: 2012/11/15 14:14:35 $
32   Version:   $Revision: 1.8 $
33
34   Copyright: (c) 2002, 2003
35   License:
36   
37      This software is distributed WITHOUT ANY WARRANTY; without even 
38      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
39      PURPOSE.  See the above copyright notice for more information.
40
41 =========================================================================*/
42
43
44
45
46 #ifndef __wxMaracasMultipleVolumeRendererManagerH__
47 #define __wxMaracasMultipleVolumeRendererManagerH__
48
49 #include <iostream>
50 #include <vector>
51 #include <vtkMatrix4x4.h>
52
53 #include "wxMaracasMultipleVolumeRendererManagerData.h"
54
55
56 class wxMaracasMultipleVolumeRendererManager  {
57
58 public:
59         wxMaracasMultipleVolumeRendererManager();
60         ~wxMaracasMultipleVolumeRendererManager();
61
62         /**
63         **      Sets the renderer to manage the prop3D from the view
64         **/
65         void setRenderer(vtkRenderer*  renderer);
66
67         /**
68         **      Gets the renderer to manage the prop3D from the view
69         **/
70         vtkRenderer* getRenderer();
71         
72         /**
73         **      Adds a volume
74         **/
75         int addVolume(int idTP, vtkImageData* img, std::string dataname) throw (char*); 
76         
77         /**
78         **      loads a prop3D from a nSTL file
79         **/
80         vtkProp3D* getVolume(std::string filename);
81
82         /**
83         **      loads a MHD file to convert it into an actor
84         **/
85         vtkImageData* getImageData(std::string filename);
86
87         /**
88         ** Gets image data asotiated with the rendering manager
89         **/
90         vtkImageData* getImageData();
91
92         /**
93         **      adds or removes an actor depending of the bool value
94         **/
95         void addRemoveActor(int propid, bool addremove) throw(char*);
96         
97         /**
98         **      Check if the variables are setted correctly
99         **/
100         void checkInvariant()throw(char*);
101
102         /** 
103         ** Set Volume Opacity
104         **/
105         void setVolumeOpacity(int propid, std::vector<double> greylevel,std::vector<double> value) throw(char*);
106         /**
107         **      Set Volume Color
108         **/
109         void setVolumeColor(int volid, std::vector<double> greylevel,
110                                                                         std::vector<double> red,
111                                                                         std::vector<double> green,
112                                                                         std::vector<double> blue)throw(char*);  
113
114         /**
115         ** Given an id search the data in the vector
116         **/
117         wxMaracasMultipleVolumeRendererManagerData* getViewData(int id)throw(char*);
118
119         void changeCompositeMIPFunction(int id, int function) throw (char *);
120         
121         /**
122         ** Deletes given actor
123         **/
124         void deleteActor(int volumeid)throw (char *);
125
126         /**
127         ** Updates given volume
128         **/
129         void Update(int propid);
130         
131         vtkPiecewiseFunction* GetTransferFunction(int volumeid);
132         vtkColorTransferFunction* GetColorFunction(int volumeid);
133 private:        
134         std::vector<wxMaracasMultipleVolumeRendererManagerData*> prop3Dvect;
135
136         vtkRenderer*  _renderer;
137         vtkImageData* image;
138
139         int _idCount;
140
141         
142
143         
144 };
145
146 #endif