Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9783 from opf/bug/39144-fix-get-viewpoint-endpoin…
…t-in-bcf-api [#39144] Get viewpoint returns too much data
- Loading branch information
Showing
26 changed files
with
598 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
// -- copyright | ||
// OpenProject is an open source project management software. | ||
// Copyright (C) 2012-2021 the OpenProject GmbH | ||
// | ||
// This program is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU General Public License version 3. | ||
// | ||
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: | ||
// Copyright (C) 2006-2013 Jean-Philippe Lang | ||
// Copyright (C) 2010-2013 the ChiliProject Team | ||
// | ||
// This program is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU General Public License | ||
// as published by the Free Software Foundation; either version 2 | ||
// of the License, or (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program; if not, write to the Free Software | ||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
// | ||
// See COPYRIGHT and LICENSE files for more details. | ||
//++ | ||
|
||
export type BcfViewpointData = BcfViewpoint&{ | ||
components:BcfViewpointVisibility&BcfViewpointSelection | ||
}; | ||
|
||
export type CreateBcfViewpointData = BcfViewpointData&{ | ||
snapshot:{ snapshot_type:string, snapshot_data:string } | ||
}; | ||
|
||
export interface BcfViewpoint { | ||
index:number|null | ||
guid:string | ||
orthogonal_camera:BcfOrthogonalCamera|null | ||
perspective_camera:BcfPerspectiveCamera|null | ||
lines:BcfLine[]|null | ||
clipping_planes:BcfClippingPlane[]|null | ||
bitmaps:BcfBitmap[]|null | ||
snapshot:{ snapshot_type:string } | ||
} | ||
|
||
export interface BcfViewpointVisibility { | ||
visibility:{ | ||
default_visibility:boolean | ||
exceptions:BcfComponent[] | ||
view_setup_hints:BcfViewSetupHints|null | ||
} | ||
} | ||
|
||
export interface BcfViewpointSelection { | ||
selection:BcfComponent[] | ||
} | ||
|
||
export interface BcfComponent { | ||
ifc_guid:string|null | ||
originating_system:string|null | ||
authoring_tool_id:string|null | ||
} | ||
|
||
export interface BcfViewSetupHints { | ||
spaces_visible:boolean | ||
space_boundaries_visible:boolean | ||
openings_visible:boolean | ||
} | ||
|
||
export interface BcfOrthogonalCamera { | ||
camera_view_point:{ x:number, y:number, z:number } | ||
camera_direction:{ x:number, y:number, z:number } | ||
camera_up_vector:{ x:number, y:number, z:number } | ||
view_to_world_scale:number | ||
} | ||
|
||
export interface BcfPerspectiveCamera { | ||
camera_view_point:{ x:number, y:number, z:number } | ||
camera_direction:{ x:number, y:number, z:number } | ||
camera_up_vector:{ x:number, y:number, z:number } | ||
field_of_view:number | ||
} | ||
|
||
export interface BcfBitmap { | ||
guid:string | ||
bitmap_type:string | ||
location:{ x:number, y:number, z:number } | ||
normal:{ x:number, y:number, z:number } | ||
up:{ x:number, y:number, z:number } | ||
height:number | ||
} | ||
|
||
export interface BcfClippingPlane { | ||
location:{ x:number, y:number, z:number } | ||
direction:{ x:number, y:number, z:number } | ||
} | ||
|
||
export interface BcfLine { | ||
start_point:{ x:number, y:number, z:number } | ||
end_point:{ x:number, y:number, z:number } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
frontend/src/app/features/bim/bcf/api/topics/bcf-topic.resource.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 32 additions & 9 deletions
41
frontend/src/app/features/bim/bcf/api/viewpoints/bcf-viewpoint-collection.paths.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 30 additions & 2 deletions
32
frontend/src/app/features/bim/bcf/api/viewpoints/bcf-viewpoint-item.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,38 @@ | ||
import { BcfViewpointInterface } from 'core-app/features/bim/bcf/api/viewpoints/bcf-viewpoint.interface'; | ||
// -- copyright | ||
// OpenProject is an open source project management software. | ||
// Copyright (C) 2012-2021 the OpenProject GmbH | ||
// | ||
// This program is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU General Public License version 3. | ||
// | ||
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: | ||
// Copyright (C) 2006-2013 Jean-Philippe Lang | ||
// Copyright (C) 2010-2013 the ChiliProject Team | ||
// | ||
// This program is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU General Public License | ||
// as published by the Free Software Foundation; either version 2 | ||
// of the License, or (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program; if not, write to the Free Software | ||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
// | ||
// See COPYRIGHT and LICENSE files for more details. | ||
//++ | ||
|
||
import { CreateBcfViewpointData } from 'core-app/features/bim/bcf/api/bcf-api.model'; | ||
|
||
export interface BcfViewpointItem { | ||
/** The URL of the viewpoint, if persisted */ | ||
href?:string|null; | ||
/** URL (persisted or data) to the snapshot */ | ||
snapshotURL:string; | ||
/** The loaded snapshot, if exists */ | ||
viewpoint?:BcfViewpointInterface; | ||
viewpoint?:CreateBcfViewpointData; | ||
} |
41 changes: 41 additions & 0 deletions
41
frontend/src/app/features/bim/bcf/api/viewpoints/bcf-viewpoint-selection.paths.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// -- copyright | ||
// OpenProject is an open source project management software. | ||
// Copyright (C) 2012-2021 the OpenProject GmbH | ||
// | ||
// This program is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU General Public License version 3. | ||
// | ||
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: | ||
// Copyright (C) 2006-2013 Jean-Philippe Lang | ||
// Copyright (C) 2010-2013 the ChiliProject Team | ||
// | ||
// This program is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU General Public License | ||
// as published by the Free Software Foundation; either version 2 | ||
// of the License, or (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program; if not, write to the Free Software | ||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
// | ||
// See COPYRIGHT and LICENSE files for more details. | ||
//++ | ||
|
||
import { BcfResourcePath } from 'core-app/features/bim/bcf/api/bcf-path-resources'; | ||
import { BcfApiRequestService } from 'core-app/features/bim/bcf/api/bcf-api-request.service'; | ||
import { HTTPClientHeaders, HTTPClientParamMap } from 'core-app/features/hal/http/http.interfaces'; | ||
import { Observable } from 'rxjs'; | ||
import { BcfViewpointSelection } from 'core-app/features/bim/bcf/api/bcf-api.model'; | ||
|
||
export class BcfViewpointSelectionPath extends BcfResourcePath { | ||
readonly bcfViewpointsService = new BcfApiRequestService<BcfViewpointSelection>(this.injector); | ||
|
||
get(params:HTTPClientParamMap = {}, headers:HTTPClientHeaders = {}):Observable<BcfViewpointSelection> { | ||
return this.bcfViewpointsService.get(this.toPath(), params, headers); | ||
} | ||
} |
Oops, something went wrong.