Changeset 2560 for GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Timestamp:
- 12/10/07 09:12:27 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2543 r2560 690 690 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 691 691 692 if (1) { 692 if (1) 693 { 693 694 SetupCameraProjection(width(), height()); 694 695 SetupCamera(); 695 696 696 if (mRenderErrors) { 697 if (mRenderErrors) 698 { 697 699 RenderErrors(); 698 } else { 700 } 701 else 702 { 699 703 glColor3f(0.6f, 0.6f, 0.6f); 700 704 RenderPvs(); … … 845 849 mShowRenderCost = false; 846 850 mShowPvsSizes = false; 851 mShowPiercingRays = false; 847 852 mSpatialFilterSize = 0.01; 848 853 mPvsSize = 0; … … 883 888 connect(mControlWidget, SIGNAL(SetUseSpatialFilter(bool)), 884 889 this, SLOT(SetUseSpatialFilter(bool))); 890 connect(mControlWidget, SIGNAL(SetShowPiercingRays(bool)), this, SLOT(SetShowPiercingRays(bool))); 885 891 886 892 connect(mControlWidget, … … 1146 1152 eq[3] = mSceneCutPlane.mD; 1147 1153 1148 if (mCutViewCells) { 1154 if (mCutViewCells) 1155 { 1149 1156 glClipPlane(GL_CLIP_PLANE0, eq); 1150 1157 glEnable(GL_CLIP_PLANE0); … … 1154 1161 ViewCellContainer &viewcells = mViewCellsManager->GetViewCells(); 1155 1162 int maxPvs = -1; 1156 for (i=0; i < viewcells.size(); i++) 1163 int maxPiercingRays = 0; 1164 1165 for (i = 0; i < viewcells.size(); ++ i) 1157 1166 { 1158 1167 ViewCell *vc = viewcells[i]; … … 1162 1171 if (p > maxPvs) 1163 1172 maxPvs = p; 1164 } 1165 1166 1167 for (i=0; i < viewcells.size(); i++) { 1173 const int piercingRays = vc->GetNumPiercingRays(); 1174 if (piercingRays > maxPiercingRays) 1175 maxPiercingRays = piercingRays; 1176 } 1177 1178 1179 for (i = 0; i < viewcells.size(); ++ i) 1180 { 1168 1181 ViewCell *vc = viewcells[i]; 1169 1182 // Mesh *m = vc->GetMesh(); … … 1171 1184 RgbColor c; 1172 1185 1173 if (!mShowPvsSizes) { 1186 if (!mShowPvsSizes && !mShowPiercingRays) 1187 { 1174 1188 mWireFrame = true; 1175 1189 c = vc->GetColor(); 1176 } else { 1177 // const float importance = 5.0f*mTransferFunction * ((float)vc->GetPvs().CountObjectsInPvs() / (float)maxPvs); 1178 const float importance = 5.0f*mTransferFunction * 1190 } 1191 else if (mShowPiercingRays) 1192 { 1193 // const float importance = 5.0f*mTransferFunction * ((float)vc->GetPvs().CountObjectsInPvs() / (float)maxPvs); 1194 const float importance = 5.0f * mTransferFunction * 1195 ((float)vc->GetNumPiercingRays() / (float)maxPiercingRays); 1196 // c = RgbColor(importance, 1.0f - importance, 0.0f); 1197 c = RainbowColorMapping(importance); 1198 } 1199 else 1200 { 1201 // const float importance = 5.0f*mTransferFunction * ((float)vc->GetPvs().CountObjectsInPvs() / (float)maxPvs); 1202 const float importance = 5.0f * mTransferFunction * 1179 1203 ((float)vc->GetPvs().GetSize() / (float)maxPvs); 1180 // 1204 // c = RgbColor(importance, 1.0f - importance, 0.0f); 1181 1205 c = RainbowColorMapping(importance); 1182 1183 1206 } 1207 1184 1208 glColor3f(c.r, c.g, c.b); 1185 1209 … … 1191 1215 1192 1216 glPopAttrib(); 1193 1194 1217 } 1195 1218 … … 1318 1341 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetShowRays(bool))); 1319 1342 1320 vbox->resize(800,100); 1343 1344 cb = new QCheckBox("Show piercing rays", hbox); 1345 hlayout->addWidget(cb); 1346 cb->setChecked(false); 1347 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetShowPiercingRays(bool))); 1348 1349 vbox->resize(800,150); 1321 1350 1322 1351 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
r2543 r2560 112 112 void SetShowRenderCost(bool); 113 113 void SetShowPvsSizes(bool); 114 void SetShowPiercingRays(bool); 114 115 void SetTopView(bool); 115 116 void SetCutViewCells(bool); 116 117 void SetCutScene(bool); 117 118 118 }; 119 119 … … 137 137 bool mUseSpatialFilter; 138 138 bool mShowRenderCost; 139 bool mShowPiercingRays; 139 140 bool mShowRays; 140 141 … … 293 294 void SetShowPvsSizes(bool b) { 294 295 mShowPvsSizes = b; 296 updateGL(); 297 } 298 299 void SetShowPiercingRays(bool b) { 300 mShowPiercingRays = b; 295 301 updateGL(); 296 302 } -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp
r2538 r2560 52 52 if (mRenderer->mRenderViewCells) 53 53 mRenderer->RenderViewCells(); 54 54 55 55 glColor3f(0.8f, 0.8f, 0.8f); 56 56 mRenderer->RenderPvs(); -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtInterface.vcproj
r2530 r2560 166 166 Name="VCCLCompilerTool" 167 167 AdditionalIncludeDirectories="..\..\src;"$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui";"$(QTDIR)\include";"$(QTDIR)\include\QtOpenGl";..\..\..\..\..\..\..\NonGTP\Zlib\include;"$(CG_INC_PATH)"" 168 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;QTGLRENDERER_EXPORTS;USE_VERBOSE_PVS "168 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;QTGLRENDERER_EXPORTS;USE_VERBOSE_PVS;USE_QT;USE_CG;GTP_INTERNAL" 169 169 RuntimeLibrary="2" 170 170 UsePrecompiledHeader="0"
Note: See TracChangeset
for help on using the changeset viewer.