From 486ffef058aef2cf3e9388e04aaad27a71094c59 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 3 Dec 2014 11:15:20 +0300 Subject: [PATCH] 0022813: [CEA 1336] Regression : sigsegv at the med file openning --- src/SVTK/CMakeLists.txt | 8 ++++---- src/SVTK/SVTK_ViewWindow.cxx | 8 ++++---- src/SVTK/SVTK_ViewWindow.h | 7 +++++-- ...AxesActor.cxx => salomevtkPVAxesActor.cxx} | 13 +++++++++++- ...tkPVAxesActor.h => salomevtkPVAxesActor.h} | 17 ++++++++++++---- ...esWidget.cxx => salomevtkPVAxesWidget.cxx} | 14 +++++++++++-- ...PVAxesWidget.h => salomevtkPVAxesWidget.h} | 20 ++++++++++++++----- 7 files changed, 65 insertions(+), 22 deletions(-) rename src/SVTK/{vtkPVAxesActor.cxx => salomevtkPVAxesActor.cxx} (98%) rename src/SVTK/{vtkPVAxesActor.h => salomevtkPVAxesActor.h} (95%) rename src/SVTK/{vtkPVAxesWidget.cxx => salomevtkPVAxesWidget.cxx} (97%) rename src/SVTK/{vtkPVAxesWidget.h => salomevtkPVAxesWidget.h} (90%) diff --git a/src/SVTK/CMakeLists.txt b/src/SVTK/CMakeLists.txt index 22a93e45d..955302b26 100755 --- a/src/SVTK/CMakeLists.txt +++ b/src/SVTK/CMakeLists.txt @@ -105,8 +105,8 @@ SET(_other_HEADERS SET(_internal_HEADERS SVTK_SelectorDef.h SVTK_Trihedron.h - vtkPVAxesActor.h - vtkPVAxesWidget.h + salomevtkPVAxesActor.h + salomevtkPVAxesWidget.h ) # header files / to install @@ -181,8 +181,8 @@ SET(_other_SOURCES SVTK_ViewModel.cxx SVTK_ViewParameterDlg.cxx SVTK_ViewWindow.cxx - vtkPVAxesActor.cxx - vtkPVAxesWidget.cxx + salomevtkPVAxesActor.cxx + salomevtkPVAxesWidget.cxx ) # sources / to compile diff --git a/src/SVTK/SVTK_ViewWindow.cxx b/src/SVTK/SVTK_ViewWindow.cxx index 49b496192..19f924966 100755 --- a/src/SVTK/SVTK_ViewWindow.cxx +++ b/src/SVTK/SVTK_ViewWindow.cxx @@ -93,8 +93,8 @@ #include "SVTK_Recorder.h" #include "SVTK_RecorderDlg.h" -#include "vtkPVAxesWidget.h" -#include "vtkPVAxesActor.h" +#include "salomevtkPVAxesWidget.h" +#include "salomevtkPVAxesActor.h" #include "SALOME_ListIO.hxx" @@ -213,14 +213,14 @@ void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel) setCentralWidget(myInteractor); - myAxesWidget = vtkPVAxesWidget::New(); + myAxesWidget = salomevtk::vtkPVAxesWidget::New(); myAxesWidget->SetParentRenderer(aRenderer->GetDevice()); myAxesWidget->SetViewport(0, 0, 0.25, 0.25); myAxesWidget->SetInteractor(myInteractor->GetDevice()); myAxesWidget->SetEnabled(1); myAxesWidget->SetInteractive(0); - vtkPVAxesActor* anAxesActor = myAxesWidget->GetAxesActor(); + salomevtk::vtkPVAxesActor* anAxesActor = myAxesWidget->GetAxesActor(); anAxesActor->GetXAxisTipProperty()->SetColor( 1.0, 0.0, 0.0 ); anAxesActor->GetXAxisShaftProperty()->SetColor( 1.0, 0.0, 0.0 ); anAxesActor->GetXAxisLabelProperty()->SetColor( 1.0, 0.0, 0.0 ); diff --git a/src/SVTK/SVTK_ViewWindow.h b/src/SVTK/SVTK_ViewWindow.h index ef6eb8a55..ea6f67236 100755 --- a/src/SVTK/SVTK_ViewWindow.h +++ b/src/SVTK/SVTK_ViewWindow.h @@ -66,7 +66,10 @@ class SVTK_KeyFreeInteractorStyle; class SVTK_ViewParameterDlg; class SVTK_Recorder; -class vtkPVAxesWidget; +namespace salomevtk +{ + class vtkPVAxesWidget; +} class vtkObject; class QtxAction; @@ -453,7 +456,7 @@ protected: int myToolBar; int myRecordingToolBar; - vtkPVAxesWidget* myAxesWidget; + salomevtk::vtkPVAxesWidget* myAxesWidget; Qtx::BackgroundData myBackground; private: diff --git a/src/SVTK/vtkPVAxesActor.cxx b/src/SVTK/salomevtkPVAxesActor.cxx similarity index 98% rename from src/SVTK/vtkPVAxesActor.cxx rename to src/SVTK/salomevtkPVAxesActor.cxx index 4431e3ea6..da12e3525 100644 --- a/src/SVTK/vtkPVAxesActor.cxx +++ b/src/SVTK/salomevtkPVAxesActor.cxx @@ -29,7 +29,11 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. =========================================================================*/ -#include "vtkPVAxesActor.h" +// +// VSR 03/12/2014: the original file vtkPVAxesActor.cxx has been renamed to salomevtkPVAxesActor.cxx +// to avoid collisions with native VTK/ParaView classes + +#include "salomevtkPVAxesActor.h" // changed by SALOME #include "vtkObject.h" #include "vtkObjectFactory.h" @@ -50,6 +54,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include +// VSR 03/12/2014: we put classes copied from VTK/ParaView to the specific namespace +// to avoid collisions with native VTK/ParaView classes +namespace salomevtk +{ + vtkStandardNewMacro(vtkPVAxesActor); vtkCxxSetObjectMacro( vtkPVAxesActor, UserDefinedTip, vtkPolyData ); @@ -807,3 +816,5 @@ void vtkPVAxesActor::AddToRender( vtkRenderer* theRenderer ) theRenderer->AddActor(this->YAxisLabel); theRenderer->AddActor(this->ZAxisLabel); } + +} // end of salomevtk namespace diff --git a/src/SVTK/vtkPVAxesActor.h b/src/SVTK/salomevtkPVAxesActor.h similarity index 95% rename from src/SVTK/vtkPVAxesActor.h rename to src/SVTK/salomevtkPVAxesActor.h index b76f59f93..6ab2edb8e 100644 --- a/src/SVTK/vtkPVAxesActor.h +++ b/src/SVTK/salomevtkPVAxesActor.h @@ -35,12 +35,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // vtkPVAxesActor is used to represent 3D axes in the scene. The user can // define the geometry to use for the shaft and the tip, and the user can // set the text for the three axes. The text will follow the camera. +// +// VSR 03/12/2014: the original file vtkPVAxesActor.h has been renamed to salomevtkPVAxesActor.h +// to avoid collisions with native VTK/ParaView classes +#ifndef __salomevtkPVAxesActor_h +#define __salomevtkPVAxesActor_h -#ifndef __vtkPVAxesActor_h -#define __vtkPVAxesActor_h - -#include "SVTK.h" +#include "SVTK.h" // added by SALOME #include "vtkProp3D.h" #include @@ -58,6 +60,11 @@ class vtkSphereSource; class vtkPolyData; class vtkVectorText; +// VSR 03/12/2014: we put classes copied from VTK/ParaView to the specific namespace +// to avoid collisions with native VTK/ParaView classes +namespace salomevtk +{ + class SVTK_EXPORT vtkPVAxesActor : public vtkProp3D { public: @@ -291,5 +298,7 @@ private: void operator=(const vtkPVAxesActor&); // Not implemented. }; +} // end of salomevtk namespace + #endif diff --git a/src/SVTK/vtkPVAxesWidget.cxx b/src/SVTK/salomevtkPVAxesWidget.cxx similarity index 97% rename from src/SVTK/vtkPVAxesWidget.cxx rename to src/SVTK/salomevtkPVAxesWidget.cxx index b83b1dea3..c73d4730b 100644 --- a/src/SVTK/vtkPVAxesWidget.cxx +++ b/src/SVTK/salomevtkPVAxesWidget.cxx @@ -29,7 +29,11 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. =========================================================================*/ -#include "vtkPVAxesWidget.h" +// VSR 03/12/2014: the original file vtkPVAxesWidget.cxx has been renamed to salomevtkPVAxesWidget.cxx +// to avoid collisions with native VTK/ParaView classes + +#include "salomevtkPVAxesWidget.h" // changed by SALOME +#include "salomevtkPVAxesActor.h" // changed by SALOME #include "vtkActor2D.h" #include "vtkCallbackCommand.h" @@ -41,11 +45,15 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "vtkPolyDataMapper2D.h" #include "vtkProperty.h" #include "vtkProperty2D.h" -#include "vtkPVAxesActor.h" #include "vtkRenderer.h" #include "vtkRenderWindow.h" #include "vtkRenderWindowInteractor.h" +// VSR 03/12/2014: we put classes copied from VTK/ParaView to the specific namespace +// to avoid collisions with native VTK/ParaView classes +namespace salomevtk +{ + vtkStandardNewMacro(vtkPVAxesWidget); vtkCxxSetObjectMacro(vtkPVAxesWidget, AxesActor, vtkPVAxesActor); @@ -866,3 +874,5 @@ void vtkPVAxesWidget::PrintSelf(ostream& os, vtkIndent indent) os << indent << "AxesActor: " << this->AxesActor << endl; os << indent << "Interactive: " << this->Interactive << endl; } + +} // end of salomevtk namespace diff --git a/src/SVTK/vtkPVAxesWidget.h b/src/SVTK/salomevtkPVAxesWidget.h similarity index 90% rename from src/SVTK/vtkPVAxesWidget.h rename to src/SVTK/salomevtkPVAxesWidget.h index cc2bba8e1..bb68fa5d9 100644 --- a/src/SVTK/vtkPVAxesWidget.h +++ b/src/SVTK/salomevtkPVAxesWidget.h @@ -33,21 +33,29 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // .SECTION Description // This widget creates and manages its own vtkPVAxesActor. +// VSR 03/12/2014: the original file vtkPVAxesWidget.h has been renamed to salomevtkPVAxesWidget.h +// to avoid collisions with native VTK/ParaView classes -#ifndef __vtkPVAxesWidget_h -#define __vtkPVAxesWidget_h +#ifndef __salomevtkPVAxesWidget_h +#define __salomevtkPVAxesWidget_h -#include "SVTK.h" +#include "SVTK.h" // added by SALOME #include "vtkInteractorObserver.h" class vtkActor2D; class vtkKWApplication; class vtkPolyData; -class vtkPVAxesActor; -class vtkPVAxesWidgetObserver; class vtkRenderer; +// VSR 03/12/2014: we put classes copied from VTK/ParaView to the specific namespace +// to avoid collisions with native VTK/ParaView classes +namespace salomevtk +{ + +class vtkPVAxesWidgetObserver; +class vtkPVAxesActor; + class SVTK_EXPORT vtkPVAxesWidget : public vtkInteractorObserver { public: @@ -156,4 +164,6 @@ private: void operator=(const vtkPVAxesWidget&); // Not implemented }; +} // end of salomevtk namespace + #endif -- 2.39.2