SCENE C++ API  2.1.0
Public Member Functions | Static Public Member Functions | List of all members
LSProject Class Reference

Interface to access information and functionality of SCENE projects. More...

#include <lsproject.h>

+ Inheritance diagram for LSProject:

Public Member Functions

 ~LSProject ()
 Destroys the workspace. More...
 
LSResult::Result saveRevision (LSString commitMessage=L"", LSString author=L"", bool updateProjectPointCloud=false)
 Saves the current workspace state to a new revision within the loaded project. More...
 
LSString getProjectName () const
 Gets the project name of this project. More...
 
LSString getUuid () const
 Returns the unique id of this project. More...
 
LSString getProjectPath () const
 Gets the file system path to the project folder of this project. More...
 
LSString getProjectFilePath () const
 Gets the file system path to the project file of this project. More...
 
LSResult::Result cleanRevisions ()
 Creates a new base revision for the loaded project. More...
 
- Public Member Functions inherited from LSWorkspace
ref_ptr< LSObjectgetRootObject () const
 Gets the root object of the workspace object tree. More...
 
LSPod< std::vector< ref_ptr< LSScan > > > getScans () const
 Convenience function to acquire a list of all scans which are part of the object tree. More...
 
bool importData (const LSString &filePath)
 Imports data from a file into this workspace. More...
 
LSPod< std::vector< ref_ptr< LSObject > > > getSelectedObjects () const
 Gets the current list of selected objects with this workspace. More...
 
ref_ptr< LSPointCloudgetPointCloud () const
 Gets the project point cloud of this workspace. More...
 
LSResult::Result createPointCloud ()
 Creates a project point cloud of all scans in that workspace. More...
 
LSResult::Result deletePointCloud ()
 Deletes the project point cloud. More...
 
ref_ptr< LSPointSelectiongetPointSelection () const
 Gets the current spatial point selection of this workspace. More...
 

Static Public Member Functions

static LSResult::Result createProject (LSString projectPath, LSString projectName)
 Creates a new project at the specified location. More...
 
static LSResult::Result createProject (LSString projectPath, LSString projectName, LSString uuid)
 Creates a new project at the specified location. More...
 
static LSResult::Result loadProject (LSString projectPath, ref_ptr< LSProject > &projectOut, bool readOnly=false)
 Opens the project at the specified location. More...
 
static LSPod< std::vector< ref_ptr< LSProjectMetadata > > > listScannerProjects (const LSString &inputDirectory, bool recursive=true)
 Scan a given path and return metadata of all contained FARO projects. More...
 
static LSResult::Result importScannerProject (const LSString &projectPath, const ref_ptr< LSProjectMetadata > &metadata)
 Import a scanner project into an existing project. More...
 

Additional Inherited Members

- Public Attributes inherited from LSWorkspace
LSSignal< ref_ptr< LSWorkspaceEvent > > onObjectSelectionChanged
 Dispatched when the object selection has changed. More...
 
LSSignal< ref_ptr< LSWorkspaceEvent > > onPointSelectionChanged
 Dispatched when the point selection has changed. More...
 
- Protected Member Functions inherited from LSRefType
void ref () const
 Increments the internal reference counter. More...
 
void unref () const
 Decrements the internal reference counter. More...
 

Detailed Description

Interface to access information and functionality of SCENE projects.

Version
SCENE API Version 2.0.0.

Constructor & Destructor Documentation

◆ ~LSProject()

~LSProject ( )

Destroys the workspace.

Version
SCENE API Version 2.0.0.

Member Function Documentation

◆ createProject() [1/2]

static LSResult::Result createProject ( LSString  projectPath,
LSString  projectName 
)
static

Creates a new project at the specified location.

Parameters
projectPathThe file system path to folder where the project will be created.
projectNameThe name of the project to be created.
Returns
An LSResult result code.
Version
SCENE API Version 2.0.0.

◆ createProject() [2/2]

static LSResult::Result createProject ( LSString  projectPath,
LSString  projectName,
LSString  uuid 
)
static

Creates a new project at the specified location.

Parameters
projectPathThe file system path to folder where the project will be created.
projectNameThe name of the project to be created.
uuidThe UUID of the project to be created. The UUID is expected to be of the windows API GUID structure type (guiddef.h) If the UUID is empty a new UUID will be generated. If the provided UUID is not valid this call will fail and return with InvalidRequest.
Returns
An LSResult result code.
Version
SCENE API Version 2.0.25.

◆ loadProject()

static LSResult::Result loadProject ( LSString  projectPath,
ref_ptr< LSProject > &  projectOut,
bool  readOnly = false 
)
static

Opens the project at the specified location.

When working with the Standalone API you should also call LSStandaloneContext::setCurrentWorkspace() after successfully loading a project. A compatibility issue may occur if the project to be loaded contains objects that are only available in a newer SCENE versions. The project can still be open as 'Read-Only'.

Parameters
projectPathThe file system path to the project folder or project file to be loaded.
projectOutOut parameter in which the project instance is provided if the workspace was successfully loaded.
readOnlyWhether the project should be loaded read-only.
Returns
An LSResult result code.
Version
SCENE API Version 2.0.0.

◆ saveRevision()

LSResult::Result saveRevision ( LSString  commitMessage = L"",
LSString  author = L"",
bool  updateProjectPointCloud = false 
)

Saves the current workspace state to a new revision within the loaded project.

Parameters
commitMessageThe commit message for the revision.
authorThe author of the revision.
updateProjectPointCloudWhether the project point cloud should be updated during the commit.
Returns
An LSResult result code.
Version
SCENE API Version 2.0.0.

◆ getProjectName()

LSString getProjectName ( ) const

Gets the project name of this project.

Version
SCENE API Version 2.0.0.

◆ getUuid()

LSString getUuid ( ) const

Returns the unique id of this project.

Version
SCENE API Version 2.0.25.

◆ getProjectPath()

LSString getProjectPath ( ) const

Gets the file system path to the project folder of this project.

Version
SCENE API Version 2.0.0.

◆ getProjectFilePath()

LSString getProjectFilePath ( ) const

Gets the file system path to the project file of this project.

Version
SCENE API Version 2.0.0.

◆ cleanRevisions()

LSResult::Result cleanRevisions ( )

Creates a new base revision for the loaded project.

All previous revisions are either immediately deleted or marked as obsolete. Currently opened 2D views and 3D views get closed.

Returns
An LSResult result code. InvalidRequest is returned when there are unsaved changes.
Version
SCENE API Version 2.0.19.

◆ listScannerProjects()

static LSPod<std::vector<ref_ptr<LSProjectMetadata> > > listScannerProjects ( const LSString inputDirectory,
bool  recursive = true 
)
static

Scan a given path and return metadata of all contained FARO projects.

This method is intended to list scan projects from Focus or Freestyle SD cards. However, it can also find and list normal SCENE projects. This method is restricted and only available with a corresponding API key.

Parameters
inputDirectoryFile system path to the input directory.
recursiveIf True all subdirectories will be scanned recursively. Default value is true.
Returns
List containing metadata for all found projects. In case of any error (e.g. path does not exist or no valid API key) it will and return an empty list.
Version
SCENE API Version 2.0.27.

◆ importScannerProject()

static LSResult::Result importScannerProject ( const LSString projectPath,
const ref_ptr< LSProjectMetadata > &  metadata 
)
static

Import a scanner project into an existing project.

The existing target project is specified by a path to the project file. The scanner project to be imported is specified by a meta data object created by LSProject::listScannerProjects(). This method is only intended for importing scanner projects from SD cards or USB sticks created by Freestyle and Focus devices. To import SCENE projects or workspaces use LSWorkspace::importData(). This method is restricted and only available with a corresponding API key.

Parameters
projectPathFile system path to the target project folder or project file. The project has to be a valid SCENE project.
metadataThe meta data container (obtained from LSProject::listScannerProjects()) defining the project to import.
Returns
An LSResult result code. Without a valid API key it will fail and return Unauthorized. If the provided meta data path does not exist or if called without read permission, it will fail and return ReadWrite. If there is no project with the given meta data it will fail and and return InvalidRequest.
Version
SCENE API version 2.0.27.