]> Creatis software - clitk.git/blob - vv/vvStructureSetActor.cxx
- bug corrected
[clitk.git] / vv / vvStructureSetActor.cxx
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ======================================================================-====*/
18
19 #include "vvStructureSetActor.h"
20 #include "vvROIActor.h"
21
22 //------------------------------------------------------------------------------
23 vvStructureSetActor::vvStructureSetActor() {
24
25 }
26 //------------------------------------------------------------------------------
27
28
29 //------------------------------------------------------------------------------
30 vvStructureSetActor::~vvStructureSetActor() {
31 }
32 //------------------------------------------------------------------------------
33
34
35 //------------------------------------------------------------------------------
36 void vvStructureSetActor::SetStructureSet(clitk::DicomRT_StructureSet * s) {
37   mStructureSet = s;
38 }
39 //------------------------------------------------------------------------------
40
41
42 //------------------------------------------------------------------------------
43 void vvStructureSetActor::SetSlicerManager(vvSlicerManager * s) {
44   mSlicerManager = s;
45 }
46 //------------------------------------------------------------------------------
47
48
49 //------------------------------------------------------------------------------
50 vvROIActor * vvStructureSetActor::GetROIActor(int n) {
51   DD(n);
52   if (mMapROIIndex.find(n) == mMapROIIndex.end()) {
53     std::cerr << "No ROI number " << n << std::endl;
54     return NULL;    
55   }
56   DD(mMapROIIndex[n]);
57   return mROIActors[mMapROIIndex[n]];
58 }
59 //------------------------------------------------------------------------------
60
61
62 //------------------------------------------------------------------------------
63 void vvStructureSetActor::CreateNewROIActor(int n) {
64   DD("AddROIActor");
65   DD(n);
66
67   // Check
68   const clitk::DicomRT_ROI * roi = mStructureSet->GetROI(n);
69   if (roi == NULL) {
70     std::cerr << "Error. No ROI number " << n << std::endl;
71     exit(0);
72   }
73
74   // Add ROI Actors
75   vvROIActor * actor = new vvROIActor;
76   mROIActors.push_back(actor);
77   actor->SetROI(roi);
78   actor->SetSlicerManager(mSlicerManager);
79   actor->Initialize();
80   mMapROIIndex[n] = mROIActors.size()-1;
81
82   //  actor->Update();
83 }
84 //------------------------------------------------------------------------------
85
86