]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix some problems.
authorjfa <jfa@opencascade.com>
Fri, 3 Feb 2006 12:56:46 +0000 (12:56 +0000)
committerjfa <jfa@opencascade.com>
Fri, 3 Feb 2006 12:56:46 +0000 (12:56 +0000)
src/VISU_I/VISU_CutLines_i.hh
src/VISU_I/VISU_CutPlanes_i.hh
src/VISU_I/VISU_DeformedShape_i.hh
src/VISU_I/VISU_IsoSurfaces_i.hh
src/VISU_I/VISU_Plot3D_i.hh
src/VISU_I/VISU_Prs3d_i.cc
src/VISU_I/VISU_Prs3d_i.hh
src/VISU_I/VISU_StreamLines_i.hh
src/VISU_I/VISU_Vectors_i.hh

index cdc7184a97ce058b7eb9deb1b05718bf31880141..7acb62a7474f32d541662fc4d9650d51e1c7093a 100644 (file)
@@ -38,7 +38,10 @@ namespace VISU{
     static int myNbPresent;
     CutLines_i();
     CutLines_i(const CutLines_i&);
+
   public:
+    typedef ScalarMap_i TSuperClass;
+
     explicit
     CutLines_i(Result_i* theResult,
               bool theAddToStudy);
index 66c2d913f970afa26cedcbdbb7227a22f0a67f9e..1ade49068c009fff88ab996c2ba11bb0ae2559a5 100644 (file)
@@ -38,7 +38,10 @@ namespace VISU{
     static int myNbPresent;
     CutPlanes_i();
     CutPlanes_i(const CutPlanes_i&);
+
   public:
+    typedef ScalarMap_i TSuperClass;
+
     explicit
     CutPlanes_i(Result_i* theResult,
                bool theAddToStudy);
index e6fccb4485313709dd9b7561ebfd96d9359453f8..814438d66ce8e3af4ef1c10c948f70ba75b6c174 100644 (file)
@@ -38,7 +38,10 @@ namespace VISU{
     static int myNbPresent;
     DeformedShape_i();
     DeformedShape_i(const DeformedShape_i&);
+
   public:
+    typedef ScalarMap_i TSuperClass;
+
     explicit
     DeformedShape_i(Result_i* theResult,
                    bool theAddToStudy);
index 94e099155f6c267a1d7d365f1cdeec9c80adde47..b10ef5204d10d50e9774b1abe41aaaad0a5ba19f 100644 (file)
@@ -38,7 +38,10 @@ namespace VISU{
     static int myNbPresent;
     IsoSurfaces_i();
     IsoSurfaces_i(const IsoSurfaces_i&);
+
   public:
+    typedef ScalarMap_i TSuperClass;
+
     explicit
     IsoSurfaces_i(Result_i* theResult,
                  bool theAddToStudy);
index a20df36301779223aebed246cbdef493e6e517e7..d612af1ef6148927d716cbb831d73eff638c01d5 100644 (file)
@@ -34,6 +34,8 @@ namespace VISU {
     Plot3D_i(const Plot3D_i&);
 
   public:
+    typedef ScalarMap_i TSuperClass;
+
     explicit
     Plot3D_i (Result_i* theResult, bool theAddToStudy = true);
     explicit
index 32338e4d0744c7f073ea5025d7944d37ea88c651..beaa4b6802dd62e4be121c7580948c3a48c6b8fa 100644 (file)
@@ -167,6 +167,22 @@ VISU::Prs3d_i
 
 
 //----------------------------------------------------------------------------
+void
+VISU::Prs3d_i
+::CheckDataSet() 
+{
+  vtkMapper *aMapper = myPipeLine->GetMapper();
+  vtkDataSet *aDataSet = aMapper->GetInput();
+  if (!aDataSet)
+    throw std::runtime_error("There is no input data !!!");
+  aDataSet->Update();
+  static float eps = VTK_LARGE_FLOAT * 0.1 ;
+  if (!aDataSet->GetNumberOfCells())
+    throw std::runtime_error("There are no visible elements");
+  if (aDataSet->GetLength() > eps)
+    throw std::runtime_error("Diagonal of the actor is too large !!!");
+}
+
 void
 VISU::Prs3d_i
 ::RemoveFromStudy() 
@@ -232,6 +248,8 @@ VISU::Prs3d_i
     }
 
     Update();
+    CheckDataSet();
+
     theActor->SetPrs3d(this);
     theActor->SetShrinkFactor();
     theActor->SetPosition(myOffset);
@@ -287,6 +305,7 @@ VISU::Prs3d_i
 {
   if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActors - this = "<<this);
   Update();
+  CheckDataSet();
   myUpdateActorsSignal();
 }
 
index a92161658e109add000487ac457df21384b388de..efdd55565bbb61f4428683202ad045c6bb29e1cc 100644 (file)
@@ -215,6 +215,11 @@ namespace VISU
     VISU_PipeLine* 
     GetPipeLine();
 
+    //! To check dataset validity, throws std::exception if not valid
+    virtual
+    void
+    CheckDataSet();
+
     bool myAddToStudy;
     float myOffset[3];
     Result_i *myResult;
index 2c5c4fef6f5a24e247ee5431d5899a23d2e1967f..31c9fe7d89714eb8f341a41b66c79f07d2da36b5 100644 (file)
@@ -39,7 +39,10 @@ namespace VISU{
     static int myNbPresent;
     StreamLines_i();
     StreamLines_i(const StreamLines_i&);
+
   public:
+    typedef DeformedShape_i TSuperClass;
+
     explicit
     StreamLines_i(Result_i* theResult,
                  bool theAddToStudy);
index d74c25edad368e9d65f555f85de4ba2153721ec5..88143087e71eaf5c8fda7a62ea628ca58017a8e2 100644 (file)
@@ -38,7 +38,10 @@ namespace VISU{
     static int myNbPresent;
     Vectors_i();
     Vectors_i(const Vectors_i&);
+
   public:
+    typedef DeformedShape_i TSuperClass;
+
     explicit
     Vectors_i(Result_i* theResult,
              bool theAddToStudy);