18#ifndef __vtkSlicerApplicationLogic_h
19#define __vtkSlicerApplicationLogic_h
28#include <vtkCollection.h>
38class vtkPersonInformation;
41class ProcessingTaskQueue;
45class WriteDataRequest;
55 void PrintSelf(ostream& os, vtkIndent indent)
override;
112 int displayData =
false,
int deleteFile =
false);
136 vtkMTimeType
RequestAddNodeReference(
const std::string &referencingNode,
const std::string& referencedNode,
const std::string& role);
162 std::vector<std::string> &targetIDs,
163 std::vector<std::string> &sourceIDs,
164 int displayData =
false,
165 int deleteFile =
false);
193 static bool IsEmbeddedModule(
const std::string& filePath,
const std::string& applicationHomeDir,
194 const std::string& slicerRevision);
200 static bool IsPluginInstalled(
const std::string& filePath,
const std::string& applicationHomeDir);
203 static bool IsPluginBuiltIn(
const std::string& filePath,
const std::string& applicationHomeDir,
204 const std::string& slicerRevision);
257 std::mutex ProcessingThreadActiveLock;
258 std::mutex ProcessingTaskQueueLock;
259 std::mutex ModifiedQueueActiveLock;
260 std::mutex ModifiedQueueLock;
261 std::mutex ReadDataQueueActiveLock;
262 std::mutex ReadDataQueueLock;
263 std::mutex WriteDataQueueActiveLock;
264 std::mutex WriteDataQueueLock;
265 vtkTimeStamp RequestTimeStamp;
266 std::thread ProcessingThread;
267 std::vector<std::thread> NetworkingThreads;
268 int ProcessingThreadActive;
269 int ModifiedQueueActive;
270 int ReadDataQueueActive;
271 int WriteDataQueueActive;
273 ProcessingTaskQueue* InternalTaskQueue;
274 ModifiedQueue* InternalModifiedQueue;
275 ReadDataQueue* InternalReadDataQueue;
276 WriteDataQueue* InternalWriteDataQueue;
278 vtkPersonInformation* UserInformation;
vtkMRMLApplicationLogic()
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)
static void ProcessingThreaderCallback(vtkSlicerApplicationLogic *appLogic)
Callback used by a std::thread to start a processing thread.
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 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.
static void NetworkingThreaderCallback(vtkSlicerApplicationLogic *appLogic)
Callback used by a std::thread to start a networking thread.
vtkMTimeType RequestModified(vtkObject *)
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)