Ignore:
Timestamp:
12/16/05 18:52:33 (19 years ago)
Author:
mattausch
Message:

updated view cells, view cell manager. changed rendersimulator

File:
1 edited

Legend:

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

    r463 r469  
    77#include "Statistics.h" 
    88//namespace GtpVisibilityPreprocessor { 
    9    
     9 
     10struct Triangle3; 
     11 
    1012class BspInterior; 
    1113class BspPvs; 
    12 struct Triangle3; 
    1314class BspLeaf; 
    1415class VspKdTree; 
    1516class VspKdLeaf; 
    16  
     17class KdLeaf; 
    1718 
    1819/** 
     
    2829        ViewCell(Mesh *mesh); 
    2930 
    30  
     31        /** Default destructor. 
     32        */ 
    3133        virtual ~ViewCell() {} 
    3234        /** Returns Pvs.  
    3335        */ 
    34         const ViewCellPvs &GetPvs() const; 
    35         ViewCellPvs &GetPvs(); 
     36        const ObjectPvs &GetPvs() const; 
     37        ObjectPvs &GetPvs(); 
    3638 
    3739        int Type() const; 
     
    4143        void AddPassingRay(const Ray &ray, const int contributions);     
    4244 
     45        /** Returns volume of the view cell. 
     46        */ 
     47        virtual float GetVolume() const; 
     48 
     49        /** Sets volume of the view cell. 
     50        */ 
     51        void SetVolume(float size); 
    4352 
    4453        /// Ray set description of the rays passing through this node.   
     
    5160 
    5261        /// the potentially visible objects 
    53         ViewCellPvs mPvs; 
     62        ObjectPvs mPvs; 
     63 
     64        float mVolume; 
    5465}; 
    5566 
    56 class BspViewCell: public ViewCell 
     67/** 
     68        View cell belonging to a hierarchy. 
     69*/ 
     70template<typename T> 
     71class HierarchyViewCell: public ViewCell 
     72{ 
     73public: 
     74        HierarchyViewCell<T>(): mLeaves(0) {} 
     75        HierarchyViewCell<T>(Mesh *mesh):  
     76                ViewCell(mesh), mLeaves(0) {} 
     77 
     78        /// Leaves of the hierarchy which are part of this view cell. 
     79        std::vector<T> mLeaves; 
     80}; 
     81 
     82typedef HierarchyViewCell<BspLeaf *> BspViewCell; 
     83typedef HierarchyViewCell<KdLeaf *> KdViewCell; 
     84typedef HierarchyViewCell<VspKdLeaf *> VspKdViewCell; 
     85 
     86/*class BspViewCell: public ViewCell 
    5787{ 
    5888public: 
    5989        BspViewCell(): mBspLeaves(0) {} 
    6090        BspViewCell(Mesh *mesh):  
    61         ViewCell(mesh), mBspLeaves(0) {} 
     91                ViewCell(mesh), mBspLeaves(0) {} 
    6292 
    63         /// Leaves which hold this view cell. 
    64         vector<BspLeaf *> mBspLeaves; 
     93        /// Leaves of the hierarchy which are part of this view cell. 
     94        std::vector<BspLeaf *> mBspLeaves; 
    6595}; 
    66  
    67 class VspKdViewCell: public ViewCell 
     96*/ 
     97/*class VspKdViewCell: public ViewCell 
    6898{ 
    6999public: 
    70         VspKdViewCell(): mVspKdLeaves(0) {} 
     100        VspKdViewCell(): mLeaves(0) {} 
    71101        VspKdViewCell(Mesh *mesh):  
    72         ViewCell(mesh), mVspKdLeaves(0) {} 
     102                ViewCell(mesh), mLeaves(0) {} 
    73103 
    74         float GetSize() {return mSize;} 
    75         void SetSize(float size) {mSize = size;} 
    76  
    77         /// Leaves which hold this view cell. 
    78         vector<VspKdLeaf *> mVspKdLeaves; 
    79  
    80 protected: 
    81         float mSize; 
     104        /// Leaves of the hierarchy which are part of this view cell. 
     105        std::vector<VspKdLeaf *> mLeaves; 
    82106}; 
    83  
     107*/ 
    84108class ViewCellsStatistics: public StatisticsBase 
    85109{ 
Note: See TracChangeset for help on using the changeset viewer.