18 #ifndef itkSpatialObject_h
19 #define itkSpatialObject_h
57 template <
unsigned int VDimension = 3>
69 static constexpr
unsigned int MaximumDepth = std::numeric_limits<unsigned int>::max();
142 itkGetConstReferenceMacro(Id,
int);
148 itkSetMacro(TypeName, std::string);
164 GetClassNameAndDimension()
const;
175 this->m_Property = property;
184 return this->m_Property;
190 return this->m_Property;
196 GetMTime()
const override;
203 return Superclass::GetMTime();
219 SetObjectToWorldTransform(
const TransformType * transform);
220 itkGetModifiableObjectMacro(ObjectToWorldTransform, TransformType);
221 const TransformType *
222 GetObjectToWorldTransformInverse()
const;
231 SetObjectToParentTransform(
const TransformType * transform);
232 itkGetModifiableObjectMacro(ObjectToParentTransform, TransformType);
233 const TransformType *
234 GetObjectToParentTransformInverse()
const;
245 ComputeObjectToParentTransform();
262 IsInsideInObjectSpace(
const PointType &
point,
unsigned int depth,
const std::string & name =
"")
const;
279 unsigned int depth = 0,
280 const std::string & name =
"")
const;
289 IsEvaluableAtInObjectSpace(
const PointType &
point,
unsigned int depth = 0,
const std::string & name =
"")
const;
298 IsInsideChildrenInObjectSpace(
const PointType &
point,
unsigned int depth = 0,
const std::string & name =
"")
const;
304 unsigned int depth = 0,
305 const std::string & name =
"")
const;
310 unsigned int depth = 0,
311 const std::string & name =
"")
const;
321 itkSetMacro(DefaultInsideValue,
double);
322 itkGetConstMacro(DefaultInsideValue,
double);
327 itkSetMacro(DefaultOutsideValue,
double);
328 itkGetConstMacro(DefaultOutsideValue,
double);
337 #ifndef ITK_FUTURE_LEGACY_REMOVE
343 unsigned int depth = 0,
344 const std::string & name =
"")
const;
352 #ifndef ITK_FUTURE_LEGACY_REMOVE
356 IsInsideInWorldSpace(
const PointType &
point,
unsigned int depth,
const std::string & name =
"")
const;
369 #ifndef ITK_FUTURE_LEGACY_REMOVE
373 IsEvaluableAtInWorldSpace(
const PointType &
point,
unsigned int depth = 0,
const std::string & name =
"")
const;
379 short unsigned int order,
380 CovariantVectorType & value,
381 unsigned int depth = 0,
382 const std::string & name =
"",
383 const DerivativeOffsetType & offset = MakeFilled<DerivativeOffsetType>(1));
391 #ifndef ITK_FUTURE_LEGACY_REMOVE
396 short unsigned int order,
397 CovariantVectorType & value,
398 unsigned int depth = 0,
399 const std::string & name =
"",
400 const DerivativeOffsetType & offset = MakeFilled<DerivativeOffsetType>(1));
412 SetParent(
Self * parent);
434 itkSetMacro(ParentId,
int);
435 itkGetConstReferenceMacro(ParentId,
int);
446 SetChildren(ChildrenListType & children);
450 AddChild(
Self * pointer);
455 RemoveChild(
Self * pointer);
459 RemoveAllChildren(
unsigned int depth = MaximumDepth);
466 virtual ChildrenListType *
467 GetChildren(
unsigned int depth = 0,
const std::string & name =
"")
const;
474 virtual ChildrenConstListType *
475 GetConstChildren(
unsigned int depth = 0,
const std::string & name =
"")
const;
478 AddChildrenToList(ChildrenListType * childrenList,
unsigned int depth = 0,
const std::string & name =
"")
const;
481 AddChildrenToConstList(ChildrenConstListType * childrenList,
482 unsigned int depth = 0,
483 const std::string & name =
"")
const;
487 GetNumberOfChildren(
unsigned int depth = 0,
const std::string & name =
"")
const;
491 GetObjectById(
int id);
497 FixParentChildHierarchyUsingParentIds();
504 CheckIdValidity()
const;
515 GetNextAvailableId()
const;
526 itkGetConstObjectMacro(MyBoundingBoxInObjectSpace, BoundingBoxType);
531 virtual const BoundingBoxType *
532 GetMyBoundingBoxInWorldSpace()
const;
540 ComputeFamilyBoundingBox(
unsigned int depth = 0,
const std::string & name =
"")
const;
544 itkGetConstObjectMacro(FamilyBoundingBoxInObjectSpace, BoundingBoxType);
548 virtual const BoundingBoxType *
549 GetFamilyBoundingBoxInWorldSpace()
const;
566 SetLargestPossibleRegion(
const RegionType & region);
577 return m_LargestPossibleRegion;
592 return m_BufferedRegion;
600 SetRequestedRegion(
const RegionType & region);
607 SetRequestedRegion(
const DataObject * data)
override;
616 return m_RequestedRegion;
623 SetRequestedRegionToLargestPossibleRegion()
override;
635 RequestedRegionIsOutsideOfTheBufferedRegion()
override;
646 VerifyRequestedRegion()
override;
656 UpdateOutputInformation()
override;
668 CopyInformation(
const DataObject * data)
override;
682 return this->IsInsideInWorldSpace(
point);
685 #if !defined(ITK_LEGACY_REMOVE)
686 itkLegacyMacro(
void ComputeObjectToWorldTransform())
691 itkLegacyMacro(
void ComputeBoundingBox())
697 itkLegacyMacro(
virtual bool IsInside(
const PointType &
point,
unsigned int depth = 0,
const std::string & name =
"")
700 return IsInsideInObjectSpace(
point, depth, name);
709 ProtectedComputeObjectToWorldTransform();
713 ComputeMyBoundingBox();
719 SpatialObject() =
default;
722 ~SpatialObject()
override;
725 PrintSelf(std::ostream & os, Indent indent)
const override;
730 return m_MyBoundingBoxInObjectSpace.GetPointer();
734 InternalClone()
const override;
741 std::string m_TypeName{
"SpatialObject" };
745 int m_ParentId{ -1 };
766 double m_DefaultInsideValue{ 1.0 };
769 double m_DefaultOutsideValue{ 0.0 };
774 #if !defined(ITK_WRAPPING_PARSER)
775 # ifndef ITK_MANUAL_INSTANTIATION
776 # include "itkSpatialObject.hxx"
780 #endif // itkSpatialObject_h