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;
72 void CreateProcessingThread();
75 void TerminateProcessingThread();
103 vtkMTimeType RequestModified(vtkObject *);
113 vtkMTimeType RequestReadFile(
const char *refNode,
const char *filename,
114 int displayData =
false,
int deleteFile =
false);
122 vtkMTimeType RequestUpdateParentTransform(
const std::string &updatedNode,
const std::string& parentTransformNode);
130 vtkMTimeType RequestUpdateSubjectHierarchyLocation(
const std::string &updatedNode,
const std::string& siblingNode);
138 vtkMTimeType RequestAddNodeReference(
const std::string &referencingNode,
const std::string& referencedNode,
const std::string& role);
143 unsigned int GetReadDataQueueSize();
151 vtkMTimeType RequestWriteData(
const char *refNode,
const char *filename);
163 vtkMTimeType RequestReadScene(
const std::string& filename,
164 std::vector<std::string> &targetIDs,
165 std::vector<std::string> &sourceIDs,
166 int displayData =
false,
167 int deleteFile =
false);
173 void ProcessModified();
179 void ProcessReadData();
182 void ProcessWriteData();
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);
209 static std::string GetModuleShareDirectory(
const std::string& moduleName,
const std::string& filePath);
212 static std::string GetModuleSlicerXYShareDirectory(
const std::string& filePath);
215 static std::string GetModuleSlicerXYLibDirectory(
const std::string& filePath);
219 vtkPersonInformation* GetUserInformation();
223 static void RequestModifiedCallback(vtkObject* caller,
unsigned long eid,
void* clientData,
void* callData);
231 static itk::ITK_THREAD_RETURN_TYPE ProcessingThreaderCallback(
void * );
234 static itk::ITK_THREAD_RETURN_TYPE NetworkingThreaderCallback(
void * );
237 void ProcessProcessingTasks();
240 void ProcessNetworkingTasks();
246 void ProcessReadSceneData( ReadDataRequest &req );
247 void ProcessWriteSceneData( WriteDataRequest &req );
253 virtual void SetCurrentThreadPriorityToBackground();
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;
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