67 #include <ACG/QtWidgets/QtFileDialog.hh>
70 #if QT_VERSION >= 0x050000
80 #include "OpenFlipper/BasePlugin/TextureInterface.hh"
81 #include "OpenFlipper/BasePlugin/INIInterface.hh"
83 #include <OpenFlipper/common/RecentFiles.hh>
85 #include "OpenFlipper/BasePlugin/PluginFunctionsCore.hh"
94 #include <OpenFlipper/widgets/messageBox/StaysOnTopMessageBox.hh>
96 #define WIDGET_HEIGHT 800
97 #define WIDGET_WIDTH 800
115 nextBackupGroupId_(0),
148 vm->
icon =
"viewmode_all.png";
155 std::vector< Viewer::ViewerProperties* > viewerProperties;
157 for (
int i=0; i < 4; i++) {
160 viewerProperties.push_back( viewerProperty );
166 OpenFlipper::Options::defaultViewingDirection( PluginFunctions::VIEW_FREE, 0 );
167 OpenFlipper::Options::defaultViewingDirection( PluginFunctions::VIEW_TOP, 1 );
168 OpenFlipper::Options::defaultViewingDirection( PluginFunctions::VIEW_LEFT, 2 );
169 OpenFlipper::Options::defaultViewingDirection( PluginFunctions::VIEW_FRONT, 3 );
181 initializeUpdateTypes();
218 if ( OpenFlipper::Options::gui() ) {
235 QPixmap splashPixmap(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() +
"splash.png");
237 splash_ =
new QSplashScreen(splashPixmap, Qt::SplashScreen | Qt::WindowStaysOnTopHint);
240 splash_->showMessage(tr(
"Initializing mainwindow") ,
241 Qt::AlignBottom | Qt::AlignLeft , Qt::white);
275 QRect rect = QApplication::desktop()->screenGeometry();
277 uint width = rect.width();
278 if ( width > 1000 ) {
282 uint height = rect.height();
283 if ( height > 1000 ) {
288 width = rect.width() - 300;
289 height = rect.height() - 150;
297 coreWidget_->setWindowTitle( OpenFlipper::Options::windowTitle() +
" [DEBUG]" );
299 coreWidget_->setWindowTitle( OpenFlipper::Options::windowTitle() );
314 connect(
this,SIGNAL(
log(QString )),newlog,SLOT(
slotLog(QString )),Qt::DirectConnection);
317 if ( OpenFlipper::Options::gui() )
329 if ( OpenFlipper::Options::gui() ){
347 omerr().connect(*newlog);
348 omerr().disconnect(std::cerr);
353 if ( OpenFlipper::Options::gui() )
364 omout().connect(*newlog);
365 omout().disconnect(std::cout);
370 if ( OpenFlipper::Options::gui() )
381 omlog().connect(*newlog);
386 if ( OpenFlipper::Options::gui() )
401 if ( OpenFlipper::Options::gui() )
409 connect(
this,SIGNAL(
scriptLog(QString )),newlog,SLOT(
slotLog(QString )),Qt::DirectConnection);
426 printFunction.setProperty(
"textedit",
scriptEngine_.newQObject(
this));
427 scriptEngine_.globalObject().setProperty(
"print", printFunction);
431 scriptEngine_.globalObject().setProperty(
"printToFile", printToFileFunc);
444 qScriptRegisterSequenceMetaType< QVector< int > >(&
scriptEngine_);
451 fromScriptValueVector,
455 QScriptValue ctorVec3 =
scriptEngine_.newFunction(createVector);
456 scriptEngine_.globalObject().setProperty(
"Vector", ctorVec3);
462 toScriptValueVector4,
463 fromScriptValueVector4,
467 QScriptValue ctorVec4 =
scriptEngine_.newFunction(createVector4);
468 scriptEngine_.globalObject().setProperty(
"Vector4", ctorVec4);
476 toScriptValueDataType,
477 fromScriptValueDataType,
481 QScriptValue dataTypector = scriptEngine_.newFunction(createDataType);
482 scriptEngine_.globalObject().setProperty(
"DataType", dataTypector);
489 qScriptRegisterMetaType(&scriptEngine_,
490 toScriptValueMatrix4x4 ,
491 fromScriptValueMatrix4x4,
495 QScriptValue matrix4x4ctor = scriptEngine_.newFunction(createMatrix4x4);
496 scriptEngine_.globalObject().setProperty(
"Matrix4x4", matrix4x4ctor);
502 QScriptValue scriptInstance = scriptEngine_.newQObject(
this,
503 QScriptEngine::QtOwnership,
504 QScriptEngine::ExcludeChildObjects |
505 QScriptEngine::ExcludeSuperClassMethods |
506 QScriptEngine::ExcludeSuperClassProperties
509 scriptEngine_.globalObject().setProperty(
"core", scriptInstance);
511 QScriptValueIterator it(scriptInstance);
512 while (it.hasNext()) {
525 if ( OpenFlipper::Options::gui() ) {
533 if ( OpenFlipper::Options::currentViewMode( ) !=
"" )
539 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
562 QString defaultRendererKey =
"Viewer" + QString::number(i)+
"/DefaultRenderer";
563 QString defaultRendererName =
OpenFlipperSettings().
value(defaultRendererKey,
"Default Classical Renderer Plugin").toString();
566 int defaultRendererId = renderManager().
getRendererId(defaultRendererName);
568 if ( defaultRendererId == -1 ) {
569 emit
log(
LOGERR,tr(
"Stored default renderer \"") + defaultRendererName + tr(
"\" is not available, trying Classical!"));
572 defaultRendererId = renderManager().
getRendererId(
"Default Classical Renderer Plugin");
575 if ( defaultRendererId != -1 ) {
576 renderManager().
setActive(defaultRendererId,i);
578 emit
log(
LOGERR,tr(
"Default classical renderer is also not available. Trying to use any other renderer i can find!"));
581 const unsigned int rendererCount = renderManager().
available();
582 emit
log(
LOGERR,tr(
"Currently ") + QString::number(rendererCount) + tr(
" renderers are available:") );
583 for (
unsigned int i = 0 ; i < rendererCount ; ++i )
584 emit
log(
LOGERR, tr(
"Renderer ") + QString::number(i) +
": " + renderManager()[i]->name );
588 renderManager().
setActive(defaultRendererId,i);
594 if ( renderManager().available() == 1 ) {
596 emit
log(
LOGERR,tr(
"No external plugin renderers available!"));
597 emit
log(
LOGERR,tr(
"The build in renderer is only a very limited one and is missing many features!"));
598 emit
log(
LOGERR,tr(
"You should build and use the other renderers!"));
600 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."));
609 QStringList optionFiles = OpenFlipper::Options::optionFiles();
610 for (
int i = 0 ; i < (int)optionFiles.size(); ++i) {
613 splash_->showMessage(tr(
"Loading Configuration File %1/%2").arg(i+1).arg(optionFiles.size()),
614 Qt::AlignBottom | Qt::AlignLeft , Qt::white);
619 if ( OpenFlipper::Options::gui() )
632 if ( OpenFlipper::Options::lang().contains(
"UTF") || OpenFlipper::Options::lang().contains(
"utf") ) {
640 if ( OpenFlipper::Options::gui() ) {
642 QFile statesFile(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"WindowStates.dat");
644 if (statesFile.exists() ) {
645 QSettings windowStates(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"WindowStates.dat", QSettings::IniFormat);
648 coreWidget_->restoreState (windowStates.value(
"Core/Window/State").toByteArray ());
650 coreWidget_->restoreGeometry (windowStates.value(
"Core/Window/Geometry").toByteArray ());
659 windowStates.beginGroup (
"Core");
660 windowStates.beginGroup (
"LogSlider");
662 windowStates.endGroup ();
664 windowStates.endGroup ();
668 if ( windowStates.value(
"Core/Window/WindowState",
false).toBool() )
680 splash_->showMessage(tr(
"Ready."), Qt::AlignBottom | Qt::AlignLeft , Qt::white);
690 OpenFlipper::Options::finishedStartup();
708 for ( uint i = 0 ; i <
loggers_.size(); ++i )
724 if(_event->button() != Qt::LeftButton)
return;
726 const QObject* senderPointer = sender();
727 unsigned int examinerId = 0;
729 if ( senderPointer == 0 ) {
730 std::cerr <<
"Error : slotMouseEventIdentify directly called! This should only be called by an examiner" << std::endl;
732 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
735 if ( OpenFlipper::Options::doSlotDebugging() )
736 emit
log(
LOGINFO,tr(
"slotMouseEventIdentify from examiner ") + QString::number(i) );
746 size_t node_idx, target_idx;
756 infoPlugin = getInfoPlugin(object->
dataType());
768 const QObject* senderPointer = sender();
769 unsigned int examinerId = 0;
771 if ( senderPointer == 0 ) {
772 std::cerr <<
"Error : slotMouseEventLight directly called! This should only be called by an examiner" << std::endl;
774 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
777 if ( OpenFlipper::Options::doSlotDebugging() )
778 emit
log(
LOGINFO,tr(
"slotMouseEventLight from examiner ") + QString::number(i) );
802 const QObject* senderPointer = sender();
803 unsigned int examinerId = 0;
805 if ( senderPointer == 0 ) {
806 std::cerr <<
"Error : slotMouseEvent directly called! This should only be called by an examiner" << std::endl;
808 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
811 if ( OpenFlipper::Options::doSlotDebugging() ) {
812 QString message = tr(
"slotMouseEvent from examiner ") + QString::number(i) +
" with ";
814 if ( _event->type() == QEvent::MouseButtonRelease )
815 message +=
" MouseButtonRelease";
816 else if ( _event->type() == QEvent::MouseButtonPress )
817 message +=
" MouseButtonRelease";
818 else if ( _event->type() == QEvent::MouseButtonDblClick )
819 message +=
" MouseButtonDblClick";
820 else if ( _event->type() == QEvent::MouseMove )
821 message +=
" MouseMove";
823 message += tr(
"unknown event type");
845 const QObject* senderPointer = sender();
846 unsigned int examinerId = 0;
848 if ( senderPointer == 0 ) {
849 std::cerr <<
"Error : slotWheelEvent directly called! This should only be called by an examiner" << std::endl;
851 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
869 if ( OpenFlipper::Options::gui() )
879 if ( OpenFlipper::Options::gui() )
891 if (OpenFlipper::Options::doSlotDebugging()) {
893 if (sender()->metaObject() != 0) {
894 emit
log(
LOGINFO, tr(
"updateView() called by ") + QString(sender()->metaObject()->className()));
899 if (!OpenFlipper::Options::gui())
906 if (elapsed < 1000 /
OpenFlipperSettings().value(
"Core/Gui/glViewer/maxFrameRate", 35).toInt()) {
909 if (OpenFlipper::Options::doSlotDebugging())
911 tr(
"Too early for redraw! Delaying request from ") + QString(sender()->metaObject()->className()));
925 if (!OpenFlipper::Options::sceneGraphUpdatesBlocked() && !OpenFlipper::Options::redrawDisabled()) {
927 for (
unsigned int i = 0; i < OpenFlipper::Options::examinerWidgets(); ++i)
940 QApplication::processEvents();
947 OpenFlipper::Options::blockSceneGraphUpdates();
949 OpenFlipper::Options::unblockSceneGraphUpdates();
964 if ( action.isDirty () )
1003 QTimer* timer =
new QTimer();
1004 connect(timer, SIGNAL(timeout()),
this, SLOT(
slotExit()));
1008 QApplication::quit();
1014 if ( OpenFlipper::Options::gui() )
1021 if ( OpenFlipper::Options::gui() ) {
1029 OpenFlipper::Options::LoggerState state =
static_cast<OpenFlipper::Options::LoggerState
> (_state);
1030 if ( OpenFlipper::Options::gui() &&
1031 (state == OpenFlipper::Options::Hidden ||
1032 state == OpenFlipper::Options::InScene ||
1040 std::cerr <<
"Script" << std::endl;
1049 if ( OpenFlipper::Options::gui() ) {
1063 if ( OpenFlipper::Options::gui() )
1070 if ( OpenFlipper::Options::gui() )
1077 if ( !OpenFlipper::Options::gui() || !
OpenFlipperSettings().value(
"Core/Gui/glViewer/useMultipleViewers",
true).toBool() )
1098 QString actionTypeName = _action->data().toString();
1101 for (
int i = 0 ; i < recentFiles.size() ; ++i )
1104 if ( (recentFiles[i] == _action->text()) && ( actionTypeName == recentTypes[i] ) ){
1106 OpenFlipper::Options::loadingRecentFile(
true);
1109 OpenFlipper::Options::loadingRecentFile(
false);
1114 emit
log(
LOGERR, tr(
"Unable to open recent. Unable to find %1 with datatype %2 in recent files list.").arg(_action->text()).arg(actionTypeName) );
1122 QString inifile = OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"OpenFlipper.ini";
1126 if ( ! ini.
connect( inifile,
true) ) {
1127 emit
log(
LOGERR,tr(
"Can not create user ini file"));
1135 if ( OpenFlipper::Options::gui() ) {
1137 QSettings windowStates(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"WindowStates.dat", QSettings::IniFormat);
1139 windowStates.setValue(
"Core/Window/State",
coreWidget_->saveState ());
1140 windowStates.setValue(
"Core/Window/Geometry",
coreWidget_->saveGeometry ());
1141 windowStates.setValue(
"Core/Window/WindowState",
coreWidget_->isMaximized() );
1146 windowStates.beginGroup (
"Core");
1147 windowStates.beginGroup (
"LogSlider");
1149 windowStates.endGroup ();
1151 windowStates.endGroup ();
1163 for ( uint i = 0 ; i <
plugins_.size() ; ++i ){
1180 OpenFlipper::Options::closeSettings();
1184 if(OpenFlipper::Options::deleteIniFile()) {
1185 bool success =
true;
1188 QStringList optionFiles = OpenFlipper::Options::optionFiles();
1189 for (
int i = 0 ; i < (int)optionFiles.size(); ++i) {
1190 success &= QFile::remove(optionFiles[i]);
1194 QMessageBox::warning(0, tr(
"Warning"),
1195 tr(
"One or more files could not be removed.\nDelete files manually."),
1221 qApp->exit(EXIT_FAILURE);
1241 QFileInfo fi( fileName );
1243 if ( fileName ==
"" || !fi.dir().exists() ) {
1244 OpenFlipperSettings().
setValue(
"Core/Log/logFile", OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"OpenFlipper.log");
1248 if (
logFile_->open(QFile::WriteOnly) ) {
1251 emit
log(
LOGERR, tr(
"Unable to open logfile!"));
1258 (*logStream_) <<
"INFO:";
break;
1260 (*logStream_) <<
"OUT :";
break;
1262 (*logStream_) <<
"WARN:";
break;
1264 (*logStream_) <<
"ERR :";
break;
1266 (*logStream_) <<
"STAT:";
break;
1269 (*logStream_) << _message <<
"\n" << flush;
1275 QStringList _parameters, QStringList _descriptions)
1278 if (sender() ==
this){
1280 info.slotName = _slotName;
1281 info.slotDescription = _slotDescription;
1282 info.parameters = _parameters;
1283 info.descriptions = _descriptions;
1294 for (uint i=0; i <
plugins_.size(); i++)
1295 if (
plugins_[i].plugin == sender())
1298 if (pluginInfo == 0){
1299 emit
log(
LOGERR, tr(
"Unable to set slot-description. Plugin not found!"));
1304 info.slotName = _slotName;
1305 info.slotDescription = _slotDescription;
1306 info.parameters = _parameters;
1307 info.descriptions = _descriptions;
1314 QStringList _parameters, QStringList _descriptions)
1317 info.slotName = _functionName;
1318 info.slotDescription = _slotDescription;
1319 info.parameters = _parameters;
1320 info.descriptions = _descriptions;
1327 QStringList& _parameters, QStringList& _descriptions )
1329 QString pluginName = _function.section(
".", 0, 0);
1330 QString slotName = _function.section(
".", 1, 1);
1333 if ( !_function.contains(
".") ) {
1336 slotName = pluginName;
1351 if (pluginName ==
"core"){
1353 _fnDescription =
"";
1354 _parameters.clear();
1355 _descriptions.clear();
1359 _fnDescription =
coreSlots_[i].slotDescription;
1372 for (uint i=0; i <
plugins_.size(); i++)
1373 if (
plugins_[i].rpcName == pluginName)
1376 if (pluginInfo == 0){
1377 emit
log(
LOGERR, tr(
"Unable to get slot-description. Plugin not found!"));
1381 _fnDescription =
"";
1382 _parameters.clear();
1383 _descriptions.clear();
1386 for (
int i=0; i < pluginInfo->
slotInfos.count(); i++)
1387 if (pluginInfo->
slotInfos[i].slotName == slotName){
1388 _fnDescription = pluginInfo->
slotInfos[i].slotDescription;
1389 _parameters = pluginInfo->
slotInfos[i].parameters;
1390 _descriptions = pluginInfo->
slotInfos[i].descriptions;
1397 if ( OpenFlipper::Options::gui() ) {
1398 if ( _viewerId >= OpenFlipper::Options::examinerWidgets() ) {
1399 emit
log(
LOGERR,tr(
"Unable to snapshotBaseFileName for viewer ") + QString::number(_viewerId) );
1410 if ( OpenFlipper::Options::gui() ) {
1411 if ( _viewerId >= OpenFlipper::Options::examinerWidgets() ) {
1412 emit
log(
LOGERR,tr(
"Unable to snapshotFileType for viewer ") + QString::number(_viewerId) );
1424 if ( OpenFlipper::Options::gui() ) {
1425 if ( _viewerId >= OpenFlipper::Options::examinerWidgets() ) {
1426 emit
log(
LOGERR,tr(
"Unable to snapshotFileType for viewer ") + QString::number(_viewerId) );
1435 void Core::snapshot(
unsigned int _viewerId,
int _width,
int _height,
bool _alpha,
bool _hideCoordsys,
int _numSamples ){
1438 if ( OpenFlipper::Options::gui() ) {
1439 if ( _viewerId >= OpenFlipper::Options::examinerWidgets() ) {
1440 emit
log(
LOGERR,tr(
"Unable to create snapshot for viewer ") + QString::number(_viewerId) );
1450 if ( OpenFlipper::Options::gui() )
1456 if ( OpenFlipper::Options::gui() )
1462 if ( OpenFlipper::Options::gui() )
1467 bool comments_visible_only,
bool comments_targeted_only,
1468 bool store_material_info,
int snapshot_width,
int snapshot_height,
1469 bool snapshot_transparent,
bool hide_coord_sys,
1470 int snapshot_multisampling,
bool store_view) {
1472 if ( OpenFlipper::Options::gui() )
1474 comments_visible_only, comments_targeted_only,
1475 store_material_info, snapshot_width, snapshot_height,
1476 snapshot_transparent, hide_coord_sys, snapshot_multisampling,
1482 if ( OpenFlipper::Options::gui() ){
1493 if ( OpenFlipper::Options::gui() ){
1506 if ( ! ini.
connect(_filename,
true) ) {
1507 emit
log(
LOGERR,tr(
"Failed to connect to _ini file") + _filename);
1512 if ( OpenFlipper::Options::isWindows() )
1513 ini.
add_entry(
"Core" ,
"VersionWindows" , OpenFlipper::Options::coreVersion() );
1515 ini.
add_entry(
"Core" ,
"VersionLinux" , OpenFlipper::Options::coreVersion() );
1518 for (uint i=0; i <
plugins_.size(); i++){
1520 if ( OpenFlipper::Options::isWindows() )
1535 foreach (QString s, _types)
1538 if (_selection ==
"source")
1540 else if (_selection ==
"target")
1545 rv.append (o_it->id ());
1555 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(
";")));
1559 emit
setSlotDescription(
"deleteObject(int)", tr(
"Delete an object from the scene."), QStringList(
"ObjectId"), QStringList(tr(
"Id of the object to delete")));
1560 emit
setSlotDescription(
"updateView()", tr(
"Redraw the contents of the viewer."), QStringList(), QStringList());
1561 emit
setSlotDescription(
"clearAll()", tr(
"Clear all data objects."), QStringList(), QStringList());
1562 emit
setSlotDescription(
"exitApplication()", tr(
"Quit OpenFlipper"), QStringList(), QStringList());
1564 QStringList(tr(
"enabled")) ,
1565 QStringList(tr(
"Enable or disable fullscreen mode")));
1566 emit
setSlotDescription(
"showViewModeControls(bool)", tr(
"Show or hide the view mode control box"),
1567 QStringList(tr(
"Show?")) ,
1569 emit
setSlotDescription(
"loggerState(int)", tr(
"Change the logger window state"), QStringList(tr(
"Change the logger window state")), QStringList());
1570 emit
setSlotDescription(
"enableOpenMeshErrorLog(bool)", tr(
"Enable or disable OpenMesh error logging"), QStringList(tr(
"OpenMesh error logging enabled")), QStringList());
1571 emit
setSlotDescription(
"showToolbox(bool)", tr(
"Show or hide toolbox"), QStringList(tr(
"Show or hide the toolbox")), QStringList());
1572 emit
setSlotDescription(
"showStatusBar(bool)", tr(
"Show or hide status bar"), QStringList(tr(
"Show or hide the status bar")), QStringList());
1574 QStringList(tr(
"Mode")), QStringList(tr(
"0: One Viewer\n1: Double Viewer\n2: Grid \n3: Horizontal split ")));
1576 emit
setSlotDescription(
"restrictFrameRate(bool)", tr(
"Restrict FrameRate to MaxFrameRate"),
1577 QStringList(tr(
"enabled")), QStringList(tr(
"restriction switch")));
1578 emit
setSlotDescription(
"setMaxFrameRate(int)", tr(
"set the maximal framerate (automatically enables framerate restriction)"),
1579 QStringList(tr(
"frameRate")), QStringList(tr(
"Maximum frameRate")));
1580 emit
setSlotDescription(
"snapshotBaseFileName(QString)", tr(
"Set a filename for storing snapshots.")
1581 , QStringList(), QStringList());
1582 emit
setSlotDescription(
"snapshotFileType(QString)", tr(
"Set a filetype for storing snapshots.")
1583 , QStringList(), QStringList());
1584 emit
setSlotDescription(
"snapshotCounterStart(int)", tr(
"Set the starting number for the snapshot counter.")
1585 , QStringList(
"StartValue"), QStringList(
"Starting number for the counter"));
1586 emit
setSlotDescription(
"snapshot()", tr(
"Make a snapshot of the viewer. If no filename"
1587 " was set using snapshotBaseFileName() the snapshot is stored"
1588 " in snap.png in the current directory. The captured image will have "
1589 " the same dimensions as the current viewport. "
1590 "For every snapshot a counter is added to the filename."), QStringList(), QStringList());
1591 emit
setSlotDescription(
"snapshot(uint)", tr(
"Make a snapshot of the viewer with id viewerId. If no filename"
1592 " was set using snapshotBaseFileName() the snapshot is stored"
1593 " in snap.png in the current directory. For every snapshot"
1594 " a counter is added to the filename."), QStringList(
"viewerId"), QStringList(
"Id of viewer to be captured (default is 0)"));
1595 emit
setSlotDescription(
"snapshot(uint,int,int)", tr(
"Make a snapshot of the viewer with id viewerId."
1596 " Pass 0 as viewerId parameter to capture the current viewer. "
1597 " The captured image will have the specified dimensions. "
1598 " If 0 is passed as either width or height parameter, the value will "
1599 " automatically be set to hold the right aspect ratio, respectively. "
1600 " If no filename was set using snapshotBaseFileName() the snapshot is stored"
1601 " in snap.png in the current directory. For every snapshot"
1602 " a counter is added to the filename."), QStringList(QString(
"viewerId;width;height").split(
";")),
1603 QStringList(QString(
"Id of viewer (default is 0);Width of image;Height of image").split(
";")));
1604 emit
setSlotDescription(
"snapshot(uint,int,int,bool)", tr(
"Make a snapshot of the viewer with id viewerId."
1605 " Pass 0 as viewerId parameter to capture the current viewer. "
1606 " The captured image will have the specified dimensions. "
1607 " If 0 is passed as either width or height parameter, the value will "
1608 " automatically be set to hold the right aspect ratio, respectively. "
1609 " If 0 is passed for both width and height values, the viewport's current "
1610 " dimension is used. Set alpha to true if you want the background to be transparent. "
1611 " If no filename was set using snapshotBaseFileName() the snapshot is stored"
1612 " in snap.png in the current directory. For every snapshot"
1613 " a counter is added to the filename."), QStringList(QString(
"viewerId;width;height;alpha").split(
";")),
1614 QStringList(QString(
"Id of viewer (default is 0);Width of image;Height of image;Transparent background").split(
";")));
1615 emit
setSlotDescription(
"snapshot(uint,int,int,bool,bool)", tr(
"Make a snapshot of the viewer with id viewerId."
1616 " Pass 0 as viewerId parameter to capture the current viewer. "
1617 " The captured image will have the specified dimensions. "
1618 " If 0 is passed as either width or height parameter, the value will "
1619 " automatically be set to hold the right aspect ratio, respectively. "
1620 " If 0 is passed for both width and height values, the viewport's current "
1621 " dimension is used. Set alpha to true if you want the background to be transparent. "
1622 " The fifth parameter is used to hide the coordinate system in the upper right corner of the screen. "
1623 " If no filename was set using snapshotBaseFileName() the snapshot is stored"
1624 " in snap.png in the current directory. For every snapshot"
1625 " a counter is added to the filename."), QStringList(QString(
"viewerId;width;height;alpha;hideCoordsys").split(
";")),
1626 QStringList(QString(
"Id of viewer (default is 0);Width of image;Height of image;Transparent background;Hide coordsys node").split(
";")));
1627 emit
setSlotDescription(
"snapshot(uint,int,int,bool,bool,int)", tr(
"Make a snapshot of the viewer with id viewerId."
1628 " Pass 0 as viewerId parameter to capture the current viewer. "
1629 " The captured image will have the specified dimensions. "
1630 " If 0 is passed as either width or height parameter, the value will "
1631 " automatically be set to hold the right aspect ratio, respectively. "
1632 " If 0 is passed for both width and height values, the viewport's current "
1633 " dimension is used. Set alpha to true if you want the background to be transparent. "
1634 " The fifth parameter is used to hide the coordinate system in the upper right corner of the screen. "
1635 " If no filename was set using snapshotBaseFileName() the snapshot is stored"
1636 " in snap.png in the current directory. For every snapshot"
1637 " a counter is added to the filename."), QStringList(QString(
"viewerId;width;height;alpha;hideCoordsys;numSamples").split(
";")),
1638 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(
";")));
1640 QString(tr(
"width,height")).split(
","),
1641 QString(tr(
"new width for the viewer,new height for the viewer")).split(
","));
1642 emit
setSlotDescription(
"writeVersionNumbers(QString)", tr(
"write the current versions of all plugins to INI file"),
1643 QStringList(tr(
"filename")),
1644 QStringList(tr(
"fullpath to a file where the versions should be written to.")));
1646 emit
setSlotDescription(
"saveObject(int,QString)", tr(
"Save object to file. If the file exists it will be overwritten."),
1647 QString(tr(
"object-id,filename")).split(
","),
1648 QString(tr(
"id of the object, complete path and filename")).split(
","));
1649 emit
setSlotDescription(
"saveObjectTo(int,QString)", tr(
"Save object to file. The location can be chosen in a dialog. "
1650 "(only works if GUI is available)"),
1651 QString(tr(
"object-id,filename")).split(
","),
1652 QString(tr(
"id of the object, initial filename for the dialog")).split(
","));
1654 "If no filename is available a dialog is shown. (only works if GUI is available)"),QStringList(), QStringList());
1655 emit
setSlotDescription(
"saveAllObjectsTo()", tr(
"Saves all target objects. The locations can be chosen in dialogs. "
1656 "(only works if GUI is available)"),QStringList(), QStringList());
1657 emit
setSlotDescription(
"saveSettings()", tr(
"Show the dialog to save the current setting. (only works if GUI is available)"),QStringList(), QStringList());
1658 emit
setSlotDescription(
"saveSettings(QString, bool, bool, bool, bool, bool, bool)", tr(
"Save the current setting to the supplied file."),
1659 QStringList(tr(
"filePath,is_saveObjectInfo,is_targetOnly,is_saveAll,is_askOverwrite,is_saveProgramSettings,is_savePluginSettings").split(
",")),
1660 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(
";")));
1662 emit
setSlotDescription(
"loadObject()", tr(
"Show the dialog to load an object. (only works if GUI is available)"),QStringList(), QStringList());
1663 emit
setSlotDescription(
"loadObject(QString)", tr(
"Load an object specified in file filename. This automatically determines which file plugin to use."),
1664 QStringList(tr(
"filename")), QStringList(tr(
"Filename")));
1665 emit
setSlotDescription(
"getObjectId(QString)", tr(
"Return identifier of object with specified name. Returns -1 if object was not found."),QStringList(), QStringList());
1666 emit
setSlotDescription(
"loadSettings()", tr(
"Show the dialog to load settings. (only works if GUI is available)"),QStringList(), QStringList());
1667 emit
setSlotDescription(
"loadSettings(QString)", tr(
"load settings from file."),QStringList(), QStringList());
1669 emit
setSlotDescription(
"createWidget(QString,QString)", tr(
"Create a widget from an ui file"),
1670 QString(tr(
"Object name,ui file")).split(
","),
1671 QString(tr(
"Name of the new widget in script,ui file to load")).split(
","));
1673 emit
setSlotDescription(
"addToolbox(QString,QWidget*)", tr(
"Add a widget as a toolbox"),
1674 QString(tr(
"Toolbox Entry name,Widget")).split(
","),
1675 QString(tr(
"Name of the new widget in the toolbox,Pointer to the new widget")).split(
","));
1677 emit
setSlotDescription(
"addToolbox(QString,QWidget*,QIcon*)", tr(
"Add a widget as a toolbox"),
1678 QString(tr(
"Toolbox Entry name,Widget,Icon")).split(
","),
1679 QString(tr(
"Name of the new widget in the toolbox,Pointer to the new widget,Pointer to icon")).split(
","));
1681 emit
setSlotDescription(
"serializeMaterialProperties(int)", tr(
"Serialize and return the material properties of the supplied object."),
1682 QString(tr(
"ObjectId")).split(
","),
1683 QString(tr(
"ID of the object")).split(
","));
1685 emit
setSlotDescription(
"deserializeMaterialProperties(int, QString)", tr(
"Deserialize the supplied material properties into the supplied object."),
1686 QString(tr(
"ObjectId, SerializedProps")).split(
","),
1687 QString(tr(
"ID of the object,The serialized material properties.")).split(
","));
1689 emit
setSlotDescription(
"addViewModeToolboxes(QString,QString)", tr(
"Set toolboxes for a viewmode (This automatically adds the view mode if it does not exist)"),
1690 QString(tr(
"Name,Toolbox List")).split(
","),
1691 QString(tr(
"Name of the Viewmode,seperated list of toolboxes visible in this viewmode")).split(
","));
1693 emit
setSlotDescription(
"addViewModeToolbars(QString,QString)", tr(
"Set toolbars for a viewmode (This automatically adds the view mode if it does not exist)"),
1694 QString(tr(
"Name,Toolbar List")).split(
","),
1695 QString(tr(
"Name of the Viewmode,seperated list of toolbars visible in this viewmode")).split(
","));
1697 emit
setSlotDescription(
"addViewModeContextMenus(QString,QString)", tr(
"Set context Menus for a viewmode (This automatically adds the view mode if it does not exist)"),
1698 QString(tr(
"Name,Context Menu List")).split(
","),
1699 QString(tr(
"Name of the Viewmode,seperated list of Context Menus visible in this viewmode")).split(
","));
1701 emit
setSlotDescription(
"addViewModeIcon(QString,QString)", tr(
"Set Icon for a viewmode (This automatically adds the view mode if it does not exist)"),
1702 QString(tr(
"Name,Icon filename")).split(
","),
1703 QString(tr(
"Name of the Viewmode,filename of the icon (will be taken from OpenFlippers icon directory)")).split(
","));
1705 emit
setSlotDescription(
"objectList(QString,QStringList)", tr(
"Returns object list"),
1706 QString(tr(
"Selection type,Object types")).split(
","),
1707 QString(tr(
"Type of object selection (all,source,target),Object type (All,PolyMesh,TriangleMesh,...)")).split(
";"));
1709 emit
setSlotDescription(
"setToolBoxSide(QString)", tr(
"Determine whether the toolboxes should be displayed on the right or on the left side."),
1710 QStringList(tr(
"side")), QStringList(tr(
"The desired side of the toolboxes (either 'left' or 'right')")));
1712 emit
setSlotDescription(
"getToolbox(QString,QString)", tr(
"Returns a pointer to the requested toolbox widget if it was found, nullptr, otherwise."),
1713 tr(
"Plugin Name\rToolbox Name").split(
"\r"),
1714 tr(
"The plugin which the requested toolbox belongs to.\rThe name of the requested toolbox.").split(
"\r"));
1716 emit
setSlotDescription(
"blockSceneGraphUpdates()", tr(
"Disable Scenegraph Updates (e.g. before loading or adding a large number of files)"),QStringList(), QStringList());
1717 emit
setSlotDescription(
"unblockSceneGraphUpdates()", tr(
"Enable Scenegraph Updates (e.g. before loading or adding a large number of files)"),QStringList(), QStringList());
1718 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.)")));
1731 std::cerr <<
"Error while deleting object, does not exist!!" << std::endl;
1738 object->deleteSubtree();
1741 object->parent()->removeChild(
object);
1752 if ( _objId == -1 )
return;
1757 std::cerr <<
"No such object." << std::endl;
1763 std::cerr <<
"No suitable object found." << std::endl;
1771 if ( _objId == -1 )
return QString();
1776 std::cerr <<
"No such object." << std::endl;
1782 std::cerr <<
"No suitable object found." << std::endl;
1791 if ( _id == -1 )
return;
1796 std::cerr <<
"No such object." << std::endl;
1804 if ( _id == -1 )
return;
1809 std::cerr <<
"No such object." << std::endl;
1817 if ( _id == -1 )
return;
1822 std::cerr <<
"No such object." << std::endl;
1833 std::vector< int > ids;
1838 ids.push_back( current->
id() );
1839 current = current->
next();
1842 for ( uint i = 0 ; i < ids.size(); ++i ) {
1863 QString qtCompiledVersion = QString( QT_VERSION_STR );
1864 QString qtCurrentVersion = qVersion();
1866 if ( qtCompiledVersion != qtCurrentVersion ) {
1867 messages += tr(
"QT Library Version mismatch!\n");
1869 messages += tr(
"Currently used QT Version:\t") + qVersion() +
"\n";
1870 messages += tr(
"Link time QT Version:\t\t") + QString( QT_VERSION_STR ) +
"\n";
1871 messages += tr(
"This inconsistency may lead to an unstable behavior of OpenFlipper!");
1877 QString message = tr(
"Error! Library tests failed!\n");
1878 message += tr(
"The following problems have been found:\n\n");
1880 message += messages;
1882 std::cerr << message.toStdString() << std::endl;
1884 if ( OpenFlipper::Options::gui() ) {
1886 StaysOnTopMessageBox::critical ( 0, tr(
"Library incompatibilities found!"),message );
1892 }
else if ( warn ) {
1894 QString message = tr(
"Warning! The OpenGL capabilities of your current machine/driver could be insufficient!\n\n");
1895 message += tr(
"The following checks failed:\n\n");
1896 message += messages;
1898 std::cerr << message.toStdString() << std::endl;
1900 if ( OpenFlipper::Options::gui() ) {
1902 StaysOnTopMessageBox::warning ( 0, tr(
"Library incompatibilities found!"),message );
1908 std::cerr <<
"Library Check succeeded" << std::endl;
1922 if ( OpenFlipper::Options::nogui() )
1932 #if QT_VERSION < 0x050000
1935 QGLFormat::OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags();
1937 if ( QGLFormat::hasOpenGL() ) {
1938 if ( flags.testFlag(QGLFormat::OpenGL_Version_None) ) {
1939 missing += tr(
"OpenGL Version Unknown to QT!\n");
1940 missing += tr(
"OpenGL reports version: ") + QString((
const char*)glGetString( GL_VERSION )) ;
1943 if ( !( flags.testFlag(QGLFormat::OpenGL_Version_3_0) |
1944 flags.testFlag(QGLFormat::OpenGL_Version_2_1) |
1945 flags.testFlag(QGLFormat::OpenGL_Version_2_0) ) ) {
1947 missing += tr(
"OpenGL Version less then 2.0!\n");
1953 missing += tr(
"No OpenGL support found!\n");
1957 QString glExtensions = QString((
const char*)glGetString(GL_EXTENSIONS));
1960 if ( !glExtensions.contains(
"GL_ARB_vertex_buffer_object") ) {
1962 missing += tr(
"Your graphics card does not support the GL_ARB_vertex_buffer_object extension!\n");
1967 QOpenGLContext* context = QOpenGLContext::currentContext();
1971 QSurfaceFormat format = context->format();
1973 if ( (format.majorVersion() < 2) ) {
1976 missing += tr(
"OpenGL Version less then 2.0!\n");
1981 if ( !context->hasExtension(
"GL_ARB_vertex_buffer_object") ) {
1982 missing +=
"GL_ARB_vertex_buffer_object extension missing\n";
1990 missing += tr(
"No OpenGL support found!\n");
1997 QString message = tr(
"Error! \nThe OpenGL capabilities of your current machine/driver are not sufficient!\n\n");
1998 message += tr(
"The following checks failed:\n\n");
2000 message += tr(
"\n\nPlease update your driver or graphics card.\n");
2002 message += tr(
"If you have more than one GPU (e.g. MacBook) don't use the internal one!\n");
2005 std::cerr << message.toStdString() << std::endl;
2009 QMessageBox::StandardButton button = StaysOnTopMessageBox::critical ( 0, tr(
"Insufficient OpenGL Capabilities!"),message,QMessageBox::Abort|QMessageBox::Ignore , QMessageBox::Abort);
2012 if ( button == QMessageBox::Abort )
2015 StaysOnTopMessageBox::warning(0,tr(
"Insufficient OpenGL Capabilities!"),tr(
"Ignoring OpenGL capabilities might lead to unstable Operation! Do it at your own risk!"));
2020 }
else if ( warn ) {
2022 QString message = tr(
"Warning! Automatic system environment checks discovered some possible problems!\n\n");
2023 message += tr(
"The following checks failed:\n\n");
2026 std::cerr << message.toStdString() << std::endl;
2028 StaysOnTopMessageBox::warning ( 0, tr(
"Detected possible problems!"),message );
2033 std::cerr <<
"OpenGL Version Check succeeded" << std::endl;
void showStatusBar(bool _state)
Show or hide status bar.
SeparatorNode * dataRootNode_
Root Node for data objects.
bool checkLibraryVersions()
Checks for library inconsistencies.
void slotGetDescription(QString _function, QString &_fnDescription, QStringList &_parameters, QStringList &_descriptions)
get available descriptions for a given public slot
void slotSetSlotDescription(QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
set a description for one of the plugin's public slots
void loggerState(int _state)
Change the logging window state.
void snapshot(unsigned int _viewerId=0, int _width=0, int _height=0, bool _alpha=false, bool _hideCoordsys=false, int _numSamples=1)
QTimer * redrawTimer_
If enabled, this timer will block screen refresh if done more then 30 times per second.
QScriptEngine scriptEngine_
Core scripting engine.
void setActiveExaminer(const unsigned int _id)
Set the active id of the examiner which got the last mouse events.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
void objectDeleted(int)
Called after an object has been deleted.
void slotWheelEvent(QWheelEvent *_event, const std::string &_mode)
Gets called by examiner widget when Wheel is moved in picking mode.
bool dataType(DataType _type) const
QStringList visibleToolboxes
List of Visible Toolboxes in this view mode.
void setDescriptions()
set the descriptions for scriptable slots of the core
void slotLogToFile(Logtype _type, QString _message)
log to file
void restoreState(QSettings &_settings)
restores the state
void setDataRoot(BaseObject *_root)
void PluginWheelEvent(QWheelEvent *, const std::string &)
When this Signal is emitted when a Wheel Event occures.
void slotAddHiddenPickMode(const std::string &_mode)
Add a new and invisible picking mode to the examiner_widget_.
bool checkOpenGLCapabilities()
OpenGL capability check.
int getRendererId(QString _name)
get renderer id with the given name
QTime * redrawTime_
Holds the time since last redraw.
void viewerSnapshot()
Take a snapshot from all viewers.
prototypeMatrix4x4 matrix4x4Prototype_
Prototype for the Matrix type.
void showReducedMenuBar(bool reduced)
Core scripting engine.
BaseObject * childExists(int _objectId)
Check if the element exists in the subtree of this element.
void snapshotCounter(const int _counter)
void setMaxFrameRate(int _rate)
set the maximal framerate ( automatically enables framerate restriction )
Interface class for providing information on objects.
std::vector< glViewer * > examiner_widgets_
Examiner Widget.
void log(Logtype _type, QString _message)
Logg with OUT,WARN or ERR as type.
prototypeVec3d vec3dPrototype_
Prototype for the Vector type.
void viewerSnapshot()
Create a snapshot of the whole app.
void clearAllComments(int objId)
Called when a plugin requests an update in the viewer.
void restrictFrameRate(bool _enable)
Enable or disable framerate restriction.
void showToolbox(bool _state)
Show or hide toolbox.
void setFullscreen(bool _state)
Enable or disable fullscreen mode.
QSplitter * splitter_
Spliter between toplevel objects and the textedit at the bottom.
void clearComment(const QString &key)
Get comment for the specified key.
LoggerWidget * logWidget_
Textedit at the bottom for log messages.
void updateRecent()
Update the recent files menu.
void snapshotBaseFileName(QString _fname, unsigned int _viewerId=0)
Execute action on node first and then on its children.
void openIniFile(QString _filename, bool _coreSettings, bool _perPluginSettings, bool _loadObjects)
Load information from an ini file.
void init()
Second initialization stage.
void snapshotFileType(QString _type, unsigned int _viewerId=0)
Set the file type for snapshots.
void slotExecuteAfterStartup()
Executed after loading core completly to load files from commandline.
void clearAll()
Clear all data objects.
Class for the handling of simple configuration files.
void stopVideoCapture()
Stop video capturing.
void setValue(const QString &key, const QVariant &value)
Wrapper function which makes it possible to enable Debugging output with -DOPENFLIPPER_SETTINGS_DEBUG...
void saveAllObjectsTo()
Slot for saving objects to a new location.
QList< SlotInfo > globalFunctions_
Core scripting engine.
void updateView()
Called when a plugin requests an update in the viewer.
bool checkSignal(QObject *_plugin, const char *_signalSignature)
Check if a plugin has a signal.
Add normals to mesh item (vertices/faces)
void resizeViewers(int _width, int _height)
resize the examinerViewer
void slotScriptError(const QScriptValue &error)
Core scripting engine.
void updateUI()
process events during script execution to keep the ui alive
void slotExit()
Exit Application.
ACG::SceneGraph::MaterialNode MaterialNode
Materialnode.
void deleteSubtree()
delete the whole subtree below this item ( The item itself is not touched )
void add_entry(const QString &_section, const QString &_key, const QString &_value)
Addition / modification of a string entry.
QSplitter * toolSplitter_
Spliter between toplevel objects and toolbox.
QVector< ViewMode * > viewModes_
List of available draw modes.
void setSlotDescription(QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
Core scripting engine.
void enableOpenMeshErrorLog(bool _state)
Enable or disable OpenMesh error logging.
QtSlideWindow * slidingLogger_
Class that holds the animated log widget.
void loadPlugins()
Load all plugins from default plugin directory and from INI-File.
void deserializeMaterialProperties(int _objId, QString _props)
Serialize material properties.
void writeVersionNumbers(QString _filename)
write the current versions of all plugins to ini file
void applicationSnapshotName(QString _name)
Set the snapshot name.
void applyOptions()
after ini-files have been loaded and core is up or if options have been changed -> apply Options ...
pick any of the prior targets (should be implemented for all nodes)
DLLEXPORT OpenFlipperQSettings & OpenFlipperSettings()
QSettings object containing all program settings of OpenFlipper.
QSplashScreen * splash_
SplashScreen, only used in gui mode.
void snapshotFileType(const QString &_type)
QList< SlotInfo > slotInfos
This list contains Descriptions about public slots if available.
void saveOptions()
Save the current options to the standard ini file.
void exitApplication()
exit the current application
void saveState(QSettings &_settings)
returns the current state
void showReducedMenuBar(bool reduced)
typedefs
std::vector< PluginLogger * > loggers_
Logger interfaces between plugins and core logger.
prototypeVec4d vec4dPrototype_
Prototype for the Vector type.
#define TOSTRING(x)
QSettings object containing all program settings of OpenFlipper.
void exitFailure()
Aborts the application with an error code.
QScrollArea * getToolboxScrollArea()
Show logger in splitter or not.
void viewUpdated()
Slot called everytime the view is updated.
ACG::SceneGraph::SeparatorNode SeparatorNode
Seperator Node.
void resizeApplication(int _width, int _height)
resize the whole Application
void slotAddPickMode(const std::string &_mode)
Add a new picking mode to the examiner_widget_.
bool custom
Is this a user defined custom view mode or a plugin generated one.
void showViewModeControls(bool _show)
Hide or show the View Mode controls.
void checkScenegraphDirty()
Called to check if the scenegraph needs to be redrawn.
ACG::SceneGraph::CoordinateSystemNode CoordsysNode
Simple Name for CoordsysNode.
void PluginMouseEventLight(QMouseEvent *)
Emitted when an light event occurs.
bool scenegraphPick(ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, size_t &_nodeIdx, size_t &_targetIdx, ACG::Vec3d *_hitPointPtr=0)
Execute picking operation on scenegraph.
SeparatorNode * root_node_scenegraph_
Scenegraphs root node.
QString serializeMaterialProperties(int _objId)
Serialize material properties.
void setActive(unsigned int _active, int _id)
set the active renderer
MaterialNode * materialNode()
get a pointer to the materialnode
void setViewerProperties(std::vector< Viewer::ViewerProperties * > _viewerProperties)
Set the internal viewerProperties pointer ( DO NOT USE!! )
Draw node in second pass.
void applicationSnapshot()
Take a snapshot from the whole app.
void showToolbox(bool _state)
Show or hide toolbox.
void slotDeleteAllObjects()
Called when a plugin wants to delete all objects.
static void loadSavedPostProcessors(const unsigned _examiner)
append all saved post processors
void fullscreen(bool _state)
set fullscreen mode
Viewer::ViewerProperties & viewerProperties(int _id)
Get the viewer properties Use this functions to get basic viewer properties such as backgroundcolor o...
void blockScenegraphUpdates(bool _block)
Called when a plugin wants to lock or unlock scenegraph updates.
std::vector< PluginInfo > plugins_
List of all loaded plugins_.
void loadSettings()
Load status from file.
void setSceneGraphRootNode(SeparatorNode *_root_node)
ViewMode struct This struct contains a ViewMode and its status information such as used widgets...
Interface class from which all plugins have to be created.
QScriptValue helpFunction(QScriptContext *context, QScriptEngine *engine)
Function to print help about scripting functions.
void slotLog(Logtype _type, QString _message)
Console logger.
void showStatusBar(bool _state)
Show or hide Status Bar.
const QStringList SOURCE_OBJECTS("source")
Iterable object range.
void snapshotBaseFileName(const QString &_fname)
Logtype
Log types for Message Window.
DLLEXPORT DataType typeId(QString _name)
Given a dataType Identifier string this function will return the id of the datatype.
void showLogger(OpenFlipper::Options::LoggerState _state)
Change visibility of the logger.
void loadObject()
Open Load Widget.
QWidget * getToolboxArea()
Show logger in splitter or not.
void finishSplash()
exit the current application
QString name
Name of the View Mode.
BaseObject * objectRoot_
Pointer to the data rootNode;.
void setViewerLayout(int _idx)
Change viewer layout that was selected in the combo box.
void slotMouseEventLight(QMouseEvent *_event)
Handle Mouse events when in Light mode.
SeparatorNode * dataSeparatorNode_
Toplevel Nodes for data objects.
void writeApplicationOptions(INIFile &_ini)
Write Application options to ini file.
QStringList scriptingFunctions_
List of all registered scripting functions.
void newObject(int _objectId)
This slot is called by the object manager when a new object is created.
void setDataSeparatorNodes(SeparatorNode *_dataSeparatorNode)
Set the internal data root node pointers ( DO NOT USE!! )
prototypeDataType DataTypePrototype_
Prototype for the DataType.
void writeOnExit()
Called if app is closed and writes all information to ini file.
QScriptValue printToFileFunction(QScriptContext *context, QScriptEngine *engine)
Special print function for sending output to a file.
void startVideoCapture(QString _baseName, int _fps, bool _captureViewers)
Start video capturing.
QString & getCommentByKey(const QString &key)
Get comment for the specified key.
int lastHeight_
Slot called everytime the view is updated.
SeparatorNode * root_node_scenegraph_global_
Seperator node for global nodes.
const QStringList ALL_OBJECTS
Iterable object range.
QList< SlotInfo > coreSlots_
Core scripting engine.
SideArea * toolBox_
Toolbox.
QList< int > objectList(QString _selection, QStringList _types)
return the list of available object that has the given selection and type
void saveState(QSettings &_settings)
saves the current state
void clearAllComments()
Get comment for the specified key.
SideArea * getToolbox()
Show logger in splitter or not.
QTextStream * logStream_
stream for logging to file
DLLEXPORT ObjectIterator objectsEnd()
Return Iterator to Object End.
void setupOptions()
Get all ini files and set basic paths and options.
ACG::SceneGraph::CoordsysNode * coordsysNode_
Node for the coordinate system.
void allCleared()
Signal send to plugins when whole scene is cleared.
void clearObjectComment(int objId, QString key)
Called when a plugin requests an update in the viewer.
void slotAddEmptyObjectMenu()
Open the add Empty dialog.
void deletedObject(int _objectId)
This slot is called by the object manager when an object is deleted.
void traverse(BaseNode *_node, Action &_action)
void slotShowPlugins()
Show Plugins Dialog.
void pluginSceneDrawn()
This signal is emitted after the scene has been drawn.
void saveSettings()
Save current status to a settings file. Solicit file name through dialog.
CoreWidget * coreWidget_
The main applications widget ( only created in gui mode )
QtGLGraphicsView * glView_
graphics view that holds the gl scene
void setSceneGraphRootNodeGlobal(SeparatorNode *_root_node)
void setScriptEngine(QScriptEngine *_engine)
DONT USE! (Function to set the internal reference to the script Engine)
void setViewMode(QString _mode, bool _expandAll=false)
Set the view Mode to the given Mode.
bool connect(const QString &name, const bool create)
Connect INIFile object with given filename.
SeparatorNode * core_nodes_
Separator Node holding all core scenegraph nodes.
QStringList IteratorRestriction
Iterable object range.
void scriptLog(QString _message)
Logging signal for ScriptEngine.
void slotScriptInfo(QString _pluginName, QString _functionName)
Core scripting engine.
virtual void slotInformationRequested(const QPoint _clickedPoint, DataType _type)=0
Show information dialog on clicked object.
int lastWidth_
Slot called everytime the view is updated.
size_t available()
number of available renderers
const QStringList TARGET_OBJECTS("target")
Iterable object range.
void deleteObject(int _id)
Called to delete an object.
void slotSetSlotDescriptionGlobalFunction(QString _functionName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
set a description for a global scripting function
void disconnect()
Remove connection of this object to a file.
QScriptValue myPrintFunction(QScriptContext *context, QScriptEngine *engine)
Special print function for core logger.
void slotCall(QString _pluginName, QString _functionName, bool &_success)
void multiViewMode(int _mode)
Switch the multiView Mode.
void snapshotCounterStart(const int _counter, unsigned int _viewerId=0)
Set the start index for the snapshot counter.
void slotMouseEventIdentify(QMouseEvent *_event)
Handle Mouse events when in Identifier mode.
void applicationSnapshotName(QString _name)
Set the baseName for the application snapshot.
void slotRegisterSlotKeyBindings()
register scripting slots to allow keyBindings
void addRecent(QString _filename, DataType _type)
Add a recent file and update menu.
bool getPickedObject(const size_t _node_idx, BaseObjectData *&_object)
Get the picked mesh.
void slotRecentOpen(QAction *_action)
Open Recent file.
void showViewModeControls(bool _show)
Show or Hide the viewmode control widget.
ACG::SceneGraph::Material & material()
Get material object reference.
ACG::SceneGraph::MaterialNode * coordsysMaterialNode_
Node for coordsys Material.
void PluginMouseEvent(QMouseEvent *)
When this Signal is emitted when a Mouse Event occures.
void slotObjectUpdated(int _identifier, const UpdateType &_type=UPDATE_ALL)
Called by the plugins if they changed something in the object list (deleted, added, or other property changes)
void saveAllObjects()
Slot for saving objects from Menu.
void restoreKeyBindings()
Restore key assignments from configs files.
void restoreState(QSettings &_settings)
restores the state
void applicationSnapshot()
Create a snapshot of the whole app.
QTimer * scenegraphCheckTimer_
Timer that starts scenegraph check.
void slotMouseEvent(QMouseEvent *_event)
Gets called by examiner widget when mouse is moved in picking mode.
void setTraverseMode(unsigned int _mode)
Set traverse mode for node.
void setObjectComment(int objId, QString key, QString comment)
Called when a plugin requests an update in the viewer.
void addPickMode(const std::string &_name, bool _mouse_tracking=false, int _pos=-1, bool _visible=true, QCursor _cursor=Qt::ArrowCursor)
add pick mode