22 #ifndef __vtkMRMLSequenceBrowserNode_h 23 #define __vtkMRMLSequenceBrowserNode_h 25 #include "vtkSlicerSequencesModuleMRMLExport.h" 45 void PrintSelf(ostream& os, vtkIndent indent)
override;
50 ProxyNodeModifiedEvent = 21001,
51 IndexDisplayFormatModifiedEvent
61 NumberOfRecordingSamplingModes
67 IndexDisplayAsIndex = 0,
69 NumberOfIndexDisplayModes
79 void WriteXML(ostream& of,
int indent)
override;
89 std::string SetAndObserveMasterSequenceNodeID(
const char *sequenceNodeID);
94 std::string AddSynchronizedSequenceNode(
const char* synchronizedSequenceNodeId);
97 std::string AddSynchronizedSequenceNodeID(
const char* synchronizedSequenceNodeId);
103 void RemoveSynchronizedSequenceNode(
const char* nodeId);
106 void RemoveAllSequenceNodes();
109 void GetSynchronizedSequenceNodes(std::vector< vtkMRMLSequenceNode* > &synchronizedDataNodes,
bool includeMasterNode=
false);
110 void GetSynchronizedSequenceNodes(vtkCollection* synchronizedDataNodes,
bool includeMasterNode=
false);
113 int GetNumberOfSynchronizedSequenceNodes(
bool includeMasterNode =
false);
116 bool IsSynchronizedSequenceNode(
const char* sequenceNodeId,
bool includeMasterNode =
false);
119 bool IsSynchronizedSequenceNodeID(
const char* sequenceNodeId,
bool includeMasterNode =
false);
120 bool IsSynchronizedSequenceNode(
vtkMRMLSequenceNode* sequenceNode,
bool includeMasterNode =
false);
123 vtkGetMacro(PlaybackActive,
bool);
124 vtkSetMacro(PlaybackActive,
bool);
125 vtkBooleanMacro(PlaybackActive,
bool);
128 vtkGetMacro(PlaybackRateFps,
double);
129 vtkSetMacro(PlaybackRateFps,
double);
132 vtkGetMacro(PlaybackItemSkippingEnabled,
bool);
133 vtkSetMacro(PlaybackItemSkippingEnabled,
bool);
134 vtkBooleanMacro(PlaybackItemSkippingEnabled,
bool);
137 vtkGetMacro(PlaybackLooped,
bool);
138 vtkSetMacro(PlaybackLooped,
bool);
139 vtkBooleanMacro(PlaybackLooped,
bool);
142 vtkGetMacro(SelectedItemNumber,
int);
143 vtkSetMacro(SelectedItemNumber,
int);
146 vtkGetMacro(RecordingActive,
bool);
147 void SetRecordingActive(
bool recording);
148 vtkBooleanMacro(RecordingActive,
bool);
151 vtkGetMacro(RecordMasterOnly,
bool);
152 vtkSetMacro(RecordMasterOnly,
bool);
153 vtkBooleanMacro(RecordMasterOnly,
bool);
156 vtkSetMacro(RecordingSamplingMode,
int);
157 void SetRecordingSamplingModeFromString(
const char *recordingSamplingModeString);
159 vtkGetMacro(RecordingSamplingMode,
int);
160 virtual std::string GetRecordingSamplingModeAsString();
163 static std::string GetRecordingSamplingModeAsString(
int recordingSamplingMode);
164 static int GetRecordingSamplingModeFromString(
const std::string &recordingSamplingModeString);
167 vtkSetMacro(IndexDisplayMode,
int);
168 void SetIndexDisplayModeFromString(
const char *indexDisplayModeString);
170 vtkGetMacro(IndexDisplayMode,
int);
171 virtual std::string GetIndexDisplayModeAsString();
174 void SetIndexDisplayFormat(std::string displayFormat);
176 vtkGetMacro(IndexDisplayFormat, std::string);
179 static std::string GetIndexDisplayModeAsString(
int indexDisplayMode);
180 static int GetIndexDisplayModeFromString(
const std::string &indexDisplayModeString);
183 int SelectNextItem(
int selectionIncrement=1);
186 int SelectFirstItem();
189 int SelectLastItem();
192 int GetNumberOfItems();
203 static bool warningLogged =
false;
206 vtkWarningMacro(
"vtkMRMLSequenceBrowserNode::GetVirtualOutputDataNode is deprecated, use vtkMRMLSequenceBrowserNode::GetProxyNode method instead");
207 warningLogged =
true;
209 return this->GetProxyNode(sequenceNode);
215 static bool warningLogged =
false;
218 vtkWarningMacro(
"vtkMRMLSequenceBrowserNode::SetOverwriteTargetNodeName is deprecated," 219 <<
" use vtkMRMLSequenceBrowserNode::SetOverwriteProxyName method instead");
220 warningLogged =
true;
222 this->SetOverwriteProxyName(
nullptr, overwrite);
228 static bool warningLogged =
false;
231 vtkWarningMacro(
"vtkMRMLSequenceBrowserNode::SetDeepCopyVirtualNodes is deprecated, use vtkMRMLSequenceBrowserNode::SetSaveChanges method instead");
232 warningLogged =
true;
234 this->SetSaveChanges(
nullptr, !deepcopy);
240 void GetAllProxyNodes(std::vector< vtkMRMLNode* > &
nodes);
241 void GetAllProxyNodes(vtkCollection*
nodes);
247 static bool warningLogged =
false;
250 vtkWarningMacro(
"vtkMRMLSequenceBrowserNode::GetAllVirtualOutputDataNodes is deprecated," 251 <<
" use vtkMRMLSequenceBrowserNode::GetAllProxyNodes method instead");
252 warningLogged =
true;
254 this->GetAllProxyNodes(
nodes);
258 bool IsProxyNode(
const char* nodeId);
261 bool IsProxyNodeID(
const char* nodeId);
264 void RemoveProxyNode(
const std::string& postfix);
266 void RemoveAllProxyNodes();
269 bool IsAnySequenceNodeRecording();
290 void ProcessMRMLEvents( vtkObject *caller,
unsigned long event,
void *callData )
override;
293 virtual void SaveProxyNodesState();
297 std::string GetFormattedIndexValue(
int index);
302 static bool ValidateFormatString(std::string& validatedFormat, std::string& prefix, std::string& suffix,
303 const std::string& requestedFormat,
const std::string& typeString);
313 void FixSequenceNodeReferenceRoleName();
318 std::string GenerateSynchronizationPostfix();
320 std::string GetSynchronizationPostfixFromSequenceID(
const char* sequenceNodeID);
323 bool PlaybackActive{
false};
324 double PlaybackRateFps{10.0};
325 bool PlaybackItemSkippingEnabled{
true};
326 bool PlaybackLooped{
true};
327 int SelectedItemNumber{-1};
329 bool RecordingActive{
false};
332 bool RecordMasterOnly{
false};
342 int LastPostfixIndex{0};
345 struct SynchronizationProperties;
346 std::map< std::string, SynchronizationProperties* > SynchronizationPropertiesMap;
RecordingSamplingModeType
Modes for determining recording frame rate.
vtkMRMLNode * GetVirtualOutputDataNode(vtkMRMLSequenceNode *sequenceNode)
Deprecated method!
void SetDeepCopyVirtualNodes(bool deepcopy)
Deprecated method!
std::vector< std::string > SynchronizationPostfixes
double RecordingTimeOffsetSec
const char * GetNodeTagName() override
Get unique node XML tag name (like Volume, Model)
virtual void ReadXMLAttributes(const char **atts)
void operator=(const vtkMRMLNode &)
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
MRML node for representing a sequence of MRML nodes.
virtual void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData)
Propagate events generated in mrml.
virtual void Copy(vtkMRMLNode *node)
Copy node contents from another node of the same type. Does not copy node ID and Scene. Performs deep copy - an independent copy is created from all data, including bulk data.
void GetAllVirtualOutputDataNodes(vtkCollection *nodes)
Deprecated method!
virtual void WriteXML(ostream &of, int indent)
double LastSaveProxyNodesStateTimeSec
IndexDisplayModeType
Modes displaying index for the user.
void PrintSelf(ostream &os, vtkIndent indent) override
virtual void OnNodeReferenceAdded(vtkMRMLNodeReference *reference)
std::string IndexDisplayFormat
Abstract Superclass for all specific types of MRML nodes.
void SetOverwriteTargetNodeName(bool overwrite)
Deprecated method!