Ignore:
Timestamp:
06/18/06 03:47:06 (18 years ago)
Author:
mattausch
Message:

worked on view-object space partition
fixed some loading bugs
fixeds some exporting bugs using line segments
enabling other methods for view space sampling in ViewCellsManager? OBJECT_DIRECTION_BASED_DISTRIBUTION)
added class interface for a sampling strategy

File:
1 edited

Legend:

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

    r1016 r1020  
    168168                VspBspTraversalData mParentData; 
    169169                // prioriry of this split 
    170                 float mRenderCost; 
    171  
    172                 VspBspSplitCandidate(): mRenderCost(0)  
     170                float mPriority; 
     171 
     172                VspBspSplitCandidate(): mPriority(0)  
    173173                {}; 
    174174 
    175175                VspBspSplitCandidate(const Plane3 &plane, const VspBspTraversalData &tData):  
    176                 mSplitPlane(plane), mParentData(tData), mRenderCost(0) 
     176                mSplitPlane(plane), mParentData(tData), mPriority(0) 
    177177                {} 
    178178 
    179179                /** Returns cost of the traversal data. 
    180180                */ 
    181                 float GetCost() const 
     181                float GetPriority() const 
    182182                { 
    183183#if 1 
    184                         return mRenderCost; 
     184                        return mPriority; 
    185185#else 
    186186                        return (float) (-mDepth); // for kd tree 
     
    190190                friend bool operator<(const VspBspSplitCandidate &a, const VspBspSplitCandidate &b) 
    191191                { 
    192                         return a.GetCost() < b.GetCost(); 
     192                        return a.GetPriority() < b.GetPriority(); 
    193193                } 
    194194    }; 
     
    211211        /** Constructs the tree from a given set of rays. 
    212212                @param sampleRays the set of sample rays the construction is based on 
    213                 @param viewCells if not NULL, new view cells are  
    214                 created in the leafs and stored in the container 
     213                @param forcedBoundingBox overwrites the view space box 
    215214        */ 
    216215        void Construct(const VssRayContainer &sampleRays, 
     
    454453                                           VspBspTraversalData &tData); 
    455454 
     455        /** Subdivides node using a best split priority queue. 
     456            @param tQueue the best split priority queue 
     457                @param splitCandidate the candidate for the next split 
     458                @returns new root of the subtree 
     459        */ 
    456460        BspNode *Subdivide(VspBspSplitQueue &tQueue, 
    457461                                           VspBspSplitCandidate &splitCandidate); 
     
    459463        /** Constructs the tree from the given traversal data. 
    460464                @param polys stores set of polygons on which subdivision may be based 
    461                 @param rays storesset of rays on which subdivision may be based 
     465                @param rays stores set of rays on which subdivision may be based 
    462466        */ 
    463467        void Construct(const PolygonContainer &polys, RayInfoContainer *rays); 
     
    496500 
    497501        /** Subdivides leaf. 
    498                 @param leaf the leaf to be subdivided 
    499                  
    500                 @param polys the polygons to be split 
    501                 @param frontPolys returns the polygons in front of the split plane 
    502                 @param backPolys returns the polygons in the back of the split plane 
     502                         
     503                @param tData data object holding, e.g., a pointer to the leaf 
     504                @param frontData returns the data (e.g.,  pointer to the leaf) in front of the split plane 
     505                @param backData returns the data (e.g.,  pointer to the leaf) in the back of the split plane 
    503506                 
    504507                @param rays the polygons to be filtered 
    505508                @param frontRays returns the polygons in front of the split plane 
    506                 @param backRays returns the polygons in the back of the split plane 
     509                @param coincident returns the polygons which are coincident to the plane and thus discarded  
     510                for traversal 
    507511 
    508512                @returns the root of the subdivision 
     
    699703 
    700704 
     705        /** Adds stats to subdivision log file. 
     706        */ 
     707        void AddSubdivisionStats(const int viewCells, 
     708                                                         const float renderCostDecr, 
     709                                                         const float splitCandidateCost, 
     710                                                         const float totalRenderCost, 
     711                                                         const float avgRenderCost); 
    701712 
    702713        /////////////////////////////////////////////////////////// 
     
    716727 
    717728        /// sorted split candidates used for sweep-heuristics 
    718         vector<SortableEntry> *mSplitCandidates; 
     729        vector<SortableEntry> *mLocalSplitCandidates; 
    719730 
    720731        /// box around the whole view domain 
     
    837848        // if rays should be stored in leaves 
    838849        bool mStoreRays; 
    839         /// render cost weight between expected value and variance 
     850        /// weight between  render cost (expected value) and variance 
    840851        float mRenderCostWeight; 
    841          
     852        /// weight between  render cost decrease and node render cost 
     853        float mRenderCostDecreaseWeight; 
    842854 
    843855        //-- subdivision statistics 
Note: See TracChangeset for help on using the changeset viewer.