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
163 GetClassNameAndDimension()
const;
174 this->m_Property = property;
183 return this->m_Property;
189 return this->m_Property;
195 GetMTime()
const override;
202 return Superclass::GetMTime();
218 SetObjectToWorldTransform(
const TransformType * transform);
219 itkGetModifiableObjectMacro(ObjectToWorldTransform, TransformType);
220 const TransformType *
221 GetObjectToWorldTransformInverse()
const;
230 SetObjectToParentTransform(
const TransformType * transform);
231 itkGetModifiableObjectMacro(ObjectToParentTransform, TransformType);
232 const TransformType *
233 GetObjectToParentTransformInverse()
const;
244 ComputeObjectToParentTransform();
261 IsInsideInObjectSpace(
const PointType &
point,
unsigned int depth,
const std::string & name =
"")
const;
278 unsigned int depth = 0,
279 const std::string & name =
"")
const;
288 IsEvaluableAtInObjectSpace(
const PointType &
point,
unsigned int depth = 0,
const std::string & name =
"")
const;
297 IsInsideChildrenInObjectSpace(
const PointType &
point,
unsigned int depth = 0,
const std::string & name =
"")
const;
303 unsigned int depth = 0,
304 const std::string & name =
"")
const;
309 unsigned int depth = 0,
310 const std::string & name =
"")
const;
320 itkSetMacro(DefaultInsideValue,
double);
321 itkGetConstMacro(DefaultInsideValue,
double);
326 itkSetMacro(DefaultOutsideValue,
double);
327 itkGetConstMacro(DefaultOutsideValue,
double);
334 unsigned int depth = 0,
335 const std::string & name =
"")
const;
339 IsInsideInWorldSpace(
const PointType &
point,
unsigned int depth = 0,
const std::string & name =
"")
const;
343 IsEvaluableAtInWorldSpace(
const PointType &
point,
unsigned int depth = 0,
const std::string & name =
"")
const;
349 short unsigned int order,
350 CovariantVectorType & value,
351 unsigned int depth = 0,
352 const std::string & name =
"",
353 const DerivativeOffsetType & offset = MakeFilled<DerivativeOffsetType>(1));
358 short unsigned int order,
359 CovariantVectorType & value,
360 unsigned int depth = 0,
361 const std::string & name =
"",
362 const DerivativeOffsetType & offset = MakeFilled<DerivativeOffsetType>(1));
374 SetParent(
Self * parent);
396 itkSetMacro(ParentId,
int);
397 itkGetConstReferenceMacro(ParentId,
int);
408 SetChildren(ChildrenListType & children);
412 AddChild(
Self * pointer);
417 RemoveChild(
Self * pointer);
421 RemoveAllChildren(
unsigned int depth = MaximumDepth);
428 virtual ChildrenListType *
429 GetChildren(
unsigned int depth = 0,
const std::string & name =
"")
const;
436 virtual ChildrenConstListType *
437 GetConstChildren(
unsigned int depth = 0,
const std::string & name =
"")
const;
440 AddChildrenToList(ChildrenListType * childrenList,
unsigned int depth = 0,
const std::string & name =
"")
const;
443 AddChildrenToConstList(ChildrenConstListType * childrenList,
444 unsigned int depth = 0,
445 const std::string & name =
"")
const;
449 GetNumberOfChildren(
unsigned int depth = 0,
const std::string & name =
"")
const;
453 GetObjectById(
int id);
459 FixParentChildHierarchyUsingParentIds();
466 CheckIdValidity()
const;
477 GetNextAvailableId()
const;
488 itkGetConstObjectMacro(MyBoundingBoxInObjectSpace, BoundingBoxType);
493 virtual const BoundingBoxType *
494 GetMyBoundingBoxInWorldSpace()
const;
502 ComputeFamilyBoundingBox(
unsigned int depth = 0,
const std::string & name =
"")
const;
506 itkGetConstObjectMacro(FamilyBoundingBoxInObjectSpace, BoundingBoxType);
510 virtual const BoundingBoxType *
511 GetFamilyBoundingBoxInWorldSpace()
const;
528 SetLargestPossibleRegion(
const RegionType & region);
539 return m_LargestPossibleRegion;
554 return m_BufferedRegion;
562 SetRequestedRegion(
const RegionType & region);
569 SetRequestedRegion(
const DataObject * data)
override;
578 return m_RequestedRegion;
585 SetRequestedRegionToLargestPossibleRegion()
override;
597 RequestedRegionIsOutsideOfTheBufferedRegion()
override;
608 VerifyRequestedRegion()
override;
618 UpdateOutputInformation()
override;
630 CopyInformation(
const DataObject * data)
override;
644 return this->IsInsideInWorldSpace(
point);
647 #if !defined(ITK_LEGACY_REMOVE)
648 itkLegacyMacro(
void ComputeObjectToWorldTransform())
653 itkLegacyMacro(
void ComputeBoundingBox())
659 itkLegacyMacro(
virtual bool IsInside(
const PointType &
point,
unsigned int depth = 0,
const std::string & name =
"")
662 return IsInsideInObjectSpace(
point, depth, name);
672 ProtectedComputeObjectToWorldTransform();
676 ComputeMyBoundingBox();
682 SpatialObject() =
default;
685 ~SpatialObject()
override;
688 PrintSelf(std::ostream & os, Indent indent)
const override;
693 return m_MyBoundingBoxInObjectSpace.GetPointer();
697 InternalClone()
const override;
704 std::string m_TypeName{
"SpatialObject" };
708 int m_ParentId{ -1 };
729 double m_DefaultInsideValue{ 1.0 };
732 double m_DefaultOutsideValue{ 0.0 };
737 #if !defined(ITK_WRAPPING_PARSER)
738 # ifndef ITK_MANUAL_INSTANTIATION
739 # include "itkSpatialObject.hxx"
743 #endif // itkSpatialObject_h