Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLNodeFactory Class Reference

Registered MRML node classes of a scene. More...

#include <Libs/MRML/Core/vtkMRMLNodeFactory.h>

Inheritance diagram for vtkMRMLNodeFactory:
Collaboration diagram for vtkMRMLNodeFactory:

Public Types

enum  { NodeClassRegisteredEvent = vtkCommand::UserEvent + 1 }
 
typedef vtkObject Superclass
 

Public Member Functions

void CopyRegisteredNodeClasses (vtkMRMLNodeFactory *sourceFactory)
 
vtkMRMLNode * CreateNodeByClass (const char *className)
 
virtual const char * GetClassName ()
 
const char * GetClassNameByTag (const char *tagName)
 
std::string GetNthRegisteredAbstractNodeClassName (int n)
 Get the class name of the nth registered abstract node class.
 
std::string GetNthRegisteredAbstractNodeTypeDisplayName (int n)
 Get the type display name of the nth registered abstract node class.
 
vtkMRMLNode * GetNthRegisteredNodeClass (int n)
 Get the prototype of the nth registered node class. Returns nullptr if n is out of range.
 
int GetNumberOfRegisteredAbstractNodeClasses ()
 Get the number of registered abstract node classes.
 
int GetNumberOfRegisteredNodeClasses ()
 Get the number of registered node classes.
 
const char * GetTagByClassName (const char *className)
 
std::string GetTypeDisplayNameByClassName (const std::string &className)
 Get the type name shown in the GUI. Returns empty string if the class is not registered.
 
virtual int IsA (const char *type)
 
bool IsNodeClassRegistered (const std::string &className)
 Return true if className is a registered node class.
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
void RegisterAbstractNodeClass (const std::string &className, const std::string &typeDisplayName)
 Register type display name of an abstract node class (e.g., "Volume"), for node selectors.
 
void RegisterCoreNodeClasses ()
 Register the built-in node classes of the MRML core library.
 
void RegisterNodeClass (vtkMRMLNode *node)
 Register a node class with the node's GetNodeTagName() as tag.
 
void RegisterNodeClass (vtkMRMLNode *node, const char *tagName)
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkMRMLNodeFactory * New ()
 
static vtkMRMLNodeFactory * SafeDownCast (vtkObject *o)
 

Protected Member Functions

void operator= (const vtkMRMLNodeFactory &)=delete
 
 vtkMRMLNodeFactory ()
 
 vtkMRMLNodeFactory (const vtkMRMLNodeFactory &)=delete
 
 ~vtkMRMLNodeFactory () override
 

Protected Attributes

std::map< std::string, std::string > RegisteredAbstractNodeClassTypeDisplayNames
 
std::vector< vtkMRMLNode * > RegisteredNodeClasses
 
std::vector< std::string > RegisteredNodeTags
 

Detailed Description

Registered MRML node classes of a scene.

Stores a prototype instance of each registered node class, used for creating nodes by class name or XML tag.

It can be shared between scenes (see vtkMRMLScene::SetNodeFactory()), to allow creating scenes without instantiating a prototype of all the node classes. This is useful when a large number of scene nodes need to be created, for example for storing scene views.

Definition at line 44 of file vtkMRMLNodeFactory.h.

Member Typedef Documentation

◆ Superclass

typedef vtkObject vtkMRMLNodeFactory::Superclass

Definition at line 48 of file vtkMRMLNodeFactory.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
NodeClassRegisteredEvent 

Invoked when a node class or an abstract node class is registered.

Definition at line 51 of file vtkMRMLNodeFactory.h.

Constructor & Destructor Documentation

◆ vtkMRMLNodeFactory() [1/2]

vtkMRMLNodeFactory::vtkMRMLNodeFactory ( )
protected

◆ ~vtkMRMLNodeFactory()

vtkMRMLNodeFactory::~vtkMRMLNodeFactory ( )
overrideprotected

◆ vtkMRMLNodeFactory() [2/2]

vtkMRMLNodeFactory::vtkMRMLNodeFactory ( const vtkMRMLNodeFactory & )
protecteddelete

Member Function Documentation

◆ CopyRegisteredNodeClasses()

void vtkMRMLNodeFactory::CopyRegisteredNodeClasses ( vtkMRMLNodeFactory * sourceFactory)

Register node classes of sourceFactory whose tag is not registered in this factory yet. Prototypes are shared, not copied.

◆ CreateNodeByClass()

vtkMRMLNode * vtkMRMLNodeFactory::CreateNodeByClass ( const char * className)

Create a new node of the specified class (falls back to vtkObjectFactory for unregistered classes). The caller must delete the returned node. Returns nullptr on failure.

◆ GetClassName()

virtual const char * vtkMRMLNodeFactory::GetClassName ( )
virtual

◆ GetClassNameByTag()

const char * vtkMRMLNodeFactory::GetClassNameByTag ( const char * tagName)

Get class name of the node class registered with the specified XML tag. Returns nullptr if no node class is registered with this tag.

◆ GetNthRegisteredAbstractNodeClassName()

std::string vtkMRMLNodeFactory::GetNthRegisteredAbstractNodeClassName ( int n)

Get the class name of the nth registered abstract node class.

◆ GetNthRegisteredAbstractNodeTypeDisplayName()

std::string vtkMRMLNodeFactory::GetNthRegisteredAbstractNodeTypeDisplayName ( int n)

Get the type display name of the nth registered abstract node class.

◆ GetNthRegisteredNodeClass()

vtkMRMLNode * vtkMRMLNodeFactory::GetNthRegisteredNodeClass ( int n)

Get the prototype of the nth registered node class. Returns nullptr if n is out of range.

◆ GetNumberOfRegisteredAbstractNodeClasses()

int vtkMRMLNodeFactory::GetNumberOfRegisteredAbstractNodeClasses ( )

Get the number of registered abstract node classes.

◆ GetNumberOfRegisteredNodeClasses()

int vtkMRMLNodeFactory::GetNumberOfRegisteredNodeClasses ( )

Get the number of registered node classes.

◆ GetTagByClassName()

const char * vtkMRMLNodeFactory::GetTagByClassName ( const char * className)

Get XML tag of the specified node class. Returns nullptr if the node class is not registered.

◆ GetTypeDisplayNameByClassName()

std::string vtkMRMLNodeFactory::GetTypeDisplayNameByClassName ( const std::string & className)

Get the type name shown in the GUI. Returns empty string if the class is not registered.

◆ IsA()

virtual int vtkMRMLNodeFactory::IsA ( const char * type)
virtual

◆ IsNodeClassRegistered()

bool vtkMRMLNodeFactory::IsNodeClassRegistered ( const std::string & className)

Return true if className is a registered node class.

◆ IsTypeOf()

static int vtkMRMLNodeFactory::IsTypeOf ( const char * type)
static

◆ New()

static vtkMRMLNodeFactory * vtkMRMLNodeFactory::New ( )
static

◆ operator=()

void vtkMRMLNodeFactory::operator= ( const vtkMRMLNodeFactory & )
protecteddelete

◆ PrintSelf()

void vtkMRMLNodeFactory::PrintSelf ( ostream & os,
vtkIndent indent )
override

◆ RegisterAbstractNodeClass()

void vtkMRMLNodeFactory::RegisterAbstractNodeClass ( const std::string & className,
const std::string & typeDisplayName )

Register type display name of an abstract node class (e.g., "Volume"), for node selectors.

◆ RegisterCoreNodeClasses()

void vtkMRMLNodeFactory::RegisterCoreNodeClasses ( )

Register the built-in node classes of the MRML core library.

◆ RegisterNodeClass() [1/2]

void vtkMRMLNodeFactory::RegisterNodeClass ( vtkMRMLNode * node)

Register a node class with the node's GetNodeTagName() as tag.

◆ RegisterNodeClass() [2/2]

void vtkMRMLNodeFactory::RegisterNodeClass ( vtkMRMLNode * node,
const char * tagName )

Register a node class, using node as prototype. If tagName is nullptr then the node's GetNodeTagName() is used. A class already registered with the same tag is replaced.

◆ SafeDownCast()

static vtkMRMLNodeFactory * vtkMRMLNodeFactory::SafeDownCast ( vtkObject * o)
static

Member Data Documentation

◆ RegisteredAbstractNodeClassTypeDisplayNames

std::map<std::string, std::string> vtkMRMLNodeFactory::RegisteredAbstractNodeClassTypeDisplayNames
protected

Definition at line 112 of file vtkMRMLNodeFactory.h.

◆ RegisteredNodeClasses

std::vector<vtkMRMLNode*> vtkMRMLNodeFactory::RegisteredNodeClasses
protected

Definition at line 110 of file vtkMRMLNodeFactory.h.

◆ RegisteredNodeTags

std::vector<std::string> vtkMRMLNodeFactory::RegisteredNodeTags
protected

Definition at line 111 of file vtkMRMLNodeFactory.h.


The documentation for this class was generated from the following file: