Commit 03a14aa9 authored by Ken Martin's avatar Ken Martin
Browse files

some fixes from the main tree

parent 641c7202
......@@ -30,7 +30,7 @@
#include "vtkUnsignedLongArray.h"
#include "vtkUnsignedShortArray.h"
vtkCxxRevisionMacro(vtkDataArray, "1.61");
vtkCxxRevisionMacro(vtkDataArray, "1.61.6.1");
// Construct object with default tuple dimension (number of components) of 1.
vtkDataArray::vtkDataArray(vtkIdType numComp)
......@@ -846,9 +846,10 @@ void vtkDataArray::ComputeRange(int comp)
}
int idx = comp;
idx = (idx<0)?(4):(idx);
idx = (idx<0)?(this->NumberOfComponents):(idx);
if ( (this->GetMTime() > this->ComponentRangeComputeTime[idx]) )
if (idx >= VTK_MAXIMUM_NUMBER_OF_CACHED_COMPONENT_RANGES ||
(this->GetMTime() > this->ComponentRangeComputeTime[idx]) )
{
numTuples=this->GetNumberOfTuples();
this->Range[0] = VTK_DOUBLE_MAX;
......@@ -879,9 +880,12 @@ void vtkDataArray::ComputeRange(int comp)
this->Range[1] = s;
}
}
if (idx < VTK_MAXIMUM_NUMBER_OF_CACHED_COMPONENT_RANGES)
{
this->ComponentRangeComputeTime[idx].Modified();
this->ComponentRange[idx][0] = this->Range[0];
this->ComponentRange[idx][1] = this->Range[1];
}
}
else
{
......
......@@ -48,6 +48,8 @@ class vtkDoubleArray;
class vtkLookupTable;
class vtkIdList;
#define VTK_MAXIMUM_NUMBER_OF_CACHED_COMPONENT_RANGES 11
class VTK_COMMON_EXPORT vtkDataArray : public vtkObject
{
public:
......@@ -357,11 +359,15 @@ protected:
private:
double Range[2];
// We can have arbitrary number of components, but 11 should
// take care of 99.99% of the cases. Components greater
// than 11 do not get cached. The comment below assume max of 4 comps.
// 5 components since you can compute the range of components
// less than 0 to get a magnitude range. ComponentRange[4] is
// this magnitude range
vtkTimeStamp ComponentRangeComputeTime[5];
double ComponentRange[5][2];
vtkTimeStamp
ComponentRangeComputeTime[VTK_MAXIMUM_NUMBER_OF_CACHED_COMPONENT_RANGES];
double ComponentRange[VTK_MAXIMUM_NUMBER_OF_CACHED_COMPONENT_RANGES][2];
double* GetTupleN(vtkIdType i, int n);
......
......@@ -17,7 +17,7 @@
#include <ctype.h>
vtkCxxRevisionMacro(vtkFunctionParser, "1.24");
vtkCxxRevisionMacro(vtkFunctionParser, "1.24.6.1");
vtkStandardNewMacro(vtkFunctionParser);
static double vtkParserVectorErrorResult[3] = { VTK_PARSER_ERROR_RESULT,
......@@ -839,9 +839,7 @@ void vtkFunctionParser::SetScalarVariableValue(const char* inVariableName,
tempNames[i] = NULL;
}
delete [] tempValues;
tempValues = NULL;
delete [] tempNames;
tempNames = NULL;
this->ScalarVariableValues[i] = value;
this->ScalarVariableNames[i] = new char [strlen(variableName) + 1];
......@@ -970,9 +968,7 @@ void vtkFunctionParser::SetVectorVariableValue(const char* inVariableName,
tempValues[i] = NULL;
}
delete [] tempValues;
tempValues = NULL;
delete [] tempNames;
tempNames = NULL;
this->VectorVariableValues[i] = new double[3];
this->VectorVariableValues[i][0] = xValue;
......@@ -1274,7 +1270,7 @@ int vtkFunctionParser::BuildInternalFunctionStructure()
void vtkFunctionParser::BuildInternalSubstringStructure(int beginIndex,
int endIndex)
{
int mathFunctionNum, mathConstantNum, beginIndex2;
int mathFunctionNum, beginIndex2;
int opNum, parenthesisCount, i;
static const char* const elementaryMathOps = "+-.*/^";
......@@ -1350,20 +1346,6 @@ void vtkFunctionParser::BuildInternalSubstringStructure(int beginIndex,
return;
}
}
else
{
mathConstantNum = this->GetMathConstantNumber(beginIndex);
if(mathConstantNum > 0)
{
this->AddInternalByte(mathConstantNum);
this->StackPointer++;
if (this->StackPointer > this->StackSize)
{
this->StackSize++;
}
return;
}
}
}
for (opNum = 0; opNum < 6; opNum++)
......@@ -1718,6 +1700,19 @@ int vtkFunctionParser::GetOperandNumber(int currentIndex)
delete [] tempImmediates;
return VTK_PARSER_IMMEDIATE;
}
if (!strncmp(&this->Function[currentIndex], "iHat", 4))
{
return VTK_PARSER_IHAT;
}
if (!strncmp(&this->Function[currentIndex], "jHat", 4))
{
return VTK_PARSER_JHAT;
}
if (!strncmp(&this->Function[currentIndex], "kHat", 4))
{
return VTK_PARSER_KHAT;
}
for (i = 0; i < this->NumberOfScalarVariables; i++)
{ // Variable
......
......@@ -32,7 +32,7 @@
#include <ctype.h>
#include <vtkstd/string>
vtkCxxRevisionMacro(vtkEnSight6BinaryReader, "1.41");
vtkCxxRevisionMacro(vtkEnSight6BinaryReader, "1.41.2.1");
vtkStandardNewMacro(vtkEnSight6BinaryReader);
//----------------------------------------------------------------------------
......@@ -257,6 +257,7 @@ int vtkEnSight6BinaryReader::ReadGeometryFile(char* fileName, int timeStep)
while (lineRead && strncmp(line, "part", 4) == 0)
{
this->NumberOfGeometryParts++;
sscanf(line, " part %d", &partId);
partId--; // EnSight starts #ing at 1.
......@@ -719,7 +720,7 @@ int vtkEnSight6BinaryReader::ReadMeasuredGeometryFile(char* fileName,
char line[80], subLine[80];
int i;
int *pointIds;
float *xCoords, *yCoords, *zCoords;
float *coords;
vtkPoints *points = vtkPoints::New();
vtkPolyData *pd = vtkPolyData::New();
......@@ -807,19 +808,13 @@ int vtkEnSight6BinaryReader::ReadMeasuredGeometryFile(char* fileName,
}
pointIds = new int[this->NumberOfMeasuredPoints];
xCoords = new float [this->NumberOfMeasuredPoints];
yCoords = new float [this->NumberOfMeasuredPoints];
zCoords = new float [this->NumberOfMeasuredPoints];
coords = new float [this->NumberOfMeasuredPoints*3];
this->ReadIntArray(pointIds, this->NumberOfMeasuredPoints);
this->ReadFloatArray(xCoords, this->NumberOfMeasuredPoints);
this->ReadFloatArray(yCoords, this->NumberOfMeasuredPoints);
this->ReadFloatArray(zCoords, this->NumberOfMeasuredPoints);
this->ReadFloatArray(coords, this->NumberOfMeasuredPoints*3);
delete [] pointIds;
delete [] xCoords;
delete [] yCoords;
delete [] zCoords;
delete [] coords;
this->ReadLine(line); // END TIME STEP
}
......@@ -845,24 +840,17 @@ int vtkEnSight6BinaryReader::ReadMeasuredGeometryFile(char* fileName,
return 0;
}
this->MeasuredNodeIds->Allocate(this->NumberOfMeasuredPoints);
pointIds = new int[this->NumberOfMeasuredPoints];
xCoords = new float [this->NumberOfMeasuredPoints];
yCoords = new float [this->NumberOfMeasuredPoints];
zCoords = new float [this->NumberOfMeasuredPoints];
coords = new float [this->NumberOfMeasuredPoints*3];
points->Allocate(this->NumberOfMeasuredPoints);
pd->Allocate(this->NumberOfMeasuredPoints);
this->ReadIntArray(pointIds, this->NumberOfMeasuredPoints);
this->ReadFloatArray(xCoords, this->NumberOfMeasuredPoints);
this->ReadFloatArray(yCoords, this->NumberOfMeasuredPoints);
this->ReadFloatArray(zCoords, this->NumberOfMeasuredPoints);
this->ReadFloatArray(coords, this->NumberOfMeasuredPoints*3);
for (i = 0; i < this->NumberOfMeasuredPoints; i++)
{
this->MeasuredNodeIds->InsertNextId(pointIds[i]);
points->InsertNextPoint(xCoords[i], yCoords[i], zCoords[i]);
points->InsertNextPoint(coords[3*i], coords[3*i+1], coords[3*i+2]);
pd->InsertNextCell(VTK_VERTEX, 1, (vtkIdType*)&pointIds[i]);
}
......@@ -872,9 +860,7 @@ int vtkEnSight6BinaryReader::ReadMeasuredGeometryFile(char* fileName,
points->Delete();
pd->Delete();
delete [] pointIds;
delete [] xCoords;
delete [] yCoords;
delete [] zCoords;
delete [] coords;
if (this->IFile)
{
......
......@@ -31,7 +31,7 @@
#include <ctype.h>
#include <vtkstd/string>
vtkCxxRevisionMacro(vtkEnSight6Reader, "1.46");
vtkCxxRevisionMacro(vtkEnSight6Reader, "1.46.2.1");
vtkStandardNewMacro(vtkEnSight6Reader);
//----------------------------------------------------------------------------
......@@ -404,8 +404,6 @@ int vtkEnSight6Reader::ReadMeasuredGeometryFile(char* fileName, int timeStep)
return 0;
}
this->MeasuredNodeIds->Allocate(this->NumberOfMeasuredPoints);
geom = ((vtkPolyData*)this->GetOutput(this->NumberOfGeometryParts));
geom->Allocate(this->NumberOfMeasuredPoints);
......@@ -417,9 +415,7 @@ int vtkEnSight6Reader::ReadMeasuredGeometryFile(char* fileName, int timeStep)
this->ReadLine(line);
vtkEnSight6ReaderRead1(line, " %8d %12e %12e %12e", &tempId, &coords[0], &coords[1],
&coords[2]);
tempId--;
id = tempId;
this->MeasuredNodeIds->InsertNextId(id);
newPoints->InsertNextPoint(coords);
geom->InsertNextCell(VTK_VERTEX, 1, &id);
}
......
......@@ -31,7 +31,7 @@
#include <ctype.h>
#include <vtkstd/string>
vtkCxxRevisionMacro(vtkEnSightGoldBinaryReader, "1.52");
vtkCxxRevisionMacro(vtkEnSightGoldBinaryReader, "1.52.2.1");
vtkStandardNewMacro(vtkEnSightGoldBinaryReader);
// This is half the precision of an int.
......@@ -995,8 +995,6 @@ int vtkEnSightGoldBinaryReader::ReadMeasuredGeometryFile(char* fileName,
this->ReadInt(&this->NumberOfMeasuredPoints);
this->MeasuredNodeIds->Allocate(this->NumberOfMeasuredPoints);
pointIds = new int[this->NumberOfMeasuredPoints];
xCoords = new float [this->NumberOfMeasuredPoints];
yCoords = new float [this->NumberOfMeasuredPoints];
......@@ -1011,7 +1009,6 @@ int vtkEnSightGoldBinaryReader::ReadMeasuredGeometryFile(char* fileName,
for (i = 0; i < this->NumberOfMeasuredPoints; i++)
{
this->MeasuredNodeIds->InsertNextId(pointIds[i]);
points->InsertNextPoint(xCoords[i], yCoords[i], zCoords[i]);
pd->InsertNextCell(VTK_VERTEX, 1, (vtkIdType*)&pointIds[i]);
}
......
......@@ -29,7 +29,7 @@
#include <ctype.h>
#include <vtkstd/string>
vtkCxxRevisionMacro(vtkEnSightGoldReader, "1.44");
vtkCxxRevisionMacro(vtkEnSightGoldReader, "1.44.2.1");
vtkStandardNewMacro(vtkEnSightGoldReader);
//----------------------------------------------------------------------------
......@@ -257,8 +257,6 @@ int vtkEnSightGoldReader::ReadMeasuredGeometryFile(char* fileName,
pd->Allocate(this->NumberOfMeasuredPoints);
this->SetNthOutput(this->NumberOfGeometryParts, pd);
pd->Delete();
this->MeasuredNodeIds->Allocate(this->NumberOfMeasuredPoints);
}
else if ( ! this->GetOutput(this->NumberOfGeometryParts)->IsA("vtkPolyData"))
{
......@@ -277,9 +275,7 @@ int vtkEnSightGoldReader::ReadMeasuredGeometryFile(char* fileName,
this->ReadLine(line);
sscanf(line, " %8d %12e %12e %12e", &tempId, &coords[0], &coords[1],
&coords[2]);
tempId--;
id = tempId;
this->MeasuredNodeIds->InsertNextId(id);
newPoints->InsertNextPoint(coords);
geom->InsertNextCell(VTK_VERTEX, 1, &id);
}
......
......@@ -28,7 +28,7 @@
#include <vtkstd/string>
#include <vtkstd/vector>
vtkCxxRevisionMacro(vtkEnSightReader, "1.49");
vtkCxxRevisionMacro(vtkEnSightReader, "1.49.2.1");
//----------------------------------------------------------------------------
typedef vtkstd::vector< vtkSmartPointer<vtkIdList> > vtkEnSightReaderCellIdsTypeBase;
......@@ -82,7 +82,6 @@ vtkEnSightReader::vtkEnSightReader()
this->NumberOfGeometryParts = 0;
this->NumberOfMeasuredPoints = 0;
this->MeasuredNodeIds = vtkIdList::New();
this->OutputsAreValid = 1;
this->InitialRead = 1;
......@@ -134,9 +133,6 @@ vtkEnSightReader::~vtkEnSightReader()
this->UnstructuredPartIds->Delete();
this->UnstructuredPartIds = NULL;
this->MeasuredNodeIds->Delete();
this->MeasuredNodeIds = NULL;
this->VariableTimeSetIds->Delete();
this->VariableTimeSetIds = NULL;
this->ComplexVariableTimeSetIds->Delete();
......
......@@ -265,7 +265,6 @@ protected:
// global list of points for measured geometry
int NumberOfMeasuredPoints;
vtkIdList *MeasuredNodeIds;
int NumberOfNewOutputs;
int OutputsAreValid;
......
......@@ -28,7 +28,7 @@
#include "vtkUnsignedCharArray.h"
#include "vtkUnsignedLongArray.h"
vtkCxxRevisionMacro(vtkCommunicator, "1.22");
vtkCxxRevisionMacro(vtkCommunicator, "1.22.6.1");
template <class T>
int SendDataArray(T* data, int length, int handle, int tag, vtkCommunicator *self)
......@@ -483,7 +483,7 @@ int vtkCommunicator::WriteDataSet(vtkDataSet *data)
copy->ShallowCopy(data);
// There is a problem with binary files with no data.
if (copy->GetNumberOfCells() > 0)
if (copy->GetNumberOfCells() + copy->GetNumberOfPoints() > 0)
{
writer->SetFileTypeToBinary();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment