ITK  4.9.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 >
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 
64 
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 
97 
101  bool FixHierarchy();
102 
103  bool CheckIdValidity();
104 
105  void FixIdValidity();
106 
107  int GetNextAvailableId();
108 
110  void Clear();
111 
112 protected:
113  SceneSpatialObject(const Self &) ITK_DELETE_FUNCTION;
114  void operator=(const Self &) ITK_DELETE_FUNCTION;
115 
119 
122 
124  virtual ~SceneSpatialObject();
125 
127  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
128 
131 };
132 } // end of namespace itk
133 
134 #ifndef ITK_MANUAL_INSTANTIATION
135 #include "itkSceneSpatialObject.hxx"
136 #endif
137 
138 #endif // __SceneSpatialObject_h
void AddSpatialObject(SpatialObject< TSpaceDimension > *pointer)
SpatialObject< TSpaceDimension > SpatialObjectType
Superclass::Pointer SuperclassPointer
Light weight base class for most itk classes.
void SetParentId(int parentid)
virtual void PrintSelf(std::ostream &os, Indent indent) const override
unsigned int GetNumberOfObjects(unsigned int depth=MaximumDepth, char *name=nullptr)
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
void SetObjects(ObjectListType &children)
SpatialObjectType::Pointer SpatialObjectPointer
a SceneSpatialObject has a list of SpatialObjects
void RemoveSpatialObject(SpatialObject< TSpaceDimension > *object)
SceneSpatialObject< TSpaceDimension > Self
Implementation of the composite pattern.
std::list< SpatialObjectPointer > ObjectListType
static const unsigned int MaximumDepth
ObjectListType * GetObjects(unsigned int depth=MaximumDepth, char *name=nullptr)
SpatialObject< TSpaceDimension > * GetObjectById(int Id)
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:57
virtual ModifiedTimeType GetMTime(void) const override
SmartPointer< Self > Pointer