FormIt C++ API  v23.0.0 (2023.0.0)
FormIt::Layers API

Description

Classes

struct  FormIt::Layers::LayerData
 

Functions

FORMIT_CORE_EXPORT::vector< size_t > FormIt::Layers::GetAllLayers ()
 Gets all layer id's. More...
 
FORMIT_CORE_EXPORT bool FormIt::Layers::GetLayerData (size_t layerID, LayerData &data)
 Get the layer's name and visibility. More...
 
FORMIT_CORE_EXPORT bool FormIt::Layers::IsValid (size_t layerID)
 Check whether the layer with the given id exists. More...
 
FORMIT_CORE_EXPORT void FormIt::Layers::SetLayersVisibility (const 1::vector< FormIt::Layers::LayerData > &aLayersVisbility)
 Set the visibility of a list of layers. More...
 
FORMIT_CORE_EXPORT bool FormIt::Layers::SetLayerVisibility (1::string const &layerName, bool visibility)
 Set the visibility of a layer by name. More...
 
FORMIT_CORE_EXPORT bool FormIt::Layers::LayerExists (1::string const &layerName)
 Check whether a layer with that name already exists. More...
 
FORMIT_CORE_EXPORT::pair< bool, 1::string > FormIt::Layers::AddLayer (size_t nHistoryId, 1::string const &layerName, bool visible)
 Add a layer with the given name and visibility. More...
 
FORMIT_CORE_EXPORT void FormIt::Layers::DeleteLayers (const 1::vector< size_t > &aLayerIDs)
 Delete layers. More...
 
FORMIT_CORE_EXPORT bool FormIt::Layers::SetLayerName (size_t layerID, 1::string const &newLayerName)
 Renames a layer. More...
 
FORMIT_CORE_EXPORT bool FormIt::Layers::AssignLayerToObjects (1::string const &newLayerName, const 1::vector< WSM::GroupInstancePath > &aObjects)
 Assigns the layer with the given name to the list of objects. The layer should already exist. More...
 
FORMIT_CORE_EXPORT bool FormIt::Layers::AssignLayerToObjects (size_t layerID, const 1::vector< WSM::GroupInstancePath > &aObjects)
 Assigns the layer to the list of objects. More...
 
FORMIT_CORE_EXPORT void FormIt::Layers::RemoveLayersFromObjects (const 1::vector< size_t > &layerIDs, const 1::vector< WSM::GroupInstancePath > &aObjectPaths)
 Removes any of layers in the vector from the list of objects. More...
 
FORMIT_CORE_EXPORT::vector< WSM::GroupInstancePathFormIt::Layers::GetAllObjectsOnLayers (const 1::vector< size_t > &aLayerIDs, bool allHistories=true)
 Collects all objects which are on the given layers. More...
 
FORMIT_CORE_EXPORT bool FormIt::Layers::ChangeLayerOrder (size_t layerID, size_t newPosition)
 Give the layer a new position in the list. More...
 
FORMIT_CORE_EXPORT LayerList FormIt::Layers::GetLayerList ()
 Get the list of layers defined in the layer manager. More...
 
FORMIT_CORE_EXPORT LayerSet FormIt::Layers::GetObjectsLayerList (1::vector< WSM::GroupInstancePath > const &aObjects, bool bIncludeNoLayer=false)
 Get the set of layers the given Objects are on. More...
 
FORMIT_CORE_EXPORT void FormIt::Layers::SetLayerList (const LayerList &layerList)
 Set the list of layers in the manager. More...
 
FORMIT_CORE_EXPORT bool FormIt::Layers::IsValidObjectForLayerAssignment (size_t nHistoryId, size_t objectId)
 Checks whether an object is valid for being assigned a layer attribute. More...
 
FORMIT_CORE_EXPORT size_t FormIt::Layers::GetObjectLayerID (size_t nHistoryID, size_t nObjectID)
 Gets the formit layer id for the object. More...
 
FORMIT_CORE_EXPORT::pair< bool, 1::string > FormIt::Layers::GetNewLayerName (1::string const &newNamePrefix)
 GetNewLayerName generates a new unique layer name with newNamePrefix as a prefix. More...
 
FORMIT_CORE_EXPORT void FormIt::Layers::RenameLayer (LayerList &layerList, 1::string const &oldName, 1::string const &newName)
 Replace the name of the layer in the layer list, which has the name "oldlName" with "newName". More...
 
FORMIT_CORE_EXPORT bool FormIt::Layers::IsValidLayerName (size_t aLayerId, const 1::string &newLayerName, 1::string &errorMsg)
 Check if the given name is valid for a layer. More...
 
FORMIT_CORE_EXPORT size_t FormIt::Layers::GetLayerID (const 1::string &layerName)
 Returns the formit layer id from the name. More...
 
FORMIT_CORE_EXPORT bool FormIt::Layers::SetLayerPickable (size_t layerId, bool pickable)
 Set the pickable status of a layer. More...
 
FORMIT_CORE_EXPORT bool FormIt::Layers::SetLoadInRevit (size_t layerId, bool bLoad)
 Set the load in Revit flag of a layer. More...
 
FORMIT_CORE_EXPORT bool FormIt::Layers::IsSectionPlaneOrIndicatorLayer (size_t layerId)
 Check whether the layer is either a section indicator or section plane layer. More...
 
FORMIT_CORE_EXPORT size_t FormIt::Layers::CountObjectsOnLayer (const 1::vector< WSM::GroupInstancePath > &objectPaths, size_t layerId)
 Returns how many of the objects in objectPaths, or their owners are on the given layer If layerId is passed as WSM::INVALID_ID, it counts how many objects are not on any layer. More...
 

Function Documentation

FORMIT_CORE_EXPORT ::pair<bool, 1::string> FormIt::Layers::AddLayer ( size_t  nHistoryId,
1::string const &  layerName,
bool  visible 
)

Add a layer with the given name and visibility.

Returns true if the layer was added (didn't exist before), false otherwise. If the layer name passed in is "", a unique layer name will be generated. Returns a pair- Success, and the name of the new layer.

Parameters
[in]nHistoryIdID of the given History
[in]layerName
[in]visible
FORMIT_CORE_EXPORT bool FormIt::Layers::AssignLayerToObjects ( 1::string const &  newLayerName,
const 1::vector< WSM::GroupInstancePath > &  aObjects 
)

Assigns the layer with the given name to the list of objects. The layer should already exist.

FORMIT_CORE_EXPORT bool FormIt::Layers::AssignLayerToObjects ( size_t  layerID,
const 1::vector< WSM::GroupInstancePath > &  aObjects 
)

Assigns the layer to the list of objects.

If a WSM layer with that name does not exist in the history of an object, it is also created.

Parameters
[in]layerID
[in]aObjects
FORMIT_CORE_EXPORT bool FormIt::Layers::ChangeLayerOrder ( size_t  layerID,
size_t  newPosition 
)

Give the layer a new position in the list.

Parameters
[in]layerID
[in]newPosition
FORMIT_CORE_EXPORT size_t FormIt::Layers::CountObjectsOnLayer ( const 1::vector< WSM::GroupInstancePath > &  objectPaths,
size_t  layerId 
)

Returns how many of the objects in objectPaths, or their owners are on the given layer If layerId is passed as WSM::INVALID_ID, it counts how many objects are not on any layer.

Parameters
[in]objectPaths
[in]layerId
FORMIT_CORE_EXPORT void FormIt::Layers::DeleteLayers ( const 1::vector< size_t > &  aLayerIDs)

Delete layers.

This will also delete the WSM layer objects.

Parameters
[in]aLayerIDs
FORMIT_CORE_EXPORT ::vector<size_t> FormIt::Layers::GetAllLayers ( )

Gets all layer id's.

The order of the layers is the way they are supposed to appear in the UI

FORMIT_CORE_EXPORT ::vector<WSM::GroupInstancePath> FormIt::Layers::GetAllObjectsOnLayers ( const 1::vector< size_t > &  aLayerIDs,
bool  allHistories = true 
)

Collects all objects which are on the given layers.

if allHistories is true, it will search all Historys, if false, it will search the current edit History.

Parameters
[in]aLayerIDs
[in]allHistories
FORMIT_CORE_EXPORT bool FormIt::Layers::GetLayerData ( size_t  layerID,
LayerData data 
)

Get the layer's name and visibility.

Returns true if successful, false otherwise

Parameters
[in]layerID
[out]data
FORMIT_CORE_EXPORT size_t FormIt::Layers::GetLayerID ( const 1::string &  layerName)

Returns the formit layer id from the name.

Returns WSM::INVALID_ID if the layer does not exist

Parameters
[in]layerName
FORMIT_CORE_EXPORT LayerList FormIt::Layers::GetLayerList ( )

Get the list of layers defined in the layer manager.

FORMIT_CORE_EXPORT ::pair<bool, 1::string> FormIt::Layers::GetNewLayerName ( 1::string const &  newNamePrefix)

GetNewLayerName generates a new unique layer name with newNamePrefix as a prefix.

A layer is not created.

Parameters
[in]newNamePrefix
FORMIT_CORE_EXPORT size_t FormIt::Layers::GetObjectLayerID ( size_t  nHistoryID,
size_t  nObjectID 
)

Gets the formit layer id for the object.

Returns WSM::INVALID_ID, if the object is not on a layer

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given object
FORMIT_CORE_EXPORT LayerSet FormIt::Layers::GetObjectsLayerList ( 1::vector< WSM::GroupInstancePath > const &  aObjects,
bool  bIncludeNoLayer = false 
)

Get the set of layers the given Objects are on.

If bIncludeNoLayer is true, an uninitialized LayerData will be added to the set.

Parameters
[in]aObjects
[in]bIncludeNoLayer
FORMIT_CORE_EXPORT bool FormIt::Layers::IsSectionPlaneOrIndicatorLayer ( size_t  layerId)

Check whether the layer is either a section indicator or section plane layer.

Parameters
[in]layerId
FORMIT_CORE_EXPORT bool FormIt::Layers::IsValid ( size_t  layerID)

Check whether the layer with the given id exists.

Parameters
[in]layerID
FORMIT_CORE_EXPORT bool FormIt::Layers::IsValidLayerName ( size_t  aLayerId,
const 1::string &  newLayerName,
1::string &  errorMsg 
)

Check if the given name is valid for a layer.

Returns success. Also returns an error string that can be posted in the UI, if the name is not valid.

Parameters
[in]aLayerId
[in]newLayerName
[out]errorMsg
FORMIT_CORE_EXPORT bool FormIt::Layers::IsValidObjectForLayerAssignment ( size_t  nHistoryId,
size_t  objectId 
)

Checks whether an object is valid for being assigned a layer attribute.

Currently this is : A top level object or an instance

Parameters
[in]nHistoryIdID of the given History
[in]objectId
FORMIT_CORE_EXPORT bool FormIt::Layers::LayerExists ( 1::string const &  layerName)

Check whether a layer with that name already exists.

Parameters
[in]layerName
FORMIT_CORE_EXPORT void FormIt::Layers::RemoveLayersFromObjects ( const 1::vector< size_t > &  layerIDs,
const 1::vector< WSM::GroupInstancePath > &  aObjectPaths 
)

Removes any of layers in the vector from the list of objects.

Parameters
[in]layerIDs
[in]aObjectPaths
FORMIT_CORE_EXPORT void FormIt::Layers::RenameLayer ( LayerList layerList,
1::string const &  oldName,
1::string const &  newName 
)

Replace the name of the layer in the layer list, which has the name "oldlName" with "newName".

Parameters
[out]layerList
[in]oldName
[in]newName
FORMIT_CORE_EXPORT void FormIt::Layers::SetLayerList ( const LayerList layerList)

Set the list of layers in the manager.

Called from persistence when loading a model. Skips Layers that already exist in the manager.

Parameters
[in]layerList
FORMIT_CORE_EXPORT bool FormIt::Layers::SetLayerName ( size_t  layerID,
1::string const &  newLayerName 
)

Renames a layer.

Returns true if the new name does not exist and renaming was successful.

Parameters
[in]layerID
[in]newLayerName
FORMIT_CORE_EXPORT bool FormIt::Layers::SetLayerPickable ( size_t  layerId,
bool  pickable 
)

Set the pickable status of a layer.

Parameters
[in]layerId
[in]pickable
FORMIT_CORE_EXPORT void FormIt::Layers::SetLayersVisibility ( const 1::vector< FormIt::Layers::LayerData > &  aLayersVisbility)

Set the visibility of a list of layers.

Parameters
[in]aLayersVisbility
FORMIT_CORE_EXPORT bool FormIt::Layers::SetLayerVisibility ( 1::string const &  layerName,
bool  visibility 
)

Set the visibility of a layer by name.

Parameters
[in]layerName
[in]visibility
FORMIT_CORE_EXPORT bool FormIt::Layers::SetLoadInRevit ( size_t  layerId,
bool  bLoad 
)

Set the load in Revit flag of a layer.

If set to false, objects on that layer will not be imported into Revit when the axm file is imported/linked

Parameters
[in]layerId
[in]bLoad