Changeset 1263


Ignore:
Timestamp:
08/23/06 09:30:35 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h

    r1201 r1263  
    388388{ 
    389389        friend class ViewCellsManager; 
    390  
     390        friend class ViewCellsParseHandlers; 
    391391 
    392392public: 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r1262 r1263  
    749749 
    750750 
    751         // the type of hierarchy: this must be known before to build  
    752         // the view cells manager 
    753         stream << "<ViewSpaceHierarchyType name=\"vspBspTree\" />" << endl; 
     751        // the type of hierarchy: this must be known before to build the view cells manager 
     752        //stream << "<ViewSpaceHierarchyType name=\"vspBspTree\" />" << endl; 
    754753 
    755754        //-- export the view cells and the pvs 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp

    r1262 r1263  
    3333#include "VspTree.h" 
    3434#include "KdTree.h" 
    35  
     35#include "BvHierarchy.h" 
    3636 
    3737 
     
    8484  , mBspTree(NULL) 
    8585  , mViewCellsTree(NULL) 
    86   , mCurrentTask(PARSE_OPTIONS) 
     86  , mCurrentState(PARSE_OPTIONS) 
    8787  , mCurrentViewCell(NULL) 
    8888  , mCurrentBspNode(NULL) 
     
    118118 
    119119        // inside the view cell description 
    120         if (mCurrentTask == PARSE_VIEWCELLS) 
     120        if (mCurrentState == PARSE_VIEWCELLS) 
    121121        { 
    122122                if (element == "Interior") 
     
    173173 
    174174        // not parsing view cells anymore 
    175         mCurrentTask = PARSE_OPTIONS; 
     175        mCurrentState = PARSE_OPTIONS; 
    176176} 
    177177 
     
    206206                         
    207207                        // the view cells manager is created here 
    208                         CreateViewCellsManager(ptr); 
     208                        //CreateViewCellsManager(ptr); 
    209209                } 
    210210        } 
     
    331331        { 
    332332                cout << "parsing view cells" << endl; 
    333                 mCurrentTask = PARSE_VIEWCELLS; 
     333                mCurrentState = PARSE_VIEWCELLS; 
    334334        } 
    335335 
     
    346346                //StartViewSpaceHierarchy(attributes); 
    347347                cout << "parsing view space partition" << endl; 
    348                 mCurrentTask = PARSE_VSP; 
     348                mCurrentState = PARSE_VSP; 
    349349        } 
    350350 
     
    354354                //StartObjectSpaceHierarchy(attributes); 
    355355                cout << "parsing object space partition" << endl; 
    356                 mCurrentTask = PARSE_OSP; 
     356                mCurrentState = PARSE_OSP; 
    357357        } 
    358358         
     
    372372 
    373373        // parse view space partition 
    374         switch (mCurrentTask) 
     374        switch (mCurrentState) 
    375375        { 
    376376        case PARSE_VSP: 
     
    713713 
    714714 
    715 void ViewCellsParseHandlers::CreateViewCellsManager(const char *name) 
    716 { 
    717         if (strcmp(name, "bspTree") == 0) 
     715void ViewCellsParseHandlers::CreateViewCellsManager(/*const char *name*/) 
     716{ 
     717        /*if (strcmp(name, "bsp") == 0) 
    718718        { 
    719719                Debug << "view cell type: Bsp" << endl; 
     
    723723 
    724724                mViewCellsManager = new BspViewCellsManager(mBspTree); 
    725         } 
    726         else if (strcmp(name, "vspBspTree") == 0) //  
     725        }*/ 
     726        if (mViewSpaceHierarchyType == BSP) //  
    727727        { 
    728728                Debug << "view cell type: VspBsp" << endl; 
     
    732732 
    733733                mVspBspTree->mBox = mViewSpaceBox; 
    734         } 
    735         else if (strcmp(name, "vspOspTree") == 0) 
    736         { 
    737                 Debug << "view cell type: VspOsp" << endl; 
     734                mVspBspTree->mRoot = mBspRoot; 
     735        } 
     736        else if (mViewSpaceHierarchyType == VSP)  
     737        { 
     738                Debug << "view cell type: Vsp" << endl; 
    738739 
    739740                mVspTree = new VspTree(); 
    740                 mOspTree = new OspTree(); 
     741 
     742                if (mObjectSpaceHierarchyType == OSP)  
     743                        mOspTree = new OspTree(); 
     744                else 
     745                        mBvHierarchy = new BvHierarchy(); 
    741746 
    742747                // hack 
     
    747752 
    748753        mViewCellsTree = mViewCellsManager->GetViewCellsTree(); 
     754        mViewCellsTree->mRoot = mViewCellRoot; 
     755 
    749756        mViewCellsManager->SetViewSpaceBox(mViewSpaceBox); 
    750757} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h

    r1233 r1263  
    2424class OspTree; 
    2525class VspNode; 
    26  
     26class BvHierarchy; 
    2727 
    2828class ViewCellsParseHandlers: public HandlerBase 
     
    6969  void resetDocument(); 
    7070 
    71   void CreateViewCellsManager(const char *name); 
     71  void CreateViewCellsManager(/*const char *name*/); 
    7272 
    7373 
     
    7575  VspTree *mVspTree; 
    7676  OspTree *mOspTree; 
     77  BvHierarchy *mBvHierarchy; 
    7778 
    7879  BspTree *mBspTree; 
     
    8384  ViewCell *mCurrentViewCell; 
    8485  KdNode *mCurrentKdNode; 
     86   
     87  BspNode *mBspRoot; 
     88  VspNode *mVspRoot; 
     89  ViewCell *mViewCellRoot; 
    8590 
    8691  ViewCellContainer mViewCells; 
     
    9196  IndexedBoundingBoxContainer mIBoundingBoxes; 
    9297  
    93   /// current task for the parser 
    94   int mCurrentTask; 
    95  
     98  /// current state of the parser 
     99  int mCurrentState; 
     100   
    96101  enum {PARSE_OPTIONS, PARSE_VIEWCELLS, PARSE_VSP, PARSE_OSP}; 
     102 
     103  /// view space / object space hierarchy types 
     104  enum {BSP, VSP, OSP, BVH}; 
     105 
     106  int mViewSpaceHierarchyType; 
     107  int mObjectSpaceHierarchyType; 
    97108 
    98109  // Handlers for X3D 
Note: See TracChangeset for help on using the changeset viewer.