61#include <ACG/QtWidgets/QtFileDialog.hh>
69#include "OpenFlipper/BasePlugin/TextureInterface.hh"
70#include "OpenFlipper/BasePlugin/INIInterface.hh"
72#include <OpenFlipper/common/RecentFiles.hh>
74#include "OpenFlipper/BasePlugin/PluginFunctionsCore.hh"
83#include <OpenFlipper/widgets/messageBox/StaysOnTopMessageBox.hh>
87#include <ACG/Scenegraph/MaterialNode.hh>
88#include <ACG/Scenegraph/SeparatorNode.hh>
91 #include <PythonInterpreter/PythonInterpreter.hh>
94#define WIDGET_HEIGHT 800
95#define WIDGET_WIDTH 800
113 nextBackupGroupId_(0),
146 vm->
icon =
"viewmode_all.png";
153 std::vector< Viewer::ViewerProperties* > viewerProperties;
155 for (
int i=0; i < 4; i++) {
158 viewerProperties.push_back( viewerProperty );
164 OpenFlipper::Options::defaultViewingDirection( PluginFunctions::VIEW_FREE, 0 );
165 OpenFlipper::Options::defaultViewingDirection( PluginFunctions::VIEW_TOP, 1 );
166 OpenFlipper::Options::defaultViewingDirection( PluginFunctions::VIEW_LEFT, 2 );
167 OpenFlipper::Options::defaultViewingDirection( PluginFunctions::VIEW_FRONT, 3 );
179 initializeUpdateTypes();
216 if ( OpenFlipper::Options::gui() ) {
232 if ( OpenFlipperSettings().value(
"Core/Gui/splash",
true).toBool() ) {
233 QPixmap splashPixmap(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() +
"splash.png");
235 splash_ =
new QSplashScreen(splashPixmap, Qt::SplashScreen | Qt::WindowStaysOnTopHint);
238 splash_->showMessage(tr(
"Initializing mainwindow") ,
239 Qt::AlignBottom | Qt::AlignLeft , Qt::white);
270 #if QT_VERSION_MAJOR < 6
276 QScreen *screen = QGuiApplication::primaryScreen();
277 QRect rect = screen->geometry();
279 uint width = rect.width();
280 if ( width > 1000 ) {
284 uint height = rect.height();
285 if ( height > 1000 ) {
290 width = rect.width() - 300;
291 height = rect.height() - 150;
303 QString titleInfo = OpenFlipper::Options::windowTitle();
306 titleInfo = titleInfo +
" [DEBUG]";
309 if ( OpenFlipper::Options::coreProfile() )
310 titleInfo = titleInfo +
" CoreProfile";
312 titleInfo = titleInfo +
" CompatProfile";
325 connect(
this,SIGNAL(
log(QString )),newlog,SLOT(
slotLog(QString )),Qt::DirectConnection);
328 if ( OpenFlipper::Options::gui() )
340 if ( OpenFlipper::Options::gui() ){
358 omerr().connect(*newlog);
359 omerr().disconnect(std::cerr);
364 if ( OpenFlipper::Options::gui() )
375 omout().connect(*newlog);
376 omout().disconnect(std::cout);
381 if ( OpenFlipper::Options::gui() )
392 omlog().connect(*newlog);
397 if ( OpenFlipper::Options::gui() )
412 if ( OpenFlipper::Options::gui() )
420 connect(
this,SIGNAL(
scriptLog(QString )),newlog,SLOT(
slotLog(QString )),Qt::DirectConnection);
427#if QT_VERSION_MAJOR < 6
436 printFunction.setProperty(
"textedit",
scriptEngine_.newQObject(
this));
437 scriptEngine_.globalObject().setProperty(
"print", printFunction);
441 scriptEngine_.globalObject().setProperty(
"printToFile", printToFileFunc);
454 qScriptRegisterSequenceMetaType< QVector< int > >(&
scriptEngine_);
461 fromScriptValueVector,
465 QScriptValue ctorVec3 =
scriptEngine_.newFunction(createVector);
466 scriptEngine_.globalObject().setProperty(
"Vector", ctorVec3);
472 toScriptValueVector4,
473 fromScriptValueVector4,
477 QScriptValue ctorVec4 =
scriptEngine_.newFunction(createVector4);
478 scriptEngine_.globalObject().setProperty(
"Vector4", ctorVec4);
486 toScriptValueDataType,
487 fromScriptValueDataType,
491 QScriptValue dataTypector =
scriptEngine_.newFunction(createDataType);
492 scriptEngine_.globalObject().setProperty(
"DataType", dataTypector);
500 toScriptValueMatrix4x4 ,
501 fromScriptValueMatrix4x4,
505 QScriptValue matrix4x4ctor =
scriptEngine_.newFunction(createMatrix4x4);
506 scriptEngine_.globalObject().setProperty(
"Matrix4x4", matrix4x4ctor);
513 QScriptEngine::QtOwnership,
514 QScriptEngine::ExcludeChildObjects |
515 QScriptEngine::ExcludeSuperClassMethods |
516 QScriptEngine::ExcludeSuperClassProperties
519 scriptEngine_.globalObject().setProperty(
"core", scriptInstance);
521 QScriptValueIterator it(scriptInstance);
522 while (it.hasNext()) {
537 if ( OpenFlipper::Options::gui() ) {
545 if ( OpenFlipper::Options::currentViewMode( ) !=
"" )
551 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
576 QString rendererDefault;
578 if ( OpenFlipper::Options::coreProfile() )
579 rendererDefault =
"Shader Pipeline Renderer Plugin";
581 rendererDefault =
"Default Classical Renderer Plugin";
585 QString rendererKey =
"Viewer" + QString::number(i)+
"/DefaultRenderer";
586 QString rendererName = OpenFlipperSettings().
value(rendererKey,rendererDefault).toString();
589 int rendererId = renderManager().
getRendererId(rendererName);
591 if ( rendererId == -1 ) {
594 emit
log(
LOGERR,tr(
"Stored default renderer \"") + rendererName + tr(
"\" is not available, trying") + rendererDefault +
"!");
600 if ( rendererId != -1 ) {
604 emit
log(
LOGERR,rendererDefault + tr(
" renderer is also not available. Trying to use any other renderer i can find!"));
607 const unsigned int rendererCount = renderManager().
available();
608 emit
log(
LOGERR,tr(
"Currently ") + QString::number(rendererCount) + tr(
" renderers are available:") );
609 for (
unsigned int rendererId = 0 ; rendererId < rendererCount ; ++rendererId )
610 emit
log(
LOGERR, tr(
"Renderer ") + QString::number(rendererId) +
": " + renderManager()[rendererId]->name );
620 if ( renderManager().available() == 1 ) {
622 emit
log(
LOGERR,tr(
"No external plugin renderers available!"));
623 emit
log(
LOGERR,tr(
"The build in renderer is only a very limited one and is missing many features!"));
624 emit
log(
LOGERR,tr(
"You should build and use the other renderers!"));
626 StaysOnTopMessageBox::warning(0,tr(
"No external plugin renderers available!"),tr(
"The build in renderer is only a very limited one and is missing many features.\nYou should build and use the other free renderers shipped with OpenFlipper."));
635 QStringList optionFiles = OpenFlipper::Options::optionFiles();
636 for (
int i = 0 ; i < (int)optionFiles.size(); ++i) {
639 splash_->showMessage(tr(
"Loading Configuration File %1/%2").arg(i+1).arg(optionFiles.size()),
640 Qt::AlignBottom | Qt::AlignLeft , Qt::white);
645 if ( OpenFlipper::Options::gui() )
658 if ( OpenFlipper::Options::lang().contains(
"UTF") || OpenFlipper::Options::lang().contains(
"utf") ) {
666 if ( OpenFlipper::Options::gui() ) {
668 QFile statesFile(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"WindowStates.dat");
670 if (statesFile.exists() ) {
671 QSettings windowStates(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"WindowStates.dat", QSettings::IniFormat);
674 coreWidget_->restoreState (windowStates.value(
"Core/Window/State").toByteArray ());
676 coreWidget_->restoreGeometry (windowStates.value(
"Core/Window/Geometry").toByteArray ());
685 windowStates.beginGroup (
"Core");
686 windowStates.beginGroup (
"LogSlider");
688 windowStates.endGroup ();
690 windowStates.endGroup ();
694 if ( windowStates.value(
"Core/Window/WindowState",
false).toBool() )
707 splash_->showMessage(tr(
"Ready."), Qt::AlignBottom | Qt::AlignLeft , Qt::white);
712 scenegraphCheckTimer_->setInterval (1000 / OpenFlipperSettings().value(
"Core/Gui/glViewer/maxFrameRate",35).toInt() );
717 OpenFlipper::Options::finishedStartup();
737 if ( OpenFlipper::Options::gui())
744 std::cerr <<
"Connected logger!!! " << std::endl;
762 for ( uint i = 0 ; i <
loggers_.size(); ++i )
771 return PluginStorage::plugins();
784 if(_event->button() != Qt::LeftButton)
return;
785 if(_event->type() != QEvent::MouseButtonRelease)
return;
787 const QObject* senderPointer = sender();
788 unsigned int examinerId = 0;
790 if ( senderPointer == 0 ) {
791 std::cerr <<
"Error : slotMouseEventIdentify directly called! This should only be called by an examiner" << std::endl;
793 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
796 if ( OpenFlipper::Options::doSlotDebugging() )
797 emit
log(
LOGINFO,tr(
"slotMouseEventIdentify from examiner ") + QString::number(i) );
807 size_t node_idx, target_idx;
818 infoPlugin = getInfoPlugin(object->
dataType());
830 const QObject* senderPointer = sender();
831 unsigned int examinerId = 0;
834 if ( senderPointer == 0 ) {
835 std::cerr <<
"Error : slotMouseEventLight directly called! This should only be called by an examiner" << std::endl;
837 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
840 if ( OpenFlipper::Options::doSlotDebugging() )
841 emit
log(
LOGINFO,tr(
"slotMouseEventLight from examiner ") + QString::number(i) );
851 QMouseEvent * new_event =
new QMouseEvent{_event->type(), pos, pos, _event->button(),_event->buttons(),_event->modifiers()};
867 const QObject* senderPointer = sender();
868 unsigned int examinerId = 0;
871 if ( senderPointer == 0 ) {
872 std::cerr <<
"Error : slotMouseEvent directly called! This should only be called by an examiner" << std::endl;
874 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
877 if ( OpenFlipper::Options::doSlotDebugging() ) {
878 QString message = tr(
"slotMouseEvent from examiner ") + QString::number(i) +
" with ";
880 if ( _event->type() == QEvent::MouseButtonRelease )
881 message +=
" MouseButtonRelease";
882 else if ( _event->type() == QEvent::MouseButtonPress )
883 message +=
" MouseButtonRelease";
884 else if ( _event->type() == QEvent::MouseButtonDblClick )
885 message +=
" MouseButtonDblClick";
886 else if ( _event->type() == QEvent::MouseMove )
887 message +=
" MouseMove";
889 message += tr(
"unknown event type");
903 #if QT_VERSION_MAJOR < 6
907 QMouseEvent * new_event =
new QMouseEvent{_event->type(), pos, pos, _event->button(),_event->buttons(),_event->modifiers()};
918 const QObject* senderPointer = sender();
919 unsigned int examinerId = 0;
921 if ( senderPointer == 0 ) {
922 std::cerr <<
"Error : slotWheelEvent directly called! This should only be called by an examiner" << std::endl;
924 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
934 #if QT_VERSION_MAJOR < 6
937 QWheelEvent * new_event =
new QWheelEvent{
PluginFunctions::adjustForDevicePixelRatio(_event->position()), _event->globalPosition(), _event->pixelDelta(), _event->angleDelta(), _event->buttons(), _event->modifiers(), _event->phase(), _event->inverted(), _event->source()};
949 if ( OpenFlipper::Options::gui() )
959 if ( OpenFlipper::Options::gui() )
971 if (OpenFlipper::Options::doSlotDebugging()) {
973 if (sender()->metaObject() != 0) {
974 emit
log(
LOGINFO, tr(
"updateView() called by ") + QString(sender()->metaObject()->className()));
979 if (!OpenFlipper::Options::gui())
982 if (OpenFlipperSettings().value(
"Core/Gui/glViewer/restrictFrameRate",
false).toBool()) {
986 if (elapsed < 1000 / OpenFlipperSettings().value(
"Core/Gui/glViewer/maxFrameRate", 35).toInt()) {
989 if (OpenFlipper::Options::doSlotDebugging())
991 tr(
"Too early for redraw! Delaying request from ") + QString(sender()->metaObject()->className()));
996 redrawTimer_->start((1000 / OpenFlipperSettings().value(
"Core/Gui/glViewer/maxFrameRate", 35).toInt()) - elapsed);
1005 if (!OpenFlipper::Options::sceneGraphUpdatesBlocked() && !OpenFlipper::Options::redrawDisabled()) {
1007 for (
unsigned int i = 0; i < OpenFlipper::Options::examinerWidgets(); ++i)
1020 QApplication::processEvents();
1027 OpenFlipper::Options::blockSceneGraphUpdates();
1029 OpenFlipper::Options::unblockSceneGraphUpdates();
1044 if ( action.isDirty () )
1052 OpenFlipperSettings().
setValue(
"Core/Gui/glViewer/restrictFrameRate",_enable);
1058 OpenFlipperSettings().
setValue(
"Core/Gui/glViewer/maxFrameRate",_rate);
1059 OpenFlipperSettings().
setValue(
"Core/Gui/glViewer/restrictFrameRate",
true);
1062 scenegraphCheckTimer_->setInterval (1000 / OpenFlipperSettings().value(
"Core/Gui/glViewer/maxFrameRate",35).toInt() );
1076#if QT_VERSION_MAJOR < 6
1087 QTimer* timer =
new QTimer();
1088 connect(timer, SIGNAL(timeout()),
this, SLOT(
slotExit()));
1092 QApplication::quit();
1098 if ( OpenFlipper::Options::gui() )
1105 if ( OpenFlipper::Options::gui() ) {
1114 if ( OpenFlipper::Options::gui() &&
1115 (state == OpenFlipper::Options::Hidden ||
1116 state == OpenFlipper::Options::InScene ||
1117 state == OpenFlipper::Options::Normal))
1124 std::cerr <<
"Script" << std::endl;
1133 if ( OpenFlipper::Options::gui() ) {
1135 OpenFlipperSettings().
setValue(
"Core/Gui/LogWindow/OpenMeshErrors",_state);
1147 if ( OpenFlipper::Options::gui() )
1154 if ( OpenFlipper::Options::gui() )
1161 if ( !OpenFlipper::Options::gui() || !OpenFlipperSettings().value(
"Core/Gui/glViewer/useMultipleViewers",
true).toBool() )
1177 QStringList recentFiles = OpenFlipperSettings().
value(
"Core/File/RecentFiles", QStringList()).toStringList();
1178 QStringList recentTypes = OpenFlipperSettings().
value(
"Core/File/RecentTypes", QStringList()).toStringList();
1182 QString actionTypeName = _action->data().toString();
1185 for (
int i = 0 ; i < recentFiles.size() ; ++i )
1188 if ( (recentFiles[i] == _action->text()) && ( actionTypeName == recentTypes[i] ) ){
1190 OpenFlipper::Options::loadingRecentFile(
true);
1193 OpenFlipper::Options::loadingRecentFile(
false);
1198 emit
log(
LOGERR, tr(
"Unable to open recent. Unable to find %1 with datatype %2 in recent files list.").arg(_action->text()).arg(actionTypeName) );
1206 QString inifile = OpenFlipper::Options::getLocalIniFullPath();
1210 if ( ! ini.
connect( inifile,
true) ) {
1211 emit
log(
LOGERR,tr(
"Can not create user ini file"));
1219 if ( OpenFlipper::Options::gui() ) {
1221 QSettings windowStates(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"WindowStates.dat", QSettings::IniFormat);
1223 windowStates.setValue(
"Core/Window/State",
coreWidget_->saveState ());
1224 windowStates.setValue(
"Core/Window/Geometry",
coreWidget_->saveGeometry ());
1225 windowStates.setValue(
"Core/Window/WindowState",
coreWidget_->isMaximized() );
1230 windowStates.beginGroup (
"Core");
1231 windowStates.beginGroup (
"LogSlider");
1233 windowStates.endGroup ();
1235 windowStates.endGroup ();
1252 qApp->processEvents();
1255 for ( uint i = 0 ; i <
plugins().size() ; ++i ){
1272 OpenFlipper::Options::closeSettings();
1276 if(OpenFlipper::Options::deleteIniFile()) {
1277 bool success =
true;
1280 QStringList optionFiles = OpenFlipper::Options::optionFiles();
1281 for (
int i = 0 ; i < (int)optionFiles.size(); ++i) {
1282 success &= QFile::remove(optionFiles[i]);
1286 QMessageBox::warning(0, tr(
"Warning"),
1287 tr(
"One or more files could not be removed.\nDelete files manually."),
1313 qApp->exit(EXIT_FAILURE);
1326 if (!OpenFlipperSettings().value(
"Core/Log/logFileEnabled",
true).toBool() )
1332 QString fileName = OpenFlipperSettings().
value(
"Core/Log/logFile",
"").toString();
1333 QFileInfo fi( fileName );
1335 if ( fileName ==
"" || !fi.dir().exists() ) {
1336 OpenFlipperSettings().
setValue(
"Core/Log/logFile", OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"OpenFlipper.log");
1339 logFile_ =
new QFile( OpenFlipperSettings().value(
"Core/Log/logFile").toString() );
1340 if (
logFile_->open(QFile::WriteOnly) ) {
1343 emit
log(
LOGERR, tr(
"Unable to open logfile!"));
1350 (*logStream_) <<
"INFO:";
break;
1352 (*logStream_) <<
"OUT :";
break;
1354 (*logStream_) <<
"WARN:";
break;
1356 (*logStream_) <<
"ERR :";
break;
1358 (*logStream_) <<
"STAT:";
break;
1361 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
1362 (*logStream_) << _message <<
"\n" << flush;
1364 (*logStream_) << _message <<
"\n" << Qt::flush;
1371 QStringList _parameters, QStringList _descriptions)
1374 if (sender() ==
this){
1376 info.slotName = _slotName;
1377 info.slotDescription = _slotDescription;
1378 info.parameters = _parameters;
1379 info.descriptions = _descriptions;
1390 for (uint i=0; i <
plugins().size(); i++)
1391 if (
plugins()[i].plugin == sender())
1394 if (pluginInfo == 0){
1395 emit
log(
LOGERR, tr(
"Unable to set slot-description. Plugin not found!"));
1400 info.slotName = _slotName;
1401 info.slotDescription = _slotDescription;
1402 info.parameters = _parameters;
1403 info.descriptions = _descriptions;
1410 QStringList _parameters, QStringList _descriptions)
1413 info.slotName = _functionName;
1414 info.slotDescription = _slotDescription;
1415 info.parameters = _parameters;
1416 info.descriptions = _descriptions;
1423 QStringList& _parameters, QStringList& _descriptions )
1425 QString pluginName = _function.section(
".", 0, 0);
1426 QString slotName = _function.section(
".", 1, 1);
1429 if ( !_function.contains(
".") ) {
1432 slotName = pluginName;
1447 if (pluginName ==
"core"){
1449 _fnDescription =
"";
1450 _parameters.clear();
1451 _descriptions.clear();
1455 _fnDescription =
coreSlots_[i].slotDescription;
1468 for (uint i=0; i <
plugins().size(); i++)
1469 if (
plugins()[i].rpcName == pluginName)
1472 if (pluginInfo == 0){
1473 emit
log(
LOGERR, tr(
"Unable to get slot-description. Plugin not found!"));
1477 _fnDescription =
"";
1478 _parameters.clear();
1479 _descriptions.clear();
1482 for (
int i=0; i < pluginInfo->
slotInfos.count(); i++)
1483 if (pluginInfo->
slotInfos[i].slotName == slotName){
1484 _fnDescription = pluginInfo->
slotInfos[i].slotDescription;
1485 _parameters = pluginInfo->
slotInfos[i].parameters;
1486 _descriptions = pluginInfo->
slotInfos[i].descriptions;
1493 if ( OpenFlipper::Options::gui() ) {
1494 if ( _viewerId >= OpenFlipper::Options::examinerWidgets() ) {
1495 emit
log(
LOGERR,tr(
"Unable to snapshotBaseFileName for viewer ") + QString::number(_viewerId) );
1506 if ( OpenFlipper::Options::gui() ) {
1507 if ( _viewerId >= OpenFlipper::Options::examinerWidgets() ) {
1508 emit
log(
LOGERR,tr(
"Unable to snapshotFileType for viewer ") + QString::number(_viewerId) );
1520 if ( OpenFlipper::Options::gui() ) {
1521 if ( _viewerId >= OpenFlipper::Options::examinerWidgets() ) {
1522 emit
log(
LOGERR,tr(
"Unable to snapshotFileType for viewer ") + QString::number(_viewerId) );
1531void Core::snapshot(
unsigned int _viewerId,
int _width,
int _height,
bool _alpha,
bool _hideCoordsys,
int _numSamples ){
1534 if ( OpenFlipper::Options::gui() ) {
1535 if ( _viewerId >= OpenFlipper::Options::examinerWidgets() ) {
1536 emit
log(
LOGERR,tr(
"Unable to create snapshot for viewer ") + QString::number(_viewerId) );
1546 if ( OpenFlipper::Options::gui() )
1552 if ( OpenFlipper::Options::gui() )
1558 if ( OpenFlipper::Options::gui() )
1563 bool comments_visible_only,
bool comments_targeted_only,
1564 bool store_material_info,
int snapshot_width,
int snapshot_height,
1565 bool snapshot_transparent,
bool hide_coord_sys,
1566 int snapshot_multisampling,
bool store_view) {
1568 if ( OpenFlipper::Options::gui() )
1570 comments_visible_only, comments_targeted_only,
1571 store_material_info, snapshot_width, snapshot_height,
1572 snapshot_transparent, hide_coord_sys, snapshot_multisampling,
1578 if ( OpenFlipper::Options::gui() ){
1589 if ( OpenFlipper::Options::gui() ){
1602 if ( ! ini.
connect(_filename,
true) ) {
1603 emit
log(
LOGERR,tr(
"Failed to connect to _ini file") + _filename);
1608 if ( OpenFlipper::Options::isWindows() )
1609 ini.
add_entry(
"Core" ,
"VersionWindows" , OpenFlipper::Options::coreVersion() );
1611 ini.
add_entry(
"Core" ,
"VersionLinux" , OpenFlipper::Options::coreVersion() );
1614 for (uint i=0; i <
plugins().size(); i++){
1616 if ( OpenFlipper::Options::isWindows() )
1631 foreach (QString s, _types)
1635 if (_selection ==
"source")
1637 else if (_selection ==
"target")
1641 rv.append (o_it->id ());
1652 emit
slotSetSlotDescriptionGlobalFunction(
"printToFile(QString,QString)", tr(
"Print a message to a file"), QStringList(QString(
"Filename;Values").split(
";")), QStringList(QString(
"Filename to print into;Arbitrary number of arguments").split(
";")));
1656 emit
setSlotDescription(
"deleteObject(int)", tr(
"Delete an object from the scene."), QStringList(
"ObjectId"), QStringList(tr(
"Id of the object to delete")));
1657 emit
setSlotDescription(
"updateView()", tr(
"Redraw the contents of the viewer."), QStringList(), QStringList());
1658 emit
setSlotDescription(
"clearAll()", tr(
"Clear all data objects."), QStringList(), QStringList());
1659 emit
setSlotDescription(
"exitApplication()", tr(
"Quit OpenFlipper"), QStringList(), QStringList());
1661 QStringList(tr(
"enabled")) ,
1662 QStringList(tr(
"Enable or disable fullscreen mode")));
1663 emit
setSlotDescription(
"showViewModeControls(bool)", tr(
"Show or hide the view mode control box"),
1664 QStringList(tr(
"Show?")) ,
1666 emit
setSlotDescription(
"loggerState(int)", tr(
"Change the logger window state"), QStringList(tr(
"Change the logger window state")), QStringList());
1667 emit
setSlotDescription(
"enableOpenMeshErrorLog(bool)", tr(
"Enable or disable OpenMesh error logging"), QStringList(tr(
"OpenMesh error logging enabled")), QStringList());
1668 emit
setSlotDescription(
"showToolbox(bool)", tr(
"Show or hide toolbox"), QStringList(tr(
"Show or hide the toolbox")), QStringList());
1669 emit
setSlotDescription(
"showStatusBar(bool)", tr(
"Show or hide status bar"), QStringList(tr(
"Show or hide the status bar")), QStringList());
1671 QStringList(tr(
"Mode")), QStringList(tr(
"0: One Viewer\n1: Double Viewer\n2: Grid \n3: Horizontal split ")));
1673 emit
setSlotDescription(
"restrictFrameRate(bool)", tr(
"Restrict FrameRate to MaxFrameRate"),
1674 QStringList(tr(
"enabled")), QStringList(tr(
"restriction switch")));
1675 emit
setSlotDescription(
"setMaxFrameRate(int)", tr(
"set the maximal framerate (automatically enables framerate restriction)"),
1676 QStringList(tr(
"frameRate")), QStringList(tr(
"Maximum frameRate")));
1677 emit
setSlotDescription(
"snapshotBaseFileName(QString)", tr(
"Set a filename for storing snapshots.")
1678 , QStringList(), QStringList());
1679 emit
setSlotDescription(
"snapshotFileType(QString)", tr(
"Set a filetype for storing snapshots.")
1680 , QStringList(), QStringList());
1681 emit
setSlotDescription(
"snapshotCounterStart(int)", tr(
"Set the starting number for the snapshot counter.")
1682 , QStringList(
"StartValue"), QStringList(
"Starting number for the counter"));
1683 emit
setSlotDescription(
"snapshot()", tr(
"Make a snapshot of the viewer. If no filename"
1684 " was set using snapshotBaseFileName() the snapshot is stored"
1685 " in snap.png in the current directory. The captured image will have "
1686 " the same dimensions as the current viewport. "
1687 "For every snapshot a counter is added to the filename."), QStringList(), QStringList());
1688 emit
setSlotDescription(
"snapshot(uint)", tr(
"Make a snapshot of the viewer with id viewerId. If no filename"
1689 " was set using snapshotBaseFileName() the snapshot is stored"
1690 " in snap.png in the current directory. For every snapshot"
1691 " a counter is added to the filename."), QStringList(
"viewerId"), QStringList(
"Id of viewer to be captured (default is 0)"));
1692 emit
setSlotDescription(
"snapshot(uint,int,int)", tr(
"Make a snapshot of the viewer with id viewerId."
1693 " Pass 0 as viewerId parameter to capture the current viewer. "
1694 " The captured image will have the specified dimensions. "
1695 " If 0 is passed as either width or height parameter, the value will "
1696 " automatically be set to hold the right aspect ratio, respectively. "
1697 " If no filename was set using snapshotBaseFileName() the snapshot is stored"
1698 " in snap.png in the current directory. For every snapshot"
1699 " a counter is added to the filename."), QStringList(QString(
"viewerId;width;height").split(
";")),
1700 QStringList(QString(
"Id of viewer (default is 0);Width of image;Height of image").split(
";")));
1701 emit
setSlotDescription(
"snapshot(uint,int,int,bool)", tr(
"Make a snapshot of the viewer with id viewerId."
1702 " Pass 0 as viewerId parameter to capture the current viewer. "
1703 " The captured image will have the specified dimensions. "
1704 " If 0 is passed as either width or height parameter, the value will "
1705 " automatically be set to hold the right aspect ratio, respectively. "
1706 " If 0 is passed for both width and height values, the viewport's current "
1707 " dimension is used. Set alpha to true if you want the background to be transparent. "
1708 " If no filename was set using snapshotBaseFileName() the snapshot is stored"
1709 " in snap.png in the current directory. For every snapshot"
1710 " a counter is added to the filename."), QStringList(QString(
"viewerId;width;height;alpha").split(
";")),
1711 QStringList(QString(
"Id of viewer (default is 0);Width of image;Height of image;Transparent background").split(
";")));
1712 emit
setSlotDescription(
"snapshot(uint,int,int,bool,bool)", tr(
"Make a snapshot of the viewer with id viewerId."
1713 " Pass 0 as viewerId parameter to capture the current viewer. "
1714 " The captured image will have the specified dimensions. "
1715 " If 0 is passed as either width or height parameter, the value will "
1716 " automatically be set to hold the right aspect ratio, respectively. "
1717 " If 0 is passed for both width and height values, the viewport's current "
1718 " dimension is used. Set alpha to true if you want the background to be transparent. "
1719 " The fifth parameter is used to hide the coordinate system in the upper right corner of the screen. "
1720 " If no filename was set using snapshotBaseFileName() the snapshot is stored"
1721 " in snap.png in the current directory. For every snapshot"
1722 " a counter is added to the filename."), QStringList(QString(
"viewerId;width;height;alpha;hideCoordsys").split(
";")),
1723 QStringList(QString(
"Id of viewer (default is 0);Width of image;Height of image;Transparent background;Hide coordsys node").split(
";")));
1724 emit
setSlotDescription(
"snapshot(uint,int,int,bool,bool,int)", tr(
"Make a snapshot of the viewer with id viewerId."
1725 " Pass 0 as viewerId parameter to capture the current viewer. "
1726 " The captured image will have the specified dimensions. "
1727 " If 0 is passed as either width or height parameter, the value will "
1728 " automatically be set to hold the right aspect ratio, respectively. "
1729 " If 0 is passed for both width and height values, the viewport's current "
1730 " dimension is used. Set alpha to true if you want the background to be transparent. "
1731 " The fifth parameter is used to hide the coordinate system in the upper right corner of the screen. "
1732 " If no filename was set using snapshotBaseFileName() the snapshot is stored"
1733 " in snap.png in the current directory. For every snapshot"
1734 " a counter is added to the filename."), QStringList(QString(
"viewerId;width;height;alpha;hideCoordsys;numSamples").split(
";")),
1735 QStringList(QString(
"Id of viewer (default is 0);Width of image;Height of image;Transparent background;Hide coordsys node;Number of samples per pixel").split(
";")));
1737 QString(tr(
"width,height")).split(
","),
1738 QString(tr(
"new width for the viewer,new height for the viewer")).split(
","));
1739 emit
setSlotDescription(
"writeVersionNumbers(QString)", tr(
"write the current versions of all plugins to INI file"),
1740 QStringList(tr(
"filename")),
1741 QStringList(tr(
"fullpath to a file where the versions should be written to.")));
1743 emit
setSlotDescription(
"saveObject(int,QString)", tr(
"Save object to file. If the file exists it will be overwritten."),
1744 QString(tr(
"object-id,filename")).split(
","),
1745 QString(tr(
"id of the object, complete path and filename")).split(
","));
1746 emit
setSlotDescription(
"saveObjectTo(int,QString)", tr(
"Save object to file. The location can be chosen in a dialog. "
1747 "(only works if GUI is available)"),
1748 QString(tr(
"object-id,filename")).split(
","),
1749 QString(tr(
"id of the object, initial filename for the dialog")).split(
","));
1751 "If no filename is available a dialog is shown. (only works if GUI is available)"),QStringList(), QStringList());
1752 emit
setSlotDescription(
"saveAllObjectsTo()", tr(
"Saves all target objects. The locations can be chosen in dialogs. "
1753 "(only works if GUI is available)"),QStringList(), QStringList());
1754 emit
setSlotDescription(
"saveSettings()", tr(
"Show the dialog to save the current setting. (only works if GUI is available)"),QStringList(), QStringList());
1755 emit
setSlotDescription(
"saveSettings(QString, bool, bool, bool, bool, bool, bool)", tr(
"Save the current setting to the supplied file."),
1756 QStringList(tr(
"filePath,is_saveObjectInfo,is_targetOnly,is_saveAll,is_askOverwrite,is_saveProgramSettings,is_savePluginSettings").split(
",")),
1757 QStringList(tr(
"Path of the file to save the settings to.;Save objects in current setting.;Restrict to targeted objects.;<no idea what this parameter does>;Prompt before overwriting files that already exist (gui mode only).;Save " TOSTRING( PRODUCT_NAME )
" program settings.;Save plugin settings.").split(
";")));
1759 emit
setSlotDescription(
"loadObject()", tr(
"Show the dialog to load an object. (only works if GUI is available)"),QStringList(), QStringList());
1760 emit
setSlotDescription(
"loadObject(QString)", tr(
"Load an object specified in file filename. This automatically determines which file plugin to use."),
1761 QStringList(tr(
"filename")), QStringList(tr(
"Filename")));
1762 emit
setSlotDescription(
"getObjectId(QString)", tr(
"Return identifier of object with specified name. Returns -1 if object was not found."),QStringList(), QStringList());
1763 emit
setSlotDescription(
"loadSettings()", tr(
"Show the dialog to load settings. (only works if GUI is available)"),QStringList(), QStringList());
1764 emit
setSlotDescription(
"loadSettings(QString)", tr(
"load settings from file."),QStringList(), QStringList());
1766 emit
setSlotDescription(
"createWidget(QString,QString)", tr(
"Create a widget from an ui file"),
1767 QString(tr(
"Object name,ui file")).split(
","),
1768 QString(tr(
"Name of the new widget in script,ui file to load")).split(
","));
1770 emit
setSlotDescription(
"addToolbox(QString,QWidget*)", tr(
"Add a widget as a toolbox"),
1771 QString(tr(
"Toolbox Entry name,Widget")).split(
","),
1772 QString(tr(
"Name of the new widget in the toolbox,Pointer to the new widget")).split(
","));
1774 emit
setSlotDescription(
"addToolbox(QString,QWidget*,QIcon*)", tr(
"Add a widget as a toolbox"),
1775 QString(tr(
"Toolbox Entry name,Widget,Icon")).split(
","),
1776 QString(tr(
"Name of the new widget in the toolbox,Pointer to the new widget,Pointer to icon")).split(
","));
1778 emit
setSlotDescription(
"serializeMaterialProperties(int)", tr(
"Serialize and return the material properties of the supplied object."),
1779 QString(tr(
"ObjectId")).split(
","),
1780 QString(tr(
"ID of the object")).split(
","));
1782 emit
setSlotDescription(
"deserializeMaterialProperties(int, QString)", tr(
"Deserialize the supplied material properties into the supplied object."),
1783 QString(tr(
"ObjectId, SerializedProps")).split(
","),
1784 QString(tr(
"ID of the object,The serialized material properties.")).split(
","));
1786 emit
setSlotDescription(
"addViewModeToolboxes(QString,QString)", tr(
"Set toolboxes for a viewmode (This automatically adds the view mode if it does not exist)"),
1787 QString(tr(
"Name,Toolbox List")).split(
","),
1788 QString(tr(
"Name of the Viewmode,seperated list of toolboxes visible in this viewmode")).split(
","));
1790 emit
setSlotDescription(
"addViewModeToolbars(QString,QString)", tr(
"Set toolbars for a viewmode (This automatically adds the view mode if it does not exist)"),
1791 QString(tr(
"Name,Toolbar List")).split(
","),
1792 QString(tr(
"Name of the Viewmode,seperated list of toolbars visible in this viewmode")).split(
","));
1794 emit
setSlotDescription(
"addViewModeContextMenus(QString,QString)", tr(
"Set context Menus for a viewmode (This automatically adds the view mode if it does not exist)"),
1795 QString(tr(
"Name,Context Menu List")).split(
","),
1796 QString(tr(
"Name of the Viewmode,seperated list of Context Menus visible in this viewmode")).split(
","));
1798 emit
setSlotDescription(
"addViewModeIcon(QString,QString)", tr(
"Set Icon for a viewmode (This automatically adds the view mode if it does not exist)"),
1799 QString(tr(
"Name,Icon filename")).split(
","),
1800 QString(tr(
"Name of the Viewmode,filename of the icon (will be taken from OpenFlippers icon directory)")).split(
","));
1802 emit
setSlotDescription(
"objectList(QString,QStringList)", tr(
"Returns object list"),
1803 QString(tr(
"Selection type,Object types")).split(
","),
1804 QString(tr(
"Type of object selection (all,source,target),Object type (All,PolyMesh,TriangleMesh,...)")).split(
";"));
1806 emit
setSlotDescription(
"setToolBoxSide(QString)", tr(
"Determine whether the toolboxes should be displayed on the right or on the left side."),
1807 QStringList(tr(
"side")), QStringList(tr(
"The desired side of the toolboxes (either 'left' or 'right')")));
1809 emit
setSlotDescription(
"getToolbox(QString,QString)", tr(
"Returns a pointer to the requested toolbox widget if it was found, nullptr, otherwise."),
1810 tr(
"Plugin Name\rToolbox Name").split(
"\r"),
1811 tr(
"The plugin which the requested toolbox belongs to.\rThe name of the requested toolbox.").split(
"\r"));
1813 emit
setSlotDescription(
"blockSceneGraphUpdates()", tr(
"Disable Scenegraph Updates (e.g. before loading or adding a large number of files)"),QStringList(), QStringList());
1814 emit
setSlotDescription(
"unblockSceneGraphUpdates()", tr(
"Enable Scenegraph Updates (e.g. before loading or adding a large number of files)"),QStringList(), QStringList());
1815 emit
setSlotDescription(
"setView", tr(
"Set the encoded view for the primary viewport."), QStringList(tr(
"view")), QStringList(tr(
"The encoded view. (You can obtain one through \"Copy View\" in the context menu of the coordinates.)")));
1828 std::cerr <<
"Error while deleting object, does not exist!!" << std::endl;
1835 object->deleteSubtree();
1838 object->parent()->removeChild(
object);
1849 if ( _objId == -1 )
return;
1854 std::cerr <<
"No such object." << std::endl;
1860 std::cerr <<
"No suitable object found." << std::endl;
1868 if ( _objId == -1 )
return QString();
1873 std::cerr <<
"No such object." << std::endl;
1879 std::cerr <<
"No suitable object found." << std::endl;
1888 if ( _id == -1 )
return;
1893 std::cerr <<
"No such object." << std::endl;
1901 if ( _id == -1 )
return;
1906 std::cerr <<
"No such object." << std::endl;
1914 if ( _id == -1 )
return;
1919 std::cerr <<
"No such object." << std::endl;
1930 std::vector< int > ids;
1935 ids.push_back( current->
id() );
1936 current = current->
next();
1939 for ( uint i = 0 ; i < ids.size(); ++i ) {
1960 QString qtCompiledVersion = QString( QT_VERSION_STR );
1961 QString qtCurrentVersion = qVersion();
1963 if ( qtCompiledVersion != qtCurrentVersion ) {
1964 messages += tr(
"QT Library Version mismatch!\n");
1966 messages += tr(
"Currently used QT Version:\t") + qVersion() +
"\n";
1967 messages += tr(
"Link time QT Version:\t\t") + QString( QT_VERSION_STR ) +
"\n";
1968 messages += tr(
"This inconsistency may lead to an unstable behavior of OpenFlipper!");
2006 std::cerr <<
"Library Check succeeded" << std::endl;
2020 if ( OpenFlipper::Options::nogui() )
2029 QOpenGLContext* context = QOpenGLContext::currentContext();
2033 QSurfaceFormat format = context->format();
2035 if ( (format.majorVersion() < 2) ) {
2038 missing += tr(
"OpenGL Version less then 2.0!\n");
2044 missing += tr(
"No OpenGL support found!\n");
2049 QString message = tr(
"Error! \nThe OpenGL capabilities of your current machine/driver are not sufficient!\n\n");
2050 message += tr(
"The following checks failed:\n\n");
2052 message += tr(
"\n\nPlease update your driver or graphics card.\n");
2054 message += tr(
"If you have more than one GPU (e.g. MacBook) don't use the internal one!\n");
2057 std::cerr << message.toStdString() << std::endl;
2061 QMessageBox::StandardButton button = StaysOnTopMessageBox::critical ( 0, tr(
"Insufficient OpenGL Capabilities!"),message,QMessageBox::Abort|QMessageBox::Ignore , QMessageBox::Abort);
2064 if ( button == QMessageBox::Abort )
2067 StaysOnTopMessageBox::warning(0,tr(
"Insufficient OpenGL Capabilities!"),tr(
"Ignoring OpenGL capabilities might lead to unstable Operation! Do it at your own risk!"));
2072 }
else if ( warn ) {
2074 QString message = tr(
"Warning! Automatic system environment checks discovered some possible problems!\n\n");
2075 message += tr(
"The following checks failed:\n\n");
2078 std::cerr << message.toStdString() << std::endl;
2080 StaysOnTopMessageBox::warning ( 0, tr(
"Detected possible problems!"),message );
2085 std::cerr <<
"OpenGL Version Check succeeded" << std::endl;
QScriptValue printToFileFunction(QScriptContext *context, QScriptEngine *engine)
Special print function for sending output to a file.
QScriptValue helpFunction(QScriptContext *context, QScriptEngine *engine)
Function to print help about scripting functions.
QScriptValue myPrintFunction(QScriptContext *context, QScriptEngine *engine)
Special print function for core logger.
DLLEXPORT DataType typeId(QString _name)
Given a dataType Identifier string this function will return the id of the datatype.
#define TOSTRING(x)
QSettings object containing all program settings of OpenFlipper.
LoggerState
State of the logging widget.
Logtype
Log types for Message Window.
@ NodeFirst
Execute action on node first and then on its children.
@ SecondPass
Draw node in second pass.
void setTraverseMode(unsigned int _mode)
Set traverse mode for node.
ACG::SceneGraph::Material & material()
Get material object reference.
Interface class from which all plugins have to be created.
MaterialNode * materialNode()
get a pointer to the materialnode
void clearAllComments()
Get comment for the specified key.
BaseObject * childExists(int _objectId)
Check if the element exists in the subtree of this element.
void deleteSubtree()
delete the whole subtree below this item ( The item itself is not touched )
QString & getCommentByKey(const QString &key)
Get comment for the specified key.
bool dataType(DataType _type) const
void clearComment(const QString &key)
Get comment for the specified key.
void showStatusBar(bool _state)
Show or hide Status Bar.
void setSlotDescription(QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
Core scripting engine.
prototypeDataType DataTypePrototype_
Prototype for the DataType.
void clearAll()
Clear all data objects.
void deletedObject(int _objectId)
This slot is called by the object manager when an object is deleted.
void pluginSceneDrawn()
This signal is emitted after the scene has been drawn.
void applyOptions()
after ini-files have been loaded and core is up or if options have been changed -> apply Options
void PluginMouseEventLight(QMouseEvent *)
Emitted when an light event occurs.
void slotMouseEvent(QMouseEvent *_event)
Gets called by examiner widget when mouse is moved in picking mode.
void showToolbox(bool _state)
Show or hide toolbox.
BaseObject * objectRoot_
Pointer to the data rootNode;.
void saveSettings()
Save current status to a settings file. Solicit file name through dialog.
void slotWheelEvent(QWheelEvent *_event, const std::string &_mode)
Gets called by examiner widget when Wheel is moved in picking mode.
void setDescriptions()
set the descriptions for scriptable slots of the core
void slotCall(const QString &_pluginName, const QString &_functionName, bool &_success)
void allCleared()
Signal send to plugins when whole scene is cleared.
void PluginMouseEvent(QMouseEvent *)
When this Signal is emitted when a Mouse Event occures.
SeparatorNode * core_nodes_
Separator Node holding all core scenegraph nodes.
void snapshotBaseFileName(QString _fname, unsigned int _viewerId=0)
void resizeApplication(int _width, int _height)
resize the whole Application
int lastWidth_
Slot called everytime the view is updated.
void checkScenegraphDirty()
Called to check if the scenegraph needs to be redrawn.
void resizeViewers(int _width, int _height)
resize the examinerViewer
void slotScriptError(const QScriptValue &error)
Core scripting engine.
void clearAllComments(int objId)
Called when a plugin requests an update in the viewer.
void deserializeMaterialProperties(int _objId, QString _props)
Serialize material properties.
void saveAllObjectsTo()
Slot for saving objects to a new location.
void setupOptions()
Get all ini files and set basic paths and options.
void fullscreen(bool _state)
set fullscreen mode
void saveAllObjects()
Slot for saving objects from Menu.
void scriptLog(QString _message)
Logging signal for ScriptEngine.
void slotGetDescription(QString _function, QString &_fnDescription, QStringList &_parameters, QStringList &_descriptions)
get available descriptions for a given public slot
void showReducedMenuBar(bool reduced)
Core scripting engine.
void slotAddEmptyObjectMenu()
Open the add Empty dialog.
void loadPlugins()
Load all plugins from default plugin directory and from INI-File.
ACG::SceneGraph::MaterialNode * coordsysMaterialNode_
Node for coordsys Material.
QElapsedTimer * redrawTime_
Holds the time since last redraw.
ACG::SceneGraph::CoordsysNode * coordsysNode_
Node for the coordinate system.
QStringList scriptingFunctions_
List of all registered scripting functions.
SeparatorNode * dataRootNode_
Root Node for data objects.
void writeApplicationOptions(INIFile &_ini)
Write Application options to ini file.
void exitFailure()
Aborts the application with an error code.
void snapshotFileType(QString _type, unsigned int _viewerId=0)
Set the file type for snapshots.
void slotLog(Logtype _type, QString _message)
Console logger.
QTimer * redrawTimer_
If enabled, this timer will block screen refresh if done more then 30 times per second.
void loadObject()
Open Load Widget.
void writeOnExit()
Called if app is closed and writes all information to ini file.
void slotLogToFile(Logtype _type, QString _message)
log to file
void restrictFrameRate(bool _enable)
Enable or disable framerate restriction.
QVector< ViewMode * > viewModes_
List of available draw modes.
prototypeVec4d vec4dPrototype_
Prototype for the Vector type.
QTimer * scenegraphCheckTimer_
Timer that starts scenegraph check.
int lastHeight_
Slot called everytime the view is updated.
void slotDeleteAllObjects()
Called when a plugin wants to delete all objects.
void blockScenegraphUpdates(bool _block)
Called when a plugin wants to lock or unlock scenegraph updates.
QTextStream * logStream_
stream for logging to file
QList< SlotInfo > coreSlots_
Core scripting engine.
void objectDeleted(int)
Called after an object has been deleted.
QSplashScreen * splash_
SplashScreen, only used in gui mode.
std::vector< PluginInfo > & plugins()
Index of Plugins toolbox widget.
void slotAddPickMode(const std::string &_mode)
Add a new picking mode to the examiner_widget_.
void snapshotCounterStart(const int _counter, unsigned int _viewerId=0)
Set the start index for the snapshot counter.
void slotSetSlotDescriptionGlobalFunction(QString _functionName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
set a description for a global scripting function
void slotSetSlotDescription(QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
set a description for one of the plugin's public slots
void slotMouseEventIdentify(QMouseEvent *_event)
Handle Mouse events when in Identifier mode.
void init()
Second initialization stage.
void newObject(int _objectId)
This slot is called by the object manager when a new object is created.
void finishSplash()
exit the current application
void snapshot(unsigned int _viewerId=0, int _width=0, int _height=0, bool _alpha=false, bool _hideCoordsys=false, int _numSamples=1)
void saveOptions()
Save the current options to the standard ini file.
void startVideoCapture(const QString &_baseName, int _fps, bool _captureViewers)
Start video capturing.
void enableOpenMeshErrorLog(bool _state)
Enable or disable OpenMesh error logging.
void applicationSnapshotName(QString _name)
Set the baseName for the application snapshot.
QScriptEngine scriptEngine_
Core scripting engine.
void deleteObject(int _id)
Called to delete an object.
void slotScriptInfo(const QString &_pluginName, const QString &_functionName)
Core scripting engine.
bool checkLibraryVersions()
Checks for library inconsistencies.
void writeVersionNumbers(QString _filename)
write the current versions of all plugins to ini file
SeparatorNode * root_node_scenegraph_global_
Seperator node for global nodes.
void slotExecuteAfterStartup()
Executed after loading core completly to load files from commandline.
void viewerSnapshot()
Take a snapshot from all viewers.
std::vector< PluginLogger * > loggers_
Logger interfaces between plugins and core logger.
void applicationSnapshot()
Take a snapshot from the whole app.
void setMaxFrameRate(int _rate)
set the maximal framerate ( automatically enables framerate restriction )
SeparatorNode * root_node_scenegraph_
Scenegraphs root node.
void slotObjectUpdated(int _identifier, const UpdateType &_type=UPDATE_ALL)
Called by the plugins if they changed something in the object list (deleted, added,...
void updateView()
Called when a plugin requests an update in the viewer.
void slotShowPlugins()
Show Plugins Dialog.
void log(Logtype _type, QString _message)
Logg with OUT,WARN or ERR as type.
void PluginWheelEvent(QWheelEvent *, const std::string &)
When this Signal is emitted when a Wheel Event occures.
void restoreKeyBindings()
Restore key assignments from configs files.
void exitApplication()
exit the current application
void slotAddHiddenPickMode(const std::string &_mode)
Add a new and invisible picking mode to the examiner_widget_.
void viewUpdated()
Slot called everytime the view is updated.
void loggerState(int _state)
Change the logging window state.
void slotMouseEventLight(QMouseEvent *_event)
Handle Mouse events when in Light mode.
void slotRecentOpen(QAction *_action)
Open Recent file.
void loadSettings()
Load status from file.
prototypeMatrix4x4 matrix4x4Prototype_
Prototype for the Matrix type.
void slotExit()
Exit Application.
void multiViewMode(int _mode)
Switch the multiView Mode.
void clearObjectComment(int objId, QString key)
Called when a plugin requests an update in the viewer.
prototypeVec3d vec3dPrototype_
Prototype for the Vector type.
void stopVideoCapture()
Stop video capturing.
QString serializeMaterialProperties(int _objId)
Serialize material properties.
QList< SlotInfo > globalFunctions_
Core scripting engine.
void updateUI()
process events during script execution to keep the ui alive
QList< int > objectList(QString _selection, QStringList _types)
return the list of available object that has the given selection and type
void setObjectComment(int objId, QString key, QString comment)
Called when a plugin requests an update in the viewer.
bool checkSignal(QObject *_plugin, const char *_signalSignature)
Check if a plugin has a signal.
SeparatorNode * dataSeparatorNode_
Toplevel Nodes for data objects.
CoreWidget * coreWidget_
The main applications widget ( only created in gui mode )
bool checkOpenGLCapabilities()
OpenGL capability check.
void showViewModeControls(bool _show)
Show or Hide the viewmode control widget.
void openIniFile(QString _filename, bool _coreSettings, bool _perPluginSettings, bool _loadObjects)
Load information from an ini file.
Class for the handling of simple configuration files.
bool connect(const QString &name, const bool create)
Connect INIFile object with given filename.
void disconnect()
Remove connection of this object to a file.
void add_entry(const QString &_section, const QString &_key, const QString &_value)
Addition / modification of a string entry.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
void setValue(const QString &key, const QVariant &value)
Wrapper function which makes it possible to enable Debugging output with -DOPENFLIPPER_SETTINGS_DEBUG...
QList< SlotInfo > slotInfos
This list contains Descriptions about public slots if available.
static void loadSavedPostProcessors(const unsigned _examiner)
append all saved post processors
This class provides OpenFlippers Python interpreter.
static PythonInterpreter * getInstance()
Creates or returns an instance of the interpreter.
void restoreState(QSettings &_settings)
restores the state
void saveState(QSettings &_settings)
saves the current state
void setActive(unsigned int _active, int _id)
set the active renderer
int getRendererId(QString _name)
get renderer id with the given name
size_t available()
number of available renderers
void restoreState(QSettings &_settings)
restores the state
void saveState(QSettings &_settings)
returns the current state
void snapshotFileType(const QString &_type)
void snapshotCounter(const int _counter)
void snapshotBaseFileName(const QString &_fname)
void traverse(BaseNode *_node, Action &_action)
@ PICK_ANYTHING
pick any of the prior targets (should be implemented for all nodes)
Viewer::ViewerProperties & viewerProperties(int _id)
Get the viewer properties Use this functions to get basic viewer properties such as backgroundcolor o...
QPoint adjustForDevicePixelRatio(const QPoint &point)
void setSceneGraphRootNode(SeparatorNode *_root_node)
void setDataRoot(BaseObject *_root)
void setDataSeparatorNodes(SeparatorNode *_dataSeparatorNode)
Set the internal data root node pointers ( DO NOT USE!! )
bool getPickedObject(const size_t _node_idx, BaseObjectData *&_object)
Get the picked mesh.
void setSceneGraphRootNodeGlobal(SeparatorNode *_root_node)
const QStringList SOURCE_OBJECTS("source")
Iterable object range.
QStringList IteratorRestriction
Iterable object range.
bool scenegraphPick(ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, size_t &_nodeIdx, size_t &_targetIdx, ACG::Vec3d *_hitPointPtr=0)
Execute picking operation on scenegraph.
void setViewerProperties(const std::vector< Viewer::ViewerProperties * > &_viewerProperties)
Set the internal viewerProperties pointer ( DO NOT USE!! )
void setActiveExaminer(const unsigned int _id)
Set the active id of the examiner which got the last mouse events.
const QStringList TARGET_OBJECTS("target")
Iterable object range.
ObjectRange objects(IteratorRestriction _restriction, DataType _dataType)
Iterable object range.
const QStringList ALL_OBJECTS
Iterable object range.
ViewMode struct This struct contains a ViewMode and its status information such as used widgets,...
bool custom
Is this a user defined custom view mode or a plugin generated one.
QString name
Name of the View Mode.
QStringList visibleToolboxes
List of Visible Toolboxes in this view mode.