Ignore:
Timestamp:
Dec 8, 2010, 2:03:02 PM (14 years ago)
Author:
gah
Message:

Clean up debugging/printing traces

File:
1 edited

Legend:

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

    r1825 r1984  
    3737    const char *path = R2FilePath::getInstance()->getPath("Font.bmp");
    3838    if (path == NULL) {
    39         fprintf(stderr, "can't find Font.bmp\n");
     39        ERROR("can't find Font.bmp\n");
    4040        assert(path != NULL);
    4141    }
     
    9999        ani_tf = ani_vol->transferFunction();
    100100#endif
    101         Trace("VOLUME INTERPOLATOR IS STARTED ----------------------------");
     101        TRACE("VOLUME INTERPOLATOR IS STARTED ----------------------------");
    102102    }
    103103    // Determine the volumes that are to be rendered.
     
    126126    size_t* actual_slices = new size_t[volumes.size()];
    127127
    128     Trace("start loop %d\n", volumes.size());
     128    TRACE("start loop %d\n", volumes.size());
    129129    for (size_t i = 0; i < volumes.size(); i++) {
    130130        Volume* volPtr;
     
    350350       
    351351    } //iterate all volumes
    352     Trace("end loop\n");
     352    TRACE("end loop\n");
    353353   
    354354    // We sort all the polygons according to their eye-space depth, from
     
    388388       
    389389#ifdef notdef
    390         Trace("shading slice: volume %s addr=%x slice=%d, volume=%d\n",
    391               volPtr->name(), volPtr, slice_index, volume_index);
     390        TRACE("shading slice: volume %s addr=%x slice=%d, volume=%d\n",
     391               volPtr->name(), volPtr, slice_index, volume_index);
    392392#endif
    393393        activate_volume_shader(volPtr, false);
     
    621621    f = fopen(filename, "rb");
    622622    if (f == NULL) {
    623         fprintf(stderr, "can't open font file \"%s\"\n", filename);
     623        ERROR("can't open font file \"%s\"\n", filename);
    624624        return false;
    625625    }
    626626   
    627627    if (fread(&bfType, sizeof(short int), 1, f) != 1) {
    628         fprintf(stderr, "can't read %lu bytes from font file \"%s\"\n",
    629                 (unsigned long)sizeof(short int), filename);
     628        ERROR("can't read %lu bytes from font file \"%s\"\n",
     629               (unsigned long)sizeof(short int), filename);
    630630        goto error;
    631631    }
     
    633633    /* check if file is a bitmap */
    634634    if (bfType != 19778) {
    635         fprintf(stderr, "not a bmp file.\n");
     635        ERROR("not a bmp file.\n");
    636636        goto error;
    637637    }
     
    643643    /* get the position of the actual bitmap data */
    644644    if (fread(&bfOffBits, sizeof(int), 1, f) != 1) {
    645         fprintf(stderr, "error reading file.\n");
     645        ERROR("error reading file.\n");
    646646        goto error;
    647647    }
     
    653653    /* get the width of the bitmap */
    654654    if (fread(&width, sizeof(int), 1, f) != 1) {
    655         fprintf(stderr, "error reading file.\n");
     655        ERROR("error reading file.\n");
    656656        goto error;
    657657    }
     
    660660    /* get the height of the bitmap */
    661661    if (fread(&height, sizeof(int), 1, f) != 1) {
    662         fprintf(stderr, "error reading file.\n");
     662        ERROR("error reading file.\n");
    663663        goto error;
    664664    }
     
    667667    /* get the number of planes (must be set to 1) */
    668668    if (fread(&biPlanes, sizeof(short int), 1, f) != 1) {
    669         fprintf(stderr, "error reading file.\n");
     669        ERROR("error reading file.\n");
    670670        goto error;
    671671    }
    672672    if (biPlanes != 1) {
    673         fprintf(stderr, "Error: number of Planes not 1!\n");
     673        ERROR("number of Planes not 1!\n");
    674674        goto error;
    675675    }
     
    677677    /* get the number of bits per pixel */
    678678    if (fread(&biBitCount, sizeof(short int), 1, f) != 1) {
    679         fprintf(stderr, "error reading file.\n");
     679        ERROR("error reading file.\n");
    680680        goto error;
    681681    }
     
    683683    //printf("Bits per Pixel: %d\n", biBitCount);
    684684    if (biBitCount != 24) {
    685         fprintf(stderr, "Bits per Pixel not 24\n");
     685        ERROR("Bits per Pixel not 24\n");
    686686        goto error;
    687687    }
     
    692692    data = (unsigned char*) malloc(biSizeImage);
    693693    if (data == NULL) {
    694         fprintf(stderr, "Can't allocate memory for image\n");
     694        ERROR("Can't allocate memory for image\n");
    695695        goto error;
    696696    }
     
    699699    fseek(f, bfOffBits, SEEK_SET);
    700700    if (fread(data, biSizeImage, 1, f) != 1) {
    701         fprintf(stderr, "Error loading file!\n");
     701        ERROR("Error loading file!\n");
    702702        goto error;
    703703    }
Note: See TracChangeset for help on using the changeset viewer.