1 #include "GEOM_VertexSource.h"
3 #include <vtkObjectFactory.h>
6 #include <vtkCellArray.h>
7 #include <vtkPolyData.h>
8 #include <vtkPolyDataMapper.h>
11 #include <BRep_Tool.hxx>
13 vtkStandardNewMacro(GEOM_VertexSource);
15 GEOM_VertexSource::GEOM_VertexSource()
19 GEOM_VertexSource::~GEOM_VertexSource()
25 AddVertex(const TopoDS_Vertex& theVertex)
27 myVertexSet.Add(theVertex);
34 vtkPolyData* aPolyData = GetOutput();
35 aPolyData->Allocate();
36 vtkPoints* aPts = vtkPoints::New();
37 aPolyData->SetPoints(aPts);
40 TVertexSet::Iterator anIter(myVertexSet);
41 for(; anIter.More(); anIter.Next()){
42 const TopoDS_Vertex& aVertex = anIter.Value();
43 OCC2VTK(aVertex,aPolyData,aPts);
49 OCC2VTK(const TopoDS_Vertex& theVertex,
50 vtkPolyData* thePolyData,
53 gp_Pnt aPnt = BRep_Tool::Pnt(theVertex);
54 vtkIdType anId = thePts->InsertNextPoint(aPnt.X(),aPnt.Y(),aPnt.Z());
55 thePolyData->InsertNextCell(VTK_VERTEX,1,&anId);