Changeset 2111 for GTP/trunk/Lib/Vis


Ignore:
Timestamp:
02/09/07 14:39:35 (17 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis
Files:
4 deleted
23 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreBoundingBoxConverter.h

    r2097 r2111  
    88#include "Containers.h" 
    99#include "IntersectableWrapper.h" 
    10 //#include "KdTree.h" 
    1110 
    1211 
     
    1413 
    1514#define USE_KD_PVS 1 
     15 
    1616class Entity; 
    1717class OctreeSceneManager; 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj

    r2100 r2111  
    638638                        Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> 
    639639                        <File 
    640                                 RelativePath="..\src\OgreBoundingBoxConverter.cpp"> 
    641                         </File> 
    642                         <File 
    643640                                RelativePath="..\src\OgreMeshInstance.cpp"> 
    644641                        </File> 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/include/ObjManualMeshLoader.h

    r2110 r2111  
    1 #ifndef __IVManualMeshLoader_H__ 
    2 #define __IVManualMeshLoader_H__ 
     1#ifndef __ObjManualMeshLoader_H__ 
     2#define __ObjManualMeshLoader_H__ 
    33 
    44 
     
    77 
    88 
    9 class __declspec(dllexport) IVManualMeshLoader: public Ogre::ManualResourceLoader 
     9class __declspec(dllexport) ObjManualMeshLoader: public Ogre::ManualResourceLoader 
    1010{ 
    1111        public: 
    12                 IVManualMeshLoader(); 
    13                 IVManualMeshLoader(IVMeshData *mData); 
    14                 ~IVManualMeshLoader();  
     12                ObjManualMeshLoader(); 
     13                ObjManualMeshLoader(ObjMeshData *mData); 
     14                ~ObjManualMeshLoader();  
    1515 
    1616                void loadResource(Ogre::Resource *resource); 
     
    1818                Ogre::AxisAlignedBox *getBoundingBox(); 
    1919        private: 
    20                 IVMeshData *data; 
     20                ObjMeshData *data; 
    2121 
    2222}; 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/include/ObjMeshData.h

    r2109 r2111  
    1 #ifndef __IVMeshData_H__ 
    2 #define __IVMeshData_H__ 
     1#ifndef __ObjMeshData_H__ 
     2#define __ObjMeshData_H__ 
    33 
    44 
    55#include <Ogre.h> 
    66 
    7 enum mIVReaderenderOperationType 
     7enum ObjReaderOpType 
    88{ 
    99        IV_ROT_INVALID = -1, 
     
    1313}; 
    1414 
    15 class __declspec(dllexport) IVMeshData 
     15class __declspec(dllexport) ObjMeshData 
    1616{ 
    1717        public:  
    18                 IVMeshData(); 
    19                 ~IVMeshData(); 
     18                ObjMeshData(); 
     19                ~ObjMeshData(); 
    2020 
    21                 IVMeshData *expand(); 
     21                ObjMeshData *expand(); 
    2222 
    2323                void collapse(); 
     
    2525                Ogre::Real *vertices, *normals, *texCoords, *indices, *normalIndices, *texCoordIndices; 
    2626                int vcnt, ncnt, tcnt, icnt, nicnt, ticnt; 
    27                 mIVReaderenderOperationType roType; 
     27                ObjReaderOpType roType; 
    2828                Ogre::AxisAlignedBox *boundingBox; 
    2929 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/include/ObjNode.h

    r2109 r2111  
    1 #ifndef __IVNode_H__ 
    2 #define __IVNode_H__ 
     1#ifndef __ObjNode_H__ 
     2#define __ObjNode_H__ 
    33 
    44 
     
    66#include <Ogre.h> 
    77 
    8 enum IVType 
     8enum ObjType 
    99{ 
    1010        IV_INVALID = -1, 
     
    1515 
    1616 
    17 class IVField 
     17class ObjField 
    1818{ 
    1919public: 
    20         IVField(); 
    21         ~IVField(); 
     20        ObjField(); 
     21        ~ObjField(); 
    2222 
    2323        char *name; 
    2424        void *value; 
    25         IVType typ; 
     25        ObjType typ; 
    2626        int cnt; 
    27         IVField *next; 
     27        ObjField *next; 
    2828}; 
    2929 
    30 class __declspec(dllexport) IVNode 
     30class __declspec(dllexport) ObjNode 
    3131{ 
    3232        public: 
    33                 IVNode(); 
    34                 IVNode(const char *s); 
    35                 ~IVNode(); 
     33                ObjNode(); 
     34                ObjNode(const char *s); 
     35                ~ObjNode(); 
    3636 
    3737                void print(int ident=0); 
    38                 void attachNode(IVNode *child); 
     38                void attachNode(ObjNode *child); 
    3939                void addField(const char *name, char *value); 
    40                 void addField(const char *name, void *value, int cnt, IVType typ); 
     40                void addField(const char *name, void *value, int cnt, ObjType typ); 
    4141 
    42                 IVNode *getParent() { return parent; } 
     42                ObjNode *getParent() { return parent; } 
    4343                char *getName() { return name; } 
    44                 IVNode *getNodeRecursive(const char *name); 
    45                 IVNode *getNextChildNode(bool reset = false); 
    46                 IVField *getField(const char *name); 
    47                 void *getField(const char *name, IVType *typ, int *cnt); 
     44                ObjNode *getNodeRecursive(const char *name); 
     45                ObjNode *getNextChildNode(bool reset = false); 
     46                ObjField *getField(const char *name); 
     47                void *getField(const char *name, ObjType *typ, int *cnt); 
    4848 
    4949        private: 
    5050                char *name; 
    51                 IVField *fields; 
    52                 IVNode *parent; 
    53                 IVNode *children; 
    54                 IVNode *next; 
     51                ObjField *fields; 
     52                ObjNode *parent; 
     53                ObjNode *children; 
     54                ObjNode *next; 
    5555 
    56                 IVNode *actual; 
     56                ObjNode *actual; 
    5757}; 
    5858 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/include/ObjReader.h

    r2110 r2111  
    1 #ifndef __mIVReader_H__ 
    2 #define __mIVReader_H__ 
     1#ifndef __ObjReader_H__ 
     2#define __ObjReader_H__ 
     3 
     4//#include <stdlib> 
     5#include <string> 
     6#include <vector> 
     7#include <Ogre.h> 
     8/*#include "ObjNode.h" 
     9#include "ObjMeshData.h" 
     10#include "ObjManualMeshLoader.h" 
     11*/ 
    312 
    413 
    5 #include "ObjNode.h" 
    6 #include "ObjMeshData.h" 
    7 #include "ObjManualMeshLoader.h" 
    8 #include "Ogre.h" 
     14namespace GtpVisibilityPreprocessor { 
    915 
    10 #define COMMENTCHAR '#' 
    11 #define BLOCKSIZE 150 
    12 #define BUFFERSIZE 256 
     16struct Triangle3; 
    1317 
     18} 
    1419 
    15 static const int validIVHeaderCnt = 2; 
     20typedef std::vector<GtpVisibilityPreprocessor::Triangle3 *> TriangleContainer; 
    1621 
    17 static const char *validIVHeader[2] = { 
    18     { "#Inventor V2.1 ascii\n" }, 
    19         { "#VRML V1.0 ascii\n" }, 
     22class __declspec(dllexport) ObjReader 
     23{ 
     24public: 
     25        ObjReader(); 
     26        ~ObjReader(); 
     27 
     28        bool LoadFile(const std::string &filename, 
     29                                  TriangleContainer &triangles) const; 
     30         
     31        const std::vector<Ogre::Entity *> &GetObjects() const; 
     32 
     33protected: 
     34 
     35        std::vector<Ogre::Entity *> mObjects; 
    2036}; 
    2137 
    22  
    23 enum IVTokenType 
    24 { 
    25         IV_TOKEN_INVALID = -1, 
    26         IV_TOKEN_STRING = 0, 
    27         IV_TOKEN_INT = 1, 
    28         IV_TOKEN_REAL = 2, 
    29         IV_TOKEN_BRACEOPEN = 3,                         // { 
    30         IV_TOKEN_BRACECLOSE = 4,                        // } 
    31         IV_TOKEN_BRACKETOPEN = 5,                       // [ 
    32         IV_TOKEN_BRACKETCLOSE = 6,                      // ] 
    33         IV_TOKEN_PARENTHESISOPEN = 7,           // ( 
    34         IV_TOKEN_PARENTHESISCLOSE = 8,          // ) 
    35         IV_TOKEN_DEF = 9,                                       // DEF 
    36         IV_TOKEN_USE = 10,                                      // USE 
    37 }; 
    38  
    39 class __declspec(dllexport) IVMeshListNode 
    40 { 
    41         public: 
    42                 IVMeshListNode(std::string name, IVManualMeshLoader *loader); 
    43                 ~IVMeshListNode(); 
    44  
    45                 void attachNewNode(std::string name, IVManualMeshLoader *loader); 
    46  
    47                 IVManualMeshLoader *getManualMeshLoader(std::string name); 
    48  
    49                 IVMeshListNode *next; 
    50  
    51         private: 
    52                 std::string name; 
    53                 IVManualMeshLoader *loader; 
    54 }; 
    55  
    56 class __declspec(dllexport) IVDefListNode 
    57 { 
    58         public: 
    59                 IVDefListNode(std::string name, IVNode *node); 
    60                 ~IVDefListNode(); 
    61  
    62                 void attachNewNode(std::string name, IVNode *node); 
    63  
    64                 IVNode *getDef(std::string name); 
    65  
    66                 IVDefListNode *next; 
    67  
    68         private: 
    69                 std::string name; 
    70                 IVNode *node; 
    71  
    72 }; 
    73  
    74 class __declspec(dllexport) IVReader 
    75 { 
    76         public: 
    77                 IVReader(); 
    78                 ~IVReader(); 
    79  
    80                 void setLog(Ogre::Log *IVLog = NULL); 
    81  
    82                 bool loadFile(const char* filename); 
    83                 void print(); 
    84 //              IVNode *getNode(const char* name); 
    85  
    86  
    87                 void buildTree(Ogre::SceneManager *sceneMgr, Ogre::SceneNode *sceneNodeRoot); 
    88  
    89                 void collapse(); 
    90  
    91                 static std::string intToStr(int num); 
    92                 static std::string realToStr(Ogre::Real num); 
    93                  
    94                 static Ogre::Log *IVLog; 
    95  
    96         private: 
    97                 bool checkHeader(const char *string); 
    98                 char buf[BUFFERSIZE]; 
    99                 int bufOffset; 
    100                 bool getNextElement(char *token, IVTokenType *type); 
    101                 void classify(char *token, IVTokenType *type); 
    102  
    103                 bool isSpace(char c); 
    104                 bool isNewline(char c); 
    105                 bool eof; 
    106                 bool isDigit(char c); 
    107                 bool isHexDigit(char c); 
    108  
    109                 IVNode *root; 
    110                 FILE* infile; 
    111  
    112                 static IVMeshListNode *meshList; 
    113                 static void addMeshToList(std::string name, IVManualMeshLoader *loader); 
    114                  
    115                 static int instanceCnt; 
    116  
    117                 int treeCnt, nodeCnt, matCnt; 
    118                 char *fileName; 
    119  
    120                 Ogre::Entity *createEntity(Ogre::SceneManager* sceneMgr, std::string name, IVMeshData *mData, Ogre::Vector3 *translation = NULL); 
    121  
    122                 void buildTree(Ogre::SceneManager *sceneMgr, Ogre::SceneNode *sceneNodeRoot, IVNode *mIVReaderoot, IVMeshData *mData = NULL, Ogre::Material *material = NULL); 
    123  
    124                 IVDefListNode *defList; 
    125                 void addDefToList(std::string name, IVNode *node); 
    126  
    127  
    128 }; 
    129  
    130  
    13138#endif 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/src/ObjManualMeshLoader.cpp

    r2110 r2111  
    22#include "ObjReader.h" 
    33 
    4 IVManualMeshLoader::IVManualMeshLoader() 
     4ObjManualMeshLoader::ObjManualMeshLoader() 
    55{ 
    66        data = NULL; 
     
    88 
    99 
    10 IVManualMeshLoader::IVManualMeshLoader(IVMeshData *mData) 
     10ObjManualMeshLoader::ObjManualMeshLoader(ObjMeshData *mData): 
     11data(mData) 
    1112{ 
    12         data = mData; 
    13 /*      data = new IVMeshData(); 
    14         if ((mData->indices != NULL) && (mData->icnt > 0)) 
    15         { 
    16                 data->icnt = mData->icnt; 
    17                 data->indices = new Ogre::Real[mData->icnt]; 
    18                 memcpy(data->indices, mData->indices, mData->icnt*sizeof(Ogre::Real)); 
    19         } 
    20         if ((mData->vertices != NULL) && (mData->vcnt > 0)) 
    21         { 
    22                 data->vcnt = mData->vcnt; 
    23                 data->vertices = new Ogre::Real[mData->vcnt]; 
    24                 memcpy(data->vertices, mData->vertices, mData->vcnt*sizeof(Ogre::Real)); 
    25         } 
    26         if ((mData->normals != NULL) && (mData->vcnt > 0)) 
    27         { 
    28                 data->ncnt = mData->ncnt; 
    29                 data->normals = new Ogre::Real[mData->ncnt]; 
    30                 memcpy(data->normals, mData->normals, mData->ncnt*sizeof(Ogre::Real)); 
    31         } 
    32         if ((mData->texCoords != NULL) && (mData->tcnt > 0)) 
    33         { 
    34                 data->tcnt = mData->tcnt; 
    35                 data->texCoords = new Ogre::Real[mData->tcnt]; 
    36                 memcpy(data->texCoords, mData->texCoords, mData->tcnt*sizeof(Ogre::Real)); 
    37         } 
    38         */ 
    3913} 
    4014 
    41 IVManualMeshLoader::~IVManualMeshLoader() 
     15 
     16ObjManualMeshLoader::~ObjManualMeshLoader() 
    4217{ 
    43 /*      if (data != NULL) 
    44         { 
    45                 if (data->vertices != NULL)             delete [] data->vertices; 
    46                 if (data->normals != NULL)              delete [] data->normals; 
    47                 if (data->texCoords != NULL)    delete [] data->texCoords; 
    48                 if (data->indices != NULL)              delete [] data->indices; 
    49                 delete data; 
    50         } 
    51         */ 
    5218        if (data != NULL) 
    5319        { 
     
    5824 
    5925 
    60 Ogre::AxisAlignedBox *IVManualMeshLoader::getBoundingBox() 
     26Ogre::AxisAlignedBox *ObjManualMeshLoader::getBoundingBox() 
    6127{ 
    6228        return data->boundingBox; 
     
    6430 
    6531 
    66 void IVManualMeshLoader::loadResource(Ogre::Resource *resource) 
     32void ObjManualMeshLoader::loadResource(Ogre::Resource *resource) 
    6733{ 
    6834        using namespace Ogre; 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/src/ObjMeshData.cpp

    r2110 r2111  
    33 
    44 
    5 IVMeshData::IVMeshData() 
     5ObjMeshData::ObjMeshData() 
    66{  
    77        vertices = normals = texCoords = indices = normalIndices = texCoordIndices = NULL;  
     
    1111} 
    1212 
    13 IVMeshData::~IVMeshData() 
     13ObjMeshData::~ObjMeshData() 
    1414{  
    1515} 
    1616 
    17 void IVMeshData::collapse() 
     17void ObjMeshData::collapse() 
    1818{ 
    1919        if (indices != NULL)    delete [] indices; 
     
    2828} 
    2929 
    30 int IVMeshData::getSeparatorCnt(Ogre::Real *data, int end) 
     30int ObjMeshData::getSeparatorCnt(Ogre::Real *data, int end) 
    3131{ 
    3232        int cnt = 0; 
     
    3535} 
    3636 
    37 Ogre::AxisAlignedBox *IVMeshData::calcBoundingBox() 
     37Ogre::AxisAlignedBox *ObjMeshData::calcBoundingBox() 
    3838{ 
    3939        if ((vertices == NULL) || (vcnt <=0))  
     
    5858 
    5959 
    60 Ogre::Real *IVMeshData::expandTriangleStripIndices(Ogre::Real *indices, int icnt, int *icntOut) 
     60Ogre::Real *ObjMeshData::expandTriangleStripIndices(Ogre::Real *indices, int icnt, int *icntOut) 
    6161{ 
    6262        if (indices[icnt-1] >= 0.0) 
     
    9494}        
    9595 
    96 int IVMeshData::getNextFaceSize(int start) 
     96 
     97int ObjMeshData::getNextFaceSize(int start) 
    9798{ 
    9899        for (int i=start; i < icnt; i++)  
     
    103104} 
    104105 
    105 Ogre::Real *IVMeshData::expandFaceSetIndices(Ogre::Real *indices, int icnt, int *icntOut) 
     106 
     107Ogre::Real *ObjMeshData::expandFaceSetIndices(Ogre::Real *indices, int icnt, int *icntOut) 
    106108{ 
    107109        if (indices[icnt-1] >= 0.0) 
     
    126128} 
    127129 
    128 IVMeshData *IVMeshData::expand() 
     130ObjMeshData *ObjMeshData::expand() 
    129131{ 
    130132        using namespace Ogre; 
    131133 
    132         IVMeshData *mDataOut = new IVMeshData(); 
     134        ObjMeshData *mDataOut = new ObjMeshData(); 
    133135 
    134136        mDataOut->boundingBox = calcBoundingBox(); 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/src/ObjNode.cpp

    r2110 r2111  
    22#include "ObjReader.h" 
    33 
    4 IVField::IVField() 
     4ObjField::ObjField() 
    55{ 
    66        next = NULL; 
     
    99 
    1010 
    11 IVField::~IVField() 
     11ObjField::~ObjField() 
    1212{ 
    1313        if (value != NULL) free(value); 
     
    1717 
    1818 
    19 IVNode::IVNode() 
     19ObjNode::ObjNode() 
    2020{ 
    2121        parent = children = next = actual = NULL;  
     
    2525 
    2626 
    27 IVNode::IVNode(const char *s) 
     27ObjNode::ObjNode(const char *s) 
    2828{ 
    2929        name = new char[strlen(s)+1]; 
     
    3333} 
    3434 
    35 IVNode::~IVNode() 
     35ObjNode::~ObjNode() 
    3636{ 
    3737        if (name != NULL) delete[] name; 
    3838        if (fields != NULL)  
    3939        { 
    40                 IVField *help = fields, *delme = NULL; 
     40                ObjField *help = fields, *delme = NULL; 
    4141                while (help->next != NULL) 
    4242                { 
     
    4747        if (children != NULL)  
    4848        { 
    49                 IVNode *help = children, *delme = NULL; 
     49                ObjNode *help = children, *delme = NULL; 
    5050                while (help->next != NULL) 
    5151                { 
     
    6060 
    6161 
    62 void IVNode::attachNode(IVNode *child) 
     62void ObjNode::attachNode(ObjNode *child) 
    6363{ 
    6464        if (children == NULL) children = child; 
    6565        else  
    6666        { 
    67                 IVNode *help = children; 
     67                ObjNode *help = children; 
    6868                while (help->next != NULL) help = help->next; 
    6969                help->next = child; 
     
    7373 
    7474 
    75 void IVNode::print(int ident) 
     75void ObjNode::print(int ident) 
    7676{ 
    7777        if (IVReader::IVLog != NULL) 
     
    8585                IVReader::IVLog->logMessage(msg); 
    8686 
    87                 IVField *help = fields; 
     87                ObjField *help = fields; 
    8888                while (help != NULL) 
    8989                { 
     
    128128} 
    129129 
    130 void IVNode::addField(const char *name, void *value, int cnt, IVType typ) 
    131 { 
    132         IVField *newone = new IVField(); 
     130void ObjNode::addField(const char *name, void *value, int cnt, ObjType typ) 
     131{ 
     132        ObjField *newone = new ObjField(); 
    133133        newone->name = new char[strlen(name)+1]; 
    134134        strcpy(newone->name, name); 
     
    153153        else 
    154154        { 
    155                 IVField *help = fields; 
     155                ObjField *help = fields; 
    156156                while (help->next != NULL) help = help->next; 
    157157                help->next = newone; 
     
    160160 
    161161 
    162 void IVNode::addField(const char *name, char *value) 
     162void ObjNode::addField(const char *name, char *value) 
    163163{ 
    164164        addField(name, value, 1, IV_STRING); 
     
    166166 
    167167 
    168 IVNode *IVNode::getNodeRecursive(const char *name) 
     168ObjNode *ObjNode::getNodeRecursive(const char *name) 
    169169{ 
    170170        if (strcmp(name, this->name) == 0) return this; 
    171171        if (this->children != NULL) 
    172172        { 
    173                 IVNode *help = this->children->getNodeRecursive(name); 
     173                ObjNode *help = this->children->getNodeRecursive(name); 
    174174                if (help != NULL) return help; 
    175175        } 
     
    178178 
    179179 
    180 IVNode *IVNode::getNextChildNode(bool reset) 
     180ObjNode *ObjNode::getNextChildNode(bool reset) 
    181181{ 
    182182        if (reset) actual = this->children; 
     
    186186 
    187187 
    188 IVField *IVNode::getField(const char *name) 
    189 { 
    190         IVField *help = fields; 
     188ObjField *ObjNode::getField(const char *name) 
     189{ 
     190        ObjField *help = fields; 
    191191        while (help != NULL) 
    192192        { 
     
    197197} 
    198198 
    199 void *IVNode::getField(const char *name, IVType *typ, int *cnt) 
    200 { 
    201         IVField *help = fields; 
     199void *ObjNode::getField(const char *name, ObjType *typ, int *cnt) 
     200{ 
     201        ObjField *help = fields; 
    202202        while (help != NULL) 
    203203        { 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/src/ObjReader.cpp

    r2110 r2111  
    11#include "ObjReader.h" 
    2 #include <string> 
    3 #include <stdlib.h> 
    4 #include <sstream> 
    5  
    6 IVMeshListNode *IVReader::meshList = NULL; 
    7 int IVReader::instanceCnt = 0; 
    8 Ogre::Log *IVReader::IVLog = NULL; 
    9  
    10  
    11  
    12 IVMeshListNode::IVMeshListNode(std::string name, IVManualMeshLoader *loader) 
    13 { 
    14         this->name = name; 
    15         this->loader = loader; 
    16         next = NULL; 
    17 } 
    18  
    19 IVMeshListNode::~IVMeshListNode() 
    20 { 
    21         if (loader != NULL) delete loader; 
    22 } 
    23  
    24 void IVMeshListNode::attachNewNode(std::string name, IVManualMeshLoader *loader) 
    25 { 
    26         IVMeshListNode *help = this; 
    27  
    28         while (help->next != NULL) help = help->next; 
    29         help->next = new IVMeshListNode(name, loader); 
    30 } 
    31  
    32 IVManualMeshLoader *IVMeshListNode::getManualMeshLoader(std::string name) 
    33 { 
    34         IVMeshListNode *help = this; 
    35         if (help->name == name) return help->loader; 
    36         while (help->next != NULL)  
    37         { 
    38                 help = help->next; 
    39                 if (help->name == name) return help->loader; 
    40         } 
    41         return NULL; 
    42 } 
    43  
    44 IVDefListNode::IVDefListNode(std::string name, IVNode *node) 
    45 { 
    46         this->name = name; 
    47         this->node = node; 
    48         next = NULL; 
    49 } 
    50  
    51 IVDefListNode::~IVDefListNode() 
    52 { 
    53 } 
    54  
    55 void IVDefListNode::attachNewNode(std::string name, IVNode *node) 
    56 { 
    57         IVDefListNode *help = this; 
    58  
    59         while (help->next != NULL) help = help->next; 
    60         help->next = new IVDefListNode(name, node); 
    61 } 
    62  
    63 IVNode *IVDefListNode::getDef(std::string name) 
    64 { 
    65         IVDefListNode *help = this; 
    66         if (help->name == name) return help->node; 
    67         while (help->next != NULL)  
    68         { 
    69                 help = help->next; 
    70                 if (help->name == name) return help->node; 
    71         } 
    72         return NULL; 
    73 } 
    74  
    75 IVReader::IVReader() 
    76 {        
    77         root = NULL; meshList = NULL; defList = NULL; fileName = NULL; 
    78         instanceCnt++; 
    79         IVLog = NULL; 
    80 } 
    81  
    82 IVReader::~IVReader() 
    83 { 
    84         collapse(); 
    85  
    86         instanceCnt--; 
    87         if (instanceCnt == 0) if (meshList != NULL)  
    88         {        
    89                 IVMeshListNode *help = meshList, *delme = NULL; 
    90                 while (help->next != NULL) 
    91                 { 
    92                         delme = help; help = help->next; delete delme; 
    93                 } 
    94                 delete help; 
    95         } 
    96 } 
    97  
    98 void IVReader::collapse() 
    99 { 
    100         if (root != NULL) {     delete root; root = NULL; } 
    101         if (defList != NULL) 
    102         {        
    103                 IVDefListNode *help = defList, *delme = NULL; 
    104                 while (help->next != NULL) 
    105                 { 
    106                         delme = help; help = help->next; delete delme; 
    107                 } 
    108                 delete help; 
    109                 defList = NULL; 
    110         } 
    111         if (this->fileName != NULL) { delete [] this->fileName; this->fileName = NULL; } 
    112  
    113 } 
    114  
    115 void IVReader::setLog(Ogre::Log *IVLog) 
    116 { 
    117         this->IVLog = IVLog; 
    118 } 
    119  
    120 std::string IVReader::intToStr(int num) 
    121 { 
    122         std::ostringstream myStream;  
    123         myStream << num; 
    124         myStream.flush(); 
    125          
    126         return(myStream.str()); 
    127 } 
    128  
    129 std::string IVReader::realToStr(Ogre::Real num) 
    130 { 
    131         std::ostringstream myStream;  
    132         myStream << num; 
    133         myStream.flush(); 
    134          
    135         return(myStream.str()); 
    136 } 
    137  
    138 bool IVReader::loadFile(const char* fileName) 
    139 { 
    140         std::string message = "trying to load "; message = message + fileName + "..."; 
    141          
    142         if (IVLog != NULL)  
    143                 IVLog->logMessage(message); 
    144          
    145         collapse(); 
    146         this->fileName = new char[strlen(fileName)+1]; strcpy(this->fileName, fileName); 
    147         treeCnt = 0; 
    148  
    149     infile = fopen(fileName, "r"); root = NULL; 
    150  
    151         if (infile == NULL) 
    152         { 
    153                 message = "! Error loading File "; message = message + fileName + " !"; 
    154                 if (IVLog != NULL) IVLog->logMessage(message); 
     2#include "gzstream.h" 
     3#include "Triangle3.h" 
     4 
     5 
     6ObjReader::ObjReader() 
     7{} 
     8 
     9ObjReader::~ObjReader() 
     10{} 
     11 
     12 
     13bool ObjReader::LoadFile(const string &filename, 
     14                                                 TriangleContainer &triangles) const 
     15{ 
     16        igzstream samplesIn(filename.c_str()); 
     17         
     18        if (!samplesIn.is_open()) 
    15519                return false; 
    156         } 
    157  
    158         if ((fgets(buf, BUFFERSIZE, infile) == NULL) && !feof(infile))  
    159         { 
    160                 message = "! Error loading File "; message = message + fileName + " !"; 
    161                 if (IVLog != NULL) IVLog->logMessage(message); 
    162                 fclose(infile); 
    163                 return false; 
    164         } 
    165  
    166         if (!checkHeader(buf))  
    167         { 
    168                 message = "! Invalid Header !"; 
    169                 if (IVLog != NULL) IVLog->logMessage(message); 
    170                 fclose(infile); 
    171                 return false; 
    172         } 
    173  
    174         IVTokenType tmptyp = IV_TOKEN_INVALID; 
    175         eof = false;     
    176  
    177         bufOffset = 0; 
    178         char token[BUFFERSIZE] = "\0", oldtoken[BUFFERSIZE] = "\0", fieldtoken[BUFFERSIZE] = "\0"; 
    179         int level = 0;  
    180  
    181         while (getNextElement(token, &tmptyp))  
    182         { 
    183                 if (tmptyp == IV_TOKEN_BRACEOPEN)  
    184                 { 
    185                         root = new IVNode(oldtoken); 
    186                         level++; 
     20         
     21        // read in triangle size 
     22        int numTriangles; 
     23 
     24        samplesIn.read(reinterpret_cast<char *>(&numTriangles), sizeof(int)); 
     25        triangles.reserve(numTriangles); 
     26         
     27        while (1) 
     28        { 
     29                GtpVisibilityPreprocessor::Triangle3 *tri =  
     30                        new GtpVisibilityPreprocessor::Triangle3(); 
     31                 
     32                samplesIn.read(reinterpret_cast<char *>((*tri).mVertices + 0),  
     33                                           sizeof(GtpVisibilityPreprocessor::Vector3)); 
     34                samplesIn.read(reinterpret_cast<char *>((*tri).mVertices + 1),  
     35                                           sizeof(GtpVisibilityPreprocessor::Vector3)); 
     36                samplesIn.read(reinterpret_cast<char *>((*tri).mVertices + 2),  
     37                                           sizeof(GtpVisibilityPreprocessor::Vector3)); 
     38 
     39                // end of file reached 
     40                if (samplesIn.eof()) 
    18741                        break; 
    188                 } 
    189  
    190                 strcpy(oldtoken, token); 
    191         } 
    192  
    193         IVNode *actualNode = root, *parent = root, *fieldNode = root, *newNode = NULL; 
    194         IVTokenType oldtmptyp = tmptyp; 
    195         bool textfield = false, realfield = false; IVType fieldtyp = IV_INVALID; 
    196         bool def = false; std::string defLabel; 
    197         Ogre::Real rblock[BLOCKSIZE];  
    198         float *rvalues; 
    199         int cnt = 0; int blockcnt = 0; 
    200         while (getNextElement(token, &tmptyp)) 
    201         { 
    202                 if ((tmptyp == IV_TOKEN_BRACKETOPEN))  
    203                         if (!getNextElement(token, &tmptyp)) break; 
    204                 if ((tmptyp == IV_TOKEN_INVALID))  
    205                         if (!getNextElement(token, &tmptyp)) break; 
    206                 if (tmptyp == IV_TOKEN_BRACEOPEN)  
    207                 { 
    208                         actualNode = new IVNode(oldtoken);  
    209                         if (parent == NULL) 
    210                         { 
    211                                 message = "Error loading file "; message = message + fileName + "! Invalid tree structure."; 
    212                                 if (IVLog != NULL) IVLog->logMessage(message); 
    213                                 fclose(infile); 
    214                                 return false; 
    215                         } 
    216                         parent->attachNode(actualNode); 
    217                         parent = actualNode; 
    218                         level++; 
    219  
    220                         if (def) 
    221                         { 
    222                                 addDefToList(defLabel, actualNode); 
    223                                 def = false; 
    224                         } 
    225  
    226                 } else 
    227                 if (tmptyp == IV_TOKEN_BRACECLOSE)  
    228                 { 
    229                         if (realfield) 
    230                         { 
    231                                 if (blockcnt == 0) rvalues = (Ogre::Real *)malloc((cnt)*sizeof(Ogre::Real)); 
    232                                 else rvalues = (Ogre::Real *)realloc(rvalues, (BLOCKSIZE*(blockcnt) + cnt)*sizeof(Ogre::Real));                                          
    233                                 memcpy((void *)&rvalues[BLOCKSIZE*blockcnt], rblock, cnt*sizeof(Ogre::Real)); 
    234                                 fieldNode->addField(fieldtoken, rvalues, BLOCKSIZE*blockcnt+cnt, fieldtyp); 
    235                                 realfield = false; 
    236 //                              free(rvalues); 
    237                         } 
    238  
    239                         if (level > 0) 
    240                         { 
    241                                 actualNode = parent = actualNode->getParent(); 
    242                                 level--; 
    243                         } 
    244                 } else 
    245                 { 
    246                         if (oldtmptyp == IV_TOKEN_DEF) 
    247                         { 
    248                                 def = true; defLabel = ""; defLabel = defLabel + token; 
    249                         } else 
    250                         if (oldtmptyp == IV_TOKEN_USE) 
    251                         { 
    252                                         newNode = new IVNode("USE");  
    253                                         if (parent == NULL) 
    254                                         { 
    255                                                 message = "Error loading file "; message = message + fileName + "! Invalid tree structure."; 
    256                                                 if (IVLog != NULL) IVLog->logMessage(message); 
    257                                                 fclose(infile); 
    258                                                 return false; 
    259                                         } 
    260                                         char *s = (char *)malloc(sizeof(char)*(strlen(token)+1)); 
    261                                         memcpy(s, token, strlen(token)); 
    262                                         s[strlen(token)] = '\0'; 
    263                                         newNode->addField("label", s); 
    264                                         actualNode->attachNode(newNode); 
    265                         } else 
    266                         if (!def) 
    267                         if (oldtmptyp == IV_TOKEN_STRING) 
    268                         { 
    269                                 if (!textfield) 
    270                                 { 
    271                                         if (tmptyp == IV_TOKEN_STRING) 
    272                                         { 
    273 /*                                              char *s = new char[strlen(token)+1]; 
    274                                                 strcpy(s, token); 
    275 */                                               
    276                                                 char *s = (char *)malloc(sizeof(char)*(strlen(token)+1)); 
    277                                                 memcpy(s, token, strlen(token)); 
    278                                                 s[strlen(token)] = '\0'; 
    279                                                 actualNode->addField(oldtoken, s); 
    280 //                                              delete [] s; 
    281                                         } 
    282                                 } 
    283                                 if (!realfield) 
    284                                 { 
    285                                         if ((tmptyp == IV_TOKEN_REAL) || (tmptyp == IV_TOKEN_INT)) 
    286                                         {        
    287                                                 cnt = 0; blockcnt = 0; 
    288                                                 char *stopstring;                                                
    289                                                 rblock[0] = strtod(token, &stopstring); 
    290                                                 cnt++; 
    291                                                 strcpy(fieldtoken, oldtoken); 
    292                                                 fieldNode = actualNode; 
    293                                             if (tmptyp == IV_TOKEN_REAL) fieldtyp = IV_REAL; 
    294                                                 if (tmptyp == IV_TOKEN_INT)     fieldtyp = IV_INT; 
    295                                                 realfield = true; 
    296                                         } 
    297                                 } 
    298                                 textfield = !textfield; 
    299                         } 
    300                         else  
    301                         { 
    302                                 if (realfield)   
    303                                 { 
    304                                         if ((tmptyp == IV_TOKEN_REAL) || (tmptyp == IV_TOKEN_INT)) 
    305                                         {                
    306                                                 char *stopstring; 
    307                                                 if (cnt >= BLOCKSIZE)  
    308                                                 { 
    309                                                         if (blockcnt == 0) rvalues = (Ogre::Real *)malloc((BLOCKSIZE)*sizeof(Ogre::Real)); 
    310                                                         else rvalues = (Ogre::Real *)realloc(rvalues, (BLOCKSIZE*(blockcnt+1))*sizeof(Ogre::Real)); 
    311                                                         memcpy((void *)&rvalues[BLOCKSIZE*blockcnt], rblock, BLOCKSIZE*sizeof(Ogre::Real)); 
    312                                                         cnt = 0; 
    313                                                         blockcnt++; 
    314                                                          
    315                                                 } 
    316                                                 rblock[cnt] = strtod(token, &stopstring); 
    317                                                 cnt++; 
    318                                             if (tmptyp == IV_TOKEN_REAL) fieldtyp = IV_REAL; 
    319                                         } 
    320                                         else 
    321                                         { 
    322                                                 if (blockcnt == 0) rvalues = (Ogre::Real *)malloc((cnt)*sizeof(Ogre::Real)); 
    323                                                 else rvalues = (Ogre::Real *)realloc(rvalues, (BLOCKSIZE*(blockcnt) + cnt)*sizeof(Ogre::Real));                                          
    324                                                 memcpy((void *)&rvalues[BLOCKSIZE*blockcnt], rblock, cnt*sizeof(Ogre::Real)); 
    325                                                 fieldNode->addField(fieldtoken, rvalues, BLOCKSIZE*blockcnt+cnt, fieldtyp); 
    326                                                 realfield = false; 
    327 //                                              free(rvalues); 
    328                                         } 
    329                                 } 
    330                                  
    331                                 textfield = false; 
    332                         } 
    333                 } 
    334  
    335  
    336                 strcpy(oldtoken, token); 
    337                 oldtmptyp = tmptyp; 
    338         } 
    339         message = ""; ; message = message + fileName + " loaded."; 
    340         if (IVLog != NULL) IVLog->logMessage(message); 
    341         fclose(infile); 
    342  
     42 
     43                triangles.push_back(tri); 
     44        } 
     45         
    34346        return true; 
    34447} 
    34548 
    346 void IVReader::print() 
    347 { 
    348         if (root != NULL) root->print(); 
    349 } 
    350  
    351 bool IVReader::checkHeader(const char *string) 
    352 { 
    353         for (int i=0; i < validIVHeaderCnt; i++) 
    354                 if (strcmp(validIVHeader[i], string) == 0) return true; 
    355         return false; 
    356 } 
    357 bool IVReader::isSpace(char c) 
    358 { 
    359         if ((c==' ') || (c=='\t')) return true; 
    360         return false; 
    361 } 
    362 bool IVReader::isNewline(char c) 
    363 { 
    364         if (c=='\n') return true; 
    365         return false; 
    366 } 
    367 bool IVReader::isDigit(char c) 
    368 { 
    369         if ((c>=48) && (c<=57)) return true; 
    370         return false; 
    371 } 
    372 bool IVReader::isHexDigit(char c) 
    373 { 
    374         if ( ((c>=48) && (c<=57)) || ((c>=65) && (c<=70)) || ((c>=97) && (c<=102)) ) return true; 
    375         return false; 
    376 } 
    377  
    378  
    379 bool IVReader::getNextElement(char *token, IVTokenType *type) 
    380 { 
    381         if (eof) return false; 
    382         bool quoted = false; 
    383         while (isSpace(buf[bufOffset])) bufOffset++; 
    384         int i=0; 
    385         while ((!isSpace(buf[bufOffset])) || (quoted)) 
    386         { 
    387                 if (!quoted) 
    388                 { 
    389                         if (isNewline(buf[bufOffset]) || (buf[bufOffset] == COMMENTCHAR)) 
    390                         { 
    391                                 token[i] = '\0';  
    392                                 classify(token, type); 
    393                                 bufOffset = 0; 
    394                                 if (fgets(buf, BUFFERSIZE, infile) == NULL)  
    395                                 {                        
    396                                         eof = true; 
    397                                 } 
    398                                 if (i==0) return getNextElement(token, type); 
    399                                 return true; 
    400                         } 
    401                         if ((buf[bufOffset] == ',') || (buf[bufOffset] == ']')) 
    402                         { 
    403                                 token[i] = '\0'; 
    404                                 bufOffset++; 
    405                                 classify(token, type); 
    406                                 return true; 
    407                         } 
    408                  
    409                          
    410  
    411                 } else if (isNewline(buf[bufOffset])) { eof = true;     } 
    412  
    413                  
    414                 token[i] = buf[bufOffset];  
    415                 i++; 
    416                 if (buf[bufOffset] == '"')  
    417                 { 
    418                         quoted = !quoted; i--; 
    419                 } 
    420                 bufOffset++; 
    421  
    422                  
    423         } 
    424         token[i] = '\0'; 
    425         classify(token, type); 
    426         return true; 
    427 } 
    428  
    429 void IVReader::classify(char *token, IVTokenType *type) 
    430 { 
    431         bool isInt = true, isReal = true; 
    432         if (!isDigit(token[0]) && (token[0] != '-') && (token[0] != '+'))  
    433         { 
    434                 isInt = false;  
    435                 if (token[0] != '.') isReal = false;  
    436         } 
    437         int i = 1; 
    438         while ((token[i] != '\0') && isReal) 
    439         { 
    440                 if (isInt && (i!=2) && !isHexDigit(token[i]))  
    441                 { 
    442                         isInt = false; 
    443                 } 
    444                 if (isInt && (i==2) && !isHexDigit(token[i]) && (token[i] != 'x') && (token[i] != 'X')) isInt = false; 
    445                 if (isReal && (!isDigit(token[i])) && (token[i] != '.') && (token[i] != 'e') && (token[i] != 'E') && (token[i] != 'd') && (token[i] != 'D') && (token[i] != '-') && (token[i] != '+')) isReal = false; 
    446                 i++; 
    447         } 
    448         if (isInt) *type = IV_TOKEN_INT;  
    449         else if (isReal) *type = IV_TOKEN_REAL; 
    450         else *type = IV_TOKEN_STRING; 
    451  
    452         if (strcmp(token, "DEF") == 0) *type = IV_TOKEN_DEF; 
    453         if (strcmp(token, "USE") == 0) *type = IV_TOKEN_USE; 
    454  
    455         if (token[1] == '\0') 
    456         { 
    457                 if (token[0] == '{') *type = IV_TOKEN_BRACEOPEN; 
    458                 if (token[0] == '}') *type = IV_TOKEN_BRACECLOSE; 
    459                 if (token[0] == '[') *type = IV_TOKEN_BRACKETOPEN; 
    460                 if (token[0] == ']') *type = IV_TOKEN_BRACKETCLOSE; 
    461                 if (token[0] == '(') *type = IV_TOKEN_PARENTHESISOPEN; 
    462                 if (token[0] == ')') *type = IV_TOKEN_PARENTHESISCLOSE; 
    463         } 
    464         if (token[0] == '\0') 
    465         { 
    466                 *type = IV_TOKEN_INVALID; 
    467         } 
    468  
    469 } 
    470  
    471 /* 
    472 IVNode *IVReader::getNode(const char* name) 
    473 { 
    474         return root->getNodeRecursive(name); 
    475 } 
    476 */ 
    477 void IVReader::addMeshToList(std::string name, IVManualMeshLoader *loader) 
    478 {        
    479         if (meshList == NULL)  
    480         { 
    481                 meshList = new IVMeshListNode(name, loader); 
    482         } 
    483         else 
    484         { 
    485                 meshList->attachNewNode(name, loader); 
    486         } 
    487 } 
    488  
    489 void IVReader::addDefToList(std::string name, IVNode *node) 
    490 {        
    491         if (defList == NULL)  
    492         { 
    493                 defList = new IVDefListNode(name, node); 
    494         } 
    495         else 
    496         { 
    497                 defList->attachNewNode(name, node); 
    498         } 
    499 } 
    500  
    501 Ogre::Entity *IVReader::createEntity(Ogre::SceneManager* sceneMgr, std::string name, IVMeshData *mData, Ogre::Vector3 *translation) 
     49 
     50const std::vector<Ogre::Entity *> &ObjReader::GetObjects() const 
     51{ 
     52        return mObjects; 
     53} 
     54 
     55 
     56#if TODO 
     57 
     58Ogre::Entity *IVReader::createEntity(Ogre::SceneManager* sceneMgr, std::string name, ObjMeshData *mData, Ogre::Vector3 *translation) 
    50259{ 
    50360        using namespace Ogre; 
     
    51067        { 
    51168 
    512                 IVMeshData *data = mData->expand(); 
    513  
    514                 IVManualMeshLoader *loader      = new IVManualMeshLoader(data); 
     69                ObjMeshData *data = mData->expand(); 
     70 
     71                ObjManualMeshLoader *loader     = new ObjManualMeshLoader(data); 
    51572 
    51673                if (translation != NULL) *translation = data->boundingBox->getCenter(); 
     
    544101 
    545102 
    546  
    547 void IVReader::buildTree(Ogre::SceneManager* sceneMgr,  Ogre::SceneNode *sceneNodeRoot) 
     103void IVReader::buildTree(Ogre::SceneManager* sceneMgr, Ogre::SceneNode *sceneNodeRoot) 
    548104{ 
    549105        using namespace Ogre; 
     
    575131void IVReader::buildTree(Ogre::SceneManager* sceneMgr,   
    576132                                                 Ogre::SceneNode *sceneNodeRoot,  
    577                                                  IVNode *IVReaderoot, IVMeshData *mData,  
     133                                                 ObjNode *IVReaderoot, ObjMeshData *mData,  
    578134                                                 Ogre::Material *material) 
    579135{ 
     
    585141        if (mData == NULL) 
    586142        { 
    587                 mData = new IVMeshData(); 
     143                mData = new ObjMeshData(); 
    588144                meshDataCreated = true; 
    589145        } 
    590146 
    591         IVType t; int i; 
    592          
    593         IVNode *help = IVReaderoot->getNextChildNode(true); 
     147        ObjType t; int i; 
     148         
     149        ObjNode *help = IVReaderoot->getNextChildNode(true); 
    594150        while (help != NULL) 
    595151        {        
     
    743299                        if (t != IV_INT) mData->texCoordIndices = NULL; 
    744300 
    745                         IVNode *n = help->getNextChildNode(true); 
     301                        ObjNode *n = help->getNextChildNode(true); 
    746302                        while ((n != NULL) && (strcmp(help->getName(), "VertexProperty") == 0)) 
    747303                        { 
     
    775331        if (meshDataCreated) if (mData != NULL) delete mData; 
    776332} 
    777  
     333#endif 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/src/ObjReader.vcproj

    r2110 r2111  
    7272                        <Tool 
    7373                                Name="VCCLCompilerTool" 
    74                                 AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;..\include" 
     74                                AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;..\include;..\..\..\Preprocessing\src" 
    7575                                PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OBJREADER_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE" 
    7676                                RuntimeLibrary="2" 
     
    8383                        <Tool 
    8484                                Name="VCLinkerTool" 
    85                                 AdditionalDependencies="OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib" 
    86                                 OutputFile="$(OutDir)/ObjReader.dll" 
    87                                 LinkIncremental="1" 
    88                                 AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;..\..\GtpVisibility\lib\$(ConfigurationName)&quot;;&quot;..\..\lib\$(ConfigurationName)&quot;;&quot;..\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)&quot;" 
     85                                AdditionalDependencies="OgreMain.lib zdll.lib zziplib.lib Preprocessor.lib xerces-c_2.lib" 
     86                                OutputFile="$(OutDir)/ObjReader.dll" 
     87                                LinkIncremental="1" 
     88                                AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)&quot;;&quot;..\..\lib\$(ConfigurationName)&quot;;&quot;..\lib\$(ConfigurationName)&quot;;&quot;..\..\..\Preprocessing\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib" 
    8989                                GenerateDebugInformation="FALSE" 
    9090                                SubSystem="2" 
     
    339339                        UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> 
    340340                        <File 
    341                                 RelativePath="..\src\ObjManualMeshLoader.cpp"> 
    342                         </File> 
    343                         <File 
    344                                 RelativePath="..\src\ObjMeshData.cpp"> 
    345                         </File> 
    346                         <File 
    347                                 RelativePath="..\src\ObjNode.cpp"> 
    348                         </File> 
    349                         <File 
    350341                                RelativePath="..\src\ObjReader.cpp"> 
    351342                        </File> 
     
    356347                        UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> 
    357348                        <File 
    358                                 RelativePath="..\include\ObjManualMeshLoader.h"> 
    359                         </File> 
    360                         <File 
    361                                 RelativePath="..\include\ObjMeshData.h"> 
    362                         </File> 
    363                         <File 
    364                                 RelativePath="..\include\ObjNode.h"> 
    365                         </File> 
    366                         <File 
    367349                                RelativePath="..\include\ObjReader.h"> 
    368350                        </File> 
  • GTP/trunk/Lib/Vis/Preprocessing/manual/integration.aux

    r2104 r2111  
    2020\@writefile{toc}{\contentsline {subsection}{\numberline {5.1}Intersectable}{4}} 
    2121\newlabel{sec:intersectable}{{5.1}{4}} 
    22 \@writefile{toc}{\contentsline {subsection}{\numberline {5.2}Bounding Box Converter}{4}} 
    23 \newlabel{sec:Converter}{{5.2}{4}} 
     22\@writefile{toc}{\contentsline {subsection}{\numberline {5.2}Bounding Box Converter}{5}} 
     23\newlabel{sec:Converter}{{5.2}{5}} 
    2424\@writefile{toc}{\contentsline {section}{\numberline {6}View Cells Usage}{7}} 
    2525\newlabel{sec:usage}{{6}{7}} 
    2626\@setckpt{integration}{ 
    27 \setcounter{page}{8} 
     27\setcounter{page}{9} 
    2828\setcounter{equation}{0} 
    2929\setcounter{enumi}{0} 
  • GTP/trunk/Lib/Vis/Preprocessing/manual/integration.tex

    r2104 r2111  
    148148\label{sec:Loading} 
    149149 
    150 A view cells manager is returned from the loading call. It will be used to access and 
    151 manage the view cells from now on. For example, it can be applied to locate the current view cell. 
    152 For loading, the user has to provide the filename of the visibility solution, an ObjectContainer  
     150The loading function returns a view cells. 
     151 
     152\begin{verbatim} 
     153static ViewCellsManager *LoadViewCells(const string &filename,  
     154                                                                                   ObjectContainer *objects,  
     155                                                                                   bool finalizeViewCells = false, 
     156                                                                                   BoundingBoxConverter *bconverter = NULL); 
     157\end{verbatim} 
     158 
     159The user has to provide the filename of the visibility solution, an ObjectContainer  
    153160containing all the static entities of the scene, and a bounding box converter.  
     161From now on, the view cells manager is used to access and 
     162manage the view cells. For example, it can be applied to locate the current view cell. 
    154163After this step the view cells should be loaded and accessable in the engine. 
    155164 
     
    170179 
    171180\begin{verbatim} 
    172  
    173181// a vector of engine entities 
    174182typedef vector<Entity *> EntityContainer; 
     
    201209This is maybe the most tricky part of the integration. The bounding box converter 
    202210is necessary because we have to associate the objects of the visibility solution with 
    203 the objects from the engine without having unique ids. 
    204  
    205 We give an example for a Bounding Box Converter  
    206 for Ogre. It is templated in order to works with any Ogre SceneManager. 
     211the objects from the engine without having unique ids. This is the interface 
     212of the {\em BoundingBoxConverter }. 
     213 
     214\begin{verbatim} 
     215/** This class assigns unique indices to objects by 
     216    comparing bounding boxes. 
     217*/ 
     218class BoundingBoxConverter 
     219{ 
     220public: 
     221        /** Takes a vector of indexed bounding boxes and  
     222            identify objects with a similar bounding box 
     223      It will then assign the bounding box id to the objects. 
     224      The objects are returned in the object container. 
     225                 
     226      @returns true if conversion was successful 
     227  */ 
     228  virtual bool IdentifyObjects( 
     229                 const IndexedBoundingBoxContainer &iboxes, 
     230                 ObjectContainer &objects) const 
     231  { 
     232    // default: do nothing as we assume that a unique id is  
     233    // already assigned to the objects. 
     234    return true; 
     235  } 
     236}; 
     237\end{verbatim} 
     238 
     239We give an example of implementation of a Bounding Box Converter  
     240for Ogre3D rendering engine. It is templated in order to works with any Ogre SceneManager. 
    207241Again, the implementation of this interface must be adapted for the requirements  
    208242of the particular engine.  
    209243 
    210244\begin{verbatim} 
    211  
    212 /**     Class which converts preprocessor entites to Ogre3D entities 
     245/**     This class converts preprocessor entites to Ogre3D entities 
    213246*/ 
    214247template<typename T> PlatFormBoundingBoxConverter:  
     
    216249{ 
    217250public: 
     251  /** This constructor takes a scene manager template as parameter. 
     252  */ 
    218253  PlatFormBoundingBoxConverter(T *sm); 
    219254         
    220   /** Takes a vector of indexed bounding boxes and uses it to  
    221       identify objects with a similar bounding box 
    222       and assigns them the proper index (id). 
    223       The objects are returned in the object container. 
    224                  
    225       @returns true if conversion was successful 
    226   */ 
    227255  bool IdentifyObjects(const GtpVisibilityPreprocessor:: 
    228256         IndexedBoundingBoxContainer &iboxes, 
    229                GtpVisibilityPreprocessor::ObjectContainer &objects) const; 
     257         GtpVisibilityPreprocessor::ObjectContainer &objects) const; 
    230258 
    231259protected: 
     
    241269typedef PlatFormBoundingBoxConverter<OctreeSceneManager>  
    242270          OctreeBoundingBoxConverter; 
    243  
    244271\end{verbatim} 
    245272 
    246273This class is inherited from {\em BoundingBoxConverter}. 
    247274{\em BoundingBoxConverters} has only one virtual function {\em IdentifyObjects} that must 
    248 be implemented. Additionally we  
    249 use a helper function {\em FindIntersectingObjects} that is responsible for locating the  
    250 corresponding objects in the scene. Let's now have a look at the  
    251 implementation of {\em IdentifyObjects} for Ogre3D. 
     275be implemented. Additionally we use a helper function {\em FindIntersectingObjects} that  
     276is responsible for locating the corresponding objects in the scene. Let's now have a look  
     277at the implementation of {\em IdentifyObjects} for Ogre3D. 
    252278 
    253279\begin{verbatim} 
     
    280306 
    281307The function just loops over the bounding boxes of the PVS entries and finds the entities that 
    282 are intersected by the bouding boxes. Let's have a look now at the function {\em FindIntersectingObjects}, which 
    283 is searching the intersections for each individual box. 
    284  
     308are intersected by the bouding boxes. Let's have a look now at the function  
     309{\em FindIntersectingObjects}, which is searching the intersections for each individual box. 
    285310 
    286311\begin{verbatim} 
     
    330355Note that the implementation of this function is maybe the one that differs the most 
    331356for another engine, as it is highly depending on the particular engine design.  
    332 For the Ogre3D implementation, we use a two stage approach. First we find the intersecting scene nodes. 
    333 We apply a search function that is optimized for this engine.  
    334 In the Ogre3D case, this is the function {\em findNodesIn}. 
     357For the Ogre3D implementation, we use a two stage approach. First we find the  
     358intersecting scene nodes. We apply a search function that is optimized for this engine.  
     359In case of Ogre3D, this is the function {\em findNodesIn}. 
    335360The engine is responsible to provide a function for fast geometric search in the scene, 
    336361in order to quickly find the objects intersecting the bounding box of a PVS entry.  
     
    342367\label{sec:usage} 
    343368 
    344 By now the view cells should be accessible within the target engine. This happens through 
    345 the view cells manager. In order to query the current view cell, use the following code. 
     369By now the view cells should be accessible within the target engine. The  
     370view cells manager provides the necessary functionality to handle the view cells.  
     371In order to query the current view cell, use the following function of the  
     372view cells manager. 
     373 
     374\begin{verbatim} 
     375ViewCell *GetViewCell(const Vector3 &point, const bool active = false) const; 
     376\end{verbatim} 
     377 
     378In your engine, the function will called like this. 
    346379 
    347380\begin{verbatim} 
    348381ViewCell *currentViewCell = viewCellsManager->GetViewCell(viewPoint); 
    349  
    350 \end{verbatim} 
    351  
    352 where {\em viewPoint} contains the current location of the player. It must be of type 
     382\end{verbatim} 
     383 
     384{\em viewPoint} contains the current location of the player. It must be of type 
    353385{\em GtpVisibilityPreprocessor::Vector3}. In order to traverse the PVS of this view cell, we  
    354386apply a PVS iterator, like in the following example. 
     
    377409  }      
    378410} 
    379  
    380 \end{verbatim} 
    381  
     411\end{verbatim} 
     412 
  • GTP/trunk/Lib/Vis/Preprocessing/manual/manual.ilg

    r2068 r2111  
    1 This is D:\texmf\MiKTeX\bin\makeindex.exe, version 2.14 [02-Oct-2002] (with Thai support). 
    2 Scanning input file D:\svn\gametools\GTP\trunk\Lib\Vis\Preprocessing\manual\manual.idx...done (0 entries accepted, 0 rejected). 
    3 Nothing written in D:\svn\gametools\GTP\trunk\Lib\Vis\Preprocessing\manual\manual.ind. 
    4 Transcript written in D:\svn\gametools\GTP\trunk\Lib\Vis\Preprocessing\manual\manual.ilg. 
     1This is C:\texmf\MiKTeX\bin\makeindex.exe, version 2.14 [02-Oct-2002] (with Thai support). 
     2Scanning input file E:\svn\gametools\GTP\trunk\Lib\Vis\Preprocessing\manual\manual.idx...done (0 entries accepted, 0 rejected). 
     3Nothing written in E:\svn\gametools\GTP\trunk\Lib\Vis\Preprocessing\manual\manual.ind. 
     4Transcript written in E:\svn\gametools\GTP\trunk\Lib\Vis\Preprocessing\manual\manual.ilg. 
  • GTP/trunk/Lib/Vis/Preprocessing/manual/manual.log

    r2104 r2111  
    1 This is pdfeTeX, Version 3.141592-1.21a-2.2 (MiKTeX 2.4) (preloaded format=latex 2005.8.25)  8 FEB 2007 14:02 
     1This is pdfeTeX, Version 3.141592-1.21a-2.2 (MiKTeX 2.4) (preloaded format=latex 2007.1.5)  9 FEB 2007 14:21 
    22entering extended mode 
    3 **D:/svn/gametools/GTP/trunk/Lib/Vis/Preprocessing/manual/manual.tex 
    4 (D:/svn/gametools/GTP/trunk/Lib/Vis/Preprocessing/manual/manual.tex 
     3**E:/svn/gametools/GTP/trunk/Lib/Vis/Preprocessing/manual/manual.tex 
     4(E:/svn/gametools/GTP/trunk/Lib/Vis/Preprocessing/manual/manual.tex 
    55LaTeX2e <2003/12/01> 
    6 Babel <v3.8g> and hyphenation patterns for english, dumylang, nohyphenation, ge 
    7 rman, ngerman, french, loaded. 
    8 (D:\texmf\tex\latex\base\article.cls 
     6Babel <v3.8a> and hyphenation patterns for english, french, german, ngerman, dumylang, nohyphenation, loaded. 
     7(C:\texmf\tex\latex\base\article.cls 
    98Document Class: article 2004/02/16 v1.4f Standard LaTeX document class 
    10 (D:\texmf\tex\latex\base\size10.clo 
     9(C:\texmf\tex\latex\base\size10.clo 
    1110File: size10.clo 2004/02/16 v1.4f Standard LaTeX file (size option) 
    1211) 
     
    2221\belowcaptionskip=\skip42 
    2322\bibindent=\dimen102 
    24 ) (D:\texmf\tex\latex\psnfss\times.sty 
    25 Package: times 2005/04/12 PSNFSS-v9.2a (SPQR)  
    26 ) 
    27 (D:\texmf\tex\latex\ltxmisc\a4wide.sty 
     23) (C:\texmf\tex\latex\psnfss\times.sty 
     24Package: times 2004/09/15 PSNFSS-v9.2 (SPQR)  
     25) (C:\texmf\tex\latex\ltxmisc\a4wide.sty 
    2826Package: a4wide 1994/08/30 
    29  (D:\texmf\tex\latex\ntgclass\a4.sty 
     27 
     28(C:\texmf\tex\latex\ntgclass\a4.sty 
    3029Package: a4 2004/04/15 v1.2g A4 based page layout 
    31 )) 
    32 (D:\texmf\tex\latex\float\float.sty 
     30)) (C:\texmf\tex\latex\float\float.sty 
    3331Package: float 2001/11/08 v1.3d Float enhancements (AL) 
    3432\c@float@type=\count87 
     
    4745\symmathboldr=\mathgroup6 
    4846LaTeX Font Info:    Redeclaring math symbol \beta on input line 74. 
    49  (D:\texmf\tex\latex\thumbpdf\thumbpdf.sty 
    50 Package: thumbpdf 2005/07/06 v3.8 Inclusion of thumbnails (HO) 
     47 (C:\texmf\tex\latex\thumbpdf\thumbpdf.sty 
     48Package: thumbpdf 2004/11/19 v3.7 Inclusion of thumbnails (HO) 
    5149 
    5250 
    5351Package thumbpdf Warning: Thumbnail data file `manual.tpt' not found. 
    5452 
    55 ) (D:\texmf\tex\latex\base\alltt.sty 
     53) (C:\texmf\tex\latex\base\alltt.sty 
    5654Package: alltt 1997/06/16 v2.0g defines alltt environment 
    57 ) (D:\texmf\tex\latex\tools\hhline.sty 
     55) (C:\texmf\tex\latex\tools\hhline.sty 
    5856Package: hhline 1994/05/23 v2.03 Table rule package (DPC) 
    59 ) 
    60 (multirow.sty 
     57) (multirow.sty 
    6158\bigstrutjot=\dimen103 
    62 ) (D:\texmf\tex\latex\ltxmisc\url.sty 
     59) 
     60(C:\texmf\tex\latex\ltxmisc\url.sty 
    6361\Urlmuskip=\muskip10 
    64 Package: url 2005/06/27  ver 3.2  Verb mode for urls, etc. 
     62Package: url 2004/03/15  ver 3.1  Verb mode for urls, etc. 
    6563) (rotating.sty 
    6664Package: rotating 1997/09/26, v2.13 Rotation package 
    67  
    68 (D:\texmf\tex\latex\graphics\graphicx.sty 
     65 (C:\texmf\tex\latex\graphics\graphicx.sty 
    6966Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR) 
    7067 
    71 (D:\texmf\tex\latex\graphics\keyval.sty 
     68(C:\texmf\tex\latex\graphics\keyval.sty 
    7269Package: keyval 1999/03/16 v1.13 key=value parser (DPC) 
    7370\KV@toks@=\toks16 
    74 ) 
    75 (D:\texmf\tex\latex\graphics\graphics.sty 
     71) (C:\texmf\tex\latex\graphics\graphics.sty 
    7672Package: graphics 2001/07/07 v1.0n Standard LaTeX Graphics (DPC,SPQR) 
    77  (D:\texmf\tex\latex\graphics\trig.sty 
     73 (C:\texmf\tex\latex\graphics\trig.sty 
    7874Package: trig 1999/03/16 v1.09 sin cos tan (DPC) 
    79 ) (D:\texmf\tex\latex\00miktex\graphics.cfg 
     75) (C:\texmf\tex\latex\00miktex\graphics.cfg 
    8076File: graphics.cfg 2003/03/12 v1.1 MiKTeX 'graphics' configuration 
    8177) 
    8278Package graphics Info: Driver file: pdftex.def on input line 80. 
    83  
    84 (D:\texmf\tex\latex\graphics\pdftex.def 
    85 File: pdftex.def 2005/06/20 v0.03m graphics/color for pdftex 
     79 (C:\texmf\tex\latex\graphics\pdftex.def 
     80File: pdftex.def 2002/06/19 v0.03k graphics/color for pdftex 
    8681\Gread@gobject=\count88 
    8782)) 
    8883\Gin@req@height=\dimen104 
    8984\Gin@req@width=\dimen105 
    90 ) (D:\texmf\tex\latex\base\ifthen.sty 
     85) 
     86(C:\texmf\tex\latex\base\ifthen.sty 
    9187Package: ifthen 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC) 
    9288) 
     
    115111LaTeX Font Info:    ... okay on input line 135. 
    116112LaTeX Font Info:    Try loading font information for OT1+ptm on input line 135. 
    117  
    118  (D:\texmf\tex\latex\psnfss\ot1ptm.fd 
     113 (C:\texmf\tex\latex\psnfss\ot1ptm.fd 
    119114File: ot1ptm.fd 2001/06/04 font definitions for OT1/ptm. 
    120 ) 
    121 (D:\texmf\tex\context\base\supp-pdf.tex (D:\texmf\tex\context\base\supp-mis.tex 
     115) (C:\texmf\tex\context\base\supp-pdf.tex 
     116(C:\texmf\tex\context\base\supp-mis.tex 
    122117loading : Context Support Macros / Miscellaneous (2004.10.26) 
    123118\protectiondepth=\count90 
     
    158153LaTeX Font Info:    External font `cmex10' loaded for size 
    159154(Font)              <6> on input line 164. 
    160 LaTeX Font Info:    Try loading font information for OML+cmbrm on input line 16 
    161 4. 
    162  (D:\texmf\tex\latex\cmbright\omlcmbrm.fd 
    163 File: omlcmbrm.fd 2005/04/13 v8.1 (WaS) 
     155LaTeX Font Info:    Try loading font information for OML+cmbrm on input line 164. 
     156 (C:\texmf\tex\latex\cmbright\omlcmbrm.fd 
     157File: omlcmbrm.fd 1999/05/12 v7.3 (WaS) 
    164158) 
    165159LaTeX Font Info:    Font shape `OT1/ptm/bx/n' in size <14.4> not available 
     
    172166 [1 
    173167 
    174 {psfonts.map}] 
    175 (integration.tex 
     168{psfonts.map}] (integration.tex 
    176169LaTeX Font Info:    Try loading font information for OT1+pcr on input line 27. 
    177  (D:\texmf\tex\latex\psnfss\ot1pcr.fd 
     170 
     171(C:\texmf\tex\latex\psnfss\ot1pcr.fd 
    178172File: ot1pcr.fd 2001/06/04 font definitions for OT1/pcr. 
    179173) 
     
    181175(Font)              Font shape `OT1/ptm/b/n' tried instead on input line 62. 
    182176LaTeX Font Info:    Try loading font information for OMS+ptm on input line 68. 
    183  
    184 (D:\texmf\tex\latex\psnfss\omsptm.fd 
     177 (C:\texmf\tex\latex\psnfss\omsptm.fd 
    185178File: omsptm.fd  
    186179) 
     
    190183 
    191184] [3] 
    192 Overfull \hbox (1.41376pt too wide) in paragraph at lines 195--195 
    193 []                                \OT1/pcr/m/n/10 IntersectableWrapper<EntityCo 
    194 ntainer *>[]  
    195  [] 
    196  
    197  
    198 Overfull \hbox (19.41376pt too wide) in paragraph at lines 195--195 
    199 []   \OT1/pcr/m/n/10 EngineIntersectable(EntityContainer *item): GtpVisibilityP 
    200 reprocessor::[]  
    201  [] 
    202  
    203 [4] 
    204 Overfull \hbox (31.41376pt too wide) in paragraph at lines 279--279 
    205 []       \OT1/pcr/m/n/10 const GtpVisibilityPreprocessor::IndexedBoundingBoxCon 
    206 tainer &iboxes,[]  
    207  [] 
    208  
    209 [5] 
    210 Overfull \hbox (1.41376pt too wide) in paragraph at lines 279--279 
    211 []    \OT1/pcr/m/n/10 EngineIntersectable *entry = new EngineIntersectable(entr 
    212 yObjects);[]  
    213  [] 
    214  
    215  
    216 Overfull \hbox (1.41376pt too wide) in paragraph at lines 328--328 
    217 []  \OT1/pcr/m/n/10 for (sit = sceneNodeList.begin(); sit != sceneNodeList.end( 
    218 ); ++ sit)[]  
    219  [] 
    220  
    221  
    222 Overfull \hbox (7.41376pt too wide) in paragraph at lines 328--328 
    223 []      \OT1/pcr/m/n/10 // test for intersection (note: function provided of pr 
    224 eprocessor)[]  
    225  [] 
    226  
    227 [6]) [7] (manual.aux (integration.aux)) )  
     185Overfull \hbox (1.41376pt too wide) in paragraph at lines 203--203 
     186[]                                \OT1/pcr/m/n/10 IntersectableWrapper<EntityContainer *>[]  
     187 [] 
     188 
     189 
     190Overfull \hbox (19.41376pt too wide) in paragraph at lines 203--203 
     191[]   \OT1/pcr/m/n/10 EngineIntersectable(EntityContainer *item): GtpVisibilityPreprocessor::[]  
     192 [] 
     193 
     194[4] [5] 
     195Overfull \hbox (31.41376pt too wide) in paragraph at lines 305--305 
     196[]       \OT1/pcr/m/n/10 const GtpVisibilityPreprocessor::IndexedBoundingBoxContainer &iboxes,[]  
     197 [] 
     198 
     199 
     200Overfull \hbox (1.41376pt too wide) in paragraph at lines 305--305 
     201[]    \OT1/pcr/m/n/10 EngineIntersectable *entry = new EngineIntersectable(entryObjects);[]  
     202 [] 
     203 
     204 
     205Overfull \hbox (1.41376pt too wide) in paragraph at lines 353--353 
     206[]  \OT1/pcr/m/n/10 for (sit = sceneNodeList.begin(); sit != sceneNodeList.end(); ++ sit)[]  
     207 [] 
     208 
     209[6] 
     210Overfull \hbox (7.41376pt too wide) in paragraph at lines 353--353 
     211[]      \OT1/pcr/m/n/10 // test for intersection (note: function provided of preprocessor)[]  
     212 [] 
     213 
     214 
     215Overfull \hbox (37.41376pt too wide) in paragraph at lines 376--376 
     216[]\OT1/pcr/m/n/10 ViewCell *GetViewCell(const Vector3 &point, const bool active = false) const;[]  
     217 [] 
     218 
     219 
     220Overfull \hbox (12.43904pt too wide) in paragraph at lines 384--389 
     221[]\OT1/ptm/m/it/10 viewPoint \OT1/ptm/m/n/10 con-tains the cur-rent lo-ca-tion of the player. It must be of type \OT1/pt 
     222m/m/it/10 Gt-pVis-i-bil-i-tyPre-proces-sor::Vector3\OT1/ptm/m/n/10 . 
     223 [] 
     224 
     225[7]) [8] (manual.aux (integration.aux)) 
     226 
     227LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right. 
     228 
     229 )  
    228230Here is how much of TeX's memory you used: 
    229  1532 strings out of 95515 
    230  16755 string characters out of 1189489 
    231  64951 words of memory out of 1065662 
    232  4500 multiletter control sequences out of 60000 
    233  21808 words of font info for 49 fonts, out of 1000000 for 2000 
    234  14 hyphenation exceptions out of 4999 
    235  32i,7n,21p,279b,239s stack positions out of 5000i,500n,10000p,200000b,32768s 
     231 1532 strings out of 95512 
     232 16885 string characters out of 1189449 
     233 64934 words of memory out of 1065638 
     234 4503 multiletter control sequences out of 60000 
     235 21808 words of font info for 49 fonts, out of 500000 for 1000 
     236 14 hyphenation exceptions out of 607 
     237 32i,7n,21p,279b,241s stack positions out of 1500i,500n,5000p,200000b,32768s 
    236238PDF statistics: 
    237  38 PDF objects out of 300000 
     239 41 PDF objects out of 300000 
    238240 0 named destinations out of 300000 
    239241 1 words of extra memory for PDF output out of 65536 
    240 <D:\texmf\fonts\type1\bluesky\cm\cmsy1 
    241 0.pfb>{8r.enc}<D:\texmf\fonts\type1\urw\urwstd\ucrr8a.pfb><D:\texmf\fonts\type1 
    242 \urw\urwstd\utmri8a.pfb><D:\texmf\fonts\type1\urw\urwstd\utmb8a.pfb><D:\texmf\f 
    243 onts\type1\urw\urwstd\utmr8a.pfb> 
    244 Output written on manual.pdf (7 pages, 82926 bytes). 
     242<C:\texmf\fonts\type1\bluesky\cm\cmsy10.pfb>{8r.enc}<C:\texmf\fonts\type1\urw\urwstd\ucrr8a.pfb><C:\texmf\fonts\type1\ 
     243urw\urwstd\utmri8a.pfb><C:\texmf\fonts\type1\urw\urwstd\utmb8a.pfb><C:\texmf\fonts\type1\urw\urwstd\utmr8a.pfb> 
     244Output written on manual.pdf (8 pages, 84658 bytes). 
  • GTP/trunk/Lib/Vis/Preprocessing/manual/manual.toc

    r2104 r2111  
    99\contentsline {section}{\numberline {5}Example Implementation}{4} 
    1010\contentsline {subsection}{\numberline {5.1}Intersectable}{4} 
    11 \contentsline {subsection}{\numberline {5.2}Bounding Box Converter}{4} 
     11\contentsline {subsection}{\numberline {5.2}Bounding Box Converter}{5} 
    1212\contentsline {section}{\numberline {6}View Cells Usage}{7} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/BoundingBoxConverter.h

    r2066 r2111  
    1616}; 
    1717 
    18 /** Class used to assign unique indices to objects using a  
    19         comparison of bounding boxes. 
     18/** This class assigns unique indices to objects by 
     19    comparing bounding boxes. 
    2020*/ 
    2121class BoundingBoxConverter 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r2076 r2111  
    265265 
    266266 
    267 bool Preprocessor::LoadBinaryObj(const string filename, 
     267bool Preprocessor::LoadBinaryObj(const string &filename, 
    268268                                                                 SceneGraphNode *root, 
    269269                                                                 vector<FaceParentInfo> *parents) 
     
    277277        cout << "binary obj dump available, loading " << filename.c_str() << endl; 
    278278         
    279         // table for vertices 
    280         VertexContainer vertices;  
    281          
    282         if (parents) 
    283                 cout << "using face parents" << endl; 
    284         else 
    285                 cout << "not using face parents" << endl; 
    286  
    287279        // read in triangle size 
    288280        int numTriangles; 
     
    309301                root->mGeometry.push_back(obj); 
    310302                 
    311                 i ++; 
    312          
    313                 if (i % 500000 == 499999) 
     303                if ((i ++) % 500000 == 499999) 
    314304                         cout<<"\r"<<i<<"/"<<numTriangles<<"\r"; 
    315305        } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h

    r2105 r2111  
    260260protected: 
    261261 
    262         bool LoadBinaryObj(const string filename, 
     262        bool LoadBinaryObj(const string &filename, 
    263263                                           SceneGraphNode *root, 
    264264                                           vector<FaceParentInfo> *parents); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h

    r2105 r2111  
    286286        virtual void GetPrVS(const Vector3 &viewPoint, PrVs &prvs, const float filterWidth); 
    287287   
    288         /** Get a viewcell containing the specified point  
     288        /** Get a viewcell containing the specified view point. 
    289289                @param active if the active or elementary view cell should be returned. 
    290290        */ 
Note: See TracChangeset for help on using the changeset viewer.