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);
192 static bool IsEmbeddedModule(
const std::string& filePath,
const std::string& applicationHomeDir,
const std::string& slicerRevision,
const std::string& extensionsDirBase =
"");
203 const std::string& applicationHomeDir,
204 const std::string& organizationDomain =
"",
205 const std::string& organizationName =
"",
206 const std::string& extensionsDirBase =
"");
211 static bool IsPluginBuiltIn(
const std::string& filePath,
const std::string& applicationHomeDir,
const std::string& slicerRevision,
const std::string& extensionsDirBase =
"");
282 std::mutex ProcessingThreadActiveLock;
283 std::mutex ProcessingTaskQueueLock;
284 std::mutex ModifiedQueueActiveLock;
285 std::mutex ModifiedQueueLock;
286 std::mutex ReadDataQueueActiveLock;
287 std::mutex ReadDataQueueLock;
288 std::mutex WriteDataQueueActiveLock;
289 std::mutex WriteDataQueueLock;
290 vtkTimeStamp RequestTimeStamp;
291 std::thread ProcessingThread;
292 std::vector<std::thread> NetworkingThreads;
293 int ProcessingThreadActive;
294 int ModifiedQueueActive;
295 int ReadDataQueueActive;
296 int WriteDataQueueActive;
298 ProcessingTaskQueue* InternalTaskQueue;
299 ModifiedQueue* InternalModifiedQueue;
300 ReadDataQueue* InternalReadDataQueue;
301 WriteDataQueue* InternalWriteDataQueue;
303 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 IsPluginInstalled(const std::string &filePath, const std::string &applicationHomeDir, const std::string &organizationDomain="", const std::string &organizationName="", const std::string &extensionsDirBase="")
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.
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.
static bool IsEmbeddedModule(const std::string &filePath, const std::string &applicationHomeDir, const std::string &slicerRevision, const std::string &extensionsDirBase="")
vtkMTimeType RequestModified(vtkObject *)
void PrintSelf(ostream &os, vtkIndent indent) override
static bool IsPluginBuiltIn(const std::string &filePath, const std::string &applicationHomeDir, const std::string &slicerRevision, const std::string &extensionsDirBase="")
void ProcessWriteData()
Process a request to write data from a referenced node.
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)