Navigation Menu

Skip to content

Commit

Permalink
[VIEW] Deprecate VRMLRenderer
Browse files Browse the repository at this point in the history
Use STLRenderer instead
  • Loading branch information
tkemmer committed May 9, 2018
1 parent 247c031 commit 773c3b6
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 161 deletions.
11 changes: 5 additions & 6 deletions include/BALL/VIEW/DIALOGS/exportGeometryDialog.h
Expand Up @@ -40,12 +40,15 @@ namespace BALL
QString getFilename() { return filename_; }

/** for information whether vrml export was chosen
* @deprecated VRML export is no longer supported; will be removed in next release. Returns always false.
*/
bool export_vrml();
BALL_DEPRECATED bool export_vrml() { return false; };

/** for information whether stl export was chosen
* @deprecated STL export is always used for 3D structured; will be removed in next release.
* Returns always true.
*/
bool export_stl();
BALL_DEPRECATED bool export_stl() { return true; };

/** for information whether representations have to be split into several files
*/
Expand Down Expand Up @@ -97,10 +100,6 @@ namespace BALL
*/
QString filename_;

bool vrml_;

bool stl_;

bool split_;

};
Expand Down
2 changes: 1 addition & 1 deletion include/BALL/VIEW/KERNEL/serverWidget.h
Expand Up @@ -56,7 +56,7 @@ namespace BALL
\ingroup ViewKernelClient
*/
class BALL_VIEW_EXPORT ServerWidget
class BALL_DEPRECATED BALL_VIEW_EXPORT ServerWidget
: public QObject,
public ModularWidget
{
Expand Down
3 changes: 2 additions & 1 deletion include/BALL/VIEW/RENDERING/RENDERERS/VRMLRenderer.h
Expand Up @@ -35,8 +35,9 @@ namespace BALL
<br>
This is unmaintained code!
\ingroup ViewRendering
@deprecated Use STL renderer instead
*/
class BALL_VIEW_EXPORT VRMLRenderer : public Renderer
class BALL_DEPRECATED BALL_VIEW_EXPORT VRMLRenderer : public Renderer
{
public:

Expand Down
2 changes: 1 addition & 1 deletion include/BALL/VIEW/RENDERING/renderSetup.h
Expand Up @@ -70,7 +70,7 @@ namespace BALL {
/// Renders into a POVRay file
POV_RENDERER,

/// Renders into a VRML file
/// Renders into a VRML file (deprecated)
VRML_RENDERER,

/// Renders into an STL file
Expand Down
4 changes: 4 additions & 0 deletions source/PYTHON/EXTENSIONS/VIEW/VRMLRenderer.sip
@@ -1,3 +1,7 @@
/*
* DEPRECATED
* Class will be removed in the next release
*/
class VRMLRenderer
: Renderer
{
Expand Down
29 changes: 0 additions & 29 deletions source/VIEW/DIALOGS/exportGeometryDialog.C
Expand Up @@ -104,8 +104,6 @@ int ExportGeometryDialog::exec()
row++;
}
split_ = false;
vrml_ = false;
stl_ = false;
raise();
return QDialog::exec();
}
Expand Down Expand Up @@ -162,23 +160,6 @@ void ExportGeometryDialog::accept()
split_ = false;
}

if (vrml_box->isChecked())
{
vrml_ = true;
}
else
{
vrml_ = false;
}

if (stl_box->isChecked())
{
stl_ = true;
}
else
{
stl_ = false;
}
setFilename(file_edit->displayText());
}

Expand All @@ -194,16 +175,6 @@ void ExportGeometryDialog::accept()
file_edit->setText(fname);
}

bool ExportGeometryDialog::export_vrml()
{
return vrml_;
}

bool ExportGeometryDialog::export_stl()
{
return stl_;
}

bool ExportGeometryDialog::split()
{
return split_;
Expand Down
38 changes: 0 additions & 38 deletions source/VIEW/DIALOGS/exportGeometryDialog.ui
Expand Up @@ -189,44 +189,6 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox12_2">
<property name="title">
<string>File Format</string>
</property>
<property name="alignment">
<set>Qt::AlignHCenter</set>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QCheckBox" name="vrml_box">
<property name="toolTip">
<string>Export selected representations </string>
</property>
<property name="text">
<string>Export as VRML file</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="stl_box">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Export as stl file</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
Expand Down
3 changes: 0 additions & 3 deletions source/VIEW/RENDERING/renderSetup.C
Expand Up @@ -3,7 +3,6 @@
#include <BALL/VIEW/RENDERING/RENDERERS/bufferedRenderer.h>
#include <BALL/VIEW/RENDERING/RENDERERS/tilingRenderer.h>
#include <BALL/VIEW/RENDERING/RENDERERS/POVRenderer.h>
#include <BALL/VIEW/RENDERING/RENDERERS/VRMLRenderer.h>
#include <BALL/VIEW/RENDERING/RENDERERS/STLRenderer.h>
#include <BALL/VIEW/RENDERING/glRenderWindow.h>

Expand Down Expand Up @@ -625,8 +624,6 @@ namespace BALL
renderer_type_ = OPENGL_RENDERER;
else if (RTTI::isKindOf<POVRenderer>(renderer))
renderer_type_ = POV_RENDERER;
else if (RTTI::isKindOf<VRMLRenderer>(renderer))
renderer_type_ = VRML_RENDERER;
else if (RTTI::isKindOf<STLRenderer>(renderer))
renderer_type_ = STL_RENDERER;
else if (RTTI::isKindOf<TilingRenderer>(renderer))
Expand Down
131 changes: 49 additions & 82 deletions source/VIEW/WIDGETS/scene.C
Expand Up @@ -1422,7 +1422,7 @@ namespace BALL
description = "Shortcut|File|Export|VRML";
insertMenuEntry(MainControl::FILE_EXPORT, tr("3D Prototyping Export"), this,
SLOT(showExportVRMLDialog()), description, QKeySequence(),
tr("Export a VRML or stl file from the scene"),
tr("Export a stl file from the scene"),
UIOperationMode::MODE_ADVANCED);

// ====================================== MODES =====================================
Expand Down Expand Up @@ -1970,7 +1970,7 @@ namespace BALL
updateGL();
}

//Opens a dialog in which parts of the scene can be exported as VRML or stl files
//Opens a dialog in which parts of the scene can be exported as stl files
void Scene::showExportVRMLDialog()
{
bool change = false;
Expand All @@ -1980,110 +1980,77 @@ namespace BALL
ts.exec();

bool *checked = ts.reps;
bool ve = ts.export_vrml();
bool se = ts.export_stl();

//prepare the filename
QString filename = ts.getFilename();
QString vrml_end = ".wrl";
QString stl_end = ".stl";
filename.remove( vrml_end );
filename.remove( stl_end );

MainControl* mc = getMainControl();
RepresentationManager& rm = mc->getRepresentationManager();
RepresentationList::const_iterator rit;

if ( ve || se)
if ( ts.split() )
//every representation gets its own file
{
if ( ts.split() )
//every representation gets its own file
{
//at the beginning all reps are hidden (see "saving base stats")
count = 0;
//number of filepartition
Position partCounter = 0;

//now all representations are hidden. in the next iteration we show one that was not hidden before and print
rit = rm.getRepresentations().begin();
for (; rit != rm.getRepresentations().end(); rit++)
{
if(checked[count])
{
//show one, print all (meaning just the one)
(*rit)->setHidden(false);

QString vtemp = filename;

if (ve)
{
vtemp.append("_");
vtemp.append(QString::number(partCounter));
vtemp.append(".wrl");
VRMLRenderer vrml(ascii(vtemp));
if ( exportScene(vrml) )
{
change = true;
}
}
if (se)
{
vtemp = filename;
vtemp.append("_");
vtemp.append(QString::number(partCounter));
vtemp.append(".stl");
STLRenderer stl(ascii(vtemp));
if ( exportScene(stl) )
{
change = true;
}
}
//at the beginning all reps are hidden (see "saving base stats")
count = 0;
//number of filepartition
Position partCounter = 0;

//hide again (for all other reps)
(*rit)->setHidden(true);
partCounter++;
}
count++;
}
}
else
//print in single file case
//now all representations are hidden. in the next iteration we show one that was not hidden before and print
rit = rm.getRepresentations().begin();
for (; rit != rm.getRepresentations().end(); rit++)
{
count = 0;

//make all checked representations visible
rit = rm.getRepresentations().begin();
for (; rit != rm.getRepresentations().end(); rit++)
if(checked[count])
{
if(checked[count])
{
(*rit)->setHidden(false);
}
count++;
}
//show one, print all (meaning just the one)
(*rit)->setHidden(false);

QString vtemp = filename;
QString vtemp = filename;

//export as requested
if (ve)
{
vtemp.append(".wrl");
VRMLRenderer vrml(ascii(vtemp));
if ( exportScene(vrml) )
{
change = true;
}
}
if (se)
{
vtemp = filename;
vtemp.append("_");
vtemp.append(QString::number(partCounter));
vtemp.append(".stl");
STLRenderer stl(ascii(vtemp));
if ( exportScene(stl) )
{
change = true;
}

//hide again (for all other reps)
(*rit)->setHidden(true);
partCounter++;
}
count++;
}
}
else
//print in single file case
{
count = 0;

//make all checked representations visible
rit = rm.getRepresentations().begin();
for (; rit != rm.getRepresentations().end(); rit++)
{
if(checked[count])
{
(*rit)->setHidden(false);
}
count++;
}

QString vtemp = filename;

//export as requested
vtemp = filename;
vtemp.append(".stl");
STLRenderer stl(ascii(vtemp));
if ( exportScene(stl) )
{
change = true;
}
}

Expand Down

0 comments on commit 773c3b6

Please sign in to comment.