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),
147 vm->
icon =
"viewmode_all.png";
154 std::vector< Viewer::ViewerProperties* > viewerProperties;
156 for (
int i=0; i < 4; i++) {
159 viewerProperties.push_back( viewerProperty );
165 OpenFlipper::Options::defaultViewingDirection( PluginFunctions::VIEW_FREE, 0 );
166 OpenFlipper::Options::defaultViewingDirection( PluginFunctions::VIEW_TOP, 1 );
167 OpenFlipper::Options::defaultViewingDirection( PluginFunctions::VIEW_LEFT, 2 );
168 OpenFlipper::Options::defaultViewingDirection( PluginFunctions::VIEW_FRONT, 3 );
180 initializeUpdateTypes();
217 if ( OpenFlipper::Options::gui() ) {
234 QPixmap splashPixmap(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() +
"splash.png");
236 splash_ =
new QSplashScreen(splashPixmap, Qt::SplashScreen | Qt::WindowStaysOnTopHint);
239 splash_->showMessage(tr(
"Initializing mainwindow") ,
240 Qt::AlignBottom | Qt::AlignLeft , Qt::white);
274 QRect rect = QApplication::desktop()->screenGeometry();
276 uint width = rect.width();
277 if ( width > 1000 ) {
281 uint height = rect.height();
282 if ( height > 1000 ) {
287 width = rect.width() - 300;
288 height = rect.height() - 150;
296 coreWidget_->setWindowTitle( OpenFlipper::Options::windowTitle() +
" [DEBUG]" );
298 coreWidget_->setWindowTitle( OpenFlipper::Options::windowTitle() );
313 connect(
this,SIGNAL(
log(QString )),newlog,SLOT(
slotLog(QString )),Qt::DirectConnection);
316 if ( OpenFlipper::Options::gui() )
328 if ( OpenFlipper::Options::gui() ){
346 omerr().connect(*newlog);
347 omerr().disconnect(std::cerr);
352 if ( OpenFlipper::Options::gui() )
363 omout().connect(*newlog);
364 omout().disconnect(std::cout);
369 if ( OpenFlipper::Options::gui() )
380 omlog().connect(*newlog);
385 if ( OpenFlipper::Options::gui() )
400 if ( OpenFlipper::Options::gui() )
408 connect(
this,SIGNAL(
scriptLog(QString )),newlog,SLOT(
slotLog(QString )),Qt::DirectConnection);
425 printFunction.setProperty(
"textedit",
scriptEngine_.newQObject(
this));
426 scriptEngine_.globalObject().setProperty(
"print", printFunction);
430 scriptEngine_.globalObject().setProperty(
"printToFile", printToFileFunc);
443 qScriptRegisterSequenceMetaType< QVector< int > >(&
scriptEngine_);
450 fromScriptValueVector,
454 QScriptValue ctorVec3 =
scriptEngine_.newFunction(createVector);
455 scriptEngine_.globalObject().setProperty(
"Vector", ctorVec3);
461 toScriptValueVector4,
462 fromScriptValueVector4,
466 QScriptValue ctorVec4 =
scriptEngine_.newFunction(createVector4);
467 scriptEngine_.globalObject().setProperty(
"Vector4", ctorVec4);
475 toScriptValueDataType,
476 fromScriptValueDataType,
480 QScriptValue dataTypector = scriptEngine_.newFunction(createDataType);
481 scriptEngine_.globalObject().setProperty(
"DataType", dataTypector);
488 qScriptRegisterMetaType(&scriptEngine_,
489 toScriptValueMatrix4x4 ,
490 fromScriptValueMatrix4x4,
494 QScriptValue matrix4x4ctor = scriptEngine_.newFunction(createMatrix4x4);
495 scriptEngine_.globalObject().setProperty(
"Matrix4x4", matrix4x4ctor);
501 QScriptValue scriptInstance = scriptEngine_.newQObject(
this,
502 QScriptEngine::QtOwnership,
503 QScriptEngine::ExcludeChildObjects |
504 QScriptEngine::ExcludeSuperClassMethods |
505 QScriptEngine::ExcludeSuperClassProperties
508 scriptEngine_.globalObject().setProperty(
"core", scriptInstance);
510 QScriptValueIterator it(scriptInstance);
511 while (it.hasNext()) {
524 if ( OpenFlipper::Options::gui() ) {
532 if ( OpenFlipper::Options::currentViewMode( ) !=
"" )
538 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
561 QString defaultRendererKey =
"Viewer" + QString::number(i)+
"/DefaultRenderer";
562 QString defaultRendererName =
OpenFlipperSettings().
value(defaultRendererKey,
"Default Classical Renderer Plugin").toString();
565 int defaultRendererId = renderManager().
getRendererId(defaultRendererName);
567 if ( defaultRendererId == -1 ) {
568 emit
log(
LOGERR,tr(
"Stored default renderer \"") + defaultRendererName + tr(
"\" is not available, trying Classical!"));
571 defaultRendererId = renderManager().
getRendererId(
"Default Classical Renderer Plugin");
574 if ( defaultRendererId != -1 ) {
575 renderManager().
setActive(defaultRendererId,i);
577 emit
log(
LOGERR,tr(
"Default classical renderer is also not available. Trying to use any other renderer i can find!"));
580 const unsigned int rendererCount = renderManager().
available();
581 emit
log(
LOGERR,tr(
"Currently ") + QString::number(rendererCount) + tr(
" renderers are available:") );
582 for (
unsigned int i = 0 ; i < rendererCount ; ++i )
583 emit
log(
LOGERR, tr(
"Renderer ") + QString::number(i) +
": " + renderManager()[i]->name );
587 renderManager().
setActive(defaultRendererId,i);
593 if ( renderManager().available() == 1 ) {
595 emit
log(
LOGERR,tr(
"No external plugin renderers available!"));
596 emit
log(
LOGERR,tr(
"The build in renderer is only a very limited one and is missing many features!"));
597 emit
log(
LOGERR,tr(
"You should build and use the other renderers!"));
599 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."));
608 QStringList optionFiles = OpenFlipper::Options::optionFiles();
609 for (
int i = 0 ; i < (int)optionFiles.size(); ++i) {
612 splash_->showMessage(tr(
"Loading Configuration File %1/%2").arg(i+1).arg(optionFiles.size()),
613 Qt::AlignBottom | Qt::AlignLeft , Qt::white);
618 if ( OpenFlipper::Options::gui() )
624 if ( OpenFlipper::Options::gui() &&
OpenFlipperSettings().value(
"Core/Gui/splash",
true).toBool() )
631 if ( OpenFlipper::Options::lang().contains(
"UTF") || OpenFlipper::Options::lang().contains(
"utf") ) {
639 if ( OpenFlipper::Options::gui() ) {
641 QFile statesFile(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"WindowStates.dat");
643 if (statesFile.exists() ) {
644 QSettings windowStates(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"WindowStates.dat", QSettings::IniFormat);
647 coreWidget_->restoreState (windowStates.value(
"Core/Window/State").toByteArray ());
649 coreWidget_->restoreGeometry (windowStates.value(
"Core/Window/Geometry").toByteArray ());
658 windowStates.beginGroup (
"Core");
659 windowStates.beginGroup (
"LogSlider");
661 windowStates.endGroup ();
663 windowStates.endGroup ();
667 if ( windowStates.value(
"Core/Window/WindowState",
false).toBool() )
679 splash_->showMessage(tr(
"Ready."), Qt::AlignBottom | Qt::AlignLeft , Qt::white);
689 OpenFlipper::Options::finishedStartup();
707 for ( uint i = 0 ; i <
loggers_.size(); ++i )
723 if(_event->button() != Qt::LeftButton)
return;
725 const QObject* senderPointer = sender();
726 unsigned int examinerId = 0;
728 if ( senderPointer == 0 ) {
729 std::cerr <<
"Error : slotMouseEventIdentify directly called! This should only be called by an examiner" << std::endl;
731 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
734 if ( OpenFlipper::Options::doSlotDebugging() )
735 emit
log(
LOGINFO,tr(
"slotMouseEventIdentify from examiner ") + QString::number(i) );
745 unsigned int node_idx, target_idx;
755 infoPlugin = getInfoPlugin(object->
dataType());
767 const QObject* senderPointer = sender();
768 unsigned int examinerId = 0;
770 if ( senderPointer == 0 ) {
771 std::cerr <<
"Error : slotMouseEventLight directly called! This should only be called by an examiner" << std::endl;
773 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
776 if ( OpenFlipper::Options::doSlotDebugging() )
777 emit
log(
LOGINFO,tr(
"slotMouseEventLight from examiner ") + QString::number(i) );
801 const QObject* senderPointer = sender();
802 unsigned int examinerId = 0;
804 if ( senderPointer == 0 ) {
805 std::cerr <<
"Error : slotMouseEvent directly called! This should only be called by an examiner" << std::endl;
807 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
810 if ( OpenFlipper::Options::doSlotDebugging() ) {
811 QString message = tr(
"slotMouseEvent from examiner ") + QString::number(i) +
" with ";
813 if ( _event->type() == QEvent::MouseButtonRelease )
814 message +=
" MouseButtonRelease";
815 else if ( _event->type() == QEvent::MouseButtonPress )
816 message +=
" MouseButtonRelease";
817 else if ( _event->type() == QEvent::MouseButtonDblClick )
818 message +=
" MouseButtonDblClick";
819 else if ( _event->type() == QEvent::MouseMove )
820 message +=
" MouseMove";
822 message += tr(
"unknown event type");
844 const QObject* senderPointer = sender();
845 unsigned int examinerId = 0;
847 if ( senderPointer == 0 ) {
848 std::cerr <<
"Error : slotWheelEvent directly called! This should only be called by an examiner" << std::endl;
850 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
868 if ( OpenFlipper::Options::gui() )
878 if ( OpenFlipper::Options::gui() )
890 if (OpenFlipper::Options::doSlotDebugging()) {
892 if (sender()->metaObject() != 0) {
893 emit
log(
LOGINFO, tr(
"updateView() called by ") + QString(sender()->metaObject()->className()));
898 if (!OpenFlipper::Options::gui())
905 if (elapsed < 1000 /
OpenFlipperSettings().value(
"Core/Gui/glViewer/maxFrameRate", 35).toInt()) {
908 if (OpenFlipper::Options::doSlotDebugging())
910 tr(
"Too early for redraw! Delaying request from ") + QString(sender()->metaObject()->className()));
924 if (!OpenFlipper::Options::sceneGraphUpdatesBlocked() && !OpenFlipper::Options::redrawDisabled()) {
926 for (
unsigned int i = 0; i < OpenFlipper::Options::examinerWidgets(); ++i)
939 QApplication::processEvents();
946 OpenFlipper::Options::blockSceneGraphUpdates();
948 OpenFlipper::Options::unblockSceneGraphUpdates();
963 if ( action.isDirty () )
1002 QTimer* timer =
new QTimer();
1003 connect(timer, SIGNAL(timeout()),
this, SLOT(
slotExit()));
1007 QApplication::quit();
1013 if ( OpenFlipper::Options::gui() )
1020 if ( OpenFlipper::Options::gui() ) {
1029 if ( OpenFlipper::Options::gui() &&
1030 (state == OpenFlipper::Options::Hidden ||
1031 state == OpenFlipper::Options::InScene ||
1039 std::cerr <<
"Script" << std::endl;
1048 if ( OpenFlipper::Options::gui() ) {
1062 if ( OpenFlipper::Options::gui() )
1069 if ( OpenFlipper::Options::gui() )
1076 if ( !OpenFlipper::Options::gui() || !
OpenFlipperSettings().value(
"Core/Gui/glViewer/useMultipleViewers",
true).toBool() )
1097 QString actionTypeName = _action->data().toString();
1100 for (
int i = 0 ; i < recentFiles.size() ; ++i )
1103 if ( (recentFiles[i] == _action->text()) && ( actionTypeName == recentTypes[i] ) ){
1105 OpenFlipper::Options::loadingRecentFile(
true);
1108 OpenFlipper::Options::loadingRecentFile(
false);
1113 emit
log(
LOGERR, tr(
"Unable to open recent. Unable to find %1 with datatype %2 in recent files list.").arg(_action->text()).arg(actionTypeName) );
1121 QString inifile = OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"OpenFlipper.ini";
1125 if ( ! ini.
connect( inifile,
true) ) {
1126 emit
log(
LOGERR,tr(
"Can not create user ini file"));
1134 if ( OpenFlipper::Options::gui() ) {
1136 QSettings windowStates(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"WindowStates.dat", QSettings::IniFormat);
1138 windowStates.setValue(
"Core/Window/State",
coreWidget_->saveState ());
1139 windowStates.setValue(
"Core/Window/Geometry",
coreWidget_->saveGeometry ());
1140 windowStates.setValue(
"Core/Window/WindowState",
coreWidget_->isMaximized() );
1145 windowStates.beginGroup (
"Core");
1146 windowStates.beginGroup (
"LogSlider");
1148 windowStates.endGroup ();
1150 windowStates.endGroup ();
1162 for ( uint i = 0 ; i <
plugins_.size() ; ++i ){
1179 OpenFlipper::Options::closeSettings();
1183 if(OpenFlipper::Options::deleteIniFile()) {
1184 bool success =
true;
1187 QStringList optionFiles = OpenFlipper::Options::optionFiles();
1188 for (
int i = 0 ; i < (int)optionFiles.size(); ++i) {
1189 success &= QFile::remove(optionFiles[i]);
1193 QMessageBox::warning(0, tr(
"Warning"),
1194 tr(
"One or more files could not be removed.\nDelete files manually."),
1220 qApp->exit(EXIT_FAILURE);
1240 QFileInfo fi( fileName );
1242 if ( fileName ==
"" || !fi.dir().exists() ) {
1243 OpenFlipperSettings().
setValue(
"Core/Log/logFile", OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"OpenFlipper.log");
1247 if (
logFile_->open(QFile::WriteOnly) ) {
1250 emit
log(
LOGERR, tr(
"Unable to open logfile!"));
1257 (*logStream_) <<
"INFO:";
break;
1259 (*logStream_) <<
"OUT :";
break;
1261 (*logStream_) <<
"WARN:";
break;
1263 (*logStream_) <<
"ERR :";
break;
1265 (*logStream_) <<
"STAT:";
break;
1268 (*logStream_) << _message <<
"\n" << flush;
1274 QStringList _parameters, QStringList _descriptions)
1277 if (sender() ==
this){
1279 info.slotName = _slotName;
1280 info.slotDescription = _slotDescription;
1281 info.parameters = _parameters;
1282 info.descriptions = _descriptions;
1293 for (uint i=0; i <
plugins_.size(); i++)
1294 if (
plugins_[i].plugin == sender())
1297 if (pluginInfo == 0){
1298 emit
log(
LOGERR, tr(
"Unable to set slot-description. Plugin not found!"));
1303 info.slotName = _slotName;
1304 info.slotDescription = _slotDescription;
1305 info.parameters = _parameters;
1306 info.descriptions = _descriptions;
1313 QStringList _parameters, QStringList _descriptions)
1316 info.slotName = _functionName;
1317 info.slotDescription = _slotDescription;
1318 info.parameters = _parameters;
1319 info.descriptions = _descriptions;
1326 QStringList& _parameters, QStringList& _descriptions )
1328 QString pluginName = _function.section(
".", 0, 0);
1329 QString slotName = _function.section(
".", 1, 1);
1332 if ( !_function.contains(
".") ) {
1335 slotName = pluginName;
1350 if (pluginName ==
"core"){
1352 _fnDescription =
"";
1353 _parameters.clear();
1354 _descriptions.clear();
1358 _fnDescription =
coreSlots_[i].slotDescription;
1371 for (uint i=0; i <
plugins_.size(); i++)
1372 if (
plugins_[i].rpcName == pluginName)
1375 if (pluginInfo == 0){
1376 emit
log(
LOGERR, tr(
"Unable to get slot-description. Plugin not found!"));
1380 _fnDescription =
"";
1381 _parameters.clear();
1382 _descriptions.clear();
1385 for (
int i=0; i < pluginInfo->
slotInfos.count(); i++)
1386 if (pluginInfo->
slotInfos[i].slotName == slotName){
1387 _fnDescription = pluginInfo->
slotInfos[i].slotDescription;
1388 _parameters = pluginInfo->
slotInfos[i].parameters;
1389 _descriptions = pluginInfo->
slotInfos[i].descriptions;
1396 if ( OpenFlipper::Options::gui() ) {
1397 if ( _viewerId >= OpenFlipper::Options::examinerWidgets() ) {
1398 emit
log(
LOGERR,tr(
"Unable to snapshotBaseFileName for viewer ") + QString::number(_viewerId) );
1409 if ( OpenFlipper::Options::gui() ) {
1410 if ( _viewerId >= OpenFlipper::Options::examinerWidgets() ) {
1411 emit
log(
LOGERR,tr(
"Unable to snapshotFileType for viewer ") + QString::number(_viewerId) );
1423 if ( OpenFlipper::Options::gui() ) {
1424 if ( _viewerId >= OpenFlipper::Options::examinerWidgets() ) {
1425 emit
log(
LOGERR,tr(
"Unable to snapshotFileType for viewer ") + QString::number(_viewerId) );
1434 void Core::snapshot(
unsigned int _viewerId,
int _width,
int _height,
bool _alpha,
bool _hideCoordsys,
int _numSamples ){
1437 if ( OpenFlipper::Options::gui() ) {
1438 if ( _viewerId >= OpenFlipper::Options::examinerWidgets() ) {
1439 emit
log(
LOGERR,tr(
"Unable to create snapshot for viewer ") + QString::number(_viewerId) );
1449 if ( OpenFlipper::Options::gui() )
1455 if ( OpenFlipper::Options::gui() )
1461 if ( OpenFlipper::Options::gui() )
1466 bool comments_visible_only,
bool comments_targeted_only,
1467 bool store_material_info,
int snapshot_width,
int snapshot_height,
1468 bool snapshot_transparent,
bool hide_coord_sys,
1469 int snapshot_multisampling,
bool store_view) {
1471 if ( OpenFlipper::Options::gui() )
1473 comments_visible_only, comments_targeted_only,
1474 store_material_info, snapshot_width, snapshot_height,
1475 snapshot_transparent, hide_coord_sys, snapshot_multisampling,
1481 if ( OpenFlipper::Options::gui() ){
1492 if ( OpenFlipper::Options::gui() ){
1505 if ( ! ini.
connect(_filename,
true) ) {
1506 emit
log(
LOGERR,tr(
"Failed to connect to _ini file") + _filename);
1511 if ( OpenFlipper::Options::isWindows() )
1512 ini.
add_entry(
"Core" ,
"VersionWindows" , OpenFlipper::Options::coreVersion() );
1514 ini.
add_entry(
"Core" ,
"VersionLinux" , OpenFlipper::Options::coreVersion() );
1517 for (uint i=0; i <
plugins_.size(); i++){
1519 if ( OpenFlipper::Options::isWindows() )
1534 foreach (QString s, _types)
1537 if (_selection ==
"source")
1539 else if (_selection ==
"target")
1544 rv.append (o_it->id ());
1554 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(
";")));
1558 emit
setSlotDescription(
"deleteObject(int)", tr(
"Delete an object from the scene."), QStringList(
"ObjectId"), QStringList(tr(
"Id of the object to delete")));
1559 emit
setSlotDescription(
"updateView()", tr(
"Redraw the contents of the viewer."), QStringList(), QStringList());
1560 emit
setSlotDescription(
"clearAll()", tr(
"Clear all data objects."), QStringList(), QStringList());
1561 emit
setSlotDescription(
"exitApplication()", tr(
"Quit OpenFlipper"), QStringList(), QStringList());
1563 QStringList(tr(
"enabled")) ,
1564 QStringList(tr(
"Enable or disable fullscreen mode")));
1565 emit
setSlotDescription(
"showViewModeControls(bool)", tr(
"Show or hide the view mode control box"),
1566 QStringList(tr(
"Show?")) ,
1568 emit
setSlotDescription(
"loggerState(int)", tr(
"Change the logger window state"), QStringList(tr(
"Change the logger window state")), QStringList());
1569 emit
setSlotDescription(
"enableOpenMeshErrorLog(bool)", tr(
"Enable or disable OpenMesh error logging"), QStringList(tr(
"OpenMesh error logging enabled")), QStringList());
1570 emit
setSlotDescription(
"showToolbox(bool)", tr(
"Show or hide toolbox"), QStringList(tr(
"Show or hide the toolbox")), QStringList());
1571 emit
setSlotDescription(
"showStatusBar(bool)", tr(
"Show or hide status bar"), QStringList(tr(
"Show or hide the status bar")), QStringList());
1573 QStringList(tr(
"Mode")), QStringList(tr(
"0: One Viewer\n1: Double Viewer\n2: Grid \n3: Horizontal split ")));
1575 emit
setSlotDescription(
"restrictFrameRate(bool)", tr(
"Restrict FrameRate to MaxFrameRate"),
1576 QStringList(tr(
"enabled")), QStringList(tr(
"restriction switch")));
1577 emit
setSlotDescription(
"setMaxFrameRate(int)", tr(
"set the maximal framerate (automatically enables framerate restriction)"),
1578 QStringList(tr(
"frameRate")), QStringList(tr(
"Maximum frameRate")));
1579 emit
setSlotDescription(
"snapshotBaseFileName(QString)", tr(
"Set a filename for storing snapshots.")
1580 , QStringList(), QStringList());
1581 emit
setSlotDescription(
"snapshotFileType(QString)", tr(
"Set a filetype for storing snapshots.")
1582 , QStringList(), QStringList());
1583 emit
setSlotDescription(
"snapshotCounterStart(int)", tr(
"Set the starting number for the snapshot counter.")
1584 , QStringList(
"StartValue"), QStringList(
"Starting number for the counter"));
1585 emit
setSlotDescription(
"snapshot()", tr(
"Make a snapshot of the viewer. If no filename" 1586 " was set using snapshotBaseFileName() the snapshot is stored" 1587 " in snap.png in the current directory. The captured image will have " 1588 " the same dimensions as the current viewport. " 1589 "For every snapshot a counter is added to the filename."), QStringList(), QStringList());
1590 emit
setSlotDescription(
"snapshot(uint)", tr(
"Make a snapshot of the viewer with id viewerId. If no filename" 1591 " was set using snapshotBaseFileName() the snapshot is stored" 1592 " in snap.png in the current directory. For every snapshot" 1593 " a counter is added to the filename."), QStringList(
"viewerId"), QStringList(
"Id of viewer to be captured (default is 0)"));
1594 emit
setSlotDescription(
"snapshot(uint,int,int)", tr(
"Make a snapshot of the viewer with id viewerId." 1595 " Pass 0 as viewerId parameter to capture the current viewer. " 1596 " The captured image will have the specified dimensions. " 1597 " If 0 is passed as either width or height parameter, the value will " 1598 " automatically be set to hold the right aspect ratio, respectively. " 1599 " If no filename was set using snapshotBaseFileName() the snapshot is stored" 1600 " in snap.png in the current directory. For every snapshot" 1601 " a counter is added to the filename."), QStringList(QString(
"viewerId;width;height").split(
";")),
1602 QStringList(QString(
"Id of viewer (default is 0);Width of image;Height of image").split(
";")));
1603 emit
setSlotDescription(
"snapshot(uint,int,int,bool)", tr(
"Make a snapshot of the viewer with id viewerId." 1604 " Pass 0 as viewerId parameter to capture the current viewer. " 1605 " The captured image will have the specified dimensions. " 1606 " If 0 is passed as either width or height parameter, the value will " 1607 " automatically be set to hold the right aspect ratio, respectively. " 1608 " If 0 is passed for both width and height values, the viewport's current " 1609 " dimension is used. Set alpha to true if you want the background to be transparent. " 1610 " If no filename was set using snapshotBaseFileName() the snapshot is stored" 1611 " in snap.png in the current directory. For every snapshot" 1612 " a counter is added to the filename."), QStringList(QString(
"viewerId;width;height;alpha").split(
";")),
1613 QStringList(QString(
"Id of viewer (default is 0);Width of image;Height of image;Transparent background").split(
";")));
1614 emit
setSlotDescription(
"snapshot(uint,int,int,bool,bool)", tr(
"Make a snapshot of the viewer with id viewerId." 1615 " Pass 0 as viewerId parameter to capture the current viewer. " 1616 " The captured image will have the specified dimensions. " 1617 " If 0 is passed as either width or height parameter, the value will " 1618 " automatically be set to hold the right aspect ratio, respectively. " 1619 " If 0 is passed for both width and height values, the viewport's current " 1620 " dimension is used. Set alpha to true if you want the background to be transparent. " 1621 " The fifth parameter is used to hide the coordinate system in the upper right corner of the screen. " 1622 " If no filename was set using snapshotBaseFileName() the snapshot is stored" 1623 " in snap.png in the current directory. For every snapshot" 1624 " a counter is added to the filename."), QStringList(QString(
"viewerId;width;height;alpha;hideCoordsys").split(
";")),
1625 QStringList(QString(
"Id of viewer (default is 0);Width of image;Height of image;Transparent background;Hide coordsys node").split(
";")));
1626 emit
setSlotDescription(
"snapshot(uint,int,int,bool,bool,int)", tr(
"Make a snapshot of the viewer with id viewerId." 1627 " Pass 0 as viewerId parameter to capture the current viewer. " 1628 " The captured image will have the specified dimensions. " 1629 " If 0 is passed as either width or height parameter, the value will " 1630 " automatically be set to hold the right aspect ratio, respectively. " 1631 " If 0 is passed for both width and height values, the viewport's current " 1632 " dimension is used. Set alpha to true if you want the background to be transparent. " 1633 " The fifth parameter is used to hide the coordinate system in the upper right corner of the screen. " 1634 " If no filename was set using snapshotBaseFileName() the snapshot is stored" 1635 " in snap.png in the current directory. For every snapshot" 1636 " a counter is added to the filename."), QStringList(QString(
"viewerId;width;height;alpha;hideCoordsys;numSamples").split(
";")),
1637 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(
";")));
1639 QString(tr(
"width,height")).split(
","),
1640 QString(tr(
"new width for the viewer,new height for the viewer")).split(
","));
1641 emit
setSlotDescription(
"writeVersionNumbers(QString)", tr(
"write the current versions of all plugins to INI file"),
1642 QStringList(tr(
"filename")),
1643 QStringList(tr(
"fullpath to a file where the versions should be written to.")));
1645 emit
setSlotDescription(
"saveObject(int,QString)", tr(
"Save object to file. If the file exists it will be overwritten."),
1646 QString(tr(
"object-id,filename")).split(
","),
1647 QString(tr(
"id of the object, complete path and filename")).split(
","));
1648 emit
setSlotDescription(
"saveObjectTo(int,QString)", tr(
"Save object to file. The location can be chosen in a dialog. " 1649 "(only works if GUI is available)"),
1650 QString(tr(
"object-id,filename")).split(
","),
1651 QString(tr(
"id of the object, initial filename for the dialog")).split(
","));
1653 "If no filename is available a dialog is shown. (only works if GUI is available)"),QStringList(), QStringList());
1654 emit
setSlotDescription(
"saveAllObjectsTo()", tr(
"Saves all target objects. The locations can be chosen in dialogs. " 1655 "(only works if GUI is available)"),QStringList(), QStringList());
1656 emit
setSlotDescription(
"saveSettings()", tr(
"Show the dialog to save the current setting. (only works if GUI is available)"),QStringList(), QStringList());
1657 emit
setSlotDescription(
"saveSettings(QString, bool, bool, bool, bool, bool, bool)", tr(
"Save the current setting to the supplied file."),
1658 QStringList(tr(
"filePath,is_saveObjectInfo,is_targetOnly,is_saveAll,is_askOverwrite,is_saveProgramSettings,is_savePluginSettings").split(
",")),
1659 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(
";")));
1661 emit
setSlotDescription(
"loadObject()", tr(
"Show the dialog to load an object. (only works if GUI is available)"),QStringList(), QStringList());
1662 emit
setSlotDescription(
"loadObject(QString)", tr(
"Load an object specified in file filename. This automatically determines which file plugin to use."),
1663 QStringList(tr(
"filename")), QStringList(tr(
"Filename")));
1664 emit
setSlotDescription(
"getObjectId(QString)", tr(
"Return identifier of object with specified name. Returns -1 if object was not found."),QStringList(), QStringList());
1665 emit
setSlotDescription(
"loadSettings()", tr(
"Show the dialog to load settings. (only works if GUI is available)"),QStringList(), QStringList());
1666 emit
setSlotDescription(
"loadSettings(QString)", tr(
"load settings from file."),QStringList(), QStringList());
1668 emit
setSlotDescription(
"createWidget(QString,QString)", tr(
"Create a widget from an ui file"),
1669 QString(tr(
"Object name,ui file")).split(
","),
1670 QString(tr(
"Name of the new widget in script,ui file to load")).split(
","));
1672 emit
setSlotDescription(
"addToolbox(QString,QWidget*)", tr(
"Add a widget as a toolbox"),
1673 QString(tr(
"Toolbox Entry name,Widget")).split(
","),
1674 QString(tr(
"Name of the new widget in the toolbox,Pointer to the new widget")).split(
","));
1676 emit
setSlotDescription(
"addToolbox(QString,QWidget*,QIcon*)", tr(
"Add a widget as a toolbox"),
1677 QString(tr(
"Toolbox Entry name,Widget,Icon")).split(
","),
1678 QString(tr(
"Name of the new widget in the toolbox,Pointer to the new widget,Pointer to icon")).split(
","));
1680 emit
setSlotDescription(
"serializeMaterialProperties(int)", tr(
"Serialize and return the material properties of the supplied object."),
1681 QString(tr(
"ObjectId")).split(
","),
1682 QString(tr(
"ID of the object")).split(
","));
1684 emit
setSlotDescription(
"deserializeMaterialProperties(int, QString)", tr(
"Deserialize the supplied material properties into the supplied object."),
1685 QString(tr(
"ObjectId, SerializedProps")).split(
","),
1686 QString(tr(
"ID of the object,The serialized material properties.")).split(
","));
1688 emit
setSlotDescription(
"addViewModeToolboxes(QString,QString)", tr(
"Set toolboxes for a viewmode (This automatically adds the view mode if it does not exist)"),
1689 QString(tr(
"Name,Toolbox List")).split(
","),
1690 QString(tr(
"Name of the Viewmode,seperated list of toolboxes visible in this viewmode")).split(
","));
1692 emit
setSlotDescription(
"addViewModeToolbars(QString,QString)", tr(
"Set toolbars for a viewmode (This automatically adds the view mode if it does not exist)"),
1693 QString(tr(
"Name,Toolbar List")).split(
","),
1694 QString(tr(
"Name of the Viewmode,seperated list of toolbars visible in this viewmode")).split(
","));
1696 emit
setSlotDescription(
"addViewModeContextMenus(QString,QString)", tr(
"Set context Menus for a viewmode (This automatically adds the view mode if it does not exist)"),
1697 QString(tr(
"Name,Context Menu List")).split(
","),
1698 QString(tr(
"Name of the Viewmode,seperated list of Context Menus visible in this viewmode")).split(
","));
1700 emit
setSlotDescription(
"addViewModeIcon(QString,QString)", tr(
"Set Icon for a viewmode (This automatically adds the view mode if it does not exist)"),
1701 QString(tr(
"Name,Icon filename")).split(
","),
1702 QString(tr(
"Name of the Viewmode,filename of the icon (will be taken from OpenFlippers icon directory)")).split(
","));
1704 emit
setSlotDescription(
"objectList(QString,QStringList)", tr(
"Returns object list"),
1705 QString(tr(
"Selection type,Object types")).split(
","),
1706 QString(tr(
"Type of object selection (all,source,target),Object type (All,PolyMesh,TriangleMesh,...)")).split(
";"));
1708 emit
setSlotDescription(
"setToolBoxSide(QString)", tr(
"Determine whether the toolboxes should be displayed on the right or on the left side."),
1709 QStringList(tr(
"side")), QStringList(tr(
"The desired side of the toolboxes (either 'left' or 'right')")));
1711 emit
setSlotDescription(
"getToolbox(QString,QString)", tr(
"Returns a pointer to the requested toolbox widget if it was found, nullptr, otherwise."),
1712 tr(
"Plugin Name\rToolbox Name").split(
"\r"),
1713 tr(
"The plugin which the requested toolbox belongs to.\rThe name of the requested toolbox.").split(
"\r"));
1715 emit
setSlotDescription(
"blockSceneGraphUpdates()", tr(
"Disable Scenegraph Updates (e.g. before loading or adding a large number of files)"),QStringList(), QStringList());
1716 emit
setSlotDescription(
"unblockSceneGraphUpdates()", tr(
"Enable Scenegraph Updates (e.g. before loading or adding a large number of files)"),QStringList(), QStringList());
1717 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.)")));
1730 std::cerr <<
"Error while deleting object, does not exist!!" << std::endl;
1737 object->deleteSubtree();
1740 object->parent()->removeChild(
object);
1751 if ( _objId == -1 )
return;
1756 std::cerr <<
"No such object." << std::endl;
1762 std::cerr <<
"No suitable object found." << std::endl;
1770 if ( _objId == -1 )
return QString();
1775 std::cerr <<
"No such object." << std::endl;
1781 std::cerr <<
"No suitable object found." << std::endl;
1790 if ( _id == -1 )
return;
1795 std::cerr <<
"No such object." << std::endl;
1803 if ( _id == -1 )
return;
1808 std::cerr <<
"No such object." << std::endl;
1816 if ( _id == -1 )
return;
1821 std::cerr <<
"No such object." << std::endl;
1832 std::vector< int > ids;
1837 ids.push_back( current->
id() );
1838 current = current->
next();
1841 for ( uint i = 0 ; i < ids.size(); ++i ) {
1862 QString qtCompiledVersion = QString( QT_VERSION_STR );
1863 QString qtCurrentVersion = qVersion();
1865 if ( qtCompiledVersion != qtCurrentVersion ) {
1866 messages += tr(
"QT Library Version mismatch!\n");
1868 messages += tr(
"Currently used QT Version:\t") + qVersion() +
"\n";
1869 messages += tr(
"Link time QT Version:\t\t") + QString( QT_VERSION_STR ) +
"\n";
1870 messages += tr(
"This inconsistency may lead to an unstable behavior of OpenFlipper!");
1876 QString message = tr(
"Error! Library tests failed!\n");
1877 message += tr(
"The following problems have been found:\n\n");
1879 message += messages;
1881 std::cerr << message.toStdString() << std::endl;
1883 if ( OpenFlipper::Options::gui() ) {
1885 StaysOnTopMessageBox::critical ( 0, tr(
"Library incompatibilities found!"),message );
1891 }
else if ( warn ) {
1893 QString message = tr(
"Warning! The OpenGL capabilities of your current machine/driver could be insufficient!\n\n");
1894 message += tr(
"The following checks failed:\n\n");
1895 message += messages;
1897 std::cerr << message.toStdString() << std::endl;
1899 if ( OpenFlipper::Options::gui() ) {
1901 StaysOnTopMessageBox::warning ( 0, tr(
"Library incompatibilities found!"),message );
1907 std::cerr <<
"Library Check succeeded" << std::endl;
1921 if ( OpenFlipper::Options::nogui() )
1931 #if QT_VERSION < 0x050000 1934 QGLFormat::OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags();
1936 if ( QGLFormat::hasOpenGL() ) {
1937 if ( flags.testFlag(QGLFormat::OpenGL_Version_None) ) {
1938 missing += tr(
"OpenGL Version Unknown to QT!\n");
1939 missing += tr(
"OpenGL reports version: ") + QString((
const char*)glGetString( GL_VERSION )) ;
1942 if ( !( flags.testFlag(QGLFormat::OpenGL_Version_3_0) |
1943 flags.testFlag(QGLFormat::OpenGL_Version_2_1) |
1944 flags.testFlag(QGLFormat::OpenGL_Version_2_0) ) ) {
1946 missing += tr(
"OpenGL Version less then 2.0!\n");
1952 missing += tr(
"No OpenGL support found!\n");
1956 QString glExtensions = QString((
const char*)glGetString(GL_EXTENSIONS));
1959 if ( !glExtensions.contains(
"GL_ARB_vertex_buffer_object") ) {
1961 missing += tr(
"Your graphics card does not support the GL_ARB_vertex_buffer_object extension!\n");
1966 QOpenGLContext* context = QOpenGLContext::currentContext();
1970 QSurfaceFormat format = context->format();
1972 if ( (format.majorVersion() < 2) ) {
1975 missing += tr(
"OpenGL Version less then 2.0!\n");
1980 if ( !context->hasExtension(
"GL_ARB_vertex_buffer_object") ) {
1981 missing +=
"GL_ARB_vertex_buffer_object extension missing\n";
1989 missing += tr(
"No OpenGL support found!\n");
1996 QString message = tr(
"Error! \nThe OpenGL capabilities of your current machine/driver are not sufficient!\n\n");
1997 message += tr(
"The following checks failed:\n\n");
1999 message += tr(
"\n\nPlease update your driver or graphics card.\n");
2001 message += tr(
"If you have more than one GPU (e.g. MacBook) don't use the internal one!\n");
2004 std::cerr << message.toStdString() << std::endl;
2008 QMessageBox::StandardButton button = StaysOnTopMessageBox::critical ( 0, tr(
"Insufficient OpenGL Capabilities!"),message,QMessageBox::Abort|QMessageBox::Ignore , QMessageBox::Abort);
2011 if ( button == QMessageBox::Abort )
2014 StaysOnTopMessageBox::warning(0,tr(
"Insufficient OpenGL Capabilities!"),tr(
"Ignoring OpenGL capabilities might lead to unstable Operation! Do it at your own risk!"));
2019 }
else if ( warn ) {
2021 QString message = tr(
"Warning! Automatic system environment checks discovered some possible problems!\n\n");
2022 message += tr(
"The following checks failed:\n\n");
2025 std::cerr << message.toStdString() << std::endl;
2027 StaysOnTopMessageBox::warning ( 0, tr(
"Detected possible problems!"),message );
2032 std::cerr <<
"OpenGL Version Check succeeded" << std::endl;
QScriptValue printToFileFunction(QScriptContext *context, QScriptEngine *engine)
Special print function for sending output to a file.
void snapshot(unsigned int _viewerId=0, int _width=0, int _height=0, bool _alpha=false, bool _hideCoordsys=false, int _numSamples=1)
void loggerState(int _state)
Change the logging window state.
QStringList scriptingFunctions_
List of all registered scripting functions.
ACG::SceneGraph::SeparatorNode SeparatorNode
Seperator Node.
QScriptValue helpFunction(QScriptContext *context, QScriptEngine *engine)
Function to print help about scripting functions.
void addPickMode(const std::string &_name, bool _mouse_tracking=false, int _pos=-1, bool _visible=true, QCursor _cursor=Qt::ArrowCursor)
add pick mode
bool checkLibraryVersions()
Checks for library inconsistencies.
void showStatusBar(bool _state)
Show or hide Status Bar.
void writeApplicationOptions(INIFile &_ini)
Write Application options to ini file.
void showReducedMenuBar(bool reduced)
typedefs
void setViewerProperties(std::vector< Viewer::ViewerProperties * > _viewerProperties)
Set the internal viewerProperties pointer ( DO NOT USE!! )
LoggerWidget * logWidget_
Textedit at the bottom for log messages.
void setScriptEngine(QScriptEngine *_engine)
DONT USE! (Function to set the internal reference to the script Engine)
bool scenegraphPick(ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, unsigned int &_nodeIdx, unsigned int &_targetIdx, ACG::Vec3d *_hitPointPtr=0)
Execute picking operation on scenegraph.
ACG::SceneGraph::CoordinateSystemNode CoordsysNode
Simple Name for CoordsysNode.
virtual void slotInformationRequested(const QPoint _clickedPoint, DataType _type)=0
Show information dialog on clicked object.
void restoreState(QSettings &_settings)
restores the state
QStringList IteratorRestriction
Iterable object range.
void slotSetSlotDescription(QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
set a description for one of the plugin's public slots
std::vector< PluginInfo > plugins_
List of all loaded plugins_.
DLLEXPORT DataType typeId(QString _name)
Given a dataType Identifier string this function will return the id of the datatype.
void openIniFile(QString _filename, bool _coreSettings, bool _perPluginSettings, bool _loadObjects)
Load information from an ini file.
void resizeApplication(int _width, int _height)
resize the whole Application
Add normals to mesh item (vertices/faces)
void addRecent(QString _filename, DataType _type)
Add a recent file and update menu.
void slotLog(Logtype _type, QString _message)
Console logger.
Logtype
Log types for Message Window.
CoreWidget * coreWidget_
The main applications widget ( only created in gui mode )
void clearComment(const QString &key)
Get comment for the specified key.
void slotScriptInfo(QString _pluginName, QString _functionName)
Core scripting engine.
void enableOpenMeshErrorLog(bool _state)
Enable or disable OpenMesh error logging.
bool custom
Is this a user defined custom view mode or a plugin generated one.
void applyOptions()
after ini-files have been loaded and core is up or if options have been changed -> apply Options ...
void writeVersionNumbers(QString _filename)
write the current versions of all plugins to ini file
void showToolbox(bool _state)
Show or hide toolbox.
void setupOptions()
Get all ini files and set basic paths and options.
ACG::SceneGraph::Material & material()
Get material object reference.
void slotAddHiddenPickMode(const std::string &_mode)
Add a new and invisible picking mode to the examiner_widget_.
static void loadSavedPostProcessors(const unsigned _examiner)
append all saved post processors
prototypeMatrix4x4 matrix4x4Prototype_
Prototype for the Matrix type.
QList< int > objectList(QString _selection, QStringList _types)
return the list of available object that has the given selection and type
void checkScenegraphDirty()
Called to check if the scenegraph needs to be redrawn.
const QStringList SOURCE_OBJECTS("source")
Iterable object range.
QSplitter * toolSplitter_
Spliter between toplevel objects and toolbox.
bool dataType(DataType _type) const
void showViewModeControls(bool _show)
Show or Hide the viewmode control widget.
void finishSplash()
exit the current application
QStringList visibleToolboxes
List of Visible Toolboxes in this view mode.
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.
prototypeVec4d vec4dPrototype_
Prototype for the Vector type.
ViewMode struct This struct contains a ViewMode and its status information such as used widgets...
QTextStream * logStream_
stream for logging to file
void updateRecent()
Update the recent files menu.
QtGLGraphicsView * glView_
graphics view that holds the gl scene
void setFullscreen(bool _state)
Enable or disable fullscreen mode.
void deserializeMaterialProperties(int _objId, QString _props)
Serialize material properties.
void exitFailure()
Aborts the application with an error code.
void PluginWheelEvent(QWheelEvent *, const std::string &)
When this Signal is emitted when a Wheel Event occures.
SideArea * toolBox_
Toolbox.
ACG::SceneGraph::MaterialNode MaterialNode
Materialnode.
void restrictFrameRate(bool _enable)
Enable or disable framerate restriction.
void showReducedMenuBar(bool reduced)
Core scripting engine.
unsigned int available()
number of available renderers
void setViewMode(QString _mode, bool _expandAll=false)
Set the view Mode to the given Mode.
void snapshotCounter(const int _counter)
Execute action on node first and then on its children.
DLLEXPORT OpenFlipperQSettings & OpenFlipperSettings()
QSettings object containing all program settings of OpenFlipper.
void startVideoCapture(QString _baseName, int _fps, bool _captureViewers)
Start video capturing.
void saveSettings()
Save current status to a settings file. Solicit file name through dialog.
int lastHeight_
Slot called everytime the view is updated.
void slotLogToFile(Logtype _type, QString _message)
log to file
const QStringList ALL_OBJECTS
Iterable object range.
void resizeViewers(int _width, int _height)
resize the examinerViewer
bool getPickedObject(const unsigned int _node_idx, BaseObjectData *&_object)
Get the picked mesh.
void snapshotCounterStart(const int _counter, unsigned int _viewerId=0)
Set the start index for the snapshot counter.
Interface class from which all plugins have to be created.
QSplitter * splitter_
Spliter between toplevel objects and the textedit at the bottom.
void saveAllObjectsTo()
Slot for saving objects to a new location.
QString serializeMaterialProperties(int _objId)
Serialize material properties.
QTime * redrawTime_
Holds the time since last redraw.
void slotShowPlugins()
Show Plugins Dialog.
bool checkSignal(QObject *_plugin, const char *_signalSignature)
Check if a plugin has a signal.
void applicationSnapshotName(QString _name)
Set the baseName for the application snapshot.
MaterialNode * materialNode()
get a pointer to the materialnode
void showLogger(OpenFlipper::Options::LoggerState _state)
Change visibility of the logger.
void loadSettings()
Load status from file.
void exitApplication()
exit the current application
void setViewerLayout(int _idx)
Change viewer layout that was selected in the combo box.
void disconnect()
Remove connection of this object to a file.
void slotCall(QString _pluginName, QString _functionName, bool &_success)
void setSlotDescription(QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
Core scripting engine.
void fullscreen(bool _state)
set fullscreen mode
void init()
Second initialization stage.
QVector< ViewMode * > viewModes_
List of available draw modes.
prototypeVec3d vec3dPrototype_
Prototype for the Vector type.
void setValue(const QString &key, const QVariant &value)
Wrapper function which makes it possible to enable Debugging output with -DOPENFLIPPER_SETTINGS_DEBUG...
void snapshotBaseFileName(QString _fname, unsigned int _viewerId=0)
void pluginSceneDrawn()
This signal is emitted after the scene has been drawn.
bool checkOpenGLCapabilities()
OpenGL capability check.
void writeOnExit()
Called if app is closed and writes all information to ini file.
Viewer::ViewerProperties & viewerProperties(int _id)
Get the viewer properties Use this functions to get basic viewer properties such as backgroundcolor o...
void setObjectComment(int objId, QString key, QString comment)
Called when a plugin requests an update in the viewer.
void slotWheelEvent(QWheelEvent *_event, const std::string &_mode)
Gets called by examiner widget when Wheel is moved in picking mode.
QList< SlotInfo > globalFunctions_
Core scripting engine.
prototypeDataType DataTypePrototype_
Prototype for the DataType.
void deleteSubtree()
delete the whole subtree below this item ( The item itself is not touched )
SeparatorNode * dataRootNode_
Root Node for data objects.
void slotDeleteAllObjects()
Called when a plugin wants to delete all objects.
void restoreState(QSettings &_settings)
restores the state
void applicationSnapshotName(QString _name)
Set the snapshot name.
void setTraverseMode(unsigned int _mode)
Set traverse mode for node.
QTimer * scenegraphCheckTimer_
Timer that starts scenegraph check.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
void saveState(QSettings &_settings)
returns the current state
void slotExecuteAfterStartup()
Executed after loading core completly to load files from commandline.
void showStatusBar(bool _state)
Show or hide status bar.
bool connect(const QString &name, const bool create)
Connect INIFile object with given filename.
BaseObject * objectRoot_
Pointer to the data rootNode;.
Class for the handling of simple configuration files.
void multiViewMode(int _mode)
Switch the multiView Mode.
void restoreKeyBindings()
Restore key assignments from configs files.
void clearAllComments(int objId)
Called when a plugin requests an update in the viewer.
void slotGetDescription(QString _function, QString &_fnDescription, QStringList &_parameters, QStringList &_descriptions)
get available descriptions for a given public slot
void viewUpdated()
Slot called everytime the view is updated.
void saveState(QSettings &_settings)
saves the current state
void slotExit()
Exit Application.
void showToolbox(bool _state)
Show or hide toolbox.
void snapshotFileType(QString _type, unsigned int _viewerId=0)
Set the file type for snapshots.
SeparatorNode * root_node_scenegraph_
Scenegraphs root node.
void traverse(BaseNode *_node, Action &_action)
SeparatorNode * dataSeparatorNode_
Toplevel Nodes for data objects.
void slotSetSlotDescriptionGlobalFunction(QString _functionName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
set a description for a global scripting function
void snapshotBaseFileName(const QString &_fname)
QString name
Name of the View Mode.
std::vector< PluginLogger * > loggers_
Logger interfaces between plugins and core logger.
QScriptEngine scriptEngine_
Core scripting engine.
LoggerState
State of the logging widget.
SideArea * getToolbox()
Show logger in splitter or not.
void clearAll()
Clear all data objects.
void setSceneGraphRootNodeGlobal(SeparatorNode *_root_node)
void slotScriptError(const QScriptValue &error)
Core scripting engine.
void updateView()
Called when a plugin requests an update in the viewer.
std::vector< glViewer * > examiner_widgets_
Examiner Widget.
SeparatorNode * core_nodes_
Separator Node holding all core scenegraph nodes.
void stopVideoCapture()
Stop video capturing.
void slotRecentOpen(QAction *_action)
Open Recent file.
void snapshotFileType(const QString &_type)
void viewerSnapshot()
Take a snapshot from all viewers.
void slotMouseEvent(QMouseEvent *_event)
Gets called by examiner widget when mouse is moved in picking mode.
void slotAddPickMode(const std::string &_mode)
Add a new picking mode to the examiner_widget_.
void PluginMouseEventLight(QMouseEvent *)
Emitted when an light event occurs.
void setDataRoot(BaseObject *_root)
int getRendererId(QString _name)
get renderer id with the given name
QWidget * getToolboxArea()
Show logger in splitter or not.
void log(Logtype _type, QString _message)
Logg with OUT,WARN or ERR as type.
Draw node in second pass.
void newObject(int _objectId)
This slot is called by the object manager when a new object is created.
QList< SlotInfo > slotInfos
This list contains Descriptions about public slots if available.
void slotAddEmptyObjectMenu()
Open the add Empty dialog.
void applicationSnapshot()
Create a snapshot of the whole app.
void objectDeleted(int)
Called after an object has been deleted.
ACG::SceneGraph::CoordsysNode * coordsysNode_
Node for the coordinate system.
void PluginMouseEvent(QMouseEvent *)
When this Signal is emitted when a Mouse Event occures.
QString & getCommentByKey(const QString &key)
Get comment for the specified key.
void blockScenegraphUpdates(bool _block)
Called when a plugin wants to lock or unlock scenegraph updates.
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 viewerSnapshot()
Create a snapshot of the whole app.
void saveAllObjects()
Slot for saving objects from Menu.
void allCleared()
Signal send to plugins when whole scene is cleared.
void setDataSeparatorNodes(SeparatorNode *_dataSeparatorNode)
Set the internal data root node pointers ( DO NOT USE!! )
void setActive(unsigned int _active, int _id)
set the active renderer
pick any of the prior targets (should be implemented for all nodes)
int lastWidth_
Slot called everytime the view is updated.
QTimer * redrawTimer_
If enabled, this timer will block screen refresh if done more then 30 times per second.
void slotMouseEventLight(QMouseEvent *_event)
Handle Mouse events when in Light mode.
void slotMouseEventIdentify(QMouseEvent *_event)
Handle Mouse events when in Identifier mode.
void clearObjectComment(int objId, QString key)
Called when a plugin requests an update in the viewer.
void loadPlugins()
Load all plugins from default plugin directory and from INI-File.
BaseObject * childExists(int _objectId)
Check if the element exists in the subtree of this element.
QSplashScreen * splash_
SplashScreen, only used in gui mode.
#define TOSTRING(x)
QSettings object containing all program settings of OpenFlipper.
QScrollArea * getToolboxScrollArea()
Show logger in splitter or not.
void updateUI()
process events during script execution to keep the ui alive
SeparatorNode * root_node_scenegraph_global_
Seperator node for global nodes.
QtSlideWindow * slidingLogger_
Class that holds the animated log widget.
void deletedObject(int _objectId)
This slot is called by the object manager when an object is deleted.
void add_entry(const QString &_section, const QString &_key, const QString &_value)
Addition / modification of a string entry.
void applicationSnapshot()
Take a snapshot from the whole app.
Interface class for providing information on objects.
void saveOptions()
Save the current options to the standard ini file.
DLLEXPORT ObjectIterator objectsEnd()
Return Iterator to Object End.
void setSceneGraphRootNode(SeparatorNode *_root_node)
QList< SlotInfo > coreSlots_
Core scripting engine.
void setMaxFrameRate(int _rate)
set the maximal framerate ( automatically enables framerate restriction )
void scriptLog(QString _message)
Logging signal for ScriptEngine.
void setDescriptions()
set the descriptions for scriptable slots of the core
void slotRegisterSlotKeyBindings()
register scripting slots to allow keyBindings
ACG::SceneGraph::MaterialNode * coordsysMaterialNode_
Node for coordsys Material.
void deleteObject(int _id)
Called to delete an object.
QScriptValue myPrintFunction(QScriptContext *context, QScriptEngine *engine)
Special print function for core logger.
void showViewModeControls(bool _show)
Hide or show the View Mode controls.
void clearAllComments()
Get comment for the specified key.
void loadObject()
Open Load Widget.