ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkSceneSpatialObject.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkSceneSpatialObject_h
19 #define itkSceneSpatialObject_h
20 
21 #include "itkSpatialObject.h"
22 
23 #include <list>
24 
25 namespace itk
26 {
37 template< unsigned int TSpaceDimension = 3 >
38 class ITK_TEMPLATE_EXPORT SceneSpatialObject:
39  public Object
40 {
41 public:
42 
44  typedef Object Superclass;
48 
52 
53  typedef std::list< SpatialObjectPointer > ObjectListType;
54 
55  itkStaticConstMacro(MaximumDepth, unsigned int, 9999999);
56 
58  itkNewMacro(Self);
59  itkTypeMacro(SceneSpatialObject, Object);
61 
63  void AddSpatialObject(SpatialObject< TSpaceDimension > *pointer);
64 
69  void RemoveSpatialObject(SpatialObject< TSpaceDimension > *object);
70 
74  ObjectListType * GetObjects(unsigned int depth = MaximumDepth,
75  char *name = ITK_NULLPTR);
76 
79  unsigned int GetNumberOfObjects(unsigned int depth = MaximumDepth,
80  char *name = ITK_NULLPTR);
81 
84  void SetObjects(ObjectListType & children);
85 
88  virtual ModifiedTimeType GetMTime(void) const ITK_OVERRIDE;
89 
91  void SetParentId(int parentid) { m_ParentId = parentid; }
92  int GetParentId(void) { return m_ParentId; }
94 
96  SpatialObject< TSpaceDimension > * GetObjectById(int Id);
97 
101  bool FixHierarchy();
102 
103  bool CheckIdValidity();
104 
105  void FixIdValidity();
106 
107  int GetNextAvailableId();
108 
110  void Clear();
111 
112 protected:
113  ITK_DISALLOW_COPY_AND_ASSIGN(SceneSpatialObject);
114 
118 
121 
123  virtual ~SceneSpatialObject() ITK_OVERRIDE;
124 
126  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
127 
129  int m_ParentId;
130 };
131 } // end of namespace itk
132 
133 #ifndef ITK_MANUAL_INSTANTIATION
134 #include "itkSceneSpatialObject.hxx"
135 #endif
136 
137 #endif // __SceneSpatialObject_h
SpatialObject< TSpaceDimension > SpatialObjectType
Superclass::Pointer SuperclassPointer
Light weight base class for most itk classes.
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
SpatialObjectType::Pointer SpatialObjectPointer
a SceneSpatialObject has a list of SpatialObjects
SceneSpatialObject< TSpaceDimension > Self
Implementation of the composite pattern.
std::list< SpatialObjectPointer > ObjectListType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
SmartPointer< const Self > ConstPointer
SpatialObject< TSpaceDimension > ObjectType
Base class for most ITK classes.
Definition: itkObject.h:59
SmartPointer< Self > Pointer