Ignore:
Timestamp:
01/11/08 02:35:42 (16 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
4 edited

Legend:

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

    r2588 r2591  
    205205 
    206206 
    207 void GlRenderer::RenderRays(const VssRayContainer &rays, int colorType) 
     207void GlRenderer::RenderRays(const VssRayContainer &rays, int colorType, int showDistribution) 
    208208{ 
    209209        VssRayContainer::const_iterator it = rays.begin(), it_end = rays.end(); 
     
    217217                VssRay *ray = *it; 
    218218 
     219                // only show distributions that were checked 
     220                if (((ray->mDistribution == SamplingStrategy::DIRECTION_BASED_DISTRIBUTION) && ((showDistribution & 1) == 0)) || 
     221                        ((ray->mDistribution == SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION) && ((showDistribution & 2) == 0)) || 
     222                        ((ray->mDistribution == SamplingStrategy::OBJECT_DIRECTION_BASED_DISTRIBUTION) && ((showDistribution & 4) == 0)) || 
     223                        ((ray->mDistribution == SamplingStrategy::MUTATION_BASED_DISTRIBUTION) && ((showDistribution & 8) == 0))) 
     224                { 
     225                        continue; 
     226                } 
     227                 
    219228                switch (colorType) 
    220229                { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h

    r2587 r2591  
    129129 
    130130  void 
    131   RenderRays(const VssRayContainer &rays, int colorType = 0); 
     131  RenderRays(const VssRayContainer &rays, int colorType = 0, int showDistribution = 15); 
    132132 
    133133  void 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp

    r2587 r2591  
    717717                if (1 && mShowRays)  
    718718                { 
    719                         RenderRays(mViewCellsManager->mVizBuffer.GetRays(), mRayVisualizationMethod); 
     719                        RenderRays(mViewCellsManager->mVizBuffer.GetRays(), mRayVisualizationMethod, mShowDistribution); 
    720720                } 
    721721        } 
     
    877877        mShowDistanceWeightedTriangles = false; 
    878878        mShowWeightedTriangles = false; 
     879        mShowDistribution = 15; 
    879880 
    880881        mSpatialFilterSize = 0.01; 
     
    931932        connect(mControlWidget, SIGNAL(SetShowDistribution(bool)), this, SLOT(SetShowDistribution(bool))); 
    932933 
    933  
    934         connect(mControlWidget, 
    935                 SIGNAL(SetShowRays(bool)), 
    936                 this, 
    937                 SLOT(SetShowRays(bool))); 
     934        connect(mControlWidget, SIGNAL(SetShowDistribution1(bool)), this, SLOT(SetShowDistribution1(bool))); 
     935        connect(mControlWidget, SIGNAL(SetShowDistribution2(bool)), this, SLOT(SetShowDistribution2(bool))); 
     936        connect(mControlWidget, SIGNAL(SetShowDistribution3(bool)), this, SLOT(SetShowDistribution3(bool))); 
     937        connect(mControlWidget, SIGNAL(SetShowDistribution4(bool)), this, SLOT(SetShowDistribution4(bool))); 
     938 
     939 
     940        connect(mControlWidget, SIGNAL(SetShowRays(bool)), this, SLOT(SetShowRays(bool))); 
    938941 
    939942        resize(1000, 500); 
     
    16481651        connect(rb4, SIGNAL(toggled(bool)), SIGNAL(SetShowDistribution(bool))); 
    16491652 
     1653 
     1654        /////////////////////////// 
     1655 
     1656         
    16501657        QGroupBox *groupBox = new QGroupBox("Ray visualization options"); 
    16511658        QVBoxLayout *vbox2 = new QVBoxLayout; 
     
    16571664         
    16581665        rb1->setChecked(true); 
     1666 
     1667 
     1668        QCheckBox *cb = new QCheckBox("Distribution 1", parent); 
     1669        vbox2->addWidget(cb); 
     1670        cb->setChecked(true); 
     1671        connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetShowDistribution1(bool))); 
     1672 
     1673        cb = new QCheckBox("Distribution 2", parent); 
     1674        vbox2->addWidget(cb); 
     1675        cb->setChecked(true); 
     1676        connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetShowDistribution2(bool))); 
     1677 
     1678        cb = new QCheckBox("Distribution 3", parent); 
     1679        vbox2->addWidget(cb); 
     1680        cb->setChecked(true); 
     1681        connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetShowDistribution3(bool))); 
     1682         
     1683        cb = new QCheckBox("Distribution 4", parent); 
     1684        vbox2->addWidget(cb); 
     1685        cb->setChecked(true); 
     1686        connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetShowDistribution4(bool))); 
     1687 
    16591688 
    16601689        vbox2->addStretch(1); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h

    r2587 r2591  
    147147  void SetShowContribution(bool); 
    148148  void SetShowDistribution(bool); 
     149 
     150  void SetShowDistribution1(bool); 
     151  void SetShowDistribution2(bool); 
     152  void SetShowDistribution3(bool); 
     153  void SetShowDistribution4(bool); 
    149154}; 
    150155 
     
    191196        bool mShowDistanceWeightedPvs; 
    192197        bool mShowWeightedTriangles; 
     198         
     199        int mShowDistribution; 
    193200 
    194201        // some statistics 
     
    459466                mRayVisualizationMethod = 3; 
    460467        } 
    461  
     468         
     469        void SetShowDistribution1(bool b) 
     470        { 
     471                if (b) 
     472                        mShowDistribution |= 1; 
     473                else 
     474                        mShowDistribution ^= 1; 
     475 
     476                std::cout << "b: " << (mShowDistribution & 1) << " " << (mShowDistribution & 2) << " " << (mShowDistribution & 4) << " " << (mShowDistribution & 8) << std::endl;  
     477        } 
     478 
     479         
     480        void SetShowDistribution2(bool b) 
     481        { 
     482                if (b) 
     483                        mShowDistribution |= 2; 
     484                else 
     485                        mShowDistribution ^= 2; 
     486        } 
     487 
     488         
     489        void SetShowDistribution3(bool b) 
     490        { 
     491                if (b) 
     492                        mShowDistribution |= 4; 
     493                else 
     494                        mShowDistribution ^= 4; 
     495        } 
     496         
     497        void SetShowDistribution4(bool b) 
     498        { 
     499                if (b) 
     500                        mShowDistribution |= 8; 
     501                else 
     502                        mShowDistribution ^= 8; 
     503        } 
    462504 
    463505        void _RenderPvs(); 
Note: See TracChangeset for help on using the changeset viewer.