DzStorable Class Reference
[Core Objects]

Base class for items that save to their own file. More...

Inheritance diagram for DzStorable:

DzBase QObject Object DzGeometry DzMap DzMorphDeltas DzVertexMesh DzVertexMap DzPolyMesh DzSubDMesh DzMRMMesh List of all members.

Methods

Boolean fileExists ()
DzStorable find (String filename)
String getExtension ()
String getFilename ()
String getFiletype ()
Number getFileVersion ()
String getFullFilename ()
Number getNumStorablesInScene ()
Boolean hasChanged ()
Boolean hasFilename ()
void markChanged ()
Boolean needsSave (String filename)
void resetFileName ()
Boolean usesDeferredLoading ()

Signals

void unableToFindFile (String file)
 Signature: "unableToFindFile(const QString&)"

Detailed Description

Base class for items that save to their own file.

Base class for raw data items that can be archived in the native file format. Instances of this class can be shared between multiple container classes to avoid duplication of large data sets in memory.


Member Function Documentation

Boolean DzStorable::fileExists (  ) 

Returns:
true if the file for this object exists. Uses the full filename (with path) to validate.

DzStorable DzStorable::find ( String  filename  ) 

Tries to find the instance with the given filename that may have been already loaded.

Parameters:
filename The name of the file to find a storable for.
Returns:
Matching instance, NULL if not found.

String DzStorable::getExtension (  ) 

Returns:
The three-letter extension to associate with storable items of each derived type.

String DzStorable::getFilename (  ) 

Returns:
The partial path for this item. The partial path is the path starting from one of the user's content directories. If no content directories match the root path for this item, the full path is returned.

String DzStorable::getFiletype (  ) 

Returns:
The filetype string that is saved as part of the file information

Number DzStorable::getFileVersion (  ) 

Returns:
The version number of the file that this item was read from. 0 if the item has not been successfully read from a file.

String DzStorable::getFullFilename (  ) 

Returns:
The full filename (with path) that this object was last read from or last saved to.

int DzStorable::getNumStorablesInScene (  ) 

Returns:
The number of storable items in the scene.
See also:
DzScene::getNumStorablesInScene()

Boolean DzStorable::hasChanged (  ) 

Returns:
true if this object has been altered since loading/creation.

Boolean DzStorable::hasFilename (  ) 

Returns:
true if this object has been read from or written to a file and so has a file path that it corresponds to.

void DzStorable::markChanged (  ) 

Called to mark this item as changed (needs saving).

Boolean DzStorable::needsSave ( String  filename  ) 

Called by the framework before saving the file - if this function returns true, the file is saved, overwriting any existing file. If it returns false, the file will not be saved.

Parameters:
filename The name of the file that will be saved.
Returns:
true if this object needs to be saved to a file, the default implementation returns true if hasChanged() is true, or if the given file does not exist.

void DzStorable::resetFileName (  ) 

Called to set the file name to an empty string (needs saving).

DzStorable::unableToFindFile ( String  file  )  [signal]

Signature: "unableToFindFile(const QString&)"

Transmitted when a content file could not be found while loading.

Parameters:
file The name and path of the file that could not be located.

Boolean DzStorable::usesDeferredLoading (  ) 

Derived classes should override this to indicate if they use deferred loading (do not load the object data at main file load time). If a class returns false, it must call loadFromFile() at a later time to invoke loading of its data.


Generated on Thu Sep 24 12:21:15 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.