![]() |
COLNEO Pro 1.0
|
3D Viewer API interface.
API is provided by Javascript object (WebForms, Macros) cnView3dAPI.
(c) COLNEO GmbH
|
slot |
Activates a viewpoint linked to a SmartSet.
| vpId | ID of SmartSet associated with the view point. |
|
slot |
Remove/Delete all overlays.
|
slot |
|
slot |
Create a new overlay in 3D view.
| name | |
| content | HTML content of overlay/legend |
| config | {
"position" : [ x:int , y:int ]
}
|
|
slot |
Creates a viewpoint.
A viewpoint is created as Smartset with a view (camera, clipping) attached.
To delete a viewpoint, use method cnCoreAPI.deleteObject(id).
| parentId | Parent to which the Smartset is appended. To append the Smartset on top level, use the ID returned by cnCoreAPI.getSmartSetsRootId(domain). |
| name | Name of the new Viewpoint/Smartset. |
| options | {
"visible": true,
"styles": false,
"clipping": false,
"redlining" : false
...
}
|
|
slot |
Get ID of active viewpoint.
|
slot |
Returns the current camera configuration of the 3D viewport.
This method retrieves the complete state of the currently active camera and returns it as a JSON-compatible structure (QVariantMap) in the API response data field.
|
slot |
|
slot |
|
slot |
Get current view.
|
slot |
Get ID of home viewpoint.
|
slot |
Get info about OpenGL version etc.
|
slot |
|
slot |
Get overlay.
|
slot |
Get config data (position etc) of overlay.
|
slot |
Get IDs of all overlays.
|
slot |
|
slot |
|
slot |
Get bounding box of scene, i.e. of all objects in coordination model
|
slot |
Get global/internal translation of scene from global coordinates to internal coordinates. Note: Mainly for development and testing prurposes.
|
slot |
Get current view as Base64 encoded string.
|
slot |
|
slot |
Retrieves the IDs of all viewpoints in the design domain. Containers are not included in the list.
Design domain. Additional domains will also be offered in the future.
|
slot |
Hide all overlays
|
slot |
Hide overlay.
|
slot |
Remove (delete) overlay
| id | Id of overlay |
|
slot |
|
slot |
Reset the current 3D viewer configuration to the default settings.
|
slot |
Reset home viewpoint.
true if a home viewpoint exists and reset was successful, else false.
|
slot |
Reset view ==> clearSelection(), showAll(), resetClipping()
|
slot |
Sets the camera configuration of the 3D viewport.
This method updates the currently active camera based on the provided JSON-compatible structure (QVariantMap). It validates the presence, type, and basic constraints of all required fields before applying the configuration.
| cam | = { "near": number, // Near clipping plane distance, must be > 0 "far": number, // Far clipping plane distance, must be > near "position": [ number, number, number ], // Camera position in world coordinates "lookat": [ number, number, number ], // Point the camera is looking at "up": [ number, number, number ] // Up vector, must be non-zero } |
|
slot |
|
slot |
Set configuration of 3D viewer.
| cfg | Configuration object (JSON) |
|
slot |
Set viewpoint with ID 'vpID' as home viewpoint for the current project.
If an empty ID or non-existent ID is passed, an error code is returned.
| vpID | ID of the viewpoint that is to be set as the home viewpoint |
true if home viewpoint changed, else false. In case of an invalid id check status code.
|
slot |
Set navigation mode of 3D view.
Available modes:
[ orbit , walk, clip, measure, redline ]
| cfg | = { "mode" : " ... mode ... " } |
|
slot |
Get config data (position etc) of overlay
| config | {
"position" : [ x:int , y:int ]
}
|
|
slot |
Set HTML content of overlay
|
slot |
|
slot |
|
slot |
Show all overlays
|
slot |
Set overlay visible
|
slot |
Show home viewpoint.
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
Updates a viewpoint.
Unlike updateSmartSets(), which updates the SmartSet structure according to the given rule, this function updates only the viewpoint.
| vpId | ID of viewpoint (SmartSet) |
|
slot |
Adjusts the view to fit the bounding box of all objects (even hidden).
| opt | Options (optional) {
'view' : one of [ 'current' , 'top' , 'left' , 'right' , 'front' , 'back' ]
// 'current' is default, i.e. view direction/vector is not changed
}
|
Example
|
slot |
Adjusts the view to fit the bounding box of the given objects.
This method modifies the current view so that all provided objects are visible in the viewport. The method computes the combined bounding box of all valid objects and moves the eye point (camera position) accordingly, so that the entire bounding box fits within the view. The current viewing direction is preserved.
| objectIds | A list of object IDs. The bounding boxes of the associated objects will be used to compute the zoom target. |
| options | Options (optional) {
'view' : one of [ 'current' , 'top' , 'left' , 'right' , 'front' , 'back' ]
// 'current' is default, i.e. view direction/vector is not changed
}
|
|
slot |
Adjusts the view to fit the bounding box of the given points.
This method modifies the current view so that all provided points are visible in the viewport. The method computes the combined bounding box of all valid points and moves the eye point (camera position) accordingly, so that the entire bounding box fits within the view. The current viewing direction is preserved.
| points | An array of points. The x, y and z coordinates must be passed on as a list one after the other. The length of the list must be divisible by three. |
| options | Options (optional) {
'view' : one of [ 'current' , 'top' , 'left' , 'right' , 'front' , 'back' ]
// 'current' is default, i.e. view direction/vector is not changed
}
|