COLNEO Pro 1.0
Loading...
Searching...
No Matches
View3dAPI

Description

3D Viewer API interface.

API is provided by Javascript object (WebForms, Macros) "cnView3dAPI".

Since
11.2014, jh

(c) COLNEO GmbH

Functions

TOOLS
ApiJsonResponse getCurrentView ()
 
ApiJsonResponse resetView ()
 
ApiJsonResponse getScreenshot ()
 
ApiJsonResponse createViewpoint (QString name, QVariantMap &options)
 
CAMERA / VIEWPOINTS
ApiJsonResponse getCamera ()
 
ApiJsonResponse setCamera (QVariantMap &cam)
 
ApiJsonResponse zoomAll ()
 
ApiJsonResponse zoomToObjects (QStringList &objectIds)
 
ApiJsonResponse zoomToPoints (QVariantMap &pointarray)
 
ApiJsonResponse showViewpointHome ()
 
CLIPPING
ApiJsonResponse setClippingPlanes (QVariantMap &clipping)
 
ApiJsonResponse getClippingPlanes ()
 
ApiJsonResponse resetClipping ()
 
PICKING
ApiJsonResponse getPickedPoints ()
 
ApiJsonResponse startPickedPointsLog ()
 
ApiJsonResponse stopPickedPointsLog ()
 
ApiJsonResponse getPickedFaces ()
 
ApiJsonResponse clearPickedFaces ()
 
ApiJsonResponse startPickedFacesLog ()
 
ApiJsonResponse stopPickedFacesLog ()
 
CONFIG
ApiJsonResponse getConfig ()
 
ApiJsonResponse setConfig (QVariantMap &cfg)
 
ApiJsonResponse resetConfig ()
 
NAVIGATION
ApiJsonResponse setNavigationMode (QVariantMap &cfg)
 
ApiJsonResponse getNavigationMode ()
 
OVERLAYS / LEGENDS
ApiJsonResponse createOverlay (QString name, QString content, QVariantMap config=QVariantMap())
 
ApiJsonResponse removeOverlay (QString id)
 
ApiJsonResponse clearOverlays ()
 
ApiJsonResponse getOverlayIds ()
 
ApiJsonResponse setOverlayContent (QString id, QString content)
 
ApiJsonResponse setOverlayName (QString id, QString name)
 
ApiJsonResponse setOverlayConfig (QString id, QVariantMap config)
 
ApiJsonResponse getOverlayConfig (QString id)
 
ApiJsonResponse showOverlay (QString id)
 
ApiJsonResponse hideOverlay (QString id)
 
ApiJsonResponse hideAllOverlays ()
 
ApiJsonResponse showAllOverlays ()
 

Function Documentation

◆ clearOverlays

ApiJsonResponse clearOverlays ( )
slot

Remove/Delete all overlays.

Since
1.0, 08.2025, jh

◆ clearPickedFaces

ApiJsonResponse clearPickedFaces ( )
slot
Since
1.0.0, 2025.02, jh

◆ createOverlay

ApiJsonResponse createOverlay ( QString name,
QString content,
QVariantMap config = QVariantMap() )
slot

Create a new overlay in 3D view.

Parameters
name
contentHTML content of overlay/legend
config
{
"position" : [ x:int , y:int ]
}
Returns
Id of newly created overlay
data : string
Since
1.0, 08.2025, jh

◆ createViewpoint

ApiJsonResponse createViewpoint ( QString name,
QVariantMap & options )
slot

Creates a viewpoint.

A viewpoint is created as Smartset with a view (camera, clipping) attached.

Parameters
name
options
{
...
}
Returns
ID of the newly created SmartSet
data : string
Since
1.0, 2025.04, jh

◆ getCamera

ApiJsonResponse getCamera ( )
slot

...

Returns
{
...
}
Since
1.0.0, ...

◆ getClippingPlanes

ApiJsonResponse getClippingPlanes ( )
slot
Since
1.0.0, 2025.02, jh

◆ getConfig

ApiJsonResponse getConfig ( )
slot

Get the current configuration of the 3D viewer.

See also
setConfig()
Since
1.0, Feb 2025, jh

◆ getCurrentView

ApiJsonResponse getCurrentView ( )
slot

Get current view.

Returns
JS object containing view data.
{
"camera": {
"position": [-20.0, -20.0, 5.0],
"lookat": [0.0, 0.0, 0.0],
"up": [0.0, 0.0, 1.0]
},
"clipping": [
{
"normal": [1.0, 0.0, 0.0],
"refpoint": [3.0, 1.0, 1.0] // picked point
}
]
}
Since
1.0, Aug 2025, sl

◆ getNavigationMode

ApiJsonResponse getNavigationMode ( )
slot
Since
1.0.0, 2025.02, jh

◆ getOverlayConfig

ApiJsonResponse getOverlayConfig ( QString id)
slot

Get config data (position etc) of overlay.

{
"position" : [ x:int, y:int ]
}
Since
1.0, 08.2025, jh

◆ getOverlayIds

ApiJsonResponse getOverlayIds ( )
slot

Get IDs of all overlays.

Since
1.0, 08.2025, jh

◆ getPickedFaces

ApiJsonResponse getPickedFaces ( )
slot
Since
1.0.0, 2025.02, jh

◆ getPickedPoints

ApiJsonResponse getPickedPoints ( )
slot
Since
1.0.0, 2025.02, jh

◆ getScreenshot

ApiJsonResponse getScreenshot ( )
slot

Get current view as Base64 encoded string.

Returns
data: string (base64 encoded)
Since
1.0, 2025.02, jh

◆ hideAllOverlays

ApiJsonResponse hideAllOverlays ( )
slot

Hide all overlays

Since
1.0, 08.2025, jh

◆ hideOverlay

ApiJsonResponse hideOverlay ( QString id)
slot

Hide overlay.

Since
1.0, 08.2025, jh

◆ removeOverlay

ApiJsonResponse removeOverlay ( QString id)
slot

Remove (delete) overlay

Parameters
idId of overlay
Returns
Since
1.0, 08.2025, jh

◆ resetClipping

ApiJsonResponse resetClipping ( )
slot
Since
1.0.0, 2025.02, jh

◆ resetConfig

ApiJsonResponse resetConfig ( )
slot

Reset the current 3D viewer configuration to the default settings.

Since
1.0, Aug 2025, sl

◆ resetView

ApiJsonResponse resetView ( )
slot

==> clearSelection(), showAll(), resetClipping()

◆ setCamera

ApiJsonResponse setCamera ( QVariantMap & cam)
slot

...

Parameters
cam= { }
See also
getCamera()
Since
1.0.0, ...

◆ setClippingPlanes

ApiJsonResponse setClippingPlanes ( QVariantMap & clipping)
slot
Since
1.0.0, 2025.02, jh

◆ setConfig

ApiJsonResponse setConfig ( QVariantMap & cfg)
slot

Set configuration of 3D viewer.

Parameters
cfgConfiguration object (JSON)
const cfg = {
"backgroundColor": "#ffffffff",
"selectionColor": "#ffffa664",
"fastPaint": true,
"edges": {
"enabled": true,
"color": "#ff5c5c5c"
},
"grid": {
"enabled": true,
"color": "#ffe0e0e0",
...
},
"drawOpenings": true,
"drawSpaces": true,
...
}
Since
1.0, Feb 2025, jh

◆ setNavigationMode

ApiJsonResponse setNavigationMode ( QVariantMap & cfg)
slot

Set navigation mode of 3D view.

Available modes:
[ orbit , walk, clip, measure, redline ]

Parameters
cfg= { "mode" : " ... mode ... " }
Since
1.0.0, 2025.02, jh

◆ setOverlayConfig

ApiJsonResponse setOverlayConfig ( QString id,
QVariantMap config )
slot

Get config data (position etc) of overlay

Parameters
config
{
"position" : [ x:int , y:int ]
}
Since
1.0, 08.2025, jh

◆ setOverlayContent

ApiJsonResponse setOverlayContent ( QString id,
QString content )
slot

Set HTML content of overlay

Since
1.0, 08.2025, jh

◆ setOverlayName

ApiJsonResponse setOverlayName ( QString id,
QString name )
slot
Since
1.0, 08.2025, jh

◆ showAllOverlays

ApiJsonResponse showAllOverlays ( )
slot

Show all overlays

Since
1.0, 08.2025, jh

◆ showOverlay

ApiJsonResponse showOverlay ( QString id)
slot

Set overlay visible

Since
1.0, 08.2025, jh

◆ showViewpointHome

ApiJsonResponse showViewpointHome ( )
slot

Show home viewpoint.

Since
1.0, Jun 2025, jh

◆ startPickedFacesLog

ApiJsonResponse startPickedFacesLog ( )
slot
Since
1.0.0, 2025.02, jh

◆ startPickedPointsLog

ApiJsonResponse startPickedPointsLog ( )
slot
Since
1.0.0, 2025.02, jh

◆ stopPickedFacesLog

ApiJsonResponse stopPickedFacesLog ( )
slot
Since
1.0.0, 2025.02, jh

◆ stopPickedPointsLog

ApiJsonResponse stopPickedPointsLog ( )
slot
Since
1.0.0, 2025.02, jh

◆ zoomAll

ApiJsonResponse zoomAll ( )
slot

Adjusts the view to fit the bounding box of all objects (even hidden).

See also
zoomToObjects
Since
1.0, Aug 2025, sl

◆ zoomToObjects

ApiJsonResponse zoomToObjects ( QStringList & objectIds)
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.

Parameters
objectIdsA list of object IDs. The bounding boxes of the associated objects will be used to compute the zoom target.
Returns
data: null
Note
Objects with invalid or undefined geometry may be ignored.
Since
1.0, Aug 2025, sl

◆ zoomToPoints

ApiJsonResponse zoomToPoints ( QVariantMap & pointarray)
slot
Since
1.0.0, 2025.02, jh