Salome HOME
Issue 0019818: EDF 703 SMESH VISU : Display Mesh Groups names in viewer (as a caption)
[modules/visu.git] / src / OBJECT / VISU_MeshAct.cxx
index f93f9c6b9273fc2744877c179769998fc202c6e7..2c3050dd51f23160010c3669db1371e10dace150 100644 (file)
@@ -1,6 +1,6 @@
-//  VISU OBJECT : interactive object for VISU entities implementation
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  VISU OBJECT : interactive object for VISU entities implementation
 //  File   : VISU_MeshAct.cxx
 //  Author : 
 //  Module : VISU
 //  $Header$
-
+//
 #include "VISU_MeshAct.h"
-#include "SVTK_DeviceActor.h"
 
 #include <vtkObjectFactory.h>
 #include <vtkRenderer.h>
@@ -76,6 +74,20 @@ VISU_MeshAct
 }
 
 
+//----------------------------------------------------------------------------
+void
+VISU_MeshAct
+::DeepCopy(VISU_Actor *theActor)
+{
+  if(VISU_MeshAct* anActor = dynamic_cast<VISU_MeshAct*>(theActor)){
+    Superclass::DeepCopy(theActor);
+    GetSurfaceProperty()->DeepCopy(anActor->GetSurfaceProperty());
+    GetEdgeProperty()->DeepCopy(anActor->GetEdgeProperty());
+    GetNodeProperty()->DeepCopy(anActor->GetNodeProperty());
+  }
+}
+
+
 //----------------------------------------------------------------------------
 void
 VISU_MeshAct
@@ -199,6 +211,64 @@ VISU_MeshAct
   myEdgeActor->UnShrink();
 }
 
+//----------------------------------------------------------------------------
+void
+VISU_MeshAct
+::SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed)
+{
+  Superclass::SetFeatureEdgesAllowed(theIsFeatureEdgesAllowed);
+
+  mySurfaceActor->SetFeatureEdgesAllowed(theIsFeatureEdgesAllowed);
+}
+
+void
+VISU_MeshAct
+::SetFeatureEdgesAngle(vtkFloatingPointType theValue)
+{
+  Superclass::SetFeatureEdgesAngle(theValue);
+
+  mySurfaceActor->SetFeatureEdgesAngle(theValue);
+}
+
+void
+VISU_MeshAct
+::SetFeatureEdgesFlags(bool theIsFeatureEdges,
+                      bool theIsBoundaryEdges,
+                      bool theIsManifoldEdges,
+                      bool theIsNonManifoldEdges)
+{
+  Superclass::SetFeatureEdgesFlags(theIsFeatureEdges,
+                                  theIsBoundaryEdges,
+                                  theIsManifoldEdges,
+                                  theIsNonManifoldEdges);
+
+  mySurfaceActor->SetFeatureEdgesFlags(theIsFeatureEdges,
+                                      theIsBoundaryEdges,
+                                      theIsManifoldEdges,
+                                      theIsNonManifoldEdges);
+}
+
+void
+VISU_MeshAct
+::SetFeatureEdgesColoring(bool theIsColoring)
+{
+  Superclass::SetFeatureEdgesColoring(theIsColoring);
+
+  mySurfaceActor->SetFeatureEdgesColoring(theIsColoring);
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_MeshAct
+::SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled)
+{
+  if(theIsFeatureEdgesEnabled && myRepresentation == VTK_POINTS)
+    return;
+
+  Superclass::SetFeatureEdgesEnabled(theIsFeatureEdgesEnabled);
+
+  mySurfaceActor->SetFeatureEdgesEnabled(theIsFeatureEdgesEnabled);
+}
 
 //----------------------------------------------------------------------------
 void 
@@ -213,6 +283,37 @@ VISU_MeshAct
     myEdgeActor->SetRepresentation(SVTK::Representation::Wireframe);
 }
 
+//----------------------------------------------------------------------------
+unsigned long int
+VISU_MeshAct
+::GetMemorySize()
+{
+  vtkDataSet* aDataSet;
+  unsigned long int aSize = Superclass::GetMemorySize();
+  {
+    aDataSet = mySurfaceActor->GetInput();
+    aSize += aDataSet->GetActualMemorySize() * 1024;
+
+    aDataSet = mySurfaceActor->GetMapper()->GetInput();
+    aSize += aDataSet->GetActualMemorySize() * 1024 * 2;
+  }
+  {
+    aDataSet = myEdgeActor->GetInput();
+    aSize += aDataSet->GetActualMemorySize() * 1024;
+
+    aDataSet = myEdgeActor->GetMapper()->GetInput();
+    aSize += aDataSet->GetActualMemorySize() * 1024 * 2;
+  }
+  {
+    aDataSet = myNodeActor->GetInput();
+    aSize += aDataSet->GetActualMemorySize() * 1024;
+
+    aDataSet = myNodeActor->GetMapper()->GetInput();
+    aSize += aDataSet->GetActualMemorySize() * 1024 * 2;
+  }
+  return aSize;
+}
+
 //----------------------------------------------------------------------------
 int
 VISU_MeshAct
@@ -244,6 +345,10 @@ VISU_MeshAct
     myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren);
     myEdgeActor->RenderOpaqueGeometry(ren);
     break;
+  case FeatureEdges :
+    mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+    mySurfaceActor->RenderOpaqueGeometry(ren);
+    break;
   }
   return 1;
 }
@@ -278,6 +383,10 @@ VISU_MeshAct
     myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren);
     myEdgeActor->RenderTranslucentGeometry(ren);
     break;
+  case FeatureEdges :
+    mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+    mySurfaceActor->RenderTranslucentGeometry(ren);
+    break;
   }
   return 1;
 }