]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Some correction
authorenk <enk@opencascade.com>
Mon, 30 May 2005 11:37:19 +0000 (11:37 +0000)
committerenk <enk@opencascade.com>
Mon, 30 May 2005 11:37:19 +0000 (11:37 +0000)
src/VTKFilter/SALOME_CubeAxesActor2D.cxx
src/VTKFilter/SALOME_Transform.cxx
src/VTKFilter/SALOME_Transform.h

index 0d047aa3217369bb60a8cd7b9f8e8b2c8a6d995e..aa61f368c5e106c1841e6c1a7475538bb52b81b0 100644 (file)
@@ -101,25 +101,27 @@ SALOME_CubeAxesActor2D::SALOME_CubeAxesActor2D()
   this->YAxis->SetProperty(this->GetProperty());
   this->ZAxis->SetProperty(this->GetProperty());
 
-  if (this->AxisLabelTextProperty)
-    {
-      if (this->XAxis->GetLabelTextProperty())
-       this->XAxis->GetLabelTextProperty()->ShallowCopy(this->AxisLabelTextProperty);
-      if (this->YAxis->GetLabelTextProperty())
-       this->YAxis->GetLabelTextProperty()->ShallowCopy(this->AxisLabelTextProperty);
-      if (this->ZAxis->GetLabelTextProperty())
-       this->ZAxis->GetLabelTextProperty()->ShallowCopy(this->AxisLabelTextProperty);
-    }
+  vtkTextProperty* aTLProp = vtkTextProperty::New();
+  aTLProp->SetBold(0);
+  aTLProp->SetItalic(0);
+  aTLProp->SetShadow(0);
+  aTLProp->SetFontFamilyToArial();
+  aTLProp->SetColor(1,1,1);
+  if (this->XAxis->GetLabelTextProperty())
+    this->XAxis->GetLabelTextProperty()->ShallowCopy(aTLProp);
+  if (this->YAxis->GetLabelTextProperty())
+    this->YAxis->GetLabelTextProperty()->ShallowCopy(aTLProp);
+  if (this->ZAxis->GetLabelTextProperty())
+    this->ZAxis->GetLabelTextProperty()->ShallowCopy(aTLProp);;
   
-  if (this->AxisTitleTextProperty)
-    {
-      if (this->XAxis->GetLabelTextProperty())
-         this->XAxis->GetTitleTextProperty()->ShallowCopy(this->AxisTitleTextProperty);
-      if (this->YAxis->GetLabelTextProperty())
-       this->YAxis->GetTitleTextProperty()->ShallowCopy(this->AxisTitleTextProperty);
-      if (this->ZAxis->GetLabelTextProperty())
-       this->ZAxis->GetTitleTextProperty()->ShallowCopy(this->AxisTitleTextProperty);
-    }
+  if (this->XAxis->GetLabelTextProperty())
+    this->XAxis->GetTitleTextProperty()->ShallowCopy(aTLProp);
+  if (this->YAxis->GetLabelTextProperty())
+    this->YAxis->GetTitleTextProperty()->ShallowCopy(aTLProp);
+  if (this->ZAxis->GetLabelTextProperty())
+    this->ZAxis->GetTitleTextProperty()->ShallowCopy(aTLProp);
+  
+  aTLProp->Delete();
   
 }
 
index 3ca3b485e481d121cc2d71d9d3708529804d5252..c47f47573c102bb865c74acb04647d42b8b56667 100644 (file)
 #include <vtkObjectFactory.h>
 #include <vtkMatrix4x4.h>
 
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
+static double EPS = 10e-4;
 
 using namespace std;
 
@@ -47,10 +43,6 @@ void SALOME_Transform::SetMatrixScale(double theScaleX, double theScaleY, double
                         0,0,theScaleZ,0, 
                         0,0,0,1.0000000};
   this->SetMatrix(aMatrix);
-  if(MYDEBUG)
-    cout << __FILE__ << "[" << __LINE__ << "]:" << endl
-        << "SetMatrixSize" << endl
-        << "\t theScaleX=" << theScaleX << " theScaleY=" << theScaleY << " theScaleZ=" << theScaleZ << endl;
 }
 
 void SALOME_Transform::GetMatrixScale(double theScale[3]){
@@ -61,14 +53,12 @@ void SALOME_Transform::GetMatrixScale(double theScale[3]){
   theScale[0] = aScaleX;
   theScale[1] = aScaleY;
   theScale[2] = aScaleZ;
-  if(MYDEBUG)
-    cout << __FILE__ << "[" << __LINE__ << "]:" << endl
-        << "GetMatrixSize" << endl
-        << "\t theScaleX=" << theScale[0] << " theScaleY=" << theScale[1] << " theScaleZ=" << theScale[2] << endl;
 }
 
 int SALOME_Transform::IsIdentity(){ 
   double aScale[3];
   this->GetMatrixScale(aScale);
-  return (aScale[0] == 1.0 && aScale[1] == 1.0 && aScale[2] == 1.0);
+  return (fabs(aScale[0] - 1.0) < EPS && 
+         fabs(aScale[1] - 1.0) < EPS && 
+         fabs(aScale[2] - 1.0) < EPS);
 }
index a6c1b6f8c1e8d41c38d361711e5091b0fefc5545..3431750f1ca5347d9236444c22cf5966e49a4b94 100644 (file)
@@ -36,7 +36,6 @@ class VTK_EXPORT SALOME_Transform : public vtkTransform{
   static SALOME_Transform *New();
   vtkTypeMacro(SALOME_Transform,vtkTransform);
 
-  //void SetScale(float theScaleX, float theScaleY, float theScaleZ);
   void SetMatrixScale(double theScaleX, double theScaleY, double theScaleZ);
   void GetMatrixScale(double theScale[3]);
   int IsIdentity();