22#ifndef __vtkSlicerUnitsLogic_h
23#define __vtkSlicerUnitsLogic_h
31#include "vtkSlicerUnitsModuleLogicExport.h"
49 void PrintSelf(ostream& os, vtkIndent indent)
override;
54 const char* quantity =
"length",
55 const char* prefix =
"",
56 const char* suffix =
"",
190 const char* quantity =
"length",
191 const char* prefix =
"",
192 const char* suffix =
"",
194 double min = -10000.,
196 double displayCoeff = 1.0,
197 double displayOffset = 0.0);
217 std::map<std::string, std::string> CachedDefaultUnits;
221 bool RestoringDefaultUnits;
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
Node that holds the information about a unit.
static double GetSIPrefixCoefficient(const char *prefix)
Get the coefficient associated with the given SI prefix name.
void OnMRMLSceneStartBatchProcess() override
static double GetDisplayCoefficient(const char *displayPrefix, const char *valuePrefix="", double power=1)
Get the coefficient to transform a value and display it.
static vtkSlicerUnitsLogic * New()
virtual void AddBuiltInUnits(vtkMRMLScene *scene)
Add the default units in the application scene.
void SetMRMLSceneInternal(vtkMRMLScene *newScene) override
Overloaded to add the defaults units in the application scene.
vtkMRMLScene * GetUnitsScene() const
Get the scene with preset unit nodes in it.
vtkMRMLUnitNode * AddUnitNodeToScene(vtkMRMLScene *scene, const char *name, const char *quantity="length", const char *prefix="", const char *suffix="", int precision=3, double min=-10000., double max=10000., double displayCoeff=1.0, double displayOffset=0.0)
Add a unit node to the given scene.
void UpdateFromMRMLScene() override
void SetDefaultUnit(const char *quantity, const char *id)
Change the default unit for the corresponding quantity.
virtual void RegisterNodesInternal(vtkMRMLScene *scene)
void OnMRMLNodeModified(vtkMRMLNode *modifiedNode) override
vtkMRMLUnitNode * AddUnitNode(const char *name, const char *quantity="length", const char *prefix="", const char *suffix="", int precision=3, double min=-10000., double max=10000.)
virtual void AddDefaultsUnits()
Add the built in units in the units logic scene.
void RestoreDefaultUnits()
void RegisterNodes() override
void PrintSelf(ostream &os, vtkIndent indent) override
void ObserveMRMLScene() override
Reimplemented to initialize the scene with unit nodes.
~vtkSlicerUnitsLogic() override
vtkMRMLScene * UnitsScene