18 #ifndef itkSpatialObject_h
19 #define itkSpatialObject_h
56 template <
unsigned int VDimension = 3>
68 static constexpr
unsigned int MaximumDepth = 9999999;
141 itkGetConstReferenceMacro(Id,
int);
147 itkSetMacro(TypeName, std::string);
150 virtual const std::string
158 GetClassNameAndDimension()
const;
169 this->m_Property = property;
178 return this->m_Property;
184 return this->m_Property;
190 GetMTime()
const override;
197 return Superclass::GetMTime();
209 SetObjectToWorldTransform(
const TransformType * transform);
210 itkGetModifiableObjectMacro(ObjectToWorldTransform, TransformType);
211 const TransformType *
212 GetObjectToWorldTransformInverse()
const;
218 SetObjectToParentTransform(
const TransformType * transform);
219 itkGetModifiableObjectMacro(ObjectToParentTransform, TransformType);
220 const TransformType *
221 GetObjectToParentTransformInverse()
const;
226 ComputeObjectToParentTransform();
243 IsInsideInObjectSpace(
const PointType &
point,
unsigned int depth,
const std::string & name =
"")
const;
260 unsigned int depth = 0,
261 const std::string & name =
"")
const;
270 IsEvaluableAtInObjectSpace(
const PointType &
point,
unsigned int depth = 0,
const std::string & name =
"")
const;
277 IsInsideChildrenInObjectSpace(
const PointType &
point,
unsigned int depth = 0,
const std::string & name =
"")
const;
282 unsigned int depth = 0,
283 const std::string & name =
"")
const;
287 unsigned int depth = 0,
288 const std::string & name =
"")
const;
298 itkSetMacro(DefaultInsideValue,
double);
299 itkGetConstMacro(DefaultInsideValue,
double);
304 itkSetMacro(DefaultOutsideValue,
double);
305 itkGetConstMacro(DefaultOutsideValue,
double);
312 unsigned int depth = 0,
313 const std::string & name =
"")
const;
317 IsInsideInWorldSpace(
const PointType &
point,
unsigned int depth = 0,
const std::string & name =
"")
const;
321 IsEvaluableAtInWorldSpace(
const PointType &
point,
unsigned int depth = 0,
const std::string & name =
"")
const;
327 short unsigned int order,
328 CovariantVectorType & value,
329 unsigned int depth = 0,
330 const std::string & name =
"",
331 const DerivativeOffsetType & offset = MakeFilled<DerivativeOffsetType>(1));
336 short unsigned int order,
337 CovariantVectorType & value,
338 unsigned int depth = 0,
339 const std::string & name =
"",
340 const DerivativeOffsetType & offset = MakeFilled<DerivativeOffsetType>(1));
352 SetParent(
Self * parent);
369 itkSetMacro(ParentId,
int);
370 itkGetConstReferenceMacro(ParentId,
int);
381 SetChildren(ChildrenListType & children);
385 AddChild(
Self * pointer);
390 RemoveChild(
Self * pointer);
394 RemoveAllChildren(
unsigned int depth = MaximumDepth);
401 virtual ChildrenListType *
402 GetChildren(
unsigned int depth = 0,
const std::string & name =
"")
const;
404 virtual ChildrenConstListType *
405 GetConstChildren(
unsigned int depth = 0,
const std::string & name =
"")
const;
408 AddChildrenToList(ChildrenListType * childrenList,
unsigned int depth = 0,
const std::string & name =
"")
const;
411 AddChildrenToConstList(ChildrenConstListType * childrenList,
412 unsigned int depth = 0,
413 const std::string & name =
"")
const;
417 GetNumberOfChildren(
unsigned int depth = 0,
const std::string & name =
"")
const;
421 GetObjectById(
int id);
427 FixParentChildHierarchyUsingParentIds();
431 CheckIdValidity()
const;
439 GetNextAvailableId()
const;
450 itkGetConstObjectMacro(MyBoundingBoxInObjectSpace, BoundingBoxType);
455 virtual const BoundingBoxType *
456 GetMyBoundingBoxInWorldSpace()
const;
461 ComputeFamilyBoundingBox(
unsigned int depth = 0,
const std::string & name =
"")
const;
465 itkGetConstObjectMacro(FamilyBoundingBoxInObjectSpace, BoundingBoxType);
469 virtual const BoundingBoxType *
470 GetFamilyBoundingBoxInWorldSpace()
const;
485 SetLargestPossibleRegion(
const RegionType & region);
496 return m_LargestPossibleRegion;
511 return m_BufferedRegion;
519 SetRequestedRegion(
const RegionType & region);
526 SetRequestedRegion(
const DataObject * data)
override;
535 return m_RequestedRegion;
542 SetRequestedRegionToLargestPossibleRegion()
override;
554 RequestedRegionIsOutsideOfTheBufferedRegion()
override;
565 VerifyRequestedRegion()
override;
575 UpdateOutputInformation()
override;
587 CopyInformation(
const DataObject * data)
override;
601 return this->IsInsideInWorldSpace(
point);
604 #if !defined(ITK_LEGACY_REMOVE)
605 itkLegacyMacro(
void ComputeObjectToWorldTransform())
610 itkLegacyMacro(
void ComputeBoundingBox())
616 itkLegacyMacro(
virtual bool IsInside(
const PointType &
point,
unsigned int depth = 0,
const std::string & name =
"")
619 return IsInsideInObjectSpace(
point, depth, name);
629 ProtectedComputeObjectToWorldTransform();
633 ComputeMyBoundingBox();
639 SpatialObject() =
default;
642 ~SpatialObject()
override;
645 PrintSelf(std::ostream & os, Indent indent)
const override;
650 return m_MyBoundingBoxInObjectSpace.GetPointer();
654 InternalClone()
const override;
661 std::string m_TypeName{
"SpatialObject" };
665 int m_ParentId{ -1 };
686 double m_DefaultInsideValue{ 1.0 };
689 double m_DefaultOutsideValue{ 0.0 };
694 #if !defined(ITK_WRAPPING_PARSER)
695 # ifndef ITK_MANUAL_INSTANTIATION
696 # include "itkSpatialObject.hxx"
700 #endif // itkSpatialObject_h