]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewPoint.h
cb9f5b1b24893c530ceeb994f036fa0aae86209a
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / manualContour / manualViewPoint.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 #ifndef manualViewPoint_h
27 #define manualViewPoint_h
28
29 #include "vtkRenderWindow.h"
30
31 #include "vtkRenderer.h"
32 #include "vtkRenderWindowInteractor.h" //extremely important with VC++ don't remove !
33 #include "vtkCommand.h"
34 #include "vtkPolyData.h"
35 #include "vtkCellArray.h"
36 #include "vtkPolyDataMapper.h"
37 #include "vtkInteractorObserver.h"
38 #include "vtkInteractorStyleImage.h"
39 #include <vtkKochanekSpline.h> 
40
41 #include <vtkCellPicker.h> 
42 #include <vtkCamera.h> 
43 #include <vtkPolyLine.h>
44 #include <vtkDataSetMapper.h>
45 #include <vtkUnstructuredGrid.h>
46
47 #include "wxVTKRenderWindowInteractor.h"
48
49 #include <vector>
50 #include "wxVtkBaseView.h"
51 #include "marTypes.h"
52
53 //--------------------------------------------------------
54
55 class manualViewPoint{
56 public:
57
58         manualViewPoint(wxVtkBaseView *wxvtkbaseview);
59         virtual ~manualViewPoint();
60
61         virtual manualViewPoint * Clone();
62         void CopyAttributesTo( manualViewPoint *cloneObject );
63         void            SetSelected(bool selected);
64         void            SetPosibleSelected(bool posibleSelected);
65         bool            GetSelected();
66         bool            GetPosibleSelected();
67         void            DeleteVtkObjects();
68         vtkActor*       CreateVtkPointActor();
69
70         //
71         // Sets the x,y,z position to the actual point. Establishes a range of the points respect 
72         // to the final coordinate.
73         // @param x - double
74         // @param y - double
75         // @param z - double
76         // @param range - double
77         //
78         void            SetPositionXY(double x, double y, double range, double posZ);
79
80         //
81         // Get ViewPoint VtkActor
82         // @return vtkActor*
83         //
84         vtkActor*   GetVtkActor();
85         
86         //
87         // Updates the color and width of the actual point if the VTK Actor has been created
88         //
89         void            UpdateColorActor();     
90
91         //
92         // Updates the point normal color of the actual point.
93         //
94         void UpdateColorActor(double nR, double nG, double nB);
95
96         void            GetSpacing(double spc[3]);
97         void            SetSpacing(double spc[3]);
98         void            SetWidthLine( double width);
99
100
101 private:
102
103         //
104         // Is point selected
105         //
106         bool                            _selected;      
107         bool                            _posibleSelected;
108         
109         vtkPoints                       *_pts;
110         
111         //
112         // Point VTK PolyData object 
113         //
114         vtkPolyData                     *_pd;
115
116         //
117         // Point VTK Actor
118         //
119         vtkActor                        *_pointVtkActor;
120
121         //
122         // Point VTK PolyData mapper
123         //
124         vtkPolyDataMapper       *_bboxMapper;
125
126         //
127         // Reference to VtkBaseView
128         //
129         wxVtkBaseView           *_wxvtkbaseview;
130
131         //
132         // Line Width (def=1)
133         //
134         double                          _widthline;
135 protected:
136
137         //
138         // Point spacing (def=1)
139         //
140         double          _spc[3];
141
142         // Point normal color
143         double          _colorNormal_r;
144         double          _colorNormal_g;
145         double          _colorNormal_b;
146
147         // Posible selected point color
148         double          _colorPosibleSelected_r;
149         double          _colorPosibleSelected_g;
150         double          _colorPosibleSelected_b;
151 };
152
153 #endif // manualViewPoint_h