Voreen - Volume Rendering Engine Voreen - Volume Rendering Engine
Voreen - Volume Rendering Engine Westfälische Wilhelms-Universität Münster
  • About
  • Gallery
  • Download
  • Documentation
  • Publications
  • Community

  • Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List

include/voreen/core/datastructures/geometry/vertexgeometry.h

00001 /**********************************************************************
00002  *                                                                    *
00003  * Voreen - The Volume Rendering Engine                               *
00004  *                                                                    *
00005  * Copyright (C) 2005-2010 The Voreen Team. <http://www.voreen.org>   *
00006  *                                                                    *
00007  * This file is part of the Voreen software package. Voreen is free   *
00008  * software: you can redistribute it and/or modify it under the terms *
00009  * of the GNU General Public License version 2 as published by the    *
00010  * Free Software Foundation.                                          *
00011  *                                                                    *
00012  * Voreen is distributed in the hope that it will be useful,          *
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of     *
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the       *
00015  * GNU General Public License for more details.                       *
00016  *                                                                    *
00017  * You should have received a copy of the GNU General Public License  *
00018  * in the file "LICENSE.txt" along with this program.                 *
00019  * If not, see <http://www.gnu.org/licenses/>.                        *
00020  *                                                                    *
00021  * The authors reserve all rights not expressly granted herein. For   *
00022  * non-commercial academic use see the license exception specified in *
00023  * the file "LICENSE-academic.txt". To get information about          *
00024  * commercial licensing please contact the authors.                   *
00025  *                                                                    *
00026  **********************************************************************/
00027 
00028 #ifndef VRN_VERTEXGEOMETRY_H
00029 #define VRN_VERTEXGEOMETRY_H
00030 
00031 #include "voreen/core/datastructures/geometry/geometry.h"
00032 
00033 #include "tgt/vector.h"
00034 #include "tgt/matrix.h"
00035 
00036 namespace voreen {
00037 
00046 class VertexGeometry : public Geometry {
00047 public:
00056     VertexGeometry(
00057         const tgt::vec3& coords = tgt::vec3(0, 0, 0),
00058         const tgt::vec3& texcoords = tgt::vec3(0, 0, 0),
00059         const tgt::vec4& color = tgt::vec4(0, 0, 0, 0));
00060 
00066     tgt::vec3 getCoords() const;
00067 
00073     void setCoords(const tgt::vec3& coords);
00074 
00080     tgt::vec3 getTexCoords() const;
00081 
00087     void setTexCoords(const tgt::vec3& texcoords);
00088 
00094     tgt::vec4 getColor() const;
00095 
00101     void setColor(const tgt::vec4& color);
00102 
00108     void setColor(const tgt::vec3& color);
00109 
00115     double getLength() const;
00116 
00128     double getDistanceToPlane(const tgt::vec4& plane, double epsilon = 1e-6) const;
00129 
00137     double getDistance(const VertexGeometry& vertex) const;
00138 
00142     virtual void render();
00143 
00155     void combine(const VertexGeometry& vertex);
00156 
00171     static VertexGeometry combine(const VertexGeometry& vertex1, const VertexGeometry& vertex2);
00172 
00183     void interpolate(const VertexGeometry& vertex, double t);
00184 
00198     static VertexGeometry interpolate(const VertexGeometry& vertex1, const VertexGeometry& vertex2, double t);
00199 
00205     void transform(const tgt::mat4& transformation);
00206 
00218     bool equals(const VertexGeometry& vertex, double epsilon = 1e-6) const;
00219 
00229     bool operator==(const VertexGeometry& vertex) const;
00230 
00240     bool operator!=(const VertexGeometry& vertex) const;
00241 
00242 private:
00246     tgt::vec3 coords_;
00247 
00251     tgt::vec3 texcoords_;
00252 
00256     tgt::vec4 color_;
00257 };
00258 
00259 }    // namespace
00260 
00261 #endif  //VRN_VERTEXGEOMETRY_H
  • Getting Started
  • Video Tutorials
  • Build Instructions
  • Adding a Module
  • Programming Tutorials
  • API Documentation
  • FAQ
edit