Changeset 1582


Ignore:
Timestamp:
10/07/06 23:13:47 (18 years ago)
Author:
bittner
Message:

ViewcellsManager? issue solved

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/Camera.cpp

    r1328 r1582  
    7171                ray.mFlags &= ~(Ray::STORE_TESTED_OBJECTS|Ray::STORE_KDLEAVES); 
    7272           
    73           if (tree->CastRay(ray)) 
     73          if (tree->CastRay(ray))  
    7474                if (ray.intersections.size()) { 
     75                  cout<<"I"; 
    7576                  sort(ray.intersections.begin(), ray.intersections.end()); 
    7677                  MeshInstance *mesh = (MeshInstance*)ray.intersections[0].mObject; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r1581 r1582  
    431431          cout << "loading view cells from " << buf << endl; 
    432432           
    433           mViewCellsManager = ViewCellsManager::LoadViewCells(buf, &mObjects, true); 
     433          // $$ does not compile -> commented out 
     434          mViewCellsManager = ViewCellsManager::LoadViewCells(buf, &mObjects, true, NULL); 
    434435           
    435436          if (!mViewCellsManager) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r1581 r1582  
    18561856                        {                        
    18571857                                if (viewcell->GetPvs().GetSampleContribution( 
    1858                                                                                                                          ray.mTerminationObject, 
    1859                                                                                                                          ray.mPdf, 
    1860                                                                                                                          contribution)) 
    1861                                   { 
     1858                                                        ray.mTerminationObject, 
     1859                                                        ray.mPdf, 
     1860                                                        contribution)) 
     1861                                { 
    18621862                                        ++ ray.mPvsContribution; 
    1863                                   } 
    1864                                 ray.mRelativePvsContribution += contribution; 
    1865                                  
     1863                                        ray.mRelativePvsContribution += contribution; 
     1864                                } 
    18661865                        } 
    18671866                         
    18681867#if SAMPLE_ORIGIN_OBJECTS 
    1869                          
     1868 
    18701869                        // for directional sampling it is important to count only contributions 
    18711870                        // made in one direction!!! 
    18721871                        // the other contributions of this sample will be counted for the oposite ray! 
    1873                          
     1872 
    18741873                        if (ray.mOriginObject &&  
    18751874                                viewcell->GetPvs().GetSampleContribution(ray.mOriginObject, 
    18761875                                                                                                                 ray.mPdf, 
    18771876                                                                                                                 contribution)) 
    1878                           { 
     1877                        { 
    18791878                                ++ ray.mPvsContribution; 
    1880                           } 
    1881                         ray.mRelativePvsContribution += contribution; 
     1879                                ray.mRelativePvsContribution += contribution; 
     1880                        } 
    18821881#endif 
    18831882                } 
     
    55175516                        { 
    55185517                                ++ ray.mPvsContribution; 
     5518                                ray.mRelativePvsContribution += contribution; 
    55195519                        } 
    5520                         ray.mRelativePvsContribution += contribution; 
    55215520#endif 
    55225521                } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h

    r1581 r1582  
    430430        bool GetExportPvs() const; 
    431431 
    432  
    433   Preprocessor *GetPreprocessor() { 
    434         return mPreprocessor; 
    435   } 
    436    
    437   void SetPreprocessor(Preprocessor *p) { 
    438         mPreprocessor = p; 
    439   } 
     432        ///////////////////////////// 
     433        // static members 
     434         
     435        /** Loads view cells from file. The view cells manager is created with  
     436                respect to the loaded view cells. 
     437 
     438                @param filename the filename of the view cells 
     439                @param objects the scene objects 
     440                @param finalizeViewCells if the view cells should be post processed, i.e. 
     441                        a mesh is created representing the geometry 
     442                @param bconverter a conversion routine working with the similarities of bounding 
     443                boxes: if there is a certain similarity of overlap between bounding boxes, two tested 
     444                candidate objects are considered to be the same objects 
     445                @returns the view cells manager if loading was successful, false otherwise 
     446        */ 
     447        static ViewCellsManager *LoadViewCells(const string &filename,  
     448                                                                                   ObjectContainer *objects,  
     449                                                                                   const bool finalizeViewCells, 
     450                                                                                   BoundingBoxConverter *bconverter = NULL); 
    440451 
    441452 
     
    523534         
    524535        void ViewCellsManager::ResetPvs(); 
    525  
     536   
     537  Preprocessor *GetPreprocessor() const { 
     538        return mPreprocessor; 
     539  } 
     540 
     541  void SetPreprocessor(Preprocessor *p) { 
     542        mPreprocessor = p; 
     543  } 
    526544 
    527545protected: 
     
    623641        void UpdatePvsForEvaluation(ViewCell *root, ObjectPvs &pvs); 
    624642 
    625          
     643 
     644   
    626645        //////////////////////////////////////////////// 
    627646 
     
    720739 
    721740        ~BspViewCellsManager(); 
    722    
     741 
    723742        int ConstructSubdivision(const ObjectContainer &objects,  
    724743                                  const VssRayContainer &rays); 
Note: See TracChangeset for help on using the changeset viewer.