Changeset 2621 for GTP/trunk/Lib/Vis
- Timestamp:
- 01/21/08 20:38:41 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/demo1.env
r2615 r2621 170 170 171 171 KdTree { 172 pvsArea 8e- 5172 pvsArea 8e-4 173 173 sahUseFaces false 174 174 Termination { -
GTP/trunk/Lib/Vis/Preprocessing/src/HavranRayCaster.cpp
r2603 r2621 516 516 517 517 518 /* 519 virtual void HavranRayCaster::AddDynamicObjecs(const ObjectContainer &objects, const Matrix4x4 &m); 520 virtual void UpdateDynamicObjects(const Matrix4x4 &m); 521 virtual void DeleteDynamicObjects); 522 */ 518 523 } // the namespace -
GTP/trunk/Lib/Vis/Preprocessing/src/HavranRayCaster.h
r2602 r2621 37 37 38 38 int Type() const { return HAVRAN_RAYCASTER; } 39 39 40 virtual void AddDynamicObjecs(const ObjectContainer &objects, const Matrix4x4 &m); 41 virtual void UpdateDynamicObjects(const Matrix4x4 &m); 42 virtual void DeleteDynamicObjects); 43 40 44 virtual int CastRay( 41 45 const SimpleRay &simpleRay, -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2615 r2621 173 173 bool Preprocessor::LoadBinaryObj(const string &filename, 174 174 SceneGraphLeaf *root, 175 vector<FaceParentInfo> *parents) 175 vector<FaceParentInfo> *parents, 176 float scale) 176 177 { 177 178 //ifstream inStream(filename, ios::binary); … … 202 203 inStream.read(reinterpret_cast<char *>(tri.mVertices + 1), sizeof(Vector3)); 203 204 inStream.read(reinterpret_cast<char *>(tri.mVertices + 2), sizeof(Vector3)); 205 206 if (scale > 0.0f) 207 { 208 tri.mVertices[0] *= scale; 209 tri.mVertices[1] *= scale; 210 tri.mVertices[2] *= scale; 211 } 204 212 205 213 // end of file reached … … 1227 1235 1228 1236 float maxT, minT; 1229 // test with bounding box 1237 1238 // test with bounding box 1230 1239 if (tmi->GetBox().GetMinMaxT(hRay, &minT, &maxT)) 1231 1240 { … … 1700 1709 SceneGraphLeaf *leaf = new SceneGraphLeaf(dynamic); 1701 1710 1702 if (LoadBinaryObj(filename, leaf, NULL ))1711 if (LoadBinaryObj(filename, leaf, NULL, 100)) 1703 1712 { 1704 1713 mDynamicObjects.push_back(leaf); 1714 leaf->RebuildKtbTree(); 1705 1715 mSceneGraph->GetRoot()->mChildren.push_back(leaf); 1706 return true 1716 return true; 1707 1717 } 1708 1718 -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
r2615 r2621 275 275 bool LoadBinaryObj(const std::string &filename, 276 276 SceneGraphLeaf *root, 277 std::vector<FaceParentInfo> *parents); 277 std::vector<FaceParentInfo> *parents, 278 float scale = -1.0f); 278 279 279 280 bool ExportBinaryObj(const std::string &filename, SceneGraphLeaf *root); -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
r2598 r2621 777 777 </File> 778 778 <File 779 RelativePath=".\SimpleRay.h"> 780 </File> 781 <File 779 782 RelativePath="..\src\Statistics.h"> 780 783 </File> … … 1071 1074 </File> 1072 1075 <File 1076 RelativePath=".\sparsehash\src\windows\hash_fun.h"> 1077 </File> 1078 <File 1073 1079 RelativePath=".\sparsehash\src\google\sparsehash\hash_fun.h"> 1074 </File>1075 <File1076 RelativePath=".\sparsehash\src\windows\hash_fun.h">1077 1080 </File> 1078 1081 <File -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2620 r2621 423 423 RenderIntersectable(*dit); 424 424 #else 425 RenderDynamicObject(*dit);425 _RenderDynamicObject(*dit); 426 426 #endif 427 427 } … … 679 679 { 680 680 Matrix4x4 tm; 681 TransformedMeshInstance *tmi;682 #if USE_TRANSFORMED_MESH_INSTANCE_HACK683 681 684 682 switch (mTrafoType) … … 687 685 { 688 686 const Vector3 transl(diffx, 0, diffy); 689 tmi = mViewCellsManager->GetPreprocessor()->mDynamicObjects[mCurrentDynamicObjectIdx];687 690 688 tm = TranslationMatrix(transl); 691 689 } … … 696 694 if (scalef < 0.9) scalef = 0.9f; 697 695 else if (scalef > 1.1f) scalef = 1.1f; 698 tmi = mViewCellsManager->GetPreprocessor()->mDynamicObjects[mCurrentDynamicObjectIdx];699 696 tm = ScaleMatrix(scalef, scalef, scalef); 700 697 } … … 702 699 case 2: 703 700 { 704 tmi = mViewCellsManager->GetPreprocessor()->mDynamicObjects[mCurrentDynamicObjectIdx];705 701 tm = RotationXMatrix(diffx) * RotationYMatrix(diffy); 706 702 } … … 710 706 } 711 707 708 #if USE_TRANSFORMED_MESH_INSTANCE_HACK 709 TransformedMeshInstance *tmi = mViewCellsManager->GetPreprocessor()->mDynamicObjects[mCurrentDynamicObjectIdx]; 712 710 tmi->ApplyWorldTransform(tm); 711 #else 712 SceneGraphLeaf *l = mViewCellsManager->GetPreprocessor()->mDynamicObjects[mCurrentDynamicObjectIdx]; 713 l->ApplyTransform(tm); 713 714 #endif 714 715 updateGL(); … … 1457 1458 ComputeMaxValues(viewcells, maxPvs, maxPiercingRays, maxRelativeRays, maxRcCost); 1458 1459 // matt: temp hack 1459 //maxRcCost = 200.0f;1460 maxRcCost = 200.0f; 1460 1461 //cout << "maxRcCost: " << maxRcCost << endl; 1461 1462 int i; … … 2119 2120 vbox->layout()->addWidget(button); 2120 2121 connect(button, SIGNAL(clicked()), SIGNAL(StoreStatistics())); 2122 #endif 2123 2124 #if DYNAMIC_OBJECTS_HACK 2121 2125 2122 2126 button = new QPushButton("Load object", vbox); … … 2124 2128 connect(button, SIGNAL(clicked()), SIGNAL(LoadObject())); 2125 2129 #endif 2130 2126 2131 /*cb = new QCheckBox("Stats", vbox); 2127 2132 vbox->layout()->addWidget(cb); -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
r2620 r2621 15 15 #include "LogReader.h" 16 16 #include "Material.h" 17 17 #include "common.h" 18 18 19 19 -
GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h
r2583 r2621 25 25 struct SimpleRay; 26 26 class RayPacket2x2; 27 class Matrix4x4; 27 28 28 29 /** This class provides an interface for ray casting. … … 104 105 105 106 107 virtual void AddDynamicObjecs(const ObjectContainer &objects, const Matrix4x4 &m) = 0; 108 virtual void UpdateDynamicObjects(const Matrix4x4 &m) = 0; 109 virtual void DeleteDynamicObjects() = 0; 110 106 111 // pool of vss rays to be used in one pass of the sampling 107 112 struct VssRayPool -
GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp
r2615 r2621 6 6 #include "Intersectable.h" 7 7 #include "IntersectableWrapper.h" 8 #include "ktball.h" 8 9 9 10 … … 234 235 void SceneGraph::ExportScene(const string filename) 235 236 { 236 237 237 } 238 238 … … 279 279 280 280 SceneGraphLeaf::SceneGraphLeaf(): mIsDynamic(false) 281 #if DYNAMIC_OBJECTS_HACK 282 , mKtbTree(NULL) 283 #endif 281 284 { 282 285 mTrafo = IdentityMatrix(); 286 283 287 #if DYNAMIC_OBJECTS_HACK 284 288 mIntersectable = new SceneGraphLeafIntersectable(this, mBox); … … 288 292 289 293 SceneGraphLeaf::SceneGraphLeaf(bool isDynamic): mIsDynamic(isDynamic) 290 { 291 mTrafo = IdentityMatrix(); 294 #if DYNAMIC_OBJECTS_HACK 295 , mKtbTree(NULL) 296 #endif 297 { 298 mTrafo = IdentityMatrix(); 292 299 } 293 300 … … 316 323 } 317 324 318 } 325 326 #if DYNAMIC_OBJECTS_HACK 327 328 329 void SceneGraphLeaf::RebuildKtbTree() 330 { 331 if (mKtbTree) 332 delete mKtbTree; 333 334 mKtbTree = new CKTB(); 335 mKtbTree->BuildUp(mGeometry); 336 } 337 338 #endif 339 340 341 } -
GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h
r2615 r2621 10 10 11 11 class SceneGraphLeafIntersectable; 12 class CKTB; 13 12 14 13 15 /** Basic scene graph node, we are interested only in bounding boxes and topology … … 68 70 virtual bool IsLeaf() const { return true; } 69 71 virtual void UpdateBox(); 70 #if DYNAMIC_OBJECT_HACK 71 SceneGraphLeafIntersectable *GetIntersectable() { return mIntersectable;} 72 73 #if DYNAMIC_OBJECTS_HACK 74 void RebuildKtbTree(); 75 SceneGraphLeafIntersectable *GetIntersectable() { return mIntersectable; } 72 76 #endif 77 73 78 /// used as actual pvs entry 74 79 ObjectContainer mGeometry; 75 80 76 81 protected: 77 #if DYNAMIC_OBJECT_HACK 82 83 #if DYNAMIC_OBJECTS_HACK 84 78 85 SceneGraphLeafIntersectable *mIntersectable; 86 CKTB *mKtbTree; 87 79 88 #endif 89 80 90 bool mIsDynamic; 81 91 Matrix4x4 mTrafo; -
GTP/trunk/Lib/Vis/Preprocessing/src/common.h
r2615 r2621 23 23 #include <vector> 24 24 25 #define DYNAMIC_OBJECTS_HACK 026 #define USE_TRANSFORMED_MESH_INSTANCE_HACK 125 #define DYNAMIC_OBJECTS_HACK 1 26 #define USE_TRANSFORMED_MESH_INSTANCE_HACK 0 27 27 #define USE_HAVRAN_RAYCASTER 28 28
Note: See TracChangeset
for help on using the changeset viewer.