![]() |
COLNEO Pro 1.0
|
Core API interface.
This API bundles the core functionality.
It is accessed via the API object 'cnCoreAPI'.
Functions | |
OBJECTS | |
ApiJsonResponse | getObjects (QStringList &domains=QStringList()<< "all") |
ApiJsonResponse | filterObjectsByProperties (QStringList &objectIds, QVariant &propertyFilter) |
ApiJsonResponse | filterObjectsByStatus (QStringList &objectIds, QString &statusCode, bool statusFlag=true) |
ApiJsonResponse | createObject (QString &parentId, QVariantMap &data) |
ApiJsonResponse | createCube (QString &parentId, QList< double > ¢er, double a) |
ApiJsonResponse | deleteObjects (QStringList &objectIds) |
MODELS | |
ApiJsonResponse | getModels (QStringList &domains=QStringList()<< "all") |
ApiJsonResponse | getModelMetaData (QString &modelId) |
ApiJsonResponse | createModel (QString &name, QString &domainCode, QVariantMap &settings=QVariantMap()) |
ApiJsonResponse | deleteModel (QString &modelId) |
ApiJsonResponse | importModel (QString &filepath, QVariantMap &importOptions=QVariantMap()) |
ApiJsonResponse | exportModels (QString &filePath, QList< QString > &modellist, QVariantMap &options) |
HIERARCHIES / DOMAINS | |
ApiJsonResponse | getParent (QString &objId) |
ApiJsonResponse | getChildren (QString &objId, int depth=0) |
ApiJsonResponse | getRootNodeOfTreeStructures (QString &domainCode) |
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 | getVisible (QStringList &domains=QStringList()<< "all") |
ApiJsonResponse | setVisible (QStringList &objIds, bool flag, bool exclusively=false) |
ApiJsonResponse | setVisibleAll (bool statusFlag, QStringList &domains=QStringList()<< "all") |
ApiJsonResponse | toggleVisibility (QStringList &objIds) |
ApiJsonResponse | isVisible (QString &objId) |
ApiJsonResponse | getSelected (QStringList &domains=QStringList()<< "all") |
ApiJsonResponse | setSelected (QStringList &objIds, bool flag, bool exclusively=false) |
ApiJsonResponse | setSelectedVisible (bool flag) |
ApiJsonResponse | toggleSelection (QStringList &objIds) |
ApiJsonResponse | isSelected (QString &objId) |
ApiJsonResponse | clearSelection (QStringList &domains=QStringList()<< "all") |
STYLES | |
ApiJsonResponse | getStyles () |
ApiJsonResponse | getStyleData (QString &styleId) |
ApiJsonResponse | createStyle (QVariantMap &styleData) |
ApiJsonResponse | updateStyle (QString &styleId, QVariantMap &styleData) |
ApiJsonResponse | deleteStyles (QStringList &styleIds) |
ApiJsonResponse | setStyle (QStringList &objectIds, QString &styleId) |
ApiJsonResponse | resetStyles (QStringList &objectIds=QStringList(), QVariantMap &filter=QVariantMap()) |
GEOMETRY | |
ApiJsonResponse | getGeometry (QString &objId, QStringList &filter=QStringList()) |
ApiJsonResponse | setGeometry (QString &objId, QVariantMap &geometryData) |
SMARTSETS | |
ApiJsonResponse | getRootNodeOfSmartSets (QString &domainCode) |
ApiJsonResponse | createSmartSet (QString &domainCode, QStringList &objIds) |
ApiJsonResponse | addObjectsToSmartSet (QString &smartSetId, QStringList &objIds) |
ApiJsonResponse | removeObjectsFromSmartSet (QString &smartSetId, QStringList &objIds) |
ApiJsonResponse | createSmartSet (QString &domainCode, QStringList &objIds, QStringList &propertyTypeKeys, QVariantMap &options=QVariantMap()) |
ApiJsonResponse | updateSmartSet (QString &setId) |
ApiJsonResponse | createSmartSetBySchema (QString &domainCode, QStringList &rootObjectIds, QVariantMap &schema, QString &treeRuleId=QString()) |
ApiJsonResponse | createColorSchemaFromSmartSet (QString &setId, QVariantMap &options=QVariantMap()) |
ApiJsonResponse | createStyles (QString &smartSetId, QVariantMap &options=QVariantMap()) |
ApiJsonResponse | activateStyles (QString &smartSetId, QStringList &objIds=QStringList()) |
TOOLS |
Events | |
STATUS NOTIFICATIONS | |
selectionStateChanged () | |
visibilityStateChanged () | |
lockedStateChanged () | |
wireFrameStateChanged () | |
statusChanged (QString &statusType) | |
MISCELLANOUS NOTIFICATIONS | |
progressChanged (QVariantMap &progressObject) | |
Public Member Functions | |
Constructors/Destructor | |
Interface IApiObject | |
QString & | getApiObjectName () |
|
slot |
Activate...
smartSetId | Id of smartset |
objIds |
|
slot |
|
slot |
Set all objects to 'unselected'.
domains | List of domains to be taken into account. Available domains can be found here : Domains |
|
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 a model in the specified domain.
name | Name of model |
domainCode | Domain short code, e.g. 'geo' |
settings | ? (to specify) {
...
}
|
|
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 |
Create SmartSet from object list.
domainCode | Create SmartSet in this domain, objects in list 'objIds' of this domain are taken into account only |
objIds | Object list |
|
slot |
Create a smart set by property type keys.
domain | Domain (short code) in which the smart set should be created. Objects in list must match this domain, if not domain equals "all". |
objIds | List of object IDs (only tree nodes, children will be automatically processed). If empty, all objects of the given domain will be taken into account. |
propertyTypeKeys | List of property type keys (name##xsdatatype) |
options | Options {
precision: 4,
intervalSize: null,
...
}
|
|
slot |
Create a smart set by a property schema tree structure.
domain | Domain (short code) in which the smart set should be created. Objects in list must match this domain, if not domain equals "all". |
rootObjectIds | List of object IDs (only tree nodes, children will be automatically processed). If empty, all objects of the given domain will be taken into account. |
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 |
...
styleData | {
}
|
|
slot |
This method creates a distinc style (color) for each sub container of a given smart set
smartSetId | |
options |
|
slot |
Delete a model. All objects and properties coming with this model are also deleted. Handle with care!
modelId | ID of the model |
|
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 |
...
styleIds | Style object ID or list of style object IDs. |
|
slot |
Write models to specified file in cnJSON-format.
filePath | Full file path, e.g "C:/MyModels/Test.cnjson" |
modellist | List of all model IDs that are to be exported. If the ID does not belong to a model, nothing is exported |
options | ? (to specify) |
|
slot |
Filter objects by property values
objectIds | Base object set. Apply filter to this set of objects. Single object ID or list of object IDs. |
propertyFilter | List of filter conditions [
{
ptkey: "icf:Entity##xs:string",
op: "in",
value: ["IfcWall", "IfcWallStandardCase"]
},
{
ptkey: "cnVolume##xs:double",
operand: ">=",
value: 2.5
}
]
|
|
slot |
Filter objects by status, e.g. "visible", or a status combination.
objectIds | List with objects IDs or single ID as string. |
statusCode | One of [ 'selected', 'visible' , 'wired' , 'locked' ] |
statusFlag | true: status, false: inverted status |
QString & getApiObjectName | ( | ) |
|
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 the metadata of a model.
modelId | ID of model |
|
slot |
Get list of models, filtered by domains.
domains | Domain short code or combination as array, e.g. 'all' or [ 'geo', 'act' ] |
|
slot |
Get objects.
domains | Domain short code or combination as array, e.g. 'all' or [ 'geo', 'act' ]. See a list of domains here: Domains |
|
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 |
Get (invisible) root object of smart set tree structure.
domainCode | Create SmartSet in this domain, objects in list 'objIds' of this domain are taken into account only |
|
slot |
...
domainCode |
|
slot |
Get objects with status 'selected'.
domains | Domain short code or domain combination as array, e.g. ["geo, "act"] |
|
slot |
...
styleId |
|
slot |
...
|
slot |
Get objects with status 'visible'.
domains | Domain short code or domain combination as array, e.g. ["geo, "act"] |
|
slot |
Imports a model in IFC, cpixml or cnJSON format
filepath | The file path of the model file, e.g "C:/MyModels/Test.ifc" |
importOptions | Import options {
transformation: {
dx: 0.0,
dy: 0.0,
dz: 0.0,
}
}
|
|
slot |
Check if an object is selected.
objId | ID of object |
|
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 |
|
slot |
...
objectIds | Object ID or list of object IDs. If empty, all objects will be considered. |
filter | {
???
}
|
|
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 |
Set objects selected.
objIds | String (single ID) OR array of IDs. |
flag | true or false |
exclusively | true or false |
|
slot |
Select/Unselect visible objects
flag | true = select visible object, false = unselect visible objects |
|
slot |
...
objectIds | |
styleId |
|
slot |
Set objects visible.
objIds | String (single ID) OR array of IDs. |
flag | true or false |
exclusively | true or false |
|
slot |
Set all objects visible.
This affects not only 3d-objects since objects in all domains have a status 'visible'
statusFlag | true: visible, false: hidden |
domains | Domain short code or domain combination as array, e.g. ["geo, "act"] |
|
signal |
Generalisation of aboves method? To discuss ...
|
slot |
Reverses the selection of the transferred objects regardless of their parent-child relationship. IDs not found are listed in the message of return value
objIds | List of object IDs whose selection is to be reversed |
|
slot |
Reverses the visibility of the transferred objects regardless of their parent-child relationship. IDs not found are listed in the message of return value
objIds | List of object IDs whose visibility is to be reversed |
|
slot |
Remove all links form objects given by sourceIds.
sourceIds | ID (string) or list of IDs (array) |
|
slot |
Update smart set 'setId'.
setId | ID of the smart set to be updated |
|
slot |
|
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.