Commit 472a839e authored by Max Lyon's avatar Max Lyon

Rendering of OpenVolumeMesh without immediate mode.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@16714 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 50ee02c1
......@@ -162,7 +162,7 @@ namespace DrawModes {
NORMAL_PER_FACE /**< Use per face normals \note per face is implicitly used in SHADE_FLAT mode */
};
typedef std::bitset<64> ModeFlagSet;
typedef std::bitset<128> ModeFlagSet;
/** \brief DrawModeProperties stores a set of properties that defines, how to render an object.
*
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -179,7 +179,7 @@ int FileOpenVolumeMeshPlugin::loadObject(QString _filename) {
emit openedFile(obj->id());
// Go into solid flat shaded mode
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_FLAT_SHADED, PluginFunctions::activeExaminer());
obj->setObjectDrawMode(ACG::SceneGraph::DrawModes::getDrawMode("Cells (flat shaded)"));
// Scale polyhedra a bit
obj->meshNode()->set_scaling(0.8);
......@@ -211,7 +211,7 @@ int FileOpenVolumeMeshPlugin::loadObject(QString _filename) {
emit openedFile(obj->id());
// Go into solid flat shaded mode
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_FLAT_SHADED, PluginFunctions::activeExaminer());
obj->setObjectDrawMode(ACG::SceneGraph::DrawModes::getDrawMode("Cells (flat shaded)"));
// Scale polyhedra a bit
obj->meshNode()->set_scaling(0.8);
......
......@@ -1664,6 +1664,8 @@ int FileVTKPlugin::loadObject(QString _filename) {
object->update();
object->setObjectDrawMode(ACG::SceneGraph::DrawModes::getDrawMode("Cells (flat shaded)"));
//general stuff
emit openedFile( object->id() );
......@@ -1704,6 +1706,8 @@ int FileVTKPlugin::loadObject(QString _filename) {
object->update();
object->setObjectDrawMode(ACG::SceneGraph::DrawModes::getDrawMode("Cells (flat shaded)"));
//general stuff
emit openedFile( object->id() );
......
......@@ -99,8 +99,6 @@ private slots:
void switchRendering();
void switchTranslucency();
void setTranslucencyFactor();
void switchShowIrregs();
......@@ -142,13 +140,8 @@ private:
QAction* render_switch_;
QAction* translucency_action_;
QAction* translucency_factor_action_;
QAction* show_irregs_action_;
QAction* show_outer_val_two_action_;
};
#endif //TYPEHEXAHEDRALMESH_HH
......@@ -47,8 +47,8 @@
TypePolyhedralMeshPlugin::TypePolyhedralMeshPlugin() :
render_switch_(NULL),
translucency_action_(NULL),
translucency_factor_action_(NULL) {
translucency_factor_action_(NULL)
{
}
bool TypePolyhedralMeshPlugin::registerType() {
......@@ -82,13 +82,6 @@ void TypePolyhedralMeshPlugin::pluginsInitialized() {
connect(render_switch_, SIGNAL( triggered() ), this, SLOT( switchRendering() ));
menu->addAction(render_switch_);
translucency_action_ = new QAction(tr("Translucent"), this);
translucency_action_->setStatusTip(tr("Translucent"));
translucency_action_->setCheckable(true);
translucency_action_->setChecked(false);
connect(translucency_action_, SIGNAL( triggered() ), this, SLOT( switchTranslucency() ));
menu->addAction(translucency_action_);
translucency_factor_action_ = new QAction(tr("Set Translucency Factor"), this);
translucency_factor_action_->setStatusTip(tr("Set Translucency Factor"));
translucency_factor_action_->setCheckable(false);
......@@ -201,28 +194,6 @@ void TypePolyhedralMeshPlugin::switchRendering() {
//----------------------------------------------------------------------------
void TypePolyhedralMeshPlugin::switchTranslucency() {
QVariant contextObject = translucency_action_->data();
int objectId = contextObject.toInt();
if(objectId == -1)
return;
BaseObjectData* bod = 0;
if(!PluginFunctions::getObject(objectId, bod))
return;
PolyhedralMeshObject* polyMeshObject = dynamic_cast<PolyhedralMeshObject*>(bod);
if(polyMeshObject) {
polyMeshObject->meshNode()->set_translucent(translucency_action_->isChecked());
polyMeshObject->meshNode()->set_geometry_changed(true);
}
}
//----------------------------------------------------------------------------
void TypePolyhedralMeshPlugin::setTranslucencyFactor() {
QVariant contextObject = translucency_factor_action_->data();
......@@ -245,9 +216,6 @@ void TypePolyhedralMeshPlugin::setTranslucencyFactor() {
0.0, 1.0, 2, &ok);
polyMeshObject->meshNode()->set_translucency_factor((float)factor);
if(polyMeshObject->meshNode()->translucent()) {
emit updatedObject(objectId, UPDATE_GEOMETRY);
}
}
}
......
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