Skip to main content
Base class for Project API, also see SimProject. #include "Project.hpp" Inheritance diagram for ansys::Project::Project:

Classes

Public Member Functions

Static Public Member Functions

Protected Member Functions

Static Protected Member Functions

Static Protected Attributes

Detailed Description

Base class for Project API, also see SimProject. To use the concepts of Simulation, Run, Output, and Result, a SimProject should be used to create/load the files. The Project object is the low-level service, offering only the File, Folder, and Link capabilities. The project concept is detailed in Project API.

Constructor & Destructor Documentation

Project()

Constructor. A project should be created/opened with newProject()/openProject() Before creating a project, the storage policy should be set up, to configure whether the new project should be a free-storage or a managed project. See getStoragePolicy().

~Project()

virtual Destructor - Will close the project and release the lock (if any).

Member Function Documentation

archiveProject() [1/2]

Compress the project to an archive (keeping current project opened and unchanged) If the project is managed (project folder), flprj+folder are compressed If the project is free storage, all files referenced from project folder (in current or subfolders) are included. Files with global URLs or, relative URL going up (../) will not be saved in the archive. Parameters

archiveProject() [2/2]

Compress the project to an archive (keeping current project opened and unchanged) If the project is managed (project folder), flprj+folder are compressed If the project is free storage, all files referenced from project folder (in current or subfolders) are included. Files with global URLs or, relative URL going up (../) will not be saved in the archive. Parameters

checkProject()

virtual Check if a Project is valid. Parameters Reimplemented in ansys::Project::SimProject.

closeProject()

Close the project and release the lock. All Iterators to this project will become invalid and will be unusable (!ok()).

copyItemTo()

Copy the Iterator item to the target project. This operation only copies the project index data, not the files themselves. The URL pointed by the files is only valid if the new project is appropriately positioned.

copyMetadata()

virtual Copy all metadata values from source to target iterator. Reimplemented in ansys::Project::SimProject.

copyProjectContent()

protected virtual Internal function - Copy a folder iterator content files from a source directory to target. Parameters

copyRuntimeMetadata()

virtual Copy all runtime metadata values from source to target iterator.

eraseProjectLock()

Erase the project lock. Parameters

executeCallback()

Trigger any registered callback for this callback ID.

exportProject()

Export the project to a new location (keeping current project opened and unchanged). This operation will copy/collate the files of the project. Parameters

forkProject()

Split the project at the specified location to a subproject. The specified location (a folder iterator) becomes the new project root, and is linked as a subproject in the current project. A new project file is saved at the specified URL filename. Parameters

get()

For a project Path, return the associated Iterator. The Path is the internal project hiearchy, which might include hidden/virtual subfolders. To get the iterator from a file path on disk, see getIteratorForURL().

getDir()

getInheritedMetadata()

virtual Return the metadata for the current iterator and include relevant data from parent iterators. In Project this only returns the metadata for the current iterator, unless the parent item is a Transparent item, the data is then also included. Used in some UI elements. Reimplemented in ansys::Project::SimProject.

getIteratorForURL()

If the specified URL is a file in the project folder, and registered, returns the Iterator.

getProjectFolder()

Get the URL of the project folder, if enabled by policy.

getProjectId()

Return a project id, which will be the same as in the matching Iterator::getProjectId().

getProjectLocation()

Get the URL of the project file with path.

getProjectLockInfo()

Indicates if the specified project is locked and retrieve the lock information. Parameters Returns Error if the lock info cannot be retrieved.

getRelativePathToFile()

Future feature - Not available.

getReleaseId()

static protected

getStoragePolicy() [1/2]

Return the StoragePolicy for the current project or to configure before newProject().

getStoragePolicy() [2/2]

getSubProjects()

Return the list of subprojects stored in the project.

isLoaded()

Indicates if a project is currrently opened (or newly created with success).

isLocalToProject()

Indicates if the specified absolute URL is inside the project folder.

isOwnedByProject()

If the specified URL is a file in the project folder, and registered, returns true.

isProject()

virtual Check if a filename is a project file (fast read, not entirely checked)

isSubProject()

join()

Join the subproject back to the master project.

loadAllSubProjects()

Load all subprojects stored in the project.

loadSubProject()

Load the specified subproject. Parameters

newProject()

virtual Create a project at the specified URL. The URL is a folder with a *.flprj filename, the location must be writeable. A Storage plug-in must be loaded to accommodate the URL type. ( StorageFilesystem is always available for local file storage). The Project is created from the currently configured ProjectStoragePolicy and a new folder is created alongside the *.flprj file, if applicable.

openProject()

virtual Open a project at the specified URL. From the storage policies, opening the project might fail if the project is locked, or read-only not permitted if locked. Parameters

openProjectFromString()

virtual Open a project by reading its data from a string. Parameters

projectObjectFactory()

protected virtual Create a new object of the current effective project type. Overridden at the SimProject level Reimplemented in ansys::Project::SimProject.

registerCallback()

Register a function callback to a project event. Project events are generated by the project viewer UI contextMenuActions, itemDoubleClick, itemSelected, etc. Parameters

root()

Return the iterator to the project root folder.

saveAsProject()

Save the project index file to a new location. The project content is copied if pFlagCopyFiles is enabled The type of the project is kept the same (project folder enabled/disabled). Parameters

saveProject()

Save the currently opened project.

saveProjectToString()

Save the currently opened project to an XML string.

setDir()

setupNewProject()

protected virtual Reimplemented in ansys::Project::SimProject.

unarchiveProject()

static Extract the project to an from an archive,. It will extract/overwrite the project files in the specified folder

updateFromPolicy()

inline protected virtual Reimplemented in ansys::Project::SimProject.

upgradeProject()

virtual Upgrade project to current version. Upgrading a project might make it incompatible with earlier versions of the software. Some metadata definitions might not be useable with the current software version until the project is updated. See also ProjectStorageManager::setAutoUpgradesEnabled(bool). If automatic upgrades are enabled in the project policy, the project is upgraded when it is read. Reimplemented in ansys::Project::SimProject.

Member Data Documentation

sFormatVersion

static protected