Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4468 in orxonox.OLD for orxonox/trunk/src/lib/graphics


Ignore:
Timestamp:
Jun 2, 2005, 1:47:16 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: doxytag

Location:
orxonox/trunk/src/lib/graphics/importer
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/importer/model.h

    r4106 r4468  
    2828#define NORMAL 1       //!< If Faces are created WITH Normals (otherwise autocalculate)
    2929#define TEXCOORD 2     //!< If Faces are created WITH TextureCoordinate
     30
    3031//! an enumerator for VERTEX_FORMAT
    3132typedef enum VERTEX_FORMAT {VERTEX_ONLY = VERTEX,
    32                     VERTEX_NORMAL = NORMAL,
    33                     VERTEX_TEXCOORD = TEXCOORD,
    34                     VERTEX_TEXCOORD_NORMAL = NORMAL | TEXCOORD};
     33                            VERTEX_NORMAL = NORMAL,
     34                            VERTEX_TEXCOORD = TEXCOORD,
     35                            VERTEX_TEXCOORD_NORMAL = NORMAL | TEXCOORD};
    3536
    3637////////////////////
     
    4445  ~ModelFaceElement();
    4546
    46   int vertexNumber;         //!< The number of the Vertex out of the Array* vertices, this vertex points to.
    47   int normalNumber;         //!< The number of the Normal out of the Array* normals, this vertex points to.
    48   int texCoordNumber;       //!< The number of the textureCoordinate out of the Array* vTexture, this vertex points to.
    49   ModelFaceElement* next;   //!< Point to the next FaceElement in this List.
     47  int                vertexNumber;         //!< The number of the Vertex out of the Array* vertices, this vertex points to.
     48  int                normalNumber;         //!< The number of the Normal out of the Array* normals, this vertex points to.
     49  int                texCoordNumber;       //!< The number of the textureCoordinate out of the Array* vTexture, this vertex points to.
     50
     51  ModelFaceElement*  next;                 //!< Point to the next FaceElement in this List.
    5052};
    5153
     
    5658  ModelFace();
    5759  ~ModelFace();
    58 
    59   int vertexCount;                //!< The Count of vertices this Face has.
    60   ModelFaceElement* firstElem;    //!< Points to the first Vertex (FaceElement) of this Face.
    6160 
    62   Material* material;             //!< The Material to use.
     61  int                 vertexCount;     //!< The Count of vertices this Face has.
     62  ModelFaceElement*   firstElem;       //!< Points to the first Vertex (FaceElement) of this Face.
     63  Material*           material;        //!< The Material to use.
    6364 
    64   ModelFace* next;                //!< Pointer to the next Face.
     65  ModelFace*          next;            //!< Pointer to the next Face.
    6566};
    6667
     
    7475  void cleanup();
    7576
    76   char* name;                 //!< the Name of the Group. this is an identifier, that can be accessed via the draw (char* name) function.
     77  char*        name;           //!< the Name of the Group. this is an identifier, that can be accessed via the draw (char* name) function.
     78  GLubyte*     indices;        //!< The indices of the Groups. Needed for vertex-arrays
     79  GLuint       listNumber;     //!< The number of the GL-List this Group gets.
     80  ModelFace*   firstFace;      //!< The first Face in this group.
     81  ModelFace*   currentFace;    //!< The current Face in this Group (the one we are currently working with.)
     82  int          faceMode;       //!< The Mode the Face is in: initially -1, 0 for FaceList opened, 1 for Material,  3 for triangle, 4 for Quad, 5+ for Poly \todo ENUM...
     83  int          faceCount;      //!< The Number of Faces this Group holds.
    7784 
    78   GLubyte* indices;           //!< The indices of the Groups. Needed for vertex-arrays
    79   GLuint listNumber;          //!< The number of the GL-List this Group gets.
    80   ModelFace* firstFace;       //!< The first Face in this group.
    81   ModelFace* currentFace;     //!< The current Face in this Group (the one we are currently working with.)
    82   int faceMode;               //!< The Mode the Face is in: initially -1, 0 for FaceList opened, 1 for Material,  3 for triangle, 4 for Quad, 5+ for Poly \todo ENUM...
    83   int faceCount;              //!< The Number of Faces this Group holds.
    84  
    85   ModelGroup* next;           //!< Pointer to the next Group.
     85  ModelGroup*  next;           //!< Pointer to the next Group.
    8686};
    8787
     
    9393class Model
    9494{
    95  private:
    96 
    97   char* name;                 //!< This is the name of the Model.
    98   MODEL_TYPE type;            //!< A type for the Model
    99   bool finalized;             //!< Sets the Object to be finalized.
    100 
    101   int vertexCount;            //!< A modelwide Counter for vertices.
    102   int normalCount;            //!< A modelwide Counter for the normals.
    103   int texCoordCount;          //!< A modelwide Counter for the texCoord.
    104   Array* vertices;            //!< The Array that handles the Vertices.
    105   Array* normals;             //!< The Array that handles the Normals.
    106   Array* vTexture;            //!< The Array that handles the VertexTextureCoordinates.
    107 
    108   ModelGroup* firstGroup;     //!< The first of all groups.
    109   ModelGroup* currentGroup;   //!< The currentGroup. this is the one we will work with.
    110   int groupCount;             //!< The Count of Groups.
    111 
    112   tList<Material>* materialList;//!< A list for all the Materials in this Model
    113  
    114   bool buildVertexNormals(void);
    115 
    116   bool importToDisplayList(void);
    117   bool addGLElement(ModelFaceElement* elem);
    118 
    119   bool importToVertexArray(void);
    120 
    121   bool deleteArrays(void);
    122   bool cleanup(void);
    123 
    124 
    125  protected:
    126   float scaleFactor;    //!< The Factor with which the Model should be scaled. \todo maybe one wants to scale the Model after Initialisation
    127 
    128   Material* findMaterialByName(const char* materialName);
    129 
    130   void cubeModel(void);
    131 
    13295 public:
    13396  Model(const char* modelName = NULL, MODEL_TYPE type = MODEL_DISPLAY_LIST);
     
    167130  /** \returns The number of Texture Coordinates of the Model*/
    168131  inline int getTexCoordCount(void) const {return this->texCoordCount;}
     132
     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  void cubeModel(void);
     136
     137  Material* findMaterialByName(const char* materialName);
     138
     139 private:
     140  bool buildVertexNormals(void);
     141
     142  bool importToDisplayList(void);
     143  bool addGLElement(ModelFaceElement* elem);
     144
     145  bool importToVertexArray(void);
     146
     147  bool deleteArrays(void);
     148  bool cleanup(void);
     149
     150 private:
     151  char*            name;            //!< This is the name of the Model.
     152  MODEL_TYPE       type;            //!< A type for the Model
     153  bool             finalized;       //!< Sets the Object to be finalized.
     154
     155  int              vertexCount;     //!< A modelwide Counter for vertices.
     156  int              normalCount;     //!< A modelwide Counter for the normals.
     157  int              texCoordCount;   //!< A modelwide Counter for the texCoord.
     158  Array*           vertices;        //!< The Array that handles the Vertices.
     159  Array*           normals;         //!< The Array that handles the Normals.
     160  Array*           vTexture;        //!< The Array that handles the VertexTextureCoordinates.
     161
     162  ModelGroup*      firstGroup;      //!< The first of all groups.
     163  ModelGroup*      currentGroup;    //!< The currentGroup. this is the one we will work with.
     164  int              groupCount;             //!< The Count of Groups.
     165
     166  tList<Material>* materialList;    //!< A list for all the Materials in this Model
    169167};
    170168
  • orxonox/trunk/src/lib/graphics/importer/objModel.h

    r4117 r4468  
    1717
    1818 private:
    19   // Variables
    20   char* objPath;        //!< The Path where the obj and mtl-file are located.
    21 
    2219  ///// readin /////
    2320  bool importFile (const char* fileName);
    2421  bool readFromObjFile (const char* fileName);
    2522  bool readMtlLib (const char* matFile);
     23
     24 private:
     25  char*       objPath;     //!< The Path where the obj and mtl-file are located.
    2626};
    2727
  • orxonox/trunk/src/lib/graphics/importer/primitive_model.cc

    r4112 r4468  
    3636    {
    3737    default:
    38     case CUBE:
     38    case PRIM_CUBE:
    3939      this->cubeModel();
    4040      break;
    41     case SPHERE:
     41    case PRIM_SPHERE:
    4242      this->sphereModel(size, detail);
    4343      break;
    44     case CYLINDER:
     44    case PRIM_CYLINDER:
    4545      this->cylinderModel();
    4646      break;
    47     case CONE:
     47    case PRIM_CONE:
    4848      this->coneModel(size, detail);
    4949      break;
    50     case PLANE:
     50    case PRIM_PLANE:
    5151      this->planeModel(size, detail);
    5252      break;
  • orxonox/trunk/src/lib/graphics/importer/primitive_model.h

    r3658 r4468  
    1111
    1212//! Specification of different primitives the Model knows
    13 enum PRIMITIVE {CUBE, SPHERE, PLANE, CYLINDER, CONE};
    14 
    15 // FORWARD DEFINITION \\
     13enum PRIMITIVE { PRIM_CUBE,
     14                 PRIM_SPHERE,
     15                 PRIM_PLANE,
     16                 PRIM_CYLINDER,
     17                 PRIM_CONE };
    1618
    1719//! A Class to create some default Models
Note: See TracChangeset for help on using the changeset viewer.