diff --git a/src/Mod/Fem/App/FemVTKTools.cpp b/src/Mod/Fem/App/FemVTKTools.cpp index ac88e59518dc..fd5df42bc900 100644 --- a/src/Mod/Fem/App/FemVTKTools.cpp +++ b/src/Mod/Fem/App/FemVTKTools.cpp @@ -97,6 +97,52 @@ void writeVTKFile(const char* filename, vtkSmartPointer dat writer->Write(); } +namespace +{ + +// Helper function to fill vtkCellArray from SMDS_Mesh using vtk cell order +template +void fillVtkArray(vtkSmartPointer& elemArray, std::vector& types, const E* elem) +{ + vtkSmartPointer cell = vtkSmartPointer::New(); + const std::vector& order = SMDS_MeshCell::toVtkOrder(elem->GetEntityType()); + if (!order.empty()) { + for (int i = 0; i < elem->NbNodes(); ++i) { + cell->GetPointIds()->SetId(i, elem->GetNode(order[i])->GetID() - 1); + } + } + else { + for (int i = 0; i < elem->NbNodes(); ++i) { + cell->GetPointIds()->SetId(i, elem->GetNode(i)->GetID() - 1); + } + } + elemArray->InsertNextCell(cell); + types.push_back(SMDS_MeshCell::toVtkType(elem->GetEntityType())); +} + +// Helper function to fill SMDS_Mesh elements ID from vtk cell +void fillMeshElementIds(vtkCell* cell, std::vector& ids) +{ + VTKCellType cellType = static_cast(cell->GetCellType()); + const std::vector& order = SMDS_MeshCell::fromVtkOrder(cellType); + vtkIdType* vtkIds = cell->GetPointIds()->GetPointer(0); + ids.clear(); + int nbPoints = cell->GetNumberOfPoints(); + ids.resize(nbPoints); + if (!order.empty()) { + for (int i = 0; i < nbPoints; ++i) { + ids[i] = vtkIds[order[i]] + 1; + } + } + else { + for (int i = 0; i < nbPoints; ++i) { + ids[i] = vtkIds[i] + 1; + } + } +} + +} // namespace + void FemVTKTools::importVTKMesh(vtkSmartPointer dataset, FemMesh* mesh, float scale) { @@ -105,10 +151,6 @@ void FemVTKTools::importVTKMesh(vtkSmartPointer dataset, FemMesh* me Base::Console().Log("%d nodes/points and %d cells/elements found!\n", nPoints, nCells); Base::Console().Log("Build SMESH mesh out of the vtk mesh data.\n", nPoints, nCells); - // vtkSmartPointer cells = dataset->GetCells(); - // works only for vtkUnstructuredGrid - vtkSmartPointer idlist = vtkSmartPointer::New(); - // Now fill the SMESH datastructure SMESH_Mesh* smesh = mesh->getSMesh(); SMESHDS_Mesh* meshds = smesh->GetMeshDS(); @@ -120,138 +162,120 @@ void FemVTKTools::importVTKMesh(vtkSmartPointer dataset, FemMesh* me } for (vtkIdType iCell = 0; iCell < nCells; iCell++) { - idlist->Reset(); - idlist = dataset->GetCell(iCell)->GetPointIds(); - vtkIdType* ids = idlist->GetPointer(0); - switch (dataset->GetCellType(iCell)) { + vtkCell* cell = dataset->GetCell(iCell); + std::vector ids; + fillMeshElementIds(cell, ids); + switch (cell->GetCellType()) { // 2D faces case VTK_TRIANGLE: // tria3 - meshds->AddFaceWithID(ids[0] + 1, ids[1] + 1, ids[2] + 1, iCell + 1); + meshds->AddFaceWithID(ids[0], ids[1], ids[2], iCell + 1); break; case VTK_QUADRATIC_TRIANGLE: // tria6 - meshds->AddFaceWithID(ids[0] + 1, - ids[1] + 1, - ids[2] + 1, - ids[3] + 1, - ids[4] + 1, - ids[5] + 1, - iCell + 1); + meshds->AddFaceWithID(ids[0], ids[1], ids[2], ids[3], ids[4], ids[5], iCell + 1); break; case VTK_QUAD: // quad4 - meshds->AddFaceWithID(ids[0] + 1, ids[1] + 1, ids[2] + 1, ids[3] + 1, iCell + 1); + meshds->AddFaceWithID(ids[0], ids[1], ids[2], ids[3], iCell + 1); break; case VTK_QUADRATIC_QUAD: // quad8 - meshds->AddFaceWithID(ids[0] + 1, - ids[1] + 1, - ids[2] + 1, - ids[3] + 1, - ids[4] + 1, - ids[5] + 1, - ids[6] + 1, - ids[7] + 1, + meshds->AddFaceWithID(ids[0], + ids[1], + ids[2], + ids[3], + ids[4], + ids[5], + ids[6], + ids[7], iCell + 1); break; - // 3D volumes case VTK_TETRA: // tetra4 - meshds->AddVolumeWithID(ids[0] + 1, ids[1] + 1, ids[2] + 1, ids[3] + 1, iCell + 1); + meshds->AddVolumeWithID(ids[0], ids[1], ids[2], ids[3], iCell + 1); break; case VTK_QUADRATIC_TETRA: // tetra10 - meshds->AddVolumeWithID(ids[0] + 1, - ids[1] + 1, - ids[2] + 1, - ids[3] + 1, - ids[4] + 1, - ids[5] + 1, - ids[6] + 1, - ids[7] + 1, - ids[8] + 1, - ids[9] + 1, + meshds->AddVolumeWithID(ids[0], + ids[1], + ids[2], + ids[3], + ids[4], + ids[5], + ids[6], + ids[7], + ids[8], + ids[9], iCell + 1); break; case VTK_HEXAHEDRON: // hexa8 - meshds->AddVolumeWithID(ids[0] + 1, - ids[1] + 1, - ids[2] + 1, - ids[3] + 1, - ids[4] + 1, - ids[5] + 1, - ids[6] + 1, - ids[7] + 1, + meshds->AddVolumeWithID(ids[0], + ids[1], + ids[2], + ids[3], + ids[4], + ids[5], + ids[6], + ids[7], iCell + 1); break; case VTK_QUADRATIC_HEXAHEDRON: // hexa20 - meshds->AddVolumeWithID(ids[0] + 1, - ids[1] + 1, - ids[2] + 1, - ids[3] + 1, - ids[4] + 1, - ids[5] + 1, - ids[6] + 1, - ids[7] + 1, - ids[8] + 1, - ids[9] + 1, - ids[10] + 1, - ids[11] + 1, - ids[12] + 1, - ids[13] + 1, - ids[14] + 1, - ids[15] + 1, - ids[16] + 1, - ids[17] + 1, - ids[18] + 1, - ids[19] + 1, + meshds->AddVolumeWithID(ids[0], + ids[1], + ids[2], + ids[3], + ids[4], + ids[5], + ids[6], + ids[7], + ids[8], + ids[9], + ids[10], + ids[11], + ids[12], + ids[13], + ids[14], + ids[15], + ids[16], + ids[17], + ids[18], + ids[19], iCell + 1); break; case VTK_WEDGE: // penta6 - meshds->AddVolumeWithID(ids[0] + 1, - ids[1] + 1, - ids[2] + 1, - ids[3] + 1, - ids[4] + 1, - ids[5] + 1, - iCell + 1); + meshds->AddVolumeWithID(ids[0], ids[1], ids[2], ids[3], ids[4], ids[5], iCell + 1); break; case VTK_QUADRATIC_WEDGE: // penta15 - meshds->AddVolumeWithID(ids[0] + 1, - ids[1] + 1, - ids[2] + 1, - ids[3] + 1, - ids[4] + 1, - ids[5] + 1, - ids[6] + 1, - ids[7] + 1, - ids[8] + 1, - ids[9] + 1, - ids[10] + 1, - ids[11] + 1, - ids[12] + 1, - ids[13] + 1, - ids[14] + 1, + meshds->AddVolumeWithID(ids[0], + ids[1], + ids[2], + ids[3], + ids[4], + ids[5], + ids[6], + ids[7], + ids[8], + ids[9], + ids[10], + ids[11], + ids[12], + ids[13], + ids[14], iCell + 1); break; case VTK_PYRAMID: // pyra5 - meshds->AddVolumeWithID(ids[0] + 1, - ids[1] + 1, - ids[2] + 1, - ids[3] + 1, - ids[4] + 1, - iCell + 1); + meshds->AddVolumeWithID(ids[0], ids[1], ids[2], ids[3], ids[4], iCell + 1); break; case VTK_QUADRATIC_PYRAMID: // pyra13 - meshds->AddVolumeWithID(ids[0] + 1, - ids[1] + 1, - ids[2] + 1, - ids[3] + 1, - ids[4] + 1, - ids[5] + 1, - ids[6] + 1, - ids[7] + 1, - ids[8] + 1, - ids[9] + 1, - ids[10] + 1, - ids[11] + 1, - ids[12] + 1, + meshds->AddVolumeWithID(ids[0], + ids[1], + ids[2], + ids[3], + ids[4], + ids[5], + ids[6], + ids[7], + ids[8], + ids[9], + ids[10], + ids[11], + ids[12], iCell + 1); break; @@ -314,58 +338,23 @@ void exportFemMeshFaces(vtkSmartPointer grid, vtkSmartPointer elemArray = vtkSmartPointer::New(); std::vector types; - for (; aFaceIter->more();) { + while (aFaceIter->more()) { const SMDS_MeshFace* aFace = aFaceIter->next(); - // triangle - if (aFace->NbNodes() == 3) { - vtkSmartPointer tria = vtkSmartPointer::New(); - tria->GetPointIds()->SetId(0, aFace->GetNode(0)->GetID() - 1); - tria->GetPointIds()->SetId(1, aFace->GetNode(1)->GetID() - 1); - tria->GetPointIds()->SetId(2, aFace->GetNode(2)->GetID() - 1); - - elemArray->InsertNextCell(tria); - types.push_back(VTK_TRIANGLE); + if (aFace->GetEntityType() == SMDSEntity_Triangle) { + fillVtkArray(elemArray, types, aFace); } // quad - else if (aFace->NbNodes() == 4) { - vtkSmartPointer quad = vtkSmartPointer::New(); - quad->GetPointIds()->SetId(0, aFace->GetNode(0)->GetID() - 1); - quad->GetPointIds()->SetId(1, aFace->GetNode(1)->GetID() - 1); - quad->GetPointIds()->SetId(2, aFace->GetNode(2)->GetID() - 1); - quad->GetPointIds()->SetId(3, aFace->GetNode(3)->GetID() - 1); - - elemArray->InsertNextCell(quad); - types.push_back(VTK_QUAD); + else if (aFace->GetEntityType() == SMDSEntity_Quadrangle) { + fillVtkArray(elemArray, types, aFace); } // quadratic triangle - else if (aFace->NbNodes() == 6) { - vtkSmartPointer tria = - vtkSmartPointer::New(); - tria->GetPointIds()->SetId(0, aFace->GetNode(0)->GetID() - 1); - tria->GetPointIds()->SetId(1, aFace->GetNode(1)->GetID() - 1); - tria->GetPointIds()->SetId(2, aFace->GetNode(2)->GetID() - 1); - tria->GetPointIds()->SetId(3, aFace->GetNode(3)->GetID() - 1); - tria->GetPointIds()->SetId(4, aFace->GetNode(4)->GetID() - 1); - tria->GetPointIds()->SetId(5, aFace->GetNode(5)->GetID() - 1); - - elemArray->InsertNextCell(tria); - types.push_back(VTK_QUADRATIC_TRIANGLE); + else if (aFace->GetEntityType() == SMDSEntity_Quad_Triangle) { + fillVtkArray(elemArray, types, aFace); } // quadratic quad - else if (aFace->NbNodes() == 8) { - vtkSmartPointer quad = vtkSmartPointer::New(); - quad->GetPointIds()->SetId(0, aFace->GetNode(0)->GetID() - 1); - quad->GetPointIds()->SetId(1, aFace->GetNode(1)->GetID() - 1); - quad->GetPointIds()->SetId(2, aFace->GetNode(2)->GetID() - 1); - quad->GetPointIds()->SetId(3, aFace->GetNode(3)->GetID() - 1); - quad->GetPointIds()->SetId(4, aFace->GetNode(4)->GetID() - 1); - quad->GetPointIds()->SetId(5, aFace->GetNode(5)->GetID() - 1); - quad->GetPointIds()->SetId(6, aFace->GetNode(6)->GetID() - 1); - quad->GetPointIds()->SetId(7, aFace->GetNode(7)->GetID() - 1); - - elemArray->InsertNextCell(quad); - types.push_back(VTK_QUADRATIC_QUAD); + else if (aFace->GetEntityType() == SMDSEntity_Quad_Quadrangle) { + fillVtkArray(elemArray, types, aFace); } else { throw Base::TypeError("Face not yet supported by FreeCAD's VTK mesh builder\n"); @@ -387,101 +376,32 @@ void exportFemMeshCells(vtkSmartPointer grid, vtkSmartPointer elemArray = vtkSmartPointer::New(); std::vector types; - for (; aVolIter->more();) { + while (aVolIter->more()) { const SMDS_MeshVolume* aVol = aVolIter->next(); - if (aVol->NbNodes() == 4) { // tetra4 - Base::Console().Log(" Volume tetra4\n"); - vtkSmartPointer cell = vtkSmartPointer::New(); - cell->GetPointIds()->SetId(0, aVol->GetNode(0)->GetID() - 1); - cell->GetPointIds()->SetId(1, aVol->GetNode(1)->GetID() - 1); - cell->GetPointIds()->SetId(2, aVol->GetNode(2)->GetID() - 1); - cell->GetPointIds()->SetId(3, aVol->GetNode(3)->GetID() - 1); - - elemArray->InsertNextCell(cell); - types.push_back(VTK_TETRA); + if (aVol->GetEntityType() == SMDSEntity_Tetra) { // tetra4 + fillVtkArray(elemArray, types, aVol); } - else if (aVol->NbNodes() == 5) { // pyra5 - Base::Console().Log(" Volume pyra5\n"); - vtkSmartPointer cell = vtkSmartPointer::New(); - cell->GetPointIds()->SetId(0, aVol->GetNode(0)->GetID() - 1); - cell->GetPointIds()->SetId(1, aVol->GetNode(1)->GetID() - 1); - cell->GetPointIds()->SetId(2, aVol->GetNode(2)->GetID() - 1); - cell->GetPointIds()->SetId(3, aVol->GetNode(3)->GetID() - 1); - cell->GetPointIds()->SetId(4, aVol->GetNode(4)->GetID() - 1); - - elemArray->InsertNextCell(cell); - types.push_back(VTK_PYRAMID); + else if (aVol->GetEntityType() == SMDSEntity_Pyramid) { // pyra5 + fillVtkArray(elemArray, types, aVol); } - else if (aVol->NbNodes() == 6) { // penta6 - Base::Console().Log(" Volume penta6\n"); - vtkSmartPointer cell = vtkSmartPointer::New(); - cell->GetPointIds()->SetId(0, aVol->GetNode(0)->GetID() - 1); - cell->GetPointIds()->SetId(1, aVol->GetNode(1)->GetID() - 1); - cell->GetPointIds()->SetId(2, aVol->GetNode(2)->GetID() - 1); - cell->GetPointIds()->SetId(3, aVol->GetNode(3)->GetID() - 1); - cell->GetPointIds()->SetId(4, aVol->GetNode(4)->GetID() - 1); - cell->GetPointIds()->SetId(5, aVol->GetNode(5)->GetID() - 1); - - elemArray->InsertNextCell(cell); - types.push_back(VTK_WEDGE); + else if (aVol->GetEntityType() == SMDSEntity_Penta) { // penta6 + fillVtkArray(elemArray, types, aVol); } - else if (aVol->NbNodes() == 8) { // hexa8 - Base::Console().Log(" Volume hexa8\n"); - vtkSmartPointer cell = vtkSmartPointer::New(); - cell->GetPointIds()->SetId(0, aVol->GetNode(0)->GetID() - 1); - cell->GetPointIds()->SetId(1, aVol->GetNode(1)->GetID() - 1); - cell->GetPointIds()->SetId(2, aVol->GetNode(2)->GetID() - 1); - cell->GetPointIds()->SetId(3, aVol->GetNode(3)->GetID() - 1); - cell->GetPointIds()->SetId(4, aVol->GetNode(4)->GetID() - 1); - cell->GetPointIds()->SetId(5, aVol->GetNode(5)->GetID() - 1); - cell->GetPointIds()->SetId(6, aVol->GetNode(6)->GetID() - 1); - cell->GetPointIds()->SetId(7, aVol->GetNode(7)->GetID() - 1); - - elemArray->InsertNextCell(cell); - types.push_back(VTK_HEXAHEDRON); + else if (aVol->GetEntityType() == SMDSEntity_Hexa) { // hexa8 + fillVtkArray(elemArray, types, aVol); } - else if (aVol->NbNodes() == 10) { // tetra10 - Base::Console().Log(" Volume tetra10\n"); - vtkSmartPointer cell = vtkSmartPointer::New(); - for (int i = 0; i < 10; i++) { - cell->GetPointIds()->SetId(i, aVol->GetNode(i)->GetID() - 1); - } - - elemArray->InsertNextCell(cell); - types.push_back(VTK_QUADRATIC_TETRA); + else if (aVol->GetEntityType() == SMDSEntity_Quad_Tetra) { // tetra10 + fillVtkArray(elemArray, types, aVol); } - - else if (aVol->NbNodes() == 13) { // pyra13 - Base::Console().Log(" Volume pyra13\n"); - vtkSmartPointer cell = vtkSmartPointer::New(); - for (int i = 0; i < 13; i++) { - cell->GetPointIds()->SetId(i, aVol->GetNode(i)->GetID() - 1); - } - - elemArray->InsertNextCell(cell); - types.push_back(VTK_QUADRATIC_PYRAMID); + else if (aVol->GetEntityType() == SMDSEntity_Quad_Pyramid) { // pyra13 + fillVtkArray(elemArray, types, aVol); } - else if (aVol->NbNodes() == 15) { // penta15 - Base::Console().Log(" Volume penta15\n"); - vtkSmartPointer cell = vtkSmartPointer::New(); - for (int i = 0; i < 15; i++) { - cell->GetPointIds()->SetId(i, aVol->GetNode(i)->GetID() - 1); - } - - elemArray->InsertNextCell(cell); - types.push_back(VTK_QUADRATIC_WEDGE); + else if (aVol->GetEntityType() == SMDSEntity_Quad_Penta) { // penta15 + fillVtkArray(elemArray, types, aVol); } - else if (aVol->NbNodes() == 20) { // hexa20 - Base::Console().Log(" Volume hexa20\n"); - vtkSmartPointer cell = - vtkSmartPointer::New(); - for (int i = 0; i < 20; i++) { - cell->GetPointIds()->SetId(i, aVol->GetNode(i)->GetID() - 1); - } - - elemArray->InsertNextCell(cell); - types.push_back(VTK_QUADRATIC_HEXAHEDRON); + else if (aVol->GetEntityType() == SMDSEntity_Quad_Hexa) { // hexa20 + fillVtkArray(elemArray, types, aVol); } else { throw Base::TypeError("Volume not yet supported by FreeCAD's VTK mesh builder\n"); diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp b/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp index d1e8b0711ee1..1728d9c9baf0 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include #include @@ -159,6 +161,11 @@ ViewProviderFemPostObject::ViewProviderFemPostObject() sPixmap = "fem-femmesh-from-shape"; // create the subnodes which do the visualization work + m_transpType = new SoTransparencyType(); + m_transpType->ref(); + m_transpType->value = SoTransparencyType::BLEND; + m_depthBuffer = new SoDepthBuffer(); + m_depthBuffer->ref(); m_shapeHints = new SoShapeHints(); m_shapeHints->ref(); m_shapeHints->shapeType = SoShapeHints::UNKNOWN_SHAPE_TYPE; @@ -185,6 +192,8 @@ ViewProviderFemPostObject::ViewProviderFemPostObject() m_drawStyle->ref(); m_drawStyle->lineWidth.setValue(2); m_drawStyle->pointSize.setValue(3); + m_sepMarkerLine = new SoSeparator(); + m_sepMarkerLine->ref(); m_separator = new SoSeparator(); m_separator->ref(); @@ -221,6 +230,8 @@ ViewProviderFemPostObject::ViewProviderFemPostObject() ViewProviderFemPostObject::~ViewProviderFemPostObject() { FemPostObjectSelectionObserver::instance().unregisterFemPostObject(this); + m_transpType->unref(); + m_depthBuffer->unref(); m_shapeHints->unref(); m_coordinates->unref(); m_materialBinding->unref(); @@ -231,6 +242,7 @@ ViewProviderFemPostObject::~ViewProviderFemPostObject() m_triangleStrips->unref(); m_markers->unref(); m_lines->unref(); + m_sepMarkerLine->unref(); m_separator->unref(); m_material->unref(); m_colorBar->Detach(this); @@ -243,19 +255,27 @@ void ViewProviderFemPostObject::attach(App::DocumentObject* pcObj) { ViewProviderDocumentObject::attach(pcObj); + // marker and line nodes + m_sepMarkerLine->addChild(m_transpType); + m_sepMarkerLine->addChild(m_depthBuffer); + m_sepMarkerLine->addChild(m_drawStyle); + m_sepMarkerLine->addChild(m_materialBinding); + m_sepMarkerLine->addChild(m_material); + m_sepMarkerLine->addChild(m_coordinates); + m_sepMarkerLine->addChild(m_markers); + m_sepMarkerLine->addChild(m_lines); + // face nodes m_separator->addChild(m_shapeHints); - m_separator->addChild(m_drawStyle); m_separator->addChild(m_materialBinding); m_separator->addChild(m_material); m_separator->addChild(m_coordinates); - m_separator->addChild(m_markers); - m_separator->addChild(m_lines); m_separator->addChild(m_faces); + m_separator->addChild(m_sepMarkerLine); // Check for an already existing color bar Gui::SoFCColorBar* pcBar = - ((Gui::SoFCColorBar*)findFrontRootOfType(Gui::SoFCColorBar::getClassTypeId())); + static_cast(findFrontRootOfType(Gui::SoFCColorBar::getClassTypeId())); if (pcBar) { float fMin = m_colorBar->getMinValue(); float fMax = m_colorBar->getMaxValue(); @@ -318,7 +338,7 @@ std::vector ViewProviderFemPostObject::getDisplayModes() const std::vector StrList; StrList.emplace_back("Outline"); StrList.emplace_back("Nodes"); - // StrList.emplace_back("Nodes (surface only)"); somehow this filter does not work + StrList.emplace_back("Nodes (surface only)"); StrList.emplace_back("Surface"); StrList.emplace_back("Surface with Edges"); StrList.emplace_back("Wireframe"); @@ -441,7 +461,6 @@ void ViewProviderFemPostObject::update3D() // write out point data if any WritePointData(points, normals, tcoords); - WriteTransparency(); bool ResetColorBarRange = false; WriteColorData(ResetColorBarRange); @@ -656,9 +675,19 @@ void ViewProviderFemPostObject::WriteColorData(bool ResetColorBarRange) void ViewProviderFemPostObject::WriteTransparency() { - float trans = float(Transparency.getValue()) / 100.0; - m_material->transparency.setValue(trans); + float trans = static_cast(Transparency.getValue()) / 100.0; + float* value = m_material->transparency.startEditing(); + for (int i = 0; i < m_material->transparency.getNum(); ++i) { + value[i] = trans; + } + m_material->transparency.finishEditing(); + if (Transparency.getValue() > 99) { + m_depthBuffer->test.setValue(false); + } + else { + m_depthBuffer->test.setValue(true); + } // In order to apply the transparency changes the shape nodes must be touched m_faces->touch(); m_triangleStrips->touch(); @@ -817,11 +846,9 @@ void ViewProviderFemPostObject::onChanged(const App::Property* prop) if (prop == &Field && setupPipeline()) { updateProperties(); WriteColorData(ResetColorBarRange); - WriteTransparency(); } else if (prop == &VectorMode && setupPipeline()) { WriteColorData(ResetColorBarRange); - WriteTransparency(); } else if (prop == &Transparency) { WriteTransparency(); @@ -832,17 +859,6 @@ void ViewProviderFemPostObject::onChanged(const App::Property* prop) bool ViewProviderFemPostObject::doubleClicked() { - // work around for a problem in VTK implementation: - // https://forum.freecad.org/viewtopic.php?t=10587&start=130#p125688 - // check if backlight is enabled - ParameterGrp::handle hGrp = - App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View"); - bool isBackLightEnabled = hGrp->GetBool("EnableBacklight", false); - if (!isBackLightEnabled) { - Base::Console().Error("Backlight is not enabled. Due to a VTK implementation problem you " - "really should consider to enable backlight in FreeCAD display " - "preferences if you work with VTK post processing.\n"); - } // set edit Gui::Application::Instance->activeDocument()->setEdit(this, (int)ViewProvider::Default); return true; diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostObject.h b/src/Mod/Fem/Gui/ViewProviderFemPostObject.h index 70b455ae7d1d..9c1322b4e5f7 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemPostObject.h +++ b/src/Mod/Fem/Gui/ViewProviderFemPostObject.h @@ -53,6 +53,8 @@ class SoDrawStyle; class SoIndexedFaceSet; class SoIndexedLineSet; class SoIndexedTriangleStripSet; +class SoTransparencyType; +class SoDepthBuffer; namespace Gui { @@ -143,6 +145,9 @@ class FemGuiExport ViewProviderFemPostObject: public Gui::ViewProviderDocumentOb Gui::SoFCColorBar* m_colorBar; SoSeparator* m_colorRoot; SoDrawStyle* m_colorStyle; + SoTransparencyType* m_transpType; + SoSeparator* m_sepMarkerLine; + SoDepthBuffer* m_depthBuffer; vtkSmartPointer m_currentAlgorithm; vtkSmartPointer m_surface; diff --git a/src/Mod/Fem/femtest/data/mesh/tetra10_mesh.vtk b/src/Mod/Fem/femtest/data/mesh/tetra10_mesh.vtk index 453413b5b1d2..bc946d3b7043 100644 --- a/src/Mod/Fem/femtest/data/mesh/tetra10_mesh.vtk +++ b/src/Mod/Fem/femtest/data/mesh/tetra10_mesh.vtk @@ -8,7 +8,7 @@ POINTS 10 float 9 6 18 6 9 9 3 3 9 9 3 9 CELLS 1 11 -10 0 1 2 3 4 5 6 7 8 9 +10 0 2 1 3 6 5 4 7 9 8 CELL_TYPES 1 24