0026511: Build fails with VTK 6.3rc1
[occt.git] / src / IVtkVTK / IVtkVTK_ShapeData.hxx
CommitLineData
913a4c4a 1// Created on: 2011-10-14
2// Created by: Roman KOZLOV
3// Copyright (c) 2011-2014 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef __IVTKVTK_SHAPEDATA_H__
17#define __IVTKVTK_SHAPEDATA_H__
18
19#include <IVtk_IShapeData.hxx>
20#include <vtkType.h>
21#include <vtkSmartPointer.h>
22
23class vtkIdTypeArray;
24class vtkPolyData;
25
c04c30b3 26class IVtkVTK_ShapeData;
913a4c4a 27DEFINE_STANDARD_HANDLE( IVtkVTK_ShapeData, IVtk_IShapeData )
28
29// macros to export static field in class
30#if (defined(_WIN32) || defined(__WIN32__))
31 #ifdef __IVtkVTK_DLL
32 #define IVtkVTK_EXPORT __declspec(dllexport)
33 #else
34 #define IVtkVTK_EXPORT __declspec(dllimport)
35 #endif
36#else
37 #define IVtkVTK_EXPORT
38#endif
39
40//! @class IVtkVTK_ShapeData
41//! @brief IShapeData implementation for VTK.
42//!
43//! Contains the shape geometry information as vtkPolyData.
44class IVtkVTK_ShapeData : public IVtk_IShapeData
45{
46public:
47
48 IVtkVTK_EXPORT static const char* const ARRNAME_SUBSHAPE_IDS;
49 IVtkVTK_EXPORT static const char* const ARRNAME_MESH_TYPES;
50
51 typedef Handle(IVtkVTK_ShapeData) Handle;
52
53 //! Constructor
54 Standard_EXPORT IVtkVTK_ShapeData();
55 //! Destructor
56 Standard_EXPORT ~IVtkVTK_ShapeData();
57
92efcf78 58 DEFINE_STANDARD_RTTIEXT(IVtkVTK_ShapeData,IVtk_IShapeData)
913a4c4a 59
60 //! Insert a coordinate
61 //! @param [in] theX X coordinate
62 //! @param [in] theY Y coordinate
63 //! @param [in] theZ Z coordinate
64 //! @return id of added point
c7854818 65 Standard_EXPORT virtual IVtk_PointId InsertCoordinate (double theX, double theY, double theZ) Standard_OVERRIDE;
913a4c4a 66
67 //! Insert a vertex.
68 //! @param [in] theShapeID id of the subshape to which the vertex belongs.
69 //! @param [in] thePointId id of the point that defines the coordinates of the vertex
70 //! @param [in] theMeshType mesh type of the subshape (MT_Undefined by default)
71 Standard_EXPORT virtual void InsertVertex (const IVtk_IdType theShapeID,
72 const IVtk_PointId thePointId,
c7854818 73 const IVtk_MeshType theMeshType) Standard_OVERRIDE;
913a4c4a 74
75 //! Insert a line.
76 //! @param [in] theShapeID id of the subshape to which the line belongs.
77 //! @param [in] thePointId1 id of the first point
78 //! @param [in] thePointId2 id of the second point
79 //! @param [in] theMeshType mesh type of the subshape (MT_Undefined by default)
80 Standard_EXPORT virtual void InsertLine (const IVtk_IdType theShapeID,
81 const IVtk_PointId thePointId1,
82 const IVtk_PointId thePointId2,
c7854818 83 const IVtk_MeshType theMeshType) Standard_OVERRIDE;
913a4c4a 84
85 //! Insert a poly-line.
86 //! @param [in] theShapeID id of the subshape to which the polyline belongs.
87 //! @param [in] thePointIds vector of point ids
88 //! @param [in] theMeshType mesh type of the subshape (MT_Undefined by default)
89 Standard_EXPORT virtual void InsertLine (const IVtk_IdType theShapeID,
90 const IVtk_PointIdList* thePointIds,
c7854818 91 const IVtk_MeshType theMeshType) Standard_OVERRIDE;
913a4c4a 92 //! Insert a triangle
93 //! @param [in] theShapeID id of the subshape to which the triangle belongs.
94 //! @param [in] thePointId1 id of the first point
95 //! @param [in] thePointId2 id of the second point
96 //! @param [in] thePointId3 id of the third point
97 //! @param [in] theMeshType mesh type of the subshape (MT_Undefined by default)
98 Standard_EXPORT virtual void InsertTriangle (const IVtk_IdType theShapeID,
99 const IVtk_PointId thePointId1,
100 const IVtk_PointId thePointId2,
101 const IVtk_PointId thePointId3,
c7854818 102 const IVtk_MeshType theMeshType) Standard_OVERRIDE;
913a4c4a 103
104
105public: //! @name Specific methods
106
107 //! Get VTK PolyData.
108 //! @return VTK PolyData
109 vtkSmartPointer< vtkPolyData > getVtkPolyData() const
110 { return myPolyData; }
111
112private:
113 vtkSmartPointer< vtkPolyData > myPolyData; //!< Shape geometry as vtkPolyData
114 vtkSmartPointer< vtkIdTypeArray > mySubShapeIDs; //!< Array of sub-shapes ids
115 vtkSmartPointer< vtkIdTypeArray > myMeshTypes; //!< Array of type codes of mesh parts
116};
117
118#endif // __IVTKVTK_SHAPEDATA_H__