From: apo Date: Tue, 11 Apr 2006 07:37:39 +0000 (+0000) Subject: Fix on Bug1984 X-Git-Tag: T3_2_0b1_pre1~25 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6dcedbbc6886f7a06b06508997dab07a146cd3ef;p=modules%2Fvisu.git Fix on Bug1984 TC: Sphere and Plane segmentation for planar mesh give SIGFPE fatal error - Additional checks were provided in order to avoid calaculation on invalid bounding boxes --- diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index 64acea7b..0568b2f5 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -603,7 +603,9 @@ VISU_GaussPtsAct } //---------------------------------------------------------------------------- -bool VISU_GaussPtsAct::IsInfinitive() +bool +VISU_GaussPtsAct +::IsInfinitive() { if(vtkMapper* aMapper = myDeviceActor->GetMapper()){ if(vtkDataSet* aDataSet= aMapper->GetInput()){ @@ -614,6 +616,14 @@ bool VISU_GaussPtsAct::IsInfinitive() return myIsInfinite; } +//---------------------------------------------------------------------------- +int +VISU_GaussPtsAct +::GetPickable() +{ + return myDeviceActor->GetPickable(); +} + //---------------------------------------------------------------------------- bool VISU_GaussPtsAct diff --git a/src/OBJECT/VISU_GaussPtsAct.h b/src/OBJECT/VISU_GaussPtsAct.h index 105db840..ef7279c6 100644 --- a/src/OBJECT/VISU_GaussPtsAct.h +++ b/src/OBJECT/VISU_GaussPtsAct.h @@ -231,6 +231,10 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor bool IsInfinitive(); + virtual + int + GetPickable(); + protected: //---------------------------------------------------------------------------- VISU_GaussPtsAct(); diff --git a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx index cc600ca7..912c2e0a 100644 --- a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx +++ b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx @@ -152,6 +152,22 @@ VISU_GaussPtsDeviceActor return myMapper.GetPointer(); } +int +VISU_GaussPtsDeviceActor +::GetPickable() +{ + if(Superclass::GetPickable()){ + if(vtkMapper* aMapper = GetPSMapper()){ + if(vtkDataSet* aDataSet= aMapper->GetInput()){ + aDataSet->Update(); + return aDataSet->GetNumberOfCells() > 0; + } + } + } + + return false; +} + //---------------------------------------------------------------------------- void diff --git a/src/OBJECT/VISU_GaussPtsDeviceActor.h b/src/OBJECT/VISU_GaussPtsDeviceActor.h index 096c91c1..c03d736c 100644 --- a/src/OBJECT/VISU_GaussPtsDeviceActor.h +++ b/src/OBJECT/VISU_GaussPtsDeviceActor.h @@ -79,6 +79,10 @@ class VISU_GaussPtsDeviceActor: public vtkLODActor VISU_OpenGLPointSpriteMapper* GetPSMapper(); + virtual + int + GetPickable(); + protected: //---------------------------------------------------------------------------- vtkSmartPointer myPipeLine;