4.3.3. WorkspaceManager package¶
4.3.3.1. Submodules¶
4.3.3.2. WorkspaceManager.DirectorySpace module¶
-
class
WorkspaceManager.DirectorySpace.
DirectorySpace
(name='', base_path='', relative_path='')[source]¶ Bases:
Savable.Savable
A space based on a directory in the file system.
-
name
¶ str
The name of the space.
-
base_path
¶ str
The absolute path of the directory containing the space.
-
relative_path
¶ str
The path of the directory space relatively to base_path.
-
subdirs
¶ dict(str,str)
The useful subdirectories (path,name). The paths are the keys
-
qt_directory
¶ QDir
The directory corresponding to that workspace
-
delete
()[source]¶ Delete the directory space (and its contents).
Raises: AssertionError
– If the directory does not exist or can not be deleted.
-
4.3.3.3. WorkspaceManager.Scene module¶
-
class
WorkspaceManager.Scene.
Scene
(name, base_path, relative_path='')[source]¶ Bases:
DirectorySpace.DirectorySpace
A scene containing all its images.
- Class Attributes:
- RECONSTRUCTION_OUTPUT_DIR RECONSTRUCTION_TEMP_DIR RECONSTRUCTION_PICTURE_DIR
-
name
¶ str
The name of the scene. It must be unique in the workspace. For example : “Shooting ENSEEIHT”. Default is “scene_n” where n is the current number of scenes in workspace.
-
base_path
¶ str
The path of the scene’s workspace.
-
relative_path
¶ str
The path of the scene relatively to base_path.
-
subdirs
¶ dict(str,str)
The useful subdirectories (path,name).
-
PICTURES_DIR
= 'pictures_set'¶
-
RECONSTRUCTION_OUTPUT_DIR
= 'reconstruction_output'¶
-
RECONSTRUCTION_PICTURE_DIR
= 'reconstruction_pictures'¶
-
RECONSTRUCTION_TEMP_DIR
= 'reconstruction_temp'¶
-
THUMBNAILS_DIR
= 'thumbnails'¶
-
delete
()[source]¶ Delete the scene and remove its access from the workspace.
It must not be called by itself but by the workspace !
4.3.3.4. WorkspaceManager.Workspace module¶
-
class
WorkspaceManager.Workspace.
Workspace
(name='', base_path='', relative_path='')[source]¶ Bases:
DirectorySpace.DirectorySpace
A workspace containing its own configuration and scenes.
-
name
¶ str
The name of the workspace.
-
base_path
¶ str
The absolute path of the directory containing the workspace.
-
relative_path
¶ str
The path of the workspace relatively to base_path.
-
subdirs
¶ dict(str,str)
The useful subdirectories (path,name).
-
scenes
¶ dict(str,Scene)
The dictionnary of the scenes it contains. Keys are the scene paths.
-
current_scene
¶ str
The path of the current scene.
-
qt_directory
¶ QDir
The directory corresponding to that workspace.
-
pictureModel
¶ PictureModel
A model for the view.
-
delete
()[source]¶ Delete the workspace (and its contents).
It must not be called by itself but by the workspace manager !
Raises: AssertionError
– If the workspace directory does not exist or can not be deleted.
-
delete_scene
(scene_path)[source]¶ Delete the scene identified by its local path.
Parameters: scene_path (str) – The path (relatively to the workspace) of the scene to delete.
-
static
deserialize
(serial)[source]¶ Recreate a Workspace object from its serialization.
Parameters: serial (dict()) – The serialized version of a Workspace object.
-
get_current_scene
()[source]¶ Get the current scene of the workspace.
Returns: The current scene.
Return type: Raises: AssertionError
– If no current scene.AssertionError
– If the current scene has disappeared.
-
4.3.3.5. WorkspaceManager.WorkspaceManager module¶
-
class
WorkspaceManager.WorkspaceManager.
WorkspaceManager
(pictureModel)[source]¶ Bases:
object
Manages the workspace.
Will handle all interactions between user and modules and the working space. This class is responsible for managing files inside the workspace and for communicating any change through signals.
-
workspaces
¶ dict(str,Workspace)
All the workspaces.
-
current_workspace
¶ str
The current workspace.
-
workspaces_model
¶ QStringListModel
The list model (for qml) of the workspaces.
-
scenes_model
¶ QStringListModel
The list model (for qml) of the scenes in the current workspace.
-
pictureModel
¶ PictureModel
The picture model
-
change_scene
(scene_path)[source]¶ Change the current scene identified by its path in the current workspace.
Parameters: scene_path (str) – The relative path of the scene to select in the current workspace. Raises: AssertionError
– If the scene directory does not exist.
-
change_workspace
(workspace_path)[source]¶ Change the current workspace.
Parameters: workspace_path (str) – The absolute path of the workspace to select.
-
close_workspace
(workspace_path)[source]¶ Close the workspace (it is not visible anymore in the list of open workspaces. :param workspace_path: The absolute path of the workspace to close.
-
delete_scene
(scene_path)[source]¶ Delete the scene identified by its path in the current workspace.
Parameters: scene_path (str) – The relative path of the scene to delete in the current workspace. Raises: AssertionError
– If the scene directory does not exist or can not be deleted.
-
delete_workspace
(workspace_path)[source]¶ Delete the workspace identified by its abolute path.
Parameters: workspace_path (str) – The absolute path of the workspace to delete. Raises: AssertionError
– If the workspace directory does not exist or can not be deleted.
-
get_current_workspace
()[source]¶ Get the current workspace.
Returns: The current workspace.
Return type: Raises: AssertionError
– If no current workspace.AssertionError
– If the current workspace has disappeared.
-
get_picture_dir
()[source]¶ Retrieve the folder where all pictures are stored
Returns: The absolute path to the folder Return type: str
-
get_scene_output_dir
()[source]¶ Returns the absolute path of the output directory for ply files.
Returns: The absolute path of directory. Return type: str
-
get_scene_temp_output_dir
()[source]¶ Returns the temporary output directory for scene reconstructions.
Returns: The absolute path of the temporary directory. Return type: str
-
get_selected_picture_dir
()[source]¶ Returns the absolute path of the directory containing the pictures used for reconstruction.
Returns: The absolute path of the picture directory. Return type: str
-
import_pictures
(picturesPath)[source]¶ Import pictures from an external location into the workspace :param picturesPath: The list of path to import
-
new_scene
(name='', path='')[source]¶ Create a new scene in the current workspace.
Parameters: - name (str) – The name of the scene.
- path (str) – The relative path of the scene in the workspace.
Raises: AssertionError
– If there is no current workspace or the scene already exists.
-
new_workspace
(name='', base_path='')[source]¶ Create a new workspace.
Parameters: - name (str) – The name of the workspace.
- base_path (str) – The absolute path of the directory that will contain the new workspace.
-
open_workspace
(directory_path, file_name)[source]¶ Open an existi ng workspace from a save file of the workspace.
Parameters: - directory_path (str) – The absolute path of the directory containing the file.
- file_name (str) – The name of the file containing the save of the workspace.
-
prepare_reconstruction
(picturesList)[source]¶ Copy all file describe in picturesList inside the temporary reconstruction folder
Parameters: picturesList (list<Picture>) – The list of pictures that should be copied
-
save_workspace
(workspace_path, file_name='workspaceSettings')[source]¶ Save the workspace in a file.
Parameters: - workspace_path (str) – The absolute path of the workspace to save.
- file_name (str) – The name of the file to save into.
-
set_current_scene
(scene_path)[source]¶ Change the current scene identified by its path in the current workspace.
Parameters: scene_path (str) – The relative path of the scene to select in the current workspace. Raises: AssertionError
– If the scene directory does not exist.
-