18 #ifndef __vtkSlicerApplicationLogic_h 19 #define __vtkSlicerApplicationLogic_h 28 #include <vtkCollection.h> 31 #include <itkPlatformMultiThreader.h> 40 class vtkPersonInformation;
43 class ProcessingTaskQueue;
45 class ReadDataRequest;
47 class WriteDataRequest;
57 void PrintSelf(ostream& os, vtkIndent indent)
override;
73 void PropagateFiducialListSelection();
76 void CreateProcessingThread();
79 void TerminateProcessingThread();
107 vtkMTimeType RequestModified(vtkObject *);
117 vtkMTimeType RequestReadFile(
const char *refNode,
const char *filename,
118 int displayData =
false,
int deleteFile =
false);
126 vtkMTimeType RequestUpdateParentTransform(
const std::string &updatedNode,
const std::string& parentTransformNode);
134 vtkMTimeType RequestUpdateSubjectHierarchyLocation(
const std::string &updatedNode,
const std::string& siblingNode);
142 vtkMTimeType RequestAddNodeReference(
const std::string &referencingNode,
const std::string& referencedNode,
const std::string& role);
147 unsigned int GetReadDataQueueSize();
155 vtkMTimeType RequestWriteData(
const char *refNode,
const char *filename);
167 vtkMTimeType RequestReadScene(
const std::string& filename,
168 std::vector<std::string> &targetIDs,
169 std::vector<std::string> &sourceIDs,
170 int displayData =
false,
171 int deleteFile =
false);
177 void ProcessModified();
183 void ProcessReadData();
186 void ProcessWriteData();
199 static bool IsEmbeddedModule(
const std::string& filePath,
const std::string& applicationHomeDir,
200 const std::string& slicerRevision);
206 static bool IsPluginInstalled(
const std::string& filePath,
const std::string& applicationHomeDir);
209 static bool IsPluginBuiltIn(
const std::string& filePath,
const std::string& applicationHomeDir);
212 static std::string GetModuleShareDirectory(
const std::string& moduleName,
const std::string& filePath);
215 static std::string GetModuleSlicerXYShareDirectory(
const std::string& filePath);
218 static std::string GetModuleSlicerXYLibDirectory(
const std::string& filePath);
222 vtkPersonInformation* GetUserInformation();
226 static void RequestModifiedCallback(vtkObject* caller,
unsigned long eid,
void* clientData,
void* callData);
234 static itk::ITK_THREAD_RETURN_TYPE ProcessingThreaderCallback(
void * );
237 static itk::ITK_THREAD_RETURN_TYPE NetworkingThreaderCallback(
void * );
240 void ProcessProcessingTasks();
243 void ProcessNetworkingTasks();
249 void ProcessReadSceneData( ReadDataRequest &req );
250 void ProcessWriteSceneData( WriteDataRequest &req );
256 virtual void SetCurrentThreadPriorityToBackground();
262 itk::PlatformMultiThreader::Pointer ProcessingThreader;
263 std::mutex ProcessingThreadActiveLock;
264 std::mutex ProcessingTaskQueueLock;
265 std::mutex ModifiedQueueActiveLock;
266 std::mutex ModifiedQueueLock;
267 std::mutex ReadDataQueueActiveLock;
268 std::mutex ReadDataQueueLock;
269 std::mutex WriteDataQueueActiveLock;
270 std::mutex WriteDataQueueLock;
271 vtkTimeStamp RequestTimeStamp;
272 int ProcessingThreadId;
273 std::vector<int> NetworkingThreadIDs;
274 int ProcessingThreadActive;
275 int ModifiedQueueActive;
276 int ReadDataQueueActive;
277 int WriteDataQueueActive;
279 ProcessingTaskQueue* InternalTaskQueue;
280 ModifiedQueue* InternalModifiedQueue;
281 ReadDataQueue* InternalReadDataQueue;
282 WriteDataQueue* InternalWriteDataQueue;
284 vtkPersonInformation* UserInformation;
static vtkMRMLApplicationLogic * New()
A set of MRML Nodes that supports serialization and undo/redo.
RequestEvents
List of events potentially fired by the application logic.
MRML node for storing information about the active nodes in the scene.
void PrintSelf(ostream &os, vtkIndent indent) override