15 #ifndef __vtkMRMLStorageNode_h 16 #define __vtkMRMLStorageNode_h 35 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
41 virtual
void ReadXMLAttributes( const
char** atts) VTK_OVERRIDE;
52 virtual
int ReadData(
vtkMRMLNode *refNode,
bool temporaryFile = false);
62 virtual
void WriteXML(ostream& of,
int indent) VTK_OVERRIDE;
70 virtual const
char* GetNodeTagName() VTK_OVERRIDE = 0;
74 vtkSetStringMacro(FileName);
75 vtkGetStringMacro(FileName);
82 virtual
std::
string GetSupportedFileExtension(const
char* fileName = NULL,
bool includeReadable = true,
bool includeWriteable = true);
86 const
char *GetNthFileName(
int n) const;
90 vtkBooleanMacro(UseCompression,
int);
91 vtkGetMacro(UseCompression,
int);
92 vtkSetMacro(UseCompression,
int);
96 vtkSetStringMacro(URI);
97 vtkGetStringMacro(URI);
100 virtual
void SetURIHandler(vtkURIHandler* uriHandler);
104 virtual
void ProcessMRMLEvents ( vtkObject *caller,
unsigned long event,
void *callData ) VTK_OVERRIDE;
125 vtkGetMacro(ReadState,
int);
126 vtkSetMacro(ReadState,
int);
133 const char *GetStateAsString(
int state);
138 vtkGetMacro(WriteState,
int);
139 vtkSetMacro(WriteState,
int);
151 std::string GetFullNameFromFileName();
152 std::string GetFullNameFromNthFileName(
int n);
165 virtual int SupportedFileType(
const char *fileName);
170 virtual vtkStringArray* GetSupportedReadFileTypes();
175 virtual vtkStringArray* GetSupportedWriteFileTypes();
182 virtual void GetFileExtensionsFromFileTypes(vtkStringArray* inputFileTypes, vtkStringArray* outputFileExtensions);
186 vtkSetStringMacro(WriteFileFormat);
187 vtkGetStringMacro(WriteFileFormat);
191 unsigned int AddFileName (
const char *fileName);
194 void ResetFileNameList();
200 return (
int)this->FileNameList.size();
206 int FileNameIsInList(
const char *fileName);
210 unsigned int AddURI(
const char *uri);
214 const char *GetNthURI(
int n);
224 return (
int)this->URIList.size();
229 void SetDataDirectory(
const char* dataDirName);
232 void SetURIPrefix(
const char *uriPrefix);
236 virtual const char* GetDefaultWriteFileExtension();
242 virtual void SetDefaultWriteFileExtension(
const char* ext);
246 void ResetNthFileName(
int n,
const char *fileName);
249 void ResetNthURI(
int n,
const char *uri);
255 int IsFilePathRelative(
const char * filepath);
261 const char *GetAbsoluteFilePath(
const char *inputPath);
265 vtkSetStringMacro(TempFileName);
266 vtkGetStringMacro(TempFileName);
271 void InvalidateFile();
275 vtkTimeStamp GetStoredTime();
283 virtual bool CanReadInReferenceNode(
vtkMRMLNode* refNode) = 0;
289 virtual bool CanWriteFromReferenceNode(
vtkMRMLNode* refNode);
299 static std::string GetLowercaseExtensionFromFileName(
const std::string& filename);
303 std::string GetFileNameWithoutExtension(
const char* fileName = NULL);
314 virtual int ReadDataInternal(
vtkMRMLNode* refNode);
319 virtual int WriteDataInternal(
vtkMRMLNode* refNode);
355 virtual void InitializeSupportedReadFileTypes();
359 virtual void InitializeSupportedWriteFileTypes();
void SetWriteStateCancelled()
void SetWriteStateScheduled()
void SetWriteStateTransferring()
void SetReadStateScheduled()
std::vector< std::string > FileNameList
An array of file names, should contain the FileName but may not.
virtual void ConfigureForDataExchange()
int GetNumberOfFileNames() const
See how many file names were generated during ExecuteInformation.
void SetReadStatePending()
void operator=(const vtkMRMLNode &)
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
void SetWriteStateTransferDone()
vtkStringArray * SupportedReadFileTypes
List of supported extensions to read in.
void SetReadStateTransferring()
vtkStringArray * SupportedWriteFileTypes
void SetReadStateTransferDone()
void SetWriteStatePending()
A supercalss for other storage nodes.
vtkURIHandler * URIHandler
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
std::string DefaultWriteFileExtension
List of supported extensions to write in.
const char * GetWriteStateAsString()
vtkTimeStamp * StoredTime
std::vector< std::string > URIList
An array of URI's, should contain the URI but may not.
void SetReadStateCancelled()
Abstract Superclass for all specific types of MRML nodes.
const char * GetReadStateAsString()
int GetNumberOfURIs()
Return how many uri names this storage node holds in it's list.