From: rnv Date: Mon, 20 Feb 2012 12:19:41 +0000 (+0000) Subject: Fix for the "0020314: EDF 993 SMESH : Display bug with Volumes created by GHS3D"... X-Git-Tag: V6_5_0a1~41 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=acd90681573ddcb1f2c5cb6eda24eb7f0d987f24;p=modules%2Fgui.git Fix for the "0020314: EDF 993 SMESH : Display bug with Volumes created by GHS3D" issue (problem with displaying coincident 3D elements). --- diff --git a/src/SVTK/SALOME_Actor.cxx b/src/SVTK/SALOME_Actor.cxx index 70deae8df..5c101d96d 100644 --- a/src/SVTK/SALOME_Actor.cxx +++ b/src/SVTK/SALOME_Actor.cxx @@ -168,11 +168,13 @@ SALOME_Actor myPreHighlightActor->Initialize(); myPreHighlightActor->PickableOff(); myPreHighlightActor->SetVisibility( false ); + myPreHighlightActor->SetCoincident3DAllowed(true); myHighlightActor->Delete(); myHighlightActor->Initialize(); myHighlightActor->PickableOff(); myHighlightActor->SetVisibility( false ); + myHighlightActor->SetCoincident3DAllowed(true); myOutline->Delete(); diff --git a/src/SVTK/SVTK_DeviceActor.cxx b/src/SVTK/SVTK_DeviceActor.cxx index c8dd1484c..4c68d61a6 100644 --- a/src/SVTK/SVTK_DeviceActor.cxx +++ b/src/SVTK/SVTK_DeviceActor.cxx @@ -745,3 +745,11 @@ int SVTK_DeviceActor::GetMarkerTexture() { return myMapper->GetMarkerTexture(); } + +void SVTK_DeviceActor::SetCoincident3DAllowed(bool theFlag) { + myGeomFilter->SetAppendCoincident3D(theFlag); +} + +bool SVTK_DeviceActor::IsCoincident3DAllowed() const { + return myGeomFilter->GetAppendCoincident3D(); +} diff --git a/src/SVTK/SVTK_DeviceActor.h b/src/SVTK/SVTK_DeviceActor.h index c4ef4cd6d..3b8221b40 100644 --- a/src/SVTK/SVTK_DeviceActor.h +++ b/src/SVTK/SVTK_DeviceActor.h @@ -244,6 +244,15 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor virtual void SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle); virtual vtkFloatingPointType GetQuadraticArcAngle(); + virtual + void + SetCoincident3DAllowed(bool theIsFeatureEdgesAllowed); + + virtual + bool + IsCoincident3DAllowed() const; + + protected: VTKViewer::Representation::Type myRepresentation; vtkProperty *myProperty; diff --git a/src/VTKViewer/VTKViewer_ConvexTool.cxx b/src/VTKViewer/VTKViewer_ConvexTool.cxx index 9fd5cfe4f..c5a35fc61 100644 --- a/src/VTKViewer/VTKViewer_ConvexTool.cxx +++ b/src/VTKViewer/VTKViewer_ConvexTool.cxx @@ -192,6 +192,7 @@ VTKViewer_Triangulator vtkIdType theCellId, int theShowInside, int theAllVisible, + int theAppendCoincident3D, const char* theCellsVisibility, vtkPolyData *theOutput, vtkCellData* theOutputCD, @@ -246,8 +247,9 @@ VTKViewer_Triangulator vtkCell* aFace = GetFace(aFaceId); GetCellNeighbors(theInput, theCellId, aFace, myCellIds); + bool process = myCellIds->GetNumberOfIds() <= 0 ? true : theAppendCoincident3D; if((!theAllVisible && !theCellsVisibility[myCellIds->GetId(0)]) || - myCellIds->GetNumberOfIds() <= 0 || theShowInside) + myCellIds->GetNumberOfIds() <= 0 || theShowInside || process) { TPointIds aPointIds; vtkIdList *anIdList = aFace->PointIds; diff --git a/src/VTKViewer/VTKViewer_ConvexTool.h b/src/VTKViewer/VTKViewer_ConvexTool.h index ce8eb1c54..e5b439118 100644 --- a/src/VTKViewer/VTKViewer_ConvexTool.h +++ b/src/VTKViewer/VTKViewer_ConvexTool.h @@ -57,6 +57,7 @@ class VTKVIEWER_EXPORT VTKViewer_Triangulator vtkIdType theCellId, int theShowInside, int theAllVisible, + int theAppendCoincident3D, const char* theCellsVisibility, vtkPolyData *theOutput, vtkCellData* theOutputCD, diff --git a/src/VTKViewer/VTKViewer_GeometryFilter.cxx b/src/VTKViewer/VTKViewer_GeometryFilter.cxx index b08bde2b4..bc96ff827 100755 --- a/src/VTKViewer/VTKViewer_GeometryFilter.cxx +++ b/src/VTKViewer/VTKViewer_GeometryFilter.cxx @@ -75,6 +75,7 @@ VTKViewer_GeometryFilter ::VTKViewer_GeometryFilter(): myShowInside(0), myStoreMapping(0), + myAppendCoincident3D(0), myIsWireframeMode(0), myIsBuildArc(false), myMaxArcAngle(2) @@ -329,6 +330,7 @@ VTKViewer_GeometryFilter cellId, myShowInside, allVisible, + myAppendCoincident3D, cellVis, output, outputCD, @@ -341,6 +343,7 @@ VTKViewer_GeometryFilter cellId, myShowInside, allVisible, + myAppendCoincident3D, cellVis, output, outputCD, @@ -361,7 +364,8 @@ VTKViewer_GeometryFilter aCellType = VTK_TRIANGLE; numFacePts = 3; input->GetCellNeighbors(cellId, faceIds, cellIds); - if ( cellIds->GetNumberOfIds() <= 0 || myShowInside || + bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D; + if ( process || myShowInside || (!allVisible && !cellVis[cellIds->GetId(0)]) ) { for ( i=0; i < numFacePts; i++) @@ -386,7 +390,8 @@ VTKViewer_GeometryFilter aCellType = VTK_QUAD; numFacePts = 4; input->GetCellNeighbors(cellId, faceIds, cellIds); - if ( cellIds->GetNumberOfIds() <= 0 || myShowInside || + bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D; + if ( process || myShowInside || (!allVisible && !cellVis[cellIds->GetId(0)]) ) { for ( i=0; i < numFacePts; i++) @@ -411,7 +416,8 @@ VTKViewer_GeometryFilter aCellType = VTK_QUAD; numFacePts = 4; input->GetCellNeighbors(cellId, faceIds, cellIds); - if ( cellIds->GetNumberOfIds() <= 0 || myShowInside || + bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D; + if ( process || myShowInside || (!allVisible && !cellVis[cellIds->GetId(0)]) ) { for ( i=0; i < numFacePts; i++) @@ -440,8 +446,10 @@ VTKViewer_GeometryFilter aCellType = VTK_QUAD; numFacePts = 4; } + input->GetCellNeighbors(cellId, faceIds, cellIds); - if ( cellIds->GetNumberOfIds() <= 0 || myShowInside || + bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D; + if ( process || myShowInside || (!allVisible && !cellVis[cellIds->GetId(0)]) ) { for ( i=0; i < numFacePts; i++) @@ -473,7 +481,8 @@ VTKViewer_GeometryFilter numFacePts = 6; } input->GetCellNeighbors(cellId, faceIds, cellIds); - if ( cellIds->GetNumberOfIds() <= 0 || myShowInside || + bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D; + if ( process || myShowInside || (!allVisible && !cellVis[cellIds->GetId(0)]) ) { for ( i=0; i < numFacePts; i++) @@ -503,7 +512,8 @@ VTKViewer_GeometryFilter numFacePts = 4; } input->GetCellNeighbors(cellId, faceIds, cellIds); - if ( cellIds->GetNumberOfIds() <= 0 || myShowInside || + bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D; + if ( process || myShowInside || (!allVisible && !cellVis[cellIds->GetId(0)]) ) { for ( i=0; i < numFacePts; i++) @@ -549,9 +559,10 @@ VTKViewer_GeometryFilter aCellType = VTK_POLYGON; break; } - // TODO understand and fix display of several polyhedrons + // TODO understand and fix display of several polyhedrons input->GetCellNeighbors(cellId, faceIds, cellIds); - if (cellIds->GetNumberOfIds() <= 0 || myShowInside + bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D; + if (process || myShowInside || (!allVisible && !cellVis[cellIds->GetId(0)])) { for (i = 0; i < numFacePts; i++) @@ -634,7 +645,8 @@ VTKViewer_GeometryFilter for (int j=0; j < cell->GetNumberOfFaces(); j++){ vtkCell *face = cell->GetFace(j); input->GetCellNeighbors(cellId, face->PointIds, cellIds); - if ( cellIds->GetNumberOfIds() <= 0 || myShowInside ) { + bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D; + if ( process <= 0 || myShowInside ) { face->Triangulate(0,lpts,coords); for (i=0; i < lpts->GetNumberOfIds(); i+=3) { aNewPts[0] = lpts->GetId(i); @@ -1318,3 +1330,15 @@ vtkFloatingPointType VTKViewer_GeometryFilter:: GetQuadraticArcAngle() const { return myMaxArcAngle; } + + +int VTKViewer_GeometryFilter::GetAppendCoincident3D() const { + return myAppendCoincident3D; +} + +void VTKViewer_GeometryFilter::SetAppendCoincident3D(int theFlag) { + if(myAppendCoincident3D != theFlag){ + myAppendCoincident3D = theFlag; + this->Modified(); + } +} \ No newline at end of file diff --git a/src/VTKViewer/VTKViewer_GeometryFilter.h b/src/VTKViewer/VTKViewer_GeometryFilter.h index f42fd2363..c82d69eec 100755 --- a/src/VTKViewer/VTKViewer_GeometryFilter.h +++ b/src/VTKViewer/VTKViewer_GeometryFilter.h @@ -62,6 +62,19 @@ public: * \brief Sets \a myIsWireframeMode flag. \a myIsWireframeMode is changed, call this->Modified(). * \param theIsWireframeMode - used for changing value of \a myIsWireframeMode variable. */ + + int GetAppendCoincident3D() const; + /*! \fn void SetAppendCoincident3D() + * \brief Sets \a myAppendCoincident3D flag. If this flag is true, filter append to the + result data set coincident 3D elements. + */ + + void SetAppendCoincident3D(int theFlag); + /*! \fn int SetAppendCoincident3D() + * \brief Return value of \a myAppendCoincident3D + * \retval myAppendCoincident3D + */ + void SetWireframeMode(int theIsWireframeMode); /*! \fn int GetWireframeMode() * \brief Return value of \a myIsWireframeMode @@ -126,6 +139,7 @@ private: int myShowInside; int myStoreMapping; int myIsWireframeMode; + int myAppendCoincident3D; vtkFloatingPointType myMaxArcAngle; // define max angle for mesh 2D quadratic element in the degrees bool myIsBuildArc; // flag for representation 2D quadratic element as arked polygon