]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBullEye.cpp
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / manualContour / manualViewBullEye.cpp
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 #include "manualViewBullEye.h"
27
28 // ----------------------------------------------------------------------------
29 // ----------------------------------------------------------------------------
30 // ----------------------------------------------------------------------------
31
32 manualViewBullEye::manualViewBullEye()
33 {
34 }
35
36 // ----------------------------------------------------------------------------
37 manualViewBullEye::~manualViewBullEye()
38 {
39         // BullEye(s)
40         int i,size=lstSectorBullEye.size();
41         for (i=0;i<size;i++)
42         {
43                 delete lstSectorBullEye[i];
44         }
45         lstSectorBullEye.clear();
46 }
47
48
49 // ----------------------------------------------------------------------------
50 manualViewBullEye * manualViewBullEye :: Clone()
51 {
52         manualViewBullEye * clone = new manualViewBullEye();
53         CopyAttributesTo(clone);
54         return clone;
55 }
56
57 // ---------------------------------------------------------------------------
58
59 void manualViewBullEye::CopyAttributesTo( manualViewBullEye * cloneObject)
60 {
61         // Fathers object
62         manualViewBaseContour::CopyAttributesTo(cloneObject);
63 }
64
65
66 // ----------------------------------------------------------------------------
67 int manualViewBullEye::GetType() // virtual
68 {
69         return 4;
70 }
71
72
73 // ----------------------------------------------------------------------------
74 void manualViewBullEye::RefreshContour() // virtual
75 {
76         // External Rectangle
77         manualViewRoi::RefreshContour();
78
79         _manContModel->UpdateSpline();
80     int np      = GetNumberOfPoints( );
81         // Refres sectors of BullEye(s)
82
83         if (np>=2  )
84         {
85                 int i,size = lstSectorBullEye.size();
86                 for (i=0;i<size;i++)
87                 {
88                         lstSectorBullEye[i]->RefreshContour();
89                 } // for
90         } // if
91
92
93 }
94
95 // ----------------------------------------------------------------------------
96 void manualViewBullEye::ConstructVTKObjects() // virtual
97 {
98         manualViewRoi::ConstructVTKObjects();
99
100         double spc[3];
101         this->GetSpacing(spc);
102         manualViewBullEyeSector *mvbc;
103         manualContourModelBullEye *mcmbe = (manualContourModelBullEye*)this->_manContModel;
104         int i,size = mcmbe->GetSizeOfSectorLst();
105         for ( i=0 ; i<size ; i++ )
106         {
107                 mvbc = new manualViewBullEyeSector();
108                 mvbc->SetModel( mcmbe->GetModelSector(i) );
109                 mvbc->SetWxVtkBaseView( this->GetWxVtkBaseView()  );
110                 mvbc->SetRange( 2 );
111                 mvbc->SetZ( 1000 );
112                 mvbc->SetSpacing(spc);
113                 mvbc->SetColorNormalContour(1, 0, 0);
114 //              mvbc->SetColorEditContour(0.5, 0.5, 0.5);
115 //              mvbc->SetColorSelectContour(1, 0.8, 0);
116                 mvbc->SetWidthLine( this->GetWidthLine()  );
117 //EED004
118                 mvbc->ConstructVTKObjects();
119                 lstSectorBullEye.push_back( mvbc );
120         }
121
122
123 }
124
125 // ----------------------------------------------------------------------------
126 void manualViewBullEye::AddSplineActor()  // virtual
127 {
128         manualViewRoi::AddSplineActor();
129         int i,size=lstSectorBullEye.size();
130         for (i=0;i<size;i++)
131         {
132                 lstSectorBullEye[i]->AddSplineActor();
133         }
134 }
135
136 // ----------------------------------------------------------------------------
137 void manualViewBullEye::RemoveSplineActor()  // virtual
138 {
139         manualViewRoi::RemoveSplineActor();
140         int i,size=lstSectorBullEye.size();
141         for (i=0;i<size;i++)
142         {
143                 lstSectorBullEye[i]->RemoveSplineActor();
144         }
145 }