Changeset 5718 for nanovis/branches
- Timestamp:
- Jun 17, 2015 2:23:37 AM (6 years ago)
- Location:
- nanovis/branches/1.2
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
nanovis/branches/1.2
- Property svn:mergeinfo changed
/nanovis/trunk merged: 5712-5717
- Property svn:mergeinfo changed
-
nanovis/branches/1.2/ConvexPolygon.cpp
r4889 r5718 136 136 137 137 void 138 ConvexPolygon::emit(bool useTexture)138 ConvexPolygon::emit(bool emitTexcoords) 139 139 { 140 140 if (vertices.size() >= 3) { 141 141 for (unsigned int i = 0; i < vertices.size(); i++) { 142 if ( useTexture) {142 if (emitTexcoords) { 143 143 glTexCoord4fv((float *)&(texcoords[i])); 144 //glTexCoord4fv((float *)&(vertices[i]));145 144 } 146 145 glVertex4fv((float *)&(vertices[i])); … … 150 149 } 151 150 } 152 153 void154 ConvexPolygon::emit(bool useTexture, const Vector3f& shift, const Vector3f& scale)155 {156 if (vertices.size() >= 3) {157 for (unsigned int i = 0; i < vertices.size(); i++) {158 if (useTexture) {159 glTexCoord4fv((float *)&(vertices[i]));160 }161 Vector4f tmp = (vertices[i]);162 Vector4f shift_4d = Vector4f(shift.x, shift.y, shift.z, 0);163 tmp = tmp + shift_4d;164 tmp.x = tmp.x * scale.x;165 tmp.y = tmp.y * scale.y;166 tmp.z = tmp.z * scale.z;167 glVertex4fv((float *)(&tmp));168 }169 } else {170 WARN("No polygons to render");171 }172 } -
nanovis/branches/1.2/ConvexPolygon.h
r4889 r5718 38 38 bool clip(nv::Plane& clipPlane, bool copyToTexcoords); 39 39 40 void emit(bool useTexture); 41 42 void emit(bool useTexture, const vrmath::Vector3f& shift, const vrmath::Vector3f& scale); 40 void emit(bool emitTexcoords); 43 41 44 42 void copyVerticesToTexcoords(); -
nanovis/branches/1.2/HeightMap.cpp
r5701 r5718 76 76 glPushMatrix(); 77 77 78 #ifndef notdef79 78 if (_scale.x != 0.0) { 80 79 glScalef(1 / _scale.x, 1 / _scale.y , 1 / _scale.z); 81 80 } 82 #endif83 81 glTranslatef(-_centerPoint.x, -_centerPoint.y, -_centerPoint.z); 84 82 … … 304 302 _contour = lineFilter.create(0.0f, 1.0f, 10, heights, xCount, yCount); 305 303 306 //if (heightMap) 307 // {308 // VertexBuffer* vertexBuffer = new VertexBuffer(VertexBuffer::POSITION3, xCount * yCount,sizeof(Vector3f) * xCount * yCount, heightMap, false);304 //if (heightMap) { 305 // VertexBuffer* vertexBuffer = new VertexBuffer(VertexBuffer::POSITION3, xCount * yCount, 306 // sizeof(Vector3f) * xCount * yCount, heightMap, false); 309 307 this->createIndexBuffer(xCount, yCount, 0); 310 //} 311 //else 312 //{ 313 //ERROR("HeightMap::setHeight"); 308 //} else { 309 // ERROR("HeightMap::setHeight"); 314 310 //} 315 311 } … … 334 330 } 335 331 } 336 #ifdef notdef337 if (retainScale_) {338 // Check the units of each axis. If they are the same, we want to339 // retain the surface's aspect ratio when transforming coordinates to340 // the grid. Use the range of the longest axis when the units are the341 // same.342 if (xAxis.units() != NULL) && (xAxis.units() == yAxis.units()) {343 }344 if (yAxis.units() != NULL) && (yAxis.units() == zAxis.units()) {345 }346 }347 #endif348 332 349 333 wAxis.setRange(min, max); … … 362 346 _centerPoint.set(0.5, 0.5, 0.5); 363 347 364 #ifndef notdef365 348 Vector3f* texcoord = new Vector3f[_vertexCount]; 366 349 for (int i = 0; i < _vertexCount; ++i) { … … 394 377 this->createIndexBuffer(xNum, yNum, heights); 395 378 delete [] map; 396 #endif397 379 } 398 380 -
nanovis/branches/1.2/ParticleAdvectionShader.h
r5588 r5718 34 34 _max = max; 35 35 /* FIXME: _max is the maximum displacement in world coords per 36 * time step. Need to determine a scale factor to get an 36 * time step. Need to determine a scale factor to get an 37 37 * appropriate animation speed 38 38 */ -
nanovis/branches/1.2/ParticleRenderer.h
r5588 r5718 118 118 bool _flip; 119 119 120 /// Maximum number of frame iterations before reset 120 121 unsigned int _maxLife; 121 122 -
nanovis/branches/1.2/VtkDataSetReader.cpp
r5699 r5718 147 147 print(dataSet); 148 148 149 int maxDim = 64;150 151 149 resampledDataSet = vtkImageData::SafeDownCast(dataSet.GetPointer()); 152 150 if (resampledDataSet != NULL) { 153 151 // Have a uniform grid, check if we need to resample 154 152 #ifdef DOWNSAMPLE_DATA 153 int maxDim = 64; 154 #else 155 // This is the hardware limit 156 int maxDim = NanoVis::max3dTextureSize; 157 #endif 155 158 if (resampledDataSet->GetDimensions()[0] > maxDim || 156 159 resampledDataSet->GetDimensions()[1] > maxDim || … … 158 161 resampledDataSet = resampleVTKDataSet(dataSet, maxDim); 159 162 } 160 #endif161 163 } else { 164 int maxDim = 64; 162 165 resampledDataSet = resampleVTKDataSet(dataSet, maxDim); 163 166 } -
nanovis/branches/1.2/nanovis.cpp
r5702 r5718 77 77 Camera *NanoVis::_camera = NULL; 78 78 RenderContext *NanoVis::renderContext = NULL; 79 GLint NanoVis::max3dTextureSize = 2048; 79 80 80 81 NanoVis::TransferFunctionHashmap NanoVis::tfTable; … … 285 286 int 286 287 NanoVis::renderLegend(TransferFunction *tf, double min, double max, 287 int width, int height, const char * volArg)288 int width, int height, const char *tag) 288 289 { 289 290 TRACE("Enter"); … … 313 314 char prefix[200]; 314 315 315 TRACE("Sending ppm legend image %s min:%g max:%g", volArg, min, max);316 sprintf(prefix, "nv>legend %s %g %g", volArg, min, max);316 TRACE("Sending ppm legend image %s min:%g max:%g", tag, min, max); 317 sprintf(prefix, "nv>legend %s %g %g", tag, min, max); 317 318 #ifdef USE_THREADS 318 319 queuePPM(g_queue, prefix, screenBuffer, width, height); … … 545 546 _camera = new Camera(0, 0, winWidth, winHeight); 546 547 548 glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &max3dTextureSize); 549 TRACE("Max 3D texture dim: %d", max3dTextureSize); 550 547 551 glEnable(GL_TEXTURE_2D); 548 552 glShadeModel(GL_FLAT); -
nanovis/branches/1.2/nanovis.h
r5698 r5718 94 94 95 95 static int renderLegend(TransferFunction *tf, double min, double max, 96 int width, int height, const char * volArg);96 int width, int height, const char *tag); 97 97 98 98 static Volume *loadVolume(const char *tag, int width, int height, int depth, … … 139 139 static util::Fonts *fonts; 140 140 static graphics::RenderContext *renderContext; 141 static GLint max3dTextureSize; 141 142 142 143 static TransferFunctionHashmap tfTable; ///< maps transfunc name to TransferFunction object
Note: See TracChangeset
for help on using the changeset viewer.