Commit c103e7d1 authored by bonnell's avatar bonnell

Warning cleanup

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23673 18c085ea-50e0-402c-830e-de6fd14e8384
parent c4aee9a8
......@@ -385,7 +385,6 @@ avtBoundaryFilter::ModifyContract(avtContract_p spec)
spec->GetDataRequest()->AddSecondaryVariable(pointVar.c_str());
}
//avtDataAttributes &data = GetInput()->GetInfo().GetAttributes();
if (spec->GetDataRequest()->MayRequireZones() ||
spec->GetDataRequest()->MayRequireNodes())
{
......
......@@ -665,7 +665,7 @@ avtOpenGLCurveRenderer::DrawCurveAsSymbols()
#define MAX_SYMBOL_VERTS 25
double symbolPoints[MAX_SYMBOL_VERTS][2];
int symbolNVerts = 0; ///TODO: check fix for uninitialized warning
int symbolNVerts = 0;
if (atts.GetSymbol() == CurveAttributes::Point)
{
symbolNVerts = 1;
......@@ -750,6 +750,16 @@ avtOpenGLCurveRenderer::DrawCurveAsSymbols()
glLineWidth(2.);
glBegin(GL_LINES);
}
else // shouldn't happen, but let's default to Point, for completeness
{
debug3 << "avtOpenGLCurveRenderer encountered invalid symbol type, reverting"
<< " to Point" << endl;
symbolNVerts = 1;
glPointSize(atts.GetPointSize());
symbolPoints[0][0] = 0.;
symbolPoints[0][1] = 0.;
glBegin(GL_POINTS);
}
// static case
if (atts.GetPointFillMode() == CurveAttributes::Static)
......
......@@ -412,7 +412,6 @@ avtFilledBoundaryFilter::ModifyContract(avtContract_p spec)
spec->SetCalculateVariableExtents(pointVar, true);
}
//avtDataAttributes &data = GetInput()->GetInfo().GetAttributes();
if (spec->GetDataRequest()->MayRequireZones() ||
spec->GetDataRequest()->MayRequireNodes())
{
......
......@@ -267,7 +267,7 @@ avtFilledBoundaryPlot::SetAtts(const AttributeGroup *a)
{
levelsMapper->DataScalingOff();
}
//avtPointGlypher::PointGlyphType glyphType = avtPointGlypher::Point;
if (atts.GetPointType() == FilledBoundaryAttributes::Box)
levelsMapper->SetGlyphType(avtPointGlypher::Box);
else if (atts.GetPointType() == FilledBoundaryAttributes::Axis)
......
......@@ -140,10 +140,6 @@ QvisHistogramPlotWindow::~QvisHistogramPlotWindow()
void
QvisHistogramPlotWindow::CreateWindowContents()
{
// Figure out the max width that we want to allow for some simple
// line edit widgets.
//int maxWidth = fontMetrics().width("1.0000000000");
QGridLayout *mainLayout = new QGridLayout();
topLayout->addLayout(mainLayout);
......
......@@ -71,8 +71,6 @@
// Look for the original cell number array.
//
vtkUnsignedIntArray *originalCells = 0;
//vtkDataArray *subsetLabel = 0;
//vtkDataArray *materialLabels = 0;
vtkDataArray *data = input->GetCellData()->GetArray("LabelFilterOriginalCellNumbers");
if(data == 0 && atts.GetVarType() == LabelAttributes::LABEL_VT_VECTOR_VAR)
{
......@@ -271,7 +269,7 @@
BEGIN_LABEL
labelString[0] = '\0';
double *vals = data->GetTuple(id);
//bool atStart = true;
for (int comp = 0 ; comp < nComps ; comp++)
{
char *formatString = NULL;
......
......@@ -256,7 +256,7 @@ debug3 << "Labelling nodes with 3d tensor data" << endl;
BEGIN_LABEL
labelString[0] = '\0';
double *vals = data->GetTuple(id);
//bool atStart = true;
for (int comp = 0 ; comp < nComps ; comp++)
{
char *formatString = NULL;
......@@ -331,7 +331,7 @@ debug3 << "Labelling nodes with original node indices: "
// const float *vert = p->GetPoint(id);
BEGIN_LABEL
unsigned int realNodeId = originalNodes->GetValue(id);
if(realNodeId == (unsigned int)-1) ///TODO: check fix that converts -1 to max
if(realNodeId == (unsigned int)-1)
{
CREATE_LABEL(labelString, MAX_LABEL_SIZE, " ");
}
......@@ -353,7 +353,7 @@ debug3 << "Labelling nodes with original node indices: "
// const float *vert = p->GetPoint(id);
BEGIN_LABEL
unsigned int realNodeId = originalNodes->GetValue(id);
if(realNodeId == (unsigned int)-1) ///TODO: check on fix asunsigned int cannot become -1 converting to max
if(realNodeId == (unsigned int)-1)
{
CREATE_LABEL(labelString, MAX_LABEL_SIZE, " ");
}
......@@ -381,7 +381,7 @@ debug3 << "Labelling nodes with original node indices: "
// const float *vert = p->GetPoint(id);
BEGIN_LABEL
unsigned int realNodeId = originalNodes->GetValue(id);
if(realNodeId == (unsigned int)-1) ///TODO: check fix that converts -1 to max
if(realNodeId == (unsigned int)-1)
{
CREATE_LABEL(labelString, MAX_LABEL_SIZE, " ");
}
......
......@@ -443,7 +443,8 @@ avtLabelPlot::CustomizeBehavior(void)
debug4 << "avtLabelPlot::CustomizeBehavior: Labels = " << endl;
std::vector<std::string> labels;
behavior->GetInfo().GetAttributes().GetLabels(labels);
for(size_t i = 0; i < labels.size(); ++i) {
for(size_t i = 0; i < labels.size(); ++i)
{
debug4 << "\tlabel["<<i<<"] = " << labels[i].c_str() << endl;
}
debug4 << endl;
......
......@@ -2075,13 +2075,16 @@ avtOpenGLLabelRenderer::InitializeZBuffer(bool haveNodeData,
zTolerance = float(zShift * 1.001);
}
if(zBufferMode == ZBUFFER_DONT_USE) {
if(zBufferMode == ZBUFFER_DONT_USE)
{
debug4 << mName << "zBufferMode = ZBUFFER_DONT_USE" << endl;
}
else if(zBufferMode == ZBUFFER_USE_PROVIDED) {
else if(zBufferMode == ZBUFFER_USE_PROVIDED)
{
debug4 << mName << "zBufferMode = ZBUFFER_USE_PROVIDED" << endl;
}
else if(zBufferMode == ZBUFFER_QUERY) {
else if(zBufferMode == ZBUFFER_QUERY)
{
debug4 << mName << "zBufferMode = ZBUFFER_QUERY" << endl;
}
}
......
......@@ -499,7 +499,6 @@ avtMeshFilter::ModifyContract(avtContract_p spec)
rv->SetCalculateVariableExtents(pointVar, true);
}
//avtDataAttributes &data = GetInput()->GetInfo().GetAttributes();
if (spec->GetDataRequest()->MayRequireZones() ||
spec->GetDataRequest()->MayRequireNodes())
{
......
......@@ -1230,28 +1230,33 @@ avtMeshPlot::SetOpaqueMeshIsAppropriate(bool val)
// Kathleen Bonnell, Thu Feb 5 11:07:05 PST 2004
// If Auto mode, only show opaque if ShowInternal is OFF.
//
// Kathleen Biagas, Tue Jul 8 11:19:38 PDT 2014
// Made Auto also be the default (its the default in the atts), so that
// shouldBeOn is guaranteed to be set.
//
// ****************************************************************************
bool
avtMeshPlot::ShouldRenderOpaque(void)
{
bool shouldBeOn = false; ///TODO: check on fix for uninitialized value
bool shouldBeOn = false;
switch (atts.GetOpaqueMode())
{
case MeshAttributes::Auto:
// Only on if appropriate
shouldBeOn = atts.GetOpaqueMeshIsAppropriate() &&
!atts.GetShowInternal();
break;
case MeshAttributes::On:
// Always on
case MeshAttributes::On:
// Always on
shouldBeOn = true;
break;
case MeshAttributes::Off:
// On if wireframeRendering is Inappropriate.
case MeshAttributes::Off:
// On if wireframeRendering is Inappropriate.
shouldBeOn = wireframeRenderingIsInappropriate;
break;
case MeshAttributes::Auto:
default:
// Only on if appropriate
shouldBeOn = atts.GetOpaqueMeshIsAppropriate() &&
!atts.GetShowInternal();
break;
}
return shouldBeOn;
}
......
......@@ -396,7 +396,6 @@ avtMantaMoleculeRenderer::DrawAtomsAsSpheres(vtkPolyData *data,
float ptOffsets[4][3] = {
{-1., -1., 0.}, {1., -1., 0.},{1., 1., 0.}, {-1., 1., 0.}
};
const float texCoords[4][2] = {{0., 0.}, {1.,0.}, {1.,1.}, {0.,1.}};
bool imposter = atts.GetDrawAtomsAs() == MoleculeAttributes::ImposterAtoms;
int vmode = 0;
if(imposter)
......@@ -463,7 +462,7 @@ avtMantaMoleculeRenderer::DrawAtomsAsSpheres(vtkPolyData *data,
else if (radiusvar && sbv)
radius = radiusvar[atom] * radiusscale;
unsigned char colora[3];
unsigned char colora[3] = {0, 0, 0};
// Determine color
if (color_by_element)
{
......@@ -515,7 +514,8 @@ avtMantaMoleculeRenderer::DrawAtomsAsSpheres(vtkPolyData *data,
mpdm->AddSphere(pos[0],pos[1],pos[2], radius, colora[0], colora[1], colora[2]);
/*if(vmode == 2)
/*const float texCoords[4][2] = {{0., 0.}, {1.,0.}, {1.,1.}, {0.,1.}};
if(vmode == 2)
{
// Plot squares. Use the same point for each of the vertices;
// a vertex program will figure out the real coordinates.
......@@ -795,7 +795,6 @@ avtMantaMoleculeRenderer::DrawBonds(vtkPolyData *data,
for (int half=0; half<=1; half++)
{
int atom = (half==0) ? v0 : v1;
int otherAtom= (half==0) ? v1 : v0;
double *pt_a = (half==0) ? pt_0 : pt_mid;
double *pt_b = (half==0) ? pt_mid : pt_1;
......@@ -912,7 +911,8 @@ avtMantaMoleculeRenderer::DrawBonds(vtkPolyData *data,
}
}
/*if (atts.GetDrawBondsAs() == MoleculeAttributes::CylinderBonds )
/*int otherAtom= (half==0) ? v1 : v0;
if (atts.GetDrawBondsAs() == MoleculeAttributes::CylinderBonds )
{
if (is2D)
{
......
......@@ -336,13 +336,11 @@ avtMoleculeFilter::PostExecute()
// the known residue names into the labels. We send them all
// with an on/off flag so we can let the viewer know about
// new residues that we've learned about.
//bool err = false;
for(int i = 0; i < NumberOfKnownResidues(); ++i)
{
const char *rn = NumberToResiduename(i);
if(rn == 0)
{
//err = true;
break;
}
......
......@@ -245,12 +245,8 @@ avtMoleculeRenderer::Render(vtkDataSet *ds)
//
// ****************************************************************************
void
avtMoleculeRenderer::Initialize(vtkDataSet *ds)
avtMoleculeRenderer::Initialize(vtkDataSet * /*ds*/)
{
// get data set
//vtkPolyData *polydata = (vtkPolyData*)ds;
(void) ds;
initialized = true;
}
......@@ -272,7 +268,6 @@ avtMoleculeRenderer::Initialize(vtkDataSet *ds)
void
avtMoleculeRenderer::SetAtts(const AttributeGroup *a)
{
//const MoleculeAttributes *newAtts = (const MoleculeAttributes*)a;
atts = *(const MoleculeAttributes*)a;
initialized = false;
......@@ -358,10 +353,6 @@ avtMoleculeRenderer::SetSpecularProperties(bool flag, double coeff,
{
spec_coeff = flag ? coeff : 0;
spec_power = power;
//int r = color.Red();
//int g = color.Green();
//int b = color.Blue();
spec_r = float(color.Red())/255.;
spec_g = float(color.Green())/255.;
spec_b = float(color.Blue())/255.;
......
......@@ -248,12 +248,6 @@ avtOpenGLAtomTexturer2D::MakeTextures()
{
int i, j;
//float dx = SPHERE_TEX_H * 0.5f;
//float dy = SPHERE_TEX_H * 0.5f;
//float R = dx-2;
//float minT = 0.;
//float maxT = 0.;
GLubyte texture[SPHERE_TEX_H][SPHERE_TEX_H][2];
......@@ -266,8 +260,6 @@ avtOpenGLAtomTexturer2D::MakeTextures()
float x2y2 = sqrt(x*x + y*y);
if(x2y2 < 1.)
{
//float z = sqrt(1. - x2y2);
//GLubyte rc = (GLubyte)(z * 255.);
texture[j][i][0] = (GLubyte) 0;
texture[j][i][1] = (GLubyte) 255;
......
......@@ -287,13 +287,6 @@ TextureModeData::MakeTextures()
{
int i, j;
//float dx = SPHERE_TEX_H * 0.5f;
//float dy = SPHERE_TEX_H * 0.5f;
//float R = dx-2;
//float minT = 0.;
//float maxT = 0.;
GLubyte texture[SPHERE_TEX_H][SPHERE_TEX_H][2];
for (j = 0; j < SPHERE_TEX_H; j++)
......
......@@ -111,7 +111,7 @@ void
ParallelCoordinatesAttributes::DeleteAxis(const std::string &axisName_,
int minAxisCount)
{
if (scalarAxisNames.size() <= minAxisCount) return;
if ((int)scalarAxisNames.size() <= minAxisCount) return;
std::string newAxisName = axisName_;
......@@ -181,8 +181,8 @@ ParallelCoordinatesAttributes::AttributesAreConsistent() const
if (axisNamesSize == 1)
return false;
if ((extentMinima.size() != axisNamesSize) ||
(extentMaxima.size() != axisNamesSize))
if ((extentMinima.size() != (size_t)axisNamesSize) ||
(extentMaxima.size() != (size_t)axisNamesSize))
{
return false;
}
......
......@@ -1358,7 +1358,7 @@ void
ParallelCoordinatesAttributes::DeleteAxis(const std::string &axisName_,
int minAxisCount)
{
if (scalarAxisNames.size() <= (size_t)minAxisCount) return;
if ((int)scalarAxisNames.size() <= minAxisCount) return;
std::string newAxisName = axisName_;
......
......@@ -1178,7 +1178,7 @@ QvisParallelCoordinatesPlotWindow::moveAxisDown()
int naxes = axes.size();
// can't move last axis down in list
if ((size_t)index >= axes.size()-1)
if (index >= (int)axes.size()-1)
return;
// InsertAxis() will reorder axes already in the list, so we
......
......@@ -373,7 +373,7 @@ QvisParallelCoordinatesWidget::drawAxes(QPainter *painter)
axisX = axesXPos[axisNum];
if ((!namedRightAxis && (axisNum == axisCount-1)) ||
((size_t)axisNum >= axisTitles.size()))
(axisNum >= (int)axisTitles.size()))
{
for (size_t dashNum = 0; dashNum < dashesTopYPos.size(); dashNum++)
{
......@@ -422,7 +422,7 @@ QvisParallelCoordinatesWidget::drawAxisTitles(QPainter *painter)
for (axisNum = 0; axisNum < axisCount; axisNum++)
{
if ((!namedRightAxis && (axisNum == axisCount-1)) ||
((size_t)axisNum >= axisTitles.size()))
(axisNum >= (int)axisTitles.size()))
{
axisTitle = std::string("?");
titleCharCount = 1;
......@@ -472,10 +472,8 @@ QvisParallelCoordinatesWidget::drawDataCurves(QPainter *painter)
painter->setPen(QPen(QColor(128,128,128), 1));
for (axisNum = 0; axisNum < axisCount-1; axisNum++)
for (axisNum = 0; axisNum < axisCount-1 && axisNum < 8; axisNum++)
{
if (axisNum > 7) break; // Shouldn't happen
leftAxisX = axesXPos[axisNum]; rightAxisX = axesXPos[axisNum+1];
for (segNum = 0; segNum < 3; segNum++)
......
......@@ -790,7 +790,6 @@ avtParallelCoordinatesFilter::ExecuteDataTree(vtkDataSet *in_ds, int domain, str
bool arrayIsCellData, dataBadOrMissing;
string arrayName;
vtkDataArray *dataArray;
vtkIdList *pointIdList = NULL; ///TODO: check on fix for uninitialized variable
float *arrayValues;
float valueSum;
......@@ -856,13 +855,9 @@ avtParallelCoordinatesFilter::ExecuteDataTree(vtkDataSet *in_ds, int domain, str
}
bool drawContext = parCoordsAtts.GetDrawContext();
if (plotCellData && (pointArrayCount > 0))
{
pointIdList = vtkIdList::New();
}
if (plotCellData)
{
vtkIdList *pointIdList = vtkIdList::New();
for (tupleNum = 0; tupleNum < cellCount; tupleNum++)
{
for (axisNum = 0; axisNum < axisCount; axisNum++)
......@@ -895,7 +890,8 @@ avtParallelCoordinatesFilter::ExecuteDataTree(vtkDataSet *in_ds, int domain, str
}
// TODO: DOESN'T SUPPORT MULTIPLE TIME STEPS; hardcoded to 0
if (drawLines) {
if (drawLines)
{
if (parCoordsAtts.GetDrawFocusAs()==ParallelCoordinatesAttributes::IndividualLines)
AppendDataTupleFocus(inputTuple);
else
......@@ -904,6 +900,7 @@ avtParallelCoordinatesFilter::ExecuteDataTree(vtkDataSet *in_ds, int domain, str
if (drawContext)
CountDataTupleContext(0, inputTuple);
}
pointIdList->Delete();
}
else
{
......@@ -919,7 +916,8 @@ avtParallelCoordinatesFilter::ExecuteDataTree(vtkDataSet *in_ds, int domain, str
}
// TODO: DOESN'T SUPPORT MULTIPLE TIME STEPS; hardcoded to 0
if (drawLines) {
if (drawLines)
{
if (parCoordsAtts.GetDrawFocusAs()==ParallelCoordinatesAttributes::IndividualLines)
AppendDataTupleFocus(inputTuple);
else
......@@ -930,11 +928,6 @@ avtParallelCoordinatesFilter::ExecuteDataTree(vtkDataSet *in_ds, int domain, str
}
}
if (plotCellData && (pointArrayCount > 0))
{
pointIdList->Delete();
}
if (drawLines && parCoordsAtts.GetDrawFocusAs()==ParallelCoordinatesAttributes::IndividualLines)
{
DrawFocusPolyLines();
......@@ -2208,11 +2201,9 @@ avtParallelCoordinatesFilter::CreateDBAcceleratedNamedSelection(
return NULL;
}
size_t j;
vector<avtDataSelection *> drs;
stringVector curAxisVarNames = parCoordsAtts.GetScalarAxisNames();
for (j = 0 ; j < (size_t)axisCount ; j++)
for (int j = 0 ; j < axisCount ; j++)
{
drs.push_back(new avtDataRangeSelection(
curAxisVarNames[j],
......@@ -2235,7 +2226,7 @@ avtParallelCoordinatesFilter::CreateDBAcceleratedNamedSelection(
// own this reference.
// delete ids;
for (j = 0 ; j < drs.size() ; j++)
for (size_t j = 0 ; j < drs.size() ; j++)
delete drs[j];
return rv;
......@@ -2265,8 +2256,6 @@ avtNamedSelection *
avtParallelCoordinatesFilter::CreateNamedSelectionThroughTraversal(
avtContract_p c, const string &selName)
{
size_t i;
// Get the zone number labels loaded up.
GetInput()->Update(c);
......@@ -2277,7 +2266,7 @@ avtParallelCoordinatesFilter::CreateNamedSelectionThroughTraversal(
int nleaves = 0;
vtkDataSet **leaves = tree->GetAllLeaves(nleaves);
stringVector curAxisVarNames = parCoordsAtts.GetScalarAxisNames();
for (i = 0 ; i < (size_t)nleaves ; i++)
for (int i = 0 ; i < nleaves ; i++)
{
int axisNum;
int tupleCount, componentCount;
......@@ -2410,12 +2399,12 @@ avtParallelCoordinatesFilter::CreateNamedSelectionThroughTraversal(
// of the named selections will be small.
int *numPerProcIn = new int[PAR_Size()];
int *numPerProc = new int[PAR_Size()];
for (i = 0 ; i < (size_t)PAR_Size() ; i++)
for (int i = 0 ; i < PAR_Size() ; i++)
numPerProcIn[i] = 0;
numPerProcIn[PAR_Rank()] = (int)doms.size();
SumIntArrayAcrossAllProcessors(numPerProcIn, numPerProc, PAR_Size());
int numTotal = 0;
for (i = 0 ; i < (size_t)PAR_Size() ; i++)
for (int i = 0 ; i < PAR_Size() ; i++)
numTotal += numPerProc[i];
if (numTotal > 1000000)
{
......@@ -2425,18 +2414,18 @@ avtParallelCoordinatesFilter::CreateNamedSelectionThroughTraversal(
"named selection. Disallowing ... no selection created");
}
int myStart = 0;
for (i = 0 ; i < (size_t)PAR_Rank()-1 ; i++)
for (int i = 0 ; i < PAR_Rank()-1 ; i++)
myStart += numPerProc[i];
int *selForDomsIn = new int[numTotal];
int *selForDoms = new int[numTotal];
for (i = 0 ; i < doms.size() ; i++)
for (size_t i = 0 ; i < doms.size() ; i++)
selForDomsIn[myStart+i] = doms[i];
SumIntArrayAcrossAllProcessors(selForDomsIn, selForDoms, numTotal);
int *selForZonesIn = new int[numTotal];
int *selForZones = new int[numTotal];
for (i = 0 ; i < zones.size() ; i++)
for (size_t i = 0 ; i < zones.size() ; i++)
selForZonesIn[myStart+i] = zones[i];
SumIntArrayAcrossAllProcessors(selForZonesIn, selForZones, numTotal);
......
......@@ -250,8 +250,6 @@ PseudocolorAttributes::ProcessOldVersions(DataNode *parentNode,
{
double opacity = k->AsDouble();
PseudocolorAttributes::OpacityType val;
// If the opacity value is set and valid set the opacityType
// to constant and a new node for it.
if( 0.0 <= opacity && opacity < 1.0 )
......
......@@ -2750,8 +2750,6 @@ PseudocolorAttributes::ProcessOldVersions(DataNode *parentNode,
{
double opacity = k->AsDouble();
//PseudocolorAttributes::OpacityType val;
// If the opacity value is set and valid set the opacityType
// to constant and a new node for it.
if( 0.0 <= opacity && opacity < 1.0 )
......@@ -2764,3 +2762,4 @@ PseudocolorAttributes::ProcessOldVersions(DataNode *parentNode,
}
}
}
......@@ -580,8 +580,6 @@ avtScatterFilter::PointMeshFromVariables(DataInput *d1,
<< "zExtents = [" << zMin << ", " << zMax << "]" << endl;
vtkIdType nCells = 0;
//avtDataAttributes &dataAtts = GetOutput()->GetInfo().GetAttributes();
//const float EPSILON = 1.e-9;
debug4 << mName << "arr1 = " << arr1->GetName()
<< ", ntuples=" << arr1->GetNumberOfTuples() << endl;
......@@ -779,12 +777,8 @@ avtScatterFilter::PointMeshFromVariables(DataInput *d1,
{
coord = (float *)pts->GetVoidPointer(0);
// Variables for log scaling
//float small_val = 0.1; // Less than 1.
//float log_smallval = log10(small_val);
// Variables for skew scaling.
float x_range, x_rangeInverse, x_logSkew, x_k;
float x_range = 0, x_rangeInverse = 0, x_logSkew = 0, x_k = 0;
if(d1scale == 2)
{
x_range = xMax - xMin;
......@@ -792,7 +786,7 @@ avtScatterFilter::PointMeshFromVariables(DataInput *d1,
x_logSkew = log(d1->skew);
x_k = x_range / (d1->skew - 1.);
}
float y_range, y_rangeInverse, y_logSkew, y_k;
float y_range = 0, y_rangeInverse = 0, y_logSkew = 0, y_k = 0;