Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 10, 2005, 3:52:33 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: some more functionality in the abstractModel class

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/vertex_list_model.cc

    r6006 r6008  
    1818#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER
    1919
    20 #include "model.h"
     20#include "vertex_list_model.h"
    2121
    2222#include "stdlibincl.h"
     
    2626
    2727using namespace std;
    28 
    29 
    30 ////////////////////
    31 /// SUB-Elements ///
    32 ////////////////////
    33 /**
    34  *  creates a new ModelFaceElement
    35 */
    36 ModelFaceElement::ModelFaceElement()
    37 {
    38   this->vertexNumber = -1;
    39   this->normalNumber = -1;
    40   this->texCoordNumber = -1;
    41 
    42   this->next = NULL;
    43 }
    44 
    45 /**
    46  *  destroys a ModelFaceElement
    47 */
    48 ModelFaceElement::~ModelFaceElement()
    49 {
    50   if (this->next)
    51     delete this->next;
    52 }
    53 
    54 /**
    55  *  creates a new ModelFace
    56 */
    57 ModelFace::ModelFace()
    58 {
    59   this->vertexCount = 0;
    60 
    61   this->firstElem = NULL;
    62 
    63   this->material = NULL;
    64 
    65   this->next = NULL;
    66 }
    67 
    68 /**
    69  *  deletes a ModelFace
    70 */
    71 ModelFace::~ModelFace()
    72 {
    73   PRINTF(5)("Cleaning up Face\n");
    74 
    75   if (this->firstElem != NULL)
    76     delete this->firstElem;
    77 
    78   if (this->next != NULL)
    79     delete this->next;
    80 }
    81 
    82 /**
    83  *  Creates a new ModelGroup
    84 */
    85 ModelGroup::ModelGroup()
    86 {
    87   PRINTF(4)("Adding new Group\n");
    88   this->name = "";
    89   this->faceMode = -1;
    90   this->faceCount = 0;
    91   this->next = NULL;
    92   this->listNumber = 0;
    93 
    94   this->firstFace = new ModelFace;
    95   this->currentFace = this->firstFace;
    96 }
    97 
    98 /**
    99  *  deletes a ModelGroup
    100 */
    101 ModelGroup::~ModelGroup()
    102 {
    103   PRINTF(5)("Cleaning up group\n");
    104   if (this->firstFace != NULL)
    105     delete this->firstFace;
    106 
    107   // deleting the glList
    108   if (this->listNumber != 0)
    109     glDeleteLists(this->listNumber, 1);
    110 
    111   if (this->name[0] != '\0')
    112     delete[] this->name;
    113 
    114   if (this->next !=NULL)
    115     delete this->next;
    116 
    117 }
    11828
    11929/**
Note: See TracChangeset for help on using the changeset viewer.