Raytracing: Added a render button
This commit is contained in:
parent
da8c9b6d63
commit
cd12853bed
|
@ -464,6 +464,83 @@ bool CmdRaytracingExportProject::isActive(void)
|
|||
}
|
||||
|
||||
|
||||
//===========================================================================
|
||||
// Raytracing_Render
|
||||
//===========================================================================
|
||||
|
||||
DEF_STD_CMD_A(CmdRaytracingRender);
|
||||
|
||||
CmdRaytracingRender::CmdRaytracingRender()
|
||||
: Command("Raytracing_Render")
|
||||
{
|
||||
// seting the
|
||||
sGroup = QT_TR_NOOP("File");
|
||||
sMenuText = QT_TR_NOOP("&Render");
|
||||
sToolTipText = QT_TR_NOOP("Renders the current raytracing project with povray");
|
||||
sWhatsThis = "Raytracing_Render";
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "Raytrace_Render";
|
||||
}
|
||||
|
||||
void CmdRaytracingRender::activated(int iMsg)
|
||||
{
|
||||
unsigned int n = getSelection().countObjectsOfType(Raytracing::RayProject::getClassTypeId());
|
||||
if (n != 1) {
|
||||
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
|
||||
QObject::tr("Select one Povray project object."));
|
||||
return;
|
||||
}
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Raytracing");
|
||||
std::string povray = hGrp->GetASCII("PovrayExecutable", "");
|
||||
if (povray == "") {
|
||||
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Povray not found"),
|
||||
QObject::tr("Please set the path to the povray executable in the preferences."));
|
||||
return;
|
||||
} else {
|
||||
QFileInfo fi(QString::fromUtf8(povray.c_str()));
|
||||
if (!fi.exists() || !fi.isFile()) {
|
||||
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Povray not found"),
|
||||
QObject::tr("Please correct the path to the povray executable in the preferences."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
QStringList filter;
|
||||
filter << QObject::tr("Rendered image(*.png)");
|
||||
filter << QObject::tr("All Files (*.*)");
|
||||
|
||||
QString fn = Gui::FileDialog::getSaveFileName(Gui::getMainWindow(), QObject::tr("Rendered image"), QString(), filter.join(QLatin1String(";;")));
|
||||
if (!fn.isEmpty()) {
|
||||
std::vector<Gui::SelectionSingleton::SelObj> Sel = getSelection().getSelection();
|
||||
int width = hGrp->GetInt("OutputWidth", 800);
|
||||
std::stringstream w;
|
||||
w << width;
|
||||
int height = hGrp->GetInt("OutputHeight", 600);
|
||||
std::stringstream h;
|
||||
h << height;
|
||||
std::string par = hGrp->GetASCII("OutputParameters", "+UA +P +A");
|
||||
std::string fname = (const char*)fn.toUtf8();
|
||||
openCommand("Render project");
|
||||
doCommand(Doc,"PageFile = open(App.activeDocument().%s.PageResult,'r')",Sel[0].FeatName);
|
||||
doCommand(Doc,"import subprocess,tempfile");
|
||||
doCommand(Doc,"TempFile = tempfile.mkstemp(suffix='.pov')[1]");
|
||||
doCommand(Doc,"f = open(TempFile,'wb')");
|
||||
doCommand(Doc,"f.write(PageFile.read())");
|
||||
doCommand(Doc,"f.close()");
|
||||
doCommand(Doc,"subprocess.call('\"%s\" %s +W%s +H%s +O\"%s\" '+TempFile,shell=True)",povray.c_str(),par.c_str(),w.str().c_str(),h.str().c_str(),fname.c_str());
|
||||
doCommand(Gui,"import ImageGui");
|
||||
doCommand(Gui,"ImageGui.open('%s')",fname.c_str());
|
||||
doCommand(Doc,"del TempFile,PageFile");
|
||||
commitCommand();
|
||||
}
|
||||
}
|
||||
|
||||
bool CmdRaytracingRender::isActive(void)
|
||||
{
|
||||
return (getActiveGuiDocument() ? true : false);
|
||||
}
|
||||
|
||||
|
||||
void CreateRaytracingCommands(void)
|
||||
{
|
||||
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
|
||||
|
@ -473,4 +550,5 @@ void CreateRaytracingCommands(void)
|
|||
rcCmdMgr.addCommand(new CmdRaytracingNewPovrayProject());
|
||||
rcCmdMgr.addCommand(new CmdRaytracingExportProject());
|
||||
rcCmdMgr.addCommand(new CmdRaytracingNewPartSegment());
|
||||
rcCmdMgr.addCommand(new CmdRaytracingRender());
|
||||
}
|
||||
|
|
|
@ -1,79 +1,73 @@
|
|||
<ui version="4.0" >
|
||||
<author></author>
|
||||
<comment></comment>
|
||||
<exportmacro></exportmacro>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>RaytracingGui::DlgSettingsRay</class>
|
||||
<widget class="QWidget" name="RaytracingGui::DlgSettingsRay" >
|
||||
<property name="geometry" >
|
||||
<widget class="QWidget" name="RaytracingGui::DlgSettingsRay">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>555</width>
|
||||
<height>311</height>
|
||||
<height>412</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<property name="windowTitle">
|
||||
<string>Raytracing</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QGroupBox" name="groupBox5" >
|
||||
<property name="title" >
|
||||
<item row="2" column="0">
|
||||
<widget class="QGroupBox" name="groupBox5">
|
||||
<property name="title">
|
||||
<string>Mesh export settings</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="textLabel2" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>5</vsizetype>
|
||||
<widget class="QLabel" name="textLabel2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>max mesh deviation:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefDoubleSpinBox" name="prefFloatSpinBox1" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>3</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<widget class="Gui::PrefDoubleSpinBox" name="prefFloatSpinBox1">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="value" >
|
||||
<double>0.1</double>
|
||||
<property name="value">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0" >
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>MeshDeviation</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0" >
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Raytracing</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
|
@ -81,27 +75,27 @@
|
|||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefCheckBox" name="prefCheckBox8" >
|
||||
<property name="text" >
|
||||
<widget class="Gui::PrefCheckBox" name="prefCheckBox8">
|
||||
<property name="text">
|
||||
<string>Do not calculate vertex normals</string>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0" >
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>NotWriteVertexNormals</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0" >
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Raytracing</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefCheckBox" name="prefCheckBox9" >
|
||||
<property name="text" >
|
||||
<widget class="Gui::PrefCheckBox" name="prefCheckBox9">
|
||||
<property name="text">
|
||||
<string>Write u,v coordinates</string>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0" >
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>WriteUVCoordinates</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0" >
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Raytracing</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
|
@ -109,85 +103,206 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QGroupBox" name="GroupBox12" >
|
||||
<property name="title" >
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Render</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="Gui::PrefFileChooser" name="prefFileChooser2">
|
||||
<property name="toolTip">
|
||||
<string>The path to the povray executable, if you want to render from FreeCAD</string>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>PovrayExecutable</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Raytracing</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Povray executable:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Output parameters:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="Gui::PrefLineEdit" name="prefLineEdit1">
|
||||
<property name="toolTip">
|
||||
<string>The povray parameters to be passed to the render.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>+UA +P +A</string>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>OutputParameters</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Raytracing</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>+W: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefSpinBox" name="prefIntSpinBox1">
|
||||
<property name="toolTip">
|
||||
<string>The width of the rendered image</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>9999</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>800</number>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>OutputWidth</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Raytracing</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string> +H : </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefSpinBox" name="prefIntSpinBox2">
|
||||
<property name="toolTip">
|
||||
<string>The height of the rendered image</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>9999</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>600</number>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>OutputHeight</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Raytracing</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="GroupBox12">
|
||||
<property name="title">
|
||||
<string>Directories</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="2" column="0" >
|
||||
<widget class="QLabel" name="textLabel1_3" >
|
||||
<property name="text" >
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="textLabel1_3">
|
||||
<property name="text">
|
||||
<string>Part file name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QLabel" name="textLabel1_2" >
|
||||
<property name="text" >
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="textLabel1_2">
|
||||
<property name="text">
|
||||
<string>Camera file name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="Gui::PrefFileChooser" name="prefFileChooser1" >
|
||||
<property name="focusPolicy" >
|
||||
<item row="1" column="1">
|
||||
<widget class="Gui::PrefFileChooser" name="prefFileChooser1">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
<property name="mode" >
|
||||
<property name="toolTip">
|
||||
<string>Used by utility tools</string>
|
||||
</property>
|
||||
<property name="mode">
|
||||
<enum>Gui::FileChooser::Directory</enum>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0" >
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>ProjectPath</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0" >
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Raytracing</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="textLabel1" >
|
||||
<property name="text" >
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="textLabel1">
|
||||
<property name="text">
|
||||
<string>Default Project dir:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="Gui::PrefLineEdit" name="prefLineEdit2" >
|
||||
<property name="text" >
|
||||
<item row="2" column="1">
|
||||
<widget class="Gui::PrefLineEdit" name="prefLineEdit2">
|
||||
<property name="toolTip">
|
||||
<string>Used by utility tools</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TempCamera.inc</string>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0" >
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>CameraName</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0" >
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Raytracing</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" >
|
||||
<widget class="Gui::PrefLineEdit" name="prefLineEdit3" >
|
||||
<property name="text" >
|
||||
<item row="3" column="1">
|
||||
<widget class="Gui::PrefLineEdit" name="prefLineEdit3">
|
||||
<property name="toolTip">
|
||||
<string>Used by utility tools</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TempPart.inc</string>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0" >
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>PartName</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0" >
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Raytracing</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
|
@ -197,12 +312,12 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" >
|
||||
<item row="3" column="0">
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
|
@ -212,35 +327,37 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11" />
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Gui::PrefCheckBox</class>
|
||||
<extends>QCheckBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
<container>0</container>
|
||||
<pixmap></pixmap>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
<container>0</container>
|
||||
<pixmap></pixmap>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefDoubleSpinBox</class>
|
||||
<extends>QDoubleSpinBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
<container>0</container>
|
||||
<pixmap></pixmap>
|
||||
<class>Gui::FileChooser</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>Gui/FileDialog.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefFileChooser</class>
|
||||
<extends>Gui::FileChooser</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
<container>0</container>
|
||||
<pixmap></pixmap>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefSpinBox</class>
|
||||
<extends>QSpinBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefCheckBox</class>
|
||||
<extends>QCheckBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefDoubleSpinBox</class>
|
||||
<extends>QDoubleSpinBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
|
|
|
@ -50,21 +50,29 @@ DlgSettingsRayImp::~DlgSettingsRayImp()
|
|||
void DlgSettingsRayImp::saveSettings()
|
||||
{
|
||||
prefFileChooser1->onSave();
|
||||
prefFileChooser2->onSave();
|
||||
prefLineEdit2->onSave();
|
||||
prefLineEdit3->onSave();
|
||||
prefFloatSpinBox1->onSave();
|
||||
prefCheckBox8->onSave();
|
||||
prefCheckBox9->onSave();
|
||||
prefIntSpinBox1->onSave();
|
||||
prefIntSpinBox2->onSave();
|
||||
prefLineEdit1->onSave();
|
||||
}
|
||||
|
||||
void DlgSettingsRayImp::loadSettings()
|
||||
{
|
||||
prefFileChooser1->onRestore();
|
||||
prefFileChooser2->onRestore();
|
||||
prefLineEdit2->onRestore();
|
||||
prefLineEdit3->onRestore();
|
||||
prefFloatSpinBox1->onRestore();
|
||||
prefCheckBox8->onRestore();
|
||||
prefCheckBox9->onRestore();
|
||||
prefIntSpinBox1->onRestore();
|
||||
prefIntSpinBox2->onRestore();
|
||||
prefLineEdit1->onSave();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<file>icons/Raytrace_Part.svg</file>
|
||||
<file>icons/Raytrace_ExportProject.svg</file>
|
||||
<file>icons/Raytrace_NewPartSegment.svg</file>
|
||||
<file>icons/Raytrace_Render.svg</file>
|
||||
<file>translations/Raytracing_af.qm</file>
|
||||
<file>translations/Raytracing_de.qm</file>
|
||||
<file>translations/Raytracing_fi.qm</file>
|
||||
|
|
320
src/Mod/Raytracing/Gui/Resources/icons/Raytrace_Render.svg
Normal file
320
src/Mod/Raytracing/Gui/Resources/icons/Raytrace_Render.svg
Normal file
|
@ -0,0 +1,320 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="64px"
|
||||
height="64px"
|
||||
id="svg2383"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="Raytrace_Render.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svg.inkscape"
|
||||
version="1.1">
|
||||
<defs
|
||||
id="defs2385">
|
||||
<linearGradient
|
||||
id="linearGradient3362">
|
||||
<stop
|
||||
id="stop3364"
|
||||
offset="0"
|
||||
style="stop-color:#85ceff;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3366"
|
||||
offset="1"
|
||||
style="stop-color:#004267;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3193">
|
||||
<stop
|
||||
id="stop3195"
|
||||
offset="0"
|
||||
style="stop-color:#030067;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3197"
|
||||
offset="1"
|
||||
style="stop-color:#0063ff;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3185">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3187" />
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop3189" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3175">
|
||||
<stop
|
||||
style="stop-color:#ababab;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3177" />
|
||||
<stop
|
||||
style="stop-color:#53c0f4;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3179" />
|
||||
</linearGradient>
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 32 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="64 : 32 : 1"
|
||||
inkscape:persp3d-origin="32 : 21.333333 : 1"
|
||||
id="perspective2391" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3175"
|
||||
id="linearGradient3181"
|
||||
x1="52.736828"
|
||||
y1="49.86422"
|
||||
x2="17.93952"
|
||||
y2="9.8805466"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-1.6287944,-3.3426866)" />
|
||||
<linearGradient
|
||||
id="linearGradient3600-63">
|
||||
<stop
|
||||
id="stop3602-9"
|
||||
offset="0"
|
||||
style="stop-color:#000117;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3604-0"
|
||||
offset="1"
|
||||
style="stop-color:#4f82b9;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
gradientUnits="userSpaceOnUse"
|
||||
y2="10.397644"
|
||||
x2="14.872466"
|
||||
y1="47.692612"
|
||||
x1="51.037281"
|
||||
id="linearGradient3606-0"
|
||||
xlink:href="#linearGradient3600-63"
|
||||
inkscape:collect="always" />
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
id="perspective3679" />
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
id="perspective3656" />
|
||||
<linearGradient
|
||||
id="linearGradient3600-6">
|
||||
<stop
|
||||
id="stop3602-5"
|
||||
offset="0"
|
||||
style="stop-color:#000117;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3604-4"
|
||||
offset="1"
|
||||
style="stop-color:#4f82b9;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
gradientUnits="userSpaceOnUse"
|
||||
y2="10.397644"
|
||||
x2="14.872466"
|
||||
y1="47.692612"
|
||||
x1="51.037281"
|
||||
id="linearGradient3606-5"
|
||||
xlink:href="#linearGradient3600-6"
|
||||
inkscape:collect="always" />
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
id="perspective3618" />
|
||||
<linearGradient
|
||||
gradientUnits="userSpaceOnUse"
|
||||
y2="10.397644"
|
||||
x2="14.872466"
|
||||
y1="47.692612"
|
||||
x1="51.037281"
|
||||
id="linearGradient3606"
|
||||
xlink:href="#linearGradient3600"
|
||||
inkscape:collect="always" />
|
||||
<inkscape:perspective
|
||||
id="perspective2824"
|
||||
inkscape:persp3d-origin="32 : 21.333333 : 1"
|
||||
inkscape:vp_z="64 : 32 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 32 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<linearGradient
|
||||
id="linearGradient3600">
|
||||
<stop
|
||||
id="stop3602"
|
||||
offset="0"
|
||||
style="stop-color:#000117;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3604"
|
||||
offset="1"
|
||||
style="stop-color:#4f82b9;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
gradientUnits="userSpaceOnUse"
|
||||
y2="10.397644"
|
||||
x2="14.872466"
|
||||
y1="47.692612"
|
||||
x1="51.037281"
|
||||
id="linearGradient3606-1"
|
||||
xlink:href="#linearGradient3600-0"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
id="linearGradient3600-0">
|
||||
<stop
|
||||
id="stop3602-3"
|
||||
offset="0"
|
||||
style="stop-color:#000117;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3604-9"
|
||||
offset="1"
|
||||
style="stop-color:#4f82b9;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
y2="10.397644"
|
||||
x2="14.872466"
|
||||
y1="47.692612"
|
||||
x1="51.037281"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient3086"
|
||||
xlink:href="#linearGradient3600-0"
|
||||
inkscape:collect="always"
|
||||
gradientTransform="matrix(0.96527774,0,0,0.96527774,-1.9240659,1.8600132)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3193"
|
||||
id="linearGradient3876"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.96527774,0,0,0.96527774,-1.1967932,2.4054677)"
|
||||
x1="42.278614"
|
||||
y1="50.047092"
|
||||
x2="13.365599"
|
||||
y2="31.682144" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600"
|
||||
id="linearGradient3883"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="51.037281"
|
||||
y1="47.692612"
|
||||
x2="14.872466"
|
||||
y2="10.397644" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3175"
|
||||
id="linearGradient3893"
|
||||
x1="28.31279"
|
||||
y1="33.722973"
|
||||
x2="28.641449"
|
||||
y2="4.1530533"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="7.7781746"
|
||||
inkscape:cx="14.739372"
|
||||
inkscape:cy="36.840683"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="true"
|
||||
inkscape:document-units="px"
|
||||
inkscape:grid-bbox="true"
|
||||
inkscape:window-width="1520"
|
||||
inkscape:window-height="847"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="19"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata2388">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer">
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="color:#000000;fill:#000000;fill-opacity:0.65625;fill-rule:evenodd;stroke:none;stroke-width:5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
||||
id="path2826-8"
|
||||
sodipodi:cx="31.636364"
|
||||
sodipodi:cy="30.363636"
|
||||
sodipodi:rx="26.181818"
|
||||
sodipodi:ry="26.181818"
|
||||
d="m 57.818182,30.363636 a 26.181818,26.181818 0 1 1 -52.363636,0 26.181818,26.181818 0 1 1 52.363636,0 z"
|
||||
transform="matrix(0.79832197,0,0,0.19433492,15.056943,47.631629)" />
|
||||
<rect
|
||||
style="color:#000000;fill:url(#linearGradient3893);stroke:#000228;stroke-width:0.2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;fill-opacity:1"
|
||||
id="rect3885"
|
||||
width="55.797153"
|
||||
height="29.184225"
|
||||
x="1.928473"
|
||||
y="4.2173357" />
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="color:#000000;fill:url(#linearGradient3883);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
||||
id="path2826"
|
||||
sodipodi:cx="31.636364"
|
||||
sodipodi:cy="30.363636"
|
||||
sodipodi:rx="26.181818"
|
||||
sodipodi:ry="26.181818"
|
||||
d="m 57.818182,30.363636 a 26.181818,26.181818 0 1 1 -52.363636,0 26.181818,26.181818 0 1 1 52.363636,0 z"
|
||||
transform="matrix(0.96527774,0,0,0.96527774,-1.1967932,2.4054681)" />
|
||||
<path
|
||||
style="color:#000000;fill:url(#linearGradient3876);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
||||
d="m 4.1647727,34.014205 c 1.1633601,12.878421 12.0061073,22.96875 25.1875003,22.96875 13.181393,0 23.99289,-10.090329 25.15625,-22.96875 l -50.3437503,0 z"
|
||||
id="path2826-88"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
||||
id="path3608"
|
||||
sodipodi:cx="11.181818"
|
||||
sodipodi:cy="20.181818"
|
||||
sodipodi:rx="10.454545"
|
||||
sodipodi:ry="7.2727275"
|
||||
d="m 21.636363,20.181818 a 10.454545,7.2727275 0 1 1 -20.90909001,0 10.454545,7.2727275 0 1 1 20.90909001,0 z"
|
||||
transform="matrix(0.77253856,-0.63496785,0.63496785,0.77253856,-1.2498073,10.828842)" />
|
||||
<path
|
||||
style="color:#000000;fill:none;stroke:#000228;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
||||
d="m 5.1803703,33.791221 c 0.8001019,12.554356 11.4695667,22.24287 24.2258797,22.24287 12.756313,0 23.26418,-9.238537 24.064282,-21.792893"
|
||||
id="path3878"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="csc" />
|
||||
<path
|
||||
style="fill:none;stroke:#0eda00;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
d="m 1.6713433,33.272996 55.9257177,0.25713"
|
||||
id="path3895"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 11 KiB |
|
@ -55,15 +55,22 @@ Gui::MenuItem* Workbench::setupMenuBar() const
|
|||
|
||||
Gui::MenuItem* ray = new Gui::MenuItem;
|
||||
root->insertItem(item, ray);
|
||||
ray->setCommand("&Raytracing");
|
||||
*ray
|
||||
|
||||
// utilities
|
||||
Gui::MenuItem* utilities = new Gui::MenuItem;
|
||||
utilities->setCommand("Utilities");
|
||||
*utilities
|
||||
<< "Raytracing_WriteView"
|
||||
<< "Raytracing_WriteCamera"
|
||||
<< "Raytracing_WritePart"
|
||||
<< "Separator"
|
||||
<< "Raytracing_WritePart";
|
||||
|
||||
ray->setCommand("&Raytracing");
|
||||
*ray
|
||||
<< utilities
|
||||
<< "Raytracing_NewPovrayProject"
|
||||
<< "Raytracing_NewPartSegment"
|
||||
<< "Raytracing_ExportProject";
|
||||
<< "Raytracing_ExportProject"
|
||||
<< "Raytracing_Render";
|
||||
|
||||
return root;
|
||||
}
|
||||
|
@ -74,12 +81,9 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
|
|||
Gui::ToolBarItem* ray = new Gui::ToolBarItem(root);
|
||||
ray->setCommand("Raytracing tools");
|
||||
*ray
|
||||
<< "Raytracing_WriteView"
|
||||
<< "Raytracing_WriteCamera"
|
||||
<< "Raytracing_WritePart"
|
||||
<< "Separator"
|
||||
<< "Raytracing_NewPovrayProject"
|
||||
<< "Raytracing_NewPartSegment"
|
||||
<< "Raytracing_ExportProject";
|
||||
<< "Raytracing_ExportProject"
|
||||
<< "Raytracing_Render";
|
||||
return root;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user