MainPage   Files   Related pages 
Public Slots | Public Member Functions | List of all members
desiteCore::ProjectAPI Class Reference

#include <desiteCore/ProjectAPI.h>

Inheritance diagram for desiteCore::ProjectAPI:
desiteCore::CoreAPI desiteCore::NavigatorProjectAPI

Public Slots

QString getModelByName (QString name)
 
QStringList getModelListByName (QString name)
 
QString createModel (QString name, bool createRootC=true)
 
void message (QString)
 
void flushEvents ()
 
Properties
int setPropertyValue (QString objID, QString propName, QString propType, QVariant value)
 
QList< QVariant > getAvailablePropertyValues (QString propName, QString propDatatype, int maxValues)
 
Linked Objects
int setLinkedObjects (QString objID, QString objIdList)
 
int removeAllLinkedObjects (QString objID)
 
Open URL/Project, Start Program
void startEXE (QString prg, QString args)
 
void openLink (QString url, bool useDesktopService)
 
void openProject (QString url, bool useSessionData)
 
Objects
bool hasElement (QString ID)
 
QString getRootContainerByName (QString modelName, QString rootContainerName)
 
QStringList getRootContainerList (QString modelName)
 
QString getContainerByName (QString parentID, QString name)
 
QString createSelectionSets (QString propName, QString rootName)
 
QString createObject (QString parentID, QString name)
 
QString createObjectFromXml (QString parentID, QString objectXML)
 
int transformObject (QString objID, QString transformation)
 
int deleteObjects (QString objIdList)
 
void filterElements (QString pName, QString pType, QString pattern)
 
void setName (QString objIdList, QString name)
 
Output to file
bool writeFile (QString filename, QString content)
 
bool openFile (QString filename)
 
bool writeToFile (QString content)
 
bool closeFile ()
 
QStringList readTextFile (QString filename)
 
Database
int setPropertyValueDB (QString objIdList, QString propName, QString propType, QString propDomain, QVariant value)
 
bool dbIsLocalCopy ()
 
void dbCheckIn ()
 
void dbCheckOut (QStringList propList)
 
bool dbQueryExec (QString sqlQurery)
 
bool dbQueryNext ()
 
QVariant dbQueryValue (int column)
 
bool startTransaction ()
 
bool endTransaction ()
 
bool dbGetImmediateUpdate ()
 
void dbSetImmediateUpdate (bool)
 
int dbClearCache (QString propName, QString propType)
 
void dbClearCacheAll ()
 
int dbDeleteProperty (QString objIdList, QString propName, QString propType)
 
Materials
QString createColorSchema (QString setContainerID, QString name)
 
QString createColorSchemaFromCurrentMaterials (QString name, bool updateExisting)
 
int showColorSchema (QString name)
 
QString getCurrentColorSchema ()
 
QStringList getColorSchemaList ()
 
QString createMaterial (QString xmlMat, QString modelID=QString())
 
int deleteMaterial (QString matID)
 
QStringList getMaterialList ()
 
QString getMaterialAsXmlByID (QString matID)
 
QString getMaterialIDByName (QString matName)
 
void updateMaterial (QString matID, QString xmlMat)
 
int setMaterialToObjects (QString matID, QString objIdList)
 
void resetMaterials ()
 
void itColorCode (QString propName, QString propDT)
 
void itColorCodeNumber (QString propName, QString propDT, double intervalSize)
 
int setTransparency (QString objIdList, float defaultTransparency=0.95)
 
Visibility, Selection
void showAll (bool repaint)
 
void hideAll (bool repaint)
 
void showElements (QString objIdList, bool includeBlocked=false)
 
QVariantMap showElementsOOBBSide (QString objIdList, double prec)
 
QVariantMap showElementsOOBBTop (QString objIdList, double prec)
 
QVariantMap showElementsOOBBFront (QString objIdList, double prec)
 
void showDimensionsPainter (bool showAABB, bool showOOBB)
 
void hideDimensionsPainter ()
 
void showElementsOnly (QString objIdList)
 
void hideElements (QString objIdList, bool ignoreObjectLocking=false)
 
void clearSelection (bool repaint)
 
void selectVisible ()
 
void selectVisibleGeometric ()
 
void selectElements (QString objIdList, bool flag)
 
void repaint3DView ()
 
void reorderElements ()
 
void zoomToSelected ()
 
void zoomToVisible ()
 
void zoomTopView ()
 
QString getVisible ()
 
int countVisible ()
 
QString getSelected ()
 
int countSelected ()
 
Locking of Objects
void lockObjects (QString objIdList)
 
void unlockObjects (QString objIdList)
 
void unlockAllObjects ()
 
QString getLocked ()
 
int countLocked ()
 
Viewpoints, Clipping, Camera
int showViewpoint (QString name)
 
int showViewpointByID (QString id)
 
QString saveViewpoint (QString name, bool saveVisible=true, bool saveSelected=false)
 
QStringList getViewpointIDList ()
 
QStringList getViewpointNameList ()
 
void addToViewPoint (QString vpID, QString objIdList)
 
void removeFromViewPoint (QString vpID, QString objIdList)
 
QStringList getViewpointsByName (QString name)
 
QString getCurrentViewAsImage ()
 
QVariantMap getClipping (int i)
 
void setClipping (int i, QVariantMap clp)
 
QVariantMap getCamera ()
 
void setCamera (QVariantMap cam)
 
QVariantMap getVisualizationOptions ()
 
void setVisualizationOptions (QVariantMap opt)
 
QVariantMap getPainterOptions ()
 
void setPainterOptions (QVariantMap opt)
 
Wire Mode
void showWireModeSchema (QString name)
 
void clearWireMode ()
 
void setObjectsToWireMode (QString objIdList, bool value)
 
void createWireModeSchema (QString objIdList, QString wmName)
 
BoundingBox / OOBB
double getBBoxMinX ()
 
double getBBoxMaxX ()
 
double getBBoxMinY ()
 
double getBBoxMaxY ()
 
double getBBoxMinZ ()
 
double getBBoxMaxZ ()
 
void updateBoundingBox3DView ()
 
QVariantMap getBoundingBoxCommon (QString objIdList)
 
double checkOverlapOBB (QString id1, QString id2, double eps=1.e-2)
 
Object Iterator
void itClear ()
 
int itByFilter (QString propName, QString propDatatype, QString filterPattern)
 
int itByObjectList (QString objIdList)
 
QString itGetObjectList ()
 
bool itHasNext ()
 
QString itNext ()
 
int itCount ()
 
void itToFront ()
 
QList< QVariant > itGetAvailablePropertyValues (QString propName, QString propDatatype, int maxValues)
 
void itSetupDbCache (QString propName, QString propType)
 
void itSetMaterial (QString matID)
 
void itCalcOOBB (double eps)
 
void itUpdateOOBB (double eps)
 
void itCalcOOBBxy (double eps)
 
void itUpdateOOBBxy (double eps)
 
Object Tooltips
QStringList getListOfObjTooltips ()
 
int activateObjTooltip (QString name)
 
void deactivateObjTooltip ()
 
QString getActiveTooltipName () const
 
void addObjectListToTooltip (QString objIdList, QString tooltipname)
 
void removeObjectListFromTooltip (QString objIdList, QString tooltipname)
 
Navigation Modes
QString getNavigationMode ()
 
void setNavigationMode (QString mode, QString pinModeContainerID=QString())
 
QStringList getCreatedPins ()
 
- Public Slots inherited from desiteCore::CoreAPI
QString addDays (QString dateStr, int nrDays)
 
QString timeStamp ()
 
QString getUserName ()
 
QString getProjectID ()
 
int getProjectVariantNumber ()
 
QString getProjectNumber ()
 
QString getProjectName ()
 
QString getProjectShortDescription ()
 
QString getProjectLongDescription ()
 
QString getApplicationDirectory ()
 
QString getProjectDirectory ()
 
bool isVisible (QString objID)
 
bool isSelected (QString objID)
 
double calcSlantedArea (QString objID, double angleMin=0.0, double angleMax=45.0)
 
QVariant getPropertyValue (QString objID, QString propName, QString propType, bool inh=true)
 
bool isPropertyInherited (QString objID, QString propName, QString propType)
 
QString getPropertyValueRange (QString IDList, QString propName, QString propType)
 
QStringList getPropertyValueList (QString propName, QString propType, int maxValues)
 
QString getPropertyValueAsString (QString objID, QString propName, QString propType, bool inh=true)
 
QStringList getLinkedObjects (QString IDList)
 
QStringList getTasksByObjectList (QString IDList)
 
QStringList getObjectsByTaskList (QString IDList)
 
QStringList getDocumentsByObjectList (QString IDList)
 
QStringList getObjectsByDocumentList (QString IDList)
 
QStringList getContainedElements (QString containerID, int maxDepth)
 
int countContainedElements (QString containerID, int maxDepth)
 
QString getParent (QString objID)
 

Public Member Functions

NavigatorProject * getNavigatorProject ()
 
Constructors
 ProjectAPI (NavigatorProject *np, QObject *parent=0)
 
virtual ~ProjectAPI ()
 
- Public Member Functions inherited from desiteCore::CoreAPI
model::IGlobalProject * getGlobalProject () const
 
 CoreAPI (domainGeometry3D::Project *gp, domainActivities::ActivityProject *ap, domainDocuments::DocumentModel *dm, model::IGlobalProject *globalP, QObject *parent=0)
 
virtual ~CoreAPI ()
 
domainActivities::ActivityProject * getActivityProject ()
 
domainGeometry3D::Project * getGeometryProject ()
 
domainDocuments::DocumentModel * getDocumentModel ()
 

Additional Inherited Members

- Protected Member Functions inherited from desiteCore::CoreAPI
 CoreAPI (QObject *parent=0)
 
void setProjects (domainGeometry3D::Project *gProject, domainActivities::ActivityProject *aProject, domainDocuments::DocumentModel *dModel)
 
void setGlobalProject (model::IGlobalProject *gp)
 
model::IContainerObject * getIContainerObject (const QString &id)
 
model::IObject * getContainer (const QString &id)
 

Detailed Description

desite API for scripting.

Since
1.0.17, 15 jun 2012 by jh
Id
ProjectAPI.h 4235 2015-12-03 19:35:05Z jochen.hanff

(c) ceapoint aec technologies GmbH

Member Function Documentation

int desiteCore::ProjectAPI::activateObjTooltip ( QString  name)
slot
Returns
Index of activated Object-Tooltip.
Since
1.3.2, 28 mar 2014, jh
void desiteCore::ProjectAPI::addObjectListToTooltip ( QString  objIdList,
QString  tooltipname 
)
slot
Since
1.3.2, 28 mar 2014, jh
void desiteCore::ProjectAPI::addToViewPoint ( QString  vpID,
QString  objIdList 
)
slot

Get ID list of viewpoints

Since
1.4.9, 22 jan 2015, jh
double desiteCore::ProjectAPI::checkOverlapOBB ( QString  id1,
QString  id2,
double  eps = 1.e-2 
)
slot

Check overlap of oriented bounding boxes of two given objects with 'id1' and 'id2'. If an OOBB has not been already calculated for each object, it will be calculated with numerical precision eps (default 1.0e-2).

Returns
A value between [0, 1] indicating the overlapping factor (of the smaller box).

Note: In case of two OBBs with the same orientation it is the exact percentage of overlap, else only a indicative value. If no geometric object exists for one of both ids, 0.0 will be returned.

Since
1.4.10, 01 jun 2015, sl
void desiteCore::ProjectAPI::clearSelection ( bool  repaint)
slot

Unselect all objects.

Parameters
repainttrue: Refresh 3D-view after selection is cleared.
Since
1.0.16
void desiteCore::ProjectAPI::clearWireMode ( )
slot

Set all objects to normal mode.

Since
1.3.0, 13 nov 2013, jh
bool desiteCore::ProjectAPI::closeFile ( )
slot

Close an open file.

Returns
true - ok
false - file is not open
Since
1.3.0, 30 oct 2013, jh
int desiteCore::ProjectAPI::countLocked ( )
slot
Since
1.3.6, 25 apr 2014, jh
int desiteCore::ProjectAPI::countSelected ( )
slot

Get number of selected elements.

Since
1.0.16
int desiteCore::ProjectAPI::countVisible ( )
slot

Get number of visible elements.

Since
1.0.16
QString desiteCore::ProjectAPI::createColorSchema ( QString  setContainerID,
QString  name 
)
slot
Parameters
setContainerID- Content of this container defines the color schema. For each contained container a material is created.
name- Name of color schema. If the name already exists the name is augmented by an index.
Returns
Name of new Color Sschema
Since
1.0.20, 18 jan 2013, jh
QString desiteCore::ProjectAPI::createColorSchemaFromCurrentMaterials ( QString  name,
bool  updateExisting 
)
slot
Returns
Name of new Color Schema.
Parameters
updateExistingIf 'true' an already existing color schema is updated other wise a new color schema is created with 'name~(index)'
Since
1.3.0, 15 nov 2013, jh
QString desiteCore::ProjectAPI::createMaterial ( QString  xmlMat,
QString  modelID = QString() 
)
slot

Create a new material for visualisation. If the material already exists the existing material is not changed.

Parameters
xmlMat: Material encoded as XML
modelID: Create the new material in this model. If the model is not found or the string is empty (default) the standard model of the project is used.
Returns
ID of new material,
empty string if material could not be created. If the material already exists, the existing material is returned.
An existing material can be located in another model than 'modelID'.

Example

<material ID="default-mat-11" name="default-mat-11">
<diff r="140" b="40" g="150" a="1"/>
<amb r="140" b="40" g="150" a="1"/>
<spec r="255" b="255" g="255" a="1"/>
<trans v="0"/>
<shin v="0.5"/>
</material>
See also
deleteMaterial()
Since
1.0.20, 14 jan 2013, jh
QString desiteCore::ProjectAPI::createModel ( QString  name,
bool  createRootC = true 
)
slot

Create a new model. The model is empty, the rootcontainers have to be created.

Parameters
createRootC: true = create rootcontainer with the same name as the new model.
Returns
ID of new model.
-1 Model could not be created.
Since
1.3.0, 21 jan 2014, jh
QString desiteCore::ProjectAPI::createObject ( QString  parentID,
QString  name 
)
slot

Create an attribute object (no geometry).

Parameters
parentIDId of parent container
nameName of new object.
Returns
ID of new object
Empty string in case of any error
Since
1.0.17, 16 jun 2012, jh
QString desiteCore::ProjectAPI::createObjectFromXml ( QString  parentID,
QString  objectXML 
)
slot

Crate a new object encoded by XML

The 3D-view is not refreshed after the objects have been created. Call 'repaint3DView()' to update the screen after creating objects.

Returns
ID of the new object
'-1' if parent could not be found
'-2' if parent element is not a container
Empty string in case of any other error
<object3D ID="ABCxyz123" name="object-1" matID="mat-abcxyz" >
<p nr="0" x="1.0" y="1.0" z="1.5" />
<p nr="1" x="10.0" y="20.0" z="1.5" />
<p nr="2" x="1.0" y="10.0" z="1.5" />
<t p1="0" p2="1" p3="2" />
</object3D>
<objectLines name="line-1" matID="mat-xyz">
<p nr="0" x="1.0" y="1.0" z="1.5" />
<p nr="1" x="10.0" y="20.0" z="1.5" />
<l p1="0" p2="1" />
</objectLines>
Since
1.3.0, 02 jan 2014, jh
QString desiteCore::ProjectAPI::createSelectionSets ( QString  propName,
QString  rootName 
)
slot
Parameters
propName
rootName
Since
1.0.20, 18 jan 2013, jh
void desiteCore::ProjectAPI::createWireModeSchema ( QString  objIdList,
QString  wmName 
)
slot
Since
1.3.0, 13 nov 2013, jh
void desiteCore::ProjectAPI::dbCheckIn ( )
slot
Since
1.0.17, 18 jul 2012, jh
void desiteCore::ProjectAPI::dbCheckOut ( QStringList  propList)
slot

Check out properties in local database. Only checked out properties can be edited. All other properties are locked in local DB.

Parameters
propListList of properties in such format: propName##propType
Since
1.0.17, 18 jul 2012, jh
int desiteCore::ProjectAPI::dbClearCache ( QString  propName,
QString  propType 
)
slot
Returns
errCode 1 = OK
-1 = error
Since
1.3.6, 28 apr 2014, jh
void desiteCore::ProjectAPI::dbClearCacheAll ( )
slot
See also
To setup cached values see also itSetupDbCache()
Since
1.3.6, 28 apr 2014, jh
int desiteCore::ProjectAPI::dbDeleteProperty ( QString  objIdList,
QString  propName,
QString  propType 
)
slot

Delete properties from database.

Parameters
objIdListThe properties are removed and deleted from these objects.
Returns
0 undefined
-4 database is not open -5 no objects found in domain projects
Since
1.4.9, 12 dec 2014, jh
bool desiteCore::ProjectAPI::dbGetImmediateUpdate ( )
slot
Since
1.3.0, 14 nov 2013, jh
bool desiteCore::ProjectAPI::dbIsLocalCopy ( )
slot
Since
1.0.17, 18 jul 2012, jh
bool desiteCore::ProjectAPI::dbQueryExec ( QString  sqlQurery)
slot

Create a database query by an SQL statement.

To iterate over the query result use dbQueryNext() and get the values of the current record by dbQueryValue().

Since
1.0.18, 14 aug 2012, jh
bool desiteCore::ProjectAPI::dbQueryNext ( )
slot

Go to next record of last query.

Returns
true if there is another record
false if iterator is at end
See also
dbQueryExec()
Since
1.0.18, 14 aug 2012, jh
QVariant desiteCore::ProjectAPI::dbQueryValue ( int  column)
slot
Since
1.0.18, 14 aug 2012, jh
void desiteCore::ProjectAPI::dbSetImmediateUpdate ( bool  )
slot
Since
1.3.0, 14 nov 2013, jh
void desiteCore::ProjectAPI::deactivateObjTooltip ( )
slot
Since
1.3.2, 28 mar 2014, jh
int desiteCore::ProjectAPI::deleteMaterial ( QString  matID)
slot

Delete material 'matID'.

Returns
ErrorCode : 1 ok
-1 Material could not be found
-2 Material could not be deleted
Since
1.0.20, 14 jan 2013, jh
int desiteCore::ProjectAPI::deleteObjects ( QString  objIdList)
slot

Delete and remove object.
The 3D-view is not refreshed after the objects have been deleted. Call 'repaint3DView()' to update the screen after deleting objects.

Parameters
objIdListList of objects IDs seperated by ';'
Returns
Number of deleted objects
-1 - Error
Since
1.3.0, 02 jan 2014, jh
bool desiteCore::ProjectAPI::endTransaction ( )
slot
Since
1.0.18, 20 aug 2012, jh
void desiteCore::ProjectAPI::filterElements ( QString  pName,
QString  pType,
QString  pattern 
)
slot

Filter elements and show matching objects only.

Since
1.0.16
QString desiteCore::ProjectAPI::getActiveTooltipName ( ) const
slot
Returns
Name of active object tooltip. Empty string if no tooltip is active.
Since
1.3.6, 26 apr 2014, jh
QList<QVariant> desiteCore::ProjectAPI::getAvailablePropertyValues ( QString  propName,
QString  propDatatype,
int  maxValues 
)
slot

Get all available values of property 'propName/propDatatype'.

Parameters
maxValues0 - get all values
> 0 - get not more than 'maxValues' items

Example:

var pList = desiteAPI.getAvailablePropertyValues( 'cpiComponentType', 'xs:string', 0 );
for( var i=0; i<pList.length;i++) {
str += '[' + pList[i] + ']\n';
}
Since
1.3.0, 04 nov 2013, jh
See also
QList<QVariant> itGetAvailablePropertyValues(QString propName, QString propDatatype, int maxValues );
QVariantMap desiteCore::ProjectAPI::getBoundingBoxCommon ( QString  objIdList)
slot

Get common bounding box of all objects in objIdList.

{
minX: 0.0,
minY: 0.0,
minZ: 0.0,
maxX: 2.0,
maxY: 2.0,
maxZ: 2.0
}
Since
1.4.10, 10 jun 2015, sl
QVariantMap desiteCore::ProjectAPI::getCamera ( )
slot

projection: 0 = perspective, 1 = ortho

{
projection: 0,
eye: [12.2,23.4,34.5],
poi: [12.2,23.4,34.5],
near: 1.23,
far: 1.23,
aspectRatio: 1.23,
orthoHeight: 1.23
}
Since
1.3.5, 20 apr 2014, jh
QVariantMap desiteCore::ProjectAPI::getClipping ( int  i)
slot

Get clipping parameters as JSON object.

JSON object:

{
enabled: true,
d: 12.23,
nx: 1.0,
ny: 0.0,
nz: 0.0
}

Example.

for( var i=0; i<6; i++ ) {
var clp = desiteAPI.getClipping(i);
console.append( clp.enabled );
console.append( clp.d );
console.append( clp.nx + '/' + clp.ny + '/' + clp.nz );
}
Since
1.3.5, 19 apr 2014, jh
QStringList desiteCore::ProjectAPI::getColorSchemaList ( )
slot
Since
1.0.16
QString desiteCore::ProjectAPI::getContainerByName ( QString  parentID,
QString  name 
)
slot

Get container with name 'name' and parent node 'parentID'. If the container does not exist it is created.

Since
1.0.18, 19 aug 2012, jh
QStringList desiteCore::ProjectAPI::getCreatedPins ( )
slot

Get ids of all pins created since navigation mode was set to 'pin'.

Since
1.4.10, xx may 2015, jh
QString desiteCore::ProjectAPI::getCurrentColorSchema ( )
slot
Since
1.0.16
QString desiteCore::ProjectAPI::getCurrentViewAsImage ( )
slot

Get the current view as Base64 encoded image.

Example:

<html>
<head>
<script>
function showView()
{
// console.log('show view');
var s = desiteAPI.getCurrentViewAsImage();
imgA.src = 'data:image/png;base64,' + s;
}
</script>
</head>
<body>
<input type="submit" onclick="showView()" value="Show View" /> <br>
<image width="200" id="imgA" />
</body>
</html>
Since
1.3.4, 12 apr 2014, jh
QStringList desiteCore::ProjectAPI::getListOfObjTooltips ( )
slot
Since
1.3.2, 28 mar 2014, jh
QString desiteCore::ProjectAPI::getLocked ( )
slot
Since
1.3.6, 25 apr 2014, jh
QString desiteCore::ProjectAPI::getMaterialIDByName ( QString  matName)
slot

Get ID of material 'matName'. If material does not exist an empty string is returned.

Since
1.0.20, 14 jan 2013, jh
QStringList desiteCore::ProjectAPI::getMaterialList ( )
slot

Get list of materials (List of IDs)

QString desiteCore::ProjectAPI::getModelByName ( QString  name)
slot

Return ID of Model 'name'. If the model does not exist it is created.

Since
1.0.17, 16 jun 2012, jh
Remarks
This method is deprecated and will be removed in future versions. Use getModelListByName() and createModel() instead.
QStringList desiteCore::ProjectAPI::getModelListByName ( QString  name)
slot

Get a list of IDs of all models with name 'name'.

Since
1.3.0, 02 jan 2014, jh
QString desiteCore::ProjectAPI::getNavigationMode ( )
slot
Since
1.0.16
QVariantMap desiteCore::ProjectAPI::getPainterOptions ( )
slot

Get Painter Options.

Returns an Object with the following Properties:

Property Type
drawSolid bool
drawWired bool
edgesColor list(3) of float (RGB)
edgesWidth int
drawNegative bool
drawComposites bool
drawOOBB bool
drawOOBBxy bool
drawTesselation bool
drawNormalVectors bool
backfaceCulling bool
selectionColor list(3) of float (RGB)
selectCompositeParts bool
selectAllCompositeParts bool
selectVisibleCompPartsOnly bool

Example:

var pOpt = desiteAPI.getPainterOptions();
if (pOpt.drawWired) {
alert( 'Edges are drawn in color ' + pOpt.edgesColor[0] + ',' + pOpt.edgesColor[1] + ',' + pOpt.edgesColor[2] );
}
Since
1.3.8, 06 may 2014, ah
QString desiteCore::ProjectAPI::getRootContainerByName ( QString  modelName,
QString  rootContainerName 
)
slot

Return ID of Root Container 'rootContainerName' which is elements of model 'modelName'. If the model or the container does not exist it is created. If the model is readonly an empty string is returned.

Since
1.0.17, 16 jun 2012, jh
QStringList desiteCore::ProjectAPI::getRootContainerList ( QString  modelName)
slot
Since
1.0.18, 19 aug 2012, jh
QString desiteCore::ProjectAPI::getSelected ( )
slot

Get selected elements.

Returns
List of element IDs separated by ';'
Since
1.0.16
QStringList desiteCore::ProjectAPI::getViewpointIDList ( )
slot

Get ID list of viewpoints

Since
1.4.9, 22 jan 2015, jh
QStringList desiteCore::ProjectAPI::getViewpointNameList ( )
slot

Get list of names of viewpoints

Since
1.4.9, 22 jan 2015, jh
QStringList desiteCore::ProjectAPI::getViewpointsByName ( QString  name)
slot

Get ID list of viewpoints

Since
1.4.9, 22 jan 2015, jh
QString desiteCore::ProjectAPI::getVisible ( )
slot

Get visible elements.

Returns
List of element IDs separated by ';'
Since
1.0.16
QVariantMap desiteCore::ProjectAPI::getVisualizationOptions ( )
slot

Get Visualization Options.

Returns an Object with the following Properties:

Property Type
drawOrigin bool
drawGrid bool
gridDistanceFine double
gridDistanceBold double
drawBoundingBox bool
showFramerate bool
enableFastPaint bool
lineStepFastPaint int
walkSpeed double
decimalPlaces int
bgColor list(3) of float (RGB)
lineStep int
drawNorthArrow bool
northArrowPos list(3) of float (xyz)
northArrowRot double
modelCoordinates list(2) of double (xy)
gpsLat double
gpsLon double

Example:

var visOpt = desiteAPI.getVisualizationOptions();
if (visOpt.drawNorthArrow) {
alert( 'North arrow at coordinates ' + visOpt.northArrowPos[0] + ',' + visOpt.northArrowPos[1] + ',' + visOpt.northArrowPos[2] );
}
Since
1.3.5, 22 apr 2014, ah
bool desiteCore::ProjectAPI::hasElement ( QString  ID)
slot

Check if object or container exists with the identificator 'ID'.

Since
1.3.0, 21 jan 2014, jh
void desiteCore::ProjectAPI::hideAll ( bool  repaint)
slot

Blocked objects are not included.

Since
1.0.16
void desiteCore::ProjectAPI::hideElements ( QString  objIdList,
bool  ignoreObjectLocking = false 
)
slot
Parameters
ignoreObjectLockingHide also objects if they are blocked [optional]
Since
1.0.16
Remarks
1.3.8 Added optional parameter 'ignoreObjectLocking', jh
int desiteCore::ProjectAPI::itByFilter ( QString  propName,
QString  propDatatype,
QString  filterPattern 
)
slot

Get objects which match the filter. If the filter should be applied on all objects make sure the object iterator is cleared first. Otherwise the filter is applied on an existing object iterator.

Since
1.3.0, 05 nov 2013, jh
int desiteCore::ProjectAPI::itByObjectList ( QString  objIdList)
slot

Object Iterator is set to objects in objIdList.

Parameters
idListList of Object IDs separated by ';'.
Since
1.3.0, 15 nov 2013, jh
void desiteCore::ProjectAPI::itCalcOOBB ( double  eps)
slot

Calculate OptOBB of all contained 3D-objects. The boundingbox is only calculated if an object has no OOBB.

Since
1.4.7, 5 sep 2014, jh
void desiteCore::ProjectAPI::itCalcOOBBxy ( double  eps)
slot

Calculate OptOBBxy of all contained 3D-objects. The boundingbox is only calculated if an object has no OOBBxy.

Since
1.4.7, 5 sep 2014, jh
void desiteCore::ProjectAPI::itClear ( )
slot

Clear and delete an existing object iterator.

Since
1.3.0, 05 nov 2013, jh
void desiteCore::ProjectAPI::itColorCode ( QString  propName,
QString  propDT 
)
slot

Color code objects in current object iterator. If the current object iterator does not exist all objects are color coded by property 'propName'. An existing object iterator is deleted by calling itClear().

Since
1.3.0, 15 nov 2013, jh
void desiteCore::ProjectAPI::itColorCodeNumber ( QString  propName,
QString  propDT,
double  intervalSize 
)
slot

Color code objects in current object iterator. If the current object iterator is empty or does not exists all objects are color coded by property 'propName'. An existing object iterator is deleted by calling itClear().

Since
1.3.0, 15 nov 2013, jh
int desiteCore::ProjectAPI::itCount ( )
slot

Count the elements in current object iterator.

Since
1.3.0, 05 nov 2013, jh
QList<QVariant> desiteCore::ProjectAPI::itGetAvailablePropertyValues ( QString  propName,
QString  propDatatype,
int  maxValues 
)
slot

Get property values of objects in current object iterator.

See also
QList<QVariant> getAvailablePropertyValues(QString propName, QString propDatatype, int maxValues );
Since
1.3.1, 24 mar 2014, jh
QString desiteCore::ProjectAPI::itGetObjectList ( )
slot

Get list of IDs of current object iterator.

Since
1.3.7, 1 may 2014, jh
bool desiteCore::ProjectAPI::itHasNext ( )
slot
Returns
true if the current object iterator has more elements.
Since
1.3.0, 05 nov 2013, jh
QString desiteCore::ProjectAPI::itNext ( )
slot

Get ID of next element in object iterator.

Since
1.3.0, 05 nov 2013, jh
void desiteCore::ProjectAPI::itSetMaterial ( QString  matID)
slot

Set material to current objects of iterator.

Since
1.3.7, 1 may 2014, jh
void desiteCore::ProjectAPI::itSetupDbCache ( QString  propName,
QString  propType 
)
slot

Setup cache for objects in iterator and property 'propname'.

Since
1.3.6, 28 apr 2014, jh
void desiteCore::ProjectAPI::itToFront ( )
slot

Set object iterator before first element. Call itNext(9 to get the first element.

Since
1.3.0, 05 nov 2013, jh
void desiteCore::ProjectAPI::itUpdateOOBB ( double  eps)
slot

Calculate OptOBB of all contained 3D-objects. The boundingbox is always calculated.

Since
1.4.7, 5 sep 2014, jh
void desiteCore::ProjectAPI::itUpdateOOBBxy ( double  eps)
slot

Calculate OptOBB of all contained 3D-objects. The boundingbox is always calculated.

Since
1.4.7, 5 sep 2014, jh
void desiteCore::ProjectAPI::lockObjects ( QString  objIdList)
slot
Since
1.3.6, 25 apr 2014, jh
void desiteCore::ProjectAPI::message ( QString  )
slot

Send a message to the remote interface of the desite application. This is the same interface as it can be used with a TCP-socket. The interface is documented in the tutorial 'desite_remote.pdf'.

This is functionality is available in desite MD only!

Example:
show a message in a message window:

desiteAPI.message( "<cmdMessage><![CDATA[<font size=\"+2\" color=\"#ffffff\">Nur eine Tür selektieren!</font>]]></cmdMessage>");
Since
1.0.18, 15 aug 2012, jh
bool desiteCore::ProjectAPI::openFile ( QString  filename)
slot

Open a textstream to a new file for writing.

Returns
true - file could be opend
false - file could not be opened
Since
1.3.0, 30 oct 2013, jh
void desiteCore::ProjectAPI::openLink ( QString  url,
bool  useDesktopService 
)
slot

Open an URL by passing this url to the operating system or to the project.

Parameters
useDesktopServicetrue: the URL is passed directly to the operating system
false: the project handles the link, this enabled paths relative to the project directory
// Open webpage in the standard browser.
desiteAPI.openLink( 'http://www.ceapoint.com', true );
Since
1.3.1, 27 feb 2014, jh
void desiteCore::ProjectAPI::openProject ( QString  url,
bool  useSessionData 
)
slot

Open project in this instance.

Parameters
useSessionDataOpen project with last session settings such as last viewpoint.
Since
1.3.3, 02 apr 2014, jh
QStringList desiteCore::ProjectAPI::readTextFile ( QString  filename)
slot

Read text file and return each line as string.

var lineList = desiteAPI.readTextFile( desiteAPI.getProjectDirectory () + '/WebForms/mat.csv' );
for( var i=0; i<lineList.length; i++) {
console.append( lineList[i] );
}
Since
1.3.6, 26 apr 2014, jh
int desiteCore::ProjectAPI::removeAllLinkedObjects ( QString  objID)
slot

Remove all linked objects from object 'objID'.

Returns
1 : ok
-1 : could not find object 'objID'
Since
1.0.17, 16 jun 2012, jh
void desiteCore::ProjectAPI::removeFromViewPoint ( QString  vpID,
QString  objIdList 
)
slot

Get ID list of viewpoints

Since
1.4.9, 22 jan 2015, jh
void desiteCore::ProjectAPI::removeObjectListFromTooltip ( QString  objIdList,
QString  tooltipname 
)
slot
Since
1.3.2, 28 mar 2014, jh
void desiteCore::ProjectAPI::reorderElements ( )
slot

To draw transparent object properly these elements have to be drawn at last. To enforce the correct order of elements call 'reorderElements()'.

Since
1.3.5, 19 apr 2014, jh
void desiteCore::ProjectAPI::repaint3DView ( )
slot

Refresh 3D-view.

Since
1.0.16
void desiteCore::ProjectAPI::resetMaterials ( )
slot

Reset all materials to materials from CAD-file. 3D-View is not updated. To refresh the 3D-view call reapint3DView().

Since
1.0.20, 14 jan 2013, jh
QString desiteCore::ProjectAPI::saveViewpoint ( QString  name,
bool  saveVisible = true,
bool  saveSelected = false 
)
slot

Save the current view as viewpoint.

Parameters
saveVisible: Store the visible objects to new viewpoint
saveSelected: Store the selected objects to new viewpoint
Returns
ID of new viewpoint.
Since
1.3.5, 18 apr 2014, jh
void desiteCore::ProjectAPI::selectElements ( QString  objIdList,
bool  flag 
)
slot

Select objects.

After selection the 3D-view is not repainted. To refresh the 3D-view call repaint3DView():

Parameters
objIdListList of Object IDs separated by ';'.
flagtrue = select, false = unselect elements
Since
1.0.16
void desiteCore::ProjectAPI::selectVisible ( )
slot
Since
1.0.16
void desiteCore::ProjectAPI::selectVisibleGeometric ( )
slot
Since
1.0.17, 01 jul 2012, jh
void desiteCore::ProjectAPI::setCamera ( QVariantMap  cam)
slot

Set camera.

Parameters
cam: Camera encoded as JSON
var cam = {
near: 0.5,
far: 25000,
eye: [ 0.0, 1.0, 2.0 ],
poi: [ 10.0, 8.0, 3.0 ],
projection: 0
}
desiteAPI.setCamera( cam );
Since
1.3.5, 20 apr 2014, jh
void desiteCore::ProjectAPI::setClipping ( int  i,
QVariantMap  clp 
)
slot
Parameters
i: Index of clipping plane [0,5]
var clp = { enabled: true, d: 12.0, nx: 1.0, ny: 0.0, nz: 0.0 }
desiteAPI.setClipping( 0, clp );
Since
1.3.5, 19 apr 2014, jh
int desiteCore::ProjectAPI::setLinkedObjects ( QString  objID,
QString  objIdList 
)
slot

Link objects.

Parameters
objID: ID of object to which the objects in objIdList should be linked. The object must be geometric object or an activity.
Returns
1 : ok
-1 : could not find object 'objID'
Since
1.0.17, 16 jun 2012, jh
int desiteCore::ProjectAPI::setMaterialToObjects ( QString  matID,
QString  objIdList 
)
slot
Returns
Number of affected objects
-1 Error: Material not found
void desiteCore::ProjectAPI::setName ( QString  objIdList,
QString  name 
)
slot

Rename all elements of objIdList to 'name'.

Since
1.4.10, 11 jun 2015, sl
void desiteCore::ProjectAPI::setNavigationMode ( QString  mode,
QString  pinModeContainerID = QString() 
)
slot

Modes:

pin orbit pan lookaround zoom ...

Parameters
pinModeContainerIDIF pinMode this is the parentcontainer where the pins are created.
Since
1.0.16
void desiteCore::ProjectAPI::setObjectsToWireMode ( QString  objIdList,
bool  value 
)
slot
Parameters
valuetrue = set objects to wire mode
false = set objects to normal mode
Since
1.3.0, 13 nov 2013, jh
void desiteCore::ProjectAPI::setPainterOptions ( QVariantMap  opt)
slot

Set Painter Options

Parameters
opt: Options encoded as a JSON object

See getPainterOptions() for a list of all properties; not all must be set!

Example:

desiteAPI.setPainterOptions({ drawWired: true, edgesColor: [1.0, 0.0, 0.0] });
Since
1.3.8, 06 may 2014, ah
int desiteCore::ProjectAPI::setPropertyValue ( QString  objID,
QString  propName,
QString  propType,
QVariant  value 
)
slot

The property is set in the model, not in the DB.

Returns
0 - ok
1 - ok, property has been changed
-1 - error, object 'objID' not found
-2 - error, model not found on which obj ist contained
-3 - error, model is read only
-4 - error, objID not of type domainGeometry3D::Element
Since
1.0.17, 28 jun 2012, jh
int desiteCore::ProjectAPI::setPropertyValueDB ( QString  objIdList,
QString  propName,
QString  propType,
QString  propDomain,
QVariant  value 
)
slot
See also
To setup cached values see also itSetupDbCache()

The property is set in the database.

Parameters
objIdList: List of objects (objIDs separated by ';') which should be affected.
propDomain: One of [geometry,activities]. If empty 'geometry' is used.
Returns
0 - ok
1 - ok, property has been changed

-3 - could not get typeID of property
-4 - type is locked -5 - Objects in 'objIDList' not found

See also
int desiteCore::DataBaseModel::setDataToElementList()
Since
1.0.18, 18 aug 2012, jh

Changed in 1.3.0, 30 jan 2014:
Extended signature by parameter 'propDomain'.

int desiteCore::ProjectAPI::setTransparency ( QString  objIdList,
float  defaultTransparency = 0.95 
)
slot

Elements get a transparent version of their original material. The material is created if not already existing. 3D-View is not updated.

Parameters
objIdList: IDs of elements to be affected, separated by ;
defaultTransparency: Transparency value used if new material is not yet defined, can be omitted (value is then 0.95)
Returns
Number of affected objects
Since
1.3.5, 25 apr 2014, ah
void desiteCore::ProjectAPI::setVisualizationOptions ( QVariantMap  opt)
slot

Set Visualization Options

Parameters
opt: Options encoded as a JSON object

See getVisualizationOptions() for a list of all properties; not all must be set!

Example:

desiteAPI.setVisualizationOptions({ drawNorthArrow: true, northArrowPos: [5.0, 5.0, 0.0] });
Since
1.3.5, 22 apr 2014, ah
void desiteCore::ProjectAPI::showAll ( bool  repaint)
slot
Since
1.0.16
int desiteCore::ProjectAPI::showColorSchema ( QString  name)
slot

Show Color Schema by name.

Returns
1 Ok
-1 Color Schema does not exist
Since
1.0.16
void desiteCore::ProjectAPI::showElements ( QString  objIdList,
bool  includeBlocked = false 
)
slot
Parameters
includeBlockedShow also objects if they are blocked [optional]
Since
1.0.16
Remarks
1.3.8 Added optional parameter 'includeBlocked', jh
void desiteCore::ProjectAPI::showElementsOnly ( QString  objIdList)
slot

Hide all objects and show objects in list 'objIdList' only.

Since
1.3.5, 19 apr 2014, jh
QVariantMap desiteCore::ProjectAPI::showElementsOOBBSide ( QString  objIdList,
double  prec 
)
slot
Returns
Size of resulting Opt OBB
{
Height: 2.45,
Width: 1.23,
Length: 4.56
}
Since
1.4.8, 29 sep 2014, jh
int desiteCore::ProjectAPI::showViewpoint ( QString  name)
slot

Show a viewpoint by name.

Returns
1 : ok
-1 : viewpoint 'name' could not be found
Since
1.0.16
int desiteCore::ProjectAPI::showViewpointByID ( QString  id)
slot

Show a viewpoint by ID.

Returns
1 : ok
-1 : viewpoint 'id' could not be found
Since
1.3.5
void desiteCore::ProjectAPI::showWireModeSchema ( QString  name)
slot
Since
1.3.0, 30 oct 2013, jh
void desiteCore::ProjectAPI::startEXE ( QString  prg,
QString  args 
)
slot

Start program

Search order for programs is:
1) absolute path
2) application directory
3) project directory

Since
1.0.17, 18 jul 2012, jh
bool desiteCore::ProjectAPI::startTransaction ( )
slot
Since
1.0.18, 20 aug 2012, jh
int desiteCore::ProjectAPI::transformObject ( QString  objID,
QString  transformation 
)
slot

Rotate, scale, translate object.

Parameters
transformationscale, rotate, translate encoded as XML

Transformaton:

<t>
<scale sx="1.0" sy="1.0" sz="1.0" />
<translate dx="10.0" dy="20.0" dz="30.0" />
<rotate x="2.0" y="1.0" z="2.0" m="0.5 0.5 0.0 0.5 0.0 0.5 0.0 0.0 1.0" />
</t>
Returns
1 Ok
-1 Could not find object
Since
27 dec 2013, jh
void desiteCore::ProjectAPI::unlockAllObjects ( )
slot
Since
1.3.6, 25 apr 2014, jh
void desiteCore::ProjectAPI::unlockObjects ( QString  objIdList)
slot
Since
1.3.6, 25 apr 2014, jh
void desiteCore::ProjectAPI::updateBoundingBox3DView ( )
slot

Update overall bounding box of all objects in 3d view.

Since
1.3.5, 15 apr 2014, jh
bool desiteCore::ProjectAPI::writeFile ( QString  filename,
QString  content 
)
slot

Write a string to file 'filename'

Returns
true - file has been written
false - error
Since
1.3.0, 30 oct 2013, jh
bool desiteCore::ProjectAPI::writeToFile ( QString  content)
slot

Write to an open file.

See also
openFile()
Returns
true - ok
false - file is not open
Since
1.3.0, 30 oct 2013, jh
void desiteCore::ProjectAPI::zoomTopView ( )
slot

Show elements from top. Zoom to visible if no elemets are selected, otherwise zoom to selected objects.

Since
1.0.16
void desiteCore::ProjectAPI::zoomToSelected ( )
slot
Since
1.0.16
void desiteCore::ProjectAPI::zoomToVisible ( )
slot
Since
1.0.16

The documentation for this class was generated from the following file:

Created: Wed Jan 6 2016 14:55:50