Ignore:
Timestamp:
08/08/07 15:50:33 (17 years ago)
Author:
mattausch
Message:

fixed obj loading error

File:
1 edited

Legend:

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

    r2353 r2539  
    147147 
    148148 
    149 /** 
    150     VspNode abstract class serving for interior and leaf node implementation 
     149/** VspNode abstract class serving for interior and leaf node implementation 
    151150*/ 
    152151class VspNode 
    153152{ 
     153        friend class VspTree; 
     154 
    154155public: 
    155156         
     
    172173        */ 
    173174        virtual bool IsRoot() const; 
    174          
    175175        /** Returns parent node. 
    176176        */ 
    177177        VspInterior *GetParent(); 
    178          
    179178        /** Sets parent node. 
    180179        */ 
    181180        void SetParent(VspInterior *parent); 
    182  
    183181        /** Returns true if this node is a sibling of node n. 
    184182        */ 
    185183        bool IsSibling(VspNode *n) const; 
    186          
    187184        /** returns depth of the node. 
    188185        */ 
    189186        int GetDepth() const; 
    190          
    191         /** returns true if the whole subtree is valid 
     187        /** Returns true if this node (which represents the whole subtree) is valid 
    192188        */ 
    193189        bool TreeValid() const; 
    194  
     190        /** Sets this node to valid. 
     191        */ 
    195192        void SetTreeValid(const bool v); 
    196          
    197193        /** Cost of mergin this node. 
    198194        */ 
    199195        float GetMergeCost() {return (float)-mTimeStamp; } 
    200196 
     197        /// timestamp of this node 
    201198        int mTimeStamp; 
    202199 
     
    212209        int mMailbox; 
    213210 
    214         //int mPvsEntriesIncr; 
    215         //float mMemoryIncr; 
    216         //float mRenderCostDecr; 
    217  
     211         
    218212protected: 
    219213 
    220214        /// if this sub tree is a completely valid view space region 
    221215        bool mTreeValid; 
    222          
    223216        /// parent of this node 
    224217        VspInterior *mParent; 
     
    230223class VspInterior: public VspNode  
    231224{ 
     225        friend class VspTree; 
     226 
    232227public: 
    233228 
     
    237232 
    238233        ~VspInterior(); 
    239          
    240234        /** @return false since it is an interior node  
    241235        */ 
    242   bool IsLeaf() const { 
    243         return false;  
    244   } 
    245  
     236        bool IsLeaf() const { return false; } 
    246237 
    247238        int Type() const; 
    248  
    249   VspNode *GetBack() { 
    250         return mBack; 
    251   } 
    252  
    253  
    254   VspNode *GetFront() { 
    255         return mFront; 
    256   } 
    257  
     239        /** Returns back child. 
     240        */ 
     241        VspNode *GetBack() { return mBack; } 
     242        /** Returns front child. 
     243        */ 
     244        VspNode *GetFront() { return mFront; } 
    258245        /** Returns split plane. 
    259246        */ 
    260   AxisAlignedPlane GetPlane() const { 
    261         return mPlane; 
    262   } 
    263    
    264  
     247        AxisAlignedPlane GetPlane() const { return mPlane; } 
    265248        /** Returns position of split plane. 
    266249        */ 
    267   float GetPosition() const { 
    268         return mPlane.mPosition; 
    269   } 
    270  
     250        float GetPosition() const { return mPlane.mPosition; } 
    271251        /** Returns split axis. 
    272252        */ 
    273   int GetAxis() const { 
    274         return mPlane.mAxis; 
    275   } 
    276  
     253        int GetAxis() const { return mPlane.mAxis; } 
    277254        /** Replace front or back child with new child. 
    278255        */ 
    279256        void ReplaceChildLink(VspNode *oldChild, VspNode *newChild); 
    280  
    281257        /** Replace front and back child. 
    282258        */ 
    283259        void SetupChildLinks(VspNode *front, VspNode *back); 
     260        /** Returns boundiŽng box of this node. 
     261        */ 
     262        AxisAlignedBox3 GetBoundingBox() const; 
     263        /** Sets boundiong box of this node. 
     264        */ 
     265        void SetBoundingBox(const AxisAlignedBox3 &box); 
     266        /** Computes intersection of this plane with the ray segment. 
     267        */ 
     268        int ComputeRayIntersection(const RayInfo &rayData, float &t) const 
     269        { 
     270                return rayData.ComputeRayIntersection(mPlane.mAxis, mPlane.mPosition, t); 
     271        } 
    284272 
    285273        friend std::ostream &operator<<(std::ostream &s, const VspInterior &A) 
     
    288276        } 
    289277 
    290         AxisAlignedBox3 GetBoundingBox() const; 
    291         void SetBoundingBox(const AxisAlignedBox3 &box); 
    292  
    293         /** Computes intersection of this plane with the ray segment. 
    294         */ 
    295         int ComputeRayIntersection(const RayInfo &rayData, float &t) const 
    296         { 
    297                 return rayData.ComputeRayIntersection(mPlane.mAxis, mPlane.mPosition, t); 
    298         } 
    299  
    300278 
    301279protected: 
     280 
    302281        /// bounding box for this interior node: should we really store this? 
    303282        AxisAlignedBox3 mBoundingBox; 
    304  
    305283        /// Splitting plane corresponding to this node 
    306284        AxisAlignedPlane mPlane; 
    307  
    308285        /// back node 
    309286        VspNode *mBack; 
     
    329306        /** @return true since it is an interior node  
    330307        */ 
    331   bool IsLeaf() const { 
    332         return true; 
    333   } 
     308        bool IsLeaf() const { return true; } 
    334309         
    335310        int Type() const; 
     
    337312        /** Returns pointer of view cell. 
    338313        */ 
    339   ViewCellLeaf *GetViewCell() const { 
    340         return mViewCell; 
    341   } 
    342  
     314        ViewCellLeaf *GetViewCell() const { return mViewCell; } 
    343315        /** Sets pointer to view cell. 
    344316        */ 
     
    383355public: 
    384356         
     357        /////////// 
     358        //-- Helper structs / classes 
     359 
    385360        /** Additional data which is passed down the BSP tree during traversal. 
    386361        */ 
    387         class VspTraversalData 
     362        struct VspTraversalData 
    388363        {   
    389364        public: 
    390365                 
    391                 /** Returns average ray contribution. 
    392                 */ 
    393                 float GetAvgRayContribution() const 
    394                 { 
    395                         return (float)mPvs / ((float)mRays->size() + Limits::Small); 
    396                 } 
    397  
    398  
    399                 /** Returns average rays per object. 
    400                 */ 
    401                 float GetAvgRaysPerObject() const 
    402                 { 
    403                         return (float)mRays->size() / ((float)mPvs + Limits::Small); 
    404                 } 
    405  
    406                 VspTraversalData(): 
    407                         mNode(NULL), 
    408                         mDepth(0), 
    409                         mRays(NULL), 
    410                         mPvs(0), 
    411                         mProbability(0.0), 
    412                         mMaxCostMisses(0),  
    413                         mPriority(0), 
    414                         mCorrectedPvs(0) 
    415                 {} 
     366                VspTraversalData(); 
    416367                 
    417368                VspTraversalData(VspLeaf *node,  
     
    420371                                                 const float pvs, 
    421372                                                 const float p, 
    422                                                  const AxisAlignedBox3 &box): 
    423                         mNode(node),  
    424                         mDepth(depth),  
    425                         mRays(rays), 
    426                         mProbability(p), 
    427                         mBoundingBox(box), 
    428                         mMaxCostMisses(0), 
    429                         mPriority(0), 
    430                         mCorrectedPvs(0), 
    431                         mPvs(pvs), 
    432                         mRenderCost(0), 
    433                         mCorrectedRenderCost(0) 
    434                 {} 
    435  
    436                 VspTraversalData(const int depth,  
    437                                                  RayInfoContainer *rays, 
    438                                                  const AxisAlignedBox3 &box):  
    439                         mNode(NULL),  
    440                         mDepth(depth),  
    441                         mRays(rays), 
    442                         mProbability(0), 
    443                         mMaxCostMisses(0), 
    444                         mBoundingBox(box), 
    445                         mCorrectedPvs(0), 
    446                         mPvs(0) , 
    447                         mRenderCost(0), 
    448                         mCorrectedRenderCost(0)  
    449                 {} 
    450  
     373                                                 const AxisAlignedBox3 &box); 
     374 
     375         
    451376                /** Returns cost of the traversal data. 
    452377                */ 
    453                 float GetCost() const 
    454                 { 
    455                         return mPriority; 
    456                 } 
    457  
    458                 /// deletes contents and sets them to NULL 
    459                 void Clear() 
    460                 { 
    461                         DEL_PTR(mRays); 
    462  
    463                         if (mNode) 
    464                         { 
    465                                 // delete old view cell 
    466                                 delete mNode->GetViewCell(); 
    467  
    468                                 delete mNode; 
    469                                 mNode = NULL; 
    470                         } 
    471                 } 
     378                inline float GetCost() const; 
     379                /** Returns average ray contribution. 
     380                */ 
     381                inline float GetAvgRayContribution() const; 
     382                /** Returns average rays per object. 
     383                */ 
     384                inline float GetAvgRaysPerObject() const; 
     385                /** deletes contents and sets them to NULL. 
     386                */ 
     387                void Clear(); 
     388 
     389 
     390                ////////////////////// 
    472391 
    473392                /// the current node 
     
    500419    }; 
    501420 
     421        /** Helper struct for data that comes with a split of a node. 
     422        */ 
    502423        struct SplitData  
    503424        { 
     
    511432                mFrontTriangles(0), 
    512433                mBackTriangles(0), 
    513                 mTotalTriangles(0) {} 
    514  
     434                mTotalTriangles(0)  
     435                {} 
     436 
     437                ////////////// 
    515438 
    516439                float mFrontRenderCost; 
     
    580503                {} 
    581504 
    582                 float GetPriority() const 
    583                 { 
    584                         return mPriority; 
    585                 } 
     505                float GetPriority() const {     return mPriority; } 
     506 
    586507 
    587508                //////////////////// 
    588509 
    589510                static VspTree* sVspTree; 
    590  
    591511                /// the current split plane 
    592512                AxisAlignedPlane mSplitPlane; 
     
    623543        }; 
    624544 
     545 
     546        ////////////////////// 
     547 
     548 
    625549        /** Default constructor creating an empty tree. 
    626550        */  
     
    629553        */ 
    630554        ~VspTree(); 
    631  
    632555        /** Returns BSP Tree statistics. 
    633556        */ 
    634557        const VspTreeStatistics &GetStatistics() const;  
    635    
    636558        /** Returns bounding box of the specified node. 
    637559        */ 
    638560        AxisAlignedBox3 GetBoundingBox(VspNode *node) const; 
    639  
    640561        /** Returns list of BSP leaves with pvs smaller than 
    641562                a certain threshold. 
     
    646567                                           const bool onlyUnmailed = false, 
    647568                                           const int maxPvs = -1) const; 
    648  
    649569        /** Returns box which bounds the whole tree. 
    650570        */ 
    651571        AxisAlignedBox3 GetBoundingBox() const; 
    652  
    653572        /** Returns root of the view space partitioning tree. 
    654573        */ 
    655574        VspNode *GetRoot() const; 
    656  
    657575        /** Collects the leaf view cells of the tree 
    658576                @param viewCells returns the view cells  
    659577        */ 
    660578        void CollectViewCells(ViewCellContainer &viewCells, bool onlyValid) const; 
    661  
    662579        /** A ray is cast possible intersecting the tree. 
    663580                @param the ray that is cast. 
     
    665582        */ 
    666583        int CastRay(Ray &ray); 
    667  
    668  
    669584        /** finds neighbouring leaves of this tree node. 
    670585        */ 
     
    672587                                          vector<VspLeaf *> &neighbors,  
    673588                                          const bool onlyUnmailed) const; 
    674  
    675589        /** Returns random leaf of BSP tree. 
    676590                @param halfspace defines the halfspace from which the leaf is taken. 
     
    682596        */ 
    683597        VspLeaf *GetRandomLeaf(const bool onlyUnmailed = false); 
    684  
    685598        /** Returns epsilon of this tree. 
    686599        */ 
    687600        float GetEpsilon() const; 
    688  
    689601        /** Casts line segment into the tree. 
    690602                @param origin the origin of the line segment 
     
    696608                                                ViewCellContainer &viewcells, 
    697609                                                const bool useMailboxing = true); 
    698  
    699                  
    700610        /** Sets pointer to view cells manager. 
    701611        */ 
    702612        void SetViewCellsManager(ViewCellsManager *vcm); 
    703  
    704613        /** Returns view cell the current point is located in. 
    705614                @param point the current view point 
     
    708617        */ 
    709618        ViewCell *GetViewCell(const Vector3 &point, const bool active = false); 
    710  
    711  
    712619        /** Returns true if this view point is in a valid view space, 
    713620                false otherwise. 
    714621        */ 
    715622        bool ViewPointValid(const Vector3 &viewPoint) const; 
    716  
    717623        /** Returns view cell corresponding to  
    718624                the invalid view space. 
    719625        */ 
    720626        VspViewCell *GetOutOfBoundsCell(); 
    721  
    722         /** Writes tree to output stream 
    723         */ 
    724         bool Export(OUT_STREAM &stream); 
    725  
    726627        /** Casts beam, i.e. a 5D frustum of rays, into tree. 
    727628                Tests conservative using the bounding box of the nodes. 
     
    729630        */ 
    730631        int CastBeam(Beam &beam); 
    731  
    732632        /** Checks if tree validity-flags are right  
    733633                with respect to view cell valitiy. 
     
    735635        */ 
    736636        void ValidateTree(); 
    737  
    738637        /** Collects rays stored in the leaves. 
    739638        */ 
    740639        void CollectRays(VssRayContainer &rays); 
    741  
    742640        /** Intersects box with the tree and returns the number of intersected boxes. 
    743641                @returns number of view cells found 
     
    745643        int ComputeBoxIntersections(const AxisAlignedBox3 &box,  
    746644                                                                ViewCellContainer &viewCells) const; 
    747  
    748645        /** Returns view cells of this ray, either taking precomputed cells 
    749646                or by recomputation. 
    750647        */ 
    751648        void GetViewCells(const VssRay &ray, ViewCellContainer &viewCells); 
    752  
    753649        /** Returns view cells tree. 
    754650        */ 
    755651        ViewCellsTree *GetViewCellsTree() const { return mViewCellsTree; } 
    756  
    757652        /** Sets the view cells tree. 
    758653        */ 
    759654        void SetViewCellsTree(ViewCellsTree *vt) { mViewCellsTree = vt; } 
    760  
     655        /** Writes vsp tree to output stream 
     656        */ 
     657        bool Export(OUT_STREAM &stream); 
     658        /** Writes vsp tree to binary output stream. 
     659        */ 
     660        bool ExportBinary(OUT_STREAM &stream); 
     661        /** Imports tree from binary format. 
     662        */ 
     663        bool ImportBinary(IN_STREAM &stream, ObjectContainer &pvsObjects); 
     664 
     665 
     666        //////////// 
    761667 
    762668        PerfTimer mSortTimer; 
     
    808714                                                         float &pFront, 
    809715                                                         float &pBack) const; 
    810  
     716        /** If != NULL, sets the bounding box to the forced  bounding box. 
     717                Else computes the bounding box of the view space using the 
     718                hit points gathered from the ray-object intersections. 
     719        */ 
    811720        void ComputeBoundingBox(const VssRayContainer &rays, 
    812721                                                        AxisAlignedBox3 *forcedBoundingBox); 
    813  
    814722        /** Evaluates candidate for splitting. 
    815723        */ 
    816         void EvalSubdivisionCandidate(VspSubdivisionCandidate &splitData,  
     724        void EvalSubdivisionCandidate(VspSubdivisionCandidate &candidate,  
    817725                                                                  bool computeSplitPlane = true); 
    818  
    819726        /** Evaluates render cost decrease of next split. 
    820727        */ 
    821         float EvalRenderCostDecrease(VspSubdivisionCandidate &splitData,  
     728        float EvalRenderCostDecrease(VspSubdivisionCandidate &candidate,  
    822729                                                                 float &normalizedOldRenderCost, 
    823730                                                                 const SplitData &data) const; 
    824  
    825731        /** Collects view cells in the subtree under root. 
    826732        */ 
     
    829735                                                  ViewCellContainer &viewCells, 
    830736                                                  bool onlyUnmailed = false) const; 
    831  
    832737        /** Returns view cell corresponding to  
    833738                the invalid view space. If it does not exist, it is created. 
    834739        */ 
    835740        VspViewCell *GetOrCreateOutOfBoundsCell(); 
    836  
    837741        /** Collapses the tree with respect to the view cell partition, 
    838742                i.e. leaves having the same view cell are collapsed. 
     
    843747        */ 
    844748        VspNode *CollapseTree(VspNode *node, int &collapsed); 
    845  
    846749        /** Helper function revalidating the view cell leaf list after merge. 
    847750        */ 
    848751        void RepairViewCellsLeafLists(); 
    849  
    850752        /** Evaluates tree stats in the BSP tree leafs. 
    851753        */ 
     
    861763                                           SubdivisionCandidate *splitCandidate, 
    862764                                           const bool globalCriteriaMet); 
    863  
    864765        /** Adds stats to subdivision log file. 
    865766        */ 
     
    868769                                                         const float totalRenderCost, 
    869770                                                         const float avgRenderCost); 
    870          
    871771        /** Subdivides leaf. 
    872                          
    873772                @param tData data object holding, e.g., a pointer to the leaf 
    874773                @param frontData returns the data (e.g., pointer to the leaf) in front of the split plane 
    875774                @param backData returns the data (e.g., pointer to the leaf) in the back of the split plane 
    876                  
    877                 @param rays the polygons to be filtered 
    878                 @param frontRays returns the polygons in front of the split plane 
    879775         
    880776                @returns the root of the subdivision 
     
    891787                                                   float &pFront, 
    892788                                                   float &pBack); 
    893  
    894789        /** Sorts split candidates along the specified axis. 
    895790                The split candidates are generated on possible visibility 
     
    905800                                                                   float minBand,  
    906801                                                                   float maxBand); 
    907  
    908802        /** Evaluate render cost of this pvs. 
    909803        */ 
     
    912806        int EvalPvsEntriesIncr(VspSubdivisionCandidate &splitCandidate, 
    913807                                                   const SplitData &sData) const; 
    914  
    915808        /** Returns number of effective entries in the pvs. 
    916809        */ 
     
    918811 
    919812        int EvalPvsEntriesContribution(const VssRay &ray, const bool isTermination) const; 
    920  
    921813        /** Computes best cost for axis aligned planes. 
    922814        */ 
     
    928820 
    929821 
    930         ////////////////////////////////////////// 
    931         // Helper function for computing heuristics 
     822        /////////////////////// 
     823        //-- Helper function for computing heuristics 
    932824 
    933825        /** Evaluates the contribution to left and right pvs at a visibility event ve. 
     
    937829        */ 
    938830        inline void EvalHeuristics(const SortableEntry &ve, float &pvsLeft, float &pvsRight) const; 
    939  
    940831        /** Evaluates contribution of min event to pvs 
    941832        */ 
    942833        inline float EvalMinEventContribution(const VssRay &ray, const bool isTermination) const; 
    943  
    944834        /** Evaluates contribution of max event to pvs 
    945835        */ 
    946836        inline float EvalMaxEventContribution(const VssRay &ray, const bool isTermination) const; 
    947  
    948837        /** Evaluates contribution of kd leaf when encountering a min event 
    949838        */ 
    950839        inline float EvalMinEventContribution(KdLeaf *leaf) const; 
    951  
    952840        /**  Evaluates contribution of kd leaf when encountering a max event 
    953841        */ 
    954842        inline float EvalMaxEventContribution(KdLeaf *leaf) const; 
    955  
    956843        /** Prepares objects for the heuristics. 
    957844                @returns pvs size as seen by the rays. 
    958845        */ 
    959846        float PrepareHeuristics(const RayInfoContainer &rays); 
    960          
    961847        /** Prepare a single ray for heuristics. 
    962848        */ 
    963849        float PrepareHeuristics(const VssRay &ray, const bool isTermination); 
    964  
    965850        /** Prepare a single kd leaf for heuristics. 
    966851        */ 
    967852        float PrepareHeuristics(KdLeaf *leaf); 
    968  
     853        /** Evaluates minimal and maximal depth in the tree. 
     854        */ 
    969855        void EvalMinMaxDepth(int &minDepth, int &maxDepth); 
    970  
    971  
    972  
    973         ///////////////////////////////////////////////////////////// 
    974  
     856        /** Writes the node to disk 
     857                @note: should be implemented as visitor. 
     858        */ 
     859        void ExportNode(VspNode *node, OUT_STREAM &stream); 
     860         
     861 
     862        //////////////// 
     863 
     864        void ExportBinInterior(OUT_STREAM &stream, VspInterior *interior); 
     865        void ExportBinLeaf(OUT_STREAM &stream, VspLeaf *leaf); 
     866 
     867        VspInterior *ImportBinInterior(IN_STREAM  &stream, VspInterior *parent); 
     868        VspLeaf *ImportBinLeaf(IN_STREAM &stream, VspInterior *parent, const ObjectContainer &pvsObjects); 
     869 
     870        VspNode *ImportNextNode(IN_STREAM &stream,  
     871                                                        VspInterior *parent, 
     872                                                        const ObjectContainer &pvsObjects); 
     873 
     874 
     875        ////////////////////////////////////////////////// 
    975876 
    976877        /** Subdivides the rays into front and back rays according to the split plane. 
    977                  
    978878                @param plane the split plane 
    979879                @param rays contains the rays to be split. The rays are  
     
    988888                              RayInfoContainer &frontRays,  
    989889                                  RayInfoContainer &backRays) const; 
    990  
    991  
     890        /** Add contributions of this ray to fron, back, and overall pvs of the parent. 
     891        */ 
    992892        inline void UpdatePvsEntriesContribution(const VssRay &ray, 
    993893                                                                                         const bool isTermination, 
     
    996896                                                                                         float &backPvs, 
    997897                                                                                         float &totalPvs) const; 
    998  
    999898        /** Classfifies the object with respect to the  
    1000899                pvs of the front and back leaf and updates pvs size 
     
    1013912                                                                                 float &backPvs, 
    1014913                                                                                 float &totalPvs) const; 
    1015  
    1016914        /** Evaluates the contribution for objects. 
    1017915        */ 
     
    1021919                                                                                 float &backPvs,  
    1022920                                                                                 float &totalPvs) const; 
    1023  
    1024921        /** Evaluates the contribution for bounding volume leaves. 
    1025922        */ 
     
    1030927                                                                                 float &totalPvs, 
    1031928                                                                                 const bool countEntries) const; 
    1032  
     929        /** Updates contribution to pvs caused by this bvh leaf. 
     930        */ 
    1033931        inline void UpdateContributionsToPvs(BvhLeaf *leaf, 
    1034932                                                                                 const int cf, 
    1035933                                                                                 SplitData &sdata) const; 
    1036  
    1037934        /** Evaluates the contribution for kd leaves. 
    1038935        */ 
     
    1042939                                                                                 float &backPvs, 
    1043940                                                                                 float &totalPvs) const; 
    1044  
    1045941        /** Returns true if tree can be terminated. 
    1046942        */ 
    1047943        inline bool LocalTerminationCriteriaMet(const VspTraversalData &data) const; 
    1048  
    1049944        /** Returns true if global tree can be terminated. 
    1050945        */ 
    1051946        bool GlobalTerminationCriteriaMet(const VspTraversalData &data) const; 
    1052  
    1053947        /** Adds ray sample contributions to the PVS. 
    1054948                @param sampleContributions the number contributions of the samples 
     
    1060954                                                 float &sampleContributions, 
    1061955                                                 int &contributingSamples); 
    1062  
    1063956        /** Propagates valid flag up the tree. 
    1064957        */ 
    1065958        void PropagateUpValidity(VspNode *node); 
    1066  
    1067         /** Writes the node to disk 
    1068                 @note: should be implemented as visitor. 
    1069         */ 
    1070         void ExportNode(VspNode *node, OUT_STREAM &stream); 
    1071  
    1072959        /** Returns estimated memory usage of tree. 
    1073960        */ 
    1074961        float GetMemUsage() const; 
    1075  
    1076962        /** Updates view cell pvs of objects. 
    1077963        */ 
     
    1079965                                                                ViewCell *front,  
    1080966                                                                ViewCell *back) const; 
    1081  
     967        /** Creates a new view cell from the traversal data. 
     968        */ 
    1082969        void CreateViewCell(VspTraversalData &tData,  
    1083970                                                const bool updatePvs, 
    1084971                                                const float renderCost, 
    1085972                                                const int pvs); 
    1086  
    1087973        /** Collect split candidates which are affected by the last split 
    1088974                and must be reevaluated. 
     
    1091977                                                                vector<SubdivisionCandidate *> &dirtyList, 
    1092978                                                                const bool onlyUnmailed); 
    1093  
    1094         void CollectDirtyCandidate(const VssRay &ray,  
     979        /** Adds the split candidate associated with this ray to the dirty list. 
     980        */ 
     981        void AddCandidateToDirtyList(const VssRay &ray,  
    1095982                                                           const bool isTermination, 
    1096983                                                           vector<SubdivisionCandidate *> &dirtyList, 
    1097984                                                           const bool onlyUnmailed) const; 
    1098  
    1099985        /** Rays will be clipped to the bounding box. 
    1100986        */ 
    1101987        void PreprocessRays(const VssRayContainer &sampleRays, RayInfoContainer &rays); 
    1102  
    1103988        /** Evaluate subdivision statistics. 
    1104989        */ 
    1105990        void EvalSubdivisionStats(const SubdivisionCandidate &tData); 
    1106  
     991        /** Prepares the construction of the vsp tree. 
     992        */ 
    1107993        void PrepareConstruction(SplitQueue &tQueue, 
    1108994                                                         const VssRayContainer &sampleRays, 
    1109995                                                         RayInfoContainer &rays); 
    1110  
    1111996        /** Evaluates pvs contribution of this ray. 
    1112997        */ 
    1113998        float EvalContributionToPvs(const VssRay &ray, const bool isTermination) const; 
    1114  
    1115999        /** Evaluates pvs contribution of a kd node. 
    11161000        */ 
    11171001        float EvalContributionToPvs(KdLeaf *leaf) const; 
    1118  
    11191002        /** Creates new root of hierarchy and computes bounding box. 
    11201003                Has to be called before the preparation of the subdivision. 
     
    11971080                int mStackPtr; 
    11981081                int mDepth; 
    1199  
    12001082        }; 
    12011083 
     
    12071089        /// pointer to the hierarchy of view cells 
    12081090        ViewCellsTree *mViewCellsTree; 
    1209  
     1091        /// Pointer to the hierarchy manager which is responsible for both  
     1092        /// view and object space 
    12101093        HierarchyManager *mHierarchyManager; 
     1094        /// Pointer to the bv hierarchy 
    12111095        BvHierarchy *mBvHierarchy; 
    1212          
     1096        /// Pointer to the view cells manager 
    12131097        ViewCellsManager *mViewCellsManager; 
    1214          
     1098        /// Buffer for subdivision candidates used for split heuristics evaluation 
    12151099        vector<SortableEntry> *mLocalSubdivisionCandidates; 
    1216  
    12171100        /// Pointer to the root of the tree 
    12181101        VspNode *mRoot; 
    1219                  
     1102        /// The statistics 
    12201103        VspTreeStatistics mVspStats; 
    1221          
    12221104        /// View cell corresponding to the space outside the valid view space 
    12231105        VspViewCell *mOutOfBoundsCell; 
    1224  
    12251106        /// box around the whole view domain 
    12261107        AxisAlignedBox3 mBoundingBox; 
     
    12811162        // if rays should be stored in leaves 
    12821163        bool mStoreRays; 
    1283  
    12841164        /// epsilon for geometric comparisons 
    12851165        float mEpsilon; 
    1286  
    12871166        /// subdivision stats output file 
    12881167        std::ofstream mSubdivisionStats; 
    12891168        /// keeps track of cost during subdivision 
    12901169        float mTotalCost; 
     1170        /// keeps track of #pvs entries during subdivison 
    12911171        int mPvsEntries; 
    12921172        /// keeps track of overall pvs size during subdivision 
     
    12971177        /// weight between render cost decrease and node render cost 
    12981178        float mRenderCostDecreaseWeight; 
    1299  
     1179        /// maximal #of rays used for heuristics evalution 
    13001180        int mMaxTests; 
    1301  
    13021181        /// constant value for driving the heuristics 
    13031182        float mMemoryConst; 
Note: See TracChangeset for help on using the changeset viewer.