Skip to content

Commit a28932b

Browse files
committed
MINOR: Add a 2D mask to model to be able to cleanup plan (#832)
* Add ability to save a viewport for a plan. * Fix doc. * Rename 2D mask. * Use kwargs instead of args in test mask 2d. * Rework with a simplier view on the model * Rename migration to match the mask2d rename
1 parent 885d354 commit a28932b

29 files changed

+814
-103
lines changed

.openapi-generator/FILES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ docs/LogEntry.md
8181
docs/MarketplaceAppImage.md
8282
docs/MarketplaceAppLight.md
8383
docs/MarketplaceAppLightRequest.md
84+
docs/Mask2D.md
85+
docs/Mask2DRequest.md
8486
docs/Material.md
8587
docs/MaterialListComponent.md
8688
docs/MaterialListComponentRequest.md
@@ -342,6 +344,8 @@ src/model/LogEntry.js
342344
src/model/MarketplaceAppImage.js
343345
src/model/MarketplaceAppLight.js
344346
src/model/MarketplaceAppLightRequest.js
347+
src/model/Mask2D.js
348+
src/model/Mask2DRequest.js
345349
src/model/Material.js
346350
src/model/MaterialListComponent.js
347351
src/model/MaterialListComponentRequest.js
@@ -596,6 +600,8 @@ test/model/LogEntry.spec.js
596600
test/model/MarketplaceAppImage.spec.js
597601
test/model/MarketplaceAppLight.spec.js
598602
test/model/MarketplaceAppLightRequest.spec.js
603+
test/model/Mask2D.spec.js
604+
test/model/Mask2DRequest.spec.js
599605
test/model/Material.spec.js
600606
test/model/MaterialListComponent.spec.js
601607
test/model/MaterialListComponentRequest.spec.js

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ Class | Method | HTTP request | Description
337337
*bimdata.ModelApi* | [**createElementPropertySetPropertyDefinition**](docs/ModelApi.md#createElementPropertySetPropertyDefinition) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{property_pk}/propertydefinition | Create a Definition to a Property
338338
*bimdata.ModelApi* | [**createElementPropertySetPropertyDefinitionUnit**](docs/ModelApi.md#createElementPropertySetPropertyDefinitionUnit) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{property_pk}/propertydefinition/{propertydefinition_pk}/unit | Create a Unit to a Definition
339339
*bimdata.ModelApi* | [**createLayer**](docs/ModelApi.md#createLayer) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/layer | Create a layer in the model
340+
*bimdata.ModelApi* | [**createMask2D**](docs/ModelApi.md#createMask2D) | **PUT** /cloud/{cloud_pk}/project/{project_pk}/model/{id}/mask-2d | Create or update a 2D mask for the model
340341
*bimdata.ModelApi* | [**createMetaBuilding**](docs/ModelApi.md#createMetaBuilding) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/create-metabuilding | Create an empty 3D Model
341342
*bimdata.ModelApi* | [**createModel**](docs/ModelApi.md#createModel) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/create-model | Make a PDF or Image file a Model
342343
*bimdata.ModelApi* | [**createModelPropertyDefinition**](docs/ModelApi.md#createModelPropertyDefinition) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/propertydefinition | Create a PropertyDefinition on the model
@@ -361,6 +362,7 @@ Class | Method | HTTP request | Description
361362
*bimdata.ModelApi* | [**deleteDrawing**](docs/ModelApi.md#deleteDrawing) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/drawing/{id} | Delete a drawing of a model
362363
*bimdata.ModelApi* | [**deleteElement**](docs/ModelApi.md#deleteElement) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/element/{uuid} | Delete an element of a model
363364
*bimdata.ModelApi* | [**deleteLayer**](docs/ModelApi.md#deleteLayer) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/layer/{id} | Delete a layer of a model
365+
*bimdata.ModelApi* | [**deleteMask2D**](docs/ModelApi.md#deleteMask2D) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{id}/mask-2d | Delete the 2D mask for the model
364366
*bimdata.ModelApi* | [**deleteModel**](docs/ModelApi.md#deleteModel) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{id} | Delete a model
365367
*bimdata.ModelApi* | [**deleteModelProperty**](docs/ModelApi.md#deleteModelProperty) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/property/{id} | Delete a Property of a model
366368
*bimdata.ModelApi* | [**deleteModelPropertyDefinition**](docs/ModelApi.md#deleteModelPropertyDefinition) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/propertydefinition/{id} | Delete a PropertyDefinitions of a model
@@ -559,6 +561,8 @@ Class | Method | HTTP request | Description
559561
- [bimdata.MarketplaceAppImage](docs/MarketplaceAppImage.md)
560562
- [bimdata.MarketplaceAppLight](docs/MarketplaceAppLight.md)
561563
- [bimdata.MarketplaceAppLightRequest](docs/MarketplaceAppLightRequest.md)
564+
- [bimdata.Mask2D](docs/Mask2D.md)
565+
- [bimdata.Mask2DRequest](docs/Mask2DRequest.md)
562566
- [bimdata.Material](docs/Material.md)
563567
- [bimdata.MaterialListComponent](docs/MaterialListComponent.md)
564568
- [bimdata.MaterialListComponentRequest](docs/MaterialListComponentRequest.md)

docs/CollaborationApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ Name | Type | Description | Notes
960960
961961
Create a document
962962

963-
Create a document. If the document is one of {'OBJ', 'GLTF', 'POINT_CLOUD', 'DWG', 'IFC', 'DXF'}, a model will be created and attached to this document Required scopes: document:write
963+
Create a document. If the document is one of {'GLTF', 'DWG', 'DXF', 'POINT_CLOUD', 'IFC', 'OBJ'}, a model will be created and attached to this document Required scopes: document:write
964964

965965
### Example
966966

docs/Mask2D.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# bimdata.Mask2D
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**id** | **Number** | | [readonly]
8+
**viewport** | **[[Number]]** | Viewport of the manually created mask to show only a part of the model. |
9+
**createdAt** | **Date** | Creation date | [readonly]
10+
**updatedAt** | **Date** | Date of the last update | [readonly]
11+
12+

docs/Mask2DRequest.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# bimdata.Mask2DRequest
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**viewport** | **[[Number]]** | Viewport of the manually created mask to show only a part of the model. |
8+
9+

docs/Model.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Name | Type | Description | Notes
3535
**parentId** | **Number** | The first page of the pdf | [readonly]
3636
**pageNumber** | **Number** | The page number of the related pdf | [readonly]
3737
**layoutName** | **String** | The name of the DWG layout (only set when type==DWG) | [optional]
38+
**mask2d** | [**Mask2D**](Mask2D.md) | |
3839
**children** | [**[ModelSerializerWithoutChildren]**](ModelSerializerWithoutChildren.md) | Contains additional pages of a pdf | [readonly]
3940

4041

docs/ModelApi.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Method | HTTP request | Description
3030
[**createElementPropertySetPropertyDefinition**](ModelApi.md#createElementPropertySetPropertyDefinition) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{property_pk}/propertydefinition | Create a Definition to a Property
3131
[**createElementPropertySetPropertyDefinitionUnit**](ModelApi.md#createElementPropertySetPropertyDefinitionUnit) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{property_pk}/propertydefinition/{propertydefinition_pk}/unit | Create a Unit to a Definition
3232
[**createLayer**](ModelApi.md#createLayer) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/layer | Create a layer in the model
33+
[**createMask2D**](ModelApi.md#createMask2D) | **PUT** /cloud/{cloud_pk}/project/{project_pk}/model/{id}/mask-2d | Create or update a 2D mask for the model
3334
[**createMetaBuilding**](ModelApi.md#createMetaBuilding) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/create-metabuilding | Create an empty 3D Model
3435
[**createModel**](ModelApi.md#createModel) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/create-model | Make a PDF or Image file a Model
3536
[**createModelPropertyDefinition**](ModelApi.md#createModelPropertyDefinition) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/propertydefinition | Create a PropertyDefinition on the model
@@ -54,6 +55,7 @@ Method | HTTP request | Description
5455
[**deleteDrawing**](ModelApi.md#deleteDrawing) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/drawing/{id} | Delete a drawing of a model
5556
[**deleteElement**](ModelApi.md#deleteElement) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/element/{uuid} | Delete an element of a model
5657
[**deleteLayer**](ModelApi.md#deleteLayer) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/layer/{id} | Delete a layer of a model
58+
[**deleteMask2D**](ModelApi.md#deleteMask2D) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{id}/mask-2d | Delete the 2D mask for the model
5759
[**deleteModel**](ModelApi.md#deleteModel) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{id} | Delete a model
5860
[**deleteModelProperty**](ModelApi.md#deleteModelProperty) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/property/{id} | Delete a Property of a model
5961
[**deleteModelPropertyDefinition**](ModelApi.md#deleteModelPropertyDefinition) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/propertydefinition/{id} | Delete a PropertyDefinitions of a model
@@ -1970,6 +1972,73 @@ Name | Type | Description | Notes
19701972
- **Accept**: application/json
19711973

19721974

1975+
## createMask2D
1976+
1977+
> Mask2D createMask2D(cloudPk, id, projectPk, mask2DRequest)
1978+
1979+
Create or update a 2D mask for the model
1980+
1981+
Create or update a 2D mask for the model. Only available for PDF, JPEG and PNG models
1982+
1983+
### Example
1984+
1985+
```javascript
1986+
import bimdata from '@bimdata/bimdata-api-client';
1987+
let defaultClient = bimdata.ApiClient.instance;
1988+
// Configure API key authorization: ApiKey
1989+
let ApiKey = defaultClient.authentications['ApiKey'];
1990+
ApiKey.apiKey = 'YOUR API KEY';
1991+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
1992+
//ApiKey.apiKeyPrefix = 'Token';
1993+
// Configure OAuth2 access token for authorization: BIMData_Connect
1994+
let BIMData_Connect = defaultClient.authentications['BIMData_Connect'];
1995+
BIMData_Connect.accessToken = 'YOUR ACCESS TOKEN';
1996+
// Configure OAuth2 access token for authorization: BIMData_Connect
1997+
let BIMData_Connect = defaultClient.authentications['BIMData_Connect'];
1998+
BIMData_Connect.accessToken = 'YOUR ACCESS TOKEN';
1999+
// Configure API key authorization: Bearer
2000+
let Bearer = defaultClient.authentications['Bearer'];
2001+
Bearer.apiKey = 'YOUR API KEY';
2002+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
2003+
//Bearer.apiKeyPrefix = 'Token';
2004+
2005+
let apiInstance = new bimdata.ModelApi();
2006+
let cloudPk = 56; // Number |
2007+
let id = 56; // Number | A unique integer value identifying this model.
2008+
let projectPk = 56; // Number |
2009+
let mask2DRequest = new bimdata.Mask2DRequest(); // Mask2DRequest |
2010+
apiInstance.createMask2D(cloudPk, id, projectPk, mask2DRequest).then((data) => {
2011+
console.log('API called successfully. Returned data: ' + data);
2012+
}, (error) => {
2013+
console.error(error);
2014+
});
2015+
2016+
```
2017+
2018+
### Parameters
2019+
2020+
2021+
Name | Type | Description | Notes
2022+
------------- | ------------- | ------------- | -------------
2023+
**cloudPk** | **Number**| |
2024+
**id** | **Number**| A unique integer value identifying this model. |
2025+
**projectPk** | **Number**| |
2026+
**mask2DRequest** | [**Mask2DRequest**](Mask2DRequest.md)| |
2027+
2028+
### Return type
2029+
2030+
[**Mask2D**](Mask2D.md)
2031+
2032+
### Authorization
2033+
2034+
[ApiKey](../README.md#ApiKey), [BIMData_Connect](../README.md#BIMData_Connect), [BIMData_Connect](../README.md#BIMData_Connect), [Bearer](../README.md#Bearer)
2035+
2036+
### HTTP request headers
2037+
2038+
- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data
2039+
- **Accept**: application/json
2040+
2041+
19732042
## createMetaBuilding
19742043

19752044
> Model createMetaBuilding(cloudPk, projectPk, createBuildingByNameRequest)
@@ -3580,6 +3649,71 @@ null (empty response body)
35803649
- **Accept**: Not defined
35813650

35823651

3652+
## deleteMask2D
3653+
3654+
> deleteMask2D(cloudPk, id, projectPk)
3655+
3656+
Delete the 2D mask for the model
3657+
3658+
Delete the 2D mask for the model.
3659+
3660+
### Example
3661+
3662+
```javascript
3663+
import bimdata from '@bimdata/bimdata-api-client';
3664+
let defaultClient = bimdata.ApiClient.instance;
3665+
// Configure API key authorization: ApiKey
3666+
let ApiKey = defaultClient.authentications['ApiKey'];
3667+
ApiKey.apiKey = 'YOUR API KEY';
3668+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
3669+
//ApiKey.apiKeyPrefix = 'Token';
3670+
// Configure OAuth2 access token for authorization: BIMData_Connect
3671+
let BIMData_Connect = defaultClient.authentications['BIMData_Connect'];
3672+
BIMData_Connect.accessToken = 'YOUR ACCESS TOKEN';
3673+
// Configure OAuth2 access token for authorization: BIMData_Connect
3674+
let BIMData_Connect = defaultClient.authentications['BIMData_Connect'];
3675+
BIMData_Connect.accessToken = 'YOUR ACCESS TOKEN';
3676+
// Configure API key authorization: Bearer
3677+
let Bearer = defaultClient.authentications['Bearer'];
3678+
Bearer.apiKey = 'YOUR API KEY';
3679+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
3680+
//Bearer.apiKeyPrefix = 'Token';
3681+
3682+
let apiInstance = new bimdata.ModelApi();
3683+
let cloudPk = 56; // Number |
3684+
let id = 56; // Number | A unique integer value identifying this model.
3685+
let projectPk = 56; // Number |
3686+
apiInstance.deleteMask2D(cloudPk, id, projectPk).then(() => {
3687+
console.log('API called successfully.');
3688+
}, (error) => {
3689+
console.error(error);
3690+
});
3691+
3692+
```
3693+
3694+
### Parameters
3695+
3696+
3697+
Name | Type | Description | Notes
3698+
------------- | ------------- | ------------- | -------------
3699+
**cloudPk** | **Number**| |
3700+
**id** | **Number**| A unique integer value identifying this model. |
3701+
**projectPk** | **Number**| |
3702+
3703+
### Return type
3704+
3705+
null (empty response body)
3706+
3707+
### Authorization
3708+
3709+
[ApiKey](../README.md#ApiKey), [BIMData_Connect](../README.md#BIMData_Connect), [BIMData_Connect](../README.md#BIMData_Connect), [Bearer](../README.md#Bearer)
3710+
3711+
### HTTP request headers
3712+
3713+
- **Content-Type**: Not defined
3714+
- **Accept**: Not defined
3715+
3716+
35833717
## deleteModel
35843718

35853719
> deleteModel(cloudPk, id, projectPk)

docs/ModelSerializerWithoutChildren.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Name | Type | Description | Notes
3535
**parentId** | **Number** | The first page of the pdf | [readonly]
3636
**pageNumber** | **Number** | The page number of the related pdf | [readonly]
3737
**layoutName** | **String** | The name of the DWG layout (only set when type==DWG) | [optional]
38+
**mask2d** | [**Mask2D**](Mask2D.md) | |
3839

3940

4041

docs/PatchedModelRequest.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Name | Type | Description | Notes
1313
**northVector** | **[[Number]]** | This field is only for information. Updating it won't impact the export. | [optional]
1414
**recommanded2dAngle** | **Number** | This is the angle in clockwise degree to apply on the 2D to optimise the horizontality of objects. This field is only for information. Updating it won't impact the export. | [optional]
1515
**layoutName** | **String** | The name of the DWG layout (only set when type==DWG) | [optional]
16+
**mask2d** | [**Mask2DRequest**](Mask2DRequest.md) | | [optional]
1617

1718

1819

docs/WriteFolder.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**updatedAt** | **Date** | Date of the last update | [readonly]
8-
**defaultPermission** | **Number** | Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write | [optional]
7+
**createdAt** | **Date** | Creation date | [readonly]
8+
**parentId** | **Number** | | [optional]
99
**id** | **Number** | | [readonly]
10+
**type** | **String** | DEPRECATED: Use 'nature' instead. Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files | [readonly]
1011
**userPermission** | **Number** | Aggregate of group user permissions and folder default permission | [readonly]
11-
**createdBy** | [**ShortUser**](ShortUser.md) | | [readonly]
12+
**updatedAt** | **Date** | Date of the last update | [readonly]
13+
**defaultPermission** | **Number** | Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write | [optional]
1214
**name** | **String** | Name of the folder |
13-
**createdAt** | **Date** | Creation date | [readonly]
15+
**createdBy** | [**ShortUser**](ShortUser.md) | | [readonly]
1416
**groupsPermissions** | [**[GroupFolderRead]**](GroupFolderRead.md) | List of group permissions | [readonly]
1517
**nature** | **String** | Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files | [readonly]
16-
**parentId** | **Number** | | [optional]
17-
**type** | **String** | DEPRECATED: Use 'nature' instead. Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files | [readonly]
1818
**children** | [**[WriteFolder]**](WriteFolder.md) | | [optional]
1919

2020

2121

22-
## Enum: DefaultPermissionEnum
22+
## Enum: UserPermissionEnum
2323

2424

2525
* `1` (value: `1`)
@@ -32,7 +32,7 @@ Name | Type | Description | Notes
3232

3333

3434

35-
## Enum: UserPermissionEnum
35+
## Enum: DefaultPermissionEnum
3636

3737

3838
* `1` (value: `1`)

0 commit comments

Comments
 (0)