21#ifndef vtkSlicerSceneViewsModuleLogic_h
22#define vtkSlicerSceneViewsModuleLogic_h
30#include "vtkSlicerSceneViewsModuleLogicExport.h"
53 void PrintSelf(ostream& os, vtkIndent indent)
override;
63 std::string description =
"",
65 vtkImageData* screenshot =
nullptr,
66 bool saveDisplayNodes =
true,
67 bool saveViewNodes =
true,
71 std::string description =
"",
73 vtkImageData* screenshot =
nullptr,
77 std::string description =
"",
79 vtkImageData* screenshot =
nullptr,
86 void ModifyNthSceneView(
int sceneViewIndex, std::string name, std::string,
int screenshotType, vtkImageData* screenshot);
91 void UpdateNthSceneView(
int sceneViewIndex,
bool updateExistingNodes =
true,
bool saveDisplayNodes =
true,
bool saveViewNodes =
true);
92 void UpdateNthSceneView(
int sceneViewIndex, vtkCollection* savedNodes,
bool updateExistingNodes =
true);
93 void UpdateNthSceneView(
int sceneViewIndex, std::vector<vtkMRMLNode*> savedNodes,
bool updateExistingNodes =
true);
248 std::string m_StringHolder;
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
MRML node for representing a sequence of MRML nodes.
MRML node for representing a volume (image stack).
void RegisterNodes() override
Register MRML Node classes to Scene. Gets called automatically when the MRMLScene is attached to this...
std::string GetNthSceneViewDescription(int index)
std::string GetNthNodeAttribute(vtkMRMLNode *proxyTextNode, int index, std::string attributeName)
bool IsSceneViewNode(vtkMRMLNode *node)
Returns true if the node is a scene view node.
void CreateSceneView(std::vector< vtkMRMLNode * > savedNodes, std::string name, std::string description="", int screenshotType=ScreenShotType3D, vtkImageData *screenshot=nullptr, vtkMRMLSequenceBrowserNode *sequenceBrowser=nullptr)
vtkMRMLSequenceNode * GetOrAddSceneViewSequenceNode(vtkMRMLSequenceBrowserNode *sequenceBrowser, vtkMRMLNode *proxyNode)
Returns the sequence node for a given proxy node. Will create a new vtkMRMLSequenceNode if none exist...
void SetNthSceneViewName(int index, std::string name)
Set/Get the name of an existing sceneView.
bool RestoreSceneView(int sceneViewIndex)
Restore a sceneView.
void GetViewNodes(std::vector< vtkMRMLNode * > &viewNodes)
Add all view-related nodes to the vector.
bool RemoveSceneView(int index)
Remove a sceneView.
void CreateSceneView(vtkCollection *savedNodes, std::string name, std::string description="", int screenshotType=ScreenShotType3D, vtkImageData *screenshot=nullptr, vtkMRMLSequenceBrowserNode *sequenceBrowser=nullptr)
void OnMRMLSceneEndImport() override
~vtkSlicerSceneViewsModuleLogic() override
vtkMRMLSequenceBrowserNode * GetSceneViewSequenceBrowserNode(bool addMissingNode)
int GetNthSceneViewScreenshotType(int index)
vtkMRMLSequenceBrowserNode * ConvertSceneViewNodeToSequenceBrowserNode(vtkMRMLSceneViewNode *sceneView, vtkMRMLSequenceBrowserNode *sequenceBrowserNode)
Convert the specified vtkMRMLSceneViewNode to use sequences.
void CreateSceneView(std::string name, std::string description="", int screenshotType=ScreenShotType3D, vtkImageData *screenshot=nullptr, bool saveDisplayNodes=true, bool saveViewNodes=true, vtkMRMLSequenceBrowserNode *sequenceBrowser=nullptr)
Create a sceneView..
void OnMRMLNodeModified(vtkMRMLNode *node) override
Called when a scene view sequence browser node is modified.
static const char * GetSceneViewNodeAttributeName()
@ SceneViewsModifiedEvent
static const char * GetSceneViewScreenshotReferenceRole()
void ModifyNthSceneView(int sceneViewIndex, std::string name, std::string, int screenshotType, vtkImageData *screenshot)
Modify the metadata of an existing sceneView.
std::string MoveSceneViewDown(std::string id)
Move sceneView up.
void OnMRMLSceneNodeAdded(vtkMRMLNode *node) override
Called when MRMLScene events are invoked.
vtkImageData * GetNthSceneViewScreenshot(int index)
static const char * GetSceneViewNameAttributeName()
std::vector< std::string > GetViewNodeClasses()
static const char * GetSceneViewDescriptionAttributeName()
void UpdateNthSceneView(int sceneViewIndex, bool updateExistingNodes=true, bool saveDisplayNodes=true, bool saveViewNodes=true)
static vtkSlicerSceneViewsModuleLogic * New()
vtkMRMLVolumeNode * GetNthSceneViewScreenshotDataNode(int index)
Return the screenshot data node in the Nth scene view index.
void ConvertSceneViewNodesToSequenceBrowserNodes(vtkMRMLScene *scene)
Convert all existing vtkMRMLSceneViewNode in the scene to use Sequences.
void SetMRMLSceneInternal(vtkMRMLScene *newScene) override
Initialize listening to MRML events.
static const char * GetSceneViewNodeAttributeValue()
int SceneViewIndexToSequenceBrowserIndex(int sceneViewIndex)
Convert the index of the scene view to the corresponding value index of the sequence browser that hol...
std::string GetScreenShotTypeAsString(int type)
Convert string to/from scene view enum type.
void SetNthSceneViewScreenshot(int index, vtkImageData *screenshot)
Set/Get the screenshot of an existing sceneView.
void SetNthSceneViewScreenshotType(int index, int type)
Set/Get the screenshot type of an existing sceneView.
std::string GetNthSceneViewName(int index)
static const char * GetSceneViewScreenshotTypeAttributeName()
int GetScreenShotTypeFromString(const std::string &type)
void GetDisplayNodes(std::vector< vtkMRMLNode * > &displayNodes)
Add all display-related nodes to the vector.
int GetNumberOfSceneViews()
Get the number of sceneViews.
vtkSlicerSceneViewsModuleLogic()
vtkMRMLVolumeNode * GetSceneViewScreenshotProxyNode(vtkMRMLSequenceBrowserNode *sequenceBrowser=nullptr)
Returns the proxy node containing the scene view screenshot.
vtkMRMLSequenceBrowserNode * GetNthSceneViewSequenceBrowserNode(int index)
void GetDisplayNodeClasses(std::vector< std::string > &displayNodeTypes)
vtkMRMLSequenceBrowserNode * AddNewSceneViewSequenceBrowserNode()
void SetNthNodeAttribute(vtkMRMLNode *proxyTextNode, int index, std::string attributeName, std::string text)
vtkMRMLNode * GetNthSceneViewDataNode(int index, vtkMRMLNode *proxyNode)
Return the data node for the specified proxy node in the Nth scene view index.
void PrintSelf(ostream &os, vtkIndent indent) override
void UpdateNthSceneView(int sceneViewIndex, vtkCollection *savedNodes, bool updateExistingNodes=true)
vtkMRMLVolumeNode * GetNthSceneViewScreenshotProxyNode(int index)
Returns the proxy node in the scene for the Nth scene view.
@ ScreenShotTypeFullLayout
std::string MoveSceneViewUp(std::string id)
Move sceneView up.
void SetNthSceneViewDescription(int index, std::string description)
Set/Get the description of an existing sceneView.
void OnMRMLSceneEndRestore() override
void UpdateNthSceneView(int sceneViewIndex, std::vector< vtkMRMLNode * > savedNodes, bool updateExistingNodes=true)
bool RestoreSceneView(std::string sceneViewName)
void GetViewNodeClasses(std::vector< std::string > &viewNodeTypes)
int GetSceneViewIndexByName(std::string name)
Returns the index for a scene view with the given name. If no matching scene view is found,...
std::vector< std::string > GetDisplayNodeClasses()
void OnMRMLSceneEndClose() override