Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkSegmentationConverterFactory.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
4  Queen's University, Kingston, ON, Canada. All Rights Reserved.
5 
6  See COPYRIGHT.txt
7  or http://www.slicer.org/copyright/copyright.txt for details.
8 
9  Unless required by applicable law or agreed to in writing, software
10  distributed under the License is distributed on an "AS IS" BASIS,
11  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  See the License for the specific language governing permissions and
13  limitations under the License.
14 
15  This file was originally developed by Andras Lasso, PerkLab, Queen's University
16  and was supported through the Applied Cancer Research Unit program of Cancer Care
17  Ontario with funds provided by the Ontario Ministry of Health and Long-Term Care
18 
19 ==============================================================================*/
20 
21 #ifndef __vtkSegmentationConverterFactory_h
22 #define __vtkSegmentationConverterFactory_h
23 
24 #include "vtkSegmentationCoreConfigure.h"
25 
26 // VTK includes
27 #include <vtkObject.h>
28 #include <vtkSmartPointer.h>
29 
30 // STD includes
31 #include <vector>
32 
34 class vtkDataObject;
35 
41 class vtkSegmentationCore_EXPORT vtkSegmentationConverterFactory : public vtkObject
42 {
43 public:
44  typedef std::vector< vtkSmartPointer<vtkSegmentationConverterRule> > RuleListType;
45 
46  vtkTypeMacro(vtkSegmentationConverterFactory, vtkObject);
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
52  void CopyConverterRules(RuleListType &rules);
53 
57  void RegisterConverterRule(vtkSegmentationConverterRule* rule);
58 
61  void UnregisterConverterRule(vtkSegmentationConverterRule* rule);
62 
64  const RuleListType& GetConverterRules();
65 
69  bool DisableConverterRule(std::string sourceRepresentationName, std::string targetRepresentationName);
70 
73  void DisableRepresentation(std::string representationName);
74 
78  vtkDataObject* ConstructRepresentationObjectByClass(std::string className);
79 
83  vtkDataObject* ConstructRepresentationObjectByRepresentation(std::string representationName);
84 
85 public:
87  static vtkSegmentationConverterFactory* GetInstance();
88 
94  static vtkSegmentationConverterFactory* New();
95 
96 protected:
100  void operator=(const vtkSegmentationConverterFactory&);
101 
102  // Singleton management functions.
103  static void classInitialize();
104  static void classFinalize();
105 
108 
111 };
112 
114 class vtkSegmentationCore_EXPORT vtkSegmentationConverterFactoryInitialize
115 {
116 public:
118 
121 private:
122  static unsigned int Count;
123 };
124 
129 
130 #endif
RuleListType Rules
Registered converter rules.
static vtkSegmentationConverterFactoryInitialize vtkSegmentationConverterFactoryInitializer
Abstract converter rule class. Subclasses perform conversions between specific representation types...
Class that can create vtkSegmentationConverter instances.
vtkSegmentationConverterFactoryInitialize Self
Utility class to make sure qSlicerModuleManager is initialized before it is used. ...
std::vector< vtkSmartPointer< vtkSegmentationConverterRule > > RuleListType