ITK  4.4.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_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 = NULL);
76 
79  unsigned int GetNumberOfObjects(unsigned int depth = MaximumDepth,
80  char *name = NULL);
81 
84  void SetObjects(ObjectListType & children);
85 
88  ModifiedTimeType GetMTime(void) const;
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(void);
102 
103  bool CheckIdValidity(void);
104 
105  void FixIdValidity(void);
106 
107  int GetNextAvailableId();
108 
110  void Clear();
111 
112 protected:
113  SceneSpatialObject(const Self &); //purposely not implemented
114  void operator=(const Self &); //purposely not implemented
115 
119 
122 
124  virtual ~SceneSpatialObject();
125 
127  virtual void PrintSelf(std::ostream & os, Indent indent) const;
128 
131 };
132 } // end of namespace itk
133 
134 #ifndef ITK_MANUAL_INSTANTIATION
135 #include "itkSceneSpatialObject.hxx"
136 #endif
137 
138 #endif // __SceneSpatialObject_h
139