Ignore:
Timestamp:
12/05/05 04:42:54 (19 years ago)
Author:
mattausch
Message:

fixed bug in VspBspTree?
view cells in VssPreprocessor?
bounding rays for vspkdtree

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h

    r444 r448  
    77#include <stack> 
    88#include "Statistics.h" 
     9#include "VssRay.h" 
     10 
    911 
    1012class ViewCell; 
     
    2729        float GetArea() const; 
    2830         
    29         /** Computes new cell based on the old cell definition and a new split plane 
    30                 @param side indicates which side of the halfspace  
    31         */ 
    32         void SplitGeometry(BspNodeGeometry &front,  
     31        /** Computes new front and back geometry based on the old cell  
     32                geometry and a new split plane 
     33        */ 
     34        void SplitGeometry(BspNodeGeometry &front, 
    3335                                           BspNodeGeometry &back, 
    34                                            const BspTree &tree, 
    35                                            const Plane3 &splitPlane) const; 
    36  
    37         Polygon3 *SplitPolygon(Polygon3 *poly, const BspTree &tree) const; 
     36                                           const Plane3 &splitPlane, 
     37                       const AxisAlignedBox3 &box, 
     38                                           const float epsilon) const; 
     39 
     40        Polygon3 *SplitPolygon(Polygon3 *poly, const float epsilon) const; 
    3841 
    3942        PolygonContainer mPolys; 
     
    270273        BspNode *GetFront(); 
    271274 
    272         Plane3 *GetPlane(); 
    273  
     275        /** Returns split plane. 
     276        */ 
     277        Plane3 GetPlane() const; 
     278 
     279        /** Replace front or back child with new child. 
     280        */ 
    274281        void ReplaceChildLink(BspNode *oldChild, BspNode *newChild); 
     282        /** Replace front and back child. 
     283        */ 
    275284        void SetupChildLinks(BspNode *b, BspNode *f); 
    276  
    277         /** Splits polygons with respect to the split plane. 
    278                 @param polys the polygons to be split. the polygons are consumed and 
    279                            distributed to the containers frontPolys, backPolys, coincident. 
    280                 @param frontPolys returns the polygons in the front of the split plane 
    281                 @param backPolys returns the polygons in the back of the split plane 
    282                 @param coincident returns the polygons coincident to the split plane 
    283  
    284                 @returns the number of splits    
    285         */ 
    286         int SplitPolygons(PolygonContainer &polys,  
    287                                           PolygonContainer &frontPolys,  
    288                                           PolygonContainer &backPolys,  
    289                                           PolygonContainer &coincident); 
    290285 
    291286        friend ostream &operator<<(ostream &s, const BspInterior &A) 
     
    298293        /// Splitting plane corresponding to this node 
    299294        Plane3 mPlane; 
     295 
    300296        /// back node 
    301297        BspNode *mBack; 
     
    328324        void SetViewCell(BspViewCell *viewCell); 
    329325 
    330         /** Adds ray sample contributions to the PVS. 
    331                 @param sampleContributions the number contributions of the samples 
    332                 @param contributingSampels the number of contributing rays 
    333                  
    334         */ 
    335         void AddToPvs(const BoundedRayContainer &rays,  
    336                                   int &sampleContributions, 
    337                                   int &contributingSamples); 
     326        VssRayContainer mVssRays; 
    338327 
    339328protected: 
     
    516505        BspViewCell *GetRootCell() const; 
    517506 
    518         /** Parses the environment and stores the global BSP tree parameters 
    519         */ 
    520         static void ParseEnvironment(); 
    521  
     507        /** Returns epsilon of this tree. 
     508        */ 
     509        float GetEpsilon() const; 
    522510 
    523511protected: 
     
    722710        bool SelectAxisAlignedPlane(Plane3 &plane, const PolygonContainer &polys) const; 
    723711 
    724         /** Bounds ray and returns minT and maxT. 
    725                 @returns true if ray hits BSP tree bounding box 
    726         */ 
    727         bool BoundRay(const Ray &ray, float &minT, float &maxT) const; 
    728  
    729712        /** Subdivides the rays into front and back rays according to the split plane. 
    730713                 
     
    768751        */ 
    769752        float AccumulatedRayLength(BoundedRayContainer &rays) const; 
     753 
     754        /** Splits polygons with respect to the split plane. 
     755                @param polys the polygons to be split. the polygons are consumed and 
     756                           distributed to the containers frontPolys, backPolys, coincident. 
     757                @param frontPolys returns the polygons in the front of the split plane 
     758                @param backPolys returns the polygons in the back of the split plane 
     759                @param coincident returns the polygons coincident to the split plane 
     760 
     761                @returns the number of splits    
     762        */ 
     763        int SplitPolygons(const Plane3 &plane, 
     764                                          PolygonContainer &polys,  
     765                                          PolygonContainer &frontPolys,  
     766                                          PolygonContainer &backPolys,  
     767                                          PolygonContainer &coincident) const; 
     768 
     769        /** Adds ray sample contributions to the PVS. 
     770                @param sampleContributions the number contributions of the samples 
     771                @param contributingSampels the number of contributing rays 
     772                 
     773        */ 
     774        void AddToPvs(BspLeaf *leaf, 
     775                                  const BoundedRayContainer &rays,  
     776                                  int &sampleContributions, 
     777                                  int &contributingSamples); 
    770778 
    771779        /// Pointer to the root of the tree. 
     
    852860        bool mPvsUseArea; 
    853861 
     862        /// epsilon where two points are still considered equal 
     863        float mEpsilon; 
     864 
    854865private: 
    855866         
Note: See TracChangeset for help on using the changeset viewer.