61 #include <ACG/QtWidgets/QtFileDialog.hh> 69 #include "OpenFlipper/BasePlugin/TextureInterface.hh" 70 #include "OpenFlipper/BasePlugin/INIInterface.hh" 72 #include <OpenFlipper/common/RecentFiles.hh> 74 #include "OpenFlipper/BasePlugin/PluginFunctionsCore.hh" 83 #include <OpenFlipper/widgets/messageBox/StaysOnTopMessageBox.hh> 87 #include <ACG/Scenegraph/MaterialNode.hh> 88 #include <ACG/Scenegraph/SeparatorNode.hh> 90 #define WIDGET_HEIGHT 800 91 #define WIDGET_WIDTH 800 109 nextBackupGroupId_(0),
142 vm->
icon =
"viewmode_all.png";
149 std::vector< Viewer::ViewerProperties* > viewerProperties;
151 for (
int i=0; i < 4; i++) {
154 viewerProperties.push_back( viewerProperty );
160 OpenFlipper::Options::defaultViewingDirection( PluginFunctions::VIEW_FREE, 0 );
161 OpenFlipper::Options::defaultViewingDirection( PluginFunctions::VIEW_TOP, 1 );
162 OpenFlipper::Options::defaultViewingDirection( PluginFunctions::VIEW_LEFT, 2 );
163 OpenFlipper::Options::defaultViewingDirection( PluginFunctions::VIEW_FRONT, 3 );
175 initializeUpdateTypes();
212 if ( OpenFlipper::Options::gui() ) {
229 QPixmap splashPixmap(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() +
"splash.png");
231 splash_ =
new QSplashScreen(splashPixmap, Qt::SplashScreen | Qt::WindowStaysOnTopHint);
234 splash_->showMessage(tr(
"Initializing mainwindow") ,
235 Qt::AlignBottom | Qt::AlignLeft , Qt::white);
269 QRect rect = QApplication::desktop()->screenGeometry();
271 uint width = rect.width();
272 if ( width > 1000 ) {
276 uint height = rect.height();
277 if ( height > 1000 ) {
282 width = rect.width() - 300;
283 height = rect.height() - 150;
295 QString titleInfo = OpenFlipper::Options::windowTitle();
298 titleInfo = titleInfo +
" [DEBUG]";
301 if ( OpenFlipper::Options::coreProfile() )
302 titleInfo = titleInfo +
" CoreProfile";
304 titleInfo = titleInfo +
" CompatProfile";
317 connect(
this,SIGNAL(
log(QString )),newlog,SLOT(
slotLog(QString )),Qt::DirectConnection);
320 if ( OpenFlipper::Options::gui() )
332 if ( OpenFlipper::Options::gui() ){
350 omerr().connect(*newlog);
351 omerr().disconnect(std::cerr);
356 if ( OpenFlipper::Options::gui() )
367 omout().connect(*newlog);
368 omout().disconnect(std::cout);
373 if ( OpenFlipper::Options::gui() )
384 omlog().connect(*newlog);
389 if ( OpenFlipper::Options::gui() )
404 if ( OpenFlipper::Options::gui() )
412 connect(
this,SIGNAL(
scriptLog(QString )),newlog,SLOT(
slotLog(QString )),Qt::DirectConnection);
429 printFunction.setProperty(
"textedit",
scriptEngine_.newQObject(
this));
430 scriptEngine_.globalObject().setProperty(
"print", printFunction);
434 scriptEngine_.globalObject().setProperty(
"printToFile", printToFileFunc);
447 qScriptRegisterSequenceMetaType< QVector< int > >(&
scriptEngine_);
454 fromScriptValueVector,
458 QScriptValue ctorVec3 =
scriptEngine_.newFunction(createVector);
459 scriptEngine_.globalObject().setProperty(
"Vector", ctorVec3);
465 toScriptValueVector4,
466 fromScriptValueVector4,
470 QScriptValue ctorVec4 =
scriptEngine_.newFunction(createVector4);
471 scriptEngine_.globalObject().setProperty(
"Vector4", ctorVec4);
479 toScriptValueDataType,
480 fromScriptValueDataType,
484 QScriptValue dataTypector = scriptEngine_.newFunction(createDataType);
485 scriptEngine_.globalObject().setProperty(
"DataType", dataTypector);
492 qScriptRegisterMetaType(&scriptEngine_,
493 toScriptValueMatrix4x4 ,
494 fromScriptValueMatrix4x4,
498 QScriptValue matrix4x4ctor = scriptEngine_.newFunction(createMatrix4x4);
499 scriptEngine_.globalObject().setProperty(
"Matrix4x4", matrix4x4ctor);
505 QScriptValue scriptInstance = scriptEngine_.newQObject(
this,
506 QScriptEngine::QtOwnership,
507 QScriptEngine::ExcludeChildObjects |
508 QScriptEngine::ExcludeSuperClassMethods |
509 QScriptEngine::ExcludeSuperClassProperties
512 scriptEngine_.globalObject().setProperty(
"core", scriptInstance);
514 QScriptValueIterator it(scriptInstance);
515 while (it.hasNext()) {
528 if ( OpenFlipper::Options::gui() ) {
536 if ( OpenFlipper::Options::currentViewMode( ) !=
"" )
542 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
565 QString defaultRendererKey =
"Viewer" + QString::number(i)+
"/DefaultRenderer";
566 QString defaultRendererName =
OpenFlipperSettings().
value(defaultRendererKey,
"Default Classical Renderer Plugin").toString();
569 int defaultRendererId = renderManager().
getRendererId(defaultRendererName);
571 if ( defaultRendererId == -1 ) {
572 emit
log(
LOGERR,tr(
"Stored default renderer \"") + defaultRendererName + tr(
"\" is not available, trying Classical!"));
575 defaultRendererId = renderManager().
getRendererId(
"Default Classical Renderer Plugin");
578 if ( defaultRendererId != -1 ) {
579 renderManager().
setActive(defaultRendererId,i);
581 emit
log(
LOGERR,tr(
"Default classical renderer is also not available. Trying to use any other renderer i can find!"));
584 const unsigned int rendererCount = renderManager().
available();
585 emit
log(
LOGERR,tr(
"Currently ") + QString::number(rendererCount) + tr(
" renderers are available:") );
586 for (
unsigned int i = 0 ; i < rendererCount ; ++i )
587 emit
log(
LOGERR, tr(
"Renderer ") + QString::number(i) +
": " + renderManager()[i]->name );
591 renderManager().
setActive(defaultRendererId,i);
597 if ( renderManager().available() == 1 ) {
599 emit
log(
LOGERR,tr(
"No external plugin renderers available!"));
600 emit
log(
LOGERR,tr(
"The build in renderer is only a very limited one and is missing many features!"));
601 emit
log(
LOGERR,tr(
"You should build and use the other renderers!"));
603 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."));
612 QStringList optionFiles = OpenFlipper::Options::optionFiles();
613 for (
int i = 0 ; i < (int)optionFiles.size(); ++i) {
616 splash_->showMessage(tr(
"Loading Configuration File %1/%2").arg(i+1).arg(optionFiles.size()),
617 Qt::AlignBottom | Qt::AlignLeft , Qt::white);
622 if ( OpenFlipper::Options::gui() )
635 if ( OpenFlipper::Options::lang().contains(
"UTF") || OpenFlipper::Options::lang().contains(
"utf") ) {
643 if ( OpenFlipper::Options::gui() ) {
645 QFile statesFile(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"WindowStates.dat");
647 if (statesFile.exists() ) {
648 QSettings windowStates(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"WindowStates.dat", QSettings::IniFormat);
651 coreWidget_->restoreState (windowStates.value(
"Core/Window/State").toByteArray ());
653 coreWidget_->restoreGeometry (windowStates.value(
"Core/Window/Geometry").toByteArray ());
662 windowStates.beginGroup (
"Core");
663 windowStates.beginGroup (
"LogSlider");
665 windowStates.endGroup ();
667 windowStates.endGroup ();
671 if ( windowStates.value(
"Core/Window/WindowState",
false).toBool() )
684 splash_->showMessage(tr(
"Ready."), Qt::AlignBottom | Qt::AlignLeft , Qt::white);
694 OpenFlipper::Options::finishedStartup();
712 for ( uint i = 0 ; i <
loggers_.size(); ++i )
721 return PluginStorage::plugins();
734 if(_event->button() != Qt::LeftButton)
return;
736 const QObject* senderPointer = sender();
737 unsigned int examinerId = 0;
739 if ( senderPointer == 0 ) {
740 std::cerr <<
"Error : slotMouseEventIdentify directly called! This should only be called by an examiner" << std::endl;
742 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
745 if ( OpenFlipper::Options::doSlotDebugging() )
746 emit
log(
LOGINFO,tr(
"slotMouseEventIdentify from examiner ") + QString::number(i) );
756 size_t node_idx, target_idx;
766 infoPlugin = getInfoPlugin(object->
dataType());
778 const QObject* senderPointer = sender();
779 unsigned int examinerId = 0;
781 if ( senderPointer == 0 ) {
782 std::cerr <<
"Error : slotMouseEventLight directly called! This should only be called by an examiner" << std::endl;
784 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
787 if ( OpenFlipper::Options::doSlotDebugging() )
788 emit
log(
LOGINFO,tr(
"slotMouseEventLight from examiner ") + QString::number(i) );
812 const QObject* senderPointer = sender();
813 unsigned int examinerId = 0;
815 if ( senderPointer == 0 ) {
816 std::cerr <<
"Error : slotMouseEvent directly called! This should only be called by an examiner" << std::endl;
818 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
821 if ( OpenFlipper::Options::doSlotDebugging() ) {
822 QString message = tr(
"slotMouseEvent from examiner ") + QString::number(i) +
" with ";
824 if ( _event->type() == QEvent::MouseButtonRelease )
825 message +=
" MouseButtonRelease";
826 else if ( _event->type() == QEvent::MouseButtonPress )
827 message +=
" MouseButtonRelease";
828 else if ( _event->type() == QEvent::MouseButtonDblClick )
829 message +=
" MouseButtonDblClick";
830 else if ( _event->type() == QEvent::MouseMove )
831 message +=
" MouseMove";
833 message += tr(
"unknown event type");
855 const QObject* senderPointer = sender();
856 unsigned int examinerId = 0;
858 if ( senderPointer == 0 ) {
859 std::cerr <<
"Error : slotWheelEvent directly called! This should only be called by an examiner" << std::endl;
861 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
879 if ( OpenFlipper::Options::gui() )
889 if ( OpenFlipper::Options::gui() )
901 if (OpenFlipper::Options::doSlotDebugging()) {
903 if (sender()->metaObject() != 0) {
904 emit
log(
LOGINFO, tr(
"updateView() called by ") + QString(sender()->metaObject()->className()));
909 if (!OpenFlipper::Options::gui())
916 if (elapsed < 1000 /
OpenFlipperSettings().value(
"Core/Gui/glViewer/maxFrameRate", 35).toInt()) {
919 if (OpenFlipper::Options::doSlotDebugging())
921 tr(
"Too early for redraw! Delaying request from ") + QString(sender()->metaObject()->className()));
935 if (!OpenFlipper::Options::sceneGraphUpdatesBlocked() && !OpenFlipper::Options::redrawDisabled()) {
937 for (
unsigned int i = 0; i < OpenFlipper::Options::examinerWidgets(); ++i)
950 QApplication::processEvents();
957 OpenFlipper::Options::blockSceneGraphUpdates();
959 OpenFlipper::Options::unblockSceneGraphUpdates();
974 if ( action.isDirty () )
1013 QTimer* timer =
new QTimer();
1014 connect(timer, SIGNAL(timeout()),
this, SLOT(
slotExit()));
1018 QApplication::quit();
1024 if ( OpenFlipper::Options::gui() )
1031 if ( OpenFlipper::Options::gui() ) {
1040 if ( OpenFlipper::Options::gui() &&
1041 (state == OpenFlipper::Options::Hidden ||
1042 state == OpenFlipper::Options::InScene ||
1043 state == OpenFlipper::Options::Normal))
1050 std::cerr <<
"Script" << std::endl;
1059 if ( OpenFlipper::Options::gui() ) {
1073 if ( OpenFlipper::Options::gui() )
1080 if ( OpenFlipper::Options::gui() )
1087 if ( !OpenFlipper::Options::gui() || !
OpenFlipperSettings().value(
"Core/Gui/glViewer/useMultipleViewers",
true).toBool() )
1108 QString actionTypeName = _action->data().toString();
1111 for (
int i = 0 ; i < recentFiles.size() ; ++i )
1114 if ( (recentFiles[i] == _action->text()) && ( actionTypeName == recentTypes[i] ) ){
1116 OpenFlipper::Options::loadingRecentFile(
true);
1119 OpenFlipper::Options::loadingRecentFile(
false);
1124 emit
log(
LOGERR, tr(
"Unable to open recent. Unable to find %1 with datatype %2 in recent files list.").arg(_action->text()).arg(actionTypeName) );
1132 QString inifile = OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"OpenFlipper.ini";
1136 if ( ! ini.
connect( inifile,
true) ) {
1137 emit
log(
LOGERR,tr(
"Can not create user ini file"));
1145 if ( OpenFlipper::Options::gui() ) {
1147 QSettings windowStates(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"WindowStates.dat", QSettings::IniFormat);
1149 windowStates.setValue(
"Core/Window/State",
coreWidget_->saveState ());
1150 windowStates.setValue(
"Core/Window/Geometry",
coreWidget_->saveGeometry ());
1151 windowStates.setValue(
"Core/Window/WindowState",
coreWidget_->isMaximized() );
1156 windowStates.beginGroup (
"Core");
1157 windowStates.beginGroup (
"LogSlider");
1159 windowStates.endGroup ();
1161 windowStates.endGroup ();
1177 for ( uint i = 0 ; i <
plugins().size() ; ++i ){
1194 OpenFlipper::Options::closeSettings();
1198 if(OpenFlipper::Options::deleteIniFile()) {
1199 bool success =
true;
1202 QStringList optionFiles = OpenFlipper::Options::optionFiles();
1203 for (
int i = 0 ; i < (int)optionFiles.size(); ++i) {
1204 success &= QFile::remove(optionFiles[i]);
1208 QMessageBox::warning(0, tr(
"Warning"),
1209 tr(
"One or more files could not be removed.\nDelete files manually."),
1235 qApp->exit(EXIT_FAILURE);
1255 QFileInfo fi( fileName );
1257 if ( fileName ==
"" || !fi.dir().exists() ) {
1258 OpenFlipperSettings().
setValue(
"Core/Log/logFile", OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"OpenFlipper.log");
1262 if (
logFile_->open(QFile::WriteOnly) ) {
1265 emit
log(
LOGERR, tr(
"Unable to open logfile!"));
1272 (*logStream_) <<
"INFO:";
break;
1274 (*logStream_) <<
"OUT :";
break;
1276 (*logStream_) <<
"WARN:";
break;
1278 (*logStream_) <<
"ERR :";
break;
1280 (*logStream_) <<
"STAT:";
break;
1283 (*logStream_) << _message <<
"\n" << flush;
1289 QStringList _parameters, QStringList _descriptions)
1292 if (sender() ==
this){
1294 info.slotName = _slotName;
1295 info.slotDescription = _slotDescription;
1296 info.parameters = _parameters;
1297 info.descriptions = _descriptions;
1308 for (uint i=0; i <
plugins().size(); i++)
1309 if (
plugins()[i].plugin == sender())
1312 if (pluginInfo == 0){
1313 emit
log(
LOGERR, tr(
"Unable to set slot-description. Plugin not found!"));
1318 info.slotName = _slotName;
1319 info.slotDescription = _slotDescription;
1320 info.parameters = _parameters;
1321 info.descriptions = _descriptions;
1328 QStringList _parameters, QStringList _descriptions)
1331 info.slotName = _functionName;
1332 info.slotDescription = _slotDescription;
1333 info.parameters = _parameters;
1334 info.descriptions = _descriptions;
1341 QStringList& _parameters, QStringList& _descriptions )
1343 QString pluginName = _function.section(
".", 0, 0);
1344 QString slotName = _function.section(
".", 1, 1);
1347 if ( !_function.contains(
".") ) {
1350 slotName = pluginName;
1365 if (pluginName ==
"core"){
1367 _fnDescription =
"";
1368 _parameters.clear();
1369 _descriptions.clear();
1373 _fnDescription =
coreSlots_[i].slotDescription;
1386 for (uint i=0; i <
plugins().size(); i++)
1387 if (
plugins()[i].rpcName == pluginName)
1390 if (pluginInfo == 0){
1391 emit
log(
LOGERR, tr(
"Unable to get slot-description. Plugin not found!"));
1395 _fnDescription =
"";
1396 _parameters.clear();
1397 _descriptions.clear();
1400 for (
int i=0; i < pluginInfo->
slotInfos.count(); i++)
1401 if (pluginInfo->
slotInfos[i].slotName == slotName){
1402 _fnDescription = pluginInfo->
slotInfos[i].slotDescription;
1403 _parameters = pluginInfo->
slotInfos[i].parameters;
1404 _descriptions = pluginInfo->
slotInfos[i].descriptions;
1411 if ( OpenFlipper::Options::gui() ) {
1412 if ( _viewerId >= OpenFlipper::Options::examinerWidgets() ) {
1413 emit
log(
LOGERR,tr(
"Unable to snapshotBaseFileName 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) );
1438 if ( OpenFlipper::Options::gui() ) {
1439 if ( _viewerId >= OpenFlipper::Options::examinerWidgets() ) {
1440 emit
log(
LOGERR,tr(
"Unable to snapshotFileType for viewer ") + QString::number(_viewerId) );
1449 void Core::snapshot(
unsigned int _viewerId,
int _width,
int _height,
bool _alpha,
bool _hideCoordsys,
int _numSamples ){
1452 if ( OpenFlipper::Options::gui() ) {
1453 if ( _viewerId >= OpenFlipper::Options::examinerWidgets() ) {
1454 emit
log(
LOGERR,tr(
"Unable to create snapshot for viewer ") + QString::number(_viewerId) );
1464 if ( OpenFlipper::Options::gui() )
1470 if ( OpenFlipper::Options::gui() )
1476 if ( OpenFlipper::Options::gui() )
1481 bool comments_visible_only,
bool comments_targeted_only,
1482 bool store_material_info,
int snapshot_width,
int snapshot_height,
1483 bool snapshot_transparent,
bool hide_coord_sys,
1484 int snapshot_multisampling,
bool store_view) {
1486 if ( OpenFlipper::Options::gui() )
1488 comments_visible_only, comments_targeted_only,
1489 store_material_info, snapshot_width, snapshot_height,
1490 snapshot_transparent, hide_coord_sys, snapshot_multisampling,
1496 if ( OpenFlipper::Options::gui() ){
1507 if ( OpenFlipper::Options::gui() ){
1520 if ( ! ini.
connect(_filename,
true) ) {
1521 emit
log(
LOGERR,tr(
"Failed to connect to _ini file") + _filename);
1526 if ( OpenFlipper::Options::isWindows() )
1527 ini.
add_entry(
"Core" ,
"VersionWindows" , OpenFlipper::Options::coreVersion() );
1529 ini.
add_entry(
"Core" ,
"VersionLinux" , OpenFlipper::Options::coreVersion() );
1532 for (uint i=0; i <
plugins().size(); i++){
1534 if ( OpenFlipper::Options::isWindows() )
1549 foreach (QString s, _types)
1553 if (_selection ==
"source")
1555 else if (_selection ==
"target")
1560 rv.append (o_it->id ());
1570 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(
";")));
1574 emit
setSlotDescription(
"deleteObject(int)", tr(
"Delete an object from the scene."), QStringList(
"ObjectId"), QStringList(tr(
"Id of the object to delete")));
1575 emit
setSlotDescription(
"updateView()", tr(
"Redraw the contents of the viewer."), QStringList(), QStringList());
1576 emit
setSlotDescription(
"clearAll()", tr(
"Clear all data objects."), QStringList(), QStringList());
1577 emit
setSlotDescription(
"exitApplication()", tr(
"Quit OpenFlipper"), QStringList(), QStringList());
1579 QStringList(tr(
"enabled")) ,
1580 QStringList(tr(
"Enable or disable fullscreen mode")));
1581 emit
setSlotDescription(
"showViewModeControls(bool)", tr(
"Show or hide the view mode control box"),
1582 QStringList(tr(
"Show?")) ,
1584 emit
setSlotDescription(
"loggerState(int)", tr(
"Change the logger window state"), QStringList(tr(
"Change the logger window state")), QStringList());
1585 emit
setSlotDescription(
"enableOpenMeshErrorLog(bool)", tr(
"Enable or disable OpenMesh error logging"), QStringList(tr(
"OpenMesh error logging enabled")), QStringList());
1586 emit
setSlotDescription(
"showToolbox(bool)", tr(
"Show or hide toolbox"), QStringList(tr(
"Show or hide the toolbox")), QStringList());
1587 emit
setSlotDescription(
"showStatusBar(bool)", tr(
"Show or hide status bar"), QStringList(tr(
"Show or hide the status bar")), QStringList());
1589 QStringList(tr(
"Mode")), QStringList(tr(
"0: One Viewer\n1: Double Viewer\n2: Grid \n3: Horizontal split ")));
1591 emit
setSlotDescription(
"restrictFrameRate(bool)", tr(
"Restrict FrameRate to MaxFrameRate"),
1592 QStringList(tr(
"enabled")), QStringList(tr(
"restriction switch")));
1593 emit
setSlotDescription(
"setMaxFrameRate(int)", tr(
"set the maximal framerate (automatically enables framerate restriction)"),
1594 QStringList(tr(
"frameRate")), QStringList(tr(
"Maximum frameRate")));
1595 emit
setSlotDescription(
"snapshotBaseFileName(QString)", tr(
"Set a filename for storing snapshots.")
1596 , QStringList(), QStringList());
1597 emit
setSlotDescription(
"snapshotFileType(QString)", tr(
"Set a filetype for storing snapshots.")
1598 , QStringList(), QStringList());
1599 emit
setSlotDescription(
"snapshotCounterStart(int)", tr(
"Set the starting number for the snapshot counter.")
1600 , QStringList(
"StartValue"), QStringList(
"Starting number for the counter"));
1601 emit
setSlotDescription(
"snapshot()", tr(
"Make a snapshot of the viewer. If no filename" 1602 " was set using snapshotBaseFileName() the snapshot is stored" 1603 " in snap.png in the current directory. The captured image will have " 1604 " the same dimensions as the current viewport. " 1605 "For every snapshot a counter is added to the filename."), QStringList(), QStringList());
1606 emit
setSlotDescription(
"snapshot(uint)", tr(
"Make a snapshot of the viewer with id viewerId. If no filename" 1607 " was set using snapshotBaseFileName() the snapshot is stored" 1608 " in snap.png in the current directory. For every snapshot" 1609 " a counter is added to the filename."), QStringList(
"viewerId"), QStringList(
"Id of viewer to be captured (default is 0)"));
1610 emit
setSlotDescription(
"snapshot(uint,int,int)", tr(
"Make a snapshot of the viewer with id viewerId." 1611 " Pass 0 as viewerId parameter to capture the current viewer. " 1612 " The captured image will have the specified dimensions. " 1613 " If 0 is passed as either width or height parameter, the value will " 1614 " automatically be set to hold the right aspect ratio, respectively. " 1615 " If no filename was set using snapshotBaseFileName() the snapshot is stored" 1616 " in snap.png in the current directory. For every snapshot" 1617 " a counter is added to the filename."), QStringList(QString(
"viewerId;width;height").split(
";")),
1618 QStringList(QString(
"Id of viewer (default is 0);Width of image;Height of image").split(
";")));
1619 emit
setSlotDescription(
"snapshot(uint,int,int,bool)", tr(
"Make a snapshot of the viewer with id viewerId." 1620 " Pass 0 as viewerId parameter to capture the current viewer. " 1621 " The captured image will have the specified dimensions. " 1622 " If 0 is passed as either width or height parameter, the value will " 1623 " automatically be set to hold the right aspect ratio, respectively. " 1624 " If 0 is passed for both width and height values, the viewport's current " 1625 " dimension is used. Set alpha to true if you want the background to be transparent. " 1626 " If no filename was set using snapshotBaseFileName() the snapshot is stored" 1627 " in snap.png in the current directory. For every snapshot" 1628 " a counter is added to the filename."), QStringList(QString(
"viewerId;width;height;alpha").split(
";")),
1629 QStringList(QString(
"Id of viewer (default is 0);Width of image;Height of image;Transparent background").split(
";")));
1630 emit
setSlotDescription(
"snapshot(uint,int,int,bool,bool)", tr(
"Make a snapshot of the viewer with id viewerId." 1631 " Pass 0 as viewerId parameter to capture the current viewer. " 1632 " The captured image will have the specified dimensions. " 1633 " If 0 is passed as either width or height parameter, the value will " 1634 " automatically be set to hold the right aspect ratio, respectively. " 1635 " If 0 is passed for both width and height values, the viewport's current " 1636 " dimension is used. Set alpha to true if you want the background to be transparent. " 1637 " The fifth parameter is used to hide the coordinate system in the upper right corner of the screen. " 1638 " If no filename was set using snapshotBaseFileName() the snapshot is stored" 1639 " in snap.png in the current directory. For every snapshot" 1640 " a counter is added to the filename."), QStringList(QString(
"viewerId;width;height;alpha;hideCoordsys").split(
";")),
1641 QStringList(QString(
"Id of viewer (default is 0);Width of image;Height of image;Transparent background;Hide coordsys node").split(
";")));
1642 emit
setSlotDescription(
"snapshot(uint,int,int,bool,bool,int)", tr(
"Make a snapshot of the viewer with id viewerId." 1643 " Pass 0 as viewerId parameter to capture the current viewer. " 1644 " The captured image will have the specified dimensions. " 1645 " If 0 is passed as either width or height parameter, the value will " 1646 " automatically be set to hold the right aspect ratio, respectively. " 1647 " If 0 is passed for both width and height values, the viewport's current " 1648 " dimension is used. Set alpha to true if you want the background to be transparent. " 1649 " The fifth parameter is used to hide the coordinate system in the upper right corner of the screen. " 1650 " If no filename was set using snapshotBaseFileName() the snapshot is stored" 1651 " in snap.png in the current directory. For every snapshot" 1652 " a counter is added to the filename."), QStringList(QString(
"viewerId;width;height;alpha;hideCoordsys;numSamples").split(
";")),
1653 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(
";")));
1655 QString(tr(
"width,height")).split(
","),
1656 QString(tr(
"new width for the viewer,new height for the viewer")).split(
","));
1657 emit
setSlotDescription(
"writeVersionNumbers(QString)", tr(
"write the current versions of all plugins to INI file"),
1658 QStringList(tr(
"filename")),
1659 QStringList(tr(
"fullpath to a file where the versions should be written to.")));
1661 emit
setSlotDescription(
"saveObject(int,QString)", tr(
"Save object to file. If the file exists it will be overwritten."),
1662 QString(tr(
"object-id,filename")).split(
","),
1663 QString(tr(
"id of the object, complete path and filename")).split(
","));
1664 emit
setSlotDescription(
"saveObjectTo(int,QString)", tr(
"Save object to file. The location can be chosen in a dialog. " 1665 "(only works if GUI is available)"),
1666 QString(tr(
"object-id,filename")).split(
","),
1667 QString(tr(
"id of the object, initial filename for the dialog")).split(
","));
1669 "If no filename is available a dialog is shown. (only works if GUI is available)"),QStringList(), QStringList());
1670 emit
setSlotDescription(
"saveAllObjectsTo()", tr(
"Saves all target objects. The locations can be chosen in dialogs. " 1671 "(only works if GUI is available)"),QStringList(), QStringList());
1672 emit
setSlotDescription(
"saveSettings()", tr(
"Show the dialog to save the current setting. (only works if GUI is available)"),QStringList(), QStringList());
1673 emit
setSlotDescription(
"saveSettings(QString, bool, bool, bool, bool, bool, bool)", tr(
"Save the current setting to the supplied file."),
1674 QStringList(tr(
"filePath,is_saveObjectInfo,is_targetOnly,is_saveAll,is_askOverwrite,is_saveProgramSettings,is_savePluginSettings").split(
",")),
1675 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(
";")));
1677 emit
setSlotDescription(
"loadObject()", tr(
"Show the dialog to load an object. (only works if GUI is available)"),QStringList(), QStringList());
1678 emit
setSlotDescription(
"loadObject(QString)", tr(
"Load an object specified in file filename. This automatically determines which file plugin to use."),
1679 QStringList(tr(
"filename")), QStringList(tr(
"Filename")));
1680 emit
setSlotDescription(
"getObjectId(QString)", tr(
"Return identifier of object with specified name. Returns -1 if object was not found."),QStringList(), QStringList());
1681 emit
setSlotDescription(
"loadSettings()", tr(
"Show the dialog to load settings. (only works if GUI is available)"),QStringList(), QStringList());
1682 emit
setSlotDescription(
"loadSettings(QString)", tr(
"load settings from file."),QStringList(), QStringList());
1684 emit
setSlotDescription(
"createWidget(QString,QString)", tr(
"Create a widget from an ui file"),
1685 QString(tr(
"Object name,ui file")).split(
","),
1686 QString(tr(
"Name of the new widget in script,ui file to load")).split(
","));
1688 emit
setSlotDescription(
"addToolbox(QString,QWidget*)", tr(
"Add a widget as a toolbox"),
1689 QString(tr(
"Toolbox Entry name,Widget")).split(
","),
1690 QString(tr(
"Name of the new widget in the toolbox,Pointer to the new widget")).split(
","));
1692 emit
setSlotDescription(
"addToolbox(QString,QWidget*,QIcon*)", tr(
"Add a widget as a toolbox"),
1693 QString(tr(
"Toolbox Entry name,Widget,Icon")).split(
","),
1694 QString(tr(
"Name of the new widget in the toolbox,Pointer to the new widget,Pointer to icon")).split(
","));
1696 emit
setSlotDescription(
"serializeMaterialProperties(int)", tr(
"Serialize and return the material properties of the supplied object."),
1697 QString(tr(
"ObjectId")).split(
","),
1698 QString(tr(
"ID of the object")).split(
","));
1700 emit
setSlotDescription(
"deserializeMaterialProperties(int, QString)", tr(
"Deserialize the supplied material properties into the supplied object."),
1701 QString(tr(
"ObjectId, SerializedProps")).split(
","),
1702 QString(tr(
"ID of the object,The serialized material properties.")).split(
","));
1704 emit
setSlotDescription(
"addViewModeToolboxes(QString,QString)", tr(
"Set toolboxes for a viewmode (This automatically adds the view mode if it does not exist)"),
1705 QString(tr(
"Name,Toolbox List")).split(
","),
1706 QString(tr(
"Name of the Viewmode,seperated list of toolboxes visible in this viewmode")).split(
","));
1708 emit
setSlotDescription(
"addViewModeToolbars(QString,QString)", tr(
"Set toolbars for a viewmode (This automatically adds the view mode if it does not exist)"),
1709 QString(tr(
"Name,Toolbar List")).split(
","),
1710 QString(tr(
"Name of the Viewmode,seperated list of toolbars visible in this viewmode")).split(
","));
1712 emit
setSlotDescription(
"addViewModeContextMenus(QString,QString)", tr(
"Set context Menus for a viewmode (This automatically adds the view mode if it does not exist)"),
1713 QString(tr(
"Name,Context Menu List")).split(
","),
1714 QString(tr(
"Name of the Viewmode,seperated list of Context Menus visible in this viewmode")).split(
","));
1716 emit
setSlotDescription(
"addViewModeIcon(QString,QString)", tr(
"Set Icon for a viewmode (This automatically adds the view mode if it does not exist)"),
1717 QString(tr(
"Name,Icon filename")).split(
","),
1718 QString(tr(
"Name of the Viewmode,filename of the icon (will be taken from OpenFlippers icon directory)")).split(
","));
1720 emit
setSlotDescription(
"objectList(QString,QStringList)", tr(
"Returns object list"),
1721 QString(tr(
"Selection type,Object types")).split(
","),
1722 QString(tr(
"Type of object selection (all,source,target),Object type (All,PolyMesh,TriangleMesh,...)")).split(
";"));
1724 emit
setSlotDescription(
"setToolBoxSide(QString)", tr(
"Determine whether the toolboxes should be displayed on the right or on the left side."),
1725 QStringList(tr(
"side")), QStringList(tr(
"The desired side of the toolboxes (either 'left' or 'right')")));
1727 emit
setSlotDescription(
"getToolbox(QString,QString)", tr(
"Returns a pointer to the requested toolbox widget if it was found, nullptr, otherwise."),
1728 tr(
"Plugin Name\rToolbox Name").split(
"\r"),
1729 tr(
"The plugin which the requested toolbox belongs to.\rThe name of the requested toolbox.").split(
"\r"));
1731 emit
setSlotDescription(
"blockSceneGraphUpdates()", tr(
"Disable Scenegraph Updates (e.g. before loading or adding a large number of files)"),QStringList(), QStringList());
1732 emit
setSlotDescription(
"unblockSceneGraphUpdates()", tr(
"Enable Scenegraph Updates (e.g. before loading or adding a large number of files)"),QStringList(), QStringList());
1733 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.)")));
1746 std::cerr <<
"Error while deleting object, does not exist!!" << std::endl;
1753 object->deleteSubtree();
1756 object->parent()->removeChild(
object);
1767 if ( _objId == -1 )
return;
1772 std::cerr <<
"No such object." << std::endl;
1778 std::cerr <<
"No suitable object found." << std::endl;
1786 if ( _objId == -1 )
return QString();
1791 std::cerr <<
"No such object." << std::endl;
1797 std::cerr <<
"No suitable object found." << std::endl;
1806 if ( _id == -1 )
return;
1811 std::cerr <<
"No such object." << std::endl;
1819 if ( _id == -1 )
return;
1824 std::cerr <<
"No such object." << std::endl;
1832 if ( _id == -1 )
return;
1837 std::cerr <<
"No such object." << std::endl;
1848 std::vector< int > ids;
1853 ids.push_back( current->
id() );
1854 current = current->
next();
1857 for ( uint i = 0 ; i < ids.size(); ++i ) {
1878 QString qtCompiledVersion = QString( QT_VERSION_STR );
1879 QString qtCurrentVersion = qVersion();
1881 if ( qtCompiledVersion != qtCurrentVersion ) {
1882 messages += tr(
"QT Library Version mismatch!\n");
1884 messages += tr(
"Currently used QT Version:\t") + qVersion() +
"\n";
1885 messages += tr(
"Link time QT Version:\t\t") + QString( QT_VERSION_STR ) +
"\n";
1886 messages += tr(
"This inconsistency may lead to an unstable behavior of OpenFlipper!");
1892 QString message = tr(
"Error! Library tests failed!\n");
1893 message += tr(
"The following problems have been found:\n\n");
1895 message += messages;
1897 std::cerr << message.toStdString() << std::endl;
1899 if ( OpenFlipper::Options::gui() ) {
1901 StaysOnTopMessageBox::critical ( 0, tr(
"Library incompatibilities found!"),message );
1907 }
else if ( warn ) {
1909 QString message = tr(
"Warning! The OpenGL capabilities of your current machine/driver could be insufficient!\n\n");
1910 message += tr(
"The following checks failed:\n\n");
1911 message += messages;
1913 std::cerr << message.toStdString() << std::endl;
1915 if ( OpenFlipper::Options::gui() ) {
1917 StaysOnTopMessageBox::warning ( 0, tr(
"Library incompatibilities found!"),message );
1923 std::cerr <<
"Library Check succeeded" << std::endl;
1937 if ( OpenFlipper::Options::nogui() )
1946 QOpenGLContext* context = QOpenGLContext::currentContext();
1950 QSurfaceFormat format = context->format();
1952 if ( (format.majorVersion() < 2) ) {
1955 missing += tr(
"OpenGL Version less then 2.0!\n");
1961 missing += tr(
"No OpenGL support found!\n");
1966 QString message = tr(
"Error! \nThe OpenGL capabilities of your current machine/driver are not sufficient!\n\n");
1967 message += tr(
"The following checks failed:\n\n");
1969 message += tr(
"\n\nPlease update your driver or graphics card.\n");
1971 message += tr(
"If you have more than one GPU (e.g. MacBook) don't use the internal one!\n");
1974 std::cerr << message.toStdString() << std::endl;
1978 QMessageBox::StandardButton button = StaysOnTopMessageBox::critical ( 0, tr(
"Insufficient OpenGL Capabilities!"),message,QMessageBox::Abort|QMessageBox::Ignore , QMessageBox::Abort);
1981 if ( button == QMessageBox::Abort )
1984 StaysOnTopMessageBox::warning(0,tr(
"Insufficient OpenGL Capabilities!"),tr(
"Ignoring OpenGL capabilities might lead to unstable Operation! Do it at your own risk!"));
1989 }
else if ( warn ) {
1991 QString message = tr(
"Warning! Automatic system environment checks discovered some possible problems!\n\n");
1992 message += tr(
"The following checks failed:\n\n");
1995 std::cerr << message.toStdString() << std::endl;
1997 StaysOnTopMessageBox::warning ( 0, tr(
"Detected possible problems!"),message );
2002 std::cerr <<
"OpenGL Version Check succeeded" << std::endl;
void clearObjectComment(int objId, QString key)
Called when a plugin requests an update in the viewer.
void setViewMode(QString _mode, bool _expandAll=false)
Set the view Mode to the given Mode.
QStringList scriptingFunctions_
List of all registered scripting functions.
LoggerWidget * logWidget_
Textedit at the bottom for log messages.
size_t available()
number of available renderers
DLLEXPORT OpenFlipperQSettings & OpenFlipperSettings()
QSettings object containing all program settings of OpenFlipper.
void pluginSceneDrawn()
This signal is emitted after the scene has been drawn.
ACG::SceneGraph::CoordinateSystemNode CoordsysNode
Simple Name for CoordsysNode.
void fullscreen(bool _state)
set fullscreen mode
Execute action on node first and then on its children.
void slotAddEmptyObjectMenu()
Open the add Empty dialog.
void saveSettings()
Save current status to a settings file. Solicit file name through dialog.
ACG::SceneGraph::MaterialNode MaterialNode
Materialnode.
QString serializeMaterialProperties(int _objId)
Serialize material properties.
void slotSetSlotDescriptionGlobalFunction(QString _functionName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
set a description for a global scripting function
ACG::SceneGraph::CoordsysNode * coordsysNode_
Node for the coordinate system.
void slotGetDescription(QString _function, QString &_fnDescription, QStringList &_parameters, QStringList &_descriptions)
get available descriptions for a given public slot
BaseObject * childExists(int _objectId)
Check if the element exists in the subtree of this element.
bool custom
Is this a user defined custom view mode or a plugin generated one.
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)
Logtype
Log types for Message Window.
void applicationSnapshotName(QString _name)
Set the snapshot name.
void loggerState(int _state)
Change the logging window state.
QSplitter * splitter_
Spliter between toplevel objects and the textedit at the bottom.
QScriptValue printToFileFunction(QScriptContext *context, QScriptEngine *engine)
Special print function for sending output to a file.
SeparatorNode * dataSeparatorNode_
Toplevel Nodes for data objects.
LoggerState
State of the logging widget.
void showReducedMenuBar(bool reduced)
Core scripting engine.
bool scenegraphPick(ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, size_t &_nodeIdx, size_t &_targetIdx, ACG::Vec3d *_hitPointPtr=0)
Execute picking operation on scenegraph.
void checkScenegraphDirty()
Called to check if the scenegraph needs to be redrawn.
Draw node in second pass.
pick any of the prior targets (should be implemented for all nodes)
QTextStream * logStream_
stream for logging to file
void showViewModeControls(bool _show)
Hide or show the View Mode controls.
void addPickMode(const std::string &_name, bool _mouse_tracking=false, int _pos=-1, bool _visible=true, QCursor _cursor=Qt::ArrowCursor)
add pick mode
QString & getCommentByKey(const QString &key)
Get comment for the specified key.
Interface class for providing information on objects.
void saveState(QSettings &_settings)
saves the current state
bool checkSignal(QObject *_plugin, const char *_signalSignature)
Check if a plugin has a signal.
void setDescriptions()
set the descriptions for scriptable slots of the core
void slotShowPlugins()
Show Plugins Dialog.
QList< SlotInfo > slotInfos
This list contains Descriptions about public slots if available.
void slotMouseEvent(QMouseEvent *_event)
Gets called by examiner widget when mouse is moved in picking mode.
void stopVideoCapture()
Stop video capturing.
void deserializeMaterialProperties(int _objId, QString _props)
Serialize material properties.
int lastWidth_
Slot called everytime the view is updated.
void slotSetSlotDescription(QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
set a description for one of the plugin's public slots
const QStringList SOURCE_OBJECTS("source")
Iterable object range.
MaterialNode * materialNode()
get a pointer to the materialnode
bool getPickedObject(const size_t _node_idx, BaseObjectData *&_object)
Get the picked mesh.
SeparatorNode * root_node_scenegraph_
Scenegraphs root node.
void openIniFile(QString _filename, bool _coreSettings, bool _perPluginSettings, bool _loadObjects)
Load information from an ini file.
QSplashScreen * splash_
SplashScreen, only used in gui mode.
void addRecent(QString _filename, DataType _type)
Add a recent file and update menu.
prototypeDataType DataTypePrototype_
Prototype for the DataType.
void slotRegisterSlotKeyBindings()
register scripting slots to allow keyBindings
QString name
Name of the View Mode.
void setViewerProperties(std::vector< Viewer::ViewerProperties * > _viewerProperties)
Set the internal viewerProperties pointer ( DO NOT USE!! )
void slotExit()
Exit Application.
void updateRecent()
Update the recent files menu.
void deletedObject(int _objectId)
This slot is called by the object manager when an object is deleted.
void viewUpdated()
Slot called everytime the view is updated.
void setSceneGraphRootNodeGlobal(SeparatorNode *_root_node)
void resizeApplication(int _width, int _height)
resize the whole Application
void setDataSeparatorNodes(SeparatorNode *_dataSeparatorNode)
Set the internal data root node pointers ( DO NOT USE!! )
void showReducedMenuBar(bool reduced)
typedefs
void setValue(const QString &key, const QVariant &value)
Wrapper function which makes it possible to enable Debugging output with -DOPENFLIPPER_SETTINGS_DEBUG...
void slotAddPickMode(const std::string &_mode)
Add a new picking mode to the examiner_widget_.
void slotScriptError(const QScriptValue &error)
Core scripting engine.
bool dataType(DataType _type) const
void setObjectComment(int objId, QString key, QString comment)
Called when a plugin requests an update in the viewer.
const QStringList TARGET_OBJECTS("target")
Iterable object range.
QStringList IteratorRestriction
Iterable object range.
SideArea * toolBox_
Toolbox.
void snapshotBaseFileName(QString _fname, unsigned int _viewerId=0)
SeparatorNode * dataRootNode_
Root Node for data objects.
void log(Logtype _type, QString _message)
Logg with OUT,WARN or ERR as type.
void snapshotFileType(const QString &_type)
void slotDeleteAllObjects()
Called when a plugin wants to delete all objects.
void saveAllObjects()
Slot for saving objects from Menu.
bool connect(const QString &name, const bool create)
Connect INIFile object with given filename.
void setViewerLayout(int _idx)
Change viewer layout that was selected in the combo box.
void setSceneGraphRootNode(SeparatorNode *_root_node)
CoreWidget * coreWidget_
The main applications widget ( only created in gui mode )
void viewerSnapshot()
Take a snapshot from all viewers.
void finishSplash()
exit the current application
QWidget * getToolboxArea()
Show logger in splitter or not.
const QStringList ALL_OBJECTS
Iterable object range.
void setActiveExaminer(const unsigned int _id)
Set the active id of the examiner which got the last mouse events.
void snapshot(unsigned int _viewerId=0, int _width=0, int _height=0, bool _alpha=false, bool _hideCoordsys=false, int _numSamples=1)
QScriptEngine scriptEngine_
Core scripting engine.
void slotAddHiddenPickMode(const std::string &_mode)
Add a new and invisible picking mode to the examiner_widget_.
void clearComment(const QString &key)
Get comment for the specified key.
SideArea * getToolbox()
Show logger in splitter or not.
QList< SlotInfo > globalFunctions_
Core scripting engine.
void showLogger(OpenFlipper::Options::LoggerState _state)
Change visibility of the logger.
SeparatorNode * core_nodes_
Separator Node holding all core scenegraph nodes.
BaseObject * objectRoot_
Pointer to the data rootNode;.
void showStatusBar(bool _state)
Show or hide status bar.
void showToolbox(bool _state)
Show or hide toolbox.
void clearAll()
Clear all data objects.
void slotRecentOpen(QAction *_action)
Open Recent file.
void slotMouseEventLight(QMouseEvent *_event)
Handle Mouse events when in Light mode.
QTimer * redrawTimer_
If enabled, this timer will block screen refresh if done more then 30 times per second.
void deleteSubtree()
delete the whole subtree below this item ( The item itself is not touched )
Viewer::ViewerProperties & viewerProperties(int _id)
Get the viewer properties Use this functions to get basic viewer properties such as backgroundcolor o...
int lastHeight_
Slot called everytime the view is updated.
void writeVersionNumbers(QString _filename)
write the current versions of all plugins to ini file
void setupOptions()
Get all ini files and set basic paths and options.
std::vector< PluginInfo > & plugins()
Index of Plugins toolbox widget.
QScriptValue myPrintFunction(QScriptContext *context, QScriptEngine *engine)
Special print function for core logger.
void clearAllComments()
Get comment for the specified key.
void setTraverseMode(unsigned int _mode)
Set traverse mode for node.
void applicationSnapshotName(QString _name)
Set the baseName for the application snapshot.
prototypeMatrix4x4 matrix4x4Prototype_
Prototype for the Matrix type.
void blockScenegraphUpdates(bool _block)
Called when a plugin wants to lock or unlock scenegraph updates.
void PluginMouseEventLight(QMouseEvent *)
Emitted when an light event occurs.
void newObject(int _objectId)
This slot is called by the object manager when a new object is created.
void restoreState(QSettings &_settings)
restores the state
void multiViewMode(int _mode)
Switch the multiView Mode.
bool checkLibraryVersions()
Checks for library inconsistencies.
QStringList visibleToolboxes
List of Visible Toolboxes in this view mode.
Interface class from which all plugins have to be created.
ACG::SceneGraph::MaterialNode * coordsysMaterialNode_
Node for coordsys Material.
ViewMode struct This struct contains a ViewMode and its status information such as used widgets...
void loadObject()
Open Load Widget.
void setFullscreen(bool _state)
Enable or disable fullscreen mode.
void snapshotCounter(const int _counter)
void slotScriptInfo(QString _pluginName, QString _functionName)
Core scripting engine.
QTime * redrawTime_
Holds the time since last redraw.
void updateView()
Called when a plugin requests an update in the viewer.
void saveState(QSettings &_settings)
returns the current state
void applicationSnapshot()
Create a snapshot of the whole app.
void setActive(unsigned int _active, int _id)
set the active renderer
std::vector< PluginLogger * > loggers_
Logger interfaces between plugins and core logger.
void snapshotCounterStart(const int _counter, unsigned int _viewerId=0)
Set the start index for the snapshot counter.
QScriptValue helpFunction(QScriptContext *context, QScriptEngine *engine)
Function to print help about scripting functions.
void applicationSnapshot()
Take a snapshot from the whole app.
QtSlideWindow * slidingLogger_
Class that holds the animated log widget.
void restrictFrameRate(bool _enable)
Enable or disable framerate restriction.
void applyOptions()
after ini-files have been loaded and core is up or if options have been changed -> apply Options ...
void restoreKeyBindings()
Restore key assignments from configs files.
void add_entry(const QString &_section, const QString &_key, const QString &_value)
Addition / modification of a string entry.
void writeApplicationOptions(INIFile &_ini)
Write Application options to ini file.
void saveOptions()
Save the current options to the standard ini file.
void saveAllObjectsTo()
Slot for saving objects to a new location.
void enableOpenMeshErrorLog(bool _state)
Enable or disable OpenMesh error logging.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
#define TOSTRING(x)
QSettings object containing all program settings of OpenFlipper.
DLLEXPORT ObjectIterator objectsEnd()
Return Iterator to Object End.
void slotLogToFile(Logtype _type, QString _message)
log to file
prototypeVec3d vec3dPrototype_
Prototype for the Vector type.
void setDataRoot(BaseObject *_root)
void showToolbox(bool _state)
Show or hide toolbox.
void traverse(BaseNode *_node, Action &_action)
ACG::SceneGraph::Material & material()
Get material object reference.
void setMaxFrameRate(int _rate)
set the maximal framerate ( automatically enables framerate restriction )
void slotMouseEventIdentify(QMouseEvent *_event)
Handle Mouse events when in Identifier mode.
prototypeVec4d vec4dPrototype_
Prototype for the Vector type.
void loadPlugins()
Load all plugins from default plugin directory and from INI-File.
void loadSettings()
Load status from file.
void deleteObject(int _id)
Called to delete an object.
QScrollArea * getToolboxScrollArea()
Show logger in splitter or not.
int getRendererId(QString _name)
get renderer id with the given name
std::vector< glViewer *> examiner_widgets_
Examiner Widget.
SeparatorNode * root_node_scenegraph_global_
Seperator node for global nodes.
void resizeViewers(int _width, int _height)
resize the examinerViewer
void setScriptEngine(QScriptEngine *_engine)
DONT USE! (Function to set the internal reference to the script Engine)
void slotWheelEvent(QWheelEvent *_event, const std::string &_mode)
Gets called by examiner widget when Wheel is moved in picking mode.
void PluginWheelEvent(QWheelEvent *, const std::string &)
When this Signal is emitted when a Wheel Event occures.
void exitFailure()
Aborts the application with an error code.
void init()
Second initialization stage.
QVector< ViewMode * > viewModes_
List of available draw modes.
void PluginMouseEvent(QMouseEvent *)
When this Signal is emitted when a Mouse Event occures.
ACG::SceneGraph::SeparatorNode SeparatorNode
Seperator Node.
void exitApplication()
exit the current application
void clearAllComments(int objId)
Called when a plugin requests an update in the viewer.
void slotExecuteAfterStartup()
Executed after loading core completly to load files from commandline.
void scriptLog(QString _message)
Logging signal for ScriptEngine.
void snapshotFileType(QString _type, unsigned int _viewerId=0)
Set the file type for snapshots.
void startVideoCapture(QString _baseName, int _fps, bool _captureViewers)
Start video capturing.
QtGLGraphicsView * glView_
graphics view that holds the gl scene
void restoreState(QSettings &_settings)
restores the state
void showViewModeControls(bool _show)
Show or Hide the viewmode control widget.
void updateUI()
process events during script execution to keep the ui alive
void allCleared()
Signal send to plugins when whole scene is cleared.
void disconnect()
Remove connection of this object to a file.
QTimer * scenegraphCheckTimer_
Timer that starts scenegraph check.
void slotLog(Logtype _type, QString _message)
Console logger.
virtual void slotInformationRequested(const QPoint _clickedPoint, DataType _type)=0
Show information dialog on clicked object.
void setSlotDescription(QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
Core scripting engine.
void slotCall(QString _pluginName, QString _functionName, bool &_success)
void writeOnExit()
Called if app is closed and writes all information to ini file.
DLLEXPORT DataType typeId(QString _name)
Given a dataType Identifier string this function will return the id of the datatype.
void snapshotBaseFileName(const QString &_fname)
void viewerSnapshot()
Create a snapshot of the whole app.
static void loadSavedPostProcessors(const unsigned _examiner)
append all saved post processors
QSplitter * toolSplitter_
Spliter between toplevel objects and toolbox.
void showStatusBar(bool _state)
Show or hide Status Bar.
Class for the handling of simple configuration files.
void objectDeleted(int)
Called after an object has been deleted.
QList< int > objectList(QString _selection, QStringList _types)
return the list of available object that has the given selection and type
bool checkOpenGLCapabilities()
OpenGL capability check.
QList< SlotInfo > coreSlots_
Core scripting engine.