Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2842 in orxonox.OLD for orxonox/trunk/importer


Ignore:
Timestamp:
Nov 12, 2004, 6:51:15 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk/importer: doxygen tags added

Location:
orxonox/trunk/importer
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/importer/array.cc

    r2823 r2842  
    1616#include "array.h"
    1717
     18/**
     19   \brief creates a new Array
     20*/
    1821Array::Array ()
    1922{
    20   createArray ();
     23  initializeArray ();
    2124}
    2225
    23 void Array::createArray ()
     26/**
     27   \brief initializes an Array
     28   the Function does this by setting up a fistEntry, and setting the entryCount.
     29*/
     30void Array::initializeArray ()
    2431{
    2532  if (verbose >= 2)
     
    3340}
    3441
     42/**
     43   \brief finalizes an array.
     44   This Function creates the array, and makes it ready to be sent to the application.
     45*/
    3546void Array::finalizeArray (void)
    3647{
     
    4960}
    5061
    51 
     62/**
     63   \brief adds a new Entry to the Array
     64   \param entry Entry to add.
     65*/
    5266void Array::addEntry (GLfloat entry)
    5367{
     
    6882}
    6983
     84/**
     85   \brief Adds 3 entries at once (convenience)
     86*/
    7087void Array::addEntry (GLfloat entry0, GLfloat entry1, GLfloat entry2)
    7188{
     
    7592}
    7693 
    77 
     94/**
     95   \brief Gives back the array !! MUST be executed AFTER finalize.
     96   \returns The created array.
     97*/
    7898GLfloat* Array::getArray ()
    7999{
     
    81101}
    82102
     103/**
     104   \returns The Count of entries in the Array
     105*/
    83106int Array::getCount()
    84107{
     
    86109}
    87110
    88 
    89 
     111/**
     112   \brief Simple debug info about the Array
     113*/
    90114void Array::debug ()
    91115{
  • orxonox/trunk/importer/array.h

    r2823 r2842  
     1/*!
     2  \file array.h
     3  \brief Contains the Array Class that handles float arrays.
     4  this class creates a Array of a semi-Dynamic length.
     5  beware, that after finalizing the array may not be resized again.
     6*/
     7
    18#ifndef _ARRAY_H
    29#define _ARRAY_H
    310
    4 extern int verbose;
     11extern int verbose; //!< will be obsolete soon
    512
    613#include <GL/gl.h>
    714#include <GL/glu.h>
    815#include <fstream>
     16
     17
     18//! Array Class that handles dynamic-float arrays.
    919class Array
    1020{
     
    1222  Array ();
    1323
    14   void createArray ();
     24  void initializeArray ();
    1525  void finalizeArray (void);
    1626  void addEntry (GLfloat entry);
  • orxonox/trunk/importer/material.cc

    r2837 r2842  
    1616#include "material.h"
    1717
     18/**
     19   \brief creates a default Material with no Name
     20   normally you call this to create a material List (for an obj-file) and then append with addMaterial()
     21*/
    1822Material::Material()
    1923{
     
    2327}
    2428
     29/**
     30   \brief creates a Material.
     31   \param mtlName Name of the Material to be added to the Material List
     32*/
    2533Material::Material (char* mtlName)
    2634{
     
    3038}
    3139
     40/**
     41   \brief adds a new Material to the List.
     42   this Function will append a new Material to the end of a Material List.
     43   \param mtlName The name of the Material to be added.
     44*/
    3245Material* Material::addMaterial(char* mtlName)
    3346{
     
    4558}
    4659
     60/**
     61   \brief initializes a new Material with its default Values
     62*/
    4763void Material::init(void)
    4864{
     
    6076}
    6177
    62 
     78/**
     79   \brief Set the Name of the Material. (Important for searching)
     80   \param mtlName the Name of the Material to be set.
     81*/
    6382void Material::setName (char* mtlName)
    6483{
     
    6988
    7089}
     90/**
     91   \returns The Name of The Material
     92*/
    7193char* Material::getName (void)
    7294{
     
    7496}
    7597
    76 
     98/**
     99   \brief Sets the Material Illumination Model.
     100   \brief illu illumination Model in int form
     101*/
    77102void Material::setIllum (int illum)
    78103{
     
    82107  //  printf ("setting illumModel to: %i\n", illumModel);
    83108}
    84 void Material::setIllum (char* illum)
     109/**
     110   \brief Sets the Material Illumination Model.
     111   \brief illu illumination Model in char* form
     112*/void Material::setIllum (char* illum)
    85113{
    86114  setIllum (atoi(illum));
    87115}
    88116
     117/**
     118   \brief Sets the Material Diffuse Color.
     119   \param r Red Color Channel.
     120   \param g Green Color Channel.
     121   \param b Blue Color Channel.
     122*/
    89123void Material::setDiffuse (float r, float g, float b)
    90124{
     
    97131
    98132}
     133/**
     134   \brief Sets the Material Diffuse Color.
     135   \param rgb The red, green, blue channel in char format (with spaces between them)
     136*/
    99137void Material::setDiffuse (char* rgb)
    100138{
     
    104142}
    105143
     144/**
     145   \brief Sets the Material Ambient Color.
     146   \param r Red Color Channel.
     147   \param g Green Color Channel.
     148   \param b Blue Color Channel.
     149*/
    106150void Material::setAmbient (float r, float g, float b)
    107151{
     
    113157  ambient[3] = 1.0;
    114158}
     159/**
     160   \brief Sets the Material Ambient Color.
     161   \param rgb The red, green, blue channel in char format (with spaces between them)
     162*/
    115163void Material::setAmbient (char* rgb)
    116164{
     
    120168}
    121169
     170/**
     171   \brief Sets the Material Specular Color.
     172   \param r Red Color Channel.
     173   \param g Green Color Channel.
     174   \param b Blue Color Channel.
     175*/
    122176void Material::setSpecular (float r, float g, float b)
    123177{
     
    129183  specular[3] = 1.0;
    130184 }
     185/**
     186   \brief Sets the Material Specular Color.
     187   \param rgb The red, green, blue channel in char format (with spaces between them)
     188*/
    131189void Material::setSpecular (char* rgb)
    132190{
     
    136194}
    137195
     196/**
     197   \brief Sets the Material Shininess.
     198   \param shini stes the Shininess from float.
     199*/
    138200void Material::setShininess (float shini)
    139201{
    140202  shininess = shini;
    141203}
     204/**
     205   \brief Sets the Material Shininess.
     206   \param shini stes the Shininess from char*.
     207*/
    142208void Material::setShininess (char* shini)
    143209{
     
    145211}
    146212
     213/**
     214   \brief Sets the Material Transparency.
     215   \param trans stes the Transparency from int.
     216*/
    147217void Material::setTransparency (float trans)
    148218{
     
    151221  transparency = trans;
    152222}
     223/**
     224   \brief Sets the Material Transparency.
     225   \param trans stes the Transparency from char*.
     226*/
    153227void Material::setTransparency (char* trans)
    154228{
     
    158232}
    159233
    160 
     234/**
     235   \brief Search for a Material called mtlName
     236   \param mtlName the Name of the Material to search for
     237   \returns Material named mtlName if it is found. NULL otherwise.
     238*/
    161239Material* Material::search (char* mtlName)
    162240{
     
    179257}
    180258
     259/**
     260   \brief sets the material with which the following Faces will be painted
     261*/
    181262bool Material::select (void)
    182263{
  • orxonox/trunk/importer/material.h

    r2836 r2842  
     1/*!
     2  \file material.h
     3  \brief Contains the Material Class that handles Material for 3D-Objects.
     4*/
     5
    16#ifndef _MATERIAL_H
    27#define _MATERIAL_H
    38
    4 extern int verbose;
     9extern int verbose; //!< will be obsolete soon.
    510
    611#include <GL/gl.h>
     
    914#include <fstream>
    1015
     16//! Class to handle Materials.
    1117class Material
    1218{
     
    3945  bool select (void);
    4046
    41   Material* nextMat;
     47  Material* nextMat; //!< pointer to the Next Material of the List. NULL if no next exists.
    4248
    4349 private:
  • orxonox/trunk/importer/object.cc

    r2837 r2842  
    1616#include "object.h"
    1717
     18/**
     19   \brief Creates a 3D-Object, but does not load any 3D-models
     20   pretty useless
     21*/
    1822Object::Object ()
    1923{
    2024
    2125  initialize();
    22 
    23   importFile ("reaphigh.obj");
     26 
     27  importFile ("");
    2428
    2529  finalize();
    2630}
    2731
     32/**
     33   \brief Crates a 3D-Object and loads in a File
     34   \param fileName file to parse and load (must be a .obj file)
     35*/
    2836Object::Object(char* fileName)
    2937{
     
    3442  finalize();
    3543}
     44
     45/**
     46   \brief Crates a 3D-Object, loads in a File and scales it.
     47   \param fileName file to parse and load (must be a .obj file)
     48   \param scaling The factor that the object will be scaled with.
     49*/
    3650
    3751Object::Object(char* fileName, float scaling)
     
    4559}
    4660
     61/**
     62    \brief initializes the Object
     63    This Function initializes all the needed arrays, Lists and clientStates
     64*/
    4765bool Object::initialize (void)
    4866{
     
    7088}
    7189
     90/**
     91   \brief Imports a obj file and handles the the relative location
     92   \param fileName The file to import
     93*/
    7294bool Object::importFile (char* fileName)
    7395{
     
    79101}
    80102
     103/**
     104   \brief finalizes an Object.
     105   This funcion is needed, to close the glList and all the other lists.
     106*/
    81107bool Object::finalize(void)
    82108{
     
    89115}
    90116
     117/**
     118   \brief Draws the Object
     119   It does this by just calling the List that must have been created earlier.
     120*/
    91121void Object::draw (void)
    92122{
     
    96126}
    97127
    98 
     128/**
     129   \brief Reads in the .obj File and sets all the Values.
     130   This function does read the file, parses it for the occurence of things like vertices, faces and so on, and executes the specific tasks
     131   \param fileName the File that will be parsed (.obj-file)
     132*/
    99133bool Object::readFromObjFile (char* fileName)
    100134{
     
    158192}
    159193
    160 
     194/**
     195   \brief parses a vertex-String
     196   If a vertex line is found this function will inject it into the vertex-Array
     197   \param vertexString The String that will be parsed.
     198*/
    161199bool Object::readVertex (char* vertexString)
    162200{
     
    172210}
    173211
     212/**
     213   \brief parses a face-string
     214   If a face line is found this function will add it to the glList.
     215   The function makes a difference between QUADS and TRIANGLES, and will if changed re-open, set and re-close the gl-processe.
     216   \param faceString The String that will be parsed.
     217*/
    174218bool Object::readFace (char* faceString)
    175219{
     
    225269}
    226270
     271/**
     272   \brief Adds a Face-element (one vertex of a face) with all its information.
     273   It does this by searching:
     274   1. The Vertex itself
     275   2. The VertexNormale
     276   3. The VertexTextureCoordinate
     277   merging this information, the face will be drawn.
     278
     279*/
    227280bool Object::addGLElement (char* elementString)
    228281{
     
    249302}
    250303
     304/**
     305   \brief parses a vertexNormal-String
     306   If a vertexNormal line is found this function will inject it into the vertexNormal-Array
     307   \param normalString The String that will be parsed.
     308*/
    251309bool Object::readVertexNormal (char* normalString)
    252310{
     
    262320}
    263321
     322/**
     323   \brief parses a vertexTextureCoordinate-String
     324   If a vertexTextureCoordinate line is found this function will inject it into the vertexTexture-Array
     325   \param vTextureString The String that will be parsed.
     326*/
    264327bool Object::readVertexTexture (char* vTextureString)
    265328{
     
    275338}
    276339
    277 
     340/**
     341    \brief Function to read in a mtl File.
     342    this Function parses all Lines of an mtl File
     343    \param mtlFile The .mtl file to read
     344*/
    278345bool Object::readMtlLib (char* mtlFile)
    279346{
     
    345412}
    346413
     414/**
     415   \brief Function that selects a material, if changed in the obj file.
     416   \param matString the Material that will be set.
     417*/
     418
    347419bool Object::readUseMtl (char* matString)
    348420{
     
    362434}
    363435
    364 
     436/**
     437   \brief Includes a default object
     438   This will inject a Cube, because this is the most basic object.
     439*/
    365440void Object::BoxObject(void)
    366441{
  • orxonox/trunk/importer/object.h

    r2833 r2842  
    11/*!
    2  \file object.h
    3  \brief Contains the Object Class that handles 3D-Objects
     2  \file object.h
     3  \brief Contains the Object Class that handles 3D-Objects
    44*/
    55
     
    1515
    1616using namespace std;
    17 extern int verbose;
     17
     18extern int verbose; //!< fill be removed and added again as a verbose-class
     19
    1820
    1921//! Class that handles 3D-Objects. it can also read them in and display them.
Note: See TracChangeset for help on using the changeset viewer.