Ignore:
Timestamp:
05/22/06 18:32:12 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp

    r971 r975  
    804804bool 
    805805Environment::ReadEnvFile(const char *envFilename) 
    806 {Debug << "here222 " << envFilename << endl; 
     806{ 
    807807  char buff[MaxStringLength], name[MaxStringLength]; 
    808808  char *s, *t; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GzBinFileInputStream.cpp

    r971 r975  
    6666 
    6767#include "GzBinFileInputStream.h" 
     68#include "common.h" 
    6869 
    6970XERCES_CPP_NAMESPACE_BEGIN 
     
    7475GzBinFileInputStream::GzBinFileInputStream(const XMLCh* const fileName 
    7576                                       , MemoryManager* const manager) : 
    76  
    77     //fSource(0) ,  
    78 fMemoryManager(manager) 
     77//fSource(0) , 
     78fMemoryManager(manager), 
     79mCurrentPos(0) 
    7980{ 
    8081        // Try to open the file 
    81     //fSource = XMLPlatformUtils::openFile((unsignedfileName, manager); 
     82    //fSource = XMLPlatformUtils::openFile(fileName, manager); 
     83        // todo: delete xmlstring 
    8284        char *myFileName = XMLString::transcode(fileName); 
     85        //mStream.open(myFileName, ios::binary); 
    8386        mStream.open(myFileName); 
    8487} 
     
    8689GzBinFileInputStream::GzBinFileInputStream(const char* const fileName, 
    8790                                                                                   MemoryManager* const manager) : 
    88 fMemoryManager(manager) 
     91fMemoryManager(manager), 
     92mCurrentPos(0) 
    8993{ 
    9094    // Try to open the file 
     95        //mStream.open(fileName, ios::binary); 
    9196        mStream.open(fileName); 
    9297} 
     
    123128unsigned int GzBinFileInputStream::curPos() const 
    124129{ 
    125     return XMLPlatformUtils::curFilePos(fSource, fMemoryManager); 
     130    //return XMLPlatformUtils::curFilePos(fSource, fMemoryManager); 
     131        return mCurrentPos; 
    126132} 
    127133 
    128 unsigned int 
    129 GzBinFileInputStream::readBytes(          XMLByte* const  toFill 
    130                                 , const unsigned int    maxToRead) 
     134unsigned int GzBinFileInputStream::readBytes(XMLByte* const  toFill,  
     135                                                                                         const unsigned int maxToRead) 
    131136{ 
    132137    // 
     
    134139    //  actually read. 
    135140    // 
    136     //return XMLPlatformUtils::readFileBuffer(fSource, maxToRead, toFill, fMemoryManager); 
    137         mStream.getline((char *)toFill, maxToRead); 
    138         return mStream.gcount(); 
     141    //unsigned int result = XMLPlatformUtils::readFileBuffer(fSource, maxToRead, toFill, fMemoryManager); 
     142        mStream.read((char *)toFill, maxToRead); 
     143         
     144        unsigned int result = mStream.gcount(); 
     145        mCurrentPos = mStream.tellg(); 
     146        //GtpVisibilityPreprocessor::Debug << "here1001 " << maxToRead << " haha " << toFill << " " << result << endl; 
     147 
     148        return result; 
    139149} 
    140150 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GzBinFileInputStream.h

    r971 r975  
    6161 
    6262XERCES_CPP_NAMESPACE_BEGIN 
    63 //0699/15227486 
     63 
    6464class /*XMLUTIL_EXPORT*/ GzBinFileInputStream : public BinInputStream 
    6565{ 
     
    105105        igzstream mStream; 
    106106 
     107        unsigned int mCurrentPos; 
    107108private : 
    108109    // ----------------------------------------------------------------------- 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GzFileInputSource.cpp

    r971 r975  
    8383//  LocalFileInputSource: Constructors and Destructor 
    8484// --------------------------------------------------------------------------- 
    85 GzFileInputSource::GzFileInputSource( const XMLCh* const basePath 
    86                              , const XMLCh* const relativePath 
    87                              , MemoryManager* const manager) 
    88     : LocalFileInputSource(basePath, relativePath, manager) 
     85GzFileInputSource::GzFileInputSource(const XMLCh* const basePath,  
     86                                                                         const XMLCh* const relativePath,  
     87                                                                        MemoryManager* const manager) 
     88: LocalFileInputSource(basePath, relativePath, manager) 
    8989{ 
    9090} 
     
    9292GzFileInputSource::GzFileInputSource(const XMLCh* const filePath, 
    9393                                                                         MemoryManager* const manager) 
    94     : LocalFileInputSource(filePath, manager) 
     94: LocalFileInputSource(filePath, manager) 
    9595{ 
    9696} 
     
    108108{ 
    109109        GzBinFileInputStream* retStrm = new (getMemoryManager()) GzBinFileInputStream(getSystemId(), getMemoryManager()); 
     110 
    110111        if (!retStrm->getIsOpen()) 
    111112    { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r971 r975  
    27592759        stream.open(filename.c_str()); 
    27602760        stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"<<endl; 
    2761         stream << "<Visibility_Solution>" << endl; 
     2761        stream << "<VisibilitySolution>" << endl; 
    27622762 
    27632763        //-- the view space bounding box 
     
    27672767 
    27682768        //-- the type of the view cells hierarchy 
    2769         //stream << "<Hierarchy name=\"bspTree\" />" << endl; 
     2769         
    27702770        // NOTE: load in vsp bsp here because bsp and vsp bsp can use same tree and vsp bsp is bug free 
    2771         stream << "<Hierarchy name=\"vspBspTree\" />" << endl;  
     2771        stream << "<Hierarchy name=\"vspBspTree\" >" << endl;  
    27722772         
    27732773        //-- load the view cells itself, i.e., the ids and the pvs 
     
    27832783        stream << endl << "</Hierarchy>" << endl; 
    27842784 
    2785         stream << "</Visibility_Solution>" << endl; 
     2785        stream << "</VisibilitySolution>" << endl; 
    27862786        stream.close(); 
    27872787 
     
    47154715 
    47164716        ViewCellsManager *vm = NULL; 
    4717 Debug << "here98 " << filename << endl; 
     4717 
    47184718        if (parser.ParseFile(filename, &vm, objects, bconverter, env)) 
    47194719        { 
     
    47634763 
    47644764        stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"<<endl; 
    4765         stream << "<Visibility_Solution>" << endl; 
     4765        stream << "<VisibilitySolution>" << endl; 
    47664766 
    47674767        //-- the view space bounding box 
     
    47914791 
    47924792        //-- export the view cells and the pvs 
     4793        stream << "<HierarchyType name=\"vspBspTree\" />" << endl; 
     4794 
    47934795        const int numViewCells = mCurrentViewCellsStats.viewCells; 
    47944796 
     
    48034805         
    48044806        // the type of the view cells hierarchy 
    4805         stream << "<Hierarchy name=\"vspBspTree\" />" << endl; 
     4807        stream << "<Hierarchy>" << endl; 
    48064808        mVspBspTree->Export(stream); 
    48074809        stream << endl << "</Hierarchy>" << endl; 
    48084810 
    4809  
    4810  
    4811         stream << "</Visibility_Solution>" << endl; 
     4811        stream << "</VisibilitySolution>" << endl; 
    48124812 
    48134813 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp

    r974 r975  
    8383  , mBoundingBoxConverter(bconverter) 
    8484  , mEnvironment(env) 
    85 {Debug << "here22" << endl; 
    86         // mObjects = objects; 
     85{ 
    8786} 
    8887 
     
    117116  else 
    118117  { 
    119         if (element == "Interior") 
     118          if (element == "Interior") 
    120119                  EndBspInterior(); 
    121120  } 
     
    127126        // go one up in the tree 
    128127        if (mCurrentBspNode->GetParent()) 
    129         {       Debug << "öaaaaaaaaaaaa]"; 
     128        {       Debug << "]"; 
    130129                mCurrentBspNode = mCurrentBspNode->GetParent(); 
    131130        } 
     
    153152        // sort view cells to help associating view cells according to their id 
    154153        stable_sort(mViewCells.begin(), mViewCells.end(), vlt); 
     154        mParseViewCells = false; 
    155155} 
    156156 
     
    165165                mBoundingBoxConverter->IdentifyObjects(mIBoundingBoxes, *mObjects); 
    166166 
    167         Debug << "\nconverted bounding boxes to objects in" 
     167        Debug << "\nconverted bounding boxes to objects in " 
    168168                  << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 
    169169} 
     
    210210void ViewCellsParseHandlers::startElement(const XMLCh* const name, 
    211211                                                                                  AttributeList& attributes) 
    212 {       Debug << "here722" << endl; 
     212{ 
    213213        StrX lname(name); 
    214214        string element(lname.LocalForm()); 
    215215 
    216         // decides the used view cell hierarchy 
     216 
    217217        if (element == "ViewCells") 
    218218        { 
     
    221221        } 
    222222 
    223         if (element == "Hierarchy") 
    224         { 
    225                 Debug << "parsing spatial hierarchy" << endl; 
    226                 mParseViewCells = false; 
     223        // decides about the view cell hierarchy 
     224        if (element == "HierarchyType") 
     225        //if (element == "Hierarchy") 
     226        { 
     227                //Debug << "parsing spatial hierarchy" << endl; 
     228                //mParseViewCells = false; 
    227229                StartHierarchy(attributes); 
    228230        } 
     
    242244        } 
    243245 
    244         // use different methods for the given view cell hierarchy types 
     246         
    245247        if (!mParseViewCells) 
    246248        { 
     249                //-- use different methods for the given view cell hierarchy types 
    247250                if (mViewCellsManager) 
    248251                { 
     
    262265        else 
    263266        { 
     267                // interiors + leaves interpreted view cells else 
    264268                if (element == "Interior")  
    265269                { 
     
    620624                mViewCellsManager = new BspViewCellsManager(mBspTree, mEnvironment); 
    621625        } 
    622         else if (strcmp(name, "vspBspTree") == 0) 
    623         { 
    624                 Debug << "view cell type: VspBsp" << endl; 
    625  
    626                 mVspBspTree = new VspBspTree(); 
    627                 //mCurrentBspNode = mVspBspTree->GetRoot(); 
    628                 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree, mEnvironment); 
    629  
    630                 mVspBspTree->mBox = mViewSpaceBox; 
    631         } 
     626         
    632627        else if (strcmp(name, "vspKdTree") == 0) 
    633628        { 
     
    637632                mViewCellsManager = new VspKdViewCellsManager(mVspKdTree, mEnvironment); 
    638633        } 
    639         else 
    640         { 
    641                 cerr << "Wrong view cells type: " << name << endl; 
    642                 exit(1); 
     634        else // vspBspTree 
     635        { 
     636                Debug << "view cell type: VspBsp" << endl; 
     637 
     638                mVspBspTree = new VspBspTree(); 
     639                //mCurrentBspNode = mVspBspTree->GetRoot(); 
     640                mViewCellsManager = new VspBspViewCellsManager(mVspBspTree, mEnvironment); 
     641 
     642                mVspBspTree->mBox = mViewSpaceBox; 
    643643        } 
    644644 
     
    720720    } 
    721721   
    722   Debug << "here2" << endl; 
    723722  // 
    724723  //  Create a SAX parser object. Then, according to what we were told on 
     
    759758         
    760759        GzFileInputSource isource(myFilePath); 
    761         Debug << "here4" << endl; 
    762760        parser->parse(isource); 
    763761 
Note: See TracChangeset for help on using the changeset viewer.