]> Creatis software - clitk.git/blob - vv/vvStructureSetActor.cxx
Reformatted using new coding style
[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 //------------------------------------------------------------------------------
31 vvStructureSetActor::~vvStructureSetActor()
32 {
33 }
34 //------------------------------------------------------------------------------
35
36
37 //------------------------------------------------------------------------------
38 void vvStructureSetActor::SetStructureSet(clitk::DicomRT_StructureSet * s)
39 {
40   mStructureSet = s;
41 }
42 //------------------------------------------------------------------------------
43
44
45 //------------------------------------------------------------------------------
46 void vvStructureSetActor::SetSlicerManager(vvSlicerManager * s)
47 {
48   mSlicerManager = s;
49 }
50 //------------------------------------------------------------------------------
51
52
53 //------------------------------------------------------------------------------
54 vvROIActor * vvStructureSetActor::GetROIActor(int n)
55 {
56   if (mMapROIIndex.find(n) == mMapROIIndex.end()) {
57     std::cerr << "No ROI number " << n << std::endl;
58     return NULL;
59   }
60   return mROIActors[mMapROIIndex[n]];
61 }
62 //------------------------------------------------------------------------------
63
64
65 //------------------------------------------------------------------------------
66 void vvStructureSetActor::CreateNewROIActor(int n)
67 {
68   // Check
69   clitk::DicomRT_ROI * roi = mStructureSet->GetROI(n);
70   if (roi == NULL) {
71     std::cerr << "Error. No ROI number " << n << std::endl;
72     exit(0);
73   }
74
75   // Add ROI Actors
76   vvROIActor * actor = new vvROIActor;
77   mROIActors.push_back(actor);
78   actor->SetROI(roi);
79   actor->SetSlicerManager(mSlicerManager);
80   actor->Initialize();
81   mMapROIIndex[n] = mROIActors.size()-1;
82
83   //  actor->Update();
84 }
85 //------------------------------------------------------------------------------
86
87