V-ART
refsystem.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include "vart/arrow.h"
3 #include "vart/graphicobj.h"
4 #include "vart/point4d.h"
5 #include "vart/refsystem.h"
6 #include "vart/scenenode.h"
7 #include "vart/arrow.h"
8 #include "vart/transform.h"
9 #include <GL/glu.h>
10 #include <sstream>
11 #include <cassert>
12 #include <fstream>
13 
14 
15 using namespace std;
16 using namespace VART;
17 
18 double VART::RefSystem::axisLength = 2.0;
19 
20 // build a default reference system
21 VART::RefSystem::RefSystem() : axisX(axisLength), axisY(axisLength), axisZ(axisLength)
22 {
24 
25  // Transformacao que leva o eixo Y para a direcao (0, 1, 0)
26  Transform rotationAxisY;
27  rotationAxisY.MakeZRotation(1.57);
28  axisY.ApplyTransform(rotationAxisY);
30 
31  // Transformacao que leva o eixo Z para a direcao (0, 0, 1)
32  Transform rotationAxisZ;
33  rotationAxisZ.MakeYRotation(-1.57);
34  axisZ.ApplyTransform(rotationAxisZ);
36 }
37 
38 // hide the axis Z
40 {
41  axisZ.Hide();
42 }
43 
44 // virtual
46 {
47  // FixMe
48 }
49 
50 // virtual
52 {
53  double headRadius;
54  headRadius = VART::Arrow::relativeHeadRadius * axisLength;
55  bBox.SetBoundingBox(-headRadius, -headRadius, -headRadius, axisLength, axisLength, axisLength);
56 }
57 
58 // virtual
59 bool VART::RefSystem::DrawInstanceOGL() const {
60  axisX.DrawOGL();
61  axisY.DrawOGL();
62  axisZ.DrawOGL();
63 }
virtual VART::SceneNode * Copy()
Definition: refsystem.cpp:45
Base class for objects that compose a scene graph.
Definition: scenenode.h:25
virtual void ComputeBoundingBox()
Computes the bounding box.
Definition: refsystem.cpp:51
Header file for V-ART class "GraphicObj".
static double axisLength
Definition: refsystem.h:26
Header file for V-ART class "SceneNode".
static const Material & PLASTIC_BLUE()
Definition: material.cpp:94
static float relativeHeadRadius
Definition: arrow.h:13
Geometric transformations.
Definition: transform.h:24
void MakeYRotation(double radians)
Turns transform into a rotation around the Y axis.
Definition: transform.cpp:73
Header file for V-ART class "Transform".
void SetMaterial(const Material &mat)
Assigns a material to all meshes of the mesh object.
Definition: meshobject.cpp:69
void ApplyTransform(const Transform &trans)
Apply Transformation to all vertices.
Definition: meshobject.cpp:658
static const Material & PLASTIC_RED()
Definition: material.cpp:82
Header file for V-ART class "Point4D".
static const Material & PLASTIC_GREEN()
Definition: material.cpp:88
void MakeZRotation(double radians)
Turns transform into a rotation around the Z axis.
Definition: transform.cpp:82