V-ART
dot.cpp
Go to the documentation of this file.
1 
5 #include "vart/dot.h"
6 
7 #ifdef WIN32
8 #include <windows.h>
9 #endif
10 #ifdef VART_OGL
11  #include <GL/gl.h>
12 #endif
13 //#include <iostream>
14 
15 //using namespace std;
16 
18 {
19  size = 3.0f;
20  show = true;
21 }
22 
24 {
25  this->operator=(dot);
26 }
27 
29 {
30  this->GraphicObj::operator=(dot);
31  position = dot.position;
32  color = dot.color;
33  size = dot.size;
34  return *this;
35 }
36 
38 {
39  return new VART::Dot(*this);
40 }
41 
42 VART::Dot::Dot(const VART::Point4D& location)
43 {
44  size = 3.0f;
45  show = true;
46  position = location;
47 }
48 
50 {
51  bBox.SetBoundingBox(position.GetX(), position.GetY(), position.GetZ(),
52  position.GetX(), position.GetY(), position.GetZ());
53 }
54 
56 {
57 #ifdef VART_OGL
58  static float fColor[4];
59  if (show)
60  {
61  color.Get(fColor);
62  glPointSize(size); // FixMe: remove when size is turned into class attribute
63  glDisable(GL_LIGHTING); // FixMe: check if lighting is enabled
64  glBegin(GL_POINTS);
65  glColor4fv(fColor);
66  glVertex4dv(position.VetXYZW());
67  glEnd();
68  glEnable(GL_LIGHTING);
69  }
70  return true;
71 #else
72  return false;
73 #endif
74 
75 }
Base class for objects that compose a scene graph.
Definition: scenenode.h:25
Points and vectors using homogeneous coordinates.
Definition: point4d.h:22
float size
The size (in pixels) of the point on screen.
Definition: dot.h:44
VART::Dot & operator=(const VART::Dot &dot)
Copies all data from an dot to another.
Definition: dot.cpp:28
virtual VART::SceneNode * Copy()
Returns a copy of an dot. Every derived class must reimplements.
Definition: dot.cpp:37
Point4D position
The point's position.
Definition: dot.h:41
Color color
The point's color.
Definition: dot.h:47
Header file for V-ART class "Dot".
virtual bool DrawInstanceOGL() const
Draws the point.
Definition: dot.cpp:55
SceneNode & operator=(const SceneNode &node)
Definition: scenenode.cpp:47
Dot()
Creates an initialized point.
Definition: dot.cpp:17
virtual void ComputeBoundingBox()
Computes the bounding box.
Definition: dot.cpp:49
A graphical point.
Definition: dot.h:17