X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FIVtkVTK%2FIVtkVTK_ShapeData.hxx;h=04ceac3371feda98d60c986b5c510a65e55f2026;hp=889381d49c6ed982c454c245bd6d7064be177aa9;hb=dad7fede3945ee013c141bcdb9769c9ca5d822de;hpb=92efcf78a683e75ce77d916d07831255342780a8 diff --git a/src/IVtkVTK/IVtkVTK_ShapeData.hxx b/src/IVtkVTK/IVtkVTK_ShapeData.hxx index 889381d49c..04ceac3371 100644 --- a/src/IVtkVTK/IVtkVTK_ShapeData.hxx +++ b/src/IVtkVTK/IVtkVTK_ShapeData.hxx @@ -17,26 +17,23 @@ #define __IVTKVTK_SHAPEDATA_H__ #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 vtkIdTypeArray; -class vtkPolyData; class IVtkVTK_ShapeData; DEFINE_STANDARD_HANDLE( IVtkVTK_ShapeData, IVtk_IShapeData ) -// macros to export static field in class -#if (defined(_WIN32) || defined(__WIN32__)) - #ifdef __IVtkVTK_DLL - #define IVtkVTK_EXPORT __declspec(dllexport) - #else - #define IVtkVTK_EXPORT __declspec(dllimport) - #endif -#else - #define IVtkVTK_EXPORT -#endif - //! @class IVtkVTK_ShapeData //! @brief IShapeData implementation for VTK. //! @@ -45,8 +42,8 @@ class IVtkVTK_ShapeData : public IVtk_IShapeData { public: - IVtkVTK_EXPORT static const char* const ARRNAME_SUBSHAPE_IDS; - IVtkVTK_EXPORT static const char* const ARRNAME_MESH_TYPES; + static const char* ARRNAME_SUBSHAPE_IDS() { return "SUBSHAPE_IDS"; } + static const char* ARRNAME_MESH_TYPES() { return "MESH_TYPES"; } typedef Handle(IVtkVTK_ShapeData) Handle; @@ -62,7 +59,7 @@ public: //! @param [in] theY Y coordinate //! @param [in] theZ Z coordinate //! @return id of added point - Standard_EXPORT virtual IVtk_PointId InsertCoordinate (double theX, double theY, double theZ); + Standard_EXPORT virtual IVtk_PointId InsertCoordinate (double theX, double theY, double theZ) Standard_OVERRIDE; //! Insert a vertex. //! @param [in] theShapeID id of the subshape to which the vertex belongs. @@ -70,7 +67,7 @@ public: //! @param [in] theMeshType mesh type of the subshape (MT_Undefined by default) Standard_EXPORT virtual void InsertVertex (const IVtk_IdType theShapeID, const IVtk_PointId thePointId, - const IVtk_MeshType theMeshType); + const IVtk_MeshType theMeshType) Standard_OVERRIDE; //! Insert a line. //! @param [in] theShapeID id of the subshape to which the line belongs. @@ -80,7 +77,7 @@ public: Standard_EXPORT virtual void InsertLine (const IVtk_IdType theShapeID, const IVtk_PointId thePointId1, const IVtk_PointId thePointId2, - const IVtk_MeshType theMeshType); + const IVtk_MeshType theMeshType) Standard_OVERRIDE; //! Insert a poly-line. //! @param [in] theShapeID id of the subshape to which the polyline belongs. @@ -88,7 +85,7 @@ public: //! @param [in] theMeshType mesh type of the subshape (MT_Undefined by default) Standard_EXPORT virtual void InsertLine (const IVtk_IdType theShapeID, const IVtk_PointIdList* thePointIds, - const IVtk_MeshType theMeshType); + const IVtk_MeshType theMeshType) Standard_OVERRIDE; //! Insert a triangle //! @param [in] theShapeID id of the subshape to which the triangle belongs. //! @param [in] thePointId1 id of the first point @@ -99,16 +96,33 @@ public: const IVtk_PointId thePointId1, const IVtk_PointId thePointId2, const IVtk_PointId thePointId3, - const IVtk_MeshType theMeshType); + const IVtk_MeshType theMeshType) Standard_OVERRIDE; public: //! @name Specific methods //! Get VTK PolyData. //! @return VTK PolyData - vtkSmartPointer< vtkPolyData > getVtkPolyData() const + vtkPolyData* getVtkPolyData() const { return myPolyData; } +private: + + //! Wrapper over vtkGenericDataArray::InsertNextTypedTuple(). + void insertNextSubShapeId (IVtk_IdType theShapeID, + IVtk_MeshType theMeshType) + { + const vtkIdType aShapeIDVTK = theShapeID; + const vtkIdType aType = theMeshType; + #if (VTK_MAJOR_VERSION > 7) || (VTK_MAJOR_VERSION == 7 && VTK_MINOR_VERSION >= 1) + mySubShapeIDs->InsertNextTypedTuple (&aShapeIDVTK); + myMeshTypes->InsertNextTypedTuple (&aType); + #else + mySubShapeIDs->InsertNextTupleValue (&aShapeIDVTK); + myMeshTypes->InsertNextTupleValue (&aType); + #endif + } + private: vtkSmartPointer< vtkPolyData > myPolyData; //!< Shape geometry as vtkPolyData vtkSmartPointer< vtkIdTypeArray > mySubShapeIDs; //!< Array of sub-shapes ids