Changeset 1022


Ignore:
Timestamp:
06/19/06 17:07:49 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
7 edited

Legend:

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

    r1021 r1022  
    1313#include "PlyParser.h" 
    1414#include "SamplingStrategy.h" 
     15#include "VspOspTree.h" 
    1516 
    1617 
     
    433434                mViewCellsManager = new VspBspViewCellsManager(mVspBspTree); 
    434435        } 
    435 #if 0 
    436436        else if (strcmp(name, "vspOspTree") == 0) 
    437437        { 
    438                 mVspOspTree = new VspOspTree();          
    439                 mViewCellsManager = new VspOspViewCellsManager(mVspOspTree); 
    440         } 
    441 #endif 
     438                mVspTree = new VspTree(); 
     439                mOspTree = new OspTree(); 
     440 
     441                mViewCellsManager = new VspOspViewCellsManager(mVspTree, mOspTree); 
     442        } 
    442443        else if (strcmp(name, "sceneDependent") == 0) 
    443444        { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h

    r1020 r1022  
    2222struct VssRayContainer; 
    2323class SamplingStrategy; 
    24  
    2524class GlRendererBuffer; 
     25class VspTree; 
     26class OspTree; 
    2627 
    2728/** Namespace for the external visibility preprocessor 
     
    134135          VssRayContainer &vssRays) {}; 
    135136 
     137  /** Returns a view cells manager with respect to the given name. 
     138  */ 
    136139  ViewCellsManager *CreateViewCellsManager(const char *name); 
    137140 
     
    144147  /// kD-tree organizing the scene graph (occluders + occludees) + viewcells 
    145148  KdTree *mKdTree; 
    146    
    147149  /// View space partition bsp tree 
    148150  VspBspTree *mVspBspTree; 
     151  // view space partition tree 
     152  VspTree *mVspTree; 
     153  /// object space partition tree 
     154  OspTree *mOspTree; 
     155  /// BSP tree representing the viewcells 
     156  BspTree *mBspTree; 
     157 
     158 
    149159  /// list of all loaded occluders 
    150160  ObjectContainer mOccluders; 
     
    152162  ObjectContainer mOccludees; 
    153163    
    154   /// BSP tree representing the viewcells 
    155   BspTree *mBspTree; 
    156  
     164   
    157165  ViewCellsManager *mViewCellsManager; 
    158166 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r1021 r1022  
    113113                mSamplingType = Preprocessor::DIRECTION_BASED_DISTRIBUTION; 
    114114        } 
    115         else if (strcmp(buf, "interior") == 0) 
     115        else if (strcmp(buf, "object_directional") == 0) 
     116        { 
     117                mSamplingType = Preprocessor::OBJECT_DIRECTION_BASED_DISTRIBUTION; 
     118        } 
     119        /*else if (strcmp(buf, "interior") == 0) 
    116120        { 
    117121                mSamplingType = Preprocessor::OBJECTS_INTERIOR_DISTRIBUTION; 
    118         } 
    119         else if (strcmp(buf, "object_directional") == 0) 
    120         { 
    121                 mSamplingType = Preprocessor::OBJECT_DIRECTION_BASED_DISTRIBUTION; 
    122         } 
     122        }*/ 
    123123        else 
    124124        { 
     
    142142                mEvaluationSamplingType = Preprocessor::OBJECT_DIRECTION_BASED_DISTRIBUTION; 
    143143        } 
    144         else if (strcmp(buf, "interior") == 0) 
     144        /*else if (strcmp(buf, "interior") == 0) 
    145145        { 
    146146                mEvaluationSamplingType = Preprocessor::OBJECTS_INTERIOR_DISTRIBUTION; 
    147         } 
     147        }*/ 
    148148        else 
    149149        { 
     
    23582358 
    23592359 
    2360  
    2361  
    23622360void ViewCellsManager::ExportColor(Exporter *exporter, ViewCell *vc) const 
    23632361{ 
     
    24232421 
    24242422 
     2423void ViewCellsManager::CollectMergeCandidates(const VssRayContainer &rays,  
     2424                                                                                          vector<MergeCandidate> &candidates) 
     2425{ 
     2426        // implemented in subclasses 
     2427} 
     2428 
    24252429/**********************************************************************/ 
    24262430/*                 BspViewCellsManager implementation                 */ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h

    r1021 r1022  
    368368 
    369369        virtual void CollectMergeCandidates(const VssRayContainer &rays,  
    370                                                                                 vector<MergeCandidate> &candidates) = 0; 
     370                                                                                vector<MergeCandidate> &candidates); 
    371371 
    372372        void CollectViewCells(const int n); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp

    r1006 r1022  
    3030#include "ViewCellsManager.h" 
    3131#include "GzFileInputSource.h" 
     32#include "VspOspTree.h" 
     33 
    3234 
    3335namespace GtpVisibilityPreprocessor { 
     
    621623                mViewCellsManager = new BspViewCellsManager(mBspTree); 
    622624        } 
    623         else // vspBspTree 
     625        else if (strcmp(name, "vspBspTree") == 0) //  
    624626        { 
    625627                Debug << "view cell type: VspBsp" << endl; 
     
    631633                mVspBspTree->mBox = mViewSpaceBox; 
    632634        } 
     635        else if (strcmp(name, "vspOspTree") == 0) 
     636        { 
     637                Debug << "view cell type: VspOsp" << endl; 
     638 
     639                mVspTree = new VspTree(); 
     640                mOspTree = new OspTree(); 
     641 
     642                //mCurrentBspNode = mVspBspTree->GetRoot(); 
     643                mViewCellsManager = new VspOspViewCellsManager(mVspTree, mOspTree); 
     644 
     645                mVspTree->mBoundingBox = mViewSpaceBox; 
     646        } 
     647 
    633648 
    634649        mViewCellsTree = mViewCellsManager->GetViewCellsTree(); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h

    r1006 r1022  
    2121class ViewCellsManager; 
    2222class ViewCellsTree; 
     23class VspTree; 
     24class OspTree; 
     25 
     26 
    2327 
    2428class ViewCellsParseHandlers: public HandlerBase 
     
    6973 
    7074  VspBspTree *mVspBspTree; 
     75  VspTree *mVspTree; 
     76  OspTree *mOspTree; 
     77 
    7178  BspTree *mBspTree; 
    7279  ViewCellsTree *mViewCellsTree; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp

    r1021 r1022  
    23102310/*****************************************************************/ 
    23112311 
     2312OspTree::OspTree(): 
     2313mRoot(NULL) 
     2314#if TODO 
     2315mOutOfBoundsCell(NULL), 
     2316mStoreRays(false), 
     2317mUseRandomAxis(false), 
     2318mTimeStamp(1) 
     2319#endif 
     2320{ 
     2321#if TODO 
     2322        bool randomize = false; 
     2323        Environment::GetSingleton()->GetBoolValue("VspTree.Construction.randomize", randomize); 
     2324        if (randomize) 
     2325                Randomize(); // initialise random generator for heuristics 
     2326 
     2327        //-- termination criteria for autopartition 
     2328        Environment::GetSingleton()->GetIntValue("VspTree.Termination.maxDepth", mTermMaxDepth); 
     2329        Environment::GetSingleton()->GetIntValue("VspTree.Termination.minPvs", mTermMinPvs); 
     2330        Environment::GetSingleton()->GetIntValue("VspTree.Termination.minRays", mTermMinRays); 
     2331        Environment::GetSingleton()->GetFloatValue("VspTree.Termination.minProbability", mTermMinProbability); 
     2332        Environment::GetSingleton()->GetFloatValue("VspTree.Termination.maxRayContribution", mTermMaxRayContribution); 
     2333        Environment::GetSingleton()->GetFloatValue("VspTree.Termination.maxCostRatio", mTermMaxCostRatio); 
     2334        Environment::GetSingleton()->GetIntValue("VspTree.Termination.missTolerance", mTermMissTolerance); 
     2335        Environment::GetSingleton()->GetIntValue("VspTree.Termination.maxViewCells", mMaxViewCells); 
     2336 
     2337        //-- max cost ratio for early tree termination 
     2338        Environment::GetSingleton()->GetFloatValue("VspTree.Termination.maxCostRatio", mTermMaxCostRatio); 
     2339 
     2340        Environment::GetSingleton()->GetFloatValue("VspTree.Termination.minGlobalCostRatio", mTermMinGlobalCostRatio); 
     2341        Environment::GetSingleton()->GetIntValue("VspTree.Termination.globalCostMissTolerance", mTermGlobalCostMissTolerance); 
     2342 
     2343        // HACK//mTermMinPolygons = 25; 
     2344 
     2345        //-- factors for bsp tree split plane heuristics 
     2346        Environment::GetSingleton()->GetFloatValue("VspTree.Termination.ct_div_ci", mCtDivCi); 
     2347 
     2348        //-- partition criteria 
     2349        Environment::GetSingleton()->GetFloatValue("VspTree.Construction.epsilon", mEpsilon); 
     2350 
     2351        // if only the driving axis is used for axis aligned split 
     2352        Environment::GetSingleton()->GetBoolValue("VspTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis); 
     2353         
     2354        //Environment::GetSingleton()->GetFloatValue("VspTree.maxTotalMemory", mMaxTotalMemory); 
     2355        Environment::GetSingleton()->GetFloatValue("VspTree.maxStaticMemory", mMaxMemory); 
     2356 
     2357        Environment::GetSingleton()->GetBoolValue("VspTree.useCostHeuristics", mUseCostHeuristics); 
     2358        Environment::GetSingleton()->GetBoolValue("VspTree.simulateOctree", mCirculatingAxis); 
     2359        Environment::GetSingleton()->GetBoolValue("VspTree.useRandomAxis", mUseRandomAxis); 
     2360        Environment::GetSingleton()->GetIntValue("VspTree.nodePriorityQueueType", mNodePriorityQueueType); 
     2361         
     2362        char subdivisionStatsLog[100]; 
     2363        Environment::GetSingleton()->GetStringValue("VspTree.subdivisionStats", subdivisionStatsLog); 
     2364        mSubdivisionStats.open(subdivisionStatsLog); 
     2365 
     2366        Environment::GetSingleton()->GetFloatValue("VspTree.Construction.minBand", mMinBand); 
     2367        Environment::GetSingleton()->GetFloatValue("VspTree.Construction.maxBand", mMaxBand); 
     2368         
     2369 
     2370        //-- debug output 
     2371 
     2372        Debug << "******* VSP BSP options ******** " << endl; 
     2373    Debug << "max depth: " << mTermMaxDepth << endl; 
     2374        Debug << "min PVS: " << mTermMinPvs << endl; 
     2375        Debug << "min probabiliy: " << mTermMinProbability << endl; 
     2376        Debug << "min rays: " << mTermMinRays << endl; 
     2377        Debug << "max ray contri: " << mTermMaxRayContribution << endl; 
     2378        Debug << "max cost ratio: " << mTermMaxCostRatio << endl; 
     2379        Debug << "miss tolerance: " << mTermMissTolerance << endl; 
     2380        Debug << "max view cells: " << mMaxViewCells << endl; 
     2381        Debug << "randomize: " << randomize << endl; 
     2382 
     2383        Debug << "min global cost ratio: " << mTermMinGlobalCostRatio << endl; 
     2384        Debug << "global cost miss tolerance: " << mTermGlobalCostMissTolerance << endl; 
     2385        Debug << "only driving axis: " << mOnlyDrivingAxis << endl; 
     2386        Debug << "max memory: " << mMaxMemory << endl; 
     2387        Debug << "use cost heuristics: " << mUseCostHeuristics << endl; 
     2388        Debug << "subdivision stats log: " << subdivisionStatsLog << endl; 
     2389        Debug << "use random axis: " << mUseRandomAxis << endl; 
     2390        Debug << "priority queue type: " << mNodePriorityQueueType << endl; 
     2391        Debug << "circulating axis: " << mCirculatingAxis << endl; 
     2392        Debug << "minband: " << mMinBand << endl; 
     2393        Debug << "maxband: " << mMaxBand << endl; 
     2394         
     2395 
     2396        mSplitCandidates = new vector<SortableEntry>; 
     2397 
     2398        Debug << endl; 
     2399#endif 
     2400} 
     2401 
     2402 
    23122403 
    23132404void OspTree::SplitObjects(const AxisAlignedPlane & splitPlane, 
Note: See TracChangeset for help on using the changeset viewer.