Slicer  4.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkMRMLUnitNode Class Reference

Node that holds the information about a unit. More...

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

Inheritance diagram for vtkMRMLUnitNode:
Inheritance graph
Collaboration diagram for vtkMRMLUnitNode:
Collaboration graph

Public Types

typedef vtkMRMLNode Superclass
- Public Types inherited from vtkMRMLNode
enum  {
  HierarchyModifiedEvent = 16000, IDChangedEvent = 16001, ReferenceAddedEvent, ReferenceModifiedEvent,
  ReferenceRemovedEvent, ReferencedNodeModifiedEvent
typedef vtkObject Superclass

Public Member Functions

void Copy (vtkMRMLNode *node) override
Copy the node's attributes to this object More...
vtkMRMLNodeCreateNodeInstance () override
 MRMLNode methods. More...
virtual const char * GetClassName ()
virtual double GetDisplayCoefficient ()
virtual double GetDisplayOffset ()
const char * GetDisplayStringFormat ()
const char * GetDisplayStringFromValue (double value)
virtual double GetDisplayValueFromValue (double value)
virtual double GetMaximumValue ()
virtual double GetMinimumValue ()
const char * GetNodeTagName () override
Get node XML tag name (like Volume, Model) More...
virtual int GetPrecision ()
virtual char * GetPrefix ()
const char * GetQuantity ()
virtual char * GetSuffix ()
virtual double GetValueFromDisplayValue (double value)
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent) override
void ReadXMLAttributes (const char **atts) override
Set node attributes More...
void Reset (vtkMRMLNode *defaultNode) override
 Reimplemented to prevent reset if unit node is a singleton. More...
virtual void SetDisplayCoefficient (double)
virtual void SetDisplayOffset (double)
virtual void SetMaximumValue (double)
virtual void SetMinimumValue (double)
void SetName (const char *name) override
virtual void SetPrecision (int)
virtual void SetPrefix (const char *)
void SetQuantity (const char *quantity)
virtual void SetSuffix (const char *)
void WriteXML (ostream &of, int indent) override
Write this node's information to a MRML file in XML format. More...
- Public Member Functions inherited from vtkMRMLNode
vtkMRMLNodeAddAndObserveNodeReferenceID (const char *referenceRole, const char *referencedNodeID, vtkIntArray *events=nullptr)
 Add and observe a reference node from this node for a specific referenceRole. More...
vtkMRMLNodeAddNodeReferenceID (const char *referenceRole, const char *referencedNodeID)
 Convenience method that adds a referencedNodeID at the end of the list. More...
void AddNodeReferenceRole (const char *referenceRole, const char *mrmlAttributeName=nullptr, vtkIntArray *events=nullptr)
 Add a referenceRole. More...
virtual void AddToSceneOff ()
virtual void AddToSceneOn ()
virtual void CopyContent (vtkMRMLNode *node, bool deepCopy=true)
 Copy node contents from another node of the same type. Does not copy node ID, Scene, Name, SingletonTag, HideFromEditors, AddToScene, UndoEnabled, and node references. If deepCopy is set to false then a shallow copy of bulk data (such as image or mesh data) could be made; copying may be faster but the node may share some data with the source node instead of creating an independent copy. More...
virtual void CopyReferences (vtkMRMLNode *node)
 Copy the references of the node into this. More...
void CopyWithScene (vtkMRMLNode *node)
 Copy everything (including Scene and ID) from another node of the same type. More...
void DisableModifiedEventOff ()
void DisableModifiedEventOn ()
virtual int EndModify (int previousDisableModifiedEventState)
 End modifying the node. More...
virtual int GetAddToScene ()
 node added to MRML scene. More...
const char * GetAttribute (const char *name)
 Get value of a name value pair attribute. More...
std::vector< std::string > GetAttributeNames ()
 Get all attribute names. More...
void GetAttributeNames (vtkStringArray *attributeNames)
 Get all attribute names. Python-wrappable version. More...
virtual vtkIntArray * GetContentModifiedEvents ()
virtual char * GetDescription ()
virtual int GetDisableModifiedEvent ()
 Turn on/off generating InvokeEvent for set macros. More...
virtual int GetHideFromEditors ()
 Describes if the node is hidden. More...
virtual char * GetID ()
 ID use by other nodes to reference this node in XML. More...
virtual int GetInMRMLCallbackFlag ()
 Flags to avoid event loops. More...
virtual int GetModifiedEventPending ()
virtual char * GetName ()
vtkMRMLNodeGetNodeReference (const char *referenceRole)
const char * GetNodeReferenceID (const char *referenceRole)
 Utility function that returns the first node id for a specific referenceRole. More...
void GetNodeReferenceIDs (const char *referenceRole, std::vector< const char *> &referencedNodeIDs)
 Return a list of the referenced node IDs. More...
void GetNodeReferenceRoles (std::vector< std::string > &roles)
void GetNodeReferences (const char *referenceRole, std::vector< vtkMRMLNode *> &nodes)
 Return a list of the referenced nodes. More...
vtkMRMLNodeGetNthNodeReference (const char *referenceRole, int n)
 Get referenced MRML node for a specific referenceRole. More...
const char * GetNthNodeReferenceID (const char *referenceRole, int n)
 Return the string of the Nth node ID for a specific reference role. More...
const char * GetNthNodeReferenceRole (int n)
int GetNumberOfNodeReferenceRoles ()
int GetNumberOfNodeReferences (const char *referenceRole)
 Return the number of node IDs for a specific reference role (and nodes as they always have the same size). More...
virtual int GetSaveWithScene ()
 Save node with MRML scene. More...
virtual vtkMRMLSceneGetScene ()
 Get the scene this node has been added to. More...
virtual int GetSelectable ()
 Describes if the node is selectable. More...
virtual int GetSelected ()
 Get/Set for Selected. More...
virtual char * GetSingletonTag ()
virtual bool GetUndoEnabled ()
virtual bool HasCopyContent () const
 Returns true if the class supports deep and shallow copying node content. More...
bool HasNodeReferenceID (const char *referenceRole, const char *referencedNodeID)
 Return true if referencedNodeID is in the node ID list for a specific referenceRole. More...
virtual void HideFromEditorsOff ()
virtual void HideFromEditorsOn ()
virtual void InvokeCustomModifiedEvent (int eventId, void *callData=nullptr)
 This method allows the node to compress events. More...
virtual int InvokePendingModifiedEvent ()
 Invokes any modified events that are pending. More...
bool IsSingleton ()
void Modified () override
 Customized version of Modified() allowing to compress vtkCommand::ModifiedEvent. More...
virtual void OnNodeAddedToScene ()
void PrintSelf (ostream &os, vtkIndent indent) override
virtual void ProcessChildNode (vtkMRMLNode *)
 Set dependencies between this node and a child node when parsing XML file. More...
virtual void ProcessMRMLEvents (vtkObject *caller, unsigned long event, void *callData)
 Propagate events generated in mrml. More...
void RemoveAttribute (const char *name)
 Remove attribute with the specified name. More...
void RemoveNodeReferenceIDs (const char *referenceRole)
 Remove all node IDs and associated nodes for a specific referenceRole. More...
void RemoveNthNodeReferenceID (const char *referenceRole, int n)
 Convenience method that removes the Nth node ID from the list. More...
virtual void SaveWithSceneOff ()
virtual void SaveWithSceneOn ()
virtual void SelectableOff ()
virtual void SelectableOn ()
virtual void SelectedOff ()
virtual void SelectedOn ()
virtual void SetAddToScene (int)
void SetAddToSceneNoModify (int value)
vtkMRMLNodeSetAndObserveNodeReferenceID (const char *referenceRole, const char *referencedNodeID, vtkIntArray *events=nullptr)
 Set and observe a reference node from this node for a specific referenceRole. More...
vtkMRMLNodeSetAndObserveNthNodeReferenceID (const char *referenceRole, int n, const char *referencedNodeID, vtkIntArray *events=nullptr)
 Set and observe the Nth node ID for a specific reference role. More...
void SetAttribute (const char *name, const char *value)
 Set a name value pair attribute. More...
virtual void SetDescription (const char *)
 Text description of this node, to be set by the user. More...
void SetDisableModifiedEvent (int onOff)
virtual void SetHideFromEditors (int)
void SetInMRMLCallbackFlag (int flag)
vtkMRMLNodeSetNodeReferenceID (const char *referenceRole, const char *referencedNodeID)
 Set a reference to a node with specified nodeID from this node for a specific referenceRole. More...
vtkMRMLNodeSetNthNodeReferenceID (const char *referenceRole, int n, const char *referencedNodeID)
 Set a N-th reference from this node with specified referencedNodeID for a specific referenceRole. More...
virtual void SetSaveWithScene (int)
virtual void SetScene (vtkMRMLScene *scene)
 This method is for internal use only. Use AddNode method of vtkMRMLScene to add a node to the scene. More...
virtual void SetSceneReferences ()
 Update the references of the node to the scene. More...
virtual void SetSelectable (int)
virtual void SetSelected (int)
void SetSingletonOff ()
void SetSingletonOn ()
virtual void SetSingletonTag (const char *)
 Tag that make this node a singleton in the scene. More...
virtual void SetUndoEnabled (bool)
virtual int StartModify ()
 Start modifying the node. Disable Modify events. More...
virtual void UndoEnabledOff ()
virtual void UndoEnabledOn ()
virtual void UpdateReferenceID (const char *oldID, const char *newID)
 Update the stored reference to another node in the scene. More...
virtual void UpdateReferences ()
 The method should remove all pointers and observations to all nodes that are not in the scene anymore. More...
virtual void UpdateScene (vtkMRMLScene *)
const char * URLDecodeString (const char *inString)
 Decode a URL string. More...
const char * URLEncodeString (const char *inString)
 Encode a URL string. More...
virtual void WriteNodeBodyXML (ostream &of, int indent)
 Write this node's body to a MRML file in XML format. More...
std::string XMLAttributeDecodeString (const std::string &inString)
 Decode an XML attribute string. More...
std::string XMLAttributeEncodeString (const std::string &inString)
 Encode an XML attribute string (replaces special characters by code sequences) More...

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkMRMLUnitNodeNew ()
static vtkMRMLUnitNodeSafeDownCast (vtkObject *o)
- Static Public Member Functions inherited from vtkMRMLNode
static int IsTypeOf (const char *type)
static vtkMRMLNodeSafeDownCast (vtkObject *o)

Protected Member Functions

virtual const char * GetDisplayStringFromDisplayValueString (const char *displayValue)
virtual const char * GetDisplayValueStringFromDisplayValue (double displayValue)
void operator= (const vtkMRMLUnitNode &)
 vtkMRMLUnitNode ()
 vtkMRMLUnitNode (const vtkMRMLUnitNode &)
std::string WrapValueWithPrefix (const std::string &value) const
std::string WrapValueWithPrefixAndSuffix (const std::string &value) const
std::string WrapValueWithSuffix (const std::string &value) const
 ~vtkMRMLUnitNode () override
- Protected Member Functions inherited from vtkMRMLNode
virtual const char * GetMRMLAttributeNameFromReferenceRole (const char *refRole)
 Return the mrml attribute name (if found) associated with a reference role. Return 0 otherwise. More...
virtual const char * GetReferenceRoleFromMRMLAttributeName (const char *attName)
 Return the reference role (if found) associated with the attribute name found in a MRML scene file. Return 0 otherwise. More...
virtual char * GetTempURLString ()
void GetUpdatedReferencedNodeEventList (int &oldReferencedNodeUseCount, int &newReferencedNodeUseCount, vtkIntArray *oldConsolidatedEventList, vtkIntArray *newConsolidatedEventList, vtkMRMLNode *oldReferencedNode, vtkMRMLNode *newReferencedNode, vtkMRMLNodeReference *referenceToIgnore, vtkIntArray *newEvents)
virtual void InvalidateNodeReferences ()
virtual bool IsReferenceRoleGeneric (const char *refRole)
 Return true if the reference role is generic (ends with '/') or false otherwise. More...
virtual void OnNodeReferenceAdded (vtkMRMLNodeReference *reference)
virtual void OnNodeReferenceModified (vtkMRMLNodeReference *reference)
 Called when a referenced node pointer is modified. More...
virtual void OnNodeReferenceRemoved (vtkMRMLNodeReference *reference)
 Called when a referenced node pointer is removed (set to nullptr). More...
void operator= (const vtkMRMLNode &)
void ParseReferencesAttribute (const char *attValue, std::set< std::string > &references)
virtual void SetTempURLString (const char *)
 Get/Set the string used to manage encoding/decoding of strings/URLs with special characters. More...
vtkMRMLNodeUpdateNodeReferenceEventObserver (vtkMRMLNode *oldReferencedNode, vtkMRMLNode *newReferencedNode, vtkIntArray *newEvents, vtkMRMLNodeReference *referenceToIgnore)
virtual void UpdateNodeReferences (const char *referenceRole=nullptr)
virtual void UpdateNthNodeReference (const char *referenceRole, int n)
 vtkMRMLNode ()
 vtkMRMLNode (const vtkMRMLNode &)
 ~vtkMRMLNode () override
 critical to have a virtual destructor! More...

Protected Attributes

double DisplayCoefficient
double DisplayOffset
std::string LastDisplayString
std::string LastValueString
double MaximumValue
double MinimumValue
int Precision
char * Prefix
char * Suffix
- Protected Attributes inherited from vtkMRMLNode
int AddToScene {1}
AttributesType Attributes
vtkIntArray * ContentModifiedEvents
char * Description {nullptr}
int HideFromEditors {0}
char * ID {nullptr}
int InMRMLCallbackFlag {0}
Flag to avoid event loops More...
vtkCallbackCommand * MRMLCallbackCommand
 Holders for MRML callbacks. More...
char * Name {nullptr}
NodeReferenceEventsType NodeReferenceEvents
std::map< std::string, std::string > NodeReferenceMRMLAttributeNames
NodeReferencesType NodeReferences
int SaveWithScene {true}
vtkWeakPointer< vtkMRMLSceneScene
int Selectable {1}
int Selected {0}
bool UndoEnabled {false}

Additional Inherited Members

- Protected Types inherited from vtkMRMLNode
typedef std::map< std::string, std::string > AttributesType
typedef std::map< std::string, vtkSmartPointer< vtkIntArray > > NodeReferenceEventsType
typedef std::vector< vtkSmartPointer< vtkMRMLNodeReference > > NodeReferenceListType
typedef std::map< std::string, NodeReferenceListTypeNodeReferencesType
- Static Protected Member Functions inherited from vtkMRMLNode
static void MRMLCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)

Detailed Description

Node that holds the information about a unit.

A unit node holds all the information regarding a given unit. A unit belongs to a quantity. A quantity can have multiple different units. For example, the units meter and millimeter belong to the quantity "length". Units are singleton.

Definition at line 33 of file vtkMRMLUnitNode.h.

Member Typedef Documentation

◆ Superclass

Definition at line 37 of file vtkMRMLUnitNode.h.

Constructor & Destructor Documentation

◆ vtkMRMLUnitNode() [1/2]

vtkMRMLUnitNode::vtkMRMLUnitNode ( )

◆ ~vtkMRMLUnitNode()

vtkMRMLUnitNode::~vtkMRMLUnitNode ( )

◆ vtkMRMLUnitNode() [2/2]

vtkMRMLUnitNode::vtkMRMLUnitNode ( const vtkMRMLUnitNode )

Member Function Documentation

◆ Copy()

void vtkMRMLUnitNode::Copy ( vtkMRMLNode node)

Copy the node's attributes to this object

Reimplemented from vtkMRMLNode.

◆ CreateNodeInstance()

vtkMRMLNode* vtkMRMLUnitNode::CreateNodeInstance ( )

MRMLNode methods.

Implements vtkMRMLNode.

◆ GetClassName()

virtual const char* vtkMRMLUnitNode::GetClassName ( )

Reimplemented from vtkMRMLNode.

◆ GetDisplayCoefficient()

virtual double vtkMRMLUnitNode::GetDisplayCoefficient ( )

Multiply the value with DisplayCoefficient for display.

See also
GetDisplayOffset(), GetDisplayValueFromValue()

◆ GetDisplayOffset()

virtual double vtkMRMLUnitNode::GetDisplayOffset ( )

Addition the value with DisplayOffset for display.

See also
GetDisplayCoefficient(), GetDisplayValueFromValue()

◆ GetDisplayStringFormat()

const char* vtkMRMLUnitNode::GetDisplayStringFormat ( )

Return the display string format to use with printf/sprintf. Note that the value passed to the format must be the DisplayValue. For example: "%#6.3g mm" if the precision is 3 and the suffix mm.

See also
GetDisplayValueFromValue(), GetDisplayStringFromValue()

◆ GetDisplayStringFromDisplayValueString()

virtual const char* vtkMRMLUnitNode::GetDisplayStringFromDisplayValueString ( const char *  displayValue)

◆ GetDisplayStringFromValue()

const char* vtkMRMLUnitNode::GetDisplayStringFromValue ( double  value)

Return the display value with prefix and suffix.

See also
GetDisplayValueFromValue(), GetValueFromDisplayValue()

◆ GetDisplayValueFromValue()

virtual double vtkMRMLUnitNode::GetDisplayValueFromValue ( double  value)

Return the value multiplied by DisplayCoefficient and summed by DisplayOffset.

See also
GetValueFromDisplayValue(), GetDisplayStringFromValue(), GetDisplayCoefficient(), GetDisplayOffset()

◆ GetDisplayValueStringFromDisplayValue()

virtual const char* vtkMRMLUnitNode::GetDisplayValueStringFromDisplayValue ( double  displayValue)

◆ GetMaximumValue()

virtual double vtkMRMLUnitNode::GetMaximumValue ( )

Set/Get the maximum value that can be attributed to the unit. For example, the maximum value for a speed should (probably) be 3e6.

See also
SetMinimumValue(), GetMinimumValue()

◆ GetMinimumValue()

virtual double vtkMRMLUnitNode::GetMinimumValue ( )

Set/Get the minimum value that can be attributed to the unit. For example, the minimum value for Kelvins should be 0.

See also
SetMaximumValue(), GetMaximumValue()

◆ GetNodeTagName()

const char* vtkMRMLUnitNode::GetNodeTagName ( )

Get node XML tag name (like Volume, Model)

Implements vtkMRMLNode.

Definition at line 59 of file vtkMRMLUnitNode.h.

◆ GetPrecision()

virtual int vtkMRMLUnitNode::GetPrecision ( )

Set/Get the precision (i.e. number of decimals) of the unit. Default is 3.

◆ GetPrefix()

virtual char* vtkMRMLUnitNode::GetPrefix ( )

Set/Get the unit prefix. Default is "".

See also
SetPrefix(), GetPrefix()

◆ GetQuantity()

const char* vtkMRMLUnitNode::GetQuantity ( )

Set/Get the quantity the unit belongs to. A unit can only have one quantity. Default is "".

◆ GetSuffix()

virtual char* vtkMRMLUnitNode::GetSuffix ( )

Set/Get the unit suffix. For example, the suffix for the unity meter would be "m". Default is "".

See also
SetSuffix(), GetSuffix()

◆ GetValueFromDisplayValue()

virtual double vtkMRMLUnitNode::GetValueFromDisplayValue ( double  value)

Return the value subtracted from DisplayOffset and divided by DisplayCoefficient.

See also
GetDisplayValueFromValue(), GetDisplayStringFromValue()

◆ IsA()

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

Reimplemented from vtkMRMLNode.

◆ IsTypeOf()

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

◆ New()

static vtkMRMLUnitNode* vtkMRMLUnitNode::New ( )

◆ operator=()

void vtkMRMLUnitNode::operator= ( const vtkMRMLUnitNode )

◆ PrintSelf()

void vtkMRMLUnitNode::PrintSelf ( ostream &  os,
vtkIndent  indent 

◆ ReadXMLAttributes()

void vtkMRMLUnitNode::ReadXMLAttributes ( const char **  atts)

Set node attributes

Reimplemented from vtkMRMLNode.

◆ Reset()

void vtkMRMLUnitNode::Reset ( vtkMRMLNode defaultNode)

Reimplemented to prevent reset if unit node is a singleton.

Reimplemented from vtkMRMLNode.

◆ SafeDownCast()

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

◆ SetDisplayCoefficient()

virtual void vtkMRMLUnitNode::SetDisplayCoefficient ( double  )

◆ SetDisplayOffset()

virtual void vtkMRMLUnitNode::SetDisplayOffset ( double  )

◆ SetMaximumValue()

virtual void vtkMRMLUnitNode::SetMaximumValue ( double  )

◆ SetMinimumValue()

virtual void vtkMRMLUnitNode::SetMinimumValue ( double  )

◆ SetName()

void vtkMRMLUnitNode::SetName ( const char *  name)

Set the name of the unit. Since unit nodes are singleton, this name must be unique throughout the scene.

Reimplemented from vtkMRMLNode.

◆ SetPrecision()

virtual void vtkMRMLUnitNode::SetPrecision ( int  )

◆ SetPrefix()

virtual void vtkMRMLUnitNode::SetPrefix ( const char *  )

◆ SetQuantity()

void vtkMRMLUnitNode::SetQuantity ( const char *  quantity)

◆ SetSuffix()

virtual void vtkMRMLUnitNode::SetSuffix ( const char *  )

◆ WrapValueWithPrefix()

std::string vtkMRMLUnitNode::WrapValueWithPrefix ( const std::string &  value) const

Helper functions that wrap the given string with the suffix and or the prefix. A space is used between the prefix and the value as well as between the value and the suffix.

◆ WrapValueWithPrefixAndSuffix()

std::string vtkMRMLUnitNode::WrapValueWithPrefixAndSuffix ( const std::string &  value) const

◆ WrapValueWithSuffix()

std::string vtkMRMLUnitNode::WrapValueWithSuffix ( const std::string &  value) const

◆ WriteXML()

void vtkMRMLUnitNode::WriteXML ( ostream &  of,
int  indent 

Write this node's information to a MRML file in XML format.

Reimplemented from vtkMRMLNode.

Member Data Documentation

◆ DisplayCoefficient

double vtkMRMLUnitNode::DisplayCoefficient

Definition at line 163 of file vtkMRMLUnitNode.h.

◆ DisplayOffset

double vtkMRMLUnitNode::DisplayOffset

Definition at line 164 of file vtkMRMLUnitNode.h.

◆ LastDisplayString

std::string vtkMRMLUnitNode::LastDisplayString

Definition at line 167 of file vtkMRMLUnitNode.h.

◆ LastValueString

std::string vtkMRMLUnitNode::LastValueString

Definition at line 166 of file vtkMRMLUnitNode.h.

◆ MaximumValue

double vtkMRMLUnitNode::MaximumValue

Definition at line 161 of file vtkMRMLUnitNode.h.

◆ MinimumValue

double vtkMRMLUnitNode::MinimumValue

Definition at line 160 of file vtkMRMLUnitNode.h.

◆ Precision

int vtkMRMLUnitNode::Precision

Definition at line 159 of file vtkMRMLUnitNode.h.

◆ Prefix

char* vtkMRMLUnitNode::Prefix

Definition at line 157 of file vtkMRMLUnitNode.h.

◆ Suffix

char* vtkMRMLUnitNode::Suffix

Definition at line 158 of file vtkMRMLUnitNode.h.

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