Ignore:
Timestamp:
01/18/08 16:28:30 (16 years ago)
Author:
mattausch
Message:

worked on dynamic objects

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
12 edited

Legend:

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

    r2613 r2614  
    368368 
    369369                Face *face = mesh->mFaces[i]; 
     370                Vector3 normal = mesh->GetNormal(i); 
     371 
     372                glNormal3f(normal.x, normal.y, normal.z); 
    370373                for (int j = 0; j < face->mVertexIndices.size(); j++) { 
    371374                        glVertex3fv(&mesh->mVertices[face->mVertexIndices[j]].x); 
     
    696699   
    697700  mViewDirection = Normalize(Vector3(sin(dVector.x), 
    698                                                                          //                                                                      cos(dVector.y), 
     701                                                                         //     cos(dVector.y), 
    699702                                                                         0.0f, 
    700703                                                                         cos(dVector.x))); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.cpp

    r2609 r2614  
    104104                        root->mFaces.push_back(i); 
    105105                 
    106                 cout<<"KD"; 
     106                //cout<<"KD"; 
     107                cout<<"constructed mesh kd tree for " << (int)mFaces.size() << " faces" << endl; 
    107108                 
    108109                mKdTree->Construct(); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.h

    r2609 r2614  
    4242  } 
    4343 
    44   Face(const VertexIndexContainer &vertices):mVertexIndices(vertices.size()) { 
     44  Face(const VertexIndexContainer &vertices): mVertexIndices(vertices.size()) { 
    4545        for (int i=0;  i < vertices.size(); i++) 
    4646          mVertexIndices[i] = vertices[i]; 
    4747  } 
    48    
     48 
     49 
    4950  //////////////////////////// 
    5051 
     
    178179  int GetId() const { return mId; } 
    179180 
    180  
     181  /** Returns normal of specified face. 
     182  */ 
    181183  Vector3 GetNormal(const int idx) const; 
    182184 
  • GTP/trunk/Lib/Vis/Preprocessing/src/MeshKdTree.cpp

    r2176 r2614  
    147147  vector<int>::const_iterator fi; 
    148148  vector<int> objectsFront, objectsBack; 
    149    
    150   for ( fi = leaf->mFaces.begin(); 
    151         fi != leaf->mFaces.end(); 
    152         fi++) { 
    153     // determine the side of this ray with respect to the plane 
    154     AxisAlignedBox3 box = mMesh->GetFaceBox(*fi); 
    155  
    156     if (box.Max(axis) > position )  
    157       objectsFront.push_back(*fi); 
    158      
    159     if (box.Min(axis) < position ) 
    160       objectsBack.push_back(*fi); 
    161   } 
    162    
     149 
     150  for ( fi = leaf->mFaces.begin(); fi != leaf->mFaces.end(); fi++)  
     151  { 
     152          // determine the side of this ray with respect to the plane 
     153          AxisAlignedBox3 box = mMesh->GetFaceBox(*fi); 
     154 
     155          if (box.Max(axis) > position )  
     156                  objectsFront.push_back(*fi); 
     157 
     158          if (box.Min(axis) < position ) 
     159                  objectsBack.push_back(*fi); 
     160  } 
     161 
    163162  MeshKdLeaf *back = new MeshKdLeaf(objectsBack); 
    164163  MeshKdLeaf *front = new MeshKdLeaf(objectsFront); 
     
    419418  mRoot = Subdivide(TraversalData(leaf, NULL, GetBox(), 0)); 
    420419   
     420  cout <<  "created " <<  
    421421  // remove the allocated array 
    422422  delete mSubdivisionCandidates; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r2610 r2614  
    186186        int numTriangles; 
    187187 
     188        const int t = 500000; 
    188189        inStream.read(reinterpret_cast<char *>(&numTriangles), sizeof(int)); 
    189190        root->mGeometry.reserve(numTriangles); 
     
    209210                root->mGeometry.push_back(obj); 
    210211                 
    211                 if ((i ++) % 500000 == 499999) 
     212                if ((i ++) % t == t) 
    212213                         cout<<"\r"<<i<<"/"<<numTriangles<<"\r"; 
    213214        } 
     
    11791180        // !!!!!!!!!!!!!!!! VH no sorting 
    11801181        if (  
    1181             rays.size() > 10000 
     1182                rays.size() > 10000 
    11821183                ) 
    1183           { 
    1184           mRayCaster->SortRays(rays); 
    1185           cout<<"Rays sorted in "<<TimeDiff(t1, GetTime())<<" ms."<<endl; 
    1186         } 
     1184        { 
     1185                mRayCaster->SortRays(rays); 
     1186                cout<<"Rays sorted in "<<TimeDiff(t1, GetTime())<<" ms."<<endl; 
     1187        } 
     1188 
     1189        int numTransformed = 0; 
    11871190 
    11881191 
     
    12081211 
    12091212                static Ray hRay; 
    1210  
    12111213                VssRayContainer::iterator vit, vit_end = vssRays.end(); 
    12121214 
     
    12191221 
    12201222                        bool foundIntersect = false; 
     1223 
    12211224                        for (tit = mDynamicObjects.begin(); tit != tit_end; ++ tit) 
    12221225                        { 
    12231226                                TransformedMeshInstance *tmi = *tit; 
    1224                                 if (tmi->CastRay(hRay)) //cout << "z"; else cout<< "r"; 
     1227 
     1228                                float maxT, minT; 
     1229         
     1230                                // test with bounding box 
     1231                                if (tmi->GetBox().GetMinMaxT(hRay, &minT, &maxT)) 
    12251232                                { 
    1226                                         cout << "i: " << Intersectable::GetTypeName(hRay.intersections[0].mObject); 
    1227                                         foundIntersect = true; 
     1233                                        if (tmi->CastRay(hRay)) //cout << "z"; else cout<< "r"; 
     1234                                        { 
     1235                                                //cout << "i: " << Intersectable::GetTypeName(hRay.intersections[0].mObject); 
     1236                                                foundIntersect = true; 
     1237                                        } 
    12281238                                } 
    12291239                        } 
    12301240 
     1241                        //if (foundIntersect)   cout << "x: " << Intersectable::GetTypeName(hRay.intersections[0].mObject); 
     1242 
    12311243                        if (foundIntersect) 
    1232                                 cout << "x: " << Intersectable::GetTypeName(hRay.intersections[0].mObject); 
    1233  
    1234                         if (foundIntersect) 
     1244                        { 
     1245                                ++ numTransformed; 
    12351246                                // write new results back into vssRay 
    12361247                                vssRay->Init(hRay); 
    1237  
    1238                         if (foundIntersect) 
    1239                                 cout << "y : " << Intersectable::GetTypeName(vssRay->mTerminationObject); 
     1248                        } 
    12401249 
    12411250                        hRay.intersections.clear(); 
     
    12581267 
    12591268        } 
    1260          
    1261         //      cerr<<"Determining PVS objects"<<endl; 
     1269        //cout << "numDummy: " << numTransformed << endl;        
     1270        //cerr<<"Determining PVS objects"<<endl; 
    12621271        DeterminePvsObjects(vssRays); 
    12631272        //      cerr<<"done."<<endl; 
     
    16201629        cout << "loading " << numTriangles << " triangles into mesh" << endl; 
    16211630 
    1622         int i = 0, j = 0; 
    1623  
    16241631        Mesh *mesh = new Mesh(numTriangles * 3, numTriangles); 
    16251632 
    1626         const int t = 500000; 
    1627         while (1) 
     1633        const int t = 1000; 
     1634        for (int j = 0, i = 0; j < numTriangles; ++ j, i += 3) 
    16281635        { 
    16291636                Triangle3 tri; 
     
    16331640                inStream.read(reinterpret_cast<char *>(&mesh->mVertices[i + 2]), sizeof(Vector3)); 
    16341641 
    1635                  
    1636                 mesh->mVertices[i].x += 20; 
     1642                /*mesh->mVertices[i].x += 20; 
    16371643                mesh->mVertices[i + 1].x += 20; 
    16381644                mesh->mVertices[i + 2].x += 20; 
     
    16411647                mesh->mVertices[i + 1].z -= 10; 
    16421648                mesh->mVertices[i + 2].z -= 10; 
    1643  
    1644                 mesh->mVertices[i] *= 50; 
    1645                 mesh->mVertices[i + 1] *= 50; 
    1646                 mesh->mVertices[i + 2] *= 50; 
     1649*/ 
     1650                mesh->mVertices[i] *= 100; 
     1651                mesh->mVertices[i + 1] *= 100; 
     1652                mesh->mVertices[i + 2] *= 100; 
    16471653 
    16481654                mesh->AddFace(new Face(i + 0, i + 1, i + 2)); 
    16491655 
    1650                 // end of file reached 
    1651                 if (inStream.eof()) 
    1652                         break; 
    1653  
    1654                 i += 3; 
    1655                 if (((j ++) % t) == (t - 1)) 
     1656                if ((j % t) == (t - 1)) 
    16561657                         cout<<"\r"<<i<<"/"<<numTriangles<<"\r"; 
    16571658        } 
    1658          
    1659         if (j != numTriangles) 
    1660         { 
    1661                 cout << "warning: triangle size does not match with loaded triangle size" << endl; 
    1662                 return false; 
    1663         } 
     1659 
     1660        cout << "loaded " << numTriangles << " triangles" << endl; 
    16641661 
    16651662        mesh->Preprocess(); 
    1666         cout << "loaded " << numTriangles << " triangles" << endl; 
     1663 
     1664        cout << "finished preprocessing" << endl; 
    16671665 
    16681666        return mesh; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp

    r2613 r2614  
    386386        for (dit = mDynamicObjects.begin(); dit != dit_end; ++ dit) 
    387387        { 
     388                //cerr << "here45\n****"<<endl; 
    388389                RenderIntersectable(*dit); 
    389390        } 
     
    659660        int diffy = -(mousePoint.y - y); 
    660661 
     662        const float t = 1.0f; 
     663 
    661664        if (e->modifiers() & Qt::ControlModifier)  
    662665        { 
     
    664667                mViewPoint.x += (x-mousePoint.x)*MOVE_SENSITIVITY / 2.0; 
    665668        }  
    666         else  
     669        else if (e->modifiers() & Qt::AltModifier) 
     670        { 
     671                if (mCurrentDynamicObjectIdx >= 0) 
     672                { 
     673                        Matrix4x4 tm; 
     674                        TransformedMeshInstance *tmi; 
     675 
     676                        switch (mTrafoType) 
     677                        { 
     678                        case 0: 
     679                                { 
     680                                        const Vector3 transl(diffx, 0, diffy); 
     681                                        tmi = mViewCellsManager->GetPreprocessor()->mDynamicObjects[mCurrentDynamicObjectIdx]; 
     682                                        tm = TranslationMatrix(transl); 
     683                                } 
     684                                break; 
     685                        case 1: 
     686                                { 
     687                                        float scalef = 1.0f + 0.01f * (diffx + diffy); 
     688                                        if (scalef < 0.9) scalef = 0.9f; 
     689                                        else if (scalef > 1.1f) scalef = 1.1f; 
     690                                        tmi = mViewCellsManager->GetPreprocessor()->mDynamicObjects[mCurrentDynamicObjectIdx]; 
     691                                        tm = ScaleMatrix(scalef, scalef, scalef); 
     692                                } 
     693                                break; 
     694                        case 2: 
     695                                { 
     696                                        tmi = mViewCellsManager->GetPreprocessor()->mDynamicObjects[mCurrentDynamicObjectIdx]; 
     697                                        tm = RotationXMatrix(diffx) * RotationYMatrix(diffy); 
     698                                } 
     699                                break; 
     700                        default: 
     701                                cerr << "not implemented" << endl; 
     702                        } 
     703 
     704                        tmi->ApplyWorldTransform(tm); 
     705                        updateGL(); 
     706                } 
     707        } 
     708        else 
    667709        { 
    668710                mViewPoint += mViewDirection*((mousePoint.y - y)*MOVE_SENSITIVITY); 
     
    889931        mShowWeightedTriangles = false; 
    890932        mShowDistribution = 15; 
     933        mCurrentDynamicObjectIdx = -1; 
    891934 
    892935        mSpatialFilterSize = 0.01; 
    893936        mPvsSize = 0; 
    894937        mRayVisualizationMethod = 0; 
     938        mTrafoType = 0; 
     939 
    895940        mRenderError = 0.0f; 
    896941        mShowRays = false; 
     
    950995        connect(mControlWidget, SIGNAL(SetShowDistribution4(bool)), this, SLOT(SetShowDistribution4(bool))); 
    951996 
    952  
    953997        connect(mControlWidget, SIGNAL(SetShowRays(bool)), this, SLOT(SetShowRays(bool))); 
    954998 
     999        connect(mControlWidget, SIGNAL(SetTranslation(bool)), this, SLOT(SetTranslation(bool))); 
     1000        connect(mControlWidget, SIGNAL(SetRotation(bool)), this, SLOT(SetRotation(bool))); 
     1001        connect(mControlWidget, SIGNAL(SetScale(bool)), this, SLOT(SetScale(bool))); 
     1002         
    9551003        // setting the size here 
    9561004        resize(800, 600); 
     
    10091057void QtGlRendererWidget::LoadObject() 
    10101058{ 
    1011         string filename("../data/bunny.bn"); 
     1059        string filename("../data/teapot.bn"); 
    10121060         
    10131061        cout << "Loading model << " << filename << endl; 
     1062 
     1063        ++ mCurrentDynamicObjectIdx; 
    10141064 
    10151065        if (mViewCellsManager->GetPreprocessor()->LoadDynamicGeometry(filename)) 
     
    15871637         
    15881638        rb1 = new QRadioButton("random colors", parent); 
    1589         rb1->setText("wireframe"); 
     1639        rb1->setText("random"); 
    15901640        connect(rb1, SIGNAL(toggled(bool)), SIGNAL(SetShowWireFrame(bool))); 
    15911641 
     
    16271677 
    16281678 
     1679QGroupBox *QtRendererControlWidget::CreateTrafoPanel(QWidget *parent) 
     1680{ 
     1681        QRadioButton *rb1, *rb2, *rb3; 
     1682         
     1683        rb1 = new QRadioButton("translation", parent); 
     1684        rb1->setText("translation"); 
     1685        connect(rb1, SIGNAL(toggled(bool)), SIGNAL(SetTranslation(bool))); 
     1686 
     1687        // Create a check box to be in the group box 
     1688        rb2 = new QRadioButton("scale", parent); 
     1689        rb2->setText("scale"); 
     1690        //vl->addWidget(rb1); 
     1691        connect(rb2, SIGNAL(toggled(bool)), SIGNAL(SetScale(bool))); 
     1692 
     1693        rb3 = new QRadioButton("rotation", parent); 
     1694        rb3->setText("rotation"); 
     1695        connect(rb3, SIGNAL(toggled(bool)), SIGNAL(SetRotation(bool))); 
     1696     
     1697        QVBoxLayout *vbox2 = new QVBoxLayout; 
     1698        QGroupBox *groupBox = new QGroupBox("Trafo types"); 
     1699 
     1700        vbox2->addWidget(rb1); 
     1701        vbox2->addWidget(rb2); 
     1702        vbox2->addWidget(rb3); 
     1703         
     1704        rb1->setChecked(true); 
     1705 
     1706        vbox2->addStretch(1); 
     1707        groupBox->setLayout(vbox2); 
     1708 
     1709        return groupBox; 
     1710} 
     1711 
     1712 
    16291713 
    16301714QGroupBox *QtRendererControlWidget::CreateRenderCostPanel(QWidget *parent) 
     
    16461730 
    16471731        QGroupBox *groupBox = new QGroupBox("Render cost options"); 
    1648  
    16491732        QVBoxLayout *vbox2 = new QVBoxLayout; 
    16501733     
     
    18571940        QGroupBox *groupBox3 = CreateRayVisualizationPanel(hbox); 
    18581941        vh->addWidget(groupBox3, 0, 0); 
     1942 
     1943        QGroupBox *groupBox4 = CreateTrafoPanel(hbox); 
     1944        vh->addWidget(groupBox4, 0, 0); 
    18591945 
    18601946        ////////////////////////////////// 
     
    20322118        cb->setChecked(false); 
    20332119        connect(cb, SIGNAL(toggled(bool)), SIGNAL(StoreStatistics()));*/ 
     2120 
    20342121        if (0)  
    20352122        { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h

    r2609 r2614  
    9191 
    9292  QGroupBox *CreateVisualizationPanel(QWidget *parent); 
     93  QGroupBox *CreateTrafoPanel(QWidget *parent); 
    9394 
    9495  public slots: 
     
    156157  void SetShowDistribution3(bool); 
    157158  void SetShowDistribution4(bool); 
     159 
     160  void SetTranslation(bool); 
     161  void SetRotation(bool); 
     162  void SetScale(bool); 
    158163}; 
    159164 
     
    204209        int mShowDistribution; 
    205210 
     211        int mCurrentDynamicObjectIdx; 
     212 
    206213        // some statistics 
    207214        int mPvsSize; 
     
    214221 
    215222        int mRayVisualizationMethod; 
     223        int mTrafoType; 
    216224 
    217225        QtRendererControlWidget *mControlWidget; 
     
    267275        virtual int GetHeight() const { return height(); } 
    268276 
    269         // virtual void 
    270         //  SetupProjection(const int w, const int h, const float angle = 70.0f); 
    271  
    272277        virtual void 
    273278                SetupCameraProjection(const int w, const int h, const float angle = 70.0f); 
     
    479484                mRayVisualizationMethod = 3; 
    480485        } 
    481          
     486 
     487        void SetTranslation(bool b) 
     488        { 
     489                mTrafoType = 0; 
     490        } 
     491 
     492        void SetScale(bool b) 
     493        { 
     494                mTrafoType = 1; 
     495        } 
     496         
     497        void SetRotation(bool b) 
     498        { 
     499                mTrafoType = 2; 
     500        } 
     501 
    482502        void SetShowDistribution1(bool b) 
    483503        { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp

    r2609 r2614  
    242242QtGlViewer::mouseMoveEvent(QMouseEvent *event) 
    243243{ 
    244   int dx = event->x() - lastPos.x(); 
    245   int dy = event->y() - lastPos.y();   
    246    
    247   if (event->modifiers() & Qt::CTRL) 
    248                 { 
    249                         scale = scale*(1.0f - dy/(float)height()); 
    250                         if (scale < 0.01f) 
    251                                 scale = 0.01f; 
    252                         updateGL(); 
    253                 } 
    254   else { 
     244        int dx = event->x() - lastPos.x(); 
     245        int dy = event->y() - lastPos.y();   
     246 
     247        if (event->modifiers() & Qt::CTRL) 
     248        { 
     249                scale = scale*(1.0f - dy/(float)height()); 
     250                if (scale < 0.01f) 
     251                        scale = 0.01f; 
     252                updateGL(); 
     253        } 
     254        else 
     255        { 
    255256                float W = width(); 
    256257                float H = height(); 
     
    259260                int y = event->y(); 
    260261                int lastY = lastPos.y(); 
    261          
     262 
    262263                float quat[4]; 
    263264                trackball(quat, 
    264                                   (2.0 * lastX - W) / W, 
    265                                   (H - 2.0 * lastY) / H, 
    266                                   (2.0 * x - W) / W, 
    267                                   (H - 2.0 * y) / H 
    268                                   ); 
     265                        (2.0 * lastX - W) / W, 
     266                        (H - 2.0 * lastY) / H, 
     267                        (2.0 * x - W) / W, 
     268                        (H - 2.0 * y) / H 
     269                        ); 
    269270 
    270271                add_quats(quat, manipulatorLastQuat, manipulatorLastQuat); 
    271   } 
    272    
    273   lastPos = event->pos(); 
    274   updateGL(); 
    275 } 
    276  
    277 void QtGlViewer::timerEvent(QTimerEvent *event)  
    278 { 
    279         update(); 
    280 } 
    281  
    282  
    283 } 
    284  
     272        } 
     273 
     274        lastPos = event->pos(); 
     275        updateGL(); 
     276} 
     277 
     278        void QtGlViewer::timerEvent(QTimerEvent *event)  
     279        { 
     280                update(); 
     281        } 
     282 
     283 
     284} 
     285 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.h

    r2567 r2614  
    5858        float scale; 
    5959        QPoint lastPos; 
    60  
    6160}; 
    6261 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp

    r2588 r2614  
    584584        } 
    585585 
     586 
    586587        for(; it != vssRays.end(); ++it)  
    587588        { 
    588589                VssRay *ray = *it; 
    589590 
    590                 //cout << " here4 " << ray->GetDir(); 
     591                //if (ray->mTerminationObject->Type() == Intersectable::TRANSFORMED_MESH_INSTANCE) 
     592                //      cout << "found transofrmed mesh instance: " << Intersectable::GetTypeName(ray->mTerminationObject) << " " << endl; 
    591593 
    592594                for (i=0; i < mDistributions.size()-1; i++)  
     
    596598                } 
    597599 
    598                 float contribution = 
    599                         mPreprocessor.mViewCellsManager->ComputeSampleContribution(*ray, 
    600                         true, 
    601                         false); 
     600                const float contribution = 
     601                        mPreprocessor.mViewCellsManager->ComputeSampleContribution(*ray, true, false); 
    602602 
    603603                mDistributions[i]->mContribution += contribution; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r2609 r2614  
    24072407                                                                                                   Intersectable *obj, 
    24082408                                                                                                   const Vector3 &pt, 
    2409                                                                                                    const bool addSamplesToPvs) 
     2409                                                                                                   bool addSamplesToPvs) 
    24102410{ 
    24112411        // check if we are outside of view space 
     
    24242424        if (addSamplesToPvs)  
    24252425        { 
     2426                //if (obj->Type() == Intersectable::TRANSFORMED_MESH_INSTANCE)cout << "here12 " << endl; 
     2427 
    24262428                hasAbsContribution = viewCell->GetPvs().AddSampleDirtyCheck(obj, ray.mPdf); 
    24272429                //hasAbsContribution = viewCell->GetPvs().AddSample(obj,ray.mPdf); 
     
    24372439                        viewCell->GetPvs().GetSampleContribution(obj, ray.mPdf, relContribution); 
    24382440        } 
    2439  
    2440         //cout << "here6: " << ray.GetDir() << " "; 
    24412441 
    24422442        // $$ clear the relative contribution as it is currently not correct anyway 
     
    24832483 
    24842484void 
    2485 ViewCellsManager::DeterminePvsObjects( 
    2486                                                                           VssRayContainer &rays, 
    2487                                                                           const bool useHitObjects) 
     2485ViewCellsManager::DeterminePvsObjects(VssRayContainer &rays, 
     2486                                                                          bool useHitObjects) 
    24882487{ 
    24892488        if (!useHitObjects)  
     
    24982497                        // set only the termination object 
    24992498                        vssRay->mTerminationObject = GetIntersectable(*vssRay, true); 
     2499                         
     2500                        if (vssRay->mTerminationObject->Type() == Intersectable::TRANSFORMED_MESH_INSTANCE)      
     2501                                cout << "r"; 
     2502 
    25002503#if 0 
    2501                   if (vssRay->mTerminationObject == NULL) { 
    2502                         cerr<<"Error in DeterminePvsObjects - termination object maps to NULL!"<<endl; 
    2503                   } 
     2504                  if (vssRay->mTerminationObject == NULL) 
     2505                          cerr<<"Error in DeterminePvsObjects - termination object maps to NULL!"<<endl; 
    25042506#endif 
    25052507                } 
    25062508        } 
    2507    
    25082509} 
    25092510 
     
    25472548float 
    25482549ViewCellsManager::ComputeSampleContribution(VssRay &ray, 
    2549                                                                                         const bool addRays, 
    2550                                                                                         const bool storeViewCells, 
    2551                                                                                         const bool useHitObjects) 
     2550                                                                                        bool addRays, 
     2551                                                                                        bool storeViewCells, 
     2552                                                                                        bool useHitObjects) 
    25522553{ 
    25532554        ray.mPvsContribution = 0; 
     
    25952596                // traverse the view space subdivision 
    25962597                CastLineSegment(origin, termination, viewCells); 
    2597  
    25982598                lastVssRay = &ray; 
    25992599        } 
     
    26312631        pvsTimer.Entry(); 
    26322632#endif 
    2633          
     2633        //if (terminationObj->Type() == Intersectable::TRANSFORMED_MESH_INSTANCE) 
     2634        //      cout << "found tmi: " << Intersectable::GetTypeName(terminationObj) << " " << viewCells.size() << endl; 
    26342635        bool contri = false; 
    26352636        ViewCellContainer::const_iterator it = viewCells.begin(); 
     
    26382639        { 
    26392640                if (ComputeViewCellContribution(*it,  
    2640                                                 ray,  
    2641                                                                         terminationObj,  
    2642                                                                         ray.mTermination,  
    2643                                                                         addRays)) 
     2641                                                    ray,  
     2642                                                                                terminationObj,  
     2643                                                                                ray.mTermination,  
     2644                                                                                addRays)) 
    26442645                { 
    26452646                        contri = true; 
     
    31663167void ViewCellsManager::MergeViewCellsRecursivly(ObjectPvs &pvs,  
    31673168                                                                                                const ViewCellContainer &viewCells,  
    3168                                                                                                 const int leftIdx,  
    3169                                                                                                 const int rightIdx) const 
     3169                                                                                                int leftIdx,  
     3170                                                                                                int rightIdx) const 
    31703171{ 
    31713172        if (leftIdx == rightIdx) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h

    r2604 r2614  
    206206        */ 
    207207        virtual float ComputeSampleContribution(VssRay &ray,  
    208                                                                                         const bool addContributions, 
    209                                                                                         const bool storeViewCells, 
    210                                                                                         const bool useHitObject = false); 
     208                                                                                        bool addContributions, 
     209                                                                                        bool storeViewCells, 
     210                                                                                        bool useHitObject = false); 
    211211        /** Compute sample contribution only for current view cell. 
    212212        */ 
     
    388388        */ 
    389389        void DeterminePvsObjects(VssRayContainer &rays, 
    390                                                          const bool useHitObjects = false); 
     390                                                         bool useHitObjects = false); 
    391391        /** Sets validity of view cell 
    392392        */ 
     
    640640                                                                         Intersectable *obj, 
    641641                                                                         const Vector3 &pt, 
    642                                                                          const bool addRays); 
     642                                                                         bool addRays); 
    643643 
    644644        void MergeViewCellsRecursivly(ObjectPvs &pvs,  
    645645                                                                  const ViewCellContainer &viewCells,  
    646                                                                   const int leftIdx,  
    647                                                                   const int rightIdx) const; 
     646                                                                  int leftIdx,  
     647                                                                  int rightIdx) const; 
     648 
    648649        /** Intersects box with the tree and returns the number of intersected boxes. 
    649650                @returns number of view cells found 
Note: See TracChangeset for help on using the changeset viewer.