Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkSlicerModelsLogic.h
Go to the documentation of this file.
1 /*=auto=========================================================================
2 
3  Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8 =========================================================================auto=*/
9 
14 
15 #ifndef __vtkSlicerModelsLogic_h
16 #define __vtkSlicerModelsLogic_h
17 
18 // Slicer includes
19 #include "vtkSlicerModuleLogic.h"
20 #include "vtkSlicerModelsModuleLogicExport.h"
21 
22 // MRML includes
23 #include "vtkMRMLStorageNode.h"
24 
25 // VTK includes
26 #include <vtkVersion.h>
27 
29 class vtkMRMLModelNode;
30 class vtkMRMLStorageNode;
32 class vtkAlgorithmOutput;
33 class vtkPolyData;
34 
35 class VTK_SLICER_MODELS_MODULE_LOGIC_EXPORT vtkSlicerModelsLogic
36  : public vtkSlicerModuleLogic
37 {
38  public:
39 
41  static vtkSlicerModelsLogic *New();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
48  vtkMRMLModelNode* AddModel(vtkPolyData* polyData = nullptr);
49 
53  vtkMRMLModelNode* AddModel(vtkAlgorithmOutput* polyData = nullptr);
54 
62  vtkMRMLModelNode* AddModel(const char* filename, int coordinateSystem = vtkMRMLStorageNode::CoordinateSystemLPS,
63  vtkMRMLMessageCollection* userMessages = nullptr);
64 
71  int AddModels(const char* dirname, const char* suffix, int coordinateSystem = vtkMRMLStorageNode::CoordinateSystemLPS,
72  vtkMRMLMessageCollection* userMessages = nullptr);
73 
80  int SaveModel(const char* filename, vtkMRMLModelNode *modelNode, int coordinateSystem = vtkMRMLStorageNode::CoordinateSystemLPS,
81  vtkMRMLMessageCollection* userMessages = nullptr);
82 
84  static void TransformModel(vtkMRMLTransformNode *tnode,
85  vtkMRMLModelNode *modelNode,
86  int transformNormals,
87  vtkMRMLModelNode *modelOut);
88 
92  void SetAllModelsVisibility(int flag);
93 
94 protected:
96  ~vtkSlicerModelsLogic() override;
98  void operator=(const vtkSlicerModelsLogic&);
99 
101  void SetMRMLSceneInternal(vtkMRMLScene* newScene) override;
102 
105  void ObserveMRMLScene() override;
106 
107  void OnMRMLSceneEndImport() override;
108 };
109 
110 #endif
111 
void PrintSelf(ostream &os, vtkIndent indent) override
static vtkSlicerModuleLogic * New()
The Usual vtk class functions.
MRML node for representing a transformation between this node space and a parent node space...
virtual void OnMRMLSceneEndImport()
MRML node to represent a 3D surface model.
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
virtual void ObserveMRMLScene()
virtual void SetMRMLSceneInternal(vtkMRMLScene *newScene)
A superclass for other storage nodes.