36 #include <QVBoxLayout>
43 #include "sscConfig.h"
55 this->setFocusPolicy(Qt::StrongFocus);
58 QVBoxLayout* vtopLayout =
new QVBoxLayout;
60 vtopLayout->setMargin(0);
61 vtopLayout->addStretch();
62 this->setLayout(vtopLayout);
71 this->setObjectName(
"preferences_performance_widget");
83 int renderingInterval =
settings()->
value(
"renderingInterval").toInt();
85 QLabel* renderingIntervalLabel =
new QLabel(tr(
"Rendering interval"));
95 this->renderingIntervalSlot(renderingInterval);
97 double Mb = pow(10.0,6);
99 double maxRenderSize =
settings()->
value(
"View3D/maxRenderSize").toDouble(&ok);
101 maxRenderSize = 10 * Mb;
105 double stillUpdateRate =
settings()->
value(
"stillUpdateRate").value<
double>();
107 "<p>Still Update Rate in vtkRenderWindow. "
108 "Increasing the value may improve rendering speed "
109 "at the cost of render quality.</p> "
110 "Generally raycast rendering requires this to be low (0.001), "
111 "while texture based rendering requires it to be high (5-10)."
112 "<p>Restart needed.</p>",
113 stillUpdateRate,
DoubleRange(0.0001, 20, 0.0001), 4, QDomNode());
121 "Select 3D visualization method for images",
122 settings()->value(
"View3D/ImageRender3DVisualizer").toString(),
123 this->getAvailableVisualizers(),
125 m3DVisualizer->setDisplayNames(this->getAvailableVisualizerDisplayNames());
127 bool useGPU2DRender =
settings()->
value(
"useGPU2DRendering").toBool();
131 "the software-based one, if available.</p>"
132 "<p>This enables multiple volume rendering in 2D.<p>");
134 bool optimizedViews =
settings()->
value(
"optimizedViews").toBool();
138 "<p>This speeds up render on some platforms, still experimental.<p>");
140 bool useGPU3DDepthPeeling =
settings()->
value(
"View3D/depthPeeling").toBool();
147 mMainLayout->addWidget(renderingIntervalLabel, 0, 0);
165 static QStringList getAvailableVisualizers();
166 static std::map<QString, QString> getAvailableVisualizerDisplayNames();
168 void PerformanceTab::renderingIntervalSlot(
int interval)
173 QStringList PerformanceTab::getAvailableVisualizers()
176 retval <<
"vtkVolumeTextureMapper3D";
177 retval <<
"vtkGPUVolumeRayCastMapper";
178 #ifdef CX_BUILD_MEHDI_VTKMULTIVOLUME
179 retval <<
"vtkOpenGLGPUMultiVolumeRayCastMapper";
180 #endif //CX_BUILD_MEHDI_VTKMULTIVOLUME
185 std::map<QString, QString> PerformanceTab::getAvailableVisualizerDisplayNames()
187 std::map<QString, QString> names;
188 names[
"vtkVolumeTextureMapper3D"] =
"Texture (single volume)";
189 names[
"vtkGPUVolumeRayCastMapper"] =
"Raycast GPU (single volume)";
190 names[
"vtkOpenGLGPUMultiVolumeRayCastMapper"] =
"Mehdi Raycast GPU (multi volume)";
PreferenceTab(QWidget *parent=0)
Utility class for describing a bounded numeric range.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
void setValue(const QString &key, const QVariant &value)
Settings * settings()
Shortcut for accessing the settings instance.
static StringPropertyPtr initialize(const QString &uid, QString name, QString help, QString value, QStringList range, QDomNode root=QDomNode())
static DoublePropertyPtr initialize(const QString &uid, QString name, QString help, double value, DoubleRange range, int decimals, QDomNode root=QDomNode())