- Timestamp:
- 06/07/06 18:38:29 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis
- Files:
-
- 42 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r975 r1004 1029 1029 OgreBoundingBoxConverter bconverter(this); 1030 1030 1031 1032 GtpVisibilityPreprocessor::Environment *env =1033 mVisibilityManager->GetVisibilityEnvironment()->GetPreprocessorEnvironment();1034 1035 1031 // load the view cells assigning the found objects to the pvss 1036 1032 mViewCellsManager = 1037 GtpVisibilityPreprocessor::ViewCellsManager::LoadViewCells(filename, &mObjects, env,false, &bconverter);1033 GtpVisibilityPreprocessor::ViewCellsManager::LoadViewCells(filename, &mObjects, false, &bconverter); 1038 1034 1039 1035 return (mViewCellsManager != NULL); -
GTP/trunk/Lib/Vis/OnlineCullingCHC/include/VisibilityEnvironment.h
r938 r1004 40 40 41 41 protected: 42 GtpVisibilityPreprocessor::Environment *mEnvironment;42 //GtpVisibilityPreprocessor::Environment *Environment::GetSingleton(); 43 43 }; 44 44 } // namespace GtpVisibility -
GTP/trunk/Lib/Vis/OnlineCullingCHC/src/VisibilityEnvironment.cpp
r971 r1004 12 12 GtpVisibilityPreprocessor::Debug.open("debug.log"); 13 13 // load environment 14 mEnvironment = new GtpVisibilityPreprocessor::Environment();14 //Environment::GetSingleton() = new GtpVisibilityPreprocessor::Environment::GetSingleton(); 15 15 } 16 16 //----------------------------------------------------------------------- 17 17 VisibilityEnvironment::~VisibilityEnvironment() 18 18 { 19 DEL_PTR(mEnvironment); 19 //DEL_PTR(Environment::GetSingleton()); 20 GtpVisibilityPreprocessor::Environment::DelSingleton(); 20 21 } 21 22 //----------------------------------------------------------------------- … … 23 24 { 24 25 //-- parse environment 25 return mEnvironment->ReadEnvFile(filename.c_str());26 return GtpVisibilityPreprocessor::Environment::GetSingleton()->ReadEnvFile(filename.c_str()); 26 27 } 27 28 //----------------------------------------------------------------------- … … 29 30 { 30 31 char str[200]; 31 mEnvironment->GetStringValue("Scene.filename", str);32 GtpVisibilityPreprocessor::Environment::GetSingleton()->GetStringValue("Scene.filename", str); 32 33 return str; 33 34 } … … 36 37 { 37 38 char str[200]; 38 mEnvironment->GetStringValue("ViewCells.filename", str); 39 GtpVisibilityPreprocessor::Environment::GetSingleton()->GetStringValue("ViewCells.filename", str); 40 39 41 return str; 40 42 } … … 42 44 GtpVisibilityPreprocessor::Environment *VisibilityEnvironment::GetPreprocessorEnvironment() 43 45 { 44 return mEnvironment;46 return GtpVisibilityPreprocessor::Environment::GetSingleton(); 45 47 } 46 48 } // namespace GtpVisibility -
GTP/trunk/Lib/Vis/Preprocessing/scripts/Preprocessor.vcproj
r1002 r1004 176 176 Name="VCCustomBuildTool" 177 177 Description="Performing moc on $(InputName).h" 178 CommandLine="%qtdir%\bin\moc.exe $(InputDir)$(InputName).h -o $(InputDir)moc_$(InputName).cpp 179 " 178 CommandLine="%qtdir%\bin\moc.exe $(InputDir)$(InputName).h -o $(InputDir)moc_$(InputName).cpp
" 180 179 Outputs="$(InputDir)moc_$(InputName).cpp"/> 181 180 </FileConfiguration> … … 308 307 Name="VCCustomBuildTool" 309 308 Description="Performing moc on $(InputName).h" 310 CommandLine="%qtdir%\bin\moc.exe $(InputDir)$(InputName).h -o $(InputDir)moc_$(InputName).cpp 311 " 309 CommandLine="%qtdir%\bin\moc.exe $(InputDir)$(InputName).h -o $(InputDir)moc_$(InputName).cpp
" 312 310 Outputs="$(InputDir)moc_$(InputName).cpp"/> 313 311 </FileConfiguration> … … 323 321 Name="VCCustomBuildTool" 324 322 Description="Performing moc on $(InputName).h" 325 CommandLine="%qtdir%\bin\moc.exe $(InputDir)$(InputName).h -o $(InputDir)moc_$(InputName).cpp 326 " 323 CommandLine="%qtdir%\bin\moc.exe $(InputDir)$(InputName).h -o $(InputDir)moc_$(InputName).cpp
" 327 324 Outputs="$(InputDir)moc_$(InputName).cpp"/> 328 325 </FileConfiguration> -
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r1002 r1004 26 26 27 27 28 Environment *environment = NULL; 28 //Environment *environment = NULL; 29 Environment *Environment::sEnvironment = NULL; 30 31 32 Environment *Environment::GetSingleton() 33 { 34 if (!sEnvironment) 35 { 36 sEnvironment = new Environment(); 37 } 38 39 return sEnvironment; 40 } 41 42 void Environment::DelSingleton() 43 { 44 DEL_PTR(sEnvironment); 45 } 46 29 47 30 48 Environment::~Environment() … … 2219 2237 if (!GetParam(' ', 0, filename)) { 2220 2238 // user didn't specified environment file explicitly, so 2221 strcpy(filename, "default. env");2239 strcpy(filename, "default.Environment::GetSingleton()"); 2222 2240 } 2223 2241 -
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.h
r938 r1004 174 174 175 175 public: 176 /**@name Methods */ 177 //@{ 178 /// Constructor of the CEnvironment class. 179 Environment(); 180 /// Destructor of the CEnvironment class. 181 virtual ~Environment(); 182 183 /// This method is used as a help on available command line options. 184 virtual void PrintUsage(ostream &s) const; 185 186 virtual void SetStaticOptions(); 176 177 public: 178 179 /** Returns the resource manager as a singleton. 180 */ 181 static Environment *GetSingleton(); 182 183 static void DelSingleton(); 184 185 /// This method is used as a help on available command line options. 186 virtual void PrintUsage(ostream &s) const; 187 188 virtual void SetStaticOptions(); 187 189 188 190 … … 312 314 /// returns named option as a character string. 313 315 bool GetStringValue(const char *name, 314 315 316 char *value, 317 const bool isFatal = false) const; 316 318 317 319 //@} … … 348 350 char *filenameCoded); 349 351 352 protected: 353 354 /**@name Methods */ //@{ 355 /// Constructor of the CEnvironment class. 356 Environment(); 357 /// Destructor of the CEnvironment class. 358 virtual ~Environment(); 359 360 private: 361 362 static Environment *sEnvironment; 350 363 }; 351 364 352 365 // global environment value 353 extern Environment *environment;366 //extern Environment *environment; 354 367 355 368 } -
GTP/trunk/Lib/Vis/Preprocessing/src/FromPointVisibilityTree.cpp
r1002 r1004 67 67 { 68 68 bool randomize = false; 69 environment->GetBoolValue("FromPointVisibilityTree.Construction.randomize", randomize);69 Environment::GetSingleton()->GetBoolValue("FromPointVisibilityTree.Construction.randomize", randomize); 70 70 if (randomize) 71 71 Randomize(); // initialise random generator for heuristics 72 72 73 73 //-- termination criteria for autopartition 74 environment->GetIntValue("FromPointVisibilityTree.Termination.maxDepth", mTermMaxDepth);75 environment->GetIntValue("FromPointVisibilityTree.Termination.minPvs", mTermMinPvs);76 environment->GetIntValue("FromPointVisibilityTree.Termination.minRays", mTermMinRays);77 environment->GetFloatValue("FromPointVisibilityTree.Termination.minProbability", mTermMinProbability);78 environment->GetFloatValue("FromPointVisibilityTree.Termination.maxRayContribution", mTermMaxRayContribution);79 environment->GetFloatValue("FromPointVisibilityTree.Termination.minAccRayLenght", mTermMinAccRayLength);80 environment->GetFloatValue("FromPointVisibilityTree.Termination.maxCostRatio", mTermMaxCostRatio);81 environment->GetIntValue("FromPointVisibilityTree.Termination.missTolerance", mTermMissTolerance);82 environment->GetIntValue("FromPointVisibilityTree.Termination.maxViewCells", mMaxViewCells);74 Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.Termination.maxDepth", mTermMaxDepth); 75 Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.Termination.minPvs", mTermMinPvs); 76 Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.Termination.minRays", mTermMinRays); 77 Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Termination.minProbability", mTermMinProbability); 78 Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Termination.maxRayContribution", mTermMaxRayContribution); 79 Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Termination.minAccRayLenght", mTermMinAccRayLength); 80 Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Termination.maxCostRatio", mTermMaxCostRatio); 81 Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.Termination.missTolerance", mTermMissTolerance); 82 Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.Termination.maxViewCells", mMaxViewCells); 83 83 84 84 //-- max cost ratio for early tree termination 85 environment->GetFloatValue("FromPointVisibilityTree.Termination.maxCostRatio", mTermMaxCostRatio);86 87 environment->GetFloatValue("FromPointVisibilityTree.Termination.minGlobalCostRatio", mTermMinGlobalCostRatio);88 environment->GetIntValue("FromPointVisibilityTree.Termination.globalCostMissTolerance", mTermGlobalCostMissTolerance);85 Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Termination.maxCostRatio", mTermMaxCostRatio); 86 87 Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Termination.minGlobalCostRatio", mTermMinGlobalCostRatio); 88 Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.Termination.globalCostMissTolerance", mTermGlobalCostMissTolerance); 89 89 90 90 // HACK//mTermMinPolygons = 25; 91 91 92 92 //-- factors for bsp tree split plane heuristics 93 environment->GetFloatValue("FromPointVisibilityTree.Factor.pvs", mPvsFactor);94 environment->GetFloatValue("FromPointVisibilityTree.Termination.ct_div_ci", mCtDivCi);93 Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Factor.pvs", mPvsFactor); 94 Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Termination.ct_div_ci", mCtDivCi); 95 95 96 96 97 97 //-- partition criteria 98 environment->GetIntValue("FromPointVisibilityTree.maxPolyCandidates", mMaxPolyCandidates);99 environment->GetIntValue("FromPointVisibilityTree.maxRayCandidates", mMaxRayCandidates);100 environment->GetIntValue("FromPointVisibilityTree.splitPlaneStrategy", mSplitPlaneStrategy);101 102 environment->GetFloatValue("FromPointVisibilityTree.Construction.epsilon", mEpsilon);103 environment->GetIntValue("FromPointVisibilityTree.maxTests", mMaxTests);98 Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.maxPolyCandidates", mMaxPolyCandidates); 99 Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.maxRayCandidates", mMaxRayCandidates); 100 Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.splitPlaneStrategy", mSplitPlaneStrategy); 101 102 Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Construction.epsilon", mEpsilon); 103 Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.maxTests", mMaxTests); 104 104 105 105 // if only the driving axis is used for axis aligned split 106 environment->GetBoolValue("FromPointVisibilityTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis);106 Environment::GetSingleton()->GetBoolValue("FromPointVisibilityTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis); 107 107 108 108 //-- termination criteria for axis aligned split 109 environment->GetFloatValue("FromPointVisibilityTree.Termination.AxisAligned.maxRayContribution",110 mTermMaxRayContriForAxisAligned);111 environment->GetIntValue("FromPointVisibilityTree.Termination.AxisAligned.minRays",112 mTermMinRaysForAxisAligned);113 114 // environment->GetFloatValue("FromPointVisibilityTree.maxTotalMemory", mMaxTotalMemory);115 environment->GetFloatValue("FromPointVisibilityTree.maxStaticMemory", mMaxMemory);116 117 environment->GetFloatValue("FromPointVisibilityTree.Construction.renderCostWeight", mRenderCostWeight);118 environment->GetBoolValue("FromPointVisibilityTree.usePolygonSplitIfAvailable", mUsePolygonSplitIfAvailable);119 120 environment->GetBoolValue("FromPointVisibilityTree.useCostHeuristics", mUseCostHeuristics);121 environment->GetBoolValue("FromPointVisibilityTree.useSplitCostQueue", mUseSplitCostQueue);122 environment->GetBoolValue("FromPointVisibilityTree.simulateOctree", mCirculatingAxis);123 environment->GetBoolValue("FromPointVisibilityTree.useRandomAxis", mUseRandomAxis);124 environment->GetIntValue("FromPointVisibilityTree.nodePriorityQueueType", mNodePriorityQueueType);125 126 environment->GetBoolValue("ViewCells.PostProcess.emptyViewCellsMerge", mEmptyViewCellsMergeAllowed);109 Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Termination.AxisAligned.maxRayContribution", 110 mTermMaxRayContriForAxisAligned); 111 Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.Termination.AxisAligned.minRays", 112 mTermMinRaysForAxisAligned); 113 114 //Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.maxTotalMemory", mMaxTotalMemory); 115 Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.maxStaticMemory", mMaxMemory); 116 117 Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Construction.renderCostWeight", mRenderCostWeight); 118 Environment::GetSingleton()->GetBoolValue("FromPointVisibilityTree.usePolygonSplitIfAvailable", mUsePolygonSplitIfAvailable); 119 120 Environment::GetSingleton()->GetBoolValue("FromPointVisibilityTree.useCostHeuristics", mUseCostHeuristics); 121 Environment::GetSingleton()->GetBoolValue("FromPointVisibilityTree.useSplitCostQueue", mUseSplitCostQueue); 122 Environment::GetSingleton()->GetBoolValue("FromPointVisibilityTree.simulateOctree", mCirculatingAxis); 123 Environment::GetSingleton()->GetBoolValue("FromPointVisibilityTree.useRandomAxis", mUseRandomAxis); 124 Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.nodePriorityQueueType", mNodePriorityQueueType); 125 126 Environment::GetSingleton()->GetBoolValue("ViewCells.PostProcess.emptyViewCellsMerge", mEmptyViewCellsMergeAllowed); 127 127 128 128 char subdivisionStatsLog[100]; 129 environment->GetStringValue("FromPointVisibilityTree.subdivisionStats", subdivisionStatsLog);129 Environment::GetSingleton()->GetStringValue("FromPointVisibilityTree.subdivisionStats", subdivisionStatsLog); 130 130 mSubdivisionStats.open(subdivisionStatsLog); 131 131 132 environment->GetFloatValue("FromPointVisibilityTree.Construction.minBand", mMinBand);133 environment->GetFloatValue("FromPointVisibilityTree.Construction.maxBand", mMaxBand);132 Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Construction.minBand", mMinBand); 133 Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Construction.maxBand", mMaxBand); 134 134 135 135 //-- debug output -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r1002 r1004 86 86 mFrame = 0; 87 87 mWireFrame = false; 88 environment->GetBoolValue("Preprocessor.detectEmptyViewSpace", mDetectEmptyViewSpace);88 Environment::GetSingleton()->GetBoolValue("Preprocessor.detectEmptyViewSpace", mDetectEmptyViewSpace); 89 89 mSnapErrorFrames = true; 90 90 mSnapPrefix = "snap/"; … … 775 775 QGLPixelBuffer(QSize(w, h)), GlRenderer(sceneGraph, viewcells, tree) { 776 776 777 environment->GetIntValue("Preprocessor.pvsRenderErrorSamples", mPvsStatFrames);777 Environment::GetSingleton()->GetIntValue("Preprocessor.pvsRenderErrorSamples", mPvsStatFrames); 778 778 mPvsErrorBuffer.resize(mPvsStatFrames); 779 779 ClearErrorBuffer(); … … 939 939 940 940 void 941 GlRendererWidget::SetupProjection(const int w, const int h )941 GlRendererWidget::SetupProjection(const int w, const int h, const float angle) 942 942 { 943 943 if (!mTopView) 944 GlRenderer::SetupProjection(w, h );944 GlRenderer::SetupProjection(w, h, angle); 945 945 else { 946 946 glViewport(0, 0, w, h); -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
r1001 r1004 366 366 virtual int GetHeight() const { return height(); } 367 367 368 369 SetupProjection(const int w, const int h );368 virtual void 369 SetupProjection(const int w, const int h, const float angle = 70.0f); 370 370 371 371 void -
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
r1002 r1004 36 36 37 37 mRoot = new KdLeaf(NULL, 0); 38 environment->GetIntValue("KdTree.Termination.maxNodes", mTermMaxNodes);39 environment->GetIntValue("KdTree.Termination.maxDepth", mTermMaxDepth);40 environment->GetIntValue("KdTree.Termination.minCost", mTermMinCost);41 environment->GetFloatValue("KdTree.Termination.maxCostRatio", mMaxCostRatio);42 environment->GetFloatValue("KdTree.Termination.ct_div_ci", mCt_div_ci);43 environment->GetFloatValue("KdTree.splitBorder", mSplitBorder);44 45 environment->GetBoolValue("KdTree.sahUseFaces", mSahUseFaces);38 Environment::GetSingleton()->GetIntValue("KdTree.Termination.maxNodes", mTermMaxNodes); 39 Environment::GetSingleton()->GetIntValue("KdTree.Termination.maxDepth", mTermMaxDepth); 40 Environment::GetSingleton()->GetIntValue("KdTree.Termination.minCost", mTermMinCost); 41 Environment::GetSingleton()->GetFloatValue("KdTree.Termination.maxCostRatio", mMaxCostRatio); 42 Environment::GetSingleton()->GetFloatValue("KdTree.Termination.ct_div_ci", mCt_div_ci); 43 Environment::GetSingleton()->GetFloatValue("KdTree.splitBorder", mSplitBorder); 44 45 Environment::GetSingleton()->GetBoolValue("KdTree.sahUseFaces", mSahUseFaces); 46 46 47 47 char splitType[64]; 48 environment->GetStringValue("KdTree.splitMethod", splitType);48 Environment::GetSingleton()->GetStringValue("KdTree.splitMethod", splitType); 49 49 50 50 mSplitMethod = SPLIT_SPATIAL_MEDIAN; -
GTP/trunk/Lib/Vis/Preprocessing/src/LogManager.cpp
r1001 r1004 1 1 #include "LogManager.h" 2 #include "common.h" 3 2 4 using namespace std; 3 5 … … 18 20 19 21 22 void LogManager::DelSingleton() 23 { 24 DEL_PTR(sLogManager); 25 } 26 27 20 28 LogManager::LogManager() 21 29 { -
GTP/trunk/Lib/Vis/Preprocessing/src/LogManager.h
r1001 r1004 24 24 static LogManager *GetSingleton(); 25 25 26 static void DelSingleton(); 26 27 27 28 protected: -
GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.cpp
r1002 r1004 719 719 int TransformedMeshInstance::CastRay(Ray &ray) 720 720 { 721 ray.ApplyTransform(Invert(mWorldTransform)); 722 int res = mMesh->CastRay(ray, this); 723 ray.ApplyTransform(mWorldTransform); 724 725 return res; 721 ray.ApplyTransform(Invert(mWorldTransform)); 722 723 const int res = mMesh->CastRay(ray, this); 724 ray.ApplyTransform(mWorldTransform); 725 726 return res; 727 } 728 729 int TransformedMeshInstance::CastRay(Ray &ray, const vector<int> &faces) 730 { 731 ray.ApplyTransform(Invert(mWorldTransform)); 732 733 const int res = mMesh->CastRayToSelectedFaces(ray, faces, this); 734 ray.ApplyTransform(mWorldTransform); 735 736 return res; 726 737 } 727 738 -
GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.h
r1002 r1004 256 256 } 257 257 258 virtual int 259 CastRay( 260 Ray &ray 261 ); 258 virtual int CastRay(Ray &ray); 262 259 263 260 virtual bool IsConvex() { return mMesh->mIsConvex; } … … 303 300 class if the same mesh should be instantiated on different places. 304 301 */ 305 class TransformedMeshInstance 302 class TransformedMeshInstance: public MeshInstance 306 303 { 307 304 public: … … 313 310 virtual int CastRay(Ray &ray); 314 311 312 virtual int CastRay(Ray &ray, const vector<int> &faces); 313 315 314 virtual int Type() const { return TRANSFORMED_MESH_INSTANCE; } 316 315 … … 329 328 void GetWorldTransform(Matrix4x4 &m); 330 329 331 /** Transforms mesh-330 /** Transforms a mesh according to the stored world transform. 332 331 @param transformedMesh returns the tranformed mesh. 333 332 */ -
GTP/trunk/Lib/Vis/Preprocessing/src/MeshKdTree.cpp
r863 r1004 25 25 MeshKdTree::ParseEnvironment() 26 26 { 27 environment->GetIntValue("MeshKdTree.Termination.maxDepth", mTermMaxDepth);28 environment->GetIntValue("MeshKdTree.Termination.minCost", mTermMinCost);29 environment->GetFloatValue("MeshKdTree.Termination.maxCostRatio", mMaxCostRatio);30 environment->GetFloatValue("MeshKdTree.Termination.ct_div_ci", mCt_div_ci);31 environment->GetFloatValue("MeshKdTree.splitBorder", mSplitBorder);27 Environment::GetSingleton()->GetIntValue("MeshKdTree.Termination.maxDepth", mTermMaxDepth); 28 Environment::GetSingleton()->GetIntValue("MeshKdTree.Termination.minCost", mTermMinCost); 29 Environment::GetSingleton()->GetFloatValue("MeshKdTree.Termination.maxCostRatio", mMaxCostRatio); 30 Environment::GetSingleton()->GetFloatValue("MeshKdTree.Termination.ct_div_ci", mCt_div_ci); 31 Environment::GetSingleton()->GetFloatValue("MeshKdTree.splitBorder", mSplitBorder); 32 32 33 33 char splitType[64]; 34 environment->GetStringValue("MeshKdTree.splitMethod", splitType);34 Environment::GetSingleton()->GetStringValue("MeshKdTree.splitMethod", splitType); 35 35 36 36 mSplitMethod = SPLIT_SPATIAL_MEDIAN; -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r1002 r1004 118 118 mRenderSimulator(NULL) 119 119 { 120 environment->GetBoolValue("Preprocessor.useGlRenderer", mUseGlRenderer);120 Environment::GetSingleton()->GetBoolValue("Preprocessor.useGlRenderer", mUseGlRenderer); 121 121 122 122 // renderer will be constructed when the scene graph and viewcell manager will be known 123 123 renderer = NULL; 124 124 125 environment->GetBoolValue("Preprocessor.useGlDebugger", mUseGlDebugger);126 environment->GetBoolValue("Preprocessor.loadPolygonsAsMeshes", mLoadPolygonsAsMeshes);127 environment->GetBoolValue("Preprocessor.quitOnFinish", mQuitOnFinish);128 environment->GetBoolValue("Preprocessor.computeVisibility", mComputeVisibility);129 environment->GetBoolValue("Preprocessor.detectEmptyViewSpace", mDetectEmptyViewSpace);130 environment->GetBoolValue("Preprocessor.exportVisibility", mExportVisibility );125 Environment::GetSingleton()->GetBoolValue("Preprocessor.useGlDebugger", mUseGlDebugger); 126 Environment::GetSingleton()->GetBoolValue("Preprocessor.loadPolygonsAsMeshes", mLoadPolygonsAsMeshes); 127 Environment::GetSingleton()->GetBoolValue("Preprocessor.quitOnFinish", mQuitOnFinish); 128 Environment::GetSingleton()->GetBoolValue("Preprocessor.computeVisibility", mComputeVisibility); 129 Environment::GetSingleton()->GetBoolValue("Preprocessor.detectEmptyViewSpace", mDetectEmptyViewSpace); 130 Environment::GetSingleton()->GetBoolValue("Preprocessor.exportVisibility", mExportVisibility ); 131 131 132 132 char buffer[256]; 133 environment->GetStringValue("Preprocessor.visibilityFile", buffer);133 Environment::GetSingleton()->GetStringValue("Preprocessor.visibilityFile", buffer); 134 134 mVisibilityFileName = buffer; 135 environment->GetBoolValue("Preprocessor.applyVisibilityFilter", mApplyVisibilityFilter );136 environment->GetBoolValue("Preprocessor.applyVisibilitySpatialFilter",135 Environment::GetSingleton()->GetBoolValue("Preprocessor.applyVisibilityFilter", mApplyVisibilityFilter ); 136 Environment::GetSingleton()->GetBoolValue("Preprocessor.applyVisibilitySpatialFilter", 137 137 mApplyVisibilitySpatialFilter ); 138 environment->GetFloatValue("Preprocessor.visibilityFilterWidth", mVisibilityFilterWidth);138 Environment::GetSingleton()->GetFloatValue("Preprocessor.visibilityFilterWidth", mVisibilityFilterWidth); 139 139 140 140 Debug << "detect empty view space=" << mDetectEmptyViewSpace << endl; … … 361 361 { 362 362 //-- parse view cells construction method 363 environment->GetBoolValue("ViewCells.loadFromFile", mLoadViewCells);363 Environment::GetSingleton()->GetBoolValue("ViewCells.loadFromFile", mLoadViewCells); 364 364 char buf[100]; 365 365 366 366 if (mLoadViewCells) 367 367 { 368 environment->GetStringValue("ViewCells.filename", buf);369 mViewCellsManager = ViewCellsManager::LoadViewCells(buf, &mObjects, environment,true);368 Environment::GetSingleton()->GetStringValue("ViewCells.filename", buf); 369 mViewCellsManager = ViewCellsManager::LoadViewCells(buf, &mObjects, true); 370 370 } 371 371 else 372 372 { 373 373 //-- parse type of view cell container 374 environment->GetStringValue("ViewCells.type", buf);374 Environment::GetSingleton()->GetStringValue("ViewCells.type", buf); 375 375 mViewCellsManager = CreateViewCellsManager(buf); 376 376 } … … 379 379 float objRenderCost = 0, vcOverhead = 0, moveSpeed = 0; 380 380 381 environment->GetFloatValue("Simulation.objRenderCost",objRenderCost);382 environment->GetFloatValue("Simulation.vcOverhead", vcOverhead);383 environment->GetFloatValue("Simulation.moveSpeed", moveSpeed);381 Environment::GetSingleton()->GetFloatValue("Simulation.objRenderCost",objRenderCost); 382 Environment::GetSingleton()->GetFloatValue("Simulation.vcOverhead", vcOverhead); 383 Environment::GetSingleton()->GetFloatValue("Simulation.moveSpeed", moveSpeed); 384 384 385 385 mRenderSimulator = … … 408 408 if (strcmp(name, "kdTree") == 0) 409 409 { 410 mViewCellsManager = new KdViewCellsManager(mKdTree , environment);410 mViewCellsManager = new KdViewCellsManager(mKdTree); 411 411 } 412 412 else if (strcmp(name, "bspTree") == 0) … … 415 415 416 416 mBspTree = new BspTree(); 417 mViewCellsManager = new BspViewCellsManager(mBspTree , environment);417 mViewCellsManager = new BspViewCellsManager(mBspTree); 418 418 } 419 419 else if (strcmp(name, "vspBspTree") == 0) … … 421 421 Debug << "view cell type: VspBsp" << endl; 422 422 423 mVspBspTree = new VspBspTree( environment);424 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree , environment);423 mVspBspTree = new VspBspTree(); 424 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree); 425 425 } 426 426 else if (strcmp(name, "vspKdTree") == 0) … … 428 428 mVspKdTree = new VspKdTree(); 429 429 430 mViewCellsManager = new VspKdViewCellsManager(mVspKdTree , environment);430 mViewCellsManager = new VspKdViewCellsManager(mVspKdTree); 431 431 } 432 432 else if (strcmp(name, "sceneDependent") == 0) … … 437 437 Debug << "view cell type: Bsp" << endl; 438 438 439 mViewCellsManager = new BspViewCellsManager(mBspTree , environment);439 mViewCellsManager = new BspViewCellsManager(mBspTree); 440 440 } 441 441 else … … 464 464 std::stable_sort(objects.begin(), objects.end(), ilt); 465 465 char fileName[100]; 466 environment->GetStringValue("Preprocessor.samplesFilename", fileName);466 Environment::GetSingleton()->GetStringValue("Preprocessor.samplesFilename", fileName); 467 467 468 468 Vector3 origin, termination; … … 549 549 { 550 550 char fileName[100]; 551 environment->GetStringValue("Preprocessor.samplesFilename", fileName);551 Environment::GetSingleton()->GetStringValue("Preprocessor.samplesFilename", fileName); 552 552 553 553 -
GTP/trunk/Lib/Vis/Preprocessing/src/RenderSampler.cpp
r1002 r1004 8 8 RenderSampler::RenderSampler():Preprocessor() 9 9 { 10 environment->GetIntValue("RenderSampler.samples", mSamples);10 Environment::GetSingleton()->GetIntValue("RenderSampler.samples", mSamples); 11 11 cout << "number of render samples: " << mSamples << endl; 12 12 } … … 22 22 bool useOcclusionQueries; 23 23 24 environment->GetIntValue("Preprocessor.histogram.maxValue", histoMaxVal);25 environment->GetIntValue("Preprocessor.histogram.intervals", histoIntervals);26 environment->GetIntValue("RenderSampler.visibleThreshold", threshold);27 environment->GetBoolValue("RenderSampler.useOcclusionQueries", useOcclusionQueries);24 Environment::GetSingleton()->GetIntValue("Preprocessor.histogram.maxValue", histoMaxVal); 25 Environment::GetSingleton()->GetIntValue("Preprocessor.histogram.intervals", histoIntervals); 26 Environment::GetSingleton()->GetIntValue("RenderSampler.visibleThreshold", threshold); 27 Environment::GetSingleton()->GetBoolValue("RenderSampler.useOcclusionQueries", useOcclusionQueries); 28 28 29 29 Debug << "************* render sampler ****************" << endl; … … 57 57 histogram[i] = 0; 58 58 } 59 cout << "here3 "<< mSamples << endl; 60 cout << "here2 " << samples.size() << endl; 59 61 60 // store maximal pvs 62 61 for (int i = 0; i < mSamples; ++ i) -
GTP/trunk/Lib/Vis/Preprocessing/src/ResourceManager.h
r1002 r1004 38 38 } 39 39 40 /** We also want full control over the delete. 41 */ 40 42 static void DelSingleton() 41 43 { -
GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp
r884 r1004 29 29 { 30 30 // this should increase coherence of the samples 31 environment->GetIntValue("RssPreprocessor.samplesPerPass", mSamplesPerPass);32 environment->GetIntValue("RssPreprocessor.initialSamples", mInitialSamples);33 environment->GetIntValue("RssPreprocessor.vssSamples", mRssSamples);34 environment->GetIntValue("RssPreprocessor.vssSamplesPerPass", mRssSamplesPerPass);35 environment->GetBoolValue("RssPreprocessor.useImportanceSampling", mUseImportanceSampling);36 37 environment->GetBoolValue("RssPreprocessor.Export.pvs", mExportPvs);38 environment->GetBoolValue("RssPreprocessor.Export.rssTree", mExportRssTree);39 environment->GetBoolValue("RssPreprocessor.Export.rays", mExportRays);40 environment->GetIntValue("RssPreprocessor.Export.numRays", mExportNumRays);41 environment->GetBoolValue("RssPreprocessor.useViewcells", mUseViewcells);42 environment->GetBoolValue("RssPreprocessor.objectBasedSampling", mObjectBasedSampling);43 environment->GetBoolValue("RssPreprocessor.directionalSampling", mDirectionalSampling);44 45 environment->GetBoolValue("RssPreprocessor.loadInitialSamples", mLoadInitialSamples);46 environment->GetBoolValue("RssPreprocessor.storeInitialSamples", mStoreInitialSamples);47 environment->GetBoolValue("RssPreprocessor.updateSubdivision", mUpdateSubdivision);31 Environment::GetSingleton()->GetIntValue("RssPreprocessor.samplesPerPass", mSamplesPerPass); 32 Environment::GetSingleton()->GetIntValue("RssPreprocessor.initialSamples", mInitialSamples); 33 Environment::GetSingleton()->GetIntValue("RssPreprocessor.vssSamples", mRssSamples); 34 Environment::GetSingleton()->GetIntValue("RssPreprocessor.vssSamplesPerPass", mRssSamplesPerPass); 35 Environment::GetSingleton()->GetBoolValue("RssPreprocessor.useImportanceSampling", mUseImportanceSampling); 36 37 Environment::GetSingleton()->GetBoolValue("RssPreprocessor.Export.pvs", mExportPvs); 38 Environment::GetSingleton()->GetBoolValue("RssPreprocessor.Export.rssTree", mExportRssTree); 39 Environment::GetSingleton()->GetBoolValue("RssPreprocessor.Export.rays", mExportRays); 40 Environment::GetSingleton()->GetIntValue("RssPreprocessor.Export.numRays", mExportNumRays); 41 Environment::GetSingleton()->GetBoolValue("RssPreprocessor.useViewcells", mUseViewcells); 42 Environment::GetSingleton()->GetBoolValue("RssPreprocessor.objectBasedSampling", mObjectBasedSampling); 43 Environment::GetSingleton()->GetBoolValue("RssPreprocessor.directionalSampling", mDirectionalSampling); 44 45 Environment::GetSingleton()->GetBoolValue("RssPreprocessor.loadInitialSamples", mLoadInitialSamples); 46 Environment::GetSingleton()->GetBoolValue("RssPreprocessor.storeInitialSamples", mStoreInitialSamples); 47 Environment::GetSingleton()->GetBoolValue("RssPreprocessor.updateSubdivision", mUpdateSubdivision); 48 48 49 49 mStats.open("stats.log"); -
GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp
r863 r1004 107 107 RssTree::RssTree() 108 108 { 109 environment->GetIntValue("RssTree.maxDepth", termMaxDepth);110 environment->GetIntValue("RssTree.minPvs", termMinPvs);111 environment->GetIntValue("RssTree.minRays", termMinRays);112 environment->GetFloatValue("RssTree.maxRayContribution", termMaxRayContribution);113 environment->GetFloatValue("RssTree.maxCostRatio", termMaxCostRatio);114 115 environment->GetFloatValue("RssTree.minSize", termMinSize);109 Environment::GetSingleton()->GetIntValue("RssTree.maxDepth", termMaxDepth); 110 Environment::GetSingleton()->GetIntValue("RssTree.minPvs", termMinPvs); 111 Environment::GetSingleton()->GetIntValue("RssTree.minRays", termMinRays); 112 Environment::GetSingleton()->GetFloatValue("RssTree.maxRayContribution", termMaxRayContribution); 113 Environment::GetSingleton()->GetFloatValue("RssTree.maxCostRatio", termMaxCostRatio); 114 115 Environment::GetSingleton()->GetFloatValue("RssTree.minSize", termMinSize); 116 116 termMinSize = sqr(termMinSize); 117 117 118 environment->GetFloatValue("RssTree.refDirBoxMaxSize", refDirBoxMaxSize);118 Environment::GetSingleton()->GetFloatValue("RssTree.refDirBoxMaxSize", refDirBoxMaxSize); 119 119 refDirBoxMaxSize = sqr(refDirBoxMaxSize); 120 120 121 environment->GetFloatValue("RssTree.epsilon", epsilon);122 environment->GetFloatValue("RssTree.ct_div_ci", ct_div_ci);123 124 environment->GetFloatValue("RssTree.maxTotalMemory", maxTotalMemory);125 environment->GetFloatValue("RssTree.maxStaticMemory", maxStaticMemory);126 127 environment->GetFloatValue("RssTree.maxStaticMemory", maxStaticMemory);128 129 130 131 environment->GetIntValue("RssTree.accessTimeThreshold", accessTimeThreshold);121 Environment::GetSingleton()->GetFloatValue("RssTree.epsilon", epsilon); 122 Environment::GetSingleton()->GetFloatValue("RssTree.ct_div_ci", ct_div_ci); 123 124 Environment::GetSingleton()->GetFloatValue("RssTree.maxTotalMemory", maxTotalMemory); 125 Environment::GetSingleton()->GetFloatValue("RssTree.maxStaticMemory", maxStaticMemory); 126 127 Environment::GetSingleton()->GetFloatValue("RssTree.maxStaticMemory", maxStaticMemory); 128 129 130 131 Environment::GetSingleton()->GetIntValue("RssTree.accessTimeThreshold", accessTimeThreshold); 132 132 //= 1000; 133 environment->GetIntValue("RssTree.minCollapseDepth", minCollapseDepth);133 Environment::GetSingleton()->GetIntValue("RssTree.minCollapseDepth", minCollapseDepth); 134 134 // int minCollapseDepth = 4; 135 135 … … 141 141 // split type 142 142 char sname[128]; 143 environment->GetStringValue("RssTree.splitType", sname);143 Environment::GetSingleton()->GetStringValue("RssTree.splitType", sname); 144 144 string name(sname); 145 145 … … 157 157 } 158 158 159 environment->GetBoolValue("RssTree.randomize", randomize);160 environment->GetBoolValue("RssTree.splitUseOnlyDrivingAxis", mSplitUseOnlyDrivingAxis);161 162 environment->GetBoolValue("RssTree.interleaveDirSplits", mInterleaveDirSplits);163 environment->GetIntValue("RssTree.dirSplitDepth", mDirSplitDepth);164 165 environment->GetBoolValue("RssTree.importanceBasedCost", mImportanceBasedCost);166 167 environment->GetIntValue("RssTree.maxRays", mMaxRays);168 169 environment->GetBoolValue("RssTree.perObjectTree", mPerObjectTree);159 Environment::GetSingleton()->GetBoolValue("RssTree.randomize", randomize); 160 Environment::GetSingleton()->GetBoolValue("RssTree.splitUseOnlyDrivingAxis", mSplitUseOnlyDrivingAxis); 161 162 Environment::GetSingleton()->GetBoolValue("RssTree.interleaveDirSplits", mInterleaveDirSplits); 163 Environment::GetSingleton()->GetIntValue("RssTree.dirSplitDepth", mDirSplitDepth); 164 165 Environment::GetSingleton()->GetBoolValue("RssTree.importanceBasedCost", mImportanceBasedCost); 166 167 Environment::GetSingleton()->GetIntValue("RssTree.maxRays", mMaxRays); 168 169 Environment::GetSingleton()->GetBoolValue("RssTree.perObjectTree", mPerObjectTree); 170 170 171 171 // mRoots; -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.cpp
r863 r1004 17 17 { 18 18 // this should increase coherence of the samples 19 environment->GetIntValue("Sampling.samplesPerPass", mSamplesPerPass);20 environment->GetIntValue("Sampling.totalSamples", mTotalSamples);19 Environment::GetSingleton()->GetIntValue("Sampling.samplesPerPass", mSamplesPerPass); 20 Environment::GetSingleton()->GetIntValue("Sampling.totalSamples", mTotalSamples); 21 21 22 22 mStats.open("stats.log"); -
GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.cpp
r1002 r1004 65 65 66 66 int meshGrouping; 67 environment->GetIntValue("Unigraphics.meshGrouping",67 Environment::GetSingleton()->GetIntValue("Unigraphics.meshGrouping", 68 68 meshGrouping); 69 69 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r1002 r1004 354 354 355 355 356 ViewCellsTree::ViewCellsTree(ViewCellsManager *vcm , Environment *env):356 ViewCellsTree::ViewCellsTree(ViewCellsManager *vcm): 357 357 mRoot(NULL), 358 358 mUseAreaForPvs(false), … … 364 364 #endif 365 365 { 366 env->GetBoolValue("ViewCells.Visualization.exportMergedViewCells", mExportMergedViewCells);367 env->GetFloatValue("ViewCells.maxStaticMemory", mMaxMemory);366 Environment::GetSingleton()->GetBoolValue("ViewCells.Visualization.exportMergedViewCells", mExportMergedViewCells); 367 Environment::GetSingleton()->GetFloatValue("ViewCells.maxStaticMemory", mMaxMemory); 368 368 369 369 //-- merge options 370 env->GetFloatValue("ViewCells.PostProcess.renderCostWeight", mRenderCostWeight);371 env->GetIntValue("ViewCells.PostProcess.minViewCells", mMergeMinViewCells);372 env->GetFloatValue("ViewCells.PostProcess.maxCostRatio", mMergeMaxCostRatio);373 env->GetBoolValue("ViewCells.PostProcess.refine", mRefineViewCells);374 375 env->GetIntValue("ViewCells.PostProcess.maxMergesPerPass", mMaxMergesPerPass);376 env->GetFloatValue("ViewCells.PostProcess.avgCostMaxDeviation", mAvgCostMaxDeviation);370 Environment::GetSingleton()->GetFloatValue("ViewCells.PostProcess.renderCostWeight", mRenderCostWeight); 371 Environment::GetSingleton()->GetIntValue("ViewCells.PostProcess.minViewCells", mMergeMinViewCells); 372 Environment::GetSingleton()->GetFloatValue("ViewCells.PostProcess.maxCostRatio", mMergeMaxCostRatio); 373 Environment::GetSingleton()->GetBoolValue("ViewCells.PostProcess.refine", mRefineViewCells); 374 375 Environment::GetSingleton()->GetIntValue("ViewCells.PostProcess.maxMergesPerPass", mMaxMergesPerPass); 376 Environment::GetSingleton()->GetFloatValue("ViewCells.PostProcess.avgCostMaxDeviation", mAvgCostMaxDeviation); 377 377 378 378 Debug << "============= view cell tree options ================\n"; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
r1002 r1004 24 24 class ViewCellsManager; 25 25 class ViewCellLeaf; 26 class Environment;26 //class Environment; 27 27 28 28 … … 393 393 394 394 public: 395 /** View cells tree constructor taking a view cell mnanager and 396 an environment as parameters. 397 */ 398 ViewCellsTree(ViewCellsManager *vcm, Environment *env); 395 /** View cells tree constructor taking a view cell mnanager as parameter 396 */ 397 ViewCellsTree(ViewCellsManager *vcm); 399 398 ~ViewCellsTree(); 400 399 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp
r1002 r1004 227 227 228 228 //-- termination criteria for autopartition 229 environment->GetIntValue("BspTree.Termination.maxDepth", mTermMaxDepth);230 environment->GetIntValue("BspTree.Termination.minPvs", mTermMinPvs);231 environment->GetIntValue("BspTree.Termination.minPolygons", mTermMinPolys);232 environment->GetIntValue("BspTree.Termination.minRays", mTermMinRays);233 environment->GetFloatValue("BspTree.Termination.minProbability", mTermMinProbability);234 environment->GetFloatValue("BspTree.Termination.maxRayContribution", mTermMaxRayContribution);235 environment->GetFloatValue("BspTree.Termination.minAccRayLenght", mTermMinAccRayLength);229 Environment::GetSingleton()->GetIntValue("BspTree.Termination.maxDepth", mTermMaxDepth); 230 Environment::GetSingleton()->GetIntValue("BspTree.Termination.minPvs", mTermMinPvs); 231 Environment::GetSingleton()->GetIntValue("BspTree.Termination.minPolygons", mTermMinPolys); 232 Environment::GetSingleton()->GetIntValue("BspTree.Termination.minRays", mTermMinRays); 233 Environment::GetSingleton()->GetFloatValue("BspTree.Termination.minProbability", mTermMinProbability); 234 Environment::GetSingleton()->GetFloatValue("BspTree.Termination.maxRayContribution", mTermMaxRayContribution); 235 Environment::GetSingleton()->GetFloatValue("BspTree.Termination.minAccRayLenght", mTermMinAccRayLength); 236 236 237 237 //-- factors for bsp tree split plane heuristics 238 environment->GetFloatValue("BspTree.Factor.verticalSplits", mVerticalSplitsFactor);239 environment->GetFloatValue("BspTree.Factor.largestPolyArea", mLargestPolyAreaFactor);240 environment->GetFloatValue("BspTree.Factor.blockedRays", mBlockedRaysFactor);241 environment->GetFloatValue("BspTree.Factor.leastRaySplits", mLeastRaySplitsFactor);242 environment->GetFloatValue("BspTree.Factor.balancedRays", mBalancedRaysFactor);243 environment->GetFloatValue("BspTree.Factor.pvs", mPvsFactor);244 environment->GetFloatValue("BspTree.Factor.leastSplits" , mLeastSplitsFactor);245 environment->GetFloatValue("BspTree.Factor.balancedPolys", mBalancedPolysFactor);246 environment->GetFloatValue("BspTree.Factor.balancedViewCells", mBalancedViewCellsFactor);247 environment->GetFloatValue("BspTree.Termination.ct_div_ci", mCtDivCi);238 Environment::GetSingleton()->GetFloatValue("BspTree.Factor.verticalSplits", mVerticalSplitsFactor); 239 Environment::GetSingleton()->GetFloatValue("BspTree.Factor.largestPolyArea", mLargestPolyAreaFactor); 240 Environment::GetSingleton()->GetFloatValue("BspTree.Factor.blockedRays", mBlockedRaysFactor); 241 Environment::GetSingleton()->GetFloatValue("BspTree.Factor.leastRaySplits", mLeastRaySplitsFactor); 242 Environment::GetSingleton()->GetFloatValue("BspTree.Factor.balancedRays", mBalancedRaysFactor); 243 Environment::GetSingleton()->GetFloatValue("BspTree.Factor.pvs", mPvsFactor); 244 Environment::GetSingleton()->GetFloatValue("BspTree.Factor.leastSplits" , mLeastSplitsFactor); 245 Environment::GetSingleton()->GetFloatValue("BspTree.Factor.balancedPolys", mBalancedPolysFactor); 246 Environment::GetSingleton()->GetFloatValue("BspTree.Factor.balancedViewCells", mBalancedViewCellsFactor); 247 Environment::GetSingleton()->GetFloatValue("BspTree.Termination.ct_div_ci", mCtDivCi); 248 248 249 249 //-- termination criteria for axis aligned split 250 environment->GetFloatValue("BspTree.Termination.AxisAligned.ct_div_ci", mAxisAlignedCtDivCi);251 environment->GetFloatValue("BspTree.Termination.maxCostRatio", mMaxCostRatio);252 environment->GetIntValue("BspTree.Termination.AxisAligned.minPolys",250 Environment::GetSingleton()->GetFloatValue("BspTree.Termination.AxisAligned.ct_div_ci", mAxisAlignedCtDivCi); 251 Environment::GetSingleton()->GetFloatValue("BspTree.Termination.maxCostRatio", mMaxCostRatio); 252 Environment::GetSingleton()->GetIntValue("BspTree.Termination.AxisAligned.minPolys", 253 253 mTermMinPolysForAxisAligned); 254 environment->GetIntValue("BspTree.Termination.AxisAligned.minRays",254 Environment::GetSingleton()->GetIntValue("BspTree.Termination.AxisAligned.minRays", 255 255 mTermMinRaysForAxisAligned); 256 environment->GetIntValue("BspTree.Termination.AxisAligned.minObjects",256 Environment::GetSingleton()->GetIntValue("BspTree.Termination.AxisAligned.minObjects", 257 257 mTermMinObjectsForAxisAligned); 258 258 //-- partition criteria 259 environment->GetIntValue("BspTree.maxPolyCandidates", mMaxPolyCandidates);260 environment->GetIntValue("BspTree.maxRayCandidates", mMaxRayCandidates);261 environment->GetIntValue("BspTree.splitPlaneStrategy", mSplitPlaneStrategy);262 environment->GetFloatValue("BspTree.AxisAligned.splitBorder", mSplitBorder);263 environment->GetIntValue("BspTree.maxTests", mMaxTests);264 environment->GetIntValue("BspTree.Termination.maxViewCells", mMaxViewCells);265 266 environment->GetFloatValue("BspTree.Construction.epsilon", mEpsilon);259 Environment::GetSingleton()->GetIntValue("BspTree.maxPolyCandidates", mMaxPolyCandidates); 260 Environment::GetSingleton()->GetIntValue("BspTree.maxRayCandidates", mMaxRayCandidates); 261 Environment::GetSingleton()->GetIntValue("BspTree.splitPlaneStrategy", mSplitPlaneStrategy); 262 Environment::GetSingleton()->GetFloatValue("BspTree.AxisAligned.splitBorder", mSplitBorder); 263 Environment::GetSingleton()->GetIntValue("BspTree.maxTests", mMaxTests); 264 Environment::GetSingleton()->GetIntValue("BspTree.Termination.maxViewCells", mMaxViewCells); 265 266 Environment::GetSingleton()->GetFloatValue("BspTree.Construction.epsilon", mEpsilon); 267 267 268 268 char subdivisionStatsLog[100]; 269 environment->GetStringValue("BspTree.subdivisionStats", subdivisionStatsLog);269 Environment::GetSingleton()->GetStringValue("BspTree.subdivisionStats", subdivisionStatsLog); 270 270 mSubdivisionStats.open(subdivisionStatsLog); 271 271 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1002 r1004 40 40 41 41 42 ViewCellsManager::ViewCellsManager( Environment *env):42 ViewCellsManager::ViewCellsManager(): 43 43 mRenderer(NULL), 44 44 mInitialSamples(0), … … 53 53 mMaxPvsRatio(1.0), 54 54 mViewCellPvsIsUpdated(false) 55 ,mEnvironment(env)56 55 { 57 56 mViewSpaceBox.Initialize(); 58 57 ParseEnvironment(); 59 58 60 mViewCellsTree = new ViewCellsTree(this , env);59 mViewCellsTree = new ViewCellsTree(this); 61 60 } 62 61 … … 65 64 { 66 65 // visualization stuff 67 mEnvironment->GetBoolValue("ViewCells.Visualization.exportRays", mExportRays);68 mEnvironment->GetBoolValue("ViewCells.Visualization.exportGeometry", mExportGeometry);69 mEnvironment->GetFloatValue("ViewCells.maxPvsRatio", mMaxPvsRatio);70 71 mEnvironment->GetBoolValue("ViewCells.pruneEmptyViewCells", mPruneEmptyViewCells);66 Environment::GetSingleton()->GetBoolValue("ViewCells.Visualization.exportRays", mExportRays); 67 Environment::GetSingleton()->GetBoolValue("ViewCells.Visualization.exportGeometry", mExportGeometry); 68 Environment::GetSingleton()->GetFloatValue("ViewCells.maxPvsRatio", mMaxPvsRatio); 69 70 Environment::GetSingleton()->GetBoolValue("ViewCells.pruneEmptyViewCells", mPruneEmptyViewCells); 72 71 73 72 // HACK … … 77 76 mMinPvsSize = 0; 78 77 79 mEnvironment->GetBoolValue("ViewCells.processOnlyValidViewCells", mOnlyValidViewCells);80 81 mEnvironment->GetIntValue("ViewCells.Construction.samples", mConstructionSamples);82 mEnvironment->GetIntValue("ViewCells.PostProcess.samples", mPostProcessSamples);83 mEnvironment->GetBoolValue("ViewCells.PostProcess.useRaysForMerge", mUseRaysForMerge);84 85 mEnvironment->GetIntValue("ViewCells.Visualization.samples", mVisualizationSamples);86 87 mEnvironment->GetIntValue("ViewCells.Construction.samplesPerPass", mSamplesPerPass);88 mEnvironment->GetBoolValue("ViewCells.exportToFile", mExportViewCells);89 90 mEnvironment->GetIntValue("ViewCells.active", mNumActiveViewCells);91 mEnvironment->GetBoolValue("ViewCells.PostProcess.compress", mCompressViewCells);92 mEnvironment->GetBoolValue("ViewCells.Visualization.useClipPlane", mUseClipPlaneForViz);93 mEnvironment->GetBoolValue("ViewCells.PostProcess.merge", mMergeViewCells);94 mEnvironment->GetBoolValue("ViewCells.evaluateViewCells", mEvaluateViewCells);95 mEnvironment->GetBoolValue("ViewCells.showVisualization", mShowVisualization);96 mEnvironment->GetIntValue("ViewCells.Filter.maxSize", mMaxFilterSize);97 mEnvironment->GetFloatValue("ViewCells.Filter.width", mFilterWidth);98 mEnvironment->GetIntValue("ViewCells.renderCostEvaluationType", mRenderCostEvaluationType);99 100 mEnvironment->GetBoolValue("ViewCells.exportBboxesForPvs", mExportBboxesForPvs);101 mEnvironment->GetBoolValue("ViewCells.exportPvs", mExportPvs);78 Environment::GetSingleton()->GetBoolValue("ViewCells.processOnlyValidViewCells", mOnlyValidViewCells); 79 80 Environment::GetSingleton()->GetIntValue("ViewCells.Construction.samples", mConstructionSamples); 81 Environment::GetSingleton()->GetIntValue("ViewCells.PostProcess.samples", mPostProcessSamples); 82 Environment::GetSingleton()->GetBoolValue("ViewCells.PostProcess.useRaysForMerge", mUseRaysForMerge); 83 84 Environment::GetSingleton()->GetIntValue("ViewCells.Visualization.samples", mVisualizationSamples); 85 86 Environment::GetSingleton()->GetIntValue("ViewCells.Construction.samplesPerPass", mSamplesPerPass); 87 Environment::GetSingleton()->GetBoolValue("ViewCells.exportToFile", mExportViewCells); 88 89 Environment::GetSingleton()->GetIntValue("ViewCells.active", mNumActiveViewCells); 90 Environment::GetSingleton()->GetBoolValue("ViewCells.PostProcess.compress", mCompressViewCells); 91 Environment::GetSingleton()->GetBoolValue("ViewCells.Visualization.useClipPlane", mUseClipPlaneForViz); 92 Environment::GetSingleton()->GetBoolValue("ViewCells.PostProcess.merge", mMergeViewCells); 93 Environment::GetSingleton()->GetBoolValue("ViewCells.evaluateViewCells", mEvaluateViewCells); 94 Environment::GetSingleton()->GetBoolValue("ViewCells.showVisualization", mShowVisualization); 95 Environment::GetSingleton()->GetIntValue("ViewCells.Filter.maxSize", mMaxFilterSize); 96 Environment::GetSingleton()->GetFloatValue("ViewCells.Filter.width", mFilterWidth); 97 Environment::GetSingleton()->GetIntValue("ViewCells.renderCostEvaluationType", mRenderCostEvaluationType); 98 99 Environment::GetSingleton()->GetBoolValue("ViewCells.exportBboxesForPvs", mExportBboxesForPvs); 100 Environment::GetSingleton()->GetBoolValue("ViewCells.exportPvs", mExportPvs); 102 101 103 102 char buf[100]; 104 mEnvironment->GetStringValue("ViewCells.samplingType", buf);103 Environment::GetSingleton()->GetStringValue("ViewCells.samplingType", buf); 105 104 106 105 … … 119 118 } 120 119 121 mEnvironment->GetStringValue("ViewCells.Evaluation.samplingType", buf);120 Environment::GetSingleton()->GetStringValue("ViewCells.Evaluation.samplingType", buf); 122 121 123 122 if (strcmp(buf, "box") == 0) … … 135 134 } 136 135 137 mEnvironment->GetStringValue("ViewCells.renderCostEvaluationType", buf);136 Environment::GetSingleton()->GetStringValue("ViewCells.renderCostEvaluationType", buf); 138 137 139 138 if (strcmp(buf, "perobject") == 0) … … 151 150 } 152 151 153 mEnvironment->GetStringValue("ViewCells.Visualization.colorCode", buf);152 Environment::GetSingleton()->GetStringValue("ViewCells.Visualization.colorCode", buf); 154 153 155 154 if (strcmp(buf, "PVS") == 0) … … 393 392 << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 394 393 395 return 0;394 //return 0; 396 395 // take post processing time 397 396 startTime = GetTime(); … … 560 559 561 560 int histoIntervals; 562 mEnvironment->GetIntValue("Preprocessor.histogram.intervals", histoIntervals);561 Environment::GetSingleton()->GetIntValue("Preprocessor.histogram.intervals", histoIntervals); 563 562 const int intervals = min(histoIntervals, (int)viewCells.size()); 564 563 565 564 int histoMaxVal; 566 mEnvironment->GetIntValue("Preprocessor.histogram.maxValue", histoMaxVal);565 Environment::GetSingleton()->GetIntValue("Preprocessor.histogram.maxValue", histoMaxVal); 567 566 maxRenderCost = max(histoMaxVal, maxRenderCost); 568 567 … … 629 628 ViewCellsManager *ViewCellsManager::LoadViewCells(const string &filename, 630 629 ObjectContainer *objects, 631 Environment *env,632 630 const bool finalizeViewCells, 633 631 BoundingBoxConverter *bconverter) … … 638 636 ViewCellsManager *vm = NULL; 639 637 640 if (parser.ParseFile(filename, &vm, objects, bconverter , env))638 if (parser.ParseFile(filename, &vm, objects, bconverter)) 641 639 { 642 640 long startTime = GetTime(); … … 762 760 // hack: normalize pvs size 763 761 int histoMaxVal; 764 mEnvironment->GetIntValue("Preprocessor.histogram.maxValue", histoMaxVal);762 Environment::GetSingleton()->GetIntValue("Preprocessor.histogram.maxValue", histoMaxVal); 765 763 maxVal = max(histoMaxVal, maxPvs); 766 764 … … 768 766 769 767 int histoIntervals; 770 mEnvironment->GetIntValue("Preprocessor.histogram.intervals", histoIntervals);768 Environment::GetSingleton()->GetIntValue("Preprocessor.histogram.intervals", histoIntervals); 771 769 const int intervals = min(histoIntervals, (int)viewCells.size()); 772 770 … … 847 845 char s[64]; 848 846 849 mEnvironment->GetIntValue("ViewCells.Evaluation.samplesPerPass", samplesPerPass);850 mEnvironment->GetIntValue("ViewCells.Evaluation.samples", numSamples);847 Environment::GetSingleton()->GetIntValue("ViewCells.Evaluation.samplesPerPass", samplesPerPass); 848 Environment::GetSingleton()->GetIntValue("ViewCells.Evaluation.samples", numSamples); 851 849 852 850 char statsPrefix[100]; 853 mEnvironment->GetStringValue("ViewCells.Evaluation.statsPrefix", statsPrefix);851 Environment::GetSingleton()->GetStringValue("ViewCells.Evaluation.statsPrefix", statsPrefix); 854 852 855 853 Debug << "view cell evaluation samples per pass: " << samplesPerPass << endl; … … 895 893 Preprocessor::SPATIAL_BOX_BASED_DISTRIBUTION; 896 894 */ 895 long startTime = GetTime(); 896 897 897 //-- construction rays => we use uniform samples for this 898 cout << "casting " << samplesPerPass << " samples " << endl; 898 cout << "casting " << samplesPerPass << " samples ... "; 899 Debug << "casting " << samplesPerPass << " samples ... "; 900 899 901 CastPassSamples(samplesPerPass, samplingType, evaluationSamples); 900 902 901 903 castSamples += samplesPerPass; 902 904 903 cout << "computing sample contributions of " << (int)evaluationSamples.size() 904 << " samples " << endl; 905 Real timeDiff = TimeDiff(startTime, GetTime()); 906 Debug << "finished in " << timeDiff * 1e-3 << " secs" << endl; 907 cout << "finished in " << timeDiff * 1e-3 << " secs" << endl; 908 909 cout << "computing sample contributions of " << (int)evaluationSamples.size() << " samples ... "; 910 Debug << "computing sample contributions of " << (int)evaluationSamples.size() << " samples ... "; 911 912 startTime = GetTime(); 905 913 906 914 ComputeSampleContributions(evaluationSamples, true, false); 907 915 916 timeDiff = TimeDiff(startTime, GetTime()); 917 cout << "finished in " << timeDiff * 1e-3 << " secs" << endl; 918 Debug << "finished in " << timeDiff * 1e-3 << " secs" << endl; 919 920 startTime = GetTime(); 921 908 922 cout << "compute new statistics ... "; 909 923 Debug << "compute new statistics ... "; 910 924 911 925 //-- propagate pvs or pvs size information … … 913 927 UpdatePvsForEvaluation(mViewCellsTree->GetRoot(), pvs); 914 928 915 916 929 //-- output stats 917 930 sprintf(s, "-%09d-eval.log", castSamples); … … 920 933 mViewCellsTree->ExportStats(fileName); 921 934 922 cout << "finished" << endl; 935 timeDiff = TimeDiff(startTime, GetTime()); 936 cout << "finished in " << timeDiff * 1e-3 << " secs" << endl; 937 Debug << "finished in " << timeDiff * 1e-3 << " secs" << endl; 938 923 939 924 940 disposeRays(evaluationSamples, NULL); … … 931 947 int histoStepSize; 932 948 933 mEnvironment->GetBoolValue("ViewCells.Evaluation.histogram", useHisto);934 mEnvironment->GetIntValue("ViewCells.Evaluation.histoStepSize", histoStepSize);949 Environment::GetSingleton()->GetBoolValue("ViewCells.Evaluation.histogram", useHisto); 950 Environment::GetSingleton()->GetIntValue("ViewCells.Evaluation.histoStepSize", histoStepSize); 935 951 936 952 const int numLeaves = mViewCellsTree->GetNumInitialViewCells(mViewCellsTree->GetRoot()); … … 1263 1279 X3dParser parser; 1264 1280 1265 mEnvironment->GetFloatValue("ViewCells.height", parser.mViewCellHeight);1281 Environment::GetSingleton()->GetFloatValue("ViewCells.height", parser.mViewCellHeight); 1266 1282 1267 1283 bool success = parser.ParseFile(filename, *this); … … 1705 1721 float pos; 1706 1722 1707 mEnvironment->GetFloatValue("ViewCells.Visualization.clipPlanePos", pos);1723 Environment::GetSingleton()->GetFloatValue("ViewCells.Visualization.clipPlanePos", pos); 1708 1724 1709 1725 Vector3 point = mViewSpaceBox.Min() + mViewSpaceBox.Size() * pos; 1710 1726 1711 1727 if (mUseClipPlaneForViz) 1712 mEnvironment->GetIntValue("ViewCells.Visualization.clipPlaneAxis", axis);1728 Environment::GetSingleton()->GetIntValue("ViewCells.Visualization.clipPlaneAxis", axis); 1713 1729 1714 1730 Vector3 normal(0,0,0); … … 2169 2185 2170 2186 2171 BspViewCellsManager::BspViewCellsManager(BspTree *bspTree , Environment *env):2172 ViewCellsManager( env), mBspTree(bspTree)2173 { 2174 mEnvironment->GetIntValue("BspTree.Construction.samples", mInitialSamples);2187 BspViewCellsManager::BspViewCellsManager(BspTree *bspTree): 2188 ViewCellsManager(), mBspTree(bspTree) 2189 { 2190 Environment::GetSingleton()->GetIntValue("BspTree.Construction.samples", mInitialSamples); 2175 2191 mBspTree->SetViewCellsManager(this); 2176 2192 mBspTree->mViewCellsTree = mViewCellsTree; … … 2340 2356 { 2341 2357 char mstats[100]; 2342 mEnvironment->GetStringValue("ViewCells.mergeStats", mstats);2358 Environment::GetSingleton()->GetStringValue("ViewCells.mergeStats", mstats); 2343 2359 mViewCellsTree->ExportStats(mstats); 2344 2360 } … … 2424 2440 { 2425 2441 char filename[100]; 2426 mEnvironment->GetStringValue("ViewCells.filename", filename);2442 Environment::GetSingleton()->GetStringValue("ViewCells.filename", filename); 2427 2443 ExportViewCells(filename, mExportPvs, objects); 2428 2444 } … … 2432 2448 { 2433 2449 char filename[100]; 2434 mEnvironment->GetStringValue("ViewCells.boxesFilename", filename);2450 Environment::GetSingleton()->GetStringValue("ViewCells.boxesFilename", filename); 2435 2451 ExportBoundingBoxes(filename, objects); 2436 2452 } … … 2459 2475 2460 2476 int savedColorCode = mColorCode; 2461 2462 2477 2463 2478 … … 2477 2492 exporter->ExportGeometry(objects); 2478 2493 2479 //exporter->SetWireframe();2480 2494 //exporter->SetFilled(); 2481 2495 bool b = mUseClipPlaneForViz; … … 2492 2506 //-- visualization of the BSP splits 2493 2507 bool exportSplits = false; 2494 mEnvironment->GetBoolValue("BspTree.Visualization.exportSplits", exportSplits);2508 Environment::GetSingleton()->GetBoolValue("BspTree.Visualization.exportSplits", exportSplits); 2495 2509 2496 2510 if (exportSplits) … … 3034 3048 3035 3049 3036 KdViewCellsManager::KdViewCellsManager(KdTree *kdTree , Environment *env):3037 ViewCellsManager( env), mKdTree(kdTree), mKdPvsDepth(100)3050 KdViewCellsManager::KdViewCellsManager(KdTree *kdTree): 3051 ViewCellsManager(), mKdTree(kdTree), mKdPvsDepth(100) 3038 3052 { 3039 3053 } … … 3338 3352 3339 3353 3340 VspKdViewCellsManager::VspKdViewCellsManager(VspKdTree *vspKdTree , Environment *env):3341 ViewCellsManager( env), mVspKdTree(vspKdTree)3342 { 3343 mEnvironment->GetIntValue("VspKdTree.Construction.samples", mInitialSamples);3354 VspKdViewCellsManager::VspKdViewCellsManager(VspKdTree *vspKdTree): 3355 ViewCellsManager(), mVspKdTree(vspKdTree) 3356 { 3357 Environment::GetSingleton()->GetIntValue("VspKdTree.Construction.samples", mInitialSamples); 3344 3358 mVspKdTree->SetViewCellsManager(this); 3345 3359 } … … 3699 3713 3700 3714 3701 VspBspViewCellsManager::VspBspViewCellsManager(VspBspTree *vspBspTree , Environment *env):3702 ViewCellsManager( env), mVspBspTree(vspBspTree)3703 { 3704 mEnvironment->GetIntValue("VspBspTree.Construction.samples", mInitialSamples);3715 VspBspViewCellsManager::VspBspViewCellsManager(VspBspTree *vspBspTree): 3716 ViewCellsManager(), mVspBspTree(vspBspTree) 3717 { 3718 Environment::GetSingleton()->GetIntValue("VspBspTree.Construction.samples", mInitialSamples); 3705 3719 mVspBspTree->SetViewCellsManager(this); 3706 3720 mVspBspTree->mViewCellsTree = mViewCellsTree; … … 3857 3871 ObjectPvs pvs; 3858 3872 3859 mEnvironment->GetStringValue("ViewCells.mergeStats", mstats);3873 Environment::GetSingleton()->GetStringValue("ViewCells.mergeStats", mstats); 3860 3874 mViewCellsTree->ExportStats(mstats); 3861 3875 } … … 4111 4125 { 4112 4126 char filename[100]; 4113 mEnvironment->GetStringValue("ViewCells.filename", filename);4127 Environment::GetSingleton()->GetStringValue("ViewCells.filename", filename); 4114 4128 ExportViewCells(filename, mExportPvs, objects); 4115 4129 } … … 4120 4134 { 4121 4135 char filename[100]; 4122 mEnvironment->GetStringValue("ViewCells.boxesFilename", filename);4136 Environment::GetSingleton()->GetStringValue("ViewCells.boxesFilename", filename); 4123 4137 4124 4138 ExportBoundingBoxes(filename, objects); 4125 /*4126 IndexedBoundingBoxContainer boxes;4127 LoadBoundingBoxes(filename, boxes);4128 4129 IndexedBoundingBoxContainer::const_iterator it, it_end = boxes.end();4130 4131 for (it = boxes.begin(); it != it_end; ++ it)4132 {4133 IndexedBoundingBox ibox = *it;4134 AxisAlignedBox3 box = ibox.second;4135 4136 Debug << ibox.first << " "4137 << box.Min().x << " "4138 << box.Min().y << " "4139 << box.Min().z << " "4140 << box.Max().x << " "4141 << box.Max().y << " "4142 << box.Max().z << endl;4143 }*/4144 4139 } 4145 4140 … … 4330 4325 if (0) 4331 4326 { 4327 // export view space box 4332 4328 exporter->SetWireframe(); 4333 4329 exporter->ExportBox(mViewSpaceBox); … … 4421 4417 //-- visualization of the BSP splits 4422 4418 bool exportSplits = false; 4423 mEnvironment->GetBoolValue("VspBspTree.Visualization.exportSplits", exportSplits);4419 Environment::GetSingleton()->GetBoolValue("VspBspTree.Visualization.exportSplits", exportSplits); 4424 4420 4425 4421 if (exportSplits) … … 4712 4708 int numSamples; 4713 4709 4714 mEnvironment->GetIntValue("RenderSampler.samples", numSamples);4710 Environment::GetSingleton()->GetIntValue("RenderSampler.samples", numSamples); 4715 4711 cout << "samples" << numSamples << endl; 4716 4712 … … 5046 5042 int i; 5047 5043 for (i=0; it != it_end; ++ it, ++ i) { 5048 cout<<"v"<<i<<" pvs="<<(*it)->GetPvs().mEntries.size()<<endl;5044 //cout<<"v"<<i<<" pvs="<<(*it)->GetPvs().mEntries.size()<<endl; 5049 5045 pvs.Merge((*it)->GetPvs()); 5050 5046 } -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r1002 r1004 33 33 class MergeCandidate; 34 34 class BoundingBoxConverter; 35 class Environment; 35 36 36 37 37 struct BspRay; … … 72 72 enum {PER_OBJECT, PER_TRIANGLE}; 73 73 74 /** default constructor taking an environment file.75 */ 76 ViewCellsManager( Environment *env);74 /** Default constructor. 75 */ 76 ViewCellsManager(); 77 77 78 78 virtual ~ViewCellsManager(); … … 409 409 of the hierarchy. 410 410 */ 411 inlinevoid SetScalarPvsSize(ViewCell *vc, const int pvsSize) const;411 void SetScalarPvsSize(ViewCell *vc, const int pvsSize) const; 412 412 413 413 … … 433 433 @param filename the filename of the view cells 434 434 @param objects the scene objects 435 @param env an environment file containing more parameters436 435 @param finalizeViewCells if the view cells should be post processed, i.e. 437 436 a mesh is created representing the geometry … … 443 442 static ViewCellsManager *LoadViewCells(const string &filename, 444 443 ObjectContainer *objects, 445 Environment *env,446 444 const bool finalizeViewCells, 447 445 BoundingBoxConverter *bconverter = NULL); … … 571 569 bool mExportBboxesForPvs; 572 570 573 Environment *environment;571 //Environment *environment; 574 572 Plane3 mClipPlane; 575 573 … … 652 650 /// if pvs should be exported with view cells 653 651 bool mExportPvs; 654 655 /// the pointer to the environment656 Environment *mEnvironment;657 652 }; 658 653 … … 668 663 used to construct the bsp tree. 669 664 */ 670 BspViewCellsManager(BspTree *tree , Environment *env);665 BspViewCellsManager(BspTree *tree); 671 666 672 667 ~BspViewCellsManager(); … … 757 752 public: 758 753 759 KdViewCellsManager(KdTree *tree , Environment *env);754 KdViewCellsManager(KdTree *tree); 760 755 761 756 int ConstructSubdivision(const ObjectContainer &objects, … … 826 821 public: 827 822 828 VspKdViewCellsManager(VspKdTree *vspKdTree , Environment *env);823 VspKdViewCellsManager(VspKdTree *vspKdTree); 829 824 830 825 int ConstructSubdivision(const ObjectContainer &objects, … … 892 887 public: 893 888 894 VspBspViewCellsManager(VspBspTree *tree , Environment *env);889 VspBspViewCellsManager(VspBspTree *tree); 895 890 ~VspBspViewCellsManager(); 896 891 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
r975 r1004 67 67 // --------------------------------------------------------------------------- 68 68 ViewCellsParseHandlers::ViewCellsParseHandlers(ObjectContainer *objects, 69 BoundingBoxConverter *bconverter, 70 Environment *env): 69 BoundingBoxConverter *bconverter): 71 70 mElementCount(0) 72 71 , mAttrCount(0) … … 82 81 , mObjects(objects) 83 82 , mBoundingBoxConverter(bconverter) 84 , mEnvironment(env)85 83 { 86 84 } … … 622 620 //mCurrentBspNode = mBspTree->GetRoot(); 623 621 624 mViewCellsManager = new BspViewCellsManager(mBspTree , mEnvironment);622 mViewCellsManager = new BspViewCellsManager(mBspTree); 625 623 } 626 624 … … 630 628 Debug << "view cell type: VspKd" << endl; 631 629 mVspKdTree = new VspKdTree(); 632 mViewCellsManager = new VspKdViewCellsManager(mVspKdTree , mEnvironment);630 mViewCellsManager = new VspKdViewCellsManager(mVspKdTree); 633 631 } 634 632 else // vspBspTree … … 638 636 mVspBspTree = new VspBspTree(); 639 637 //mCurrentBspNode = mVspBspTree->GetRoot(); 640 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree , mEnvironment);638 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree); 641 639 642 640 mVspBspTree->mBox = mViewSpaceBox; … … 705 703 ViewCellsManager **viewCells, 706 704 ObjectContainer *objects, 707 BoundingBoxConverter *bconverter, 708 Environment *env) 705 BoundingBoxConverter *bconverter) 709 706 { 710 707 // Initialize the XML4C system … … 737 734 // to do. 738 735 // 739 ViewCellsParseHandlers handler(objects, bconverter , env);736 ViewCellsParseHandlers handler(objects, bconverter); 740 737 parser->setDocumentHandler(&handler); 741 738 parser->setErrorHandler(&handler); -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.h
r938 r1004 21 21 ViewCellsManager **viewCells, 22 22 ObjectContainer *objectsm, 23 BoundingBoxConverter *bconverter, 24 Environment *env); 23 BoundingBoxConverter *bconverter); 25 24 }; 26 25 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h
r955 r1004 29 29 // Constructors and Destructor 30 30 // ----------------------------------------------------------------------- 31 ViewCellsParseHandlers(ObjectContainer *objects, BoundingBoxConverter *bconverter , Environment *env);31 ViewCellsParseHandlers(ObjectContainer *objects, BoundingBoxConverter *bconverter); 32 32 ~ViewCellsParseHandlers(); 33 33 … … 85 85 86 86 IndexedBoundingBoxContainer mIBoundingBoxes; 87 Environment *mEnvironment; 88 87 89 88 bool mParseViewCells; 90 89 -
GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp
r1001 r1004 751 751 VssRay *ray; 752 752 753 const in dices[][2] = {{0,0}, {0,1}, {1,1}, {1,0}};753 const int indices[][2] = {{0,0}, {0,1}, {1,1}, {1,0}}; 754 754 MeshInstance dummy(mesh); 755 755 for (int i=0; i < 4; i++) -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r1002 r1004 55 55 56 56 57 VspBspTree::VspBspTree( Environment *env):57 VspBspTree::VspBspTree(): 58 58 mRoot(NULL), 59 59 mUseAreaForPvs(false), … … 67 67 { 68 68 bool randomize = false; 69 env->GetBoolValue("VspBspTree.Construction.randomize", randomize);69 Environment::GetSingleton()->GetBoolValue("VspBspTree.Construction.randomize", randomize); 70 70 if (randomize) 71 71 Randomize(); // initialise random generator for heuristics 72 72 73 73 //-- termination criteria for autopartition 74 env->GetIntValue("VspBspTree.Termination.maxDepth", mTermMaxDepth);75 env->GetIntValue("VspBspTree.Termination.minPvs", mTermMinPvs);76 env->GetIntValue("VspBspTree.Termination.minRays", mTermMinRays);77 env->GetFloatValue("VspBspTree.Termination.minProbability", mTermMinProbability);78 env->GetFloatValue("VspBspTree.Termination.maxRayContribution", mTermMaxRayContribution);79 env->GetFloatValue("VspBspTree.Termination.minAccRayLenght", mTermMinAccRayLength);80 env->GetFloatValue("VspBspTree.Termination.maxCostRatio", mTermMaxCostRatio);81 env->GetIntValue("VspBspTree.Termination.missTolerance", mTermMissTolerance);82 env->GetIntValue("VspBspTree.Termination.maxViewCells", mMaxViewCells);74 Environment::GetSingleton()->GetIntValue("VspBspTree.Termination.maxDepth", mTermMaxDepth); 75 Environment::GetSingleton()->GetIntValue("VspBspTree.Termination.minPvs", mTermMinPvs); 76 Environment::GetSingleton()->GetIntValue("VspBspTree.Termination.minRays", mTermMinRays); 77 Environment::GetSingleton()->GetFloatValue("VspBspTree.Termination.minProbability", mTermMinProbability); 78 Environment::GetSingleton()->GetFloatValue("VspBspTree.Termination.maxRayContribution", mTermMaxRayContribution); 79 Environment::GetSingleton()->GetFloatValue("VspBspTree.Termination.minAccRayLenght", mTermMinAccRayLength); 80 Environment::GetSingleton()->GetFloatValue("VspBspTree.Termination.maxCostRatio", mTermMaxCostRatio); 81 Environment::GetSingleton()->GetIntValue("VspBspTree.Termination.missTolerance", mTermMissTolerance); 82 Environment::GetSingleton()->GetIntValue("VspBspTree.Termination.maxViewCells", mMaxViewCells); 83 83 84 84 //-- max cost ratio for early tree termination 85 env->GetFloatValue("VspBspTree.Termination.maxCostRatio", mTermMaxCostRatio);86 87 env->GetFloatValue("VspBspTree.Termination.minGlobalCostRatio", mTermMinGlobalCostRatio);88 env->GetIntValue("VspBspTree.Termination.globalCostMissTolerance", mTermGlobalCostMissTolerance);85 Environment::GetSingleton()->GetFloatValue("VspBspTree.Termination.maxCostRatio", mTermMaxCostRatio); 86 87 Environment::GetSingleton()->GetFloatValue("VspBspTree.Termination.minGlobalCostRatio", mTermMinGlobalCostRatio); 88 Environment::GetSingleton()->GetIntValue("VspBspTree.Termination.globalCostMissTolerance", mTermGlobalCostMissTolerance); 89 89 90 90 // HACK//mTermMinPolygons = 25; 91 91 92 92 //-- factors for bsp tree split plane heuristics 93 env->GetFloatValue("VspBspTree.Factor.pvs", mPvsFactor);94 env->GetFloatValue("VspBspTree.Termination.ct_div_ci", mCtDivCi);93 Environment::GetSingleton()->GetFloatValue("VspBspTree.Factor.pvs", mPvsFactor); 94 Environment::GetSingleton()->GetFloatValue("VspBspTree.Termination.ct_div_ci", mCtDivCi); 95 95 96 96 97 97 //-- partition criteria 98 env->GetIntValue("VspBspTree.maxPolyCandidates", mMaxPolyCandidates);99 env->GetIntValue("VspBspTree.maxRayCandidates", mMaxRayCandidates);100 env->GetIntValue("VspBspTree.splitPlaneStrategy", mSplitPlaneStrategy);101 102 env->GetFloatValue("VspBspTree.Construction.epsilon", mEpsilon);103 env->GetIntValue("VspBspTree.maxTests", mMaxTests);98 Environment::GetSingleton()->GetIntValue("VspBspTree.maxPolyCandidates", mMaxPolyCandidates); 99 Environment::GetSingleton()->GetIntValue("VspBspTree.maxRayCandidates", mMaxRayCandidates); 100 Environment::GetSingleton()->GetIntValue("VspBspTree.splitPlaneStrategy", mSplitPlaneStrategy); 101 102 Environment::GetSingleton()->GetFloatValue("VspBspTree.Construction.epsilon", mEpsilon); 103 Environment::GetSingleton()->GetIntValue("VspBspTree.maxTests", mMaxTests); 104 104 105 105 // if only the driving axis is used for axis aligned split 106 env->GetBoolValue("VspBspTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis);106 Environment::GetSingleton()->GetBoolValue("VspBspTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis); 107 107 108 108 //-- termination criteria for axis aligned split 109 env->GetFloatValue("VspBspTree.Termination.AxisAligned.maxRayContribution",109 Environment::GetSingleton()->GetFloatValue("VspBspTree.Termination.AxisAligned.maxRayContribution", 110 110 mTermMaxRayContriForAxisAligned); 111 env->GetIntValue("VspBspTree.Termination.AxisAligned.minRays",111 Environment::GetSingleton()->GetIntValue("VspBspTree.Termination.AxisAligned.minRays", 112 112 mTermMinRaysForAxisAligned); 113 113 114 // env->GetFloatValue("VspBspTree.maxTotalMemory", mMaxTotalMemory);115 env->GetFloatValue("VspBspTree.maxStaticMemory", mMaxMemory);116 117 env->GetFloatValue("VspBspTree.Construction.renderCostWeight", mRenderCostWeight);118 env->GetBoolValue("VspBspTree.usePolygonSplitIfAvailable", mUsePolygonSplitIfAvailable);119 120 env->GetBoolValue("VspBspTree.useCostHeuristics", mUseCostHeuristics);121 env->GetBoolValue("VspBspTree.useSplitCostQueue", mUseSplitCostQueue);122 env->GetBoolValue("VspBspTree.simulateOctree", mCirculatingAxis);123 env->GetBoolValue("VspBspTree.useRandomAxis", mUseRandomAxis);124 env->GetIntValue("VspBspTree.nodePriorityQueueType", mNodePriorityQueueType);125 126 env->GetBoolValue("ViewCells.PostProcess.emptyViewCellsMerge", mEmptyViewCellsMergeAllowed);114 //Environment::GetSingleton()->GetFloatValue("VspBspTree.maxTotalMemory", mMaxTotalMemory); 115 Environment::GetSingleton()->GetFloatValue("VspBspTree.maxStaticMemory", mMaxMemory); 116 117 Environment::GetSingleton()->GetFloatValue("VspBspTree.Construction.renderCostWeight", mRenderCostWeight); 118 Environment::GetSingleton()->GetBoolValue("VspBspTree.usePolygonSplitIfAvailable", mUsePolygonSplitIfAvailable); 119 120 Environment::GetSingleton()->GetBoolValue("VspBspTree.useCostHeuristics", mUseCostHeuristics); 121 Environment::GetSingleton()->GetBoolValue("VspBspTree.useSplitCostQueue", mUseSplitCostQueue); 122 Environment::GetSingleton()->GetBoolValue("VspBspTree.simulateOctree", mCirculatingAxis); 123 Environment::GetSingleton()->GetBoolValue("VspBspTree.useRandomAxis", mUseRandomAxis); 124 Environment::GetSingleton()->GetIntValue("VspBspTree.nodePriorityQueueType", mNodePriorityQueueType); 125 126 Environment::GetSingleton()->GetBoolValue("ViewCells.PostProcess.emptyViewCellsMerge", mEmptyViewCellsMergeAllowed); 127 127 128 128 char subdivisionStatsLog[100]; 129 env->GetStringValue("VspBspTree.subdivisionStats", subdivisionStatsLog);129 Environment::GetSingleton()->GetStringValue("VspBspTree.subdivisionStats", subdivisionStatsLog); 130 130 mSubdivisionStats.open(subdivisionStatsLog); 131 131 132 env->GetFloatValue("VspBspTree.Construction.minBand", mMinBand);133 env->GetFloatValue("VspBspTree.Construction.maxBand", mMaxBand);134 env->GetBoolValue("VspBspTree.Construction.useDrivingAxisForMaxCost", mUseDrivingAxisForMaxCost);132 Environment::GetSingleton()->GetFloatValue("VspBspTree.Construction.minBand", mMinBand); 133 Environment::GetSingleton()->GetFloatValue("VspBspTree.Construction.maxBand", mMaxBand); 134 Environment::GetSingleton()->GetBoolValue("VspBspTree.Construction.useDrivingAxisForMaxCost", mUseDrivingAxisForMaxCost); 135 135 136 136 //-- debug output … … 198 198 Debug << endl; 199 199 } 200 200 /* 201 201 VspBspTree::VspBspTree(): 202 202 mRoot(NULL), … … 211 211 mEpsilon(1e-6f) 212 212 { 213 } 213 }*/ 214 214 215 215 BspViewCell *VspBspTree::GetOutOfBoundsCell() -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h
r971 r1004 28 28 class Beam; 29 29 class ViewCellsTree; 30 class Environment;30 //class Environment; 31 31 32 32 /** … … 201 201 VspBspTree(); 202 202 203 204 /** Constructor creating an empty tree. Loads parameters205 from an environment file.206 */207 VspBspTree(Environment *env);208 209 203 /** Default destructor. 210 204 */ -
GTP/trunk/Lib/Vis/Preprocessing/src/VspKdTree.cpp
r882 r1004 407 407 VspKdTree::VspKdTree(): mOnlyDrivingAxis(false) 408 408 { 409 environment->GetIntValue("VspKdTree.Termination.maxDepth", mTermMaxDepth);410 environment->GetIntValue("VspKdTree.Termination.minPvs", mTermMinPvs);411 environment->GetIntValue("VspKdTree.Termination.minRays", mTermMinRays);412 environment->GetFloatValue("VspKdTree.Termination.maxRayContribution", mTermMaxRayContribution);413 environment->GetFloatValue("VspKdTree.Termination.maxCostRatio", mTermMaxCostRatio);414 environment->GetFloatValue("VspKdTree.Termination.minSize", mTermMinSize);415 416 environment->GetIntValue("VspKdTree.Termination.missTolerance", mTermMissTolerance);409 Environment::GetSingleton()->GetIntValue("VspKdTree.Termination.maxDepth", mTermMaxDepth); 410 Environment::GetSingleton()->GetIntValue("VspKdTree.Termination.minPvs", mTermMinPvs); 411 Environment::GetSingleton()->GetIntValue("VspKdTree.Termination.minRays", mTermMinRays); 412 Environment::GetSingleton()->GetFloatValue("VspKdTree.Termination.maxRayContribution", mTermMaxRayContribution); 413 Environment::GetSingleton()->GetFloatValue("VspKdTree.Termination.maxCostRatio", mTermMaxCostRatio); 414 Environment::GetSingleton()->GetFloatValue("VspKdTree.Termination.minSize", mTermMinSize); 415 416 Environment::GetSingleton()->GetIntValue("VspKdTree.Termination.missTolerance", mTermMissTolerance); 417 417 418 418 mTermMinSize = sqr(mTermMinSize); 419 419 420 environment->GetFloatValue("VspKdTree.epsilon", mEpsilon);421 environment->GetFloatValue("VspKdTree.ct_div_ci", mCtDivCi);422 423 environment->GetFloatValue("VspKdTree.maxTotalMemory", mMaxTotalMemory);424 environment->GetFloatValue("VspKdTree.maxStaticMemory", mMaxStaticMemory);425 426 environment->GetIntValue("VspKdTree.accessTimeThreshold", mAccessTimeThreshold);427 environment->GetIntValue("VspKdTree.minCollapseDepth", mMinCollapseDepth);428 429 // environment->GetIntValue("ViewCells.maxViewCells", mMaxViewCells);430 431 environment->GetIntValue("VspKdTree.PostProcess.minViewCells", mMergeMinViewCells);432 environment->GetFloatValue("VspKdTree.PostProcess.maxCostRatio", mMergeMaxCostRatio);433 environment->GetIntValue("VspKdTree.PostProcess.maxPvsSize",420 Environment::GetSingleton()->GetFloatValue("VspKdTree.epsilon", mEpsilon); 421 Environment::GetSingleton()->GetFloatValue("VspKdTree.ct_div_ci", mCtDivCi); 422 423 Environment::GetSingleton()->GetFloatValue("VspKdTree.maxTotalMemory", mMaxTotalMemory); 424 Environment::GetSingleton()->GetFloatValue("VspKdTree.maxStaticMemory", mMaxStaticMemory); 425 426 Environment::GetSingleton()->GetIntValue("VspKdTree.accessTimeThreshold", mAccessTimeThreshold); 427 Environment::GetSingleton()->GetIntValue("VspKdTree.minCollapseDepth", mMinCollapseDepth); 428 429 //Environment::GetSingleton()->GetIntValue("ViewCells.maxViewCells", mMaxViewCells); 430 431 Environment::GetSingleton()->GetIntValue("VspKdTree.PostProcess.minViewCells", mMergeMinViewCells); 432 Environment::GetSingleton()->GetFloatValue("VspKdTree.PostProcess.maxCostRatio", mMergeMaxCostRatio); 433 Environment::GetSingleton()->GetIntValue("VspKdTree.PostProcess.maxPvsSize", 434 434 VspKdMergeCandidate::sMaxPvsSize); 435 435 436 environment->GetBoolValue("VspKdTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis);437 environment->GetIntValue("VspKdTree.Termination.maxViewCells", mMaxViewCells);436 Environment::GetSingleton()->GetBoolValue("VspKdTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis); 437 Environment::GetSingleton()->GetIntValue("VspKdTree.Termination.maxViewCells", mMaxViewCells); 438 438 439 439 //-- output … … 450 450 //-- split type 451 451 char sname[128]; 452 environment->GetStringValue("VspKdTree.splitType", sname);452 Environment::GetSingleton()->GetStringValue("VspKdTree.splitType", sname); 453 453 string name(sname); 454 454 -
GTP/trunk/Lib/Vis/Preprocessing/src/VspKdTree.h
r860 r1004 277 277 /** Returns back child. 278 278 */ 279 inlineVspKdNode *GetBack() const;279 VspKdNode *GetBack() const; 280 280 /** Returns front child. 281 281 */ 282 inlineVspKdNode *GetFront() const;282 VspKdNode *GetFront() const; 283 283 284 284 protected: -
GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp
r1002 r1004 26 26 { 27 27 // this should increase coherence of the samples 28 environment->GetIntValue("VssPreprocessor.samplesPerPass", mSamplesPerPass);29 environment->GetIntValue("VssPreprocessor.initialSamples", mInitialSamples);30 environment->GetIntValue("VssPreprocessor.vssSamples", mVssSamples);31 environment->GetIntValue("VssPreprocessor.vssSamplesPerPass", mVssSamplesPerPass);32 environment->GetBoolValue("VssPreprocessor.useImportanceSampling", mUseImportanceSampling);28 Environment::GetSingleton()->GetIntValue("VssPreprocessor.samplesPerPass", mSamplesPerPass); 29 Environment::GetSingleton()->GetIntValue("VssPreprocessor.initialSamples", mInitialSamples); 30 Environment::GetSingleton()->GetIntValue("VssPreprocessor.vssSamples", mVssSamples); 31 Environment::GetSingleton()->GetIntValue("VssPreprocessor.vssSamplesPerPass", mVssSamplesPerPass); 32 Environment::GetSingleton()->GetBoolValue("VssPreprocessor.useImportanceSampling", mUseImportanceSampling); 33 33 34 environment->GetBoolValue("VssPreprocessor.loadInitialSamples", mLoadInitialSamples);35 environment->GetBoolValue("VssPreprocessor.storeInitialSamples", mStoreInitialSamples);36 environment->GetBoolValue("VssPreprocessor.useViewSpaceBox", mUseViewSpaceBox);37 environment->GetBoolValue("VssPreprocessor.testBeamSampling", mTestBeamSampling);38 environment->GetBoolValue("VssPreprocessor.enlargeViewSpace", mEnlargeViewSpace);39 environment->GetBoolValue("Preprocessor.detectEmptyViewSpace", mDetectEmptyViewSpace);34 Environment::GetSingleton()->GetBoolValue("VssPreprocessor.loadInitialSamples", mLoadInitialSamples); 35 Environment::GetSingleton()->GetBoolValue("VssPreprocessor.storeInitialSamples", mStoreInitialSamples); 36 Environment::GetSingleton()->GetBoolValue("VssPreprocessor.useViewSpaceBox", mUseViewSpaceBox); 37 Environment::GetSingleton()->GetBoolValue("VssPreprocessor.testBeamSampling", mTestBeamSampling); 38 Environment::GetSingleton()->GetBoolValue("VssPreprocessor.enlargeViewSpace", mEnlargeViewSpace); 39 Environment::GetSingleton()->GetBoolValue("Preprocessor.detectEmptyViewSpace", mDetectEmptyViewSpace); 40 40 41 41 useViewspacePlane = mUseViewSpaceBox; //hack -
GTP/trunk/Lib/Vis/Preprocessing/src/VssTree.cpp
r863 r1004 67 67 VssTree::VssTree() 68 68 { 69 environment->GetIntValue("VssTree.maxDepth", termMaxDepth);70 environment->GetIntValue("VssTree.minPvs", termMinPvs);71 environment->GetIntValue("VssTree.minRays", termMinRays);72 environment->GetFloatValue("VssTree.maxRayContribution", termMaxRayContribution);73 environment->GetFloatValue("VssTree.maxCostRatio", termMaxCostRatio);74 75 environment->GetFloatValue("VssTree.minSize", termMinSize);69 Environment::GetSingleton()->GetIntValue("VssTree.maxDepth", termMaxDepth); 70 Environment::GetSingleton()->GetIntValue("VssTree.minPvs", termMinPvs); 71 Environment::GetSingleton()->GetIntValue("VssTree.minRays", termMinRays); 72 Environment::GetSingleton()->GetFloatValue("VssTree.maxRayContribution", termMaxRayContribution); 73 Environment::GetSingleton()->GetFloatValue("VssTree.maxCostRatio", termMaxCostRatio); 74 75 Environment::GetSingleton()->GetFloatValue("VssTree.minSize", termMinSize); 76 76 termMinSize = sqr(termMinSize); 77 77 78 environment->GetFloatValue("VssTree.refDirBoxMaxSize", refDirBoxMaxSize);78 Environment::GetSingleton()->GetFloatValue("VssTree.refDirBoxMaxSize", refDirBoxMaxSize); 79 79 refDirBoxMaxSize = sqr(refDirBoxMaxSize); 80 80 81 environment->GetFloatValue("VssTree.epsilon", epsilon);82 environment->GetFloatValue("VssTree.ct_div_ci", ct_div_ci);83 84 environment->GetFloatValue("VssTree.maxTotalMemory", maxTotalMemory);85 environment->GetFloatValue("VssTree.maxStaticMemory", maxStaticMemory);81 Environment::GetSingleton()->GetFloatValue("VssTree.epsilon", epsilon); 82 Environment::GetSingleton()->GetFloatValue("VssTree.ct_div_ci", ct_div_ci); 83 84 Environment::GetSingleton()->GetFloatValue("VssTree.maxTotalMemory", maxTotalMemory); 85 Environment::GetSingleton()->GetFloatValue("VssTree.maxStaticMemory", maxStaticMemory); 86 86 87 87 … … 89 89 90 90 float refDirAngle; 91 environment->GetFloatValue("VssTree.refDirAngle", refDirAngle);92 93 environment->GetIntValue("VssTree.accessTimeThreshold", accessTimeThreshold);91 Environment::GetSingleton()->GetFloatValue("VssTree.refDirAngle", refDirAngle); 92 93 Environment::GetSingleton()->GetIntValue("VssTree.accessTimeThreshold", accessTimeThreshold); 94 94 //= 1000; 95 environment->GetIntValue("VssTree.minCollapseDepth", minCollapseDepth);95 Environment::GetSingleton()->GetIntValue("VssTree.minCollapseDepth", minCollapseDepth); 96 96 // int minCollapseDepth = 4; 97 97 … … 103 103 // split type 104 104 char sname[128]; 105 environment->GetStringValue("VssTree.splitType", sname);105 Environment::GetSingleton()->GetStringValue("VssTree.splitType", sname); 106 106 string name(sname); 107 107 … … 119 119 } 120 120 121 environment->GetBoolValue("VssTree.randomize", randomize);122 environment->GetBoolValue("VssTree.splitUseOnlyDrivingAxis", mSplitUseOnlyDrivingAxis);123 environment->GetBoolValue("VssTree.useRss", mUseRss);124 125 environment->GetBoolValue("VssTree.interleaveDirSplits", mInterleaveDirSplits);126 environment->GetIntValue("VssTree.dirSplitDepth", mDirSplitDepth);121 Environment::GetSingleton()->GetBoolValue("VssTree.randomize", randomize); 122 Environment::GetSingleton()->GetBoolValue("VssTree.splitUseOnlyDrivingAxis", mSplitUseOnlyDrivingAxis); 123 Environment::GetSingleton()->GetBoolValue("VssTree.useRss", mUseRss); 124 125 Environment::GetSingleton()->GetBoolValue("VssTree.interleaveDirSplits", mInterleaveDirSplits); 126 Environment::GetSingleton()->GetIntValue("VssTree.dirSplitDepth", mDirSplitDepth); 127 127 128 128 root = NULL; -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.cpp
r1001 r1004 737 737 VssRay *ray; 738 738 739 const in dices[][2] = {{0,0}, {0,1}, {1,1}, {1,0}};739 const int indices[][2] = {{0,0}, {0,1}, {1,1}, {1,0}}; 740 740 MeshInstance dummy(mesh); 741 741 for (int i=0; i < 4; i++) { -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp
r1002 r1004 175 175 Vector3 transl; 176 176 177 if (sscanf(ptr, "%f %f %f %f", &transl.x, &transl.y, &transl.z) == 3)177 if (sscanf(ptr, "%f %f %f", &transl.x, &transl.y, &transl.z) == 3) 178 178 { 179 179 translm = new Matrix4x4(TranslationMatrix(transl)); … … 184 184 Vector3 scale; 185 185 186 if (sscanf(ptr, "%f %f %f %f", &scale.x, &scale.y, &scale.z) == 3)186 if (sscanf(ptr, "%f %f %f", &scale.x, &scale.y, &scale.z) == 3) 187 187 { 188 188 scalem = new Matrix4x4(ScaleMatrix(scale.x, scale.y, scale.z)); -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r1002 r1004 40 40 41 41 Debug.open("debug.log"); 42 environment = new Environment; 43 44 environment->Parse(argc, argv, USE_EXE_PATH); 42 43 Environment::GetSingleton()->Parse(argc, argv, USE_EXE_PATH); 45 44 MeshKdTree::ParseEnvironment(); 46 45 47 46 char buff[128]; 48 environment->GetStringValue("Preprocessor.type", buff);47 Environment::GetSingleton()->GetStringValue("Preprocessor.type", buff); 49 48 string preprocessorType(buff); 50 49 … … 81 80 } 82 81 else { 83 DEL_PTR(environment);82 Environment::DelSingleton(); 84 83 cerr<<"Unknown preprocessor type"<<endl; 85 84 Debug<<"Unknown preprocessor type"<<endl; … … 109 108 preprocessor = p; 110 109 111 environment->GetStringValue("Scene.filename", buff);110 Environment::GetSingleton()->GetStringValue("Scene.filename", buff); 112 111 string filename(buff); 113 112 p->LoadScene(filename); … … 166 165 //-- clean up 167 166 DEL_PTR(p); 168 DEL_PTR(environment);167 Environment::DelSingleton(); 169 168 170 169 MeshManager::DelSingleton(); -
GTP/trunk/Lib/Vis/shared/scripts/GtpVisibility.sln
r902 r1004 1 1 Microsoft Visual Studio Solution File, Format Version 8.00 2 Project("{ 8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Preprocessor", "..\..\Preprocessing\scripts\Preprocessor.vcproj", "{EABCE292-D598-4600-A1C9-2591E7D62FDA}"2 Project("{EAF909A5-FA59-4C3D-9431-0FCC20D5BCF9}") = "Preprocessor", "..\..\Preprocessing\scripts\Preprocessor.icproj", "{1C63E944-5E2E-447C-AE75-F1BF14641C98}" 3 3 ProjectSection(ProjectDependencies) = postProject 4 4 EndProjectSection 5 5 EndProject 6 Project("{ 8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GtpVisibility", "..\..\OnlineCullingCHC\scripts\GtpVisibility.vcproj", "{101A7691-74F3-48B4-96A3-CF35578F5900}"6 Project("{EAF909A5-FA59-4C3D-9431-0FCC20D5BCF9}") = "GtpVisibility", "..\..\OnlineCullingCHC\scripts\GtpVisibility.icproj", "{C1910FAC-39EA-49F1-B93C-517E15D1C250}" 7 7 ProjectSection(ProjectDependencies) = postProject 8 { EABCE292-D598-4600-A1C9-2591E7D62FDA} = {EABCE292-D598-4600-A1C9-2591E7D62FDA}8 {1C63E944-5E2E-447C-AE75-F1BF14641C98} = {1C63E944-5E2E-447C-AE75-F1BF14641C98} 9 9 EndProjectSection 10 10 EndProject 11 Project("{ 8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCullingTerrain", "..\..\..\..\App\Demos\Vis\HillyTerrain\OGRE\TestCullingTerrain.vcproj", "{248F19A6-2FE0-4F5D-8928-E0EA10609887}"11 Project("{EAF909A5-FA59-4C3D-9431-0FCC20D5BCF9}") = "TestCullingTerrain", "..\..\..\..\App\Demos\Vis\HillyTerrain\OGRE\TestCullingTerrain.icproj", "{D26A9780-4457-473C-A391-BBEB7758E2D0}" 12 12 ProjectSection(ProjectDependencies) = postProject 13 { 80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}14 { 101A7691-74F3-48B4-96A3-CF35578F5900} = {101A7691-74F3-48B4-96A3-CF35578F5900}15 {7 319E499-473D-4CE5-9983-725D6E68A55D} = {7319E499-473D-4CE5-9983-725D6E68A55D}13 {4FC8EE48-701E-474E-88CB-FFD17E8A778B} = {4FC8EE48-701E-474E-88CB-FFD17E8A778B} 14 {C1910FAC-39EA-49F1-B93C-517E15D1C250} = {C1910FAC-39EA-49F1-B93C-517E15D1C250} 15 {7499CFDA-3C7F-4660-B1D3-8A41EA2EBFA3} = {7499CFDA-3C7F-4660-B1D3-8A41EA2EBFA3} 16 16 EndProjectSection 17 17 EndProject 18 Project("{ 8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_VisibilitySceneManager", "..\..\OnlineCullingCHC\OGRE\scripts\Plugin_VisibilitySceneManager.vcproj", "{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}"18 Project("{EAF909A5-FA59-4C3D-9431-0FCC20D5BCF9}") = "Plugin_VisibilitySceneManager", "..\..\OnlineCullingCHC\OGRE\scripts\Plugin_VisibilitySceneManager.icproj", "{4FC8EE48-701E-474E-88CB-FFD17E8A778B}" 19 19 ProjectSection(ProjectDependencies) = postProject 20 { 101A7691-74F3-48B4-96A3-CF35578F5900} = {101A7691-74F3-48B4-96A3-CF35578F5900}20 {C1910FAC-39EA-49F1-B93C-517E15D1C250} = {C1910FAC-39EA-49F1-B93C-517E15D1C250} 21 21 EndProjectSection 22 22 EndProject 23 Project("{ 8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EvalStats", "..\EvalStats\EvalStats.vcproj", "{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}"23 Project("{EAF909A5-FA59-4C3D-9431-0FCC20D5BCF9}") = "EvalStats", "..\EvalStats\EvalStats.icproj", "{A83C475F-BE2B-452B-B702-97C8F125D31D}" 24 24 ProjectSection(ProjectDependencies) = postProject 25 25 EndProjectSection 26 26 EndProject 27 Project("{ 8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestPreprocessor", "..\..\Preprocessing\scripts\TestPreprocessor.vcproj", "{69BC58F0-C7EB-4B43-B782-B6F047EF0528}"27 Project("{EAF909A5-FA59-4C3D-9431-0FCC20D5BCF9}") = "TestPreprocessor", "..\..\Preprocessing\scripts\TestPreprocessor.icproj", "{6DB3C2CD-BBE6-463D-A9D3-92240C71ED22}" 28 28 ProjectSection(ProjectDependencies) = postProject 29 { EABCE292-D598-4600-A1C9-2591E7D62FDA} = {EABCE292-D598-4600-A1C9-2591E7D62FDA}29 {1C63E944-5E2E-447C-AE75-F1BF14641C98} = {1C63E944-5E2E-447C-AE75-F1BF14641C98} 30 30 EndProjectSection 31 31 EndProject 32 Project("{ 8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IVReader", "..\..\OnlineCullingCHC\IVReader\scripts\IVReader.vcproj", "{7319E499-473D-4CE5-9983-725D6E68A55D}"32 Project("{EAF909A5-FA59-4C3D-9431-0FCC20D5BCF9}") = "IVReader", "..\..\OnlineCullingCHC\IVReader\scripts\IVReader.icproj", "{7499CFDA-3C7F-4660-B1D3-8A41EA2EBFA3}" 33 33 ProjectSection(ProjectDependencies) = postProject 34 34 EndProjectSection … … 40 40 EndGlobalSection 41 41 GlobalSection(ProjectConfiguration) = postSolution 42 {1C63E944-5E2E-447C-AE75-F1BF14641C98}.Debug.ActiveCfg = Debug|Win32 43 {1C63E944-5E2E-447C-AE75-F1BF14641C98}.Debug.Build.0 = Debug|Win32 44 {1C63E944-5E2E-447C-AE75-F1BF14641C98}.Release.ActiveCfg = Release|Win32 45 {1C63E944-5E2E-447C-AE75-F1BF14641C98}.Release.Build.0 = Release|Win32 46 {C1910FAC-39EA-49F1-B93C-517E15D1C250}.Debug.ActiveCfg = Debug|Win32 47 {C1910FAC-39EA-49F1-B93C-517E15D1C250}.Debug.Build.0 = Debug|Win32 48 {C1910FAC-39EA-49F1-B93C-517E15D1C250}.Release.ActiveCfg = Release|Win32 49 {C1910FAC-39EA-49F1-B93C-517E15D1C250}.Release.Build.0 = Release|Win32 50 {D26A9780-4457-473C-A391-BBEB7758E2D0}.Debug.ActiveCfg = Debug|Win32 51 {D26A9780-4457-473C-A391-BBEB7758E2D0}.Debug.Build.0 = Debug|Win32 52 {D26A9780-4457-473C-A391-BBEB7758E2D0}.Release.ActiveCfg = Release|Win32 53 {D26A9780-4457-473C-A391-BBEB7758E2D0}.Release.Build.0 = Release|Win32 54 {4FC8EE48-701E-474E-88CB-FFD17E8A778B}.Debug.ActiveCfg = Debug|Win32 55 {4FC8EE48-701E-474E-88CB-FFD17E8A778B}.Debug.Build.0 = Debug|Win32 56 {4FC8EE48-701E-474E-88CB-FFD17E8A778B}.Release.ActiveCfg = Release|Win32 57 {4FC8EE48-701E-474E-88CB-FFD17E8A778B}.Release.Build.0 = Release|Win32 58 {A83C475F-BE2B-452B-B702-97C8F125D31D}.Debug.ActiveCfg = Debug|Win32 59 {A83C475F-BE2B-452B-B702-97C8F125D31D}.Debug.Build.0 = Debug|Win32 60 {A83C475F-BE2B-452B-B702-97C8F125D31D}.Release.ActiveCfg = Release|Win32 61 {A83C475F-BE2B-452B-B702-97C8F125D31D}.Release.Build.0 = Release|Win32 62 {6DB3C2CD-BBE6-463D-A9D3-92240C71ED22}.Debug.ActiveCfg = Debug|Win32 63 {6DB3C2CD-BBE6-463D-A9D3-92240C71ED22}.Debug.Build.0 = Debug|Win32 64 {6DB3C2CD-BBE6-463D-A9D3-92240C71ED22}.Release.ActiveCfg = Release|Win32 65 {6DB3C2CD-BBE6-463D-A9D3-92240C71ED22}.Release.Build.0 = Release|Win32 66 {7499CFDA-3C7F-4660-B1D3-8A41EA2EBFA3}.Debug.ActiveCfg = Debug|Win32 67 {7499CFDA-3C7F-4660-B1D3-8A41EA2EBFA3}.Debug.Build.0 = Debug|Win32 68 {7499CFDA-3C7F-4660-B1D3-8A41EA2EBFA3}.Release.ActiveCfg = Release|Win32 69 {7499CFDA-3C7F-4660-B1D3-8A41EA2EBFA3}.Release.Build.0 = Release|Win32 70 {EABCE292-D598-4600-A1C9-2591E7D62FDA}.Release.Build.0 = Release|Win32 71 {EABCE292-D598-4600-A1C9-2591E7D62FDA}.Release.ActiveCfg = Release|Win32 72 {EABCE292-D598-4600-A1C9-2591E7D62FDA}.Debug.Build.0 = Debug|Win32 42 73 {EABCE292-D598-4600-A1C9-2591E7D62FDA}.Debug.ActiveCfg = Debug|Win32 43 { EABCE292-D598-4600-A1C9-2591E7D62FDA}.Debug.Build.0 = Debug|Win3244 { EABCE292-D598-4600-A1C9-2591E7D62FDA}.Release.ActiveCfg = Release|Win3245 { EABCE292-D598-4600-A1C9-2591E7D62FDA}.Release.Build.0 = Release|Win3274 {101A7691-74F3-48B4-96A3-CF35578F5900}.Release.Build.0 = Release|Win32 75 {101A7691-74F3-48B4-96A3-CF35578F5900}.Release.ActiveCfg = Release|Win32 76 {101A7691-74F3-48B4-96A3-CF35578F5900}.Debug.Build.0 = Debug|Win32 46 77 {101A7691-74F3-48B4-96A3-CF35578F5900}.Debug.ActiveCfg = Debug|Win32 47 { 101A7691-74F3-48B4-96A3-CF35578F5900}.Debug.Build.0 = Debug|Win3248 { 101A7691-74F3-48B4-96A3-CF35578F5900}.Release.ActiveCfg = Release|Win3249 { 101A7691-74F3-48B4-96A3-CF35578F5900}.Release.Build.0 = Release|Win3278 {248F19A6-2FE0-4F5D-8928-E0EA10609887}.Release.Build.0 = Release|Win32 79 {248F19A6-2FE0-4F5D-8928-E0EA10609887}.Release.ActiveCfg = Release|Win32 80 {248F19A6-2FE0-4F5D-8928-E0EA10609887}.Debug.Build.0 = Debug|Win32 50 81 {248F19A6-2FE0-4F5D-8928-E0EA10609887}.Debug.ActiveCfg = Debug|Win32 51 { 248F19A6-2FE0-4F5D-8928-E0EA10609887}.Debug.Build.0 = Debug|Win3252 { 248F19A6-2FE0-4F5D-8928-E0EA10609887}.Release.ActiveCfg = Release|Win3253 { 248F19A6-2FE0-4F5D-8928-E0EA10609887}.Release.Build.0 = Release|Win3282 {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release.Build.0 = Release|Win32 83 {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release.ActiveCfg = Release|Win32 84 {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Debug.Build.0 = Debug|Win32 54 85 {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Debug.ActiveCfg = Debug|Win32 55 { 80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Debug.Build.0 = Debug|Win3256 { 80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release.ActiveCfg = Release|Win3257 { 80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release.Build.0 = Release|Win3286 {935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Release.Build.0 = Release|Win32 87 {935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Release.ActiveCfg = Release|Win32 88 {935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Debug.Build.0 = Debug|Win32 58 89 {935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Debug.ActiveCfg = Debug|Win32 59 { 935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Debug.Build.0 = Debug|Win3260 { 935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Release.ActiveCfg = Release|Win3261 { 935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Release.Build.0 = Release|Win3290 {69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Release.Build.0 = Release|Win32 91 {69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Release.ActiveCfg = Release|Win32 92 {69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Debug.Build.0 = Debug|Win32 62 93 {69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Debug.ActiveCfg = Debug|Win32 63 { 69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Debug.Build.0 = Debug|Win3264 { 69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Release.ActiveCfg = Release|Win3265 { 69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Release.Build.0 = Release|Win3294 {7319E499-473D-4CE5-9983-725D6E68A55D}.Release.Build.0 = Release|Win32 95 {7319E499-473D-4CE5-9983-725D6E68A55D}.Release.ActiveCfg = Release|Win32 96 {7319E499-473D-4CE5-9983-725D6E68A55D}.Debug.Build.0 = Debug|Win32 66 97 {7319E499-473D-4CE5-9983-725D6E68A55D}.Debug.ActiveCfg = Debug|Win32 67 {7319E499-473D-4CE5-9983-725D6E68A55D}.Debug.Build.0 = Debug|Win3268 {7319E499-473D-4CE5-9983-725D6E68A55D}.Release.ActiveCfg = Release|Win3269 {7319E499-473D-4CE5-9983-725D6E68A55D}.Release.Build.0 = Release|Win3270 98 EndGlobalSection 71 99 GlobalSection(ExtensibilityGlobals) = postSolution
Note: See TracChangeset
for help on using the changeset viewer.