1 // Created on: 2011-10-14
2 // Created by: Roman KOZLOV
3 // Copyright (c) 2011-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef __IVTKVTK_SHAPEDATA_H__
17 #define __IVTKVTK_SHAPEDATA_H__
19 #include <IVtk_IShapeData.hxx>
21 // prevent disabling some MSVC warning messages by VTK headers
25 #include <vtkPolyData.h>
26 #include <vtkSmartPointer.h>
33 class IVtkVTK_ShapeData;
34 DEFINE_STANDARD_HANDLE( IVtkVTK_ShapeData, IVtk_IShapeData )
36 //! @class IVtkVTK_ShapeData
37 //! @brief IShapeData implementation for VTK.
39 //! Contains the shape geometry information as vtkPolyData.
40 class IVtkVTK_ShapeData : public IVtk_IShapeData
44 static const char* ARRNAME_SUBSHAPE_IDS() { return "SUBSHAPE_IDS"; }
45 static const char* ARRNAME_MESH_TYPES() { return "MESH_TYPES"; }
47 typedef Handle(IVtkVTK_ShapeData) Handle;
50 Standard_EXPORT IVtkVTK_ShapeData();
52 Standard_EXPORT ~IVtkVTK_ShapeData();
54 DEFINE_STANDARD_RTTIEXT(IVtkVTK_ShapeData,IVtk_IShapeData)
56 //! Insert a coordinate
57 //! @param [in] theX X coordinate
58 //! @param [in] theY Y coordinate
59 //! @param [in] theZ Z coordinate
60 //! @return id of added point
61 Standard_EXPORT virtual IVtk_PointId InsertCoordinate (double theX, double theY, double theZ) Standard_OVERRIDE;
64 //! @param [in] theShapeID id of the subshape to which the vertex belongs.
65 //! @param [in] thePointId id of the point that defines the coordinates of the vertex
66 //! @param [in] theMeshType mesh type of the subshape (MT_Undefined by default)
67 Standard_EXPORT virtual void InsertVertex (const IVtk_IdType theShapeID,
68 const IVtk_PointId thePointId,
69 const IVtk_MeshType theMeshType) Standard_OVERRIDE;
72 //! @param [in] theShapeID id of the subshape to which the line belongs.
73 //! @param [in] thePointId1 id of the first point
74 //! @param [in] thePointId2 id of the second point
75 //! @param [in] theMeshType mesh type of the subshape (MT_Undefined by default)
76 Standard_EXPORT virtual void InsertLine (const IVtk_IdType theShapeID,
77 const IVtk_PointId thePointId1,
78 const IVtk_PointId thePointId2,
79 const IVtk_MeshType theMeshType) Standard_OVERRIDE;
81 //! Insert a poly-line.
82 //! @param [in] theShapeID id of the subshape to which the polyline belongs.
83 //! @param [in] thePointIds vector of point ids
84 //! @param [in] theMeshType mesh type of the subshape (MT_Undefined by default)
85 Standard_EXPORT virtual void InsertLine (const IVtk_IdType theShapeID,
86 const IVtk_PointIdList* thePointIds,
87 const IVtk_MeshType theMeshType) Standard_OVERRIDE;
89 //! @param [in] theShapeID id of the subshape to which the triangle belongs.
90 //! @param [in] thePointId1 id of the first point
91 //! @param [in] thePointId2 id of the second point
92 //! @param [in] thePointId3 id of the third point
93 //! @param [in] theMeshType mesh type of the subshape (MT_Undefined by default)
94 Standard_EXPORT virtual void InsertTriangle (const IVtk_IdType theShapeID,
95 const IVtk_PointId thePointId1,
96 const IVtk_PointId thePointId2,
97 const IVtk_PointId thePointId3,
98 const IVtk_MeshType theMeshType) Standard_OVERRIDE;
101 public: //! @name Specific methods
103 //! Get VTK PolyData.
104 //! @return VTK PolyData
105 vtkPolyData* getVtkPolyData() const
106 { return myPolyData; }
109 vtkSmartPointer< vtkPolyData > myPolyData; //!< Shape geometry as vtkPolyData
110 vtkSmartPointer< vtkIdTypeArray > mySubShapeIDs; //!< Array of sub-shapes ids
111 vtkSmartPointer< vtkIdTypeArray > myMeshTypes; //!< Array of type codes of mesh parts
114 #endif // __IVTKVTK_SHAPEDATA_H__