@@ -63,11 +63,6 @@ namespace itk
6363 * string "[UNKNOWN PRINT CHARACTERISTICS]" that works for all possible
6464 * MetaDataObject types.
6565 *
66- * The application developer may overload the default implementation to provide
67- * a specialized Print() characteristics to produce results desirable for their application.
68- * A set of very crude Macros {NATIVE_TYPE_METADATAPRINT, ITK_OBJECT_TYPE_METADATAPRINT_1COMMA,
69- * ITK_IMAGE_TYPE_METADATAPRINT } are provided to facilitate a very simple implementation, and as an example.
70- *
7166 * \ingroup ITKCommon
7267 *
7368 */
@@ -123,13 +118,6 @@ class ITK_TEMPLATE_EXPORT MetaDataObject : public MetaDataObjectBase
123118 void
124119 SetMetaDataObjectValue (const MetaDataObjectType & newValue);
125120
126- /* *
127- * Defines the default behavior for printing out this element
128- * \param os An output stream
129- */
130- void
131- Print (std::ostream & os) const override ;
132-
133121 /* * Returns (metaDataObject1 == metaDataObject2). */
134122 friend bool
135123 operator ==(const Self & lhs, const Self & rhs)
@@ -144,10 +132,21 @@ class ITK_TEMPLATE_EXPORT MetaDataObject : public MetaDataObjectBase
144132 return !(lhs == rhs);
145133 }
146134
135+ /* * Helper to print contents of a MetaDataObject. */
136+ void
137+ PrintValue (std::ostream & os) const ;
138+
147139protected:
148140 MetaDataObject () = default ;
149141 ~MetaDataObject () override = default ;
150142
143+ /* *
144+ * Defines the default behavior for printing out this element
145+ * \param os An output stream
146+ */
147+ void
148+ PrintSelf (std::ostream & os, Indent indent) const override ;
149+
151150private:
152151 /* * Assigns the value of `source` to `target`.
153152 * \note The trailing return type is there, just to enable SFINAE.*/
@@ -262,53 +261,8 @@ ExposeMetaData(const MetaDataDictionary & Dictionary, const std::string key, T &
262261 return true ;
263262}
264263
265- } // end namespace itk
266264
267- /* *
268- * \def ITK_NATIVE_TYPE_METADATAPRINT( TYPE_NAME )
269- * \brief An ugly macro to facilitate creating a simple implementation of
270- * the MetaDataObject<Type>::Print() function for types that
271- * have operator<< defined.
272- * \param TYPE_NAME the native type parameter type
273- */
274- #define ITK_NATIVE_TYPE_METADATAPRINT (TYPE_NAME ) \
275- template <> \
276- void itk::MetaDataObject<TYPE_NAME>::Print(std::ostream & os) const \
277- { \
278- os << this ->m_MetaDataObjectValue << std::endl; \
279- }
280-
281- /* *
282- * \def ITK_OBJECT_TYPE_METADATAPRINT_1COMMA( TYPE_NAME_PART1, TYPE_NAME_PART2 )
283- * \brief An ugly macro to facilitate creating a simple implementation of
284- * the MetaDataObject< Type >::Print() function for
285- * itk::Objects that have 1 comma in their type definition
286- * \param TYPE_NAME_PART1
287- * \param TYPE_NAME_PART2
288- */
289- #define ITK_OBJECT_TYPE_METADATAPRINT_1COMMA (TYPE_NAME_PART1, TYPE_NAME_PART2 ) \
290- template <> \
291- void itk::MetaDataObject<TYPE_NAME_PART1, TYPE_NAME_PART2>::Print(std::ostream & os) const \
292- { \
293- this ->m_MetaDataObjectValue ->Print (os); \
294- }
295-
296- /* *
297- * \def ITK_IMAGE_TYPE_METADATAPRINT( STORAGE_TYPE )
298- * An ugly macro to facilitate creating a simple implementation of
299- * the MetaDataObject<Type>::Print() function for
300- * itk::Image\<STORAGE_TYPE,[1-8]\>\::Pointer
301- * \param STORAGE_TYPE The storage type of the image type to print.
302- */
303- #define ITK_IMAGE_TYPE_METADATAPRINT (STORAGE_TYPE ) \
304- ITK_OBJECT_TYPE_METADATAPRINT_1COMMA (itk::Image<STORAGE_TYPE, 1 >::Pointer) \
305- ITK_OBJECT_TYPE_METADATAPRINT_1COMMA (itk::Image<STORAGE_TYPE, 2 >::Pointer) \
306- ITK_OBJECT_TYPE_METADATAPRINT_1COMMA (itk::Image<STORAGE_TYPE, 3 >::Pointer) \
307- ITK_OBJECT_TYPE_METADATAPRINT_1COMMA (itk::Image<STORAGE_TYPE, 4 >::Pointer) \
308- ITK_OBJECT_TYPE_METADATAPRINT_1COMMA (itk::Image<STORAGE_TYPE, 5 >::Pointer) \
309- ITK_OBJECT_TYPE_METADATAPRINT_1COMMA (itk::Image<STORAGE_TYPE, 6 >::Pointer) \
310- ITK_OBJECT_TYPE_METADATAPRINT_1COMMA (itk::Image<STORAGE_TYPE, 7 >::Pointer) \
311- ITK_OBJECT_TYPE_METADATAPRINT_1COMMA (itk::Image<STORAGE_TYPE, 8 >::Pointer)
265+ } // end namespace itk
312266
313267#ifndef ITK_MANUAL_INSTANTIATION
314268# include " itkMetaDataObject.hxx"
0 commit comments