18#ifndef __vtkSlicerApplicationLogic_h
19#define __vtkSlicerApplicationLogic_h
28#include <vtkCollection.h>
40class vtkPersonInformation;
43class ProcessingTaskQueue;
47class WriteDataRequest;
55 void PrintSelf(ostream& os, vtkIndent indent)
override;
108 vtkMTimeType
RequestReadFile(
const char* refNode,
const char* filename,
int displayData =
false,
int deleteFile =
false);
132 vtkMTimeType
RequestAddNodeReference(
const std::string& referencingNode,
const std::string& referencedNode,
const std::string& role);
157 std::vector<std::string>& targetIDs,
158 std::vector<std::string>& sourceIDs,
159 int displayData =
false,
160 int deleteFile =
false);
188 static bool IsEmbeddedModule(
const std::string& filePath,
const std::string& applicationHomeDir,
const std::string& slicerRevision);
194 static bool IsPluginInstalled(
const std::string& filePath,
const std::string& applicationHomeDir);
197 static bool IsPluginBuiltIn(
const std::string& filePath,
const std::string& applicationHomeDir,
const std::string& slicerRevision);
268 std::mutex ProcessingThreadActiveLock;
269 std::mutex ProcessingTaskQueueLock;
270 std::mutex ModifiedQueueActiveLock;
271 std::mutex ModifiedQueueLock;
272 std::mutex ReadDataQueueActiveLock;
273 std::mutex ReadDataQueueLock;
274 std::mutex WriteDataQueueActiveLock;
275 std::mutex WriteDataQueueLock;
276 vtkTimeStamp RequestTimeStamp;
277 std::thread ProcessingThread;
278 std::vector<std::thread> NetworkingThreads;
279 int ProcessingThreadActive;
280 int ModifiedQueueActive;
281 int ReadDataQueueActive;
282 int WriteDataQueueActive;
284 ProcessingTaskQueue* InternalTaskQueue;
285 ModifiedQueue* InternalModifiedQueue;
286 ReadDataQueue* InternalReadDataQueue;
287 WriteDataQueue* InternalWriteDataQueue;
289 vtkPersonInformation* UserInformation;
Superclass for displayable manager classes.
Abstract MRML node to represent a view. The class holds the properties common to any view type (3D,...
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)
vtkMRMLAbstractDisplayableManager * GetViewDisplayableManagerByClassName(vtkMRMLAbstractViewNode *viewNode, const char *className) const
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)