Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

Vertex.h

00001 /*************************************************************************** 00002 * This file is part of OpenCAL: Open Computer Animation Library * 00003 * I created OpenCAL as my master's thesis Computer Science (multimedia) * 00004 * at the tUL university in Diepenbeek, Belgium * 00005 * * 00006 * Copyright (C) 2003-2004 by Jeroen Dierckx * 00007 * jeroen.dierckx@student.luc.ac.be * 00008 * * 00009 ***************************************************************************/ 00010 00011 #ifndef OPENCAL_VERTEX_H 00012 #define OPENCAL_VERTEX_H 00013 00014 // Includes 00015 #include <OpenCAL/global.h> 00016 00017 #include <OpenCAL/Vector3.h> 00018 using OpenCAL::Utils::Vector3; 00019 00020 namespace OpenCAL 00021 { 00022 // Forward declarations 00023 00027 class OPENCAL_API Vertex 00028 { 00029 protected: 00030 // Member variables 00031 Vector3 *m_position; 00032 Vector3 m_normal; 00033 float m_textureU, m_textureV; 00034 bool m_linked; 00035 00036 public: 00037 // Constructors and destructor 00038 Vertex(); 00039 Vertex(Vector3 *position); 00040 Vertex(const Vector3 &position); 00041 Vertex(const Vector3 &position, const Vector3 &normal); 00042 virtual ~Vertex(); 00043 00044 // Get functions 00045 const Vector3 &getPosition() const { return *m_position; } 00046 Vector3 *getPositionP() { return m_position; } 00047 const Vector3 &getNormal() const { return m_normal; } 00048 Vector3 *getNormalP() { return &m_normal; } 00049 float getTextureU() const { return m_textureU; } 00050 float getTextureV() const { return m_textureV; } 00051 bool isLinked() const { return m_linked; } 00052 00053 // Set functions 00054 void setPosition(const Vector3 &position); 00055 void linkPosition(Vector3 *position); 00056 void setNormal(const Vector3 &normal) { m_normal = normal; } 00057 void setTexturePos(float u, float v) { m_textureU = u; m_textureV = v; } 00058 00059 // Other function 00060 void addNormal(const Vector3 &normal) { m_normal += normal; } 00061 }; 00062 } 00063 00064 #endif // OPENCAL_VERTEX_H

Generated on Sun Aug 15 19:19:23 2004 for OpenCAL: Open Computer Animation Library by doxygen 1.3.8