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