Salome HOME
Fixed method GetSame for the case of two cylindrical surfaces that are part of the...
[modules/geom.git] / src / OBJECT / GEOM_Actor.cxx
index 0ebbf32f4e412e0d78df0246bba60bbe9e8e3bf3..e1ff415418bc65d33122661f1d44c6921443ed0b 100644 (file)
@@ -17,7 +17,7 @@
 //  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
 //
 //
 //
@@ -42,6 +42,7 @@
 #include <vtkMatrix4x4.h>
 #include <vtkMath.h>
 
+#include <vtkProperty.h>
 #include <vtkRenderer.h>
 #include <vtkCamera.h>
 
@@ -112,7 +113,7 @@ void GEOM_Actor::ShallowCopy(vtkProp *prop)
   GEOM_Actor *f = GEOM_Actor::SafeDownCast(prop);
   if ( f != NULL )
     {
-      this->setInputShape(f->getTopo(),f->getDeflection(),f->getDisplayMode());
+      this->setInputShape(f->getTopo(),f->getDeflection(),f->getDisplayMode(),f->isVector());
       this->setName( f->getName() );
       if ( f->hasIO() )
        this->setIO( f->getIO() );
@@ -154,9 +155,12 @@ void GEOM_Actor::setDeflection(double adef) {
   deflection = adef;
 }
 
-void GEOM_Actor::setInputShape(const TopoDS_Shape& aShape,double adef,int imode) {
+void GEOM_Actor::setInputShape(const TopoDS_Shape& aShape, double adef,
+                               int imode, bool isVector)
+{
   myShape = aShape;
   deflection = adef;
+  myIsVector = isVector;
   setDisplayMode(imode);
 }
 
@@ -185,16 +189,16 @@ void GEOM_Actor::SetShadingProperty(vtkProperty* Prop) {
 // Mapper creating function
 //-------------------------------------------------------------
 void GEOM_Actor::CreateMapper(int theMode) {
-  this->myIsInfinite = myShape.Infinite();  
+  this->myIsInfinite = (bool)myShape.Infinite();  
   if(myShape.ShapeType() == TopAbs_VERTEX) {
     gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(myShape));
     this->SetPosition(aPnt.X(),aPnt.Y(),aPnt.Z());
   }
   GEOM_OCCReader* aread = GEOM_OCCReader::New();
-  aread->setTopo(myShape);
+  aread->setTopo(myShape, myIsVector);
   aread->setDisplayMode(theMode);
   aread->GetOutput()->ReleaseDataFlagOn(); 
-    
+
   vtkPolyDataMapper* aMapper = vtkPolyDataMapper::New();
   if (theMode == 0) { 
     aMapper->SetInput(aread->GetOutput());
@@ -274,10 +278,10 @@ void GEOM_Actor::Render(vtkRenderer *ren, vtkMapper *Mapper)
   if(myShape.ShapeType() == TopAbs_VERTEX) {
     if(ren){
       //The parameter determine size of vertex actor relate to diagonal of RendererWindow
-      static float delta = 0.01;
-      float X1 = -1, Y1 = -1, Z1 = 0;
+      static vtkFloatingPointType delta = 0.01;
+      vtkFloatingPointType X1 = -1, Y1 = -1, Z1 = 0;
       ren->ViewToWorld(X1,Y1,Z1);
-      float X2 = +1, Y2 = +1, Z2 = 0;
+      vtkFloatingPointType X2 = +1, Y2 = +1, Z2 = 0;
       ren->ViewToWorld(X2,Y2,Z2);
       Z2 = sqrt((X2-X1)*(X2-X1) + (Y2-Y1)*(Y2-Y1) + (Z2-Z1)*(Z2-Z1));
       this->SetScale(Z2*delta);
@@ -307,26 +311,26 @@ void GEOM_Actor::SubShapeOff()
 // Opacity methods
 //-------------------------------------------------------------
 
-void GEOM_Actor::SetOpacity(float opa)
+void GEOM_Actor::SetOpacity(vtkFloatingPointType opa)
 {
   //HighlightProperty->SetOpacity(opa);
   SALOME_Actor::SetOpacity(opa);
   ShadingProperty->SetOpacity(opa);
 }
 
-float GEOM_Actor::GetOpacity() {
+vtkFloatingPointType GEOM_Actor::GetOpacity() {
   return ShadingProperty->GetOpacity();
 }
 
 //-------------------------------------------------------------
 // Color methods
 //-------------------------------------------------------------
-void GEOM_Actor::SetColor(float r,float g,float b) {
+void GEOM_Actor::SetColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) {
   ShadingProperty->SetColor(r,g,b);  
 }
 
-void GEOM_Actor::GetColor(float& r,float& g,float& b) {
-  float color[3];
+void GEOM_Actor::GetColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) {
+  vtkFloatingPointType color[3];
   ShadingProperty->GetColor(color);
   r = color[0];
   g = color[1];