Commit ba304cba authored by Max Lyon's avatar Max Lyon

make Cells (flat shaded) the default draw mode for OpenVolumeMeshes loaded from vtk files

parent 92567329
Pipeline #4352 passed with stage
in 44 minutes and 49 seconds
......@@ -1595,7 +1595,8 @@ int FileVTKPlugin::loadObject(QString _filename) {
return -1;
}
BaseObject* baseObj = 0;
BaseObjectData* baseObj = 0;
bool is_OpenVolumeMesh = false;
if ( (forceTriangleMesh_) || (bestType == BMT_TriMesh) ){
......@@ -1660,6 +1661,7 @@ int FileVTKPlugin::loadObject(QString _filename) {
else if (bestType == BMT_PolyhedralMesh)
{
// add a Polyhedral mesh
is_OpenVolumeMesh = true;
int id = -1;
emit addEmptyObject(DATA_POLYHEDRAL_MESH, id);
......@@ -1689,6 +1691,7 @@ int FileVTKPlugin::loadObject(QString _filename) {
else if (bestType == BMT_HexahedralMesh)
{
// add a hexahedral mesh
is_OpenVolumeMesh = true;
int id = -1;
emit addEmptyObject(DATA_HEXAHEDRAL_MESH, id);
......@@ -1717,6 +1720,7 @@ int FileVTKPlugin::loadObject(QString _filename) {
else if (bestType == BMT_TetrahedralMesh)
{
// add a tetrahedral mesh
is_OpenVolumeMesh = true;
int id = -1;
emit addEmptyObject(DATA_TETRAHEDRAL_MESH, id);
......@@ -1747,6 +1751,11 @@ int FileVTKPlugin::loadObject(QString _filename) {
baseObj->setFromFileName(_filename);
baseObj->setName(baseObj->filename());
if (is_OpenVolumeMesh)
{
// Go into solid flat shaded mode
baseObj->setObjectDrawMode(ACG::SceneGraph::DrawModes::getDrawMode("Cells (flat shaded)"));
}
emit updatedObject(baseObj->id(), UPDATE_ALL);
......
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