From 5eed4d5f0fcfe9a93d810b48c2522bf39fc010d0 Mon Sep 17 00:00:00 2001 From: Spiros Tsalikis <spiros.tsalikis@kitware.com> Date: Mon, 4 Mar 2024 12:06:43 -0500 Subject: [PATCH] vtkDataObjectTree: Make protected Getters public This is useful to avoid downcasting to many types when trying to get the same information. --- Common/DataModel/vtkDataObjectTree.h | 46 ++++++++++++++-------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Common/DataModel/vtkDataObjectTree.h b/Common/DataModel/vtkDataObjectTree.h index c1155545195..4eed583055d 100644 --- a/Common/DataModel/vtkDataObjectTree.h +++ b/Common/DataModel/vtkDataObjectTree.h @@ -141,6 +141,29 @@ public: */ vtkIdType GetNumberOfCells() override; + /** + * Get the number of children. + */ + unsigned int GetNumberOfChildren(); + + /** + * Returns a child dataset at a given index. + */ + vtkDataObject* GetChild(unsigned int index); + + /** + * Returns the meta-data at a given index. If the index is valid, however, no + * information object is set, then a new one will created and returned. + * To avoid unnecessary creation, use HasMetaData(). + */ + vtkInformation* GetChildMetaData(unsigned int index); + + /** + * Returns if meta-data information is available for the given child index. + * Returns 1 is present, 0 otherwise. + */ + vtkTypeBool HasChildMetaData(unsigned int index); + ///@{ /** * Retrieve an instance of this class from an information object. @@ -163,11 +186,6 @@ protected: */ void SetNumberOfChildren(unsigned int num); - /** - * Get the number of children. - */ - unsigned int GetNumberOfChildren(); - /** * Set child dataset at a given index. The number of children is adjusted to * to be greater than the index specified. @@ -179,29 +197,11 @@ protected: */ void RemoveChild(unsigned int index); - /** - * Returns a child dataset at a given index. - */ - vtkDataObject* GetChild(unsigned int index); - - /** - * Returns the meta-data at a given index. If the index is valid, however, no - * information object is set, then a new one will created and returned. - * To avoid unnecessary creation, use HasMetaData(). - */ - vtkInformation* GetChildMetaData(unsigned int index); - /** * Sets the meta-data at a given index. */ void SetChildMetaData(unsigned int index, vtkInformation* info); - /** - * Returns if meta-data information is available for the given child index. - * Returns 1 is present, 0 otherwise. - */ - vtkTypeBool HasChildMetaData(unsigned int index); - /** * When copying structure from another vtkDataObjectTree, this method gets * called for create a new non-leaf for the `other` node. Subclasses can -- GitLab