Skip to content

Commit 048e607

Browse files
committed
MINOR: Feature: Model Transform (#786)
* MINOR: feat(model): add models transform * fix: set transform read_only=True * fix(transform): use 'prefetch_related' instead of 'select_related' for transform in model qs * fix(transform): use select_related and fix model_list tests
1 parent b07183b commit 048e607

File tree

77 files changed

+925
-382
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+925
-382
lines changed

.openapi-generator/FILES

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ docs/PatchedTagRequest.md
132132
docs/PatchedTopicRequest.md
133133
docs/PatchedTopicStatusRequest.md
134134
docs/PatchedTopicTypeRequest.md
135+
docs/PatchedTransformRequest.md
135136
docs/PatchedUnitRequest.md
136137
docs/PatchedUserCloudUpdateRequest.md
137138
docs/PatchedUserProjectUpdateRequest.md
@@ -224,6 +225,8 @@ docs/TopicStatus.md
224225
docs/TopicStatusRequest.md
225226
docs/TopicType.md
226227
docs/TopicTypeRequest.md
228+
docs/Transform.md
229+
docs/TransformRequest.md
227230
docs/Unit.md
228231
docs/UnitRequest.md
229232
docs/User.md
@@ -397,6 +400,7 @@ src/model/PatchedTagRequest.js
397400
src/model/PatchedTopicRequest.js
398401
src/model/PatchedTopicStatusRequest.js
399402
src/model/PatchedTopicTypeRequest.js
403+
src/model/PatchedTransformRequest.js
400404
src/model/PatchedUnitRequest.js
401405
src/model/PatchedUserCloudUpdateRequest.js
402406
src/model/PatchedUserProjectUpdateRequest.js
@@ -488,6 +492,8 @@ src/model/TopicStatus.js
488492
src/model/TopicStatusRequest.js
489493
src/model/TopicType.js
490494
src/model/TopicTypeRequest.js
495+
src/model/Transform.js
496+
src/model/TransformRequest.js
491497
src/model/Unit.js
492498
src/model/UnitRequest.js
493499
src/model/User.js
@@ -656,6 +662,7 @@ test/model/PatchedTagRequest.spec.js
656662
test/model/PatchedTopicRequest.spec.js
657663
test/model/PatchedTopicStatusRequest.spec.js
658664
test/model/PatchedTopicTypeRequest.spec.js
665+
test/model/PatchedTransformRequest.spec.js
659666
test/model/PatchedUnitRequest.spec.js
660667
test/model/PatchedUserCloudUpdateRequest.spec.js
661668
test/model/PatchedUserProjectUpdateRequest.spec.js
@@ -747,6 +754,8 @@ test/model/TopicStatus.spec.js
747754
test/model/TopicStatusRequest.spec.js
748755
test/model/TopicType.spec.js
749756
test/model/TopicTypeRequest.spec.js
757+
test/model/Transform.spec.js
758+
test/model/TransformRequest.spec.js
750759
test/model/Unit.spec.js
751760
test/model/UnitRequest.spec.js
752761
test/model/User.spec.js

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ Class | Method | HTTP request | Description
456456
*bimdata.ModelApi* | [**updateModelFiles**](docs/ModelApi.md#updateModelFiles) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{id}/files | Update models file (gltf, svg, structure, etc)
457457
*bimdata.ModelApi* | [**updateModelProperty**](docs/ModelApi.md#updateModelProperty) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/property/{id} | Update some fields of a Property
458458
*bimdata.ModelApi* | [**updateModelPropertyDefinition**](docs/ModelApi.md#updateModelPropertyDefinition) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/propertydefinition/{id} | Update some fields of many PropertyDefinitions of a model
459+
*bimdata.ModelApi* | [**updateModelTransform**](docs/ModelApi.md#updateModelTransform) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{id}/transform | Update model transform
459460
*bimdata.ModelApi* | [**updateModelUnit**](docs/ModelApi.md#updateModelUnit) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/unit/{id} | Update some fields of a Unit of a model
460461
*bimdata.ModelApi* | [**updateOrderBuildingPlan**](docs/ModelApi.md#updateOrderBuildingPlan) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/building/{building_uuid}/plan/order | Update order of all plan of a building
461462
*bimdata.ModelApi* | [**updateOrderStoreyPlan**](docs/ModelApi.md#updateOrderStoreyPlan) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/storey/{storey_uuid}/plan/order | Update order of all plan of a storey
@@ -617,6 +618,7 @@ Class | Method | HTTP request | Description
617618
- [bimdata.PatchedTopicRequest](docs/PatchedTopicRequest.md)
618619
- [bimdata.PatchedTopicStatusRequest](docs/PatchedTopicStatusRequest.md)
619620
- [bimdata.PatchedTopicTypeRequest](docs/PatchedTopicTypeRequest.md)
621+
- [bimdata.PatchedTransformRequest](docs/PatchedTransformRequest.md)
620622
- [bimdata.PatchedUnitRequest](docs/PatchedUnitRequest.md)
621623
- [bimdata.PatchedUserCloudUpdateRequest](docs/PatchedUserCloudUpdateRequest.md)
622624
- [bimdata.PatchedUserProjectUpdateRequest](docs/PatchedUserProjectUpdateRequest.md)
@@ -708,6 +710,8 @@ Class | Method | HTTP request | Description
708710
- [bimdata.TopicStatusRequest](docs/TopicStatusRequest.md)
709711
- [bimdata.TopicType](docs/TopicType.md)
710712
- [bimdata.TopicTypeRequest](docs/TopicTypeRequest.md)
713+
- [bimdata.Transform](docs/Transform.md)
714+
- [bimdata.TransformRequest](docs/TransformRequest.md)
711715
- [bimdata.Unit](docs/Unit.md)
712716
- [bimdata.UnitRequest](docs/UnitRequest.md)
713717
- [bimdata.User](docs/User.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 {'DWG', 'POINT_CLOUD', 'IFC', 'DXF', 'OBJ', 'GLTF'}, a model will be created and attached to this document Required scopes: document:write
963+
Create a document. If the document is one of {'POINT_CLOUD', 'DWG', 'OBJ', 'DXF', 'IFC', 'GLTF'}, a model will be created and attached to this document Required scopes: document:write
964964

965965
### Example
966966

docs/FullTopic.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ Name | Type | Description | Notes
2525
**dueDate** | **Date** | | [optional]
2626
**comments** | [**[Comment]**](Comment.md) | | [optional]
2727
**viewpoints** | [**[Viewpoint]**](Viewpoint.md) | | [optional]
28-
**project** | **Number** | |
2928
**bimdataViewerLayout** | **Object** | Non standard field. JSON describing bimdataViewerLayout. | [optional]
3029

3130

docs/FullTopicRequest.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Name | Type | Description | Notes
2424
**dueDate** | **Date** | | [optional]
2525
**comments** | [**[CommentRequest]**](CommentRequest.md) | | [optional]
2626
**viewpoints** | [**[ViewpointRequest]**](ViewpointRequest.md) | | [optional]
27-
**project** | **Number** | |
2827
**bimdataViewerLayout** | **Object** | Non standard field. JSON describing bimdataViewerLayout. | [optional]
2928

3029

docs/LabelRequest.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**label** | **String** | |
8-
**project** | **Number** | This field is automatically provided by the route, you don't need to provide it in the body | [optional]
98

109

docs/Model.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Name | Type | Description | Notes
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]
3838
**mask2d** | [**Mask2D**](Mask2D.md) | | [readonly]
39+
**transform** | [**Transform**](Transform.md) | | [readonly]
3940
**children** | [**[ModelSerializerWithoutChildren]**](ModelSerializerWithoutChildren.md) | Contains additional pages of a pdf | [readonly]
4041

4142

docs/ModelApi.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ Method | HTTP request | Description
149149
[**updateModelFiles**](ModelApi.md#updateModelFiles) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{id}/files | Update models file (gltf, svg, structure, etc)
150150
[**updateModelProperty**](ModelApi.md#updateModelProperty) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/property/{id} | Update some fields of a Property
151151
[**updateModelPropertyDefinition**](ModelApi.md#updateModelPropertyDefinition) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/propertydefinition/{id} | Update some fields of many PropertyDefinitions of a model
152+
[**updateModelTransform**](ModelApi.md#updateModelTransform) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{id}/transform | Update model transform
152153
[**updateModelUnit**](ModelApi.md#updateModelUnit) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/unit/{id} | Update some fields of a Unit of a model
153154
[**updateOrderBuildingPlan**](ModelApi.md#updateOrderBuildingPlan) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/building/{building_uuid}/plan/order | Update order of all plan of a building
154155
[**updateOrderStoreyPlan**](ModelApi.md#updateOrderStoreyPlan) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/storey/{storey_uuid}/plan/order | Update order of all plan of a storey
@@ -10075,6 +10076,75 @@ Name | Type | Description | Notes
1007510076
- **Accept**: application/json
1007610077

1007710078

10079+
## updateModelTransform
10080+
10081+
> Transform updateModelTransform(cloudPk, id, projectPk, opts)
10082+
10083+
Update model transform
10084+
10085+
Update model transform (translate, scale, rotate and opacity) Required scopes: ifc:write, model:write
10086+
10087+
### Example
10088+
10089+
```javascript
10090+
import bimdata from '@bimdata/bimdata-api-client';
10091+
let defaultClient = bimdata.ApiClient.instance;
10092+
// Configure API key authorization: ApiKey
10093+
let ApiKey = defaultClient.authentications['ApiKey'];
10094+
ApiKey.apiKey = 'YOUR API KEY';
10095+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
10096+
//ApiKey.apiKeyPrefix = 'Token';
10097+
// Configure OAuth2 access token for authorization: BIMData_Connect
10098+
let BIMData_Connect = defaultClient.authentications['BIMData_Connect'];
10099+
BIMData_Connect.accessToken = 'YOUR ACCESS TOKEN';
10100+
// Configure OAuth2 access token for authorization: BIMData_Connect
10101+
let BIMData_Connect = defaultClient.authentications['BIMData_Connect'];
10102+
BIMData_Connect.accessToken = 'YOUR ACCESS TOKEN';
10103+
// Configure API key authorization: Bearer
10104+
let Bearer = defaultClient.authentications['Bearer'];
10105+
Bearer.apiKey = 'YOUR API KEY';
10106+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
10107+
//Bearer.apiKeyPrefix = 'Token';
10108+
10109+
let apiInstance = new bimdata.ModelApi();
10110+
let cloudPk = 56; // Number |
10111+
let id = 56; // Number | A unique integer value identifying this model.
10112+
let projectPk = 56; // Number |
10113+
let opts = {
10114+
'patchedTransformRequest': new bimdata.PatchedTransformRequest() // PatchedTransformRequest |
10115+
};
10116+
apiInstance.updateModelTransform(cloudPk, id, projectPk, opts).then((data) => {
10117+
console.log('API called successfully. Returned data: ' + data);
10118+
}, (error) => {
10119+
console.error(error);
10120+
});
10121+
10122+
```
10123+
10124+
### Parameters
10125+
10126+
10127+
Name | Type | Description | Notes
10128+
------------- | ------------- | ------------- | -------------
10129+
**cloudPk** | **Number**| |
10130+
**id** | **Number**| A unique integer value identifying this model. |
10131+
**projectPk** | **Number**| |
10132+
**patchedTransformRequest** | [**PatchedTransformRequest**](PatchedTransformRequest.md)| | [optional]
10133+
10134+
### Return type
10135+
10136+
[**Transform**](Transform.md)
10137+
10138+
### Authorization
10139+
10140+
[ApiKey](../README.md#ApiKey), [BIMData_Connect](../README.md#BIMData_Connect), [BIMData_Connect](../README.md#BIMData_Connect), [Bearer](../README.md#Bearer)
10141+
10142+
### HTTP request headers
10143+
10144+
- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data
10145+
- **Accept**: application/json
10146+
10147+
1007810148
## updateModelUnit
1007910149

1008010150
> Unit updateModelUnit(cloudPk, id, modelPk, projectPk, opts)

docs/ModelSerializerWithoutChildren.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Name | Type | Description | Notes
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]
3838
**mask2d** | [**Mask2D**](Mask2D.md) | | [readonly]
39+
**transform** | [**Transform**](Transform.md) | | [readonly]
3940

4041

4142

docs/PatchedFullTopicRequest.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Name | Type | Description | Notes
2424
**dueDate** | **Date** | | [optional]
2525
**comments** | [**[CommentRequest]**](CommentRequest.md) | | [optional]
2626
**viewpoints** | [**[ViewpointRequest]**](ViewpointRequest.md) | | [optional]
27-
**project** | **Number** | | [optional]
2827
**bimdataViewerLayout** | **Object** | Non standard field. JSON describing bimdataViewerLayout. | [optional]
2928

3029

0 commit comments

Comments
 (0)