18#ifndef __vtkSlicerApplicationLogic_h
19#define __vtkSlicerApplicationLogic_h
28#include <vtkCollection.h>
31#include <itkPlatformMultiThreader.h>
40class vtkPersonInformation;
43class ProcessingTaskQueue;
47class WriteDataRequest;
57 void PrintSelf(ostream& os, vtkIndent indent)
override;
114 int displayData =
false,
int deleteFile =
false);
138 vtkMTimeType
RequestAddNodeReference(
const std::string &referencingNode,
const std::string& referencedNode,
const std::string& role);
164 std::vector<std::string> &targetIDs,
165 std::vector<std::string> &sourceIDs,
166 int displayData =
false,
167 int deleteFile =
false);
195 static bool IsEmbeddedModule(
const std::string& filePath,
const std::string& applicationHomeDir,
196 const std::string& slicerRevision);
202 static bool IsPluginInstalled(
const std::string& filePath,
const std::string& applicationHomeDir);
205 static bool IsPluginBuiltIn(
const std::string& filePath,
const std::string& applicationHomeDir,
206 const std::string& slicerRevision);
259 itk::PlatformMultiThreader::Pointer ProcessingThreader;
260 std::mutex ProcessingThreadActiveLock;
261 std::mutex ProcessingTaskQueueLock;
262 std::mutex ModifiedQueueActiveLock;
263 std::mutex ModifiedQueueLock;
264 std::mutex ReadDataQueueActiveLock;
265 std::mutex ReadDataQueueLock;
266 std::mutex WriteDataQueueActiveLock;
267 std::mutex WriteDataQueueLock;
268 vtkTimeStamp RequestTimeStamp;
269 int ProcessingThreadId;
270 std::vector<int> NetworkingThreadIDs;
271 int ProcessingThreadActive;
272 int ModifiedQueueActive;
273 int ReadDataQueueActive;
274 int WriteDataQueueActive;
276 ProcessingTaskQueue* InternalTaskQueue;
277 ModifiedQueue* InternalModifiedQueue;
278 ReadDataQueue* InternalReadDataQueue;
279 WriteDataQueue* InternalWriteDataQueue;
281 vtkPersonInformation* UserInformation;
A set of MRML Nodes that supports serialization and undo/redo.
MRML node for storing information about the active nodes in the scene.
vtkMTimeType RequestAddNodeReference(const std::string &referencingNode, const std::string &referencedNode, const std::string &role)
static bool IsEmbeddedModule(const std::string &filePath, const std::string &applicationHomeDir, const std::string &slicerRevision)
unsigned int GetReadDataQueueSize()
static void RequestModifiedCallback(vtkObject *caller, unsigned long eid, void *clientData, void *callData)
void CreateProcessingThread()
Create a thread for processing.
vtkMTimeType RequestReadScene(const std::string &filename, std::vector< std::string > &targetIDs, std::vector< std::string > &sourceIDs, int displayData=false, int deleteFile=false)
RequestEvents
List of events potentially fired by the application logic.
static bool IsPluginBuiltIn(const std::string &filePath, const std::string &applicationHomeDir, const std::string &slicerRevision)
Return true if the plugin identified with its filePath is a built-in Slicer module.
void TerminateProcessingThread()
Shutdown the processing thread.
static itk::ITK_THREAD_RETURN_TYPE NetworkingThreaderCallback(void *)
Callback used by a MultiThreader to start a networking thread.
static vtkSlicerApplicationLogic * New()
The Usual vtk class functions.
void SetMRMLSceneDataIO(vtkMRMLScene *scene, vtkMRMLRemoteIOLogic *remoteIOLogic, vtkDataIOManagerLogic *dataIOManagerLogic)
vtkMTimeType RequestWriteData(const char *refNode, const char *filename)
static std::string GetModuleSlicerXYShareDirectory(const std::string &filePath)
Get Slicer-X.Y share directory associated with module located in filePath.
vtkPersonInformation * GetUserInformation()
int ScheduleTask(vtkSlicerTask *)
vtkMTimeType RequestUpdateSubjectHierarchyLocation(const std::string &updatedNode, const std::string &siblingNode)
void ProcessProcessingTasks()
Task processing loop that is run in the processing thread.
~vtkSlicerApplicationLogic() override
static std::string GetModuleSlicerXYLibDirectory(const std::string &filePath)
Get Slicer-X.Y lib directory associated with module located in filePath.
vtkMTimeType RequestModified(vtkObject *)
static itk::ITK_THREAD_RETURN_TYPE ProcessingThreaderCallback(void *)
Callback used by a MultiThreader to start a processing thread.
void PrintSelf(ostream &os, vtkIndent indent) override
void ProcessWriteData()
Process a request to write data from a referenced node.
static bool IsPluginInstalled(const std::string &filePath, const std::string &applicationHomeDir)
static std::string GetModuleShareDirectory(const std::string &moduleName, const std::string &filePath)
Get share directory associated with moduleName located in filePath.
vtkMTimeType RequestReadFile(const char *refNode, const char *filename, int displayData=false, int deleteFile=false)
void ProcessNetworkingTasks()
Networking Task processing loop that is run in a networking thread.
vtkSlicerApplicationLogic()
vtkMTimeType RequestUpdateParentTransform(const std::string &updatedNode, const std::string &parentTransformNode)
void ProcessWriteSceneData(WriteDataRequest &req)
virtual void SetCurrentThreadPriorityToBackground()
void ProcessReadSceneData(ReadDataRequest &req)