Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

trimesh.cpp

Go to the documentation of this file.
00001 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*-
00002 
00003    this file is part of rcssserver3D
00004    Fri May 9 2003
00005    Copyright (C) 2002,2003 Koblenz University
00006    Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group
00007    $Id: trimesh.cpp,v 1.1 2004/04/22 17:03:03 rollmark Exp $
00008 
00009    This program is free software; you can redistribute it and/or modify
00010    it under the terms of the GNU General Public License as published by
00011    the Free Software Foundation; version 2 of the License.
00012 
00013    This program is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016    GNU General Public License for more details.
00017 
00018    You should have received a copy of the GNU General Public License
00019    along with this program; if not, write to the Free Software
00020    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00021 */
00022 #include "trimesh.h"
00023 
00024 using namespace oxygen;
00025 using namespace std;
00026 using namespace boost;
00027 
00028 TriMesh::TriMesh() : mVertexCount(0)
00029 {
00030 }
00031 
00032 TriMesh::~TriMesh()
00033 {
00034 }
00035 
00036 void TriMesh::SetPos(shared_array<float> pos, int vertexCount)
00037 {
00038     mPos = pos;
00039     mVertexCount = vertexCount;
00040 }
00041 
00042 void TriMesh::SetTexCoords(shared_array<float> texCoords)
00043 {
00044     mTexCoords = texCoords;
00045 }
00046 
00047 void TriMesh::SetNormals(shared_array<float> normal)
00048 {
00049     mNormal = normal;
00050 }
00051 
00052 const shared_array<float> TriMesh::GetPos() const
00053 {
00054     return mPos;
00055 }
00056 
00057 int TriMesh::GetVertexCount() const
00058 {
00059     return mVertexCount;
00060 }
00061 
00062 const shared_array<float> TriMesh::GetTexCoords() const
00063 {
00064     return mTexCoords;
00065 }
00066 
00067 const shared_array<float> TriMesh::GetNormals() const
00068 {
00069     return mNormal;
00070 }
00071 
00072 void TriMesh::AddFace(boost::shared_ptr<IndexBuffer> indeces,
00073                        const std::string& material)
00074 {
00075     mFaces.push_back(Face(indeces, material));
00076 }
00077 
00078 void TriMesh::AddFace(const Face& face)
00079 {
00080     mFaces.push_back(face);
00081 }
00082 
00083 const TriMesh::TFaces& TriMesh::GetFaces() const
00084 {
00085     return mFaces;
00086 }
00087 
00088 const std::string& TriMesh::GetName() const
00089 {
00090     return mName;
00091 }
00092 
00093 void TriMesh::SetName(const std::string& name)
00094 {
00095     mName = name;
00096 }
00097 
00098 

Generated on Thu Apr 6 15:25:40 2006 for rcssserver3d by  doxygen 1.4.4