- Timestamp:
- 05/21/08 18:44:16 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_vienna
r2692 r2694 8 8 9 9 10 #SCENE=../data/vienna/vienna_cropped.obj11 SCENE=../data/vienna/city_full.obj10 SCENE=../data/vienna/vienna_cropped.obj 11 #SCENE=../data/vienna/city_full.obj 12 12 13 13 VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz 14 14 #VIEWCELLS=../data/vienna/vienna_cropped-seq-3000-false-20-viewcells.xml.gz 15 15 #VIEWCELLS=../data/vienna/vienna_cropped-57000-viewcells.xml.gz 16 VIEWPOINTS=../data/vienna/ change.vp16 VIEWPOINTS=../data/vienna/testwalk.vp 17 17 18 18 -
GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vps.sh
r2691 r2694 11 11 echo "starting $TARGET version" 12 12 13 #SCENE=../data/vienna/vienna_cropped.obj14 SCENE=../data/vienna/city_full.obj13 SCENE=../data/vienna/vienna_cropped.obj 14 #SCENE=../data/vienna/city_full.obj 15 15 16 16 VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz 17 17 VIEWPOINTS=../data/vienna/testwalk.vp 18 18 19 LOG_PREFIX=../src/SG08/try 19 LOG_PREFIX=../src/SG08/try_100_real 20 20 #LOG_PREFIX=../src/SG08/city_full_100 21 21 … … 35 35 -gvs_samples_per_pass=1000000 \ 36 36 -gvs_initial_samples=16 \ 37 -gvs_max_viewcells= 1\38 -gvs_min_contribution= 3000 \37 -gvs_max_viewcells=20 \ 38 -gvs_min_contribution=100 \ 39 39 -gvs_per_viewcell=true \ 40 40 -gvs_stats=$LOG_PREFIX-gvsStats.log \ -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r2692 r2694 229 229 230 230 //KdNode *node = mKdTree->GetPvsNodeCheck(ray.mTermination, obj); 231 //if (!node) cerr << "e : " << obj->GetBox() << " " << ray.mTermination << endl;else231 //if (!node) cerr << "e " << obj->GetBox() << " " << ray.mTermination << endl; else 232 232 if (!node->Mailed()) 233 { 233 {//cout<<"o "; 234 234 // add to pvs 235 235 node->Mail(); … … 565 565 newOrigin = newPoint - newDir * offset; 566 566 567 567 568 ////////////// 568 569 //-- for per view cell sampling, we must check for intersection … … 738 739 m.mDiffuseColor = RgbColor(0, 1, 0); 739 740 exporter->SetForcedMaterial(m); 740 741 //mViewCellsManager->ExportViewCellGeometry(exporter, vc, NULL, NULL);742 //mViewCellsManager->ExportViewCellGeometry(exporter, mCurrentViewCell, NULL, NULL);743 741 744 742 AxisAlignedBox3 bbox = mCurrentViewCell->GetMesh()->mBox; -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h
r2691 r2694 14 14 class KdIntersectable; 15 15 class ViewCellBasedDistribution; 16 class ViewCellBorderBasedDistribution; 17 16 18 17 19 /** View space partition statistics. -
GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.h
r2615 r2694 202 202 203 203 int CastSimpleRay(const SimpleRay &ray); 204 204 int CastSimpleRay(const SimpleRay &ray, int rayIndex); 205 205 206 206 AxisAlignedBox3 GetBox() const; -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2691 r2694 1604 1604 1605 1605 1606 Mesh *Preprocessor::LoadBinaryObjIntoMesh(const string &filename) 1607 { 1608 igzstream inStream(filename.c_str()); 1609 1610 if (!inStream.is_open()) 1611 return NULL; 1612 1613 cout << "binary obj dump available, loading " << filename.c_str() << endl; 1614 1615 // read in triangle size 1616 int numTriangles; 1617 1618 inStream.read(reinterpret_cast<char *>(&numTriangles), sizeof(int)); 1619 1620 cout << "loading " << numTriangles << " triangles into mesh" << endl; 1621 1622 Mesh *mesh = new Mesh(numTriangles * 3, numTriangles); 1623 1624 const int t = 1000; 1625 for (int j = 0, i = 0; j < numTriangles; ++ j, i += 3) 1626 { 1627 Triangle3 tri; 1628 1629 inStream.read(reinterpret_cast<char *>(&mesh->mVertices[i]), sizeof(Vector3)); 1630 inStream.read(reinterpret_cast<char *>(&mesh->mVertices[i + 1]), sizeof(Vector3)); 1631 inStream.read(reinterpret_cast<char *>(&mesh->mVertices[i + 2]), sizeof(Vector3)); 1632 1633 // hack: objects initially very small 1634 mesh->mVertices[i] *= 100; 1635 mesh->mVertices[i + 1] *= 100; 1636 mesh->mVertices[i + 2] *= 100; 1637 1638 mesh->AddFace(new Face(i + 0, i + 1, i + 2)); 1639 1640 if ((j % t) == (t - 1)) 1641 cout<<"\r"<<i<<"/"<<numTriangles<<"\r"; 1642 } 1643 1644 cout << "loaded " << numTriangles << " triangles" << endl; 1645 1646 mesh->Preprocess(); 1647 1648 cout << "finished preprocessing" << endl; 1649 1650 return mesh; 1651 } 1652 1653 1654 bool Preprocessor::LoadDynamicGeometry(const string &filename) 1606 SceneGraphLeaf *Preprocessor::RegisterDynamicGeometryWithRayCaster(SceneGraphLeaf *leaf) 1607 { 1608 if (mRayCaster) 1609 mRayCaster->AddDynamicObjecs(leaf->mGeometry, leaf->GetTransformation()); 1610 } 1611 1612 1613 SceneGraphLeaf *Preprocessor::LoadDynamicGeometry(const string &filename) 1655 1614 { 1656 1615 #if DYNAMIC_OBJECTS_HACK … … 1665 1624 cout<<"parsing obj file.."<<endl; 1666 1625 ObjParser *p = new ObjParser; 1667 parsed = p->ParseFile(filename, 1668 leaf, 1669 false); 1670 leaf->UpdateBox(); 1671 cout<<leaf->GetBox(); 1672 1673 float s = 10.0f; 1674 leaf->ApplyTransform(ScaleMatrix(s, s, s)); 1675 leaf->ApplyTransform(TranslationMatrix(Vector3(0, 10, 0))); 1676 1677 1626 parsed = p->ParseFile(filename, leaf, false); 1678 1627 } 1679 1628 else 1680 1629 { 1681 1630 cout<<"parsing binary obj file ... " << endl; 1682 1683 1631 parsed = LoadBinaryObj(filename, leaf, NULL, 100); 1684 1632 } … … 1686 1634 if (parsed) 1687 1635 { 1688 cout<<"success."<<endl; 1636 const float scale = 0.01f; 1637 1638 ObjectContainer::const_iterator it, it_end = leaf->mGeometry.end(); 1639 1640 for (it = leaf->mGeometry.begin(); it != it_end; ++ it) 1641 { 1642 TriangleIntersectable *tri = static_cast<TriangleIntersectable *>(*it); 1643 1644 Triangle3 t = tri->GetItem(); 1645 1646 // scale object appropriately 1647 t.mVertices[0] *= scale; 1648 t.mVertices[1] *= scale; 1649 t.mVertices[2] *= scale; 1650 1651 tri->SetItem(t); 1652 } 1653 1654 //leaf->ApplyTransform(ScaleMatrix(s, s, s)); 1655 //leaf->ApplyTransform(TranslationMatrix(Vector3(0, 10, 0))); 1656 1689 1657 leaf->UpdateBox(); 1690 cout<<leaf->GetBox();1691 mDynamicObjects.push_back(leaf);1692 //leaf->RebuildKtbTree();1693 1658 mSceneGraph->GetRoot()->mChildren.push_back(leaf); 1694 1695 if (mRayCaster) 1696 mRayCaster->AddDynamicObjecs(leaf->mGeometry, leaf->GetTransformation()); 1697 1698 1699 return true; 1659 //mDynamicObjects.push_back(leaf); 1660 1661 cout<<"Dynamic object loaded successfully: " << leaf->GetBox() << endl; 1662 1663 return leaf; 1700 1664 } 1701 else 1702 { 1703 cout<<"failed."<<endl; 1704 1705 } 1706 1665 1707 1666 1708 1667 #endif 1709 return false; 1668 cout<<"Dynamic object loading failed."<<endl; 1669 return NULL; 1710 1670 } 1711 1671 -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
r2691 r2694 192 192 /** Adds dynamic geometry 193 193 */ 194 bool LoadDynamicGeometry(const string &filename); 195 196 Mesh *Preprocessor::LoadBinaryObjIntoMesh(const string &filename); 194 SceneGraphLeaf *LoadDynamicGeometry(const string &filename); 195 196 /** Register the dynamic object to be handled by the ray caster for visibility 197 computation. 198 */ 199 SceneGraphLeaf *RegisterDynamicGeometryWithRayCaster(SceneGraphLeaf *leaf); 200 201 197 202 198 203 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/ObjectPlacer.cpp
r2693 r2694 1 1 #include "ObjectPlacer.h" 2 #include "Matrix4x4.h" 3 #include "SceneGraph.h" 2 4 3 namespace GtpVisibilityPreprocessor { 5 6 7 namespace GtpVisibilityPreprocessor 8 { 4 9 5 10 // --------------------------------------------------------------------------- 6 11 // ObjectPlacer implementation 7 12 // --------------------------------------------------------------------------- 8 #if 0 13 9 14 ObjectPlacer::ObjectPlacer() 10 :mCurrentLibaryObject(0), mPlacedNodes(new BranchGroup), mLibraryViz(new BranchGroup)15 : mCurrentObject(0) 11 16 { 12 mLibraryViz->addChild(new BranchGroup);13 14 BranchGroup *bg = new BranchGroup;15 bg->addChild(new Box);16 SetLibrary(bg);17 17 } 18 18 19 19 20 void ObjectPlacer:: SetLibrary(BranchGroup *library)20 void ObjectPlacer::AddObject(SceneGraphLeaf *obj) 21 21 { 22 mLibrary = new BranchGroup; 23 if (!library) 24 { 25 mLibrary->addChild(new Box); 26 } 27 else 28 { 29 for (int i = 0; i < library->numChildren(); i ++) 30 { 31 Node *n = library->getChild(i); 32 SharedGroup *s = new SharedGroup; 33 s->addChild(n); 34 35 Link *l = new Link; 36 l->setSharedGroup(s); 37 mLibrary->addChild(l); 38 } 39 } 40 41 UpdateLibraryViz(); 42 } 43 44 void ObjectPlacer::UpdateLibraryViz() 45 { 46 Link *l = new Link; 47 l->setSharedGroup(((Link *)mLibrary->getChild(mCurrentLibaryObject))->getSharedGroup()); 48 49 mLibraryViz->setChild(l, 0); 22 mDynamicObjects.push_back(obj); 50 23 } 51 24 … … 53 26 void ObjectPlacer::NextObject() 54 27 { 55 if (mLibrary) 56 mCurrentLibaryObject = (mCurrentLibaryObject + 1) % (mLibrary->numChildren()); 57 UpdateLibraryViz(); 28 mCurrentObject = (mCurrentObject + 1) % (int)mDynamicObjects.size(); 58 29 } 30 59 31 60 32 void ObjectPlacer::PreviousObject() 61 33 { 62 if (mLibrary) 63 mCurrentLibaryObject = (mCurrentLibaryObject - 1) % (mLibrary->numChildren()); 64 UpdateLibraryViz(); 65 } 66 67 void ObjectPlacer::AddObject(const Point3f &p) 68 { 69 //BranchGroup *o = new BranchGroup; 70 TransformGroup *tg = new TransformGroup; 71 Transform3D t; 72 t.setTranslation(p - Origin3f); 73 tg->setTransform(t); 74 //o->addChild(tg); 75 76 Link *l = new Link; 77 l->setSharedGroup(((Link *)(mLibrary->getChild(mCurrentLibaryObject)))->getSharedGroup()); 78 tg->addChild(l); 79 80 mPlacedNodes->addChild(tg); 81 } 82 83 void ObjectPlacer::RemoveLastObject() 84 { 85 if (mPlacedNodes->numChildren() > 0) 86 mPlacedNodes->removeChild(mPlacedNodes->numChildren()-1); 87 } 88 89 void ObjectPlacer::SaveObjects(const String &filename) 90 { 91 WriteActionIV wa(filename, ""); 92 93 wa.Apply(mPlacedNodes); 94 } 95 96 BranchGroup *ObjectPlacer::GetLibraryVisualization() 97 { 98 return mLibraryViz; 99 } 100 101 BranchGroup *ObjectPlacer::GetPlacedNodeVisualization() 102 { 103 return mPlacedNodes; 104 } 105 106 void ObjectPlacer::Clear() 107 { 108 mPlacedNodes->removeAllChildren(); 34 mCurrentObject = (mCurrentObject - 1) % (int)mDynamicObjects.size(); 109 35 } 110 36 111 37 112 void TestApp::Placer(const String &parm) 38 SceneGraphLeaf *ObjectPlacer::GetCurrentObject() 39 { 40 if (mCurrentObject >= mDynamicObjects.size()) 41 return NULL; 42 43 return mDynamicObjects[mCurrentObject]; 44 } 45 46 47 void ObjectPlacer::PlaceObject(const Vector3 &pt) 48 { 49 Vector3 p = pt; 50 51 SceneGraphLeaf *obj = mDynamicObjects[mCurrentObject]; 52 53 // set pivot to ground of object 54 p.y -= obj->GetOriginalBox().Min().y; 55 Matrix4x4 trafo = TranslationMatrix(p); 56 57 obj->LoadTransform(trafo); 58 } 59 60 61 /*void TestApp::Placer(const String &parm) 113 62 { 114 63 if (parm.Empty()) … … 191 140 } else 192 141 OUT1("Unknown placer command"); 142 } 143 */ 193 144 194 145 } 195 196 #endif197 198 } -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/ObjectPlacer.h
r2693 r2694 1 1 #ifndef OBJECTPLACER_H 2 2 #define OBJECTPLACER_H 3 4 #include "Containers.h" 3 5 4 6 namespace GtpVisibilityPreprocessor { 5 7 6 8 class Vector3; 9 class Preprocessor; 7 10 8 11 … … 12 15 { 13 16 public: 17 /** Default constructor taking a pointer to the currently used preprocessor. 18 */ 19 // ObjectPlacer(Preprocessor *prep); 14 20 ObjectPlacer(); 15 21 16 /// sets library objects 17 //void SetLibrary(BranchGroup *library); 18 /// selects the next library object 22 /** Sets library objects. 23 */ 24 void AddObject(SceneGraphLeaf *object); 25 26 /** Selects the next library object. 27 */ 19 28 void NextObject(); 20 /// selects the previous library object 29 /** Selects the previous library object. 30 */ 21 31 void PreviousObject(); 22 /// adds an object at the indicated position 23 void AddObject(const Vector3 &p); 24 /// remove the last added object 25 void RemoveLastObject(); 32 /** Adds an object at the indicated position. 33 */ 34 void PlaceObject(const Vector3 &p); 26 35 27 /// Clear all objects 28 void Clear(); 36 SceneGraphLeaf *GetCurrentObject(); 29 37 30 /// Save the objects31 /*void SaveObjects(const std::string &filename);32 33 /// Get a node to visualize from the library34 BranchGroup *GetLibraryVisualization();35 36 /// Get the nodes that have already been placed37 BranchGroup *GetPlacedNodeVisualization();38 39 */40 38 virtual ~ObjectPlacer() {} 41 39 40 DynamicObjectsContainer &GetDynamicObjects() { return mDynamicObjects; } 41 42 42 43 protected: 43 /*SceneBasePtr<BranchGroup> mLibrary;44 SceneBasePtr<BranchGroup> mPlacedNodes;45 SceneBasePtr<BranchGroup> mLibraryViz;46 int mCurrentLibaryObject;47 44 48 /// Get a link to an object in the library 49 void UpdateLibraryViz(); 50 */ 45 //Preprocessor *mPreprocessor; 46 47 DynamicObjectsContainer mDynamicObjects; 48 49 int mCurrentObject; 50 51 51 }; 52 52 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2693 r2694 18 18 #include "LogWriter.h" 19 19 #include "RayCaster.h" 20 #include "ObjectPlacer.h" 20 21 21 22 … … 271 272 if (pixelCount > pixelThres) 272 273 { 273 cout << "f rame " << mFrame << " vc id: " << viewcell->GetId() << " pvs: " << pvsSize << " pc: " << pixelCount << " vp: " << mViewPoint<< endl;274 cout << "f " << mFrame << " id " << viewcell->GetId() << " pvs " << pvsSize << " e " << pixelCount << " vp " << mViewPoint << " vd " << mViewDirection << endl; 274 275 275 276 if (mSnapErrorFrames) … … 510 511 _RenderDynamicObject(*dit); 511 512 } 513 514 if (mPendingDynamicObject) 515 _RenderDynamicObject(mPendingDynamicObject); 512 516 #endif 513 517 } … … 736 740 mousePoint.y = y; 737 741 738 } 742 if (e->button() == Qt::RightButton) 743 { 744 if (mPlacer->GetCurrentObject()) 745 { 746 Vector3 pt = Unproject(x, y); 747 cout << "unproject: " << pt << endl; 748 749 mPlacer->PlaceObject(pt); 750 mPendingDynamicObject = mPlacer->GetCurrentObject(); 751 } 752 } 753 } 754 739 755 740 756 void QtGlRendererWidget::mouseReleaseEvent(QMouseEvent *e) … … 1047 1063 1048 1064 mRenderError = 0.0f; 1065 1049 1066 mShowRays = false; 1050 1051 1067 mReplayMode = false; 1068 1069 mPlacer = new ObjectPlacer(); 1070 1071 mPendingDynamicObject = NULL; 1052 1072 1053 1073 SetSceneCut(1000); … … 1183 1203 ++ mCurrentDynamicObjectIdx; 1184 1204 1185 if (mViewCellsManager->GetPreprocessor()->LoadDynamicGeometry(filename)) { 1186 1187 cout << "Loading finished" << endl; 1188 } else 1189 cerr << "Loading failed" << endl; 1205 SceneGraphLeaf *leaf = 1206 mViewCellsManager->GetPreprocessor()->LoadDynamicGeometry(filename); 1207 1208 if (leaf) 1209 { 1210 mPlacer->AddObject(leaf); 1211 cout << "Loading finished" << endl; 1212 } 1213 else 1214 cerr << "Loading failed" << endl; 1190 1215 1191 1216 updateGL(); 1192 1217 } 1218 1193 1219 1194 1220 void … … 2524 2550 { 2525 2551 // swap y coordinate 2526 //y = GetHeight() - y;2552 y = GetHeight() - y; 2527 2553 2528 2554 // HACK: should come from camera! … … 2534 2560 const int viewport[4] = {0,0, GetWidth(), GetHeight()}; 2535 2561 2562 RenderScene(); 2563 2536 2564 float z; 2537 2565 glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &z); 2538 2539 RenderScene(); 2540 2566 2541 2567 GLdouble rx, ry, rz; 2542 2568 gluUnProject(x, y, z, modelview, projection, viewport, &rx, &ry, &rz); -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
r2693 r2694 39 39 class OcclusionQuery; 40 40 class TransformedMeshInstance; 41 class ObjectPlacer; 41 42 42 43 … … 221 222 float mTransferFunction; 222 223 223 224 224 Vector3 mDummyViewPoint; 225 225 … … 242 242 int mReplayTimerId; 243 243 244 ObjectPlacer *mPlacer; 245 244 246 #if DYNAMIC_OBJECTS_HACK 247 248 SceneGraphLeaf *mPendingDynamicObject; 249 245 250 DynamicObjectsContainer mDynamicObjects; 246 251 #endif … … 254 259 255 260 QtGlRendererWidget() {}; 261 262 ~QtGlRendererWidget() { delete mPlacer; } 256 263 257 264 void SetThread(QtPreprocessorThread *t) -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
r2691 r2694 36 36 37 37 HaltonSequence ViewCellBasedDistribution::sHalton; 38 HaltonSequence ViewCellBorderBasedDistribution::sHalton; 38 39 39 40 SamplingStrategy::SamplingStrategy(Preprocessor &preprocessor): … … 289 290 290 291 return true; 291 }292 293 294 bool ViewCellBorderBasedDistribution::GenerateSample(SimpleRay &ray)295 {296 Vector3 origin, direction;297 298 //ViewCellContainer &viewCells = mPreprocessor.mViewCellsManager->GetViewCells();299 300 Vector3 point;301 Vector3 normal, normal2;302 303 //const int vcIdx = (int)RandomValue(0, (float)viewCells.size() - 0.5f);304 const int objIdx = (int)RandomValue(0, (float)mPreprocessor.mObjects.size() - 0.5f);305 306 Intersectable *object = mPreprocessor.mObjects[objIdx];307 ViewCell *viewCell = mViewCell;//viewCells[vcIdx];308 309 object->GetRandomSurfacePoint(point, normal);310 viewCell->GetRandomEdgePoint(origin, normal2);311 312 direction = point - origin;313 314 // $$ jb the pdf is yet not correct for all sampling methods!315 const float c = Magnitude(direction);316 317 if ((c <= Limits::Small) /*|| (DotProd(direction, normal) < 0)*/)318 {319 return false;320 }321 322 // $$ jb the pdf is yet not correct for all sampling methods!323 const float pdf = 1.0f;324 //cout << "p: " << point << " ";325 direction *= 1.0f / c;326 ray = SimpleRay(origin, direction, VIEWCELL_BORDER_BASED_DISTRIBUTION, pdf);327 328 //cout << "ray: " << ray.mOrigin << " " << ray.mDirection << endl;329 330 return true;331 292 } 332 293 … … 886 847 887 848 888 } 889 890 849 bool ViewCellBorderBasedDistribution::GenerateSample(SimpleRay &ray) 850 { 851 float r[3]; 852 sHalton.GetNext(3, r); 853 854 Vector3 origin, direction; 855 Vector3 normal; 856 857 Vector3 point = mPreprocessor.sceneBox.GetRandomPoint(Vector3(r[0], r[1], r[2])); 858 859 mViewCell->GetRandomEdgePoint(origin, normal); 860 861 direction = point - origin; 862 863 // $$ jb the pdf is yet not correct for all sampling methods! 864 const float c = Magnitude(direction); 865 866 if ((c <= Limits::Small) /*|| (DotProd(direction, normal) < 0)*/) 867 { 868 return false; 869 } 870 871 // $$ jb the pdf is yet not correct for all sampling methods! 872 const float pdf = 1.0f; 873 //cout << "p: " << point << " "; 874 direction *= 1.0f / c; 875 ray = SimpleRay(origin, direction, VIEWCELL_BORDER_BASED_DISTRIBUTION, pdf); 876 877 //cout << "ray: " << ray.mOrigin << " " << ray.mDirection << endl; 878 879 return true; 880 } 881 882 883 } 884 885 -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.h
r2691 r2694 218 218 219 219 220 class ViewCellBorderBasedDistribution: public SamplingStrategy221 {222 public:223 ViewCellBorderBasedDistribution(Preprocessor &preprocessor, ViewCell *viewCell)224 : SamplingStrategy(preprocessor), mViewCell(viewCell)225 {226 mType = VIEWCELL_BORDER_BASED_DISTRIBUTION;227 }228 229 private:230 virtual bool GenerateSample(SimpleRay &ray);231 232 ViewCell *mViewCell;233 };234 235 236 220 class GlobalLinesDistribution: public SamplingStrategy 237 221 { … … 334 318 }; 335 319 320 class ViewCellBorderBasedDistribution: public SamplingStrategy 321 { 322 public: 323 ViewCellBorderBasedDistribution(Preprocessor &preprocessor, ViewCell *viewCell) 324 : SamplingStrategy(preprocessor), mViewCell(viewCell) 325 { 326 mType = VIEWCELL_BORDER_BASED_DISTRIBUTION; 327 } 328 329 void SetViewCell(ViewCell *vc) { mViewCell = vc; } 330 331 private: 332 333 // Generate a new sample according to a mixture distribution 334 virtual bool GenerateSample(SimpleRay &ray); 335 336 // halton sequence generator for deciding between distributions 337 static HaltonSequence sHalton; 338 339 ViewCell *mViewCell; 340 }; 341 342 336 343 }; 337 344 -
GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp
r2662 r2694 260 260 SceneGraphLeaf *leaf = static_cast<SceneGraphLeaf *>(node); 261 261 262 size += leaf->mGeometry.size();262 size += (int)leaf->mGeometry.size(); 263 263 } 264 264 else … … 318 318 319 319 320 321 } 320 AxisAlignedBox3 SceneGraphLeaf::GetOriginalBox() const 321 { 322 return mBox; 323 } 324 325 } -
GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h
r2678 r2694 65 65 66 66 virtual AxisAlignedBox3 GetBox() const; 67 /** Returns the box without the trafo. 68 */ 69 virtual AxisAlignedBox3 GetOriginalBox() const; 67 70 68 71 virtual void ApplyTransform(const Matrix4x4 &trafo);
Note: See TracChangeset
for help on using the changeset viewer.