Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/new_class_id/src/lib/graphics/importer/static_model.h @ 9830

Last change on this file since 9830 was 9830, checked in by bensch, 18 years ago

orxonox/new_class_id: Static Model splitted up into Data and Logic part

File size: 2.2 KB
Line 
1/*!
2 * @file static_model.h
3 * @brief Contains the Model Class that handles Static 3D-Models rendered with glList's
4 */
5
6#ifndef _STATIC_MODEL_H
7#define _STATIC_MODEL_H
8
9#include "model.h"
10
11#include "material.h"
12#include <vector>
13#include "static_model_data.h"
14
15/////////////
16/// MODEL ///
17/////////////
18//! Class that handles static 3D-Models.
19/**
20 * it can also read them in and display them.
21 * All the objects are rendered with glLists
22 */
23class StaticModel : public Model
24{
25  ObjectListDeclaration(StaticModel);
26  public:
27  StaticModel(const std::string& modelName = "");
28  virtual ~StaticModel();
29
30  virtual void draw() const { data->draw(); };
31  void draw(int groupNumber) const { data->draw(groupNumber); };
32  void draw(const std::string& groupName) const { data->draw(groupName); };
33
34  void rebuild() { data->rebuild(); };
35
36  Material* addMaterial(Material* material) { return data->addMaterial(material); };
37  Material* addMaterial(const std::string& materialName) { return data->addMaterial(materialName); };
38
39  bool addGroup(const std::string& groupString) { return data->addGroup(groupString); };
40
41  bool addVertex(const std::string& vertexString) { return data->addVertex(vertexString); };
42  bool addVertex(float x, float y, float z) { return data->addVertex(x, y, z); };
43
44  bool addFace(const std::string& faceString) { return data->addFace(faceString); };
45  bool addFace(int faceElemCount, VERTEX_FORMAT type, ...);
46
47  bool addVertexNormal(const std::string& normalString) { return this->data->addVertexNormal(normalString); };
48  bool addVertexNormal(float x, float y, float z) { return this->data->addVertexNormal(x,y,z); };
49
50  bool addVertexTexture(const std::string& vTextureString) { return this->data->addVertexTexture(vTextureString); };
51  bool addVertexTexture(float u, float v) { return this->data->addVertexTexture(u, v); };
52
53  bool setMaterial(const std::string& mtlString) { return data->setMaterial(mtlString); };
54  bool setMaterial(Material* mtl) { return data->setMaterial(mtl);};
55
56  void finalize();
57
58  inline void setScaleFactor(float scaleFactor) { this->data->setScaleFactor(scaleFactor); };
59  float getScaleFactor() const { return data->getScaleFactor(); }
60
61 protected:
62  void cubeModel();
63
64 private:
65   StaticModelData::Pointer         data;
66};
67
68#endif
Note: See TracBrowser for help on using the repository browser.