]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix for the "0020314: EDF 993 SMESH : Display bug with Volumes created by GHS3D"...
authorrnv <rnv@opencascade.com>
Mon, 20 Feb 2012 12:19:41 +0000 (12:19 +0000)
committerrnv <rnv@opencascade.com>
Mon, 20 Feb 2012 12:19:41 +0000 (12:19 +0000)
src/SVTK/SALOME_Actor.cxx
src/SVTK/SVTK_DeviceActor.cxx
src/SVTK/SVTK_DeviceActor.h
src/VTKViewer/VTKViewer_ConvexTool.cxx
src/VTKViewer/VTKViewer_ConvexTool.h
src/VTKViewer/VTKViewer_GeometryFilter.cxx
src/VTKViewer/VTKViewer_GeometryFilter.h

index 70deae8df0a8a8cfed99956083b394ab10bedff2..5c101d96dd6ea15480db0def60b3a64287c90078 100644 (file)
@@ -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();
 
index c8dd1484c35c694f17d6db5f6de16e8dce1d2933..4c68d61a678d8ac3d88f513d549eb00b65735931 100644 (file)
@@ -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();
+}
index c4ef4cd6d431a1518fbc065f7c4ee75f52ddc4f6..3b8221b40ce18fa96fcfd0d3e2271fbfdd5cc0cf 100644 (file)
@@ -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;
index 9fd5cfe4f94815cf0a2a623a8e34fdc31427aaab..c5a35fc617994ab868a21b3501d31dd5b5cdfcba 100644 (file)
@@ -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;  
index ce8eb1c541c92709a37709597c181610f3e6ef40..e5b4391180e0fcf34945c1ed1c81bf67ca83add6 100644 (file)
@@ -57,6 +57,7 @@ class VTKVIEWER_EXPORT VTKViewer_Triangulator
           vtkIdType theCellId,
           int theShowInside,
           int theAllVisible,
+          int theAppendCoincident3D,
           const char* theCellsVisibility,
           vtkPolyData *theOutput,
           vtkCellData* theOutputCD,
index b08bde2b4d06411676979e7136f59258bd3fe262..bc96ff827d70725996a08b38c7cbc11b98f2ae95 100755 (executable)
@@ -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
index f42fd2363b697d8aa2254d5f94130094b23ab9f1..c82d69eecf5de14397d97b06348343dafc777c4a 100755 (executable)
@@ -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