]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/manualContour.h
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / manualContour.h
1
2 #ifndef MANUAL_CONTOUR_H
3 #define MANUAL_CONTOUR_H
4
5
6 //--
7 /* // EEDxx include
8 #include <vtkProperty.h> 
9 #include "vtkActor.h"
10 #include "vtkPoints.h"
11 #include "vtkImageViewer2.h"
12 #include "vtkImageData.h"
13 */
14
15 #include "vtkRenderWindow.h"
16
17 #include "vtkRenderer.h"
18 #include "vtkRenderWindowInteractor.h" //extremely important with VC++ don't remove !
19 #include "vtkCommand.h"
20 #include "vtkPolyData.h"
21 #include "vtkCellArray.h"
22 #include "vtkPolyDataMapper.h"
23 #include "vtkInteractorObserver.h"
24 #include "vtkInteractorStyleImage.h"
25 #include <vtkKochanekSpline.h> 
26
27 #include <vtkCellPicker.h> 
28
29
30 #include <vtkCamera.h> 
31 #include <vtkPolyLine.h>
32 #include <vtkDataSetMapper.h>
33 #include <vtkUnstructuredGrid.h>
34
35 #include "wxVTKRenderWindowInteractor.h"
36
37
38 //--
39
40 #include <vector>
41
42
43 #include "wxVtkBaseView.h"
44 #include "marTypes.h"
45
46
47 // ----------------------------------------------------------------------------
48 // ----------------------------------------------------------------------------
49 // ----------------------------------------------------------------------------
50
51
52
53 class manualPoint{
54 public:
55         manualPoint();
56         virtual ~manualPoint();
57         void    SetPoint(double x,double y,double z);
58         void    SetPointX(double x);
59         void    SetPointY(double y);
60         void    SetPointZ(double z);
61         double  GetX();
62         double  GetY();
63         double  GetZ();
64         virtual manualPoint * Clone();
65 private:
66         double  _x;
67         double  _y;
68         double  _z;
69 }; 
70
71 // ----------------------------------------------------------------------------
72 // ----------------------------------------------------------------------------
73 // ----------------------------------------------------------------------------
74
75
76 class creaMaracasVisu_EXPORT manualContourModel{
77 public:
78         manualContourModel();
79         virtual ~manualContourModel();
80
81         virtual manualContourModel * Clone();
82         void CopyAttributesTo( manualContourModel *cloneObject );
83         virtual void Open(FILE *ff);    // virtual
84         virtual void Save(FILE *ff);    // virtual
85         virtual int GetTypeModel();                     // virtual 
86
87         int                             AddPoint(double x,double y,double z);
88         int                             InsertPoint(double x,double y,double z);
89 //JSTG 25-04-08 -------------------------------------------------------
90         void                    InsertPoint_id(int id, double x,double y,double z);
91 //---------------------------------------------------------------------
92         void                    AddManualPoint( manualPoint* theManualPoint );
93
94         void                    DeletePoint(int i);
95         void                    DeleteAllPoints();
96
97         void                    MovePoint(int i,double dx,double dy,double dz);
98         void                    MoveLstPoints(double dx,double dy,double dz);
99         void                    MoveAllPoints(double dx,double dy,double dz);
100
101         int                             GetIdPoint(double x, double y, double z, int i_range,int type);
102         manualPoint*    GetManualPoint(int id);
103         int                             GetSizeLstPoints();
104         int                             GetNumberOfPointsSpline();
105         void                    SetNumberOfPointsSpline(int size);
106
107         virtual void    UpdateSpline();
108         void                    SetCloseContour(bool closeContour);
109         bool                    IfCloseContour();
110 //JSTG 25-02-08 -----------------------------------------------------------------
111         //void                  GetSplinePoint(double t, double &x, double &y, double &z);      //Method Original
112         //void                  GetSplineiPoint(int i, double &x, double &y, double &z);        //Method Original
113 //-------------------------------------------------------------------------------
114         double                  GetPathSize();
115         double                  GetPathArea();
116
117         void                    GetNearestPointAndNormal(double *p, double *rp,  double *rn);
118         
119 // JSTG 25-02-08 -----------------------------------------------------------------
120         virtual void    GetSpline_i_Point(int i, double *x, double *y, double *z);
121         void                    GetSpline_t_Point(double t, double *x, double *y, double *z);
122 //--------------------------------------------------------------------------------
123
124         virtual std::vector<manualContourModel*> ExploseModel(  );
125
126
127 private:
128         int                                                     _sizePointsContour;
129         std::vector<manualPoint*>       _lstPoints;
130         bool                                            _closeContour;
131     vtkKochanekSpline                   *_cntSplineX;
132     vtkKochanekSpline                   *_cntSplineY;
133     vtkKochanekSpline                   *_cntSplineZ;
134
135 //JSTG 25-02-08 ----------------------------------------
136         double                  _delta_JSTG;
137 //------------------------------------------------------
138
139 }; 
140
141
142 //--------------------------------------------------------
143
144 class creaMaracasVisu_EXPORT manualContourModelCircle : public manualContourModel
145 {
146 public:
147         manualContourModelCircle();
148         virtual ~manualContourModelCircle();
149         virtual manualContourModelCircle *Clone();
150         void CopyAttributesTo( manualContourModelCircle *cloneObject);
151         virtual void GetSpline_i_Point(int i, double *x, double *y, double *z);
152 private:
153         double          _deltaAngle;
154         double          _radio;
155         double          _centerX;
156         double          _centerY;
157         double          _centerZ;
158
159         virtual int             GetTypeModel();  
160         virtual void    UpdateSpline();
161 };
162
163 //--------------------------------------------------------
164
165 class creaMaracasVisu_EXPORT manualContourModelLine : public manualContourModel
166 {
167 public:
168         manualContourModelLine();
169         virtual ~manualContourModelLine();
170         virtual manualContourModelLine *Clone();
171         void CopyAttributesTo( manualContourModelLine *cloneObject);
172         virtual void GetSpline_i_Point(int i, double *x, double *y, double *z);
173 private:
174         virtual int             GetTypeModel();  
175 };
176
177 //--------------------------------------------------------
178
179 class manualContourModelBullEyeSector : public manualContourModel
180 {
181 public:
182         manualContourModelBullEyeSector();
183         virtual ~manualContourModelBullEyeSector();
184         virtual manualContourModelBullEyeSector *Clone();
185         void    CopyAttributesTo( manualContourModelBullEyeSector *cloneObject);
186         void    SetSector(      double radioA,
187                                                 double radioB,
188                                                 double ang,
189                                                 double angDelta);
190         void GetSector(         double *radioA,
191                                                 double *radioB,
192                                                 double *ang,
193                                                 double *angDelta);
194         void SetSize(double ww,double hh);
195         void SetCenter(double cx,double cy);
196         virtual void GetSpline_i_Point(int i, double *x, double *y, double *z);
197         virtual void Save(FILE *ff);
198         virtual void Open(FILE *ff);
199
200 private:
201         double          _radioA;
202         double          _radioB;
203         double          _ang;
204         double          _angDelta;
205         double          _ww;
206         double          _hh;
207         double          _cx;
208         double          _cy;
209
210         virtual int             GetTypeModel();  
211 };
212
213
214 //--------------------------------------------------------
215 //eed004
216 class creaMaracasVisu_EXPORT manualContourModelBullEye : public manualContourModel
217 {
218 public:
219         manualContourModelBullEye();
220         virtual ~manualContourModelBullEye();
221         virtual manualContourModelBullEye *Clone();
222         void    CopyAttributesTo( manualContourModelBullEye *cloneObject);
223         virtual void Save(FILE *ff);
224         virtual void Open(FILE *ff);
225
226         int             GetNumberOfPointsSplineSectorBulleEje();
227         void    SetNumberOfPointsSplineSectorBulleEje(int);
228         void    AddSector(      double radioA,
229                                                 double radioB,
230                                                 double ang,
231                                                 double angDelta);
232         void GetSector(         int id, 
233                                                 double *radioA,
234                                                 double *radioB,
235                                                 double *ang,
236                                                 double *angDelta);
237         manualContourModelBullEyeSector * GetModelSector(int id);
238
239         void    ResetSectors();
240         int             GetSizeOfSectorLst();
241         virtual void UpdateSpline(); // virtual
242         virtual std::vector<manualContourModel*> ExploseModel(  );
243
244
245
246 private:
247         int                                                                                        _numberPointsSlineBySector;
248         std::vector<manualContourModelBullEyeSector *> _lstModelBullEyeSector;
249
250 /* Borrame Eduardo
251         std::vector<double>             _lstRadioA;
252         std::vector<double>             _lstRadioB;
253         std::vector<double>             _lstAng;
254         std::vector<double>             _lstAngDelta;
255 */
256
257         virtual int             GetTypeModel();  
258 };
259
260
261
262 //--------------------------------------------------------
263
264 //JSTG 25-02-08 ------------------------------------------
265 class creaMaracasVisu_EXPORT manualContourModelRoi : public manualContourModel
266 {
267         public:
268         manualContourModelRoi();
269         virtual ~manualContourModelRoi();
270         virtual manualContourModelRoi *Clone();
271         void CopyAttributesTo( manualContourModelRoi *cloneObject);
272 private:
273         virtual int GetTypeModel();  
274 };
275 //--------------------------------------------------------
276
277
278 class manualViewPoint{
279 public:
280
281 //      static int range;
282
283         manualViewPoint(wxVtkBaseView *wxvtkbaseview);
284         ~manualViewPoint();
285         void            SetSelected(bool selected);
286         void            SetPosibleSelected(bool posibleSelected);
287         bool            GetSelected();
288         bool            GetPosibleSelected();
289         void            DeleteVtkObjects();
290         vtkActor*       CreateVtkPointActor();
291         void            SetPositionXY(double x, double y, double range, double posZ);
292         vtkActor*   GetVtkActor();
293         void            UpdateColorActor();     
294         void            GetSpacing(double spc[3]);
295         void            SetSpacing(double spc[3]);
296         void            SetWidthLine( double width);
297
298
299 private:
300         bool                            _selected;      
301         bool                            _posibleSelected;
302         vtkPoints                       *_pts;
303         vtkPolyData                     *_pd;
304         vtkActor                        *_pointVtkActor;
305         vtkPolyDataMapper       *_bboxMapper;
306         wxVtkBaseView           *_wxvtkbaseview;
307         double                          _widthline;
308 protected:
309         double                          _spc[3];
310 };
311
312 // ----------------------------------------------------------------------------
313 // ----------------------------------------------------------------------------
314 // ----------------------------------------------------------------------------
315
316
317 class creaMaracasVisu_EXPORT manualViewBaseContour{
318 public:
319         manualViewBaseContour();
320         virtual ~manualViewBaseContour();
321
322         virtual int GetType();
323         virtual void Save(FILE *pFile);
324         virtual void Open(FILE *pFile);
325
326         void    AddPoint();
327         void    AddPoint( manualViewPoint * manualViewPoint );
328         void    InsertPoint(int id);
329         void    DeleteContour();
330         void    DeletePoint(int x, int y,int z);
331         virtual void    DeletePoint(int id);
332
333         virtual void    UpdateViewPoint(int id);
334         virtual void    UpdateViewPoints();
335
336         void    SetSelected(bool selected);
337         void    SetPosibleSelected(bool posibleSelected);
338         bool    GetSelected();
339         bool    GetPosibleSelected();
340         void    DeleteSelectedPoints();
341         bool    GetEditable();
342         void    SetEditable( bool * condition );
343
344
345
346         virtual int             GetIdPoint(int x, int y, int z);
347
348         void    SelectPoint(int i,bool select);
349         void    SelectLstPoints();
350         void    SelectAllPoints(bool select);
351         virtual int             SelectPosiblePoint(int x, int y ,int z);
352         bool    SelectPosibleContour(int x, int y ,int z);
353         void    SelectAllPossibleSelected(bool select);
354         void    SetPointSelected(int id,bool select);
355         void    SetPointPosibleSelected(int id,bool select);
356         void    SetIfViewControlPoints(bool ifShow);
357         bool    GetIfViewControlPoints();
358         
359         void    UnSelectPoint(int i);
360         void    UnSelectLstPoints();
361         void    UnSelectAllPoints();
362
363         void    SetModel(manualContourModel *manContModel);
364         void    SetWxVtkBaseView(wxVtkBaseView *wxvtkbaseview);
365
366         virtual void    Refresh();
367         int             GetNumberOfPoints();                                            // ??? 
368         //int           GetNumberOfPointsSpline();                              //JSTG 25-02-08 In ContourModel is the same method 
369         //void  SetNumberOfPointsSpline(int size);                      //JSTG 25-02-08 In ContourModel is the same method 
370
371         void    CreateNewContour();
372         double* GetVectorPointsXManualContour();
373         double* GetVectorPointsYManualContour();
374         double* GetVectorPointsZManualContour();
375
376         virtual bool    ifTouchContour(int x,int y, int z);
377         void    UpdateColorActor();
378
379         void    SetRange(int range);
380         int             GetRange();
381         void    SetZ(int z);
382         int             GetZ();
383
384         wxVtkBaseView *GetWxVtkBaseView();
385
386         virtual void InitMove(int x, int y, int z);
387         virtual void MoveContour(int x, int y, int z);
388         virtual void MoveContour(int horizontalUnits, int verticalUnits );
389         virtual void GetMinMax( double &minX,double &minY, double &minZ, double &maxX, double &maxY, double &maxZ );
390         virtual void TransfromeCoordViewWorld(double &X, double &Y, double &Z, int type=2);
391
392         void    ClearContour();
393         virtual void    ClearPoint(int id);
394
395         void    SetVisible(bool ok);
396         void    SetShowText(bool ok);
397
398         void    GetSpacing(double spc[3]);
399         void    SetSpacing(double spc[3]);
400
401         void    SetColorNormalContour(double r, double g, double b);
402         void    GetColorNormalContour(double &r, double &g, double &b);
403         void    SetColorEditContour(double r, double g, double b);
404         void    GetColorEditContour(double &r, double &g, double &b);
405         void    SetColorSelectContour(double r, double g, double b);
406         void    GetColorSelectContour(double &r, double &g, double &b);
407         
408         //Addinging and removing from visualization specific actors included in the viewer contour
409         void    AddCompleteContourActor( bool ifControlPoints = false);
410         void    RemoveCompleteContourActor();
411         virtual void    AddSplineActor();
412         virtual void    RemoveSplineActor();
413         void    AddControlPoints();
414         void    RemoveControlPoints();  
415         void    AddTextActor();
416         void    RemoveTextActor();
417
418         virtual manualViewBaseContour * Clone();
419                         void                                    CopyAttributesTo( manualViewBaseContour *cloneObject );
420         virtual void                                    RefreshContour();
421                         void                                    SetWidthLine(double width);
422                         double                                  GetWidthLine();
423
424         virtual void                    ConstructVTKObjects();
425
426 private:
427         int                                                             _range;
428
429         wxVtkBaseView                                   *_wxvtkbaseview;
430         bool                                                    _selected;
431         bool                                                    *_editable;
432         bool                                                    _posibleSelected;
433         bool                                                    _viewControlPoints;
434
435
436         vtkPolyData                                             *_pd;
437         vtkActor                                                *_contourVtkActor;
438         vtkPolyDataMapper                               *_bboxMapper;
439
440         double                                                  _coulorEdit_r;
441         double                                                  _coulorEdit_g;
442         double                                                  _coulorEdit_b;
443         double                                                  _coulorNormal_r;
444         double                                                  _coulorNormal_g;
445         double                                                  _coulorNormal_b;
446         double                                                  _coulorSelection_r;
447         double                                                  _coulorSelection_g;
448         double                                                  _coulorSelection_b;
449         double                                                  _widthline;
450
451         void                    DeleteVtkObjects();
452         virtual void    RefreshText();
453
454
455 protected:
456
457         // text
458         bool                                                    _show_text;
459         int                                                             _id_viewPoint_for_text;
460         vtkTextActor                                    *_textActor;
461         manualContourModel                              *_manContModel;
462         vtkPoints                                               *_pts;
463 // JSTG 25-02-08 --------------------------------------------
464         int                                                             _sizePointsContour;
465 //-----------------------------------------------------------
466         std::vector<manualViewPoint*>   _lstViewPoints;
467         double                                                  _spc[3];
468
469 };
470
471
472 // ----------------------------------------------------------------------------
473 // ----------------------------------------------------------------------------
474 // ----------------------------------------------------------------------------
475
476
477 class creaMaracasVisu_EXPORT manualViewContour: public manualViewBaseContour
478 {
479 public:
480         manualViewContour();
481         virtual ~manualViewContour();
482         virtual manualViewContour * Clone();
483         void CopyAttributesTo( manualViewContour *cloneObject );
484
485         virtual int GetType();
486         virtual void Save(FILE *pFile);
487         virtual void Open(FILE *pFile);
488
489
490         virtual void RefreshContour();
491         virtual bool ifTouchContour(int x,int y, int z);
492         virtual void InitMove(int x, int y, int z);
493         virtual void MoveContour(int x, int y, int z);  
494         virtual void MoveContour(int horizontalUnits, int verticalUnits );
495         virtual void DeletePoint(int id); 
496         virtual void ClearPoint(int id);
497                         void SetMesureScale(double mesureScale);
498 private:
499         double  _mesureScale;
500         std::vector< std::vector<double> > _initialMovingPoints;
501         manualContourModel * _initialConoturModel;
502
503         virtual void    RefreshText();
504 protected:
505
506 };
507
508 // ----------------------------------------------------------------------------
509 // ----------------------------------------------------------------------------
510 // ----------------------------------------------------------------------------
511
512 class manualView3VContour: public manualViewContour
513 {
514 public:
515         manualView3VContour(int type);
516         virtual ~manualView3VContour();
517         virtual manualView3VContour * Clone();
518         void CopyAttributesTo( manualView3VContour *cloneObject );
519
520         virtual void    RefreshContour();
521         virtual int             GetIdPoint(int x, int y, int z);
522         virtual void    UpdateViewPoint(int id);
523         virtual bool    ifTouchContour(int x,int y,int z);
524                         int             GetType();
525
526 protected:
527 private:
528         int             _type;
529         void    FilterCordinateXYZ(double &x,double &y,double &z);
530
531 // JSTG 25-02-08 -------------------------------------
532         //manualContourModel                            *_manContModel;
533 //----------------------------------------------------
534
535 };
536
537 // ----------------------------------------------------------------------------
538 // ----------------------------------------------------------------------------
539 // ----------------------------------------------------------------------------
540
541 class manualView3DContour: public manualViewContour
542 {
543 public:
544         manualView3DContour();
545         virtual ~manualView3DContour();
546         virtual manualView3DContour * Clone();
547         void CopyAttributesTo( manualView3DContour *cloneObject );
548
549         virtual void    TransfromeCoordViewWorld(double &X, double &Y, double &Z, int type);
550                         void    SetVtkMPRBaseData(vtkMPRBaseData *vtkmprbasedata);
551
552         virtual int             SelectPosiblePoint ( int x, int y, int z );     
553                         void    SetDimensions(int w, int h, int d);
554
555                         int             GetIdPoint2(int x, int y);
556
557 protected:
558         vtkMPRBaseData  *_vtkmprbasedata;
559 private:
560         int _w;
561         int _h;
562         int _d;
563
564 };
565
566
567 // ----------------------------------------------------------------------------
568 // ----------------------------------------------------------------------------
569 // ----------------------------------------------------------------------------
570
571
572 class creaMaracasVisu_EXPORT manualViewRoi: public manualViewBaseContour
573 {
574 public:
575         manualViewRoi();
576         virtual ~manualViewRoi();
577
578         virtual int GetType();
579         virtual manualViewRoi * Clone();
580         void CopyAttributesTo( manualViewRoi *cloneObject );
581
582         virtual void RefreshContour();
583         virtual bool ifTouchContour(int x,int y, int z);  
584         virtual void InitMove(int x, int y, int z);
585         virtual void MoveContour(int x, int y, int z);
586         void GetMinMax(double &minX,double &minY, double &maxX, double &maxY);
587
588 private:
589         double                          _dp0[3];
590         double                          _dp1[3];
591         double                          _dp2[3];
592         double                          _dp3[3];
593 };
594
595 // ----------------------------------------------------------------------------
596 // ----------------------------------------------------------------------------
597 // ----------------------------------------------------------------------------
598 class creaMaracasVisu_EXPORT manualViewBullEyeSector: public manualViewBaseContour
599 {
600 public:
601         manualViewBullEyeSector();
602         virtual void RefreshContour();
603 };
604
605
606
607 // ----------------------------------------------------------------------------
608 // ----------------------------------------------------------------------------
609 // ----------------------------------------------------------------------------
610 //EED004
611 class creaMaracasVisu_EXPORT manualViewBullEye: public manualViewRoi
612 {
613 public:
614         manualViewBullEye();
615         virtual ~manualViewBullEye();
616
617         virtual int GetType();
618         virtual manualViewBullEye * Clone();
619         void CopyAttributesTo( manualViewBullEye *cloneObject );
620
621 //      void UpdateColorActorBullEye();
622 //      void DeleteVtkObjectsBullEye();
623         virtual void RemoveSplineActor();
624         virtual void AddSplineActor();
625         virtual void ConstructVTKObjects();
626         virtual void RefreshContour(); 
627
628 private:
629
630 /*EED Borrame
631         std::vector<sectorBullEye* > lstSectorBullEye;
632 */
633
634         std::vector<manualViewBaseContour* > lstSectorBullEye;
635         
636 };
637
638
639 // ----------------------------------------------------------------------------
640 // ----------------------------------------------------------------------------
641 // ----------------------------------------------------------------------------
642
643 // EED08
644 class creaMaracasVisu_EXPORT manualViewCircle: public manualViewContour
645 {
646 public:
647         manualViewCircle();
648         virtual ~manualViewCircle();
649
650         virtual int GetType();
651         virtual manualViewCircle * Clone();
652         void CopyAttributesTo( manualViewCircle *cloneObject );
653
654 //      void RefreshContour();
655 //      virtual bool ifTouchContour(int x,int y, int z);  
656         virtual void InitMove(int x, int y, int z);
657         virtual void MoveContour(int x, int y, int z);
658         void GetMinMax(double &minX,double &minY, double &maxX, double &maxY);
659
660 private:
661         double                          _dp0[3];
662         double                          _dp1[3];
663 //      double                          _dp2[3];
664 //      double                          _dp3[3];
665 };
666
667
668 // ----------------------------------------------------------------------------
669 // ----------------------------------------------------------------------------
670 // ----------------------------------------------------------------------------
671
672 // AD:02-09
673 class creaMaracasVisu_EXPORT manualViewLine: public manualViewContour
674 {
675 public:
676         manualViewLine();
677         virtual ~manualViewLine();
678
679         virtual int GetType();
680         virtual manualViewLine * Clone();
681         void CopyAttributesTo( manualViewLine *cloneObject );
682
683 //      void RefreshContour();
684 //      virtual bool ifTouchContour(int x,int y, int z);  
685         virtual void InitMove(int x, int y, int z);
686         virtual void MoveContour(int x, int y, int z);
687
688 private:
689         double                          _dp0[3];
690         double                          _dp1[3];
691 //      double                          _dp2[3];
692 //      double                          _dp3[3];
693 };
694
695
696
697 // ----------------------------------------------------------------------------
698 // ----------------------------------------------------------------------------
699 // ----------------------------------------------------------------------------
700
701
702
703 class creaMaracasVisu_EXPORT manualContourBaseControler: public InteractorStyleMaracas
704 {
705 public:
706         manualContourBaseControler();
707         virtual ~manualContourBaseControler();
708
709         virtual manualContourBaseControler * Clone();
710         void CopyAttributesTo( manualContourBaseControler *cloneObject );
711
712         virtual bool  OnChar();
713         virtual bool  OnMouseMove();
714         virtual bool  OnLeftButtonDown(); 
715         virtual bool  OnLeftButtonUp();
716         virtual bool  OnLeftDClick();
717         virtual bool  OnMiddleButtonDown(); 
718         virtual bool  OnMiddleButtonUp();
719         virtual bool  OnRightButtonDown();
720         virtual bool  OnRightButtonUp();
721
722         void    SetModelView(manualContourModel *manContModel, manualViewBaseContour *manViewBaseCont);
723         manualContourModel              * GetManualContourModel();
724         manualViewBaseContour   * GetManualViewBaseContour();
725
726
727         virtual void    MouseClickLeft(int x, int y);
728         virtual void    MouseClickRight(int x, int y);
729         virtual void    MouseDLeft(int x, int y);
730
731         virtual void    MouseMove(int x, int y);
732         virtual void    MouseReleaseLeft(int x, int y);
733
734         void    SetState(int state);
735         int             GetState();
736         bool    IsEditable();
737         void    SetEditable(  bool condition  );
738         bool    GetPosibleToMove();
739         void    SetPosibleToMove(  bool condition  );
740         bool    IsMoving();
741         void    SetMoving(  bool condition  );
742         void    SetCompleteCreation( bool condition );
743         bool    GetIfCompleteCreation ( );
744         void    SetKeyBoardMoving( bool condition );
745         bool    GetKeyBoardMoving(  );
746         
747         void    CreateNewManualContour();
748         int             GetNumberOfPointsManualContour();
749         int             GetNumberOfPointsSplineManualContour();
750         void    DeleteContour();
751         virtual void    DeleteActualMousePoint(int x, int y );
752         double* GetVectorPointsXManualContour();
753         double* GetVectorPointsYManualContour();
754         
755
756         void    SetZ(int z);
757         virtual int             GetZ();
758
759         virtual void    AddPoint(int x, int y, int z);
760         virtual void    InsertPoint(int x, int y, int z);
761
762         virtual void    SetPoint(       int id ,int x ,int y ,int z);
763                         void    SetPointX(      int id ,int x );
764                         void    SetPointY(      int id ,int y );
765                         void    SetPointZ(      int id ,int z );
766
767                         void    Magnet(int x, int y);
768         virtual void    ResetContour();
769
770         virtual void Configure();
771
772
773 //EED Borrame
774 //      virtual manualContourBaseControler * Clone( manualViewBaseContour * cloneView = NULL, manualContourModel * cloneModel = NULL );
775
776
777 private:
778         manualViewBaseContour   *_manViewBaseCont;
779         manualContourModel              *_manContModel;
780
781         int                                             _z;
782         int                                             _state;
783         bool                                    _editable;      
784         bool                                    _posibleToMove;
785         bool                                    _moving;
786         bool                                    _created;
787         bool                                    _keyBoardMoving;
788                 
789 }; 
790
791
792
793
794 // ----------------------------------------------------------------------------
795 // ----------------------------------------------------------------------------
796 // ----------------------------------------------------------------------------
797
798
799 class creaMaracasVisu_EXPORT manualContourControler: public manualContourBaseControler
800 {
801 public:
802         manualContourControler();
803         virtual ~manualContourControler();
804         virtual manualContourControler * Clone();
805         void CopyAttributesTo( manualContourControler *cloneObject );
806
807         virtual void    MouseClickLeft(int x, int y);
808         virtual void    MouseMove(int x, int y);
809         virtual void    MouseDLeft( int x, int y);              
810         void SetEasyCreation(bool easyCreation);
811         bool GetEasyCreation();
812
813         virtual void Configure();
814
815 protected:
816         int             _bakIdPoint;
817 private:
818         bool    _easyCreation;
819 };
820
821 // ----------------------------------------------------------------------------
822 // ----------------------------------------------------------------------------
823 // ----------------------------------------------------------------------------
824
825
826
827
828 class creaMaracasVisu_EXPORT manualContour3VControler:  public manualContourControler
829 {
830 public:
831         manualContour3VControler(int type);
832         virtual ~manualContour3VControler();
833         virtual manualContour3VControler * Clone();
834         void CopyAttributesTo( manualContour3VControler *cloneObject );
835
836         virtual bool    OnChar();       
837         virtual void    AddPoint(int x, int y, int z);
838         virtual void    InsertPoint(int x, int y, int z);
839         virtual void    MouseMove(int x, int y);
840         virtual void    ResetContour();
841
842         void AddManualViewBaseContour( manualViewBaseContour *manViewBaseCont );
843
844         vtkMPRBaseData  *GetVtkMPRBaseData();
845                         void    SetVtkMPRBaseData (vtkMPRBaseData *vtkmprbasedata );
846         virtual void    SetPoint( int id ,int x ,int y ,int z );
847
848         virtual void    DeleteActualMousePoint(int x, int y);
849
850                         void    AddPoint_Others();
851                         void    DeleteActualMousePoint_Others(int id);
852                         void    MouseMove_Others(int id);
853                         void    InsertPoint_Others(int id);
854                         void    OnChar_Others();
855                         void    ResetContour_Others();
856                         int             GetType();
857
858 private:
859         int _type;
860
861         vtkMPRBaseData            *_vtkmprbasedata; 
862
863         std::vector< manualViewBaseContour* > _lstManualViewBaseContour;
864 };
865
866
867 // ----------------------------------------------------------------------------
868 // ----------------------------------------------------------------------------
869 // ----------------------------------------------------------------------------
870
871
872 class creaMaracasVisu_EXPORT manualContour3DControler:  public manualContourControler
873 {
874 public:
875         manualContour3DControler();
876         virtual ~manualContour3DControler();
877         virtual manualContour3DControler * Clone();
878         void CopyAttributesTo( manualContour3DControler *cloneObject );
879
880         virtual bool OnLeftButtonDown(); 
881         virtual bool OnChar(); 
882         virtual void InsertPoint(int x, int y, int z);
883         virtual void MouseClickLeft(int x, int y);
884                         void ResetOrientationPlane();
885
886         vtkMPRBaseData  *GetVtkMPRBaseData();
887                         void    SetVtkMPRBaseData (vtkMPRBaseData *vtkmprbasedata );
888
889
890 protected:
891 private:
892         vtkMPRBaseData *_vtkmprbasedata; 
893
894 };
895
896
897 // ----------------------------------------------------------------------------
898 // ----------------------------------------------------------------------------
899 // ----------------------------------------------------------------------------
900
901 class creaMaracasVisu_EXPORT manualContour3V3DControler: public manualContour3DControler
902 {
903 public:
904         manualContour3V3DControler();
905         virtual ~manualContour3V3DControler();
906         virtual manualContour3V3DControler * Clone();
907         void CopyAttributesTo( manualContour3V3DControler *cloneObject );
908
909         void SetManualContour3VControler(manualContour3VControler *manualcontour3Vcontroler);
910         manualContour3VControler *GetManualContour3VControler();
911
912         virtual bool OnChar();
913         virtual void AddPoint( int x, int y, int z );
914         virtual void DeleteActualMousePoint(int x, int y);
915         virtual void MouseMove(int x, int y);
916         virtual void InsertPoint(int x, int y, int z);
917         virtual void ResetContour();
918
919
920 protected:
921 private:
922         manualContour3VControler        *_manualcontour3Vcontroler;
923
924 };
925
926 // ----------------------------------------------------------------------------
927 // ----------------------------------------------------------------------------
928 // ----------------------------------------------------------------------------
929
930 class creaMaracasVisu_EXPORT manualContourPerpPlaneControler: public manualContourControler
931 {
932 public:
933         manualContourPerpPlaneControler();
934         virtual ~manualContourPerpPlaneControler();
935     virtual manualContourPerpPlaneControler * Clone();
936         void CopyAttributesTo( manualContourPerpPlaneControler *cloneObject );
937
938         void SetVtkMPRBaseData(vtkMPRBaseData *vtkmprbasedata);
939         vtkMPRBaseData *GetVtkMPRBaseData();
940
941         virtual bool OnChar();
942         virtual bool OnMouseMove();
943         virtual bool OnLeftDClick(); 
944         virtual void AddPoint( int x, int y, int z );
945         virtual void DeleteActualMousePoint(int x, int y);
946         virtual void MouseMove(int x, int y);
947         virtual void InsertPoint(int x, int y, int z);
948         virtual void ResetContour();
949
950                         void SetManualContour3VControler(manualContour3VControler *manualcontour3Vcontroler);
951                         manualContour3VControler *GetManualContour3VControler();
952
953         virtual void MouseDLeft( int x, int y);
954                         void ResetOrientationPlane();
955                         void SetVtkInteractorStylePlane2D(InteractorStyleMaracas *vtkinteractorstyleplane2D);
956                         InteractorStyleMaracas * GetVtkInteractorStylePlane2D();
957
958 private:
959         bool                                            _flagMouseMove;
960         bool                                            _flagMouseDClick;
961         InteractorStyleMaracas          *_vtkinteractorstyleplane2D;
962
963 protected:
964         vtkMPRBaseData                          *_vtkmprbasedata;
965         manualContour3VControler        *_manualcontour3Vcontroler;
966 };
967
968 // ----------------------------------------------------------------------------
969 // ----------------------------------------------------------------------------
970 // ----------------------------------------------------------------------------
971
972
973 class creaMaracasVisu_EXPORT manualRoiControler: public manualContourBaseControler
974 {
975 public:
976         manualRoiControler();
977         virtual ~manualRoiControler();
978         virtual manualRoiControler * Clone();
979         void CopyAttributesTo( manualRoiControler *cloneObject );
980
981         virtual void MouseClickLeft(int x, int y);
982         virtual void MouseMove(int x, int y );
983         virtual void DeleteActualMousePoint(int x, int y);
984                         void InitRoi(int ww, int hh, double porcentage);
985                         void SetRoi(int x1, int y1,int x2, int y2);
986         virtual void Configure();
987
988
989 private:
990         int                                     bakIdPoint;
991 };
992
993 // ----------------------------------------------------------------------------
994 // ----------------------------------------------------------------------------
995 // ----------------------------------------------------------------------------
996
997 // EED08
998 class creaMaracasVisu_EXPORT manualCircleControler: public manualContourControler
999 {
1000 public:
1001         manualCircleControler();
1002         virtual ~manualCircleControler();
1003         virtual manualCircleControler * Clone();
1004         void CopyAttributesTo( manualCircleControler *cloneObject );
1005
1006         virtual void MouseClickLeft(int x, int y);
1007         virtual void MouseMove(int x, int y );
1008         virtual void DeleteActualMousePoint(int x, int y);
1009                         void InitRoi(int ww, int hh, double porcentage);
1010 //                      void SetRoi(int x1, int y1,int x2, int y2);
1011         virtual void Configure();
1012
1013
1014 private:
1015         int                                     bakIdPoint;
1016 };
1017
1018
1019 // ----------------------------------------------------------------------------
1020 // ----------------------------------------------------------------------------
1021 // ----------------------------------------------------------------------------
1022
1023 // AD:02-09
1024 class creaMaracasVisu_EXPORT manualLineControler: public manualContourControler
1025 {
1026 public:
1027         manualLineControler();
1028         virtual ~manualLineControler();
1029         virtual manualLineControler * Clone();
1030         void CopyAttributesTo( manualLineControler *cloneObject );
1031
1032         virtual void MouseClickLeft(int x, int y);
1033         virtual void MouseMove(int x, int y );
1034         virtual void DeleteActualMousePoint(int x, int y);
1035                         void InitRoi(int ww, int hh, double porcentage);
1036
1037
1038
1039 private:
1040         int                                     bakIdPoint;
1041 };
1042
1043
1044
1045
1046 #endif // MANUAL_CONTOUR_H
1047