DzContentMgr Class Reference
[Manager ObjectsContent Access Objects]

Content library manager. More...

Inheritance diagram for DzContentMgr:

DzBase QObject Object List of all members.

Properties

Boolean autoRefresh
Boolean showBuiltInContent
String startupScene

Methods

void addContentDirectory (String directory)
void addImportDirectory (String directory)
void addPoserDirectory (String directory)
Boolean alterDBContent (DzContentDBEntry entry)
void categorizeDBContent (Number categoryIndex, Number contentIndex, Boolean useNew=false)
Number createDBCategory (String sCategoryPath, String fileCalling="")
void deleteDBCategory (Number categoryIndex)
Boolean doContentScan (Boolean forceScan=false)
Boolean doContentSearch ()
void doContentVerificationScan ()
void doDirNumCheck ()
void fileCreated (String filename)
DzContentFolder findBaseDirectory (String path, Boolean useImportFolders)
String findFile (String partialPath)
String getAbsolutePath (String relativePath, Boolean useImportFolders)
DzContentFolder getBuiltInContentDirectory ()
String getBuiltInContentDirectoryPath ()
DzContentFolder getContentDirectory (Number which)
String getContentDirectoryPath (Number which)
String getContentPath (DzNode node)
DzContentReplaceMgr getContentReplaceMgr ()
void getDBCategory (Number index, DzCategoriesDBEntry entry)
Array getDBCategoryContent (Number categoryIndex)
Number getDBCategoryParentIndex (Number categoryIndex)
Number getDBCategoryRootIndex (Number categoryIndex)
void getDBContentData (Number contentIndex, DzContentDBEntry entry)
Number getDBContentIndex (String path, String file)
Number getDBContentIndex (String absolutePath)
Array getDBItemCategoryIndexList (Number itemIndex)
Array getDBSubCategoryList (Number parentCategoryIndex)
DzContentFolder getImportDirectory (Number which)
String getImportDirectoryPath (Number which)
Number getNumContentDirectories ()
Number getNumImportDirectories ()
Number getNumPoserDirectories ()
DzContentFolder getPoserDirectory (Number which)
String getPoserDirectoryPath (Number which)
String getRelativePath (String absolutePath, Boolean useImportFolders)
String getTypeForContentFile (String fullPath)
String getTypeForNode (DzNode node)
Boolean importFile (String path)
Number insertDBContent (String path, String file, String name, String timestamp, Number categoryIndex, Boolean useNew)
Boolean isClothingType (String type)
Boolean isConformingType (String type)
Boolean isFigureType (String type)
Boolean isHairType (String type)
Boolean isNeedsBaseFigureType (String type)
Boolean isPresetForFigureType (String type)
Boolean isPresetType (String type)
Boolean isPropType (String type)
Boolean isReplaceableType (String type)
void moveDBCategory (Number categoryIndex, Number toIndex)
Boolean openFile (String filename, Boolean merge=true)
Boolean openNativeFile (String filename, Boolean isMerge)
void refresh (Boolean reloadIcons=false)
void refreshCategories ()
void removeAllContentDirectories ()
void removeAllImportDirectories ()
void removeAllPoserDirectories ()
Boolean removeContentDirectory (String directory)
Boolean removeImportDirectory (String directory)
Boolean removePoserDirectory (String directory)
Boolean renameDBCategory (Number categoryIndex, String newName)
void setCheckCompatibilityOn (Boolean useCheckCompatibility)
void setUseDatabaseSearch (Boolean useDatabase)
void uncategorizeDBContent (Number categoryIndex, Number contentIndex)
void updateCategoryType ()
Boolean usingCheckCompatibility ()
Boolean usingDatabaseSearch ()

Signals

void autoRefreshChanged (Boolean onOff)
 Signature: "autoRefreshChanged(bool)"
void categoryListChanged ()
 Signature: "categoryListChanged()"
void categoryTypeChanged ()
 Signature: "categoryTypeChanged()"
void changeViewType (DzContentManagerViewType type)
 Signature: "changeViewType(DzContentManagerViewType)"
void contentDirectoryListChanged ()
 Signature: "contentDirectoryListChanged()"
void folderTreeChanged ()
 Signature: "folderTreeChanged()"
void importDirectoryListChanged ()
 Signature: "importDirectoryListChanged()"
void newFileCreated (String filename)
 Signature: "newFileCreated(const QString&)"
void onNewSceneChanged (String filename)
 Signature: "onNewSceneChanged(const QString&)"
void poserDirectoryListChanged ()
 Signature: "poserDirectoryListChanged()"
void startupSceneChanged (String filename)
 Signature: "startupSceneChanged(const QString&)"

Detailed Description

Content library manager.

Manager that is responsible for all the content folder & file trees that are accessible from the content library.

There is only one instance of this manager in an application. This instance is created and owned by DzApp. Don't create an instance of this class, but rather request a pointer to it from DzApp via DzApp::getContentMgr().


Member Function Documentation

void DzContentMgr::addContentDirectory ( String  directory  ) 

Adds a content directory to the list.

Parameters:
directory The path of the directory to add.

void DzContentMgr::addImportDirectory ( String  directory  ) 

Adds an import directory to the list.

Parameters:
directory The name of the directory to add.

void DzContentMgr::addPoserDirectory ( String  directory  ) 

Adds a Poser import directory to the list. Poser import paths are folders one level above any Poser Runtime folder.

Parameters:
directory The Poser directory to add

Boolean DzContentMgr::alterDBContent ( DzContentDBEntry  entry  ) 

Parameters:
entry entry to update
Updates the entry in the database according to the values in the given entry. Update is based on the entery.id(). Returns true if successful

DzContentMgr::autoRefreshChanged ( Boolean  onOff  )  [signal]

Signature: "autoRefreshChanged(bool)"

Emitted when the enabled state of the auto refresh has changed

Parameters:
onOff The new state of auto refresh.

DzContentMgr::categorizeDBContent ( Number  categoryIndex,
Number  contentIndex,
Boolean  useNew = false 
)

Parameters:
categoryIndex Index of the category
contentIndex Index of the content
useNew Whether to march this content as new Adds the content from the given category

void DzContentMgr::categoryListChanged (  )  [signal]

Signature: "categoryListChanged()"

Emitted when the list of categories has changed.

void DzContentMgr::categoryTypeChanged (  )  [signal]

Signature: "categoryTypeChanged()"

Emitted when the current category type has changed.

void DzContentMgr::changeViewType ( DzContentManagerViewType  type  )  [signal]

Signature: "changeViewType(DzContentManagerViewType)"

Emitted when the content manager view type has changed.

void DzContentMgr::contentDirectoryListChanged (  )  [signal]

Signature: "contentDirectoryListChanged()"

Emitted when a content directory is added or removed.

Number DzContentMgr::createDBCategory ( String  sCategoryPath,
String  fileCalling = "" 
)

Parameters:
sCategoryPath path for the categry seperated by "/". Categories in the path can be given as category indexes,or category name, but root must be a valid category number. Use "1/" to go from root.
fileCalling Index of the content Creates the given category and returns its index or -1 if unscessful

DzContentMgr::deleteDBCategory ( Number  categoryIndex  ) 

Parameters:
categoryIndex Index of the category
Deletes the given category from the database

Boolean DzContentMgr::doContentScan ( Boolean  forceScan = false  ) 

Scans mapped directories for content to add to the database.

Parameters:
forceScan is true if the scan must be performed. False if a previous scan is sufficient.
Returns:
true if the scan was performed successfully.

bool DzContentMgr::doContentSearch (  ) 

Displays a dialog to the user to perform a Poser content search on the local machine.

Returns:
true if the user accepted and a search was performed.

void DzContentMgr::doContentVerificationScan (  ) 

Prompts the user to rescan all the content in the database and remove invalid content.

void DzContentMgr::doDirNumCheck (  ) 

Causes the content manager to check the number of mapped content directories, and display a warning to the user if it is excessive.

void DzContentMgr::fileCreated ( String  filename  ) 

Notifies the content manager that a new content file has been saved.

DzContentFolder DzContentMgr::findBaseDirectory ( String  path,
Boolean  useImportFolders 
)

Given an absolute path, this method traverses the content directories and attempts to find the base (mapped) folder.

Parameters:
path The absolute path
useImportFolders If true, the import folders will also be searched.
Returns:
The given content folder if successful, otherwise NULL.

String DzContentMgr::findFile ( String  partialPath  ) 

Given a partial path (a file path that is relative to a content directory) this function traverses the DAZ Studio Native content directories to find the given file.

Parameters:
partialPath The releative path to the file to find.
Returns:
The full path to the file if successful, otherwise an empty string.

void DzContentMgr::folderTreeChanged (  )  [signal]

Signature: "folderTreeChanged()"

Emitted when the currently loaded tree of folders has changed and needs to be rebuilt. Usually a result of a call to refresh(), or when one of the content directory lists has changed.

String DzContentMgr::getAbsolutePath ( String  relativePath,
Boolean  useImportFolders 
)

Attempts to locate a file with the given relative path by prepending the path information for each content directory.

Parameters:
relativePath The relative path to find
useImportFolders If true, the import folders will also be searched.
Returns:
The absolute path for the file, or an empty string if the file cannot be found.

DzContentFolder DzContentMgr::getBuiltInContentDirectory (  ) 

Returns:
The built-in content directory used for content and utilities that are shipped with DAZ Studio.

String DzContentMgr::getBuiltInContentDirectoryPath (  ) 

Returns:
The path of the built-in content directory used for content and utilities that are shipped with DAZ Studio.

DzContentFolder DzContentMgr::getContentDirectory ( Number  which  ) 

Parameters:
which The index of the content directory to be returned.
Returns:
The given content directory.

String DzContentMgr::getContentDirectoryPath ( Number  which  ) 

Parameters:
which The index of the content directory to return the path of.
Returns:
The path of the given content directory.

String DzContentMgr::getContentPath ( DzNode  node  ) 

Checks the given node for a source file data item, and returns the path of the source file if one is found.

Parameters:
node The scene node to get the source file of.
Returns:
The path of the source file for the node if the node contains a source file data item, otherwise, an empty string.

DzContentReplaceMgr * DzContentMgr::getContentReplaceMgr (  ) 

Returns:
The content replace manager that belongs to the DzContentMgr.

DzContentMgr::getDBCategory ( Number  index,
DzCategoriesDBEntry  entry 
)

Parameters:
index Index of the content
entry Entry to fill with this category's entry Fills the given entry with the datbase entry if the index exists in the database, otherwise sets the entry's id to -1

Array DzContentMgr::getDBCategoryContent ( Number  categoryIndex  ) 

Parameters:
categoryIndex Index of the category to get the content for
Returns a list of content indexes for the content of the given category.

Number DzContentMgr::getDBCategoryParentIndex ( Number  categoryIndex  ) 

Parameters:
categoryIndex Index of the category Returns the index of the category's parent

Number DzContentMgr::getDBCategoryRootIndex ( Number  categoryIndex  ) 

Parameters:
categoryIndex Index of the category Returns the index of the category's root

DzContentMgr::getDBContentData ( Number  contentIndex,
DzContentDBEntry  entry 
)

Parameters:
contentIndex Index of the content
entry Entry to fill with this content's entry Fills the given entry with the datbase entry if the index exists in the database, otherwise sets the entry's id to -1

Number DzContentMgr::getDBContentIndex ( String  path,
String  file 
)

Parameters:
path Absolute path the the file
file Filename of the file Returns the index of the content or -1 if it is not in the database

Number DzContentMgr::getDBContentIndex ( String  absolutePath  ) 

Parameters:
absolutePath Absolute path of the content to get the path for. Returns the index for the content at the given path or -1 if it is not in the database

Array DzContentMgr::getDBItemCategoryIndexList ( Number  itemIndex  ) 

Parameters:
itemIndex Index of the content item
Returns a list of category indexs this item belongs to

Array DzContentMgr::getDBSubCategoryList ( Number  parentCategoryIndex  ) 

Parameters:
parentCategory Index of the category to get subcategories for
Returns a list of category indexes for the subcategories of the given category.

DzContentFolder DzContentMgr::getImportDirectory ( Number  which  ) 

Parameters:
which The index of the import directory to return.
Returns:
The given inport directory.

String DzContentMgr::getImportDirectoryPath ( Number  which  ) 

Parameters:
which The index of the import directory to return the path of.
Returns:
The path of the given import directory.

Number DzContentMgr::getNumContentDirectories (  ) 

Returns:
The number of content directories

Number DzContentMgr::getNumImportDirectories (  ) 

Returns:
The number of content directories for imported content.

Number DzContentMgr::getNumPoserDirectories (  ) 

Returns:
The number of stored paths to Poser content directories.

DzContentFolder DzContentMgr::getPoserDirectory ( Number  which  ) 

Parameters:
which The index of the Poser directory to return.
Returns:
The given Poser content directory.

String DzContentMgr::getPoserDirectoryPath ( Number  which  ) 

Parameters:
which The index of the Poser directory to return the path of.
Returns:
The path of the given Poser content directory.

String DzContentMgr::getRelativePath ( String  absolutePath,
Boolean  useImportFolders 
)

Attempts to shorten the given absolute path to a path that is relative to one of the current content directories. If the path cannot be shortened, the original string is returned.

Parameters:
absolutePath The path name to make relative
useImportFolders If true, then the import folders will also be searched.
Returns:
A relative path to the file if one can be made, otherwise the original path.

String DzContentMgr::getTypeForContentFile ( String  fullPath  ) 

Looks up the file in the content database to find its type.

Parameters:
fullPath The file to get the type of.
Returns:
The type of the source file if the file is in the content database, otherwise, an empty string.

String DzContentMgr::getTypeForNode ( DzNode  node  ) 

Checks the given node for a source file data item, looks up the item in the content database to find its type.

Parameters:
node The scene node to get the source file type of.
Returns:
The type of the source file for the node if the node contains a source file data item, otherwise, an empty string.

void DzContentMgr::importDirectoryListChanged (  )  [signal]

Signature: "importDirectoryListChanged()"

Emitted when an import directory is added or removed.

Boolean DzContentMgr::importFile ( String  filename  ) 

Imports the file at the given path. A companion script (a DAZ Script file with the same name as the file being imported) will be executed if one exists. This function should only be used in special circumstances. Use openFile() instead.

Parameters:
filename The name of the file to import
Returns:
true if the file was imported successfully, otherwise false.
See also:
openFile()

Number DzContentMgr::insertDBContent ( String  path,
String  file,
String  name,
String  timestamp,
Number  categoryIndex,
Boolean  useNew 
)

Parameters:
path path to the conent (absolute path not including filename)
file filename of the content
name name of the content
timestamp timestamp for the file
categoryIndex category to categorize as
useNew whether to mark as new
Inserts the content in the database at the given category. If content is already in the database it adds the content to the given category only. Returns the index of the content

Boolean DzContentMgr::isClothingType ( String  type  ) 

Parameters:
type The type string to test.
Returns:
true if the type string is of the base type of Clothing.

Boolean DzContentMgr::isConformingType ( String  type  ) 

Parameters:
type The type string to test.
Returns:
true if the type string is of a conforming type.

Boolean DzContentMgr::isFigureType ( String  type  ) 

Parameters:
type The type string to test.
Returns:
true if the type string is of the base type of Figure.

Boolean DzContentMgr::isHairType ( String  type  ) 

Parameters:
type The type string to test.
Returns:
true if the type string is of the base type of Hair.

Boolean DzContentMgr::isNeedsBaseFigureType ( String  type  ) 

Parameters:
type The type string to test.
Returns:
true if the type string is of a type that needs a base figure.

Boolean DzContentMgr::isPresetForFigureType ( String  type  ) 

Parameters:
type The type string to test.
Returns:
true if the type string is a Preset for a Figure.

Boolean DzContentMgr::isPresetType ( String  type  ) 

Parameters:
type The type string to test.
Returns:
true if the type string is of the base type of Preset.

Boolean DzContentMgr::isPropType ( String  type  ) 

Parameters:
type The type string to test.
Returns:
true if the type string is of the base type of Prop.

Boolean DzContentMgr::isReplaceableType ( String  type  ) 

Parameters:
type The type string to test.
Returns:
true if the type string is of a replaceable type.

DzContentMgr::moveDBCategory ( Number  categoryIndex,
Number  toIndex 
)

Parameters:
categoryIndex Index of the category
toIndex Index of the category to move this category under Moves the category to be a subcategory of the target category.

DzContentMgr::newFileCreated ( String  filename  )  [signal]

Signature: "newFileCreated(const QString&)"

Emitted when a new content file has been created.

DzContentMgr::onNewSceneChanged ( String  filename  )  [signal]

Signature: "onNewSceneChanged(const QString&)"

Emitted when the file that is loaded on 'new' has been changed.

Boolean DzContentMgr::openFile ( String  filename,
Boolean  merge = true 
)

Loads the file, either as a native file or an imported file, by calling openNativeFile() or importFile() based on the file extension. For file imports, a companion script (a DAZ Script file with the same name as the file being imported) will be executed if one exists.

Parameters:
filename The name of the file to load.
merge True to merge file, false to open it (applies only for native files).
Returns:
true if the file was loaded successfully, otherwise false.

Boolean DzContentMgr::openNativeFile ( String  filename,
Boolean  isMerge 
)

Loads a native file into the scene. This function should only be used in special circumstances. Use openFile() instead.

Parameters:
filename The name of the file to load
isMerge If true, the file is merged into the scene. If false, the file is loaded as the scene.
Returns:
true if the file was loaded successfully, otherwise false.
See also:
openFile()

void DzContentMgr::poserDirectoryListChanged (  )  [signal]

Signature: "poserDirectoryListChanged()"

Emitted when a poser import directory is added or removed.

void DzContentMgr::refresh ( Boolean  reloadIcons = false  ) 

Refreshes any currently loaded content directories. Call this after any operation that makes changes to the file system, e.g. saving or deleting files, etc.

Parameters:
reloadIcons If true, all file icons will be reloaded - good for updating the current content directory when a file has been saved over, etc.

void DzContentMgr::refreshCategories (  ) 

Triggers a refresh of the categories list.

void DzContentMgr::removeAllContentDirectories (  ) 

Removes all content directories.

void DzContentMgr::removeAllImportDirectories (  ) 

Removes all import directories from the list.

void DzContentMgr::removeAllPoserDirectories (  ) 

Removes all Poser import directories from the list.

Boolean DzContentMgr::removeContentDirectory ( String  directory  ) 

Removes the given directory from the content directory list.

Parameters:
directory The name of the content directory to remove.
Returns:
False if the directory was not found in the list.

Boolean DzContentMgr::removeImportDirectory ( String  directory  ) 

Removes an import directory from the list.

Parameters:
directory The import directory to remove.
Returns:
true if the directory was removed, false if the given directory is not in the list.

Boolean DzContentMgr::removePoserDirectory ( String  directory  ) 

Removes a Poser import directory from the list.

Parameters:
directory The name of the directory to remove.
Returns:
true if the directory was removed, false if the given directory is not in the list.

Boolean DzContentMgr::renameDBCategory ( Number  categoryIndex,
String  newName 
)

Parameters:
categoryIndex Index of the category
newName New name for the category Renames the category to the given name

void DzContentMgr::setCheckCompatibilityOn ( Boolean  useCheckCompatibility  ) 

Turns file compatibility testing on or off.

Parameters:
useCheckCompatibility If true, turns on compatibility checking, if false, turns off compatibility checking.

void DzContentMgr::setUseDatabaseSearch ( Boolean  useDatabaseSearch  ) 

Sets whether or not to use the database.

Parameters:
useDatabaseSearch If true, turns database use on, if false, turns database use off.

DzContentMgr::startupSceneChanged ( String  filename  )  [signal]

Signature: "startupSceneChanged(const QString&)"

Emitted when the startup scene file has changed

Parameters:
filename The new startup scene file.

DzContentMgr::uncategorizeDBContent ( Number  categoryIndex,
Number  contentIndex 
)

Parameters:
categoryIndex Index of the category
contentIndex Index of the content Removes the content from the given category

void DzContentMgr::updateCategoryType (  ) 

Triggers an update of the current category type.

bool DzContentMgr::usingCheckCompatibility (  ) 

Returns:
true if compatibility checking is on, otherwise false.

bool DzContentMgr::usingDatabaseSearch (  ) 

Returns:
true if database use is turned on, otherwise, false.


Member Data Documentation

Boolean DzContentMgr::autoRefresh

This property determines whether or not the content manager automatically refreshes itself.

Boolean DzContentMgr::showBuiltInContent

This property determines whether or not the built-in content is shown in the content pane.

String DzContentMgr::startupScene

This property holds the path of the scene that DAZ Studio will load on startup.


Generated on Thu Sep 24 12:21:11 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.