18 #ifndef itkSpatialObject_h
19 #define itkSpatialObject_h
56 template <
unsigned int VDimension = 3>
68 static constexpr
unsigned int MaximumDepth = 9999999;
138 itkGetConstReferenceMacro(Id,
int);
144 itkSetMacro(TypeName, std::string);
147 virtual const std::string
155 GetClassNameAndDimension()
const;
166 this->m_Property = property;
175 return this->m_Property;
181 return this->m_Property;
187 GetMTime()
const override;
194 return Superclass::GetMTime();
206 SetObjectToWorldTransform(
const TransformType * transform);
207 itkGetModifiableObjectMacro(ObjectToWorldTransform, TransformType);
208 const TransformType *
209 GetObjectToWorldTransformInverse()
const;
215 SetObjectToParentTransform(
const TransformType * transform);
216 itkGetModifiableObjectMacro(ObjectToParentTransform, TransformType);
217 const TransformType *
218 GetObjectToParentTransformInverse()
const;
223 ComputeObjectToParentTransform();
240 IsInsideInObjectSpace(
const PointType & point,
unsigned int depth,
const std::string & name =
"")
const;
245 IsInsideInObjectSpace(
const PointType & point)
const;
255 ValueAtInObjectSpace(
const PointType & point,
257 unsigned int depth = 0,
258 const std::string & name =
"")
const;
267 IsEvaluableAtInObjectSpace(
const PointType & point,
unsigned int depth = 0,
const std::string & name =
"")
const;
274 IsInsideChildrenInObjectSpace(
const PointType & point,
unsigned int depth = 0,
const std::string & name =
"")
const;
277 ValueAtChildrenInObjectSpace(
const PointType & point,
279 unsigned int depth = 0,
280 const std::string & name =
"")
const;
283 IsEvaluableAtChildrenInObjectSpace(
const PointType & point,
284 unsigned int depth = 0,
285 const std::string & name =
"")
const;
295 itkSetMacro(DefaultInsideValue,
double);
296 itkGetConstMacro(DefaultInsideValue,
double);
301 itkSetMacro(DefaultOutsideValue,
double);
302 itkGetConstMacro(DefaultOutsideValue,
double);
307 ValueAtInWorldSpace(
const PointType & point,
309 unsigned int depth = 0,
310 const std::string & name =
"")
const;
314 IsInsideInWorldSpace(
const PointType & point,
unsigned int depth = 0,
const std::string & name =
"")
const;
318 IsEvaluableAtInWorldSpace(
const PointType & point,
unsigned int depth = 0,
const std::string & name =
"")
const;
323 DerivativeAtInObjectSpace(
const PointType & point,
324 short unsigned int order,
325 CovariantVectorType & value,
326 unsigned int depth = 0,
327 const std::string & name =
"",
328 const DerivativeOffsetType & spacing = 1);
332 DerivativeAtInWorldSpace(
const PointType & point,
333 short unsigned int order,
334 CovariantVectorType & value,
335 unsigned int depth = 0,
336 const std::string & name =
"",
337 const DerivativeOffsetType & spacing = 1);
349 SetParent(Self * parent);
366 itkSetMacro(ParentId,
int);
367 itkGetConstReferenceMacro(ParentId,
int);
378 SetChildren(ChildrenListType & children);
382 AddChild(Self * pointer);
387 RemoveChild(Self *
object);
391 RemoveAllChildren(
unsigned int depth = MaximumDepth);
398 virtual ChildrenListType *
399 GetChildren(
unsigned int depth = 0,
const std::string & name =
"")
const;
402 AddChildrenToList(ChildrenListType * children,
unsigned int depth = 0,
const std::string & name =
"")
const;
406 GetNumberOfChildren(
unsigned int depth = 0,
const std::string & name =
"")
const;
410 GetObjectById(
int Id);
416 FixParentChildHierarchyUsingParentIds();
420 CheckIdValidity()
const;
428 GetNextAvailableId()
const;
439 itkGetConstObjectMacro(MyBoundingBoxInObjectSpace, BoundingBoxType);
444 virtual const BoundingBoxType *
445 GetMyBoundingBoxInWorldSpace()
const;
450 ComputeFamilyBoundingBox(
unsigned int depth = 0,
const std::string & name =
"")
const;
454 itkGetConstObjectMacro(FamilyBoundingBoxInObjectSpace, BoundingBoxType);
458 virtual const BoundingBoxType *
459 GetFamilyBoundingBoxInWorldSpace()
const;
474 SetLargestPossibleRegion(
const RegionType & region);
485 return m_LargestPossibleRegion;
500 return m_BufferedRegion;
508 SetRequestedRegion(
const RegionType & region);
515 SetRequestedRegion(
const DataObject * data)
override;
524 return m_RequestedRegion;
531 SetRequestedRegionToLargestPossibleRegion()
override;
543 RequestedRegionIsOutsideOfTheBufferedRegion()
override;
554 VerifyRequestedRegion()
override;
564 UpdateOutputInformation()
override;
576 CopyInformation(
const DataObject * data)
override;
590 return this->IsInsideInWorldSpace(point);
593 #if !defined(ITK_LEGACY_REMOVE)
594 itkLegacyMacro(
void ComputeObjectToWorldTransform())
599 itkLegacyMacro(
void ComputeBoundingBox())
605 itkLegacyMacro(
virtual bool IsInside(
const PointType & point,
unsigned int depth = 0,
const std::string & name =
"")
608 return IsInsideInObjectSpace(point, depth, name);
618 ProtectedComputeObjectToWorldTransform();
622 ComputeMyBoundingBox();
628 SpatialObject() =
default;
631 ~SpatialObject()
override;
634 PrintSelf(std::ostream & os, Indent indent)
const override;
639 return m_MyBoundingBoxInObjectSpace.GetPointer();
643 InternalClone()
const override;
650 std::string m_TypeName{
"SpatialObject" };
654 int m_ParentId{ -1 };
675 double m_DefaultInsideValue{ 1.0 };
678 double m_DefaultOutsideValue{ 0.0 };
683 #if !defined(ITK_WRAPPING_PARSER)
684 # ifndef ITK_MANUAL_INSTANTIATION
685 # include "itkSpatialObject.hxx"
689 #endif // itkSpatialObject_h