V-ART
polyline.h
Go to the documentation of this file.
1 
5 #ifndef VART_POLYLLINE_H
6 #define VART_POLYLLINE_H
7 
8 #include "vart/graphicobj.h"
9 #include "vart/material.h"
10 #include <vector>
11 
16 namespace VART {
18  class PolyLine : public VART::GraphicObj
19  {
20  public:
21  // PUBLIC TYPES
23 
24  // PUBLIC METHODS
26  PolyLine();
27 
29  PolyLine(const VART::PolyLine& polyLine);
30 
32  ~PolyLine();
33 
35  VART::PolyLine& operator=(const VART::PolyLine& polyLine);
36 
38  virtual VART::SceneNode* Copy();
39 
41  void Clear();
42 
44  void AddVertex(VART::Point4D& vertex) { vertexVec.push_back( vertex ); }
45 
47  void Setvertex(unsigned int i, VART::Point4D vertex) { vertexVec[i] = vertex; }
48 
50  virtual void ComputeBoundingBox();
51 
53  void SetMaterial(const VART::Material& material) { this->material = material; }
54 
56  const VART::Material& GetMaterial() { return material; }
57 
59  void SetLineWidth(float width) { this->width = width; }
60 
62  float GetLineWidth() { return width; }
63 
64  virtual bool DrawOGL() const;
65 
66  // PUBLIC ATTRIBUTES
69  protected:
70 #ifdef VART_OGL
71  GLenum GLOrganizationType() const;
73 #endif
74  private:
76  float width;
78  std::vector< VART::Point4D > vertexVec;
80  VART::Material material;
81  };
82 } // end namespace
83 #endif // VART_POLYLLINE_H
void AddVertex(VART::Point4D &vertex)
Adds a vertex at the end of the list of vertices.
Definition: polyline.h:44
void Setvertex(unsigned int i, VART::Point4D vertex)
Sets the vertex at index i.
Definition: polyline.h:47
Base class for objects that compose a scene graph.
Definition: scenenode.h:25
PolyLine()
Creates a empty PolyLine.
Definition: polyline.cpp:10
Header file for V-ART class "Material".
Points and vectors using homogeneous coordinates.
Definition: point4d.h:22
Header file for V-ART class "GraphicObj".
A PolyLine is a sequence of lines, defined by a list of points.
Definition: polyline.h:18
virtual bool DrawOGL() const
Recursive drawing using OpenGL commands.
Definition: polyline.cpp:55
~PolyLine()
Destroy all PolyLine data.
Definition: polyline.cpp:20
virtual VART::SceneNode * Copy()
Return a copy of the PolyLine.
Definition: polyline.cpp:33
An scene node that is associated with a shape.
Definition: graphicobj.h:18
Material properties for graphical objects.
Definition: material.h:16
void SetLineWidth(float width)
Sets the width of the lines.
Definition: polyline.h:59
VART::PolyLine & operator=(const VART::PolyLine &polyLine)
Copies all polyLine data to another PolyLine.
Definition: polyline.cpp:25
const VART::Material & GetMaterial()
Returns the current material of the PolyLine.
Definition: polyline.h:56
virtual void ComputeBoundingBox()
Computes the bounding box of the PolyLine.
Definition: polyline.cpp:43
void SetMaterial(const VART::Material &material)
Assigns a material to all lines of the PolyLine.
Definition: polyline.h:53
OrganizationType organization
The vertex organization.
Definition: polyline.h:68
float GetLineWidth()
Returns the width of the lines.
Definition: polyline.h:62
void Clear()
Clear all vertices in the PolyLine.
Definition: polyline.cpp:38