Changeset 3696 for trunk/packages/vizservers/vtkvis/Line.h
- Timestamp:
- Jun 17, 2013 1:48:27 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/vtkvis/Line.h
r3621 r3696 9 9 #define VTKVIS_LINE_H 10 10 11 #include <vector> 12 11 13 #include <vtkSmartPointer.h> 12 14 #include <vtkPolyDataMapper.h> 13 15 #include <vtkActor.h> 14 16 #include <vtkLineSource.h> 17 #include <vtkPoints.h> 15 18 16 19 #include "Shape.h" … … 22 25 * \brief VTK PolyData Line 23 26 * 24 * This class creates a line27 * This class creates a polyline 25 28 */ 26 29 class Line : public Shape … … 35 38 } 36 39 40 /** 41 * \brief This interface creates a single line 42 */ 37 43 void setEndPoints(double pt1[3], double pt2[3]) 38 44 { 39 45 if (_line != NULL) { 40 46 _line->SetPoint1(pt1); 41 _line->SetPoint2(pt2); 42 } 47 _line->SetPoint2(pt2); 48 _line->SetPoints(NULL); 49 } 50 } 51 52 /** 53 * \brief This interface creates a polyline 54 */ 55 void setPoints(std::vector<double> pts) 56 { 57 if (_line == NULL) 58 return; 59 vtkPoints *points = vtkPoints::New(); 60 for (size_t i = 0; i < pts.size(); i+=3) { 61 points->InsertNextPoint(pts[i], pts[i+1], pts[i+2]); 62 } 63 _line->SetPoints(points); 43 64 } 44 65
Note: See TracChangeset
for help on using the changeset viewer.