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

Clean up debugging/printing traces

File:
1 edited

Legend:

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

    r1053 r1984  
    3636   
    3737    float transtion = (max - min) / (linecount + 1);
    38    
    3938    float val;
    40     int totalNumOfPoints = 0, numOfPoints;
     39    int totalPoints = 0, numPoints;
    4140    for (int i = 1; i <= linecount; ++i) {
    4241        val = min + i * transtion;
    4342       
    4443        ContourLine* c = new ContourLine(val);
    45         numOfPoints = c->createLine(width, height, vertices, _top);
    46         if (numOfPoints != 0) {
    47             totalNumOfPoints += numOfPoints;
     44        numPoints = c->createLine(width, height, vertices, _top);
     45        if (numPoints != 0) {
     46            totalPoints += numPoints;
    4847            _lines.push_back(c);
    4948        } else {
     
    5150        }
    5251    }
    53    
    54     Vector3* vertexSet = (Vector3*) malloc(sizeof(Vector3) * totalNumOfPoints);
    55     Vector3* colorSet = 0;
     52    Vector3* vertexSet = (Vector3 *)malloc(sizeof(Vector3) * totalPoints);
     53    Vector3* colorSet = NULL;
    5654    if (_colorMap) {
    57         colorSet = (Vector3*) malloc(sizeof(Vector3) * totalNumOfPoints);
    58     }
    59    
     55        colorSet = (Vector3 *)malloc(sizeof(Vector3) * totalPoints);
     56    }
    6057    ContourLineFilter::ContourLineList::iterator iter;
    6158    unsigned int index = 0, colorIndex = 0;
     
    7269        }
    7370    }
    74    
    7571    R2VertexBuffer* vertexBuffer;
    76     vertexBuffer = new R2VertexBuffer(R2VertexBuffer::POSITION3,
    77                                       totalNumOfPoints,
    78                                       totalNumOfPoints * sizeof(Vector3),
    79                                       vertexSet, false);
    80     R2VertexBuffer* colorBuffer = 0;
    81     R2Geometry* geometry = 0;
     72    vertexBuffer = new R2VertexBuffer(R2VertexBuffer::POSITION3, totalPoints,
     73        totalPoints * sizeof(Vector3), vertexSet, false);
     74    R2VertexBuffer* colorBuffer = NULL;
    8275    if (_colorMap) {
    83         colorBuffer  = new R2VertexBuffer(R2VertexBuffer::COLOR4,
    84                                           totalNumOfPoints,
    85                                           totalNumOfPoints * sizeof(Vector3),
    86                                           colorSet, false);
    87     }
    88 
     76        colorBuffer  = new R2VertexBuffer(R2VertexBuffer::COLOR4, totalPoints,
     77                totalPoints * sizeof(Vector3), colorSet, false);
     78    }
     79    R2Geometry* geometry;
    8980    geometry = new R2Geometry(R2Geometry::LINES, vertexBuffer, colorBuffer, 0);
    9081    clear();
     
    10192
    10293    float val;
    103     int totalNumOfPoints = 0, numOfPoints;
     94    int totalPoints = 0, numPoints;
    10495    for (int i = 1; i <= linecount; ++i) {
    10596        val = min + i * transtion;
    10697       
    10798        ContourLine* c = new ContourLine(val);
    108         numOfPoints = c->createLine(width, height, vertices, _top);
    109         if (numOfPoints != 0) {
    110             totalNumOfPoints += numOfPoints;
     99        numPoints = c->createLine(width, height, vertices, _top);
     100        if (numPoints != 0) {
     101            totalPoints += numPoints;
    111102            _lines.push_back(c);
    112103        } else {
     
    114105        }
    115106    }
    116     Vector3* vertexSet = (Vector3*) malloc(sizeof(Vector3) * totalNumOfPoints);
    117     Vector3* colorSet = (Vector3*) malloc(sizeof(Vector3) * totalNumOfPoints);
     107    Vector3* vertexSet = (Vector3 *)malloc(sizeof(Vector3) * totalPoints);
     108    Vector3* colorSet  = (Vector3 *)malloc(sizeof(Vector3) * totalPoints);
    118109       
    119110    ContourLineFilter::ContourLineList::iterator iter;
     
    133124    }
    134125    R2VertexBuffer* vertexBuffer;
    135     vertexBuffer = new R2VertexBuffer(R2VertexBuffer::POSITION3,
    136                                       totalNumOfPoints,
    137                                       totalNumOfPoints * sizeof(Vector3),
    138                                       vertexSet, false);
     126    vertexBuffer = new R2VertexBuffer(R2VertexBuffer::POSITION3, totalPoints,
     127        totalPoints * sizeof(Vector3), vertexSet, false);
    139128    R2VertexBuffer* colorBuffer;
    140     colorBuffer = new R2VertexBuffer(R2VertexBuffer::COLOR4, totalNumOfPoints,
    141                                      totalNumOfPoints * sizeof(Vector3),
    142                                      colorSet, false);
     129    colorBuffer = new R2VertexBuffer(R2VertexBuffer::COLOR4, totalPoints,
     130        totalPoints * sizeof(Vector3), colorSet, false);
    143131    R2Geometry* geometry;
    144132    geometry = new R2Geometry(R2Geometry::LINES, vertexBuffer, colorBuffer, 0);
     
    224212}
    225213
    226 bool
    227 ContourLineFilter::ContourLine::isValueWithIn(float val1, float Val2)
    228 {
    229     return ((_value >= val1 && _value <= Val2) ||
    230             (_value >= Val2 && _value <= val1));
    231 }
    232214
    233215void
Note: See TracChangeset for help on using the changeset viewer.