Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkTubeGraphObjectFactory.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 
19 #include <mitkBaseRenderer.h>
20 #include <mitkDataNode.h>
21 #include <mitkProperties.h>
22 
23 #include "mitkTubeGraph.h"
25 
27 {
28  static bool alreadyDone = false;
29  if (!alreadyDone)
30  {
31  MITK_INFO << "TubeGraphObjectFactory c'tor" << std::endl;
32  CreateFileExtensionsMap();
33 
34  alreadyDone = true;
35  }
36 }
37 
39 {
40  mitk::Mapper::Pointer newMapper = NULL;
41 
43  {
44  if ((dynamic_cast<mitk::TubeGraph *>(node->GetData()) != NULL))
45  {
46  newMapper = mitk::TubeGraphVtkMapper3D::New();
47  newMapper->SetDataNode(node);
48  }
49  }
50 
51  return newMapper;
52 }
53 
55 {
56  if ((dynamic_cast<mitk::TubeGraph *>(node->GetData()) != NULL))
57  {
58  node->SetProperty("Tube Graph.Clip Structures", mitk::BoolProperty::New(false));
60  }
61 }
62 
64 {
65  std::string fileExtension;
66  this->CreateFileExtensions(m_FileExtensionsMap, fileExtension);
67  return fileExtension.c_str();
68 };
69 
71 {
72  return m_FileExtensionsMap;
73 }
74 
76 {
77  std::string fileExtension;
78  this->CreateFileExtensions(m_SaveFileExtensionsMap, fileExtension);
79  return fileExtension.c_str();
80 };
81 
83 {
84  return m_SaveFileExtensionsMap;
85 }
86 
87 void mitk::TubeGraphObjectFactory::CreateFileExtensionsMap()
88 {
89 }
90 
91 struct RegisterTubeGraphObjectFactory
92 {
93  RegisterTubeGraphObjectFactory() : m_Factory(mitk::TubeGraphObjectFactory::New())
94  {
95  mitk::CoreObjectFactory::GetInstance()->RegisterExtraFactory(m_Factory);
96  }
97  ~RegisterTubeGraphObjectFactory() { mitk::CoreObjectFactory::GetInstance()->UnRegisterExtraFactory(m_Factory); }
99 };
100 
101 static RegisterTubeGraphObjectFactory registerTubeGraphObjectFactory;
static RegisterTubeGraphObjectFactory registerTubeGraphObjectFactory
#define MITK_INFO
Definition: mitkLogMacros.h:22
virtual mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap() override
virtual mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap() override
DataCollection - Class to facilitate loading/accessing structured data.
virtual const char * GetFileExtensions() override
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
virtual Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override
static Pointer New()
virtual const char * GetSaveFileExtensions() override
virtual void SetDefaultProperties(mitk::DataNode *node) override
void SetProperty(const char *propertyKey, BaseProperty *property, const mitk::BaseRenderer *renderer=nullptr)
Set the property (instance of BaseProperty) with key propertyKey in the PropertyList of the renderer ...
unsigned int MapperSlotId
Definition: mitkCommon.h:37
std::multimap< std::string, std::string > MultimapType
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66
static void SetDefaultProperties(DataNode *node, BaseRenderer *renderer=nullptr, bool overwrite=false)
Set default values of properties used by this mapper to node.
Definition: mitkMapper.cpp:153
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.