![]() |
COLNEO Pro 1.0
|
Core API interface.
This API bundles the core functionality. It is accessed via the API object 'cnCoreAPI'.
(c) COLNEO GmbH
Functions | |
OBJECTS | |
ApiJsonResponse | getObjects (QStringList &domains=QStringList()<< "geo", QString &filterexpression=QString()) |
ApiJsonResponse | filterObjects (QStringList &objectIds, QVariant &filter) |
ApiJsonResponse | getObjectsByStatus (QString &status, bool statusFlag, QStringList &domains=QStringList()<< "all") |
ApiJsonResponse | createObject (QString &parentId, QVariantMap &data) |
ApiJsonResponse | createCube (QString &parentId, QList< double > ¢er, double a) |
ApiJsonResponse | deleteObjects (QStringList &objectIds) |
HIERARCHIES / DOMAINS | |
ApiJsonResponse | getParent (QString &objId) |
ApiJsonResponse | getChildren (QString &objId, int depth=0) |
OBJECT PROPERTIES | |
ApiJsonResponse | getPropertyValue (QStringList &objIds, QString &name, QString &xsDataType) |
ApiJsonResponse | setPropertyValue (QStringList &objIds, QString &name, QString &xsDataType, QVariant &value) |
ApiJsonResponse | getProperties (QString &objId, QVariantMap &filter=QVariantMap()) |
ApiJsonResponse | setProperties (QStringList &objIds, QVariantMap &propertyMap) |
PROPERTY TYPES | |
ApiJsonResponse | getPropertyTypesByObject (QString &objId, QVariantMap &filter=QVariantMap()) |
ApiJsonResponse | getPropertyTypeValues (QString &name, QString &xsDataType, QVariantMap &options=QVariantMap()) |
ApiJsonResponse | getPropertyTypes () |
ApiJsonResponse | createPropertyType (QVariantMap &data, bool updateExisting) |
ApiJsonResponse | deletePropertyType (QString &ptkeyAsString) |
RELATIONS | |
ApiJsonResponse | getLinkedObjects (QStringList &sourceIds, QVariantMap &options=QVariantMap()) |
ApiJsonResponse | linkObjects (QStringList &sourceIds, QStringList &targetIds, QVariantMap &linkData=QVariantMap()) |
ApiJsonResponse | unlinkObjects (QStringList &sourceIds) |
OBJECT STATUS | |
ApiJsonResponse | setVisible (QStringList &objIds, bool flag) |
ApiJsonResponse | isolate (QStringList &objIds, QVariantMap &config=QVariantMap()) |
ApiJsonResponse | showAll () |
ApiJsonResponse | toggleVisibility (QStringList &objIds) |
ApiJsonResponse | getVisible (QStringList &domains=QStringList()<< "all") |
ApiJsonResponse | isVisible (QString &objId) |
ApiJsonResponse | getSelected (QStringList &domains=QStringList()<< "all") |
ApiJsonResponse | setSelected (QStringList &objIds, bool flag) |
ApiJsonResponse | toggleSelection (QStringList &objIds) |
ApiJsonResponse | setSelectedOnly (QStringList &objIds) |
ApiJsonResponse | isSelected (QString &objId) |
ApiJsonResponse | clearSelection (QStringList &domains=QStringList()<< "all") |
GEOMETRY | |
ApiJsonResponse | getGeometry (QString &objId, QStringList &filter=QStringList()) |
ApiJsonResponse | setGeometry (QString &objId, QVariantMap &geometryData) |
SMART SETS | |
ApiJsonResponse | getRootNodeOfSmartSetsByDomain (QString &domainCode) |
ApiJsonResponse | createSmartSet (QStringList &objIds, QStringList &propertyTypeKeys, QVariantMap &options=QVariantMap()) |
ApiJsonResponse | updateSmartSet (QString &setId) |
ApiJsonResponse | createTreeStructure (QStringList &objIds, QVariantMap &schema, QString &treeRuleId=QString()) |
ApiJsonResponse | updateTreeStructure (QString &smartSetId) |
ApiJsonResponse | createColorSchemaFromSmartSet (QString &setId, QVariantMap &options=QVariantMap()) |
ApiJsonResponse | createStyles (QString &smartSetId, QVariantMap &options=QVariantMap()) |
ApiJsonResponse | activateStyles (QString &smartSetId, QStringList &objIds=QStringList()) |
ApiJsonResponse | resetStyles (QStringList &objIds=QStringList()) |
TOOLS |
Events | |
STATUS NOTIFICATIONS | |
selectionStateChanged () | |
visibilityStateChanged () | |
lockedStateChanged () | |
wireFrameStateChanged () | |
statusChanged (QString &statusType) | |
MISCELLANOUS NOTIFICATIONS | |
progressChanged (QVariantMap &progressObject) | |
|
slot |
Activate...
smartSetId | Id of smartset |
objIds |
|
slot |
|
slot |
...
setId | ID of smart set. |
options | ... |
|
slot |
Create a cube with the given edge length and center.
parentId | Id of parent object |
center | Center point of cube [x, y, z] |
a | Edge length of the cube |
|
slot |
Create an object. If the parent does not fit (e.g. wrong domain), nothing happens.
parentId | Id of parent object |
data | Object data given in JSON notation {
info: {
object_type : "geo_container"
object_name : "MyObject",
//object_id : null,
},
properties: {
...
},
geometry: {
...
}
}
|
|
slot |
Create a new property type.
Property types are identified by their name and datatype.
Values of properties can be restricted: To a selection (list entries) or the matching of a regular expression.
data | Example 1:
{
name: "MyLength",
datatype: "xs:double",
unit: "m"
}
Example 2:
{
name: "TrafficLight",
datatype: "xs:string",
values: ["red", "yellow", "green"]
readOnly: true
}
|
updateExisting |
|
slot |
...
objIds | List of object IDs. |
propertyTypeKeys | List of property type keys (name##xsdatatype) |
options | Options {
precision: 4,
intervalSize: null,
...
}
|
|
slot |
This method creates a distinc style (color) for each sub container of a given smart set
smartSetId | |
options |
|
slot |
...
objIds | List of object IDs. |
schema | Schema as defined in cn_properties on infohub |
treeRuleId | ID of tree rule which should be applied. If empty, all trees will be created. |
|
slot |
Delete objects.
objectIds | Single object ID or list of object IDs. |
|
slot |
... Warning: if a property type is deleted, all properties with this key are removed from objects
ptkeyAsString |
|
slot |
Filter objects.
objectIds | Base object set. Apply filter to this set of objects. Single object ID or list of object IDs. |
filter | Filter condition. Each expression consist of [[operand1], [operator], [operand2]] filter = {
options : {
case_sensitive: true
},
filter: [
[["ifc:Entity##xs:string"], ["match"], ["/^IfcWall$/g"]],
["AND"],
[["cn:Volume##xs:double"], [">="], [4.5]]
]
...
}
|
|
slot |
Get children of object with given id recursivly up to given depth.
objId | ID of the object |
depth | [optional] Recursion depth, default = 0 (maximum depth). |
|
slot |
Get geometry data of object.
Vertices, triangles, triangle normal are provided as plain arrays.
objId | |
filter | List of keys which should be returned ['vertices', 'triangles', 'edges']
|
|
slot |
Get all objects linked to given objects.
sourceIds | |
options | {
...
}
|
|
slot |
Get objects.
domains | Domain short code or combination as array, e.g. [ 'geo', 'act' ] |
filterexpression | Object filter "$ifc:Entity##xs:string ~like~ 'IfcWall%'"
|
|
slot |
Get object with given status in the specified domain(s). This is a more generic version of the methods getVisibleObjects(), getSelectedObjects(), ...
status | One of 'selected', 'visible', ... |
statusFlag | true or false |
|
slot |
Get parent of object with given ID.
objId | ID of the object |
|
slot |
Get map of properties of a given object.
objId | ID of the object. |
filter | [optional] Filter specification for getting properties. If defined the filter affects the name and data type of the fetched properties. {
name: "MyNumber",
datatype : ["xs:double", "xs:float"]
}
|
|
slot |
Get a list of all available property types.
!! CHECK AGAINST METHOD getPropertyTypeValues
|
slot |
Get property types of an given object.
objId | ID of object. |
filter | [optional] Filter settings for getting property type. The filter the listed attributes (keys) of the fetched property types. {
name: 'numb*',
datatypes: ['xs:double', 'xs:float']
readOnly: true
}
|
|
slot |
Get property values of a given property type.
name | Name of property |
xsDataType | Data type of property |
options | {
objects: [...], // If the key is specified, only the listed objects are taken into account, otherwise all objects
precision: 0.0001, // applies only to floating point numbers
interval_size: 0, // applies only to numbers
interval_offset: 0, // applies only to numbers
date_grouping: 'week', // applies only to dates, one of ['day','week', 'month', 'year']
max_values: 0
}
|
|
slot |
Get property value for a one or more objects and property type.
objIds | Object ID or list of object IDs |
name | Name of property. |
xsDataType | Datatype of property, one of
|
|
slot |
...
domainCode |
|
slot |
Get objects with status 'selected'.
domains | Domain short code or domain combination as array, e.g. ["geo, "act"] |
|
slot |
Get objects with status 'visible'.
domains | Domain short code or domain combination as array, e.g. ["geo, "act"] |
|
slot |
Isolate objects (show only)
objIds | |
config | Isolation configuration : {
"include_children" : true
}
|
|
slot |
Check if an object is selected.
objId |
|
slot |
Check if an object is visible.
objId | ID of object |
|
slot |
Link objects given in sourceIds to objects given in targetIds (link is bidirectional).
sourceIds | ID (string) or list of IDs (array) |
targetIds | ID (string) or list of IDs (array) |
linkData | ... {
}
|
|
signal |
This signal is emitted when the locked state of objects has changed. Connect the signal to a javascript function after the web page is loaded.
|
signal |
...
progressObject | {
value: 12,
message: "Reading properties...",
status: "ok"
}
|
|
slot |
...
objIds | List with object IDs. If no list is passed, the style of all objects will be reset. |
|
signal |
This signal is emitted when the selection state of objects has changed. Connect the signal to a javascript function (e.g. function onSelectionStateChanged) after the web page is loaded.
|
slot |
Set geometry data to an object.
objId | |
geometryData |
|
slot |
Set properties for one or more objects.
objIds | Object ID or list of object IDs. |
propertyMap | Map with properties (key given in property type key notation name##xsDataType ) {
"myType##xs:string": "ABC",
"myNumber##xs:double": 1.234,
"myBoolean##xs:boolean": true
}
|
|
slot |
Set a property value for one ore more objects.
objIds | Object ID or list of object IDs. |
name | Name of property |
xsDataType | Data type of property |
value | Property value (java script value). A value of null removes the property from the object. If the data type is 'xs:date' or 'xs:dateTime', Date objects and ISO strings will be accepted as values. If the data type is 'xs:object', the array or object will be stored internally as json string. |
|
slot |
...
objIds | String (single ID) OR array of IDs. |
flag | true or false |
|
slot |
|
slot |
...
objIds | String (single ID) OR array of IDs. |
flag | true or false |
|
slot |
Set all objects visible.
This affects not only 3d-objects since objects in all domains have a status 'visible'
|
signal |
Generalisation of aboves method? To discuss ...
|
slot |
|
slot |
|
slot |
Remove all links form objects given by sourceIds.
sourceIds | ID (string) or list of IDs (array) |
|
slot |
...
setId | ID of the smart set |
|
slot |
smartSetId | ID of root smart set |
|
signal |
This signal is emitted if the visibility state of objects has changed. Connect the signal to a javascript function after the web page is loaded.
|
signal |
This signal is emitted when the wire frame state of objects has changed. Connect the signal to a javascript function after the web page is loaded.