Ignore:
Timestamp:
07/06/07 03:18:02 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r2353 r2530  
    197197        */ 
    198198        HierarchyManager(const int objectSpaceHierarchyType); 
    199          
    200199        /** Hack: OspTree will copy the content from this kd tree. 
    201200                Only view space hierarchy will be constructed. 
    202201        */ 
    203202        HierarchyManager(KdTree *kdTree); 
    204  
    205203        /** Deletes space partition and view space partition. 
    206204        */ 
    207205        ~HierarchyManager(); 
    208  
    209206        /** Constructs the view space and object space subdivision from a given set of rays 
    210207                and a set of objects. 
     
    233230        */ 
    234231        int GetObjectSpaceSubdivisionType() const;       
    235          
    236232        /** The type of view space space subdivison 
    237233        */ 
    238234        int GetViewSpaceSubdivisionType() const; 
    239          
    240235        /** Sets a pointer to the view cells manager. 
    241236        */               
    242237        void SetViewCellsManager(ViewCellsManager *vcm); 
    243          
    244238        /** Sets a pointer to the view cells tree. 
    245239        */ 
    246240        void SetViewCellsTree(ViewCellsTree *vcTree); 
    247  
    248241        /** Exports the object hierarchy to disc. 
    249242        */ 
    250243        void ExportObjectSpaceHierarchy(OUT_STREAM &stream); 
    251          
    252244        /** Print out statistics. 
    253245        */ 
    254246        void PrintHierarchyStatistics(std::ostream &stream) const; 
    255  
    256247        /** Returns the view space partition tree. 
    257248        */ 
    258249        VspTree *GetVspTree(); 
    259  
    260250        /** Returns object space bounding box. 
    261251        */ 
    262252        AxisAlignedBox3 GetObjectSpaceBox() const; 
    263  
    264253        /** Exports object space hierarchy for visualization. 
    265254        */ 
     
    275264   
    276265        Intersectable *GetIntersectable(Intersectable *obj, const Vector3 &point) const; 
    277  
    278266        /** Export object space partition bounding boxes. 
    279267        */ 
     
    306294                                                   const float totalPvs, 
    307295                                                   const float raysPerObjects) const; 
    308  
    309  
    310296        /** Casts line segment into the view cells tree. 
    311297                @param origin the origin of the line segment 
     
    346332 
    347333 
    348         ////////////////////////////// 
    349         // the main loop 
     334        ////////////// 
     335        // these functions implement the main loop 
    350336 
    351337        /** This is for interleaved construction / sequential construction. 
     
    355341                                                 const ObjectContainer &objects, 
    356342                                                 AxisAlignedBox3 *forcedViewSpace); 
    357          
    358343        /** This is for interleaved construction using some objects  
    359344                and some view space splits. 
     
    365350                                                const int minSteps, 
    366351                                                const int maxSteps); 
    367  
    368352        /** Default subdivision method. 
    369353        */ 
     
    371355         
    372356         
    373         //////////////////////////////////////////////// 
     357        ////////////////////////// 
    374358 
    375359        /** Evaluates the subdivision candidate and executes the split. 
     
    380364                                                                   std::vector<SubdivisionCandidate *> &dirtyList 
    381365                                                                   ); 
    382  
    383366        /** Tests if hierarchy construction is finished. 
    384367        */ 
    385368        bool FinishedConstruction() const; 
    386  
    387369        /** Returns next subdivision candidate from the split queue. 
    388370        */ 
    389371        SubdivisionCandidate *NextSubdivisionCandidate(SplitQueue &splitQueue); 
    390  
    391372        /** Repairs the dirty entries of the subdivision candidate queue. The 
    392373                list of entries is given in the dirty list. 
     
    397378                                        SplitQueue &splitQueue, 
    398379                                        const bool recomputeSplitPlaneOnRepair); 
    399  
    400380        /** Collect subdivision candidates which were affected by the splits from the 
    401381                chosenCandidates list. 
     
    403383        void CollectDirtyCandidates(const SubdivisionCandidateContainer &chosenCandidates,  
    404384                                                                SubdivisionCandidateContainer &dirtyList); 
    405  
    406385        /** Print subdivision stats for log. 
    407386        */ 
     
    420399        void CollectViewSpaceDirtyList(SubdivisionCandidate *sc, 
    421400                                                                   SubdivisionCandidateContainer &dirtyList); 
    422  
    423401        /** Collect affected object space candidates. 
    424402        */ 
    425403        void CollectObjectSpaceDirtyList(SubdivisionCandidate *sc, 
    426404                                                                         SubdivisionCandidateContainer &dirtyList); 
    427                  
    428405        /** Export object space partition tree. 
    429406        */ 
    430407        void ExportOspTree(Exporter *exporter,  
    431408                                           const ObjectContainer &objects) const; 
    432  
    433409        /** Parse the environment variables. 
    434410        */ 
     
    463439        */ 
    464440        bool ObjectSpaceSubdivisionConstructed() const; 
    465          
    466441        /** Was view space subdivision already constructed? 
    467442        */ 
    468443        bool ViewSpaceSubdivisionConstructed() const; 
    469  
    470444        /** Reset the split queue, i.e., reevaluate the split candidates. 
    471445        */ 
    472446    void ResetQueue(SplitQueue &splitQueue, const bool recomputeSplitPlane); 
    473  
    474447        /** After the suddivision has ended, do some final tasks. 
    475448        */ 
    476449        void FinishObjectSpaceSubdivision(const ObjectContainer &objects,  
    477450                                                                          const bool removeRayRefs = true) const; 
    478  
    479451        /** Returns depth of object space subdivision. 
    480452        */ 
    481453        int GetObjectSpaceSubdivisionDepth() const; 
    482  
    483454        /** Returns number of leaves in object space subdivision. 
    484455        */ 
    485456        int GetObjectSpaceSubdivisionLeaves() const; 
    486457        int GetObjectSpaceSubdivisionNodes() const; 
    487  
    488458        /** Construct object space partition interleaved with view space partition. 
    489459                Each time the best object or view space candidate is selected 
     
    493463                                                          const ObjectContainer &objects, 
    494464                                                          AxisAlignedBox3 *forcedViewSpace); 
    495  
    496465        /** Construct object space partition interleaved with view space partition. 
    497466                The method chooses a number candidates of each type for subdivision. 
     
    505474                                                                                  const ObjectContainer &objects, 
    506475                                                                                  AxisAlignedBox3 *forcedViewSpace); 
    507  
    508476        /** Use iteration to construct the object space hierarchy. 
    509477        */ 
     
    511479                                                         const ObjectContainer &objects, 
    512480                                                         AxisAlignedBox3 *forcedViewSpace); 
    513  
    514481        /** Based on a given subdivision, we try to optimize using an 
    515482                multiple iteration over view and object space. 
     
    518485                                                        const ObjectContainer &objects, 
    519486                                                        AxisAlignedBox3 *forcedViewSpace); 
    520  
    521487        /** Reset the object space subdivision.  
    522488                E.g., deletes hierarchy and resets stats. 
     
    533499 
    534500        void CreateTraversalTree(); 
     501 
    535502 
    536503        /////////////////////////// 
     
    570537protected: 
    571538 
     539        friend VspTree; 
     540        friend OspTree; 
     541        friend BvHierarchy; 
     542        friend ViewCellsParseHandlers; 
     543 
     544 
    572545        /** construction types 
    573546                sequential: construct first view space, then object space 
     
    580553        /// type of hierarchy construction 
    581554        int mConstructionType; 
    582  
    583555        /// Type of object space partition 
    584556        int mObjectSpaceSubdivisionType; 
     
    586558    int mViewSpaceSubdivisionType; 
    587559 
    588         /// the traversal queue 
     560        /// the queue maintains the split candidates during traversal 
    589561        SplitQueue mTQueue; 
    590          
    591         //////////// 
    592         //-- helper variables 
    593          
    594         // the original osp type 
    595         int mSavedObjectSpaceSubdivisionType; 
    596         // the original vsp type 
    597         int mSavedViewSpaceSubdivisionType; 
    598562         
    599563 
     
    601565        // Hierarchies 
    602566 
     567        /// the bounding volume hierarchy 
     568        BvHierarchy *mBvHierarchy; 
    603569        /// view space hierarchy 
    604570        VspTree *mVspTree; 
     
    608574        float mInitialRenderCost; 
    609575         
    610         //float mMaxAvgRayContri; 
    611         //float mMinAvgRayContri; 
    612  
    613576        float mMaxAvgRaysPerObject; 
    614577        float mMinAvgRaysPerObject; 
    615578 
    616         // quick hack: 
    617 public: 
    618         /// bounding volume hierarchy 
    619         BvHierarchy *mBvHierarchy; 
    620          
     579 
     580        /// an internal tree optimized for view cell traversal 
    621581        bool mUseTraversalTree; 
    622  
    623         float mMinRenderCost; 
    624  
    625 protected: 
    626582 
    627583 
     
    638594        float mTermMaxMemory; 
    639595 
     596        float mMinRenderCost; 
     597 
    640598 
    641599        //////////////////// 
     
    651609        int mMinDepthForViewSpaceSubdivion; 
    652610         
    653         //int mMinRenderCostDecrease; 
    654  
    655         std::ofstream mSubdivisionStats; 
    656  
    657611        /// if the queue should be repaired after a subdivision steps 
    658612        bool mRepairQueue; 
    659613 
    660614        bool mStartWithObjectSpace; 
    661         /** if multi level construction method should be used 
    662                 where we iterate over both hierarchies until we 
    663                 converge to the optimum. 
     615        /** multi level construction method  means that 
     616                we iterate over both hierarchies until we 
     617                converge to the optimum.  
    664618        */ 
    665619        bool mUseMultiLevelConstruction; 
    666  
    667620        /// number of iteration steps for multilevel approach    
    668621        int mNumMultiLevels; 
    669  
    670622        /** if split plane should be recomputed for the repair. 
    671623                Otherwise only the priority is recomputed, the 
    672                 split plane itself stays the same 
     624                split plane itself stays the same.  
    673625        */ 
    674626        bool mRecomputeSplitPlaneOnRepair; 
    675627 
    676628        /** If memory should be considered during choosing 
    677                 of the next split type during gradient method. 
     629                of the next split type during gradient method.  
    678630        */ 
    679631        bool mConsiderMemory; 
     
    684636 
    685637        int mTimeStamp; 
    686         friend VspTree; 
    687         friend OspTree; 
    688         friend BvHierarchy; 
    689638 
    690639        float mPriority; 
    691640 
    692         friend ViewCellsParseHandlers; 
    693  
     641 
     642        //////////// 
     643        //-- helper variables 
     644         
     645        // the original osp type 
     646        int mSavedObjectSpaceSubdivisionType; 
     647        // the original vsp type 
     648        int mSavedViewSpaceSubdivisionType; 
     649         
     650 
     651        /// this is just a cache used during evaluation 
    694652        ViewCellContainer mOldViewCells; 
     653 
     654        std::ofstream mSubdivisionStats; 
    695655}; 
    696656 
Note: See TracChangeset for help on using the changeset viewer.