Changeset 5718 for nanovis


Ignore:
Timestamp:
Jun 17, 2015, 5:23:37 AM (4 years ago)
Author:
ldelgass
Message:

Merge from trunk

Location:
nanovis/branches/1.2
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • nanovis/branches/1.2

  • nanovis/branches/1.2/ConvexPolygon.cpp

    r4889 r5718  
    136136
    137137void
    138 ConvexPolygon::emit(bool useTexture)
     138ConvexPolygon::emit(bool emitTexcoords)
    139139{
    140140    if (vertices.size() >= 3) {
    141141        for (unsigned int i = 0; i < vertices.size(); i++) {
    142             if (useTexture) {
     142            if (emitTexcoords) {
    143143                glTexCoord4fv((float *)&(texcoords[i]));
    144                 //glTexCoord4fv((float *)&(vertices[i]));
    145144            }
    146145            glVertex4fv((float *)&(vertices[i]));
     
    150149    }
    151150}
    152 
    153 void
    154 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  
    3838    bool clip(nv::Plane& clipPlane, bool copyToTexcoords);
    3939
    40     void emit(bool useTexture);
    41 
    42     void emit(bool useTexture, const vrmath::Vector3f& shift, const vrmath::Vector3f& scale);
     40    void emit(bool emitTexcoords);
    4341
    4442    void copyVerticesToTexcoords();
  • nanovis/branches/1.2/HeightMap.cpp

    r5701 r5718  
    7676    glPushMatrix();
    7777
    78 #ifndef notdef
    7978    if (_scale.x != 0.0) {
    8079        glScalef(1 / _scale.x, 1 / _scale.y , 1 / _scale.z);
    8180    }
    82 #endif
    8381    glTranslatef(-_centerPoint.x, -_centerPoint.y, -_centerPoint.z);
    8482
     
    304302    _contour = lineFilter.create(0.0f, 1.0f, 10, heights, xCount, yCount);
    305303
    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);
    309307    this->createIndexBuffer(xCount, yCount, 0);
    310     //}
    311     //else
    312     //{
    313     //ERROR("HeightMap::setHeight");
     308    //} else {
     309    //    ERROR("HeightMap::setHeight");
    314310    //}
    315311}
     
    334330        }
    335331    }
    336 #ifdef notdef
    337     if (retainScale_) {
    338         // Check the units of each axis.  If they are the same, we want to
    339         // retain the surface's aspect ratio when transforming coordinates to
    340         // the grid. Use the range of the longest axis when the units are the
    341         // same.
    342         if (xAxis.units() != NULL) && (xAxis.units() == yAxis.units()) {
    343         }
    344         if (yAxis.units() != NULL) && (yAxis.units() == zAxis.units()) {
    345         }
    346     }
    347 #endif
    348332
    349333    wAxis.setRange(min, max);
     
    362346    _centerPoint.set(0.5, 0.5, 0.5);
    363347
    364 #ifndef notdef
    365348    Vector3f* texcoord = new Vector3f[_vertexCount];
    366349    for (int i = 0; i < _vertexCount; ++i) {
     
    394377    this->createIndexBuffer(xNum, yNum, heights);
    395378    delete [] map;
    396 #endif
    397379}
    398380
  • nanovis/branches/1.2/ParticleAdvectionShader.h

    r5588 r5718  
    3434        _max = max;
    3535        /* 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
    3737         * appropriate animation speed
    3838         */
  • nanovis/branches/1.2/ParticleRenderer.h

    r5588 r5718  
    118118    bool _flip;
    119119
     120    /// Maximum number of frame iterations before reset
    120121    unsigned int _maxLife;
    121122
  • nanovis/branches/1.2/VtkDataSetReader.cpp

    r5699 r5718  
    147147        print(dataSet);
    148148
    149         int maxDim = 64;
    150 
    151149        resampledDataSet = vtkImageData::SafeDownCast(dataSet.GetPointer());
    152150        if (resampledDataSet != NULL) {
    153151            // Have a uniform grid, check if we need to resample
    154152#ifdef DOWNSAMPLE_DATA
     153            int maxDim = 64;
     154#else
     155            // This is the hardware limit
     156            int maxDim = NanoVis::max3dTextureSize;
     157#endif
    155158            if (resampledDataSet->GetDimensions()[0] > maxDim ||
    156159                resampledDataSet->GetDimensions()[1] > maxDim ||
     
    158161                resampledDataSet = resampleVTKDataSet(dataSet, maxDim);
    159162            }
    160 #endif
    161163        } else {
     164            int maxDim = 64;
    162165            resampledDataSet = resampleVTKDataSet(dataSet, maxDim);
    163166        }
  • nanovis/branches/1.2/nanovis.cpp

    r5702 r5718  
    7777Camera *NanoVis::_camera = NULL;
    7878RenderContext *NanoVis::renderContext = NULL;
     79GLint NanoVis::max3dTextureSize = 2048;
    7980
    8081NanoVis::TransferFunctionHashmap NanoVis::tfTable;
     
    285286int
    286287NanoVis::renderLegend(TransferFunction *tf, double min, double max,
    287                       int width, int height, const char *volArg)
     288                      int width, int height, const char *tag)
    288289{
    289290    TRACE("Enter");
     
    313314        char prefix[200];
    314315
    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);
    317318#ifdef USE_THREADS
    318319        queuePPM(g_queue, prefix, screenBuffer, width, height);
     
    545546    _camera = new Camera(0, 0, winWidth, winHeight);
    546547
     548    glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &max3dTextureSize);
     549    TRACE("Max 3D texture dim: %d", max3dTextureSize);
     550
    547551    glEnable(GL_TEXTURE_2D);
    548552    glShadeModel(GL_FLAT);
  • nanovis/branches/1.2/nanovis.h

    r5698 r5718  
    9494
    9595    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);
    9797
    9898    static Volume *loadVolume(const char *tag, int width, int height, int depth,
     
    139139    static util::Fonts *fonts;
    140140    static graphics::RenderContext *renderContext;
     141    static GLint max3dTextureSize;
    141142
    142143    static TransferFunctionHashmap tfTable; ///< maps transfunc name to TransferFunction object
Note: See TracChangeset for help on using the changeset viewer.