From a9660929049d3655adcbc96296577d51776508e9 Mon Sep 17 00:00:00 2001 From: abv Date: Tue, 15 Aug 2017 16:04:45 +0300 Subject: [PATCH] 0028452: VIS - MSVC 14 compiler warnings Includes of VTK headers are wrapped in #pragmas to ensure that MSVC warning messages disabled by VTK headers are still enabled for OCCT code --- src/IVtkDraw/IVtkDraw.cxx | 9 ++++- ...IVtkDraw_HighlightAndSelectionPipeline.cxx | 7 ++++ ...IVtkDraw_HighlightAndSelectionPipeline.hxx | 7 ++++ src/IVtkDraw/IVtkDraw_Interactor.cxx | 38 +++++++++---------- src/IVtkDraw/IVtkDraw_Interactor.hxx | 8 ++++ src/IVtkTools/IVtkTools.cxx | 8 ++++ src/IVtkTools/IVtkTools_DisplayModeFilter.cxx | 8 ++++ src/IVtkTools/IVtkTools_ShapeDataSource.cxx | 8 +++- src/IVtkTools/IVtkTools_ShapeObject.cxx | 8 ++++ src/IVtkTools/IVtkTools_ShapeObject.hxx | 8 ++++ src/IVtkTools/IVtkTools_ShapePicker.cxx | 8 ++++ src/IVtkTools/IVtkTools_ShapePicker.hxx | 8 ++++ src/IVtkTools/IVtkTools_SubPolyDataFilter.cxx | 9 ++++- src/IVtkVTK/IVtkVTK_ShapeData.cxx | 8 ++++ src/IVtkVTK/IVtkVTK_ShapeData.hxx | 8 ++++ src/IVtkVTK/IVtkVTK_View.cxx | 8 ++++ 16 files changed, 136 insertions(+), 22 deletions(-) diff --git a/src/IVtkDraw/IVtkDraw.cxx b/src/IVtkDraw/IVtkDraw.cxx index 364e73fed3..18ccdb92d8 100644 --- a/src/IVtkDraw/IVtkDraw.cxx +++ b/src/IVtkDraw/IVtkDraw.cxx @@ -85,6 +85,11 @@ #include #include +// prevent disabling some MSVC warning messages by VTK headers +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4244) +#endif #include #include #include @@ -107,7 +112,6 @@ #include #include #include - #ifndef _WIN32 #include #include @@ -119,6 +123,9 @@ #include #include #endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif // workaround name conflicts with OCCT methods (in class TopoDS_Shape for example) #ifdef Convex diff --git a/src/IVtkDraw/IVtkDraw_HighlightAndSelectionPipeline.cxx b/src/IVtkDraw/IVtkDraw_HighlightAndSelectionPipeline.cxx index 098e94d46a..d20883b008 100644 --- a/src/IVtkDraw/IVtkDraw_HighlightAndSelectionPipeline.cxx +++ b/src/IVtkDraw/IVtkDraw_HighlightAndSelectionPipeline.cxx @@ -15,6 +15,10 @@ #include +// prevent disabling some MSVC warning messages by VTK headers +#ifdef _MSC_VER +#pragma warning(push) +#endif #include #include #include @@ -22,6 +26,9 @@ #include #include #include +#ifdef _MSC_VER +#pragma warning(pop) +#endif #include #include diff --git a/src/IVtkDraw/IVtkDraw_HighlightAndSelectionPipeline.hxx b/src/IVtkDraw/IVtkDraw_HighlightAndSelectionPipeline.hxx index 863de75227..a8e8574cf0 100644 --- a/src/IVtkDraw/IVtkDraw_HighlightAndSelectionPipeline.hxx +++ b/src/IVtkDraw/IVtkDraw_HighlightAndSelectionPipeline.hxx @@ -21,11 +21,18 @@ #include #include +// prevent disabling some MSVC warning messages by VTK headers +#ifdef _MSC_VER +#pragma warning(push) +#endif #include #include #include #include #include +#ifdef _MSC_VER +#pragma warning(pop) +#endif #include #include diff --git a/src/IVtkDraw/IVtkDraw_Interactor.cxx b/src/IVtkDraw/IVtkDraw_Interactor.cxx index 5911cc116f..9401662dd4 100644 --- a/src/IVtkDraw/IVtkDraw_Interactor.cxx +++ b/src/IVtkDraw/IVtkDraw_Interactor.cxx @@ -13,10 +13,28 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +// prevent disabling some MSVC warning messages by VTK headers +#ifdef _MSC_VER +#pragma warning(push) +#endif #ifdef _WIN32 -#include #include #include +#else +#include +#include +#include +#endif +#include +#include +#include +#include +#include + +#include + +#ifdef _MSC_VER +#pragma warning(pop) #endif #include @@ -24,28 +42,10 @@ #include #include #include -#include #include #include -#include -#include -#include -#include -#include - -#ifndef _WIN32 -#include -#include -#include -#include -#include -#include -#include -#include -#endif - //=========================================================== // Function : ClearHighlightAndSelection // Purpose : diff --git a/src/IVtkDraw/IVtkDraw_Interactor.hxx b/src/IVtkDraw/IVtkDraw_Interactor.hxx index 78bdba21f5..9a1977c833 100644 --- a/src/IVtkDraw/IVtkDraw_Interactor.hxx +++ b/src/IVtkDraw/IVtkDraw_Interactor.hxx @@ -30,8 +30,16 @@ #include #endif +// prevent disabling some MSVC warning messages by VTK headers +#ifdef _MSC_VER +#pragma warning(push) +#endif #include #include +#ifdef _MSC_VER +#pragma warning(pop) +#endif + #include #include #include diff --git a/src/IVtkTools/IVtkTools.cxx b/src/IVtkTools/IVtkTools.cxx index 8a93a3e91a..7d4d048ec6 100644 --- a/src/IVtkTools/IVtkTools.cxx +++ b/src/IVtkTools/IVtkTools.cxx @@ -15,8 +15,16 @@ #include #include + +// prevent disabling some MSVC warning messages by VTK headers +#ifdef _MSC_VER +#pragma warning(push) +#endif #include #include +#ifdef _MSC_VER +#pragma warning(pop) +#endif namespace IVtkTools { diff --git a/src/IVtkTools/IVtkTools_DisplayModeFilter.cxx b/src/IVtkTools/IVtkTools_DisplayModeFilter.cxx index 10bc6f258a..bad36053f0 100644 --- a/src/IVtkTools/IVtkTools_DisplayModeFilter.cxx +++ b/src/IVtkTools/IVtkTools_DisplayModeFilter.cxx @@ -15,9 +15,17 @@ #include #include + +// prevent disabling some MSVC warning messages by VTK headers +#ifdef _MSC_VER +#pragma warning(push) +#endif #include #include #include +#ifdef _MSC_VER +#pragma warning(pop) +#endif vtkStandardNewMacro(IVtkTools_DisplayModeFilter) diff --git a/src/IVtkTools/IVtkTools_ShapeDataSource.cxx b/src/IVtkTools/IVtkTools_ShapeDataSource.cxx index 2d4f4c2f0d..3c1e754c52 100644 --- a/src/IVtkTools/IVtkTools_ShapeDataSource.cxx +++ b/src/IVtkTools/IVtkTools_ShapeDataSource.cxx @@ -18,7 +18,10 @@ #include #include -// VTK includes +// prevent disabling some MSVC warning messages by VTK headers +#ifdef _MSC_VER +#pragma warning(push) +#endif #include #include #include @@ -27,6 +30,9 @@ #include #include #include +#ifdef _MSC_VER +#pragma warning(pop) +#endif vtkStandardNewMacro(IVtkTools_ShapeDataSource) diff --git a/src/IVtkTools/IVtkTools_ShapeObject.cxx b/src/IVtkTools/IVtkTools_ShapeObject.cxx index a0fdbc4235..141050fe6f 100644 --- a/src/IVtkTools/IVtkTools_ShapeObject.cxx +++ b/src/IVtkTools/IVtkTools_ShapeObject.cxx @@ -15,12 +15,20 @@ #include #include + +// prevent disabling some MSVC warning messages by VTK headers +#ifdef _MSC_VER +#pragma warning(push) +#endif #include #include #include #include #include #include +#ifdef _MSC_VER +#pragma warning(pop) +#endif IVtkTools_ShapeObject::KeyPtr IVtkTools_ShapeObject::myKey = 0; diff --git a/src/IVtkTools/IVtkTools_ShapeObject.hxx b/src/IVtkTools/IVtkTools_ShapeObject.hxx index 96eb71e99a..33fc6b4e03 100644 --- a/src/IVtkTools/IVtkTools_ShapeObject.hxx +++ b/src/IVtkTools/IVtkTools_ShapeObject.hxx @@ -18,9 +18,17 @@ #include #include + +// prevent disabling some MSVC warning messages by VTK headers +#ifdef _MSC_VER +#pragma warning(push) +#endif #include #include #include +#ifdef _MSC_VER +#pragma warning(pop) +#endif class vtkActor; class vtkDataSet; diff --git a/src/IVtkTools/IVtkTools_ShapePicker.cxx b/src/IVtkTools/IVtkTools_ShapePicker.cxx index 0d5b8e838d..b94c364282 100644 --- a/src/IVtkTools/IVtkTools_ShapePicker.cxx +++ b/src/IVtkTools/IVtkTools_ShapePicker.cxx @@ -16,10 +16,18 @@ #include #include #include + +// prevent disabling some MSVC warning messages by VTK headers +#ifdef _MSC_VER +#pragma warning(push) +#endif #include #include #include #include +#ifdef _MSC_VER +#pragma warning(pop) +#endif //! @class IVtkTools_ShapePicker //! VTK picker implementation for OCCT shapes. diff --git a/src/IVtkTools/IVtkTools_ShapePicker.hxx b/src/IVtkTools/IVtkTools_ShapePicker.hxx index 1d39a0f12a..471db3dfbe 100644 --- a/src/IVtkTools/IVtkTools_ShapePicker.hxx +++ b/src/IVtkTools/IVtkTools_ShapePicker.hxx @@ -19,8 +19,16 @@ #include #include #include + +// prevent disabling some MSVC warning messages by VTK headers +#ifdef _MSC_VER +#pragma warning(push) +#endif #include #include +#ifdef _MSC_VER +#pragma warning(pop) +#endif class vtkRenderer; class vtkActorCollection; diff --git a/src/IVtkTools/IVtkTools_SubPolyDataFilter.cxx b/src/IVtkTools/IVtkTools_SubPolyDataFilter.cxx index 67c49656f6..a83978715f 100644 --- a/src/IVtkTools/IVtkTools_SubPolyDataFilter.cxx +++ b/src/IVtkTools/IVtkTools_SubPolyDataFilter.cxx @@ -15,13 +15,20 @@ #include #include + +// prevent disabling some MSVC warning messages by VTK headers +#ifdef _MSC_VER +#pragma warning(push) +#endif #include #include #include #include #include #include - +#ifdef _MSC_VER +#pragma warning(pop) +#endif vtkStandardNewMacro(IVtkTools_SubPolyDataFilter) diff --git a/src/IVtkVTK/IVtkVTK_ShapeData.cxx b/src/IVtkVTK/IVtkVTK_ShapeData.cxx index c05c28b201..53731fc280 100644 --- a/src/IVtkVTK/IVtkVTK_ShapeData.cxx +++ b/src/IVtkVTK/IVtkVTK_ShapeData.cxx @@ -14,12 +14,20 @@ // commercial license or contractual agreement. #include + +// prevent disabling some MSVC warning messages by VTK headers +#ifdef _MSC_VER +#pragma warning(push) +#endif #include #include #include #include #include #include +#ifdef _MSC_VER +#pragma warning(pop) +#endif IMPLEMENT_STANDARD_RTTIEXT(IVtkVTK_ShapeData,IVtk_IShapeData) diff --git a/src/IVtkVTK/IVtkVTK_ShapeData.hxx b/src/IVtkVTK/IVtkVTK_ShapeData.hxx index 94b528986e..76b19853ab 100644 --- a/src/IVtkVTK/IVtkVTK_ShapeData.hxx +++ b/src/IVtkVTK/IVtkVTK_ShapeData.hxx @@ -17,8 +17,16 @@ #define __IVTKVTK_SHAPEDATA_H__ #include + +// prevent disabling some MSVC warning messages by VTK headers +#ifdef _MSC_VER +#pragma warning(push) +#endif #include #include +#ifdef _MSC_VER +#pragma warning(pop) +#endif class vtkIdTypeArray; diff --git a/src/IVtkVTK/IVtkVTK_View.cxx b/src/IVtkVTK/IVtkVTK_View.cxx index b4e898c851..f0165bec15 100644 --- a/src/IVtkVTK/IVtkVTK_View.cxx +++ b/src/IVtkVTK/IVtkVTK_View.cxx @@ -15,11 +15,19 @@ #include + +// prevent disabling some MSVC warning messages by VTK headers +#ifdef _MSC_VER +#pragma warning(push) +#endif #include #include #include #include #include +#ifdef _MSC_VER +#pragma warning(pop) +#endif IMPLEMENT_STANDARD_RTTIEXT(IVtkVTK_View,IVtk_IView)