12 #include <basic/IProgressDelegate.h> 13 #include <model/IProject.h> 14 #include <model/IObject.h> 16 #include <domainDocuments/DocumentProject.h> 17 #include <domainDocuments/Document.h> 19 #include <domainQTO/QTOProject.h> 20 #include <domainQTO/ConstructionElement.h> 53 class CoreAPI :
public QObject,
public basic::IProgressDelegate
59 static bool BLOCK_UNSAFE;
63 CoreAPI::CoreAPI( BimProject* bimPrj, QObject* parent = 0);
66 BimProject* getBimProject()
const {
return _bimProject; }
88 QString addDays(QString dateStr,
int nrDays);
97 QString timeStamp( QString format = QString() );
111 int getCalendarWeek( QDateTime dt );
126 QString
format(
double v,
int dec = 2, QString frmt =
"%L1",
int fieldWidth = 10, QChar fillChar = QChar::Nbsp ) {
return frmt.arg(v,fieldWidth,
'f',dec,fillChar); }
164 QString formatDateTime( QDateTime dt, QString formatstr =
"iso" );
176 long calcHashcode( QString str );
196 QString compressToIfcGuid(QString
id);
204 QString uncompressFromIfcGuid(QString ifcGuid);
224 bool checkRegExp( QString value, QString pattern );
238 double calcSlantedArea(QString objId,
double angleMin = 0.0,
double angleMax = 45.0);
272 QVariantMap calcGpsCoordsByStation( QString objId,
double station );
296 QVariantMap calcGpsCoordsByModelCoords(
double x,
double y );
318 QVariantMap calcModelCoordsByGpsCoords(
double lat,
double lon );
346 QVariantMap calcGkCoordsByModelCoords(
double x,
double y,
double z );
352 QVariantMap calcModelCoordsByGkCoords(
double r,
double h );
375 QVariantMap calcGkCoordsByGpsCoords(
double lat,
double lon );
399 QVariantMap calcGpsCoordsByGkCoords(
double rw,
double hw );
405 QString idListToStr( QStringList idList );
411 QStringList strToIdList( QString strIDList );
418 #pragma region TOOLS - FILES 434 QVariantMap getFileInfo( QString filePath );
443 QString getAbsolutePath( QString filePath );
453 QString getBaseName( QString filePath );
462 QString getFileName( QString filePath );
470 #ifdef ENABLE_READJSON 471 QVariantMap readJsonFromTextFile( QString filename,
bool useCache =
true, QString codec = QString() );
477 #pragma region APPLICATION 483 QString getApplicationDirectory();
489 QString getApplicationFilename();
495 virtual QString getApplicationLanguage();
502 QString getVersionAsString();
514 int getVersionMAJOR();
526 int getVersionMINOR();
538 int getVersionBUILD();
550 QVariantMap getVersion();
557 bool requireVersion(
int major,
int minor,
int patch );
564 #pragma region PROJECT 570 QString getUserName();
575 QString getProjectID();
581 int getProjectVariantNumber();
592 int getProjectVersionNumber();
598 QString getProjectNumber();
603 int setProjectNumber(QString s,
bool overwriteExisting =
false);
608 QString getProjectName();
613 QString getProjectShortDescription();
618 int setProjectShortDescription(QString s,
bool overwriteExisting =
false);
623 QString getProjectLongDescription();
628 int setProjectLongDescription(QString s,
bool overwriteExisting =
false);
633 QString getProjectDirectory();
654 QString getLocation();
668 QVariantMap getProjectLocation()
const;
683 QVariantMap getCloudSettings();
710 QVariantMap getProjectInfo();
716 #pragma region DOMAINS 744 QString getDomainByElement( QString objId );
750 #pragma region PROPERTIES 791 QVariant getPropertyValue(QString objId, QString propName, QString propType,
bool inh =
true );
840 QList<QVariant> getPropertyValuesByObject( QString objId, QString filterpattern =
"*" );
847 QVariant getPropertySource( QString objId, QString propName, QString propType,
bool inh =
true );
860 QString getPropertyUnit(QString objId, QString propName, QString propType,
bool inh =
true );
867 QString getPropertyUnit( QString propName, QString propType );
889 QVariant getPropertyValueByDate(QString objId, QString propName, QString propType,
bool inh =
true );
909 QDateTime getPropertyLastDate(QString objId, QString propName, QString propType,
bool inh =
true );
926 QDateTime getPropertyFirstDate(QString objId, QString propName, QString propType,
bool inh );
994 QVariantMap getPropertyDateListAsJSON( QString objId, QString propName, QString propType,
bool inh =
true );
1031 QVariantList getPropertyDateList(QString objectId, QString propertyBaseName, QString propertyType );
1068 QVariantMap getPropertyTypesByObject( QString objId, QString filterPattern =
"*" );
1104 QVariantMap getPropertyTypesByDomain( QString domainName, QString filterPattern =
"*" );
1128 QVariantMap getPropertyTypeMetaData( QString propName, QString propType );
1165 QList<QVariant> getPropertyTypeList( QString domain =
"all", QString filterPattern =
"*",
bool activeOnly =
false );
1206 QList<QVariant> getPropertyTypeListByObject( QString objId, QString filterPattern =
"*" );
1214 bool isPropertyInherited(QString objId, QString propName, QString propType );
1226 QString getPropertyValueRange(QString idList, QString propName, QString propType, QString domainFilter =
"geometry" );
1239 QStringList getPropertyValueList( QString propName, QString propType,
int maxValues );
1253 QString getPropertyValueAsString(QString objId, QString propName, QString propType,
bool inh =
true );
1304 QVariant evaluateFormula( QString code, QString
id, QString id_otherdomain = QString() );
1319 QString prepareJsCode( QString code, QString
id,
int dec = -1, QString frmt =
"%L1",
int fieldWidth = 10, QChar fillChar = QChar() );
1340 QStringList extractPropertyNames(
const QString& code,
const QString& startTag =
"[[",
const QString& endTag =
"]]" );
1346 #pragma region LINKS BETWEEN OBJECTS 1386 QStringList getLinkedObjects(QString objectIDList, QString resultDomains =
"all", QString objectLookupDomains =
"all");
1402 QStringList getTasksByObjectList(QString idList);
1413 QStringList getObjectsByTaskList(QString idList);
1425 QStringList getDocumentsByObjectList(QString idList);
1436 QStringList getObjectsByDocumentList(QString idList);
1448 QStringList getSectionsByObjectList(QString idList);
1459 QStringList getObjectsBySectionList(QString idList);
1471 QStringList getTypesByObjectList(QString idList);
1483 QStringList getObjectsByTypeList(QString idList);
1495 QStringList getResourcesByObjectList(QString idList);
1506 QStringList getObjectsByResourcesList(QString idList);
1516 QStringList getBoQItemsByObjectList(QString idList);
1524 QStringList getObjectsByBoQItemList(QString idList);
1535 QStringList getPcItemsByObjectList(QString idList);
1545 QStringList getObjectsByPcItemList(QString idList);
1551 #pragma region OBJECT HIERARCHY 1567 QStringList getContainedElements(QString containerId,
int maxDepth,
bool loadExternal =
true);
1580 int countContainedElements(QString containerId,
int maxDepth,
bool loadExternal =
true);
1588 QString getParent(QString objId);
1599 QStringList getOpenings(QString objId);
1610 QStringList getParts(QString objId);
1616 #pragma region STATUS 1626 bool isVisible(QString objId);
1632 bool isSelected(QString objId);
1638 bool isLocked(QString objId);
1644 bool isWired(QString objId);
1650 #pragma region GEOMETRY 1667 QVariantList getPointList( QString objId );
1673 #pragma region ALIGNMENTS / REGIONS 1693 QVariantMap getPointOnAlignmentAtStation( QString alignmentId,
double d );
1710 double getStationOfProjectedPoint( QString alignmentId,
double x,
double y,
double z = 0.0 );
1722 QStringList getRegionsOfAlignment( QString alignmentId );
1735 QVariantList getRangesOfRegion( QString alignmentID, QString regionID );
1749 double getValueOfAlignmentRegion( QString alignmentID, QString regionID );
1756 #pragma region ACTIVITIES 1767 int getTaskMode(QString taskID);
1779 QString getTaskVisualisation(QString taskID);
1790 QString getTaskRestrictionsByTask(QString taskID);
1795 #pragma region LINKRULES 1806 int updateRuleBasedLinks(QString domainName,
bool visibleOnly =
false);
1815 int removeRuleBasedLinks(QString domainName);
1827 model::IContainerObject* getIContainerObject(
const QString&
id, model::eDomainType domainFilter = model::typeDomainAll );
1828 model::IContainer* getIContainer(
const QString&
id, model::eDomainType domainFilter = model::typeDomainAll );
1829 model::Element* getElement(
const QString&
id, model::eDomainType domainFilter = model::typeDomainAll );
1831 model::IProperty* _getProperty( QString objId, QString propName, QString propType,
bool inh );
1832 QVariant _getPropertyValue(
const QString& objId,
const QString& propName,
const QString& propType,
bool inh,
bool evaluate,
bool formatAsString );
1837 void collectGeoObjects(
const QString& idList, QList<model::IObject*>& list );
1842 QList<QDateTime> _getPropertyDateList(
const QString& objId,
const QString& propBaseName,
const QString& propType,
const QTime& defaultTime );
1847 BimProject* _bimProject;
1851 #ifdef ENABLE_READJSON 1853 QVariantMap _fileCache;
QString format(double v, int dec=2, QString frmt="%L1", int fieldWidth=10, QChar fillChar=QChar::Nbsp)
Definition: CoreAPI.h:126