Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 1, 2005, 9:50:30 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/trackManager: merged trunk back to trackManager
merged with command
svn merge -r 3369:HEAD trunk/ branches/trackManager
resoloved conflicts in favor of the trunk.

Location:
orxonox/branches/trackManager
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/trackManager

    • Property svn:externals set to
  • orxonox/branches/trackManager/src/importer/model.h

    r3369 r3430  
    77#define _MODEL_H
    88
    9 #include "../stdincl.h"
     9//#include "../stdincl.h"
    1010
    11 #include "array.h"
    1211#include "material.h"
    13 #include "vector.h"
    14 #include <fstream>
     12
     13// FORWARD DEFINITION //
     14class Array;
     15class Vector;
    1516
    1617using namespace std;
    1718
    18 
     19enum PRIMITIVE {PLANE, CUBE, SPHERE, CYLINDER};
    1920
    2021//! Class that handles 3D-Models. it can also read them in and display them.
     
    2223{
    2324 public:
    24   Model ();
    25   Model (char* fileName);
    26   Model(char* fileName, float scaling);
    27   ~Model ();
     25  Model(void);
     26  Model(PRIMITIVE type);
     27  Model(char* modelName);
     28  virtual ~Model(void);
     29
     30  void setName(const char* name);
    2831 
    29   void draw (void) const;
    30   void draw (int groupNumber) const;
    31   void draw (char* groupName) const;
     32  void draw(void) const;
     33  void draw(int groupNumber) const;
     34  void draw(char* groupName) const;
    3235  int getGroupCount() const;
    3336
    34  private:
     37 protected:
     38  char* name;            //!< This is the name of the Model.
     39  bool finalized;        //!< Sets the Object to be finalized.
     40 
    3541  //! This is the placeholder of one Vertex beloning to a Face.
    36   struct FaceElement 
     42  struct FaceElement
    3743  {
    3844    int vertexNumber;    //!< The number of the Vertex out of the Array* vertices, this vertex points to.
     
    4349
    4450  //! This is the placeholder of a Face belonging to a Group of Faces.
    45   /**
    46      \todo take Material to a call for itself.
    47 
    48      This can also be a Material-Change switch.
    49      That means if you want to change a Material inside of a group,
    50      you can create an empty face and apply a material to it, and the Importer will cahnge Colors
    51   */
    52   struct Face
     51  struct Face
    5352  {
    5453    int vertexCount;        //!< The Count of vertices this Face has.
     
    6564    char* name;         //!< the Name of the Group. this is an identifier, that can be accessed via the draw (char* name) function.
    6665
    67     GLuint listNumber;  //!< The number of the GL-List this Group gets.
     66    unsigned int listNumber;//!< The number of the GL-List this Group gets.
    6867    Face* firstFace;    //!< The first Face in this group.
    6968    Face* currentFace;  //!< The current Face in this Group (the one we are currently working with.)
     
    8887  float scaleFactor;    //!< The Factor with which the Model should be scaled. \todo maybe one wants to scale the Model after Initialisation
    8988
    90   char* objPath;        //!< The Path wher the obj and mtl-file are located.
    91   char* objFileName;    //!< The Name of the obj-file.
    92   char* mtlFileName;    //!< The Name of the mtl-file (parsed out of the obj-file)
    93 
    94   bool initialize (void);
     89  bool initialize(void);
    9590  bool initGroup(Group* group);
    9691  bool initFace (Face* face);
     
    10095  bool cleanupFaceElement(FaceElement* faceElem);
    10196
    102   ///// readin ///
    103   bool importFile (char* fileName);
    104   bool readFromObjFile (void);
    105  
    106   bool readGroup (char* groupString);
    107   bool readVertex (char* vertexString);
    108   bool readFace (char* faceString);
    109   bool readVertexNormal (char* normalString);
    110   bool readVertexTexture (char* vTextureString);
    111   bool readMtlLib (char* matFile);
    112   bool readUseMtl (char* mtlString);
     97 public:
     98  bool addGroup(char* groupString);
     99  bool addVertex(char* vertexString);
     100  bool addVertex(const float x, const float y, const float z);
     101  bool addFace(char* faceString);
     102  bool addFace(const float faceElemCount, int type, ...);
     103  bool addVertexNormal(char* normalString);
     104  bool addVertexNormal(const float x, const float y, const float z);
     105  bool addVertexTexture(char* vTextureString);
     106  bool addVertexTexture(const float u, const float v);
     107  bool addUseMtl(char* mtlString);
     108  void finalize(void);
    113109
    114   bool importToGL (void);
    115   bool addGLElement (FaceElement* elem);
     110 protected:
     111  bool importToGL(void);
     112  bool addGLElement(FaceElement* elem);
    116113
    117   bool buildVertexNormals ();
     114  bool buildVertexNormals(void);
    118115
    119   void BoxModel (void);
     116  void cubeModel(void);
     117  void sphereModel(void);
     118  void cylinderModel(void);
    120119};
    121120
Note: See TracChangeset for help on using the changeset viewer.