MainPage   Related pages 
ProjectAPI.h
1 
2 //
3 // $Id: ProjectAPI.h 2983 2019-10-17 13:37:25Z ansgar.horstmann $
4 // (c) ceapoint aec technologies GmbH
5 //
6 
7 
8 #pragma once
9 
10 
11 #include <domainBim/AutomationAPI.h>
12 #include <xqtgl/xQGLView.h>
13 
14 #include <QString>
15 #include <QStringList>
16 #include <QFile>
17 #include <QTextStream>
18 
19 
20 namespace desiteCore
21 {
22 
23  class NavigatorProject;
24 
39  {
40  Q_OBJECT
41 
42  public:
43 
44 
46  explicit ProjectAPI(NavigatorProject* np, QObject* parent = 0);
47  virtual ~ProjectAPI();
49 
50 
51  public slots:
52 
66  int message(QString);
67 
76  bool sendRemoteMessage(QString message);
77 
78 
79 #pragma region TOOLS
80 
92  void startEXE(QString prg, QString args);
93 
99  void showOnScreenKeyboard();
100 
116  void openLink( QString url, bool useDesktopService );
117 
137  QString showOpenFileDialog( QString caption = "", QString directory = "", QString filter = "" );
138 
139 
141 #pragma endregion
142 
143 
144 #pragma region PROJECT
145 
154  void openProject( QString url, bool useSessionData );
155 
165  int saveProject();
166 
180  int saveCPA( QString cpa_filename, QString pack_bookmark );
181 
182  // ah: hidden until documented and properly implemented
183  // since, supported domains, error codes
185  int saveDomain( QString domainName );
200  int importModel( QString filename, bool showDialog = true, QVariantMap options = QVariantMap() );
201 
223  QString exportBCF(QStringList sourceIds, QString targetPath, QString targetFileBaseName, QString bcfVersion = "2.1");
224 
234  bool importBCF(QString sourceFilePath);
235 
237 #pragma endregion
238 
239 
240 #pragma region FILTER OBJECTS
241 
247  void filterElements(QString pName, QString pType, QString pattern, bool checkInh = true, QString domainCombination = "geometry" );
248 
250 #pragma endregion
251 
252 
253 #pragma region MATERIALS
254 
266  int showColorSchema(QString name);
267 
269 #pragma endregion
270 
271 
272 #pragma region VISIBILITY, SELECTION
273 
280  void showAll(bool repaint, QString domainCombination = "geometry" );
281 
288  void hideAll(bool repaint, QString domainCombination = "geometry" );
289 
298  void showElements( QString idList, bool includeBlocked = false, QString domainCombination = "geometry" );
299 
307  void showElementsOnly( QString IDList, QString domainCombination = "geometry");
308 
317  void hideElements( QString idList, bool ignoreObjectLocking = false, QString domainCombination = "geometry" );
318 
327  void clearSelection( bool repaint, QString domainCombination = "geometry" );
328 
333  void selectVisible();
334 
339  void selectVisibleGeometric();
340 
349  void selectElements( QString idList, bool flag, QString domainCombination = "geometry" );
350 
359  void zoomToSelected();
360 
369  void zoomToVisible();
370 
381  void zoomToObjects( QString objIDs );
382 
387  void zoomToAllDocuments();
388 
394 
399  void zoomToVisibleDocuments();
400 
408  void zoomToDocuments( QStringList idList );
409 
414  void zoomToAllResources();
415 
421 
425  void zoomToVisibleResources();
426 
431  void zoomToResources( QStringList idList );
432 
437  void zoomToLocationGK( double rw, double hw, double h);
438 
443  void zoomToLocationGps( double lat, double lon );
444 
449  void moveToLocationGps( double lat, double lon );
450 
455  void zoomTopView();
456 
468  QString getAll( QString domainFilter = "geometry" );
469 
481  QStringList getAllElements( QString domainFilter = "geometry" );
482 
494  QString getVisible( QString domainFilter = "geometry" );
495 
507  QStringList getVisibleElements( QString domainFilter = "geometry" );
508 
518  bool hasVisible( QString domainFilter = "all" );
519 
528  int countVisible( QString domainFilter = "geometry" );
529 
541  QString getSelected( QString domainFilter = "geometry" );
542 
554  QStringList getSelectedElements( QString domainFilter = "geometry" );
555 
556 
566  bool hasSelected( QString domainFilter = "all" );
567 
577  int countSelected( QString domainFilter = "geometry" );
578 
588  void setVisualisationMode(int mode, bool repaint = true );
589 
593  int getVisualisationMode();
594 
611  QVariantMap showElementsOOBBSide( QString IDList, double prec = 1.e-2 );
612 
623  QVariantMap showElementsOOBBTop( QString IDList, double prec = 1.e-2 );
624 
635  QVariantMap showElementsOOBBFront( QString idList, double prec = 1.e-2 );
636 
646  void showDimensionsPainter( bool showAABB, bool showOOBB );
647 
652  void hideDimensionsPainter();
653 
658  void repaint3DView();
659 
661 #pragma endregion
662 
663 
664 #pragma region VIEWPOINTS
665 
677  int showViewpoint(QString name);
678 
689  int showViewpointByID(QString id);
690 
716  QVariantMap getViewpointList();
717 
738  QVariantMap getViewpointMetadata( QString id );
739 
745  void addToViewPoint( QString vpID, QString objIdList );
746 
752  void removeFromViewPoint( QString vpID, QString objIdList );
753 
767  QString saveViewpoint(QString name, bool saveVisible = true, bool saveSelected = false, QString desc = QString(), bool saveRedlining = false, bool copyMeasureItems = false );
768 
773  bool deleteViewpointByID( QString id );
774 
779  bool deleteAllViewpoints();
780 
808  QString getCurrentViewAsImage();
809 
825  bool saveCurrentViewToFile( QString filename );
826 
907  QVariantMap getViewpointAsJsonObject( const QString& vpID, const QStringList& blacklist = QStringList() );
908 
915  QString createViewpointFromJsonObject( const QVariantMap& vm );
916 
923  QVariantMap getViewpointObjectDataAsJsonObject( const QString& vpID );
924 
934  int setViewpointObjectDataFromJsonObject( const QString& vpID, const QVariantMap& vm );
935 
942  QVariantMap getViewpointMeasureItemsAsJsonObject( const QString& vpID );
943 
953  int addMeasureItemsToViewpointFromJsonObject( const QString& vpID, const QVariantMap& vm );
954 
961  void applyViewByJsonObject( const QVariantMap& vm );
962 
967  void applyMeasureItemsFromJsonObject( const QVariantMap& vm );
968 
970 #pragma endregion
971 
972 
973 #pragma region CAMERA / LIGHT SOURCES
974 
1002  QVariantMap getClipping(int i);
1003 
1016  void setClipping(int i, QVariantMap clp);
1017 
1041  QVariantMap getCamera();
1042 
1075  QVariantMap getCameraAsJsonObject();
1076 
1103  void setCamera(QVariantMap cam);
1104 
1113  void setCameraFromJsonObject(QVariantMap camJSON);
1114 
1137  QList<QVariant> getLightSources();
1138 
1144  void setLightSources( QList<QVariant> lList );
1145 
1186  QVariantMap getVisualizationOptions();
1187 
1202  void setVisualizationOptions(QVariantMap opt);
1203 
1243  QVariantMap getPainterOptions();
1244 
1259  void setPainterOptions(QVariantMap opt);
1260 
1262 #pragma endregion
1263 
1264 
1265 #pragma region OBJECT TOOLTIPS, DOCUMENTS TOOLTIPS, RESOURCES TOOLTIPS
1266 
1275  int activateObjTooltip(QString name);
1276 
1281  void deactivateObjTooltip();
1282 
1288  QString getActiveTooltipName() const;
1289 
1293  void setDocumentsTooltipsVisible( bool v );
1294 
1299 
1304  void setResourcesTooltipsVisible( bool v );
1305 
1311 
1312 
1314 #pragma endregion
1315 
1316 
1317 #pragma region _4D_SIMULATION
1318 
1320 
1325  void set4dIsActive( bool active );
1326 
1331  bool get4dIsActive();
1332 
1338  bool set4dDateTime( QDateTime dt );
1339 
1344  QDateTime get4dDateTime();
1345 
1367  QVariantMap get4dOptions();
1368 
1377  void set4dOptions( QVariantMap opt );
1378 
1383  QDateTime get4dProjectStart();
1384 
1389  QDateTime get4dProjectFinish();
1390 
1395  QStringList get4dActiveTaskList( QDateTime dt, bool linkedToObjectsOnly = false );
1396 
1401  QStringList get4dActiveTaskListByInterval( QDateTime dtStart, QDateTime dtEnd, bool linkedToObjectsOnly = false );
1402 
1407  QStringList get4dFinishedTaskList( QDateTime, bool linkedToObjectsOnly = false );
1408 
1413  QStringList get4dProspectiveTaskList( QDateTime, bool linkedToObjectsOnly = false );
1414 
1419  QString get4dTaskColor( QString taskID, QDateTime dt, QString defaultColorName = "#000" );
1420 
1422 
1423 #pragma endregion
1424 
1425 
1426 #pragma region BUILDING STRUCTURE
1427 
1439  void setBsPlanUnderlayActive(bool active);
1440 
1446  bool getBsPlanUnderlayActive();
1447 
1449 #pragma endregion
1450 
1451 
1452 #pragma region NAVIGATION MODES
1453 
1455 
1467  QString getNavigationMode();
1468 
1481  void setNavigationMode( QString mode, QString pinModeContainerID = QString() );
1482 
1483 
1491  QVariantMap getHandlerMode();
1492 
1570  bool setHandlerMode( QVariantMap handlerInfo );
1571 
1576  QStringList getCreatedPins();
1577 
1579 #pragma endregion
1580 
1581 
1582 #pragma region PICK POINTS, MEASURE
1583 
1602  QVariantMap getPickedPoint();
1603 
1632  QVariantMap getAllPickedPoints();
1633 
1650  QVariantMap getPickedPointGPS();
1651 
1669  QVariantMap getPickedPointGK();
1670 
1675  void clearMeasureItems();
1676 
1678 #pragma endregion
1679 
1680 
1681 #pragma region CLASH_DETECTION
1682 
1688  void showClashList( QString clashIdList );
1689 
1691 #pragma endregion
1692 
1693 
1694 //#pragma region SURVEYPOINTS
1695 // ///@{ \name SURVEY POINTS
1696 //
1697 // /*
1698 // Import survey points from file and create model with object points.
1699 //
1700 // \param fileName Full file name with path
1701 // \param propName Name of property which will store value of survey point
1702 // \param delimiter Column delimiter (default: Tab)
1703 //
1704 // \return number of survey points imported if import was successful<br>
1705 // -1 file not found / file could not be opened<br>
1706 // -2 model could not be created
1707 // \since 2.2.1, 21 jun 2018, sl
1708 // */
1709 // int importSurveyPoints( QString fileName, QString propName = "spValue", QChar delimiter = '\t' );
1710 //
1711 // ///@}
1712 //#pragma endregion
1713 
1714  private:
1715 
1716  void zoomToDocumentsByList( QList<model::Element*> eleList );
1717  void zoomToResourcesByList( QList<model::Element*> eleList );
1718 
1722  NavigatorProject* getNavigatorProject();
1723 
1724  int _isPainting_;
1725 
1726  xqtgl::xQGLView* _redliningView;
1727 
1728  };
1729 
1730 }
void filterElements(QString pName, QString pType, QString pattern, bool checkInh=true, QString domainCombination="geometry")
QStringList getCreatedPins()
QStringList get4dActiveTaskListByInterval(QDateTime dtStart, QDateTime dtEnd, bool linkedToObjectsOnly=false)
QString exportBCF(QStringList sourceIds, QString targetPath, QString targetFileBaseName, QString bcfVersion="2.1")
QVariantMap getViewpointAsJsonObject(const QString &vpID, const QStringList &blacklist=QStringList())
QString getAll(QString domainFilter="geometry")
void setCamera(QVariantMap cam)
void zoomToResources(QStringList idList)
QVariantMap getClipping(int i)
int addMeasureItemsToViewpointFromJsonObject(const QString &vpID, const QVariantMap &vm)
void setNavigationMode(QString mode, QString pinModeContainerID=QString())
void showDimensionsPainter(bool showAABB, bool showOOBB)
bool getDocumentsTooltipsVisible()
QStringList getAllElements(QString domainFilter="geometry")
void setVisualisationMode(int mode, bool repaint=true)
void moveToLocationGps(double lat, double lon)
QVariantMap getPickedPoint()
void hideElements(QString idList, bool ignoreObjectLocking=false, QString domainCombination="geometry")
QStringList get4dActiveTaskList(QDateTime dt, bool linkedToObjectsOnly=false)
void set4dIsActive(bool active)
int showViewpoint(QString name)
void addToViewPoint(QString vpID, QString objIdList)
int setViewpointObjectDataFromJsonObject(const QString &vpID, const QVariantMap &vm)
QString saveViewpoint(QString name, bool saveVisible=true, bool saveSelected=false, QString desc=QString(), bool saveRedlining=false, bool copyMeasureItems=false)
void selectElements(QString idList, bool flag, QString domainCombination="geometry")
Definition: ProjectAPI.h:38
QDateTime get4dDateTime()
int showViewpointByID(QString id)
void showAll(bool repaint, QString domainCombination="geometry")
bool hasVisible(QString domainFilter="all")
QVariantMap getVisualizationOptions()
QVariantMap showElementsOOBBSide(QString IDList, double prec=1.e-2)
void setDocumentsTooltipsVisible(bool v)
QVariantMap showElementsOOBBTop(QString IDList, double prec=1.e-2)
QStringList get4dProspectiveTaskList(QDateTime, bool linkedToObjectsOnly=false)
QStringList getSelectedElements(QString domainFilter="geometry")
void setLightSources(QList< QVariant > lList)
QVariantMap getViewpointMetadata(QString id)
void setClipping(int i, QVariantMap clp)
QString getCurrentViewAsImage()
QList< QVariant > getLightSources()
bool saveCurrentViewToFile(QString filename)
QString getSelected(QString domainFilter="geometry")
void removeFromViewPoint(QString vpID, QString objIdList)
QStringList getVisibleElements(QString domainFilter="geometry")
QVariantMap getPickedPointGPS()
bool hasSelected(QString domainFilter="all")
void zoomToLocationGK(double rw, double hw, double h)
void openLink(QString url, bool useDesktopService)
QVariantMap getCameraAsJsonObject()
QVariantMap getViewpointMeasureItemsAsJsonObject(const QString &vpID)
QVariantMap get4dOptions()
QVariantMap getPainterOptions()
int showColorSchema(QString name)
void setCameraFromJsonObject(QVariantMap camJSON)
void openProject(QString url, bool useSessionData)
QVariantMap getHandlerMode()
bool getResourcesTooltipsVisible()
QString createViewpointFromJsonObject(const QVariantMap &vm)
QVariantMap getCamera()
QString get4dTaskColor(QString taskID, QDateTime dt, QString defaultColorName="#000")
Definition: AutomationAPI.h:30
bool deleteViewpointByID(QString id)
bool setHandlerMode(QVariantMap handlerInfo)
void zoomToObjects(QString objIDs)
QVariantMap getPickedPointGK()
void zoomToLocationGps(double lat, double lon)
QString showOpenFileDialog(QString caption="", QString directory="", QString filter="")
int activateObjTooltip(QString name)
void showClashList(QString clashIdList)
int importModel(QString filename, bool showDialog=true, QVariantMap options=QVariantMap())
void hideAll(bool repaint, QString domainCombination="geometry")
QVariantMap showElementsOOBBFront(QString idList, double prec=1.e-2)
Definition: ProjectAPI.h:20
QDateTime get4dProjectFinish()
bool importBCF(QString sourceFilePath)
void showElements(QString idList, bool includeBlocked=false, QString domainCombination="geometry")
void zoomToDocuments(QStringList idList)
QVariantMap getAllPickedPoints()
void setVisualizationOptions(QVariantMap opt)
int countSelected(QString domainFilter="geometry")
int countVisible(QString domainFilter="geometry")
int saveCPA(QString cpa_filename, QString pack_bookmark)
QStringList get4dFinishedTaskList(QDateTime, bool linkedToObjectsOnly=false)
QVariantMap getViewpointObjectDataAsJsonObject(const QString &vpID)
bool set4dDateTime(QDateTime dt)
void startEXE(QString prg, QString args)
QString getActiveTooltipName() const
QString getVisible(QString domainFilter="geometry")
void showElementsOnly(QString IDList, QString domainCombination="geometry")
void setBsPlanUnderlayActive(bool active)
QVariantMap getViewpointList()
void setResourcesTooltipsVisible(bool v)
bool sendRemoteMessage(QString message)
void applyViewByJsonObject(const QVariantMap &vm)
void clearSelection(bool repaint, QString domainCombination="geometry")
void set4dOptions(QVariantMap opt)
void setPainterOptions(QVariantMap opt)
void applyMeasureItemsFromJsonObject(const QVariantMap &vm)
QDateTime get4dProjectStart()

Created: Mon Nov 18 2019 04:08:00