- Timestamp:
- 05/23/08 17:47:22 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_vienna
r2696 r2702 8 8 9 9 10 #SCENE=../data/vienna/vienna_cropped.obj10 SCENE=../data/vienna/vienna_cropped.obj 11 11 #SCENE=../data/vienna/city_full.obj 12 12 #SCENE=../data/vienna/city_full_hp.obj 13 SCENE=../data/vienna/vienna_rep.obj13 #SCENE=../data/vienna/vienna_rep.obj 14 14 15 15 VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz -
GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vps.sh
r2699 r2702 14 14 #VIEWCELLS=../data/Arena/arena-high-lods-5000-viewcells.xml.gz 15 15 #SCENE=../data/vienna/vienna_cropped.obj 16 #SCENE=../data/roofs2.obj16 SCENE=../data/roofs_new.obj 17 17 #SCENE=../data/vienna/city_full_hp.obj 18 SCENE=../data/vienna/vienna_rep.obj18 #SCENE=../data/vienna/vienna_rep.obj 19 19 20 20 #SCENE=../data/vienna/vienna_cropped.obj -
GTP/trunk/Lib/Vis/Preprocessing/src/Containers.h
r2678 r2702 22 22 class KdLeaf; 23 23 class Vector3; 24 class IntersectableGroup; 24 25 25 26 struct IndexedBoundingBox; … … 75 76 76 77 /// a container for dynamic objects 77 78 78 typedef vector<SceneGraphLeaf *> DynamicObjectsContainer; 79 79 80 // a container for intersectable groups (e.g., triangle soups) 81 typedef vector<IntersectableGroup *> GroupContainer; 80 82 81 83 } -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r2697 r2702 551 551 glPopMatrix(); 552 552 553 if ( 1)554 { 555 // testthe box of the object553 if (0) 554 { 555 // render the box of the object 556 556 AxisAlignedBox3 box = leaf->GetBox(); 557 557 RenderBox(box); … … 590 590 Intersectable::NewMail(); 591 591 592 #if DYNAMIC_OBJECTS_HACK593 592 Preprocessor *p = mViewCellsManager->GetPreprocessor(); 594 593 // handle dynamic objects … … 599 598 _RenderDynamicObject(*dit); 600 599 } 601 #endif 600 602 601 _RenderSceneTrianglesWithDrawArrays(); 603 602 … … 606 605 607 606 608 void 609 GlRendererBuffer::EvalQueryWithItemBuffer() 610 { 611 // read back the texture 612 glReadPixels(0, 0, 613 GetWidth(), GetHeight(), 614 GL_RGBA, 615 GL_UNSIGNED_BYTE, 616 mPixelBuffer); 617 618 619 unsigned int *p = mPixelBuffer; 620 621 for (int y = 0; y < GetHeight(); y++) 622 { 623 for (int x = 0; x < GetWidth(); x++, p++) 624 { 625 unsigned int id = (*p) & 0xFFFFFF; 626 627 if (id != 0xFFFFFF) 628 { 629 ++ mObjects[id]->mCounter; 630 } 631 } 632 } 633 } 634 607 608 Preprocessor *GlRenderer::GetPreprocessor() 609 { 610 return mViewCellsManager->GetPreprocessor(); 611 } 635 612 636 613 … … 648 625 mPixelBuffer = NULL; 649 626 // implement width and height in subclasses 627 } 628 629 630 void 631 GlRendererBuffer::EvalQueryWithItemBuffer() 632 { 633 // read back the texture 634 glReadPixels(0, 0, 635 GetWidth(), GetHeight(), 636 GL_RGBA, 637 GL_UNSIGNED_BYTE, 638 mPixelBuffer); 639 640 641 unsigned int *p = mPixelBuffer; 642 643 for (int y = 0; y < GetHeight(); y++) 644 { 645 for (int x = 0; x < GetWidth(); x++, p++) 646 { 647 unsigned int id = (*p) & 0xFFFFFF; 648 649 if (id != 0xFFFFFF) 650 { 651 ++ mObjects[id]->mCounter; 652 } 653 } 654 } 650 655 } 651 656 -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
r2686 r2702 29 29 class SimpleRayContainer; 30 30 class SceneGraphLeaf; 31 class Preprocessor; 31 32 32 33 struct VssRayContainer; … … 234 235 }; 235 236 237 Preprocessor *GetPreprocessor(); 238 239 236 240 vector<PvsErrorEntry> mPvsErrorBuffer; 237 241 … … 297 301 298 302 GlRendererBuffer(SceneGraph *sceneGraph, 299 ViewCellsManager *viewcells,300 KdTree *tree);303 ViewCellsManager *viewcells, 304 KdTree *tree); 301 305 302 306 virtual ~GlRendererBuffer(); -
GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.h
r2694 r2702 249 249 /** Intersectable wrapping is a group of objects. 250 250 */ 251 class ContainerIntersectable: public GtpVisibilityPreprocessor::IntersectableWrapper<ObjectContainer *>252 { 253 public: 254 ContainerIntersectable(ObjectContainer *item):251 class IntersectableGroup: public GtpVisibilityPreprocessor::IntersectableWrapper<ObjectContainer *> 252 { 253 public: 254 IntersectableGroup(ObjectContainer *item): 255 255 IntersectableWrapper<ObjectContainer *>(item) {} 256 256 257 257 // hack 258 ~ ContainerIntersectable()258 ~IntersectableGroup() 259 259 { 260 260 delete mItem; -
GTP/trunk/Lib/Vis/Preprocessing/src/IntersectionBoundingBoxConverter.cpp
r2544 r2702 55 55 FindIntersectingObjects(box, *entryObjects); 56 56 57 ContainerIntersectable*entry =58 new ContainerIntersectable(entryObjects);57 IntersectableGroup *entry = 58 new IntersectableGroup(entryObjects); 59 59 60 60 entry->SetId((*iit).first); -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2701 r2702 1591 1591 1592 1592 1593 SceneGraphLeaf *Preprocessor::RegisterDynamicGeometryWithRayCaster(SceneGraphLeaf *leaf) 1594 { 1593 void Preprocessor::RegisterDynamicObject(SceneGraphLeaf *leaf) 1594 { 1595 mDynamicObjects.push_back(leaf); 1596 1597 // add to scene graph 1598 mSceneGraph->GetRoot()->mChildren.push_back(leaf); 1599 1595 1600 if (mRayCaster) 1596 1601 mRayCaster->AddDynamicObjecs(leaf->mGeometry, leaf->GetTransformation()); … … 1602 1607 SceneGraphLeaf *Preprocessor::LoadDynamicGeometry(const string &filename) 1603 1608 { 1604 #if DYNAMIC_OBJECTS_HACK1605 1606 1609 const bool dynamic = true; 1607 1610 SceneGraphLeaf *leaf = new SceneGraphLeaf(dynamic); … … 1623 1626 if (parsed) 1624 1627 { 1625 const float scale = 0.01f;1626 1627 1628 ObjectContainer::const_iterator it, it_end = leaf->mGeometry.end(); 1628 1629 … … 1633 1634 Triangle3 t = tri->GetItem(); 1634 1635 1635 // scale object appropriately 1636 // hack: scale object appropriately 1637 float scale = 0.01f; 1638 1636 1639 t.mVertices[0] *= scale; 1637 1640 t.mVertices[1] *= scale; … … 1641 1644 } 1642 1645 1643 //leaf->ApplyTransform(ScaleMatrix(s, s, s));1644 //leaf->ApplyTransform(TranslationMatrix(Vector3(0, 10, 0)));1645 1646 1646 leaf->UpdateBox(); 1647 mSceneGraph->GetRoot()->mChildren.push_back(leaf);1648 //mDynamicObjects.push_back(leaf);1649 1650 1647 cout<<"Dynamic object loaded successfully: " << leaf->GetBox() << endl; 1651 1648 … … 1654 1651 1655 1652 1656 #endif1657 1653 cout<<"Dynamic object loading failed."<<endl; 1658 1654 return NULL; -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
r2695 r2702 33 33 class SceneGraphLeaf; 34 34 class GlRendererWidget; 35 class IntersectableGroup; 35 36 36 37 … … 197 198 computation. 198 199 */ 199 SceneGraphLeaf *RegisterDynamicGeometryWithRayCaster(SceneGraphLeaf *leaf); 200 200 void RegisterDynamicObject(SceneGraphLeaf *leaf); 201 201 202 202 … … 226 226 ViewCellsManager *mViewCellsManager; 227 227 228 #if DYNAMIC_OBJECTS_HACK229 228 DynamicObjectsContainer mDynamicObjects; 230 #endif 229 231 230 /// greedy optimized hierarchy for both objects and view cells 232 231 VspOspTree *mVspOspTree; -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/ObjectPlacer.cpp
r2694 r2702 20 20 void ObjectPlacer::AddObject(SceneGraphLeaf *obj) 21 21 { 22 m DynamicObjects.push_back(obj);22 mLibraryObjects.push_back(obj); 23 23 } 24 24 … … 26 26 void ObjectPlacer::NextObject() 27 27 { 28 mCurrentObject = (mCurrentObject + 1) % (int)m DynamicObjects.size();28 mCurrentObject = (mCurrentObject + 1) % (int)mLibraryObjects.size(); 29 29 } 30 30 … … 32 32 void ObjectPlacer::PreviousObject() 33 33 { 34 mCurrentObject = (mCurrentObject - 1) % (int)m DynamicObjects.size();34 mCurrentObject = (mCurrentObject - 1) % (int)mLibraryObjects.size(); 35 35 } 36 36 … … 38 38 SceneGraphLeaf *ObjectPlacer::GetCurrentObject() 39 39 { 40 if (mCurrentObject >= m DynamicObjects.size())40 if (mCurrentObject >= mLibraryObjects.size()) 41 41 return NULL; 42 42 43 return m DynamicObjects[mCurrentObject];43 return mLibraryObjects[mCurrentObject]; 44 44 } 45 45 … … 49 49 Vector3 p = pt; 50 50 51 SceneGraphLeaf *obj = m DynamicObjects[mCurrentObject];51 SceneGraphLeaf *obj = mLibraryObjects[mCurrentObject]; 52 52 53 53 // set pivot to ground of object … … 58 58 } 59 59 60 61 /*void TestApp::Placer(const String &parm)62 {63 if (parm.Empty())64 {65 OUT1("Object placement: place/load <libaryfile>/removelast/next/previous/save <objectfile>");66 return;67 }68 69 ASM_RET(viewer->GetRoot(), "No scene");70 71 if (!placer)72 placer = new ObjectPlacer;73 74 //-- make sure the placer visualization (which shows the already placed objects) is in the viewer75 SearchNodeByNameVisitor search("placervis");76 search.Apply(viewer->GetRoot(), SearchNodeByNameVisitor::FIRST);77 BranchGroup *placervis = search.GetNode();78 if (!placervis)79 {80 placervis = placer->GetPlacedNodeVisualization();81 viewer->GetRoot()->addChild(placervis);82 placervis->setName("placervis");83 }84 85 if (parm == "place")86 {87 int x, y;88 input_module->GetMousePos(x, y);89 90 Point3f pos = viewer->UnProject(x, y);91 if (viewer && viewer->GetRoot() && viewer->GetRoot()->getBoundingBox()->intersects(pos))92 {93 placer->AddObject(pos);94 OUT1(x << " " << y << " " << pos);95 }96 else97 {98 OUT1("Point out of bounds");99 }100 } else if (parm == "removelast") {101 placer->RemoveLastObject();102 } else if (parm == "next") {103 placer->NextObject();104 } else if (parm == "previous") {105 placer->PreviousObject();106 } else if (parm.Left(5) == "save ") {107 String filename = parm.Right(parm.size()-5);108 if (!filename.Empty())109 placer->SaveObjects(filename);110 } else if (parm.Left(5) == "clear") {111 placer->Clear();112 } else if (parm.Left(5) == "load ") {113 String fn = sysutils::FindFile(parm.Right(parm.size()-5), settings->get_ObjectPath());114 115 ASM_ELSE(!fn.empty(), "Couldn't find file " << fn)116 {117 OUT1("Loading library " << fn << "...");118 SceneBasePtr<BranchGroup> root = ReadSceneGraph(fn, 0, 0, 1);119 120 BranchGroup *library = new BranchGroup;121 ASM_ELSE((root != NULL), "No scene found in file...")122 {123 SearchNodeByNameVisitor search("start");124 search.Apply(root, SearchNodeByNameVisitor::FIRST);125 BranchGroup *local_root = search.GetNode();126 127 if (local_root == NULL)128 {129 OUT1("Note: BranchGroup named \"start\" not found - using root node");130 local_root = root;131 }132 133 placer->SetLibrary(local_root);134 BranchGroup *viz = placer->GetLibraryVisualization();135 mRenderArea->SetSceneRoot(viz);136 mRenderArea->SetCamera(new Camera);137 mRenderArea->GetCamera()->ViewAll(viz->getBoundingSphere());138 }139 }140 } else141 OUT1("Unknown placer command");142 60 } 143 */144 145 } -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/ObjectPlacer.h
r2694 r2702 1 1 #ifndef OBJECTPLACER_H 2 2 #define OBJECTPLACER_H 3 3 … … 15 15 { 16 16 public: 17 /** Default constructor taking a pointer to the currently used preprocessor.17 /** Default constructor. 18 18 */ 19 // ObjectPlacer(Preprocessor *prep);20 19 ObjectPlacer(); 21 20 22 /** Sets library objects. 21 virtual ~ObjectPlacer() {} 22 23 /** Adds a library objects. 23 24 */ 24 void AddObject(SceneGraphLeaf *object); 25 25 void AddObject(SceneGraphLeaf *obj); 26 26 /** Selects the next library object. 27 27 */ … … 33 33 */ 34 34 void PlaceObject(const Vector3 &p); 35 35 /** Returns the currently active object. 36 */ 36 37 SceneGraphLeaf *GetCurrentObject(); 37 38 virtual ~ObjectPlacer() {} 39 40 DynamicObjectsContainer &GetDynamicObjects() { return mDynamicObjects; } 38 /** Returns a ref to the object container. 39 */ 40 DynamicObjectsContainer &GetDynamicObjects() { return mLibraryObjects; } 41 41 42 42 43 43 protected: 44 44 45 //Preprocessor *mPreprocessor; 46 47 DynamicObjectsContainer mDynamicObjects; 48 45 DynamicObjectsContainer mLibraryObjects; 49 46 int mCurrentObject; 50 47 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2697 r2702 63 63 GLuint names, *ptr; 64 64 65 cout << "hits = %d"<< endl;;65 cout << "hits: " << hits << endl;; 66 66 ptr = (GLuint *) buffer; 67 67 … … 71 71 names = *ptr; 72 72 73 printf (" number of names for hit = %d\n", names); ptr++; 74 printf(" z1 is %g;", (float) *ptr/0x7fffffff); ptr++; 75 printf(" z2 is %g\n", (float) *ptr/0x7fffffff); ptr++; 76 printf (" the name is "); 77 78 for (j = 0; j < names; j++) { /* for each name */ 73 printf ("number of names for hit: %d\n", names); ptr ++; 74 printf("z1: %g;", (float) *ptr / 0x7fffffff); ptr ++; 75 printf("z2: %g\n", (float) *ptr / 0x7fffffff); ptr ++; 76 printf ("the name is "); 77 78 // for each name 79 for (j = 0; j < names; j++) 79 80 printf ("%d ", *ptr); ptr++; 80 } 81 81 82 printf ("\n"); 82 83 } … … 555 556 glDrawElements(GL_TRIANGLES, mIndexBufferSize, GL_UNSIGNED_INT, mIndices); 556 557 557 #if DYNAMIC_OBJECTS_HACK558 558 // handle dynamic objects 559 DynamicObjectsContainer::const_iterator dit, dit_end = mDynamic Objects.end();560 561 for (dit = mDynamic Objects.begin(); dit != dit_end; ++ dit)559 DynamicObjectsContainer::const_iterator dit, dit_end = mDynamicPvsObjects.end(); 560 561 for (dit = mDynamicPvsObjects.begin(); dit != dit_end; ++ dit) 562 562 { 563 563 _RenderDynamicObject(*dit); … … 565 565 566 566 // handle dynamic objects 567 dit, dit_end = mPendingDynamicObjects.end(); 568 569 for (dit = mPendingDynamicObjects.begin(); dit != dit_end; ++ dit) 567 Preprocessor *p = mViewCellsManager->GetPreprocessor(); 568 dit, dit_end = p->mDynamicObjects.end(); 569 570 for (dit = p->mDynamicObjects.begin(); dit != dit_end; ++ dit) 570 571 { 571 572 _RenderDynamicObject(*dit); … … 573 574 574 575 //_RenderDynamicObject(mPendingDynamicObject); 575 #endif576 576 } 577 577 … … 586 586 mPvsSize = pvs.GetSize(); 587 587 588 #if DYNAMIC_OBJECTS_HACK 589 mDynamicObjects.clear(); 590 #endif 588 mDynamicPvsObjects.clear(); 591 589 592 590 ObjectPvsIterator it = pvs.GetIterator(); … … 604 602 } 605 603 break; 606 #if DYNAMIC_OBJECTS_HACK607 604 608 605 case Intersectable::SCENEGRAPHLEAF_INTERSECTABLE: 609 mDynamic Objects.push_back(static_cast<SceneGraphLeafIntersectable *>(obj)->GetItem());606 mDynamicPvsObjects.push_back(static_cast<SceneGraphLeafIntersectable *>(obj)->GetItem()); 610 607 break; 611 #endif612 608 default: 613 609 cerr << "PreparePvs: type " << Intersectable::GetTypeName(obj) << " not handled yet" << endl; … … 807 803 808 804 mPlacer->PlaceObject(pt); 809 //mPendingDynamicObjects.push_back( mPlacer->GetCurrentObject()); 805 SceneGraphLeaf *leaf = mPlacer->GetCurrentObject(); 806 807 // hack: should just pass a IntersectableGroup as a whole 808 // instead we duplicate the object container and create a new 809 // leaf 810 SceneGraphLeaf *newObj = new SceneGraphLeaf(*leaf); 811 812 mViewCellsManager->GetPreprocessor()->RegisterDynamicObject(newObj); 813 //mPendingDynamicObjects.push_back(); 810 814 } 811 815 } … … 825 829 const Vector3 pt = Unproject(x, y); 826 830 827 int num = FindDynamicObject(pt); 828 cout << "\n*****************\n" << "here4" << num << endl; 829 //processHits(buf); 830 831 int idx = FindDynamicObject(x, y); 832 833 Preprocessor *p = GetPreprocessor(); 834 835 swap(p->mDynamicObjects[idx], p->mDynamicObjects.back()); 836 p->mDynamicObjects.pop_back(); 831 837 /*if (mCurrentDynamicObjectIdx >= 0) { 832 838 preprocessor->ScheduleUpdateDynamicObjects(); … … 933 939 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 934 940 935 if (1) 936 { 937 SetupCameraProjection(width(), height()); 938 SetupCamera(); 939 940 if (mRenderErrors) 941 { 942 RenderErrors(); 943 } 944 else 945 { 946 glColor3f(0.6f, 0.6f, 0.6f); 947 VisualizePvs(); 948 } 949 950 if (mShowRays) 951 { 952 RenderRays(mViewCellsManager->mVizBuffer.GetRays(), mRayVisualizationMethod, mShowDistribution, 1); 953 } 954 } 955 941 SetupCameraProjection(width(), height()); 942 SetupCamera(); 943 944 if (mRenderErrors) 945 RenderErrors(); 946 else 947 { 948 glColor3f(0.6f, 0.6f, 0.6f); 949 VisualizePvs(); 950 } 951 952 if (mShowRays) 953 RenderRays(mViewCellsManager->mVizBuffer.GetRays(), mRayVisualizationMethod, mShowDistribution, 1); 954 956 955 RenderInfo(); 957 mFrame ++; 956 957 ++ mFrame; 958 958 // cout<<"vp="<<mViewPoint<<" vd="<<mViewDirection<<endl; 959 959 } … … 2367 2367 vbox->layout()->addWidget(button); 2368 2368 connect(button, SIGNAL(clicked()), SIGNAL(ComputeGVS())); 2369 2370 #else 2371 2369 #endif 2370 2371 #if 1 2372 2372 button = new QPushButton("Replay view points", vbox); 2373 2373 vbox->layout()->addWidget(button); … … 2376 2376 #endif 2377 2377 2378 #if DYNAMIC_OBJECTS_HACK2379 2380 2378 button = new QPushButton("Load object", vbox); 2381 2379 vbox->layout()->addWidget(button); 2382 2380 connect(button, SIGNAL(clicked()), SIGNAL(LoadObject())); 2383 #endif2384 2381 2385 2382 /*cb = new QCheckBox("Stats", vbox); … … 2650 2647 2651 2648 2652 int QtGlRendererWidget::FindDynamicObject( const Vector3 &pos)2649 int QtGlRendererWidget::FindDynamicObject(float x, float y) 2653 2650 { 2651 makeCurrent(); 2654 2652 // we need to lock the rendering context 2655 2653 //glw.lockGLContext(); … … 2660 2658 // see below for an explanation on the buffer content 2661 2659 GLuint buffer[maxSize]; 2662 GLint viewport[4];2663 2664 glGetIntegerv(GL_VIEWPORT, viewport);2665 2660 glSelectBuffer(maxSize, buffer); 2666 2661 … … 2673 2668 glPushMatrix(); 2674 2669 glLoadIdentity(); 2675 gluPickMatrix((GLdouble)pos.x, (GLdouble)(viewport[3] - pos.y), 5.0f, 5.0f, viewport); 2676 2677 GLfloat x = (GLfloat)width() / height(); 2678 glFrustum(-x, x, -1.0, 1.0, 4.0, 15.0); 2679 2680 glLoadName(1); 2681 2682 _RenderDynamicObject(mPendingDynamicObjects[0]); 2670 2671 glViewport(0, 0, width(), height()); 2672 2673 GLint viewport[4]; 2674 glGetIntegerv(GL_VIEWPORT, viewport); 2675 2676 const float w = 1.0f; 2677 2678 //gluPickMatrix(x, y, 1000.0, 1000.0, viewport); 2679 gluPickMatrix((GLdouble)x, (GLdouble)(viewport[3] - y), w, w, viewport); 2680 2681 GLfloat aspect = (GLfloat) width() / height(); 2682 gluPerspective(70.0f, aspect, 0.1f, 2.0f * Magnitude(mSceneGraph->GetBox().Diagonal())); 2683 2684 glMatrixMode(GL_MODELVIEW); 2685 glPushMatrix(); 2686 glLoadIdentity(); 2687 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 2688 2689 2690 SetupCamera(); 2691 2692 for (size_t i = 0; i < GetPreprocessor()->mDynamicObjects.size(); ++ i) 2693 { 2694 glLoadName(i); 2695 _RenderDynamicObject(GetPreprocessor()->mDynamicObjects[i]); 2696 } 2697 2698 glFlush(); 2699 glPopMatrix(); 2683 2700 2684 2701 glMatrixMode(GL_PROJECTION); 2685 2702 glPopMatrix(); 2686 2703 2704 //updateGL(); 2705 2706 int hits; 2687 2707 // finally release the rendering context again 2688 if ( !glRenderMode(GL_RENDER))2708 if ((hits = glRenderMode(GL_RENDER)) < 0) 2689 2709 { 2710 cout << "no object picked" << endl; 2690 2711 //glw.unlockGLContext(); 2691 2712 return -1; 2692 2713 } 2714 2715 2716 //processHits(hits, buffer); 2717 2693 2718 2694 2719 //glw.unlockGLContext(); … … 2703 2728 // (number of the surface). 2704 2729 // return the name of the clicked surface 2705 2706 2730 return buffer[3]; 2707 2731 } -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
r2697 r2702 248 248 ObjectPlacer *mPlacer; 249 249 250 #if DYNAMIC_OBJECTS_HACK 251 252 DynamicObjectsContainer mPendingDynamicObjects; 253 DynamicObjectsContainer mDynamicObjects; 254 255 #endif 250 //DynamicObjectsContainer mPendingDynamicObjects; 251 DynamicObjectsContainer mDynamicPvsObjects; 256 252 257 253 QtGlRendererWidget(SceneGraph *sceneGraph, … … 329 325 Vector3 Unproject(int x, int y); 330 326 331 int FindDynamicObject( const Vector3 &pos);327 int FindDynamicObject(float x, float y); 332 328 333 329 -
GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp
r2694 r2702 282 282 mTrafo = IdentityMatrix(); 283 283 284 #if DYNAMIC_OBJECTS_HACK285 284 mIntersectable = new SceneGraphLeafIntersectable(this, mBox); 286 #endif287 285 } 288 286 … … 323 321 } 324 322 325 } 323 324 SceneGraphLeaf::SceneGraphLeaf(SceneGraphLeaf const& copy) 325 { 326 // hack: should just pass a IntersectableGroup as a whole 327 // instead we duplicate the object container and create a new 328 // leaf 329 mGeometry = copy.mGeometry; 330 //for (size_t i = 0; i < copy.mGeometry->size(); ++ i) 331 // mGeometry.push_back(copy.mGeometry[i]); 332 333 mBox = copy.mBox; 334 mTrafo = copy.mTrafo; 335 mIsDynamic = copy.mIsDynamic; 336 } 337 338 } -
GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h
r2694 r2702 55 55 { 56 56 public: 57 57 /** Copy constructor. 58 */ 59 SceneGraphLeaf(SceneGraphLeaf const&); 58 60 SceneGraphLeaf(); 59 61 SceneGraphLeaf(bool isDynamic); … … 74 76 virtual void UpdateBox(); 75 77 76 #if DYNAMIC_OBJECTS_HACK77 78 SceneGraphLeafIntersectable *GetIntersectable() { return mIntersectable; } 78 #endif79 79 80 /// used as actual pvs entry 80 const Matrix4x4 &GetTransformation() const { return mTrafo; } 81 82 //void SetGeometry(ObjectContainer *geometry); 83 84 /// used as actual pvs entry: note should be pointer to geometry!! 81 85 ObjectContainer mGeometry; 82 const Matrix4x4 &GetTransformation() const { return mTrafo; } 86 87 83 88 protected: 84 89 85 #if DYNAMIC_OBJECTS_HACK86 87 90 SceneGraphLeafIntersectable *mIntersectable; 88 CKTB *mKtbTree;89 90 #endif91 91 92 92 bool mIsDynamic; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2696 r2702 369 369 { 370 370 // dynamic objects are scene graph leaves 371 #if DYNAMIC_OBJECTS_HACK372 371 if (ray.mTerminationObject->Type() == Intersectable::SCENEGRAPHLEAF_INTERSECTABLE) 373 372 return ray.mTerminationObject; 374 #endif375 373 376 374 if (mUseKdPvs) -
GTP/trunk/Lib/Vis/Preprocessing/src/common.h
r2699 r2702 23 23 #include <vector> 24 24 25 #define DYNAMIC_OBJECTS_HACK 126 25 #define USE_HAVRAN_RAYCASTER 1 27 26
Note: See TracChangeset
for help on using the changeset viewer.