Changeset 2613 for GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Timestamp:
- 01/18/08 09:28:09 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2612 r2613 102 102 { 103 103 104 MakeCurrent(); 105 104 106 float pErrorPixels = -1.0f; 105 107 … … 113 115 return 0.0f; 114 116 115 116 117 ObjectPvs pvs; 117 118 118 119 if (1) 119 120 pvs = viewcell->GetPvs(); … … 121 122 mViewCellsManager->ApplyFilter2(viewcell, false, 1.0f, pvs); 122 123 124 mUseForcedColors = true; 125 123 126 SetupCamera(); 124 127 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); 125 128 glColorMask(GL_FALSE, GL_TRUE, GL_FALSE, GL_FALSE); 129 glColor3f(0,1,0); 126 130 127 131 … … 133 137 134 138 pvsSize = pvs.GetSize(); 139 cout<<pvsSize<<endl; 135 140 136 141 Intersectable::NewMail(); … … 140 145 } 141 146 142 143 147 //glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE); 144 148 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 145 149 glEnable(GL_STENCIL_TEST); 146 147 mUseFalseColors = true; 148 150 glColor3f(1,0,0); 151 152 149 153 OcclusionQuery *query = mOcclusionQueries[0]; 150 154 155 // SetupCamera(); 156 157 Intersectable::NewMail(); 158 151 159 query->BeginQuery(); 152 160 153 SetupCamera();154 155 161 RenderScene(); 156 162 157 163 query->EndQuery(); 158 164 glDisable(GL_STENCIL_TEST); … … 166 172 167 173 pixelCount = query->GetQueryResult(); 168 174 // cout<<"pc="<<pixelCount<<endl; 175 169 176 pErrorPixels = ((float)pixelCount)/(GetWidth()*GetHeight()); 170 177 171 178 172 if (mSnapErrorFrames && pErrorPixels >= 0.01f) {179 if (mSnapErrorFrames && (0 && pErrorPixels >= 0.01f)) { 173 180 glReadBuffer(GL_BACK); 181 //glReadBuffer(GL_FRONT); 174 182 175 183 char filename[256]; … … 180 188 181 189 im.save(qstr, "PNG"); 182 if ( 1) { //0 && mFrame == 1543) {190 if (0) { //0 && mFrame == 1543) { 183 191 int x,y; 184 192 int lastIndex = -1; … … 196 204 } 197 205 198 199 206 mUseFalseColors = false; 200 207 glPushAttrib(GL_CURRENT_BIT); 201 208 glColor3f(0,1,0); 202 209 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 203 SetupCamera();204 210 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 205 211 … … 207 213 Intersectable::NewMail(); 208 214 215 209 216 ObjectPvsIterator it = pvs.GetIterator(); 210 217 for (; it.HasMoreEntries(); ) … … 212 219 RenderIntersectable(it.Next()); 213 220 } 221 222 mUseForcedColors = false; 214 223 215 224 im = toImage(); … … 222 231 223 232 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 224 233 234 DoneCurrent(); 235 225 236 return pErrorPixels; 226 237 }
Note: See TracChangeset
for help on using the changeset viewer.