Ignore:
Timestamp:
Jun 2, 2006 9:38:14 PM (18 years ago)
Author:
mmc
Message:

Added a new "legend" command, which can be used to request the
legend strip for a transfer function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/vizservers/nanovis/VolumeRenderer.cpp

    r452 r455  
    7474    }
    7575  }
     76}
     77
     78TransferFunction*
     79VolumeRenderer::get_volume_shading(Volume* _vol)
     80{
     81  for (int i=0; i < volume.size(); i++) {
     82    if (volume[i] == _vol) {
     83      return tf[i];
     84    }
     85  }
     86  return NULL;
    7687}
    7788
     
    891902
    892903  //x
    893   glColor3f(0., 0., 0.5);
    894 
    895   int length = strlen(vol->label[0]);
     904  glColor3f(0.5, 0.5, 0.5);
     905
     906  int length = vol->label[0].size();
    896907  glPushMatrix();
    897908 
    898     glTranslatef(.5*vol->aspect_ratio_width, vol->aspect_ratio_height, -0.2*vol->aspect_ratio_depth);
     909    glTranslatef(.5*vol->aspect_ratio_width, vol->aspect_ratio_height, -0.1*vol->aspect_ratio_depth);
    899910    glRotatef(180, 0, 0, 1);
    900911    glRotatef(90, 1, 0, 0);
    901912
    902     glScalef(0.00035, 0.00035, 0.00035);
     913    glScalef(0.0008, 0.0008, 0.0008);
    903914    for(int i=0; i<length; i++){
    904       glutStrokeCharacter(GLUT_STROKE_ROMAN, vol->label[0][i]);
     915      glutStrokeCharacter(GLUT_STROKE_ROMAN, vol->label[0].c_str()[i]);
    905916      glTranslatef(0.04, 0., 0.);
    906917    }
     
    908919
    909920  //y
    910   length = strlen(vol->label[1]);
     921  length = vol->label[1].size();
    911922  glPushMatrix();
    912     glTranslatef(vol->aspect_ratio_width, 0.5*vol->aspect_ratio_height, -0.2*vol->aspect_ratio_depth);
     923    glTranslatef(vol->aspect_ratio_width, 0.5*vol->aspect_ratio_height, -0.1*vol->aspect_ratio_depth);
    913924    glRotatef(90, 0, 1, 0);
    914925    glRotatef(90, 0, 0, 1);
    915926
    916     glScalef(0.00035, 0.00035, 0.00035);
     927    glScalef(0.0008, 0.0008, 0.0008);
    917928    for(int i=0; i<length; i++){
    918       glutStrokeCharacter(GLUT_STROKE_ROMAN, vol->label[1][i]);
     929      glutStrokeCharacter(GLUT_STROKE_ROMAN, vol->label[1].c_str()[i]);
    919930      glTranslatef(0.04, 0., 0.);
    920931    }
     
    923934
    924935  //z
    925   length = strlen(vol->label[2]);
     936  length = vol->label[2].size();
    926937  glPushMatrix();
    927938    glTranslatef(0., 1.*vol->aspect_ratio_height, 0.5*vol->aspect_ratio_depth);
    928939    glRotatef(90, 0, 1, 0);
    929940
    930     glScalef(0.00035, 0.00035, 0.00035);
     941    glScalef(0.0008, 0.0008, 0.0008);
    931942    for(int i=0; i<length; i++){
    932       glutStrokeCharacter(GLUT_STROKE_ROMAN, vol->label[2][i]);
     943      glutStrokeCharacter(GLUT_STROKE_ROMAN, vol->label[2].c_str()[i]);
    933944      glTranslatef(0.04, 0., 0.);
    934945    }
Note: See TracChangeset for help on using the changeset viewer.