ITK  6.0.0
Insight Toolkit
itkSpatialObjectDuplicator.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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 itkSpatialObjectDuplicator_h
19#define itkSpatialObjectDuplicator_h
20
21#include "itkObject.h"
22#include "itkSpatialObject.h"
23
24namespace itk
25{
32template <typename TInputSpatialObject>
33class ITK_TEMPLATE_EXPORT SpatialObjectDuplicator : public Object
34{
35public:
36 ITK_DISALLOW_COPY_AND_MOVE(SpatialObjectDuplicator);
37
43
44 itkNewMacro(Self);
45
47 itkOverrideGetNameOfClassMacro(SpatialObjectDuplicator);
48
50 using SpatialObjectType = TInputSpatialObject;
53
54 static constexpr unsigned int ObjectDimension = SpatialObjectType::ObjectDimension;
55
57
59 itkSetConstObjectMacro(Input, SpatialObjectType);
60
68 // NOTE: The m_GeneratedImageSource is only
69 // exposed via the Source generation interface
70 // by the GetOutput() method that mimics
71 // a process object.
72 virtual const SpatialObjectType *
73 GetOutput() const
74 {
75 return this->m_DuplicateSpatialObject.GetPointer();
76 }
77 virtual SpatialObjectType *
79 {
80 return this->m_DuplicateSpatialObject.GetPointer();
81 }
84#if !defined(ITK_LEGACY_REMOVE)
85 // This interface was exposed in ITKv4 when the itkGetModifiableObjectMacro was used
86 virtual SpatialObjectType *
87 GetModifiedOutput()
88 {
89 return this->m_DuplicateSpatialObject.GetPointer();
90 }
91#endif
92
93
95 void
97
98protected:
100 ~SpatialObjectDuplicator() override = default;
101 void
102 PrintSelf(std::ostream & os, Indent indent) const override;
103
105 void
107
108private:
110 SpatialObjectPointer m_DuplicateSpatialObject{};
111 ModifiedTimeType m_InternalSpatialObjectTime{};
112};
113} // end namespace itk
114
115#ifndef ITK_MANUAL_INSTANTIATION
116# include "itkSpatialObjectDuplicator.hxx"
117#endif
118
119#endif /* itkSpatialObjectDuplicator_h */
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Base class for most ITK classes.
Definition: itkObject.h:62
typename TInputSpatialObject::Pointer SpatialObjectPointer
void CopyObject(const InternalSpatialObjectType *source, InternalSpatialObjectType *destination)
virtual const SpatialObjectType * GetOutput() const
~SpatialObjectDuplicator() override=default
typename TInputSpatialObject::ConstPointer SpatialObjectConstPointer
virtual SpatialObjectType * GetOutput()
void PrintSelf(std::ostream &os, Indent indent) const override
Implementation of the composite pattern.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
SizeValueType ModifiedTimeType
Definition: itkIntTypes.h:105