]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/manualContour.h
BUG interaction ROI-creation line, rectangle, circle,
[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         virtual void InitMove(int x, int y, int z);
655         virtual void MoveContour(int x, int y, int z);
656         void GetMinMax(double &minX,double &minY, double &maxX, double &maxY);
657
658 private:
659         double                          _dp0[3];
660         double                          _dp1[3];
661 };
662
663
664 // ----------------------------------------------------------------------------
665 // ----------------------------------------------------------------------------
666 // ----------------------------------------------------------------------------
667
668 // AD:02-09
669 class creaMaracasVisu_EXPORT manualViewLine: public manualViewContour
670 {
671 public:
672         manualViewLine();
673         virtual ~manualViewLine();
674
675         virtual int GetType();
676         virtual manualViewLine * Clone();
677         void CopyAttributesTo( manualViewLine *cloneObject );
678
679         virtual void InitMove(int x, int y, int z);
680         virtual void MoveContour(int x, int y, int z);
681
682 private:
683         double                          _dp0[3];
684         double                          _dp1[3];
685 };
686
687
688
689 // ----------------------------------------------------------------------------
690 // ----------------------------------------------------------------------------
691 // ----------------------------------------------------------------------------
692
693
694
695 class creaMaracasVisu_EXPORT manualContourBaseControler: public InteractorStyleMaracas
696 {
697 public:
698         manualContourBaseControler();
699         virtual ~manualContourBaseControler();
700
701         virtual manualContourBaseControler * Clone();
702         void CopyAttributesTo( manualContourBaseControler *cloneObject );
703
704         virtual bool  OnChar();
705         virtual bool  OnMouseMove();
706         virtual bool  OnLeftButtonDown(); 
707         virtual bool  OnLeftButtonUp();
708         virtual bool  OnLeftDClick();
709         virtual bool  OnMiddleButtonDown(); 
710         virtual bool  OnMiddleButtonUp();
711         virtual bool  OnRightButtonDown();
712         virtual bool  OnRightButtonUp();
713
714         void    SetModelView(manualContourModel *manContModel, manualViewBaseContour *manViewBaseCont);
715         manualContourModel              * GetManualContourModel();
716         manualViewBaseContour   * GetManualViewBaseContour();
717
718
719         virtual void    MouseClickLeft(int x, int y);
720         virtual void    MouseClickRight(int x, int y);
721         virtual void    MouseDLeft(int x, int y);
722
723         virtual void    MouseMove(int x, int y);
724         virtual void    MouseReleaseLeft(int x, int y);
725
726         void    SetState(int state);
727         int             GetState();
728         bool    IsEditable();
729         void    SetEditable(  bool condition  );
730         bool    GetPosibleToMove();
731         void    SetPosibleToMove(  bool condition  );
732         bool    IsMoving();
733         void    SetMoving(  bool condition  );
734         void    SetCompleteCreation( bool condition );
735         bool    GetIfCompleteCreation ( );
736         void    SetKeyBoardMoving( bool condition );
737         bool    GetKeyBoardMoving(  );
738         
739         void    CreateNewManualContour();
740         int             GetNumberOfPointsManualContour();
741         int             GetNumberOfPointsSplineManualContour();
742         void    DeleteContour();
743         virtual void    DeleteActualMousePoint(int x, int y );
744         double* GetVectorPointsXManualContour();
745         double* GetVectorPointsYManualContour();
746         
747
748         void    SetZ(int z);
749         virtual int             GetZ();
750
751         virtual void    AddPoint(int x, int y, int z);
752         virtual void    InsertPoint(int x, int y, int z);
753
754         virtual void    SetPoint(       int id ,int x ,int y ,int z);
755                         void    SetPointX(      int id ,int x );
756                         void    SetPointY(      int id ,int y );
757                         void    SetPointZ(      int id ,int z );
758
759                         void    Magnet(int x, int y);
760         virtual void    ResetContour();
761
762         virtual void Configure();
763
764
765 //EED Borrame
766 //      virtual manualContourBaseControler * Clone( manualViewBaseContour * cloneView = NULL, manualContourModel * cloneModel = NULL );
767
768
769 private:
770         manualViewBaseContour   *_manViewBaseCont;
771         manualContourModel              *_manContModel;
772
773         int                                             _z;
774         int                                             _state;
775         bool                                    _editable;      
776         bool                                    _posibleToMove;
777         bool                                    _moving;
778         bool                                    _created;
779         bool                                    _keyBoardMoving;
780                 
781 }; 
782
783
784
785
786 // ----------------------------------------------------------------------------
787 // ----------------------------------------------------------------------------
788 // ----------------------------------------------------------------------------
789
790
791 class creaMaracasVisu_EXPORT manualContourControler: public manualContourBaseControler
792 {
793 public:
794         manualContourControler();
795         virtual ~manualContourControler();
796         virtual manualContourControler * Clone();
797         void CopyAttributesTo( manualContourControler *cloneObject );
798
799         virtual void    MouseClickLeft(int x, int y);
800         virtual void    MouseMove(int x, int y);
801         virtual void    MouseDLeft( int x, int y);              
802         void SetEasyCreation(bool easyCreation);
803         bool GetEasyCreation();
804
805         virtual void Configure();
806
807 protected:
808         int             _bakIdPoint;
809 private:
810         bool    _easyCreation;
811 };
812
813 // ----------------------------------------------------------------------------
814 // ----------------------------------------------------------------------------
815 // ----------------------------------------------------------------------------
816
817
818
819
820 class creaMaracasVisu_EXPORT manualContour3VControler:  public manualContourControler
821 {
822 public:
823         manualContour3VControler(int type);
824         virtual ~manualContour3VControler();
825         virtual manualContour3VControler * Clone();
826         void CopyAttributesTo( manualContour3VControler *cloneObject );
827
828         virtual bool    OnChar();       
829         virtual void    AddPoint(int x, int y, int z);
830         virtual void    InsertPoint(int x, int y, int z);
831         virtual void    MouseMove(int x, int y);
832         virtual void    ResetContour();
833
834         void AddManualViewBaseContour( manualViewBaseContour *manViewBaseCont );
835
836         vtkMPRBaseData  *GetVtkMPRBaseData();
837                         void    SetVtkMPRBaseData (vtkMPRBaseData *vtkmprbasedata );
838         virtual void    SetPoint( int id ,int x ,int y ,int z );
839
840         virtual void    DeleteActualMousePoint(int x, int y);
841
842                         void    AddPoint_Others();
843                         void    DeleteActualMousePoint_Others(int id);
844                         void    MouseMove_Others(int id);
845                         void    InsertPoint_Others(int id);
846                         void    OnChar_Others();
847                         void    ResetContour_Others();
848                         int             GetType();
849
850 private:
851         int _type;
852
853         vtkMPRBaseData            *_vtkmprbasedata; 
854
855         std::vector< manualViewBaseContour* > _lstManualViewBaseContour;
856 };
857
858
859 // ----------------------------------------------------------------------------
860 // ----------------------------------------------------------------------------
861 // ----------------------------------------------------------------------------
862
863
864 class creaMaracasVisu_EXPORT manualContour3DControler:  public manualContourControler
865 {
866 public:
867         manualContour3DControler();
868         virtual ~manualContour3DControler();
869         virtual manualContour3DControler * Clone();
870         void CopyAttributesTo( manualContour3DControler *cloneObject );
871
872         virtual bool OnLeftButtonDown(); 
873         virtual bool OnChar(); 
874         virtual void InsertPoint(int x, int y, int z);
875         virtual void MouseClickLeft(int x, int y);
876                         void ResetOrientationPlane();
877
878         vtkMPRBaseData  *GetVtkMPRBaseData();
879                         void    SetVtkMPRBaseData (vtkMPRBaseData *vtkmprbasedata );
880
881
882 protected:
883 private:
884         vtkMPRBaseData *_vtkmprbasedata; 
885
886 };
887
888
889 // ----------------------------------------------------------------------------
890 // ----------------------------------------------------------------------------
891 // ----------------------------------------------------------------------------
892
893 class creaMaracasVisu_EXPORT manualContour3V3DControler: public manualContour3DControler
894 {
895 public:
896         manualContour3V3DControler();
897         virtual ~manualContour3V3DControler();
898         virtual manualContour3V3DControler * Clone();
899         void CopyAttributesTo( manualContour3V3DControler *cloneObject );
900
901         void SetManualContour3VControler(manualContour3VControler *manualcontour3Vcontroler);
902         manualContour3VControler *GetManualContour3VControler();
903
904         virtual bool OnChar();
905         virtual void AddPoint( int x, int y, int z );
906         virtual void DeleteActualMousePoint(int x, int y);
907         virtual void MouseMove(int x, int y);
908         virtual void InsertPoint(int x, int y, int z);
909         virtual void ResetContour();
910
911
912 protected:
913 private:
914         manualContour3VControler        *_manualcontour3Vcontroler;
915
916 };
917
918 // ----------------------------------------------------------------------------
919 // ----------------------------------------------------------------------------
920 // ----------------------------------------------------------------------------
921
922 class creaMaracasVisu_EXPORT manualContourPerpPlaneControler: public manualContourControler
923 {
924 public:
925         manualContourPerpPlaneControler();
926         virtual ~manualContourPerpPlaneControler();
927     virtual manualContourPerpPlaneControler * Clone();
928         void CopyAttributesTo( manualContourPerpPlaneControler *cloneObject );
929
930         void SetVtkMPRBaseData(vtkMPRBaseData *vtkmprbasedata);
931         vtkMPRBaseData *GetVtkMPRBaseData();
932
933         virtual bool OnChar();
934         virtual bool OnMouseMove();
935         virtual bool OnLeftDClick(); 
936         virtual void AddPoint( int x, int y, int z );
937         virtual void DeleteActualMousePoint(int x, int y);
938         virtual void MouseMove(int x, int y);
939         virtual void InsertPoint(int x, int y, int z);
940         virtual void ResetContour();
941
942                         void SetManualContour3VControler(manualContour3VControler *manualcontour3Vcontroler);
943                         manualContour3VControler *GetManualContour3VControler();
944
945         virtual void MouseDLeft( int x, int y);
946                         void ResetOrientationPlane();
947                         void SetVtkInteractorStylePlane2D(InteractorStyleMaracas *vtkinteractorstyleplane2D);
948                         InteractorStyleMaracas * GetVtkInteractorStylePlane2D();
949
950 private:
951         bool                                            _flagMouseMove;
952         bool                                            _flagMouseDClick;
953         InteractorStyleMaracas          *_vtkinteractorstyleplane2D;
954
955 protected:
956         vtkMPRBaseData                          *_vtkmprbasedata;
957         manualContour3VControler        *_manualcontour3Vcontroler;
958 };
959
960 // ----------------------------------------------------------------------------
961 // ----------------------------------------------------------------------------
962 // ----------------------------------------------------------------------------
963
964
965 class creaMaracasVisu_EXPORT manualRoiControler: public manualContourControler
966 {
967 public:
968         manualRoiControler();
969         virtual ~manualRoiControler();
970         virtual manualRoiControler * Clone();
971         void CopyAttributesTo( manualRoiControler *cloneObject );
972
973         virtual void MouseClickLeft(int x, int y);
974         virtual void MouseMove(int x, int y );
975         virtual void DeleteActualMousePoint(int x, int y);
976                         void InitRoi(int ww, int hh, double porcentage);
977                         void SetRoi(int x1, int y1,int x2, int y2);
978         virtual void Configure();
979
980
981 private:
982         int                                     bakIdPoint;
983 };
984
985 // ----------------------------------------------------------------------------
986 // ----------------------------------------------------------------------------
987 // ----------------------------------------------------------------------------
988
989 // EED08
990 class creaMaracasVisu_EXPORT manualCircleControler: public manualContourControler
991 {
992 public:
993         manualCircleControler();
994         virtual ~manualCircleControler();
995         virtual manualCircleControler * Clone();
996         void CopyAttributesTo( manualCircleControler *cloneObject );
997
998         virtual void MouseClickLeft(int x, int y);
999         virtual void MouseMove(int x, int y );
1000         virtual void DeleteActualMousePoint(int x, int y);
1001                         void InitRoi(int ww, int hh, double porcentage);
1002 //                      void SetRoi(int x1, int y1,int x2, int y2);
1003         virtual void Configure();
1004
1005
1006 private:
1007         int                                     bakIdPoint;
1008 };
1009
1010
1011 // ----------------------------------------------------------------------------
1012 // ----------------------------------------------------------------------------
1013 // ----------------------------------------------------------------------------
1014
1015 // AD:02-09
1016 class creaMaracasVisu_EXPORT manualLineControler: public manualContourControler
1017 {
1018 public:
1019         manualLineControler();
1020         virtual ~manualLineControler();
1021         virtual manualLineControler * Clone();
1022         void CopyAttributesTo( manualLineControler *cloneObject );
1023
1024         virtual void MouseClickLeft(int x, int y);
1025         virtual void MouseMove(int x, int y );
1026         virtual void DeleteActualMousePoint(int x, int y);
1027                         void InitRoi(int ww, int hh, double porcentage);
1028
1029
1030
1031 private:
1032         int                                     bakIdPoint;
1033 };
1034
1035
1036
1037
1038 #endif // MANUAL_CONTOUR_H
1039