Commit 43534f41 authored by Jan Möbius's avatar Jan Möbius

Added render object widget

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@16250 383ad7c9-94d9-4d36-a494-682f7c89f535
parent f3e703f4
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*--------------------------------------------------------------------------- *
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 15910 $ *
* $LastChangedBy: moeller $ *
* $Date: 2012-12-05 12:53:39 +0100 (Mi, 05 Dez 2012) $ *
* *
\*===========================================================================*/
#include "rendererObjectWidget.hh"
#include <QtGui>
#include <QMessageBox>
#include <OpenFlipper/BasePlugin/BaseInterface.hh>
#include <OpenFlipper/common/GlobalOptions.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
RendererObjectWidget::RendererObjectWidget(QWidget *parent)
: QDialog(parent)
{
setupUi(this);
connect(closeButton, SIGNAL(clicked()), this, SLOT(accept()));
//set icons
QString iconPath = OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator();
closeButton->setIcon( QIcon(iconPath + "window-close.png"));
}
void RendererObjectWidget::closeEvent(QCloseEvent *event)
{
event->accept();
accept();
}
void RendererObjectWidget::showEvent ( QShowEvent * ) {
update();
}
void RendererObjectWidget::update()
{
RendererInfo* renderer = renderManager().active(PluginFunctions::activeExaminer());
textBrowser->clear();
if ( renderer ) {
textBrowser->insertPlainText(tr("Current renderer: ") + renderer->name +"\n");
textBrowser->insertPlainText(tr("Description: ") + renderer->description +"\n");
textBrowser->insertPlainText(tr("Version: ") + renderer->version + "\n" );
textBrowser->insertPlainText("\n" );
textBrowser->insertPlainText(renderer->plugin->renderObjectsInfo());
} else {
textBrowser->setText("Unable to get renderer!");
}
}
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*--------------------------------------------------------------------------- *
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 15910 $ *
* $LastChangedBy: moeller $ *
* $Date: 2012-12-05 12:53:39 +0100 (Mi, 05 Dez 2012) $ *
* *
\*===========================================================================*/
#include "ui_rendererObjectWidget.hh"
#include <QtGui>
#include <OpenFlipper/common/RendererInfo.hh>
class RendererObjectWidget : public QDialog, public Ui::RendererObjectWidget
{
Q_OBJECT
public:
RendererObjectWidget(QWidget *parent = 0);
protected:
void closeEvent(QCloseEvent *event);
void showEvent ( QShowEvent * );
private:
void update();
};
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>RendererObjectWidget</class>
<widget class="QWidget" name="RendererObjectWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>939</width>
<height>527</height>
</rect>
</property>
<property name="windowTitle">
<string>Render Objects</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QFrame" name="frame_3">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>40</height>
</size>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<property name="midLineWidth">
<number>0</number>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Current Render Object Data</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QTextBrowser" name="textBrowser"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="closeButton">
<property name="text">
<string>Close</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment