Salome HOME
PR: merged from V5_1_4rc1
[modules/smesh.git] / src / OBJECT / SMESH_DeviceActor.cxx
index 4d0626902228f86a9e23f10e27d43179e588b445..4be8cadec51d855ad2af99e58b2fdf3d1a0c9b83 100644 (file)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SMESH OBJECT : interactive object for SMESH visualization
 //  File   : SMESH_DeviceActor.cxx
 //  Author : 
 //  Module : SMESH
 //
-
 #include "SMESH_DeviceActor.h"
 #include "SMESH_ExtractGeometry.h"
 #include "SMESH_ControlsDef.hxx"
 #include "SMESH_ActorUtils.h"
 #include "SMESH_FaceOrientationFilter.h"
 #include "VTKViewer_CellLocationsArray.h"
+#include "VTKViewer_PolyDataMapper.h"
 
 #include <VTKViewer_Transform.h>
 #include <VTKViewer_TransformFilter.h>
@@ -88,7 +89,7 @@ SMESH_DeviceActor
   myRepresentation = eSurface;
 
   myProperty = vtkProperty::New();
-  myMapper = vtkPolyDataMapper::New();
+  myMapper = VTKViewer_PolyDataMapper::New();
 
   vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
                                                                  myPolygonOffsetUnits);
@@ -625,6 +626,48 @@ SMESH_DeviceActor
   }
 }
 
+void
+SMESH_DeviceActor
+::SetFacesOrientationColor(vtkFloatingPointType theColor[3])
+{
+  myFaceOrientation->GetProperty()->SetColor( theColor );
+}
+
+void
+SMESH_DeviceActor
+::GetFacesOrientationColor(vtkFloatingPointType theColor[3])
+{
+  myFaceOrientation->GetProperty()->GetColor( theColor );
+}
+
+void
+SMESH_DeviceActor
+::SetFacesOrientationScale(vtkFloatingPointType theScale)
+{
+  myFaceOrientationFilter->SetOrientationScale( theScale );
+}
+
+vtkFloatingPointType
+SMESH_DeviceActor
+::GetFacesOrientationScale()
+{
+  return myFaceOrientationFilter->GetOrientationScale();
+}
+
+void
+SMESH_DeviceActor
+::SetFacesOrientation3DVectors(bool theState)
+{
+  myFaceOrientationFilter->Set3dVectors( theState );
+}
+
+bool
+SMESH_DeviceActor
+::GetFacesOrientation3DVectors()
+{
+  return myFaceOrientationFilter->Get3dVectors();
+}
+
 void
 SMESH_DeviceActor
 ::UpdateFaceOrientation()
@@ -661,6 +704,7 @@ SMESH_DeviceActor
     myGeomFilter->SetWireframeMode(false);
     GetProperty()->SetRepresentation(theMode);
   }
+  SetMarkerEnabled(theMode == ePoint);
   myRepresentation = theMode;
   UpdateFaceOrientation();
   GetProperty()->Modified();
@@ -859,3 +903,58 @@ void SMESH_DeviceActor::SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle){
 vtkFloatingPointType SMESH_DeviceActor::GetQuadraticArcAngle(){
   return myGeomFilter->GetQuadraticArcAngle();
 }
+
+/*!
+ * Set point marker enabled
+ * \param theMarkerEnabled flag to enable/disable point marker
+ */
+void SMESH_DeviceActor::SetMarkerEnabled( bool theMarkerEnabled )
+{
+  myMapper->SetMarkerEnabled( theMarkerEnabled );
+}
+
+/*!
+ * Set standard point marker
+ * \param theMarkerType type of the marker
+ */
+void SMESH_DeviceActor::SetMarkerStd( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale )
+{
+  myMapper->SetMarkerStd( theMarkerType, theMarkerScale );
+}
+
+/*!
+ * Set custom point marker
+ * \param theMarkerId id of the marker texture
+ * \param theMarkerTexture marker texture
+ */
+void SMESH_DeviceActor::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture theMarkerTexture )
+{
+  myMapper->SetMarkerTexture( theMarkerId, theMarkerTexture );
+}
+
+/*!
+ * Get type of the point marker
+ * \return type of the point marker
+ */
+VTK::MarkerType SMESH_DeviceActor::GetMarkerType()
+{
+  return myMapper->GetMarkerType();
+}
+
+/*!
+  Get scale of the point marker
+  \return scale of the point marker
+*/
+VTK::MarkerScale SMESH_DeviceActor::GetMarkerScale()
+{
+  return myMapper->GetMarkerScale();
+}
+
+/*!
+ * Get texture identifier of the point marker
+ * \return texture identifier of the point marker
+ */
+int SMESH_DeviceActor::GetMarkerTexture()
+{
+  return myMapper->GetMarkerTexture();
+}