Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 26, 2006, 2:54:38 PM (18 years ago)
Author:
bensch
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/graphics/importer/static_model_data.h

    r9829 r9830  
    44 */
    55
    6 #ifndef _STATIC_MODEL_H
    7 #define _STATIC_MODEL_H
     6#ifndef _STATIC_MODEL_DATA_H
     7#define _STATIC_MODEL_DATA_H
    88
    99#include "model.h"
     
    1111#include "material.h"
    1212#include <vector>
     13#include "count_pointer.h"
     14
    1315
    1416// definition of different modes for setting up Faces
     
    3133class ModelFaceElement
    3234{
    33  public:
     35public:
    3436  ModelFaceElement();
    3537  ~ModelFaceElement();
     
    4547class ModelFace
    4648{
    47  public:
     49public:
    4850  ModelFace();
    4951  ~ModelFace();
     
    5961class ModelGroup
    6062{
    61  public:
     63public:
    6264  ModelGroup();
    6365  ~ModelGroup();
     
    9496  ObjectListDeclaration(StaticModelData);
    9597  public:
     98    typedef CountPointer<StaticModelData> Pointer;
     99
     100  public:
    96101  StaticModelData(const std::string& modelName = "");
    97102  virtual ~StaticModelData();
    98103
    99   virtual void draw() const;
     104  void draw() const;
    100105  void draw(int groupNumber) const;
    101106  void draw(const std::string& groupName) const;
     
    108113  bool addGroup(const std::string& groupString);
    109114
     115  void setScaleFactor(float scaleFactor) { this->scaleFactor = scaleFactor; };
     116
    110117  bool addVertex(const std::string& vertexString);
    111118  bool addVertex(float x, float y, float z);
    112119
    113120  bool addFace(const std::string& faceString);
    114   bool addFace(int faceElemCount, VERTEX_FORMAT type, ...);
     121  bool addFace(int faceElemCount, VERTEX_FORMAT type, va_list args);
    115122
    116123  bool addVertexNormal(const std::string& normalString);
     
    126133
    127134
    128  protected:
    129   void cubeModel();
     135  const std::vector<GLfloat>& getVertices() const { return this->vertices; };
     136  const std::vector<GLfloat>& getNormals() const { return this->normals; };
     137  const std::vector<GLfloat>& getTexCoords() const { return this->vTexture; };
     138  const std::vector<sTriangleExt>& getTriangles() const { return this->triangles; };
     139  ///! HACK SOLUTION sTriangleExt should be const in the modelInfo.
     140  sTriangleExt* getTrianglesExt() { return &this->triangles[0]; };
    130141
     142  float getScaleFactor() const  { return scaleFactor; }
     143
     144protected:
    131145  Material* findMaterialByName(const std::string& materialName);
    132146
    133  protected:
    134   float            scaleFactor;     //!< The Factor with which the Model should be scaled. @todo maybe one wants to scale the Model after Initialisation
    135 
    136  private:
     147private:
    137148  bool buildVertexNormals();
    138149
     
    144155  bool cleanup();
    145156
    146  private:
     157private:
    147158  bool                       finalized;       //!< Sets the Object to be finalized.
     159
     160  float                      scaleFactor;     //!< The Factor with which the Model should be scaled. @todo maybe one wants to scale the Model after Initialisation
    148161
    149162  unsigned int               faceCount;       //!< A modelwide Counter for the faces
     
    162175};
    163176
    164 #endif
     177#endif /* _STATIC_MODEL_DATA_H */
Note: See TracChangeset for help on using the changeset viewer.