Commit b628505c authored by Ken Martin's avatar Ken Martin
Browse files

Create VTK 3.1.1 release

The VTK 3.1 release tag in CVS was moved file-wise as fixes were made.
Therefore the true history of the 'branch' is gone.  This commit was
manufactured during conversion from CVS to represent the version as a
merge from all the commits whose files have the tag.
......@@ -23,11 +23,9 @@ vtkCell \
vtkDataArray \
vtkDataSet \
vtkGeneralTransform \
vtkLinearTransform \
vtkImplicitFunction \
vtkLocator \
vtkObjectFactory \
vtkPerspectiveTransform \
vtkPointSet \
vtkScalarsToColors \
vtkViewport \
......@@ -67,7 +65,6 @@ vtkGeneralTransformConcatenation \
vtkGeneralTransformInverse \
vtkGenericCell \
vtkHexahedron \
vtkIdentityTransform \
vtkIdList \
vtkImageData \
vtkImageSource \
......@@ -76,8 +73,6 @@ vtkImplicitFunctionCollection \
vtkIndent \
vtkIntArray \
vtkLine \
vtkLinearTransformConcatenation \
vtkLinearTransformInverse \
vtkLogLookupTable \
vtkLongArray \
vtkLookupTable \
......@@ -90,8 +85,6 @@ vtkMutexLock \
vtkNormals \
vtkObject \
vtkOutputWindow \
vtkPerspectiveTransformConcatenation \
vtkPerspectiveTransformInverse \
vtkPixel \
vtkPlane \
vtkPlaneCollection \
......@@ -105,7 +98,6 @@ vtkPolyVertex \
vtkPolygon \
vtkPriorityQueue \
vtkProcessObject \
vtkProjectionTransform \
vtkProp \
vtkPropAssembly \
vtkPropCollection \
......
......@@ -143,48 +143,6 @@ void Test(ostream& strm)
strm << endl;
}
strm << "Test vtkMath::InvertMatrix Complete" << endl;
matrix[0][0] = 1.00000;
matrix[0][1] = 1.00000;
matrix[0][2] = 1.00000;
matrix[0][3] = 1.00000;
matrix[0][4] = 1.00000;
matrix[1][0] = 0.500000;
matrix[1][1] = 1.0 / 3.0;
matrix[1][2] = 0.250000;
matrix[1][3] = 0.200000;
matrix[1][4] = 1.0 / 6.0;
matrix[2][0] = 1.0 / 3.0;
matrix[2][1] = 0.250000;
matrix[2][2] = 0.200000;
matrix[2][3] = 1.0 / 6.0;
matrix[2][4] = 1.0 / 7.0;
matrix[3][0] = 0.250000;
matrix[3][1] = 0.200000;
matrix[3][2] = 1.0 / 6.0;
matrix[3][3] = 1.0 / 7.0;
matrix[3][4] = 0.125000;
matrix[4][0] = 0.200000;
matrix[4][1] = 1.0 / 6.0;
matrix[4][2] = 1.0 / 7.0;
matrix[4][3] = 0.125000;
matrix[4][4] = 1.0 / 9.0;
strm << "vtkMath:LUFactorLinearSystem(double **, int *, int, double *)" << endl;
vtkMath::LUFactorLinearSystem (lotkin, tmpIntSpace, 5, tmpDoubleSpace);
for (j = 0; j < 5; j++)
{
strm << "\t";
for (i = 0; i < 5; i++)
{
strm << matrix[j][i] << ", ";
}
strm << endl;
}
strm << "vtkMath:EstimateMatrixCondition(double **, int)" << endl;
strm << "Condition is: " << vtkMath::EstimateMatrixCondition (lotkin, 5) << endl;
}
......
......@@ -8,7 +8,7 @@
catch {load vtktcl}
set rtSelector "grep -v 0x | grep -v Modified"
set rtSelector "grep -v vtkTransform | grep -v Modified"
set rtComparator "diff"
proc rtOtherTest { fileid } {
......
......@@ -43,6 +43,24 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkDataSet.h"
#include "vtkObjectFactory.h"
//------------------------------------------------------------------------------
vtkAbstractMapper* vtkAbstractMapper::New()
{
// First try to create the object from the vtkObjectFactory
vtkObject* ret = vtkObjectFactory::CreateInstance("vtkAbstractMapper");
if(ret)
{
return (vtkAbstractMapper*)ret;
}
// If the factory was unable to create the object, then create it here.
return new vtkAbstractMapper;
}
// Construct object.
vtkAbstractMapper::vtkAbstractMapper()
{
......
......@@ -61,6 +61,10 @@ public:
vtkTypeMacro(vtkAbstractMapper,vtkProcessObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Construct object.
static vtkAbstractMapper *New();
// Description:
// Release any graphics resources that are being consumed by this mapper.
// The parameter window could be used to determine which graphic
......
......@@ -84,51 +84,34 @@ vtkCoordinate::~vtkCoordinate()
this->SetViewport(NULL);
}
const char *vtkCoordinate::GetCoordinateSystemAsString()
void vtkCoordinate::PrintSelf(ostream& os, vtkIndent indent)
{
this->vtkObject::PrintSelf(os,indent);
char posString[64];
switch (this->CoordinateSystem)
{
case VTK_DISPLAY:
return "Display";
strcpy(posString, "Display"); break;
case VTK_NORMALIZED_DISPLAY:
return "Normalized Display";
strcpy(posString, "Normalized Display"); break;
case VTK_VIEWPORT:
return "Viewport";
strcpy(posString, "Viewport"); break;
case VTK_NORMALIZED_VIEWPORT:
return "Normalized Viewport";
strcpy(posString, "Normalized Viewport"); break;
case VTK_VIEW:
return "View";
strcpy(posString, "View"); break;
case VTK_WORLD:
return "World";
strcpy(posString, "World"); break;
default:
return "UNKNOWN!";
strcpy(posString, "UNKNOWN!"); break;
}
}
void vtkCoordinate::PrintSelf(ostream& os, vtkIndent indent)
{
this->vtkObject::PrintSelf(os,indent);
os << indent << "Coordinate System: " << this->GetCoordinateSystemAsString() << "\n";
os << indent << "Coordinate System: " << posString << "\n";
os << indent << "Value: (" << this->Value[0] << ","
<< this->Value[1] << "," << this->Value[2] << ")\n";
if (this->ReferenceCoordinate)
{
os << indent << "ReferenceCoordinate: " << this->ReferenceCoordinate << "\n";
}
else
{
os << indent << "ReferenceCoordinate: (none)\n";
}
if (this->Viewport)
{
os << indent << "Viewport: " << this->Viewport << "\n";
}
else
{
os << indent << "Viewport: (none)\n";
}
os << indent << "ReferenceCoordinate: " << this->ReferenceCoordinate << "\n";
os << indent << "Viewport: " << this->Viewport << "\n";
}
......@@ -206,7 +189,7 @@ float *vtkCoordinate::GetComputedWorldValue(vtkViewport* viewport)
ival = this->ReferenceCoordinate->GetComputedDisplayValue(viewport);
RefValue[0] = (float)(ival[0]);
RefValue[1] = (float)(ival[1]);
RefValue[2] = 0.0;
RefValue[2] = (float)(ival[2]);
// convert to current coordinate system
switch (this->CoordinateSystem)
......@@ -257,7 +240,6 @@ float *vtkCoordinate::GetComputedWorldValue(vtkViewport* viewport)
float *RefValue;
RefValue = this->ReferenceCoordinate->GetComputedWorldValue(viewport);
val[0] += RefValue[0];
val[1] += RefValue[1];
val[2] += RefValue[2];
......
......@@ -109,8 +109,6 @@ public:
void SetCoordinateSystemToView() {this->SetCoordinateSystem(VTK_VIEW);}
void SetCoordinateSystemToWorld() {this->SetCoordinateSystem(VTK_WORLD);}
const char *GetCoordinateSystemAsString ();
// Description:
// Set/get the value of this coordinate. This can be thought of as
// the position of this coordinate in its coordinate system.
......
/*=========================================================================
Program: Visualization Toolkit
Module: vtkDataInformation.h
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) 1993-2000 Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
of any contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
* Modified source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
// .NAME vtkDataInformation - Superclass of information objects.
// .SECTION Description
// Note: This object is under development an might change in the future.
// This class and its sublcasses encapsulate the information associated
// with vtkData objects into there own objects. The primary motivation
// for this division is for pipeline ports between mutiple processes.
#ifndef __vtkDataInformation_h
#define __vtkDataInformation_h
#include "vtkObject.h"
class VTK_EXPORT vtkDataInformation : public vtkObject
{
public:
static vtkDataInformation *New();
vtkTypeMacro(vtkDataInformation,vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Makes an empty similar type object.
virtual vtkDataInformation *MakeObject() {return vtkDataInformation::New();}
// Description:
// Subclasses override this method, and try to be smart
// if the types are different.
virtual void Copy(vtkDataInformation *in);
// Description:
// This is a special value that may not be considered "DataInformation".
// it is just convenient to compute this value in the UpdateInformation
// calls. This value represents the mamimum MTimes of all upstream
// pipeline objects (not including this data object itself).
void SetPipelineMTime(unsigned long time) {this->PipelineMTime = time; }
vtkGetMacro(PipelineMTime, unsigned long);
// Description:
// This is set to the estimated size of the data object (in Kb)
// if the whole extent were updated.
// Setting this value does not change MTime because this value
// is automatically computed in
// vtkImageData::ComputeEstimatedWholeMemorySize.
void SetEstimatedWholeMemorySize(unsigned long size)
{this->EstimatedWholeMemorySize = size;};
vtkGetMacro(EstimatedWholeMemorySize, unsigned long);
// Description:
// Locality is a measure of how many filters (in this same process)
// are upstream of this filter. Alternatively, it is a crude measure
// of how long the processing should take to update our data.
// It is used to sort Update requests in multiple input filters to
// get the best possible parallel perfomance.
void SetLocality(float l) {this->Locality = l;};
vtkGetMacro(Locality, float);
// Description:
// Sources that can generate a series of data objects can communicate
// this down stream using this ivar.
vtkSetMacro(SeriesLength, int);
vtkGetMacro(SeriesLength, int);
// Description:
// This method is passed a ClassName and returns 1 if the object is
// a subclass of the class arg. It is an attempt at making a smarter copy.
virtual int GetClassCheck(char *className);
// Description:
// Serialization provided for the multi-process ports.
virtual void ReadSelf(istream& is);
virtual void WriteSelf(ostream& os);
protected:
vtkDataInformation();
~vtkDataInformation() {};
vtkDataInformation(vtkDataInformation&) {};
void operator=(vtkDataInformation&) {};
// A guess at how much memory would be consumed by the data object
// if the WholeExtent were updated.
unsigned long EstimatedWholeMemorySize;
// The Maximum MTime of all upstreamg filters and data objects.
// This does not include the MTime of this data object.
unsigned long PipelineMTime;
// How many upstream filters are local to the process.
// This will have to change to a float for Kens definition of locality.
float Locality;
// Support for processing series of data sets.
int SeriesLength;
};
#endif
......@@ -37,9 +37,9 @@ void vtkDirectory::PrintSelf(ostream& os, vtkIndent indent)
}
// First microsoft compilers
// First windows style directory access
#ifdef _MSC_VER
#ifdef _WIN32
#include <windows.h>
#include <io.h>
#include <ctype.h>
......@@ -106,7 +106,7 @@ int vtkDirectory::Open(const char* name)
#else
// Now the POSIX style directory access
// Unix style directory access
#include <sys/types.h>
#include <dirent.h>
......
/*=========================================================================
Program: Visualization Toolkit
Module: vtkExtent.h
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) 1993-2000 Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
of any contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
* Modified source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
// .NAME vtkExtent - Generalizes imaging extents into graphics.
// .SECTION Description
// Note: This object is under development an might change in the future.
// vtkExtent contains information to specify update extents of vtkDataSets.
// This is a superclass. Two subclasses exist. One for structured data,
// and one for unstructured data. The extent object will also indicate
// whether the request is for points or cells.
#ifndef __vtkExtent_h
#define __vtkExtent_h
#include "vtkObject.h"
class vtkStructuredExtent;
class vtkUnstructuredExtent;
class VTK_EXPORT vtkExtent : public vtkObject
{
public:
static vtkExtent *New();
vtkTypeMacro(vtkExtent,vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Copy information from one extent into another.
// Subclasses override this method, and try to be smart
// if the types are different.
virtual void Copy(vtkExtent *in);
// Description:
// We can use streaming to processes series of data sets one at a time.
vtkSetMacro(SeriesIndex, int);
vtkGetMacro(SeriesIndex, int);
// Description:
// Serialization provided for the multi-process ports.
virtual void ReadSelf(istream& is);
virtual void WriteSelf(ostream& os);
protected:
vtkExtent();
~vtkExtent() {};
vtkExtent(const vtkExtent&) {};
void operator=(const vtkExtent&) {};
int SeriesIndex;
};
#endif
......@@ -48,36 +48,36 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
void vtkGeneralTransform::PrintSelf(ostream& os, vtkIndent indent)
{
vtkObject::PrintSelf(os, indent);
os << indent << "TransformType: " << this->TransformType << "\n";
os << indent << "AutoUpdate: " << (this->AutoUpdate ? "On\n" : "Off\n");
}
//------------------------------------------------------------------------
// Update() and perform the transformation.
void vtkGeneralTransform::TransformPoint(const float input[3],
float output[3])
//----------------------------------------------------------------------------
vtkGeneralTransform::~vtkGeneralTransform()
{
this->Update();
this->InternalTransformPoint(input,output);
if (this->MyInverse)
{
this->MyInverse->Delete();
}
}
//----------------------------------------------------------------------------
// Convert double to float, then do the transformation. A subclass
// can override this method to provide true double-precision transformations.
void vtkGeneralTransform::TransformPoint(const double input[3],
double output[3])
// If the subclass has not defined a 'double' transform method, then
// use the 'float' transform method instead.
void vtkGeneralTransform::TransformPoint(const double in[3], double out[3])
{
float point[3];
point[0] = input[0];
point[1] = input[1];
point[2] = input[2];
point[0] = in[0];
point[1] = in[1];
point[2] = in[2];
this->TransformPoint(point,point);
output[0] = point[0];
output[1] = point[1];
output[2] = point[2];
out[0] = point[0];
out[1] = point[1];
out[2] = point[2];
}
//----------------------------------------------------------------------------
// These two functions are definitely not thread safe, and should
// really only be called from python or tcl.
float *vtkGeneralTransform::TransformFloatPoint(float x,
float y,
float z)
......@@ -102,101 +102,200 @@ double *vtkGeneralTransform::TransformDoublePoint(double x,
}
//----------------------------------------------------------------------------
// Transform a series of points.
void vtkGeneralTransform::TransformPoints(vtkPoints *in,
vtkPoints *out)
// If the subclass has not defined a TransformPoints method, then
// call the TransformPoint method for each point.
void vtkGeneralTransform::TransformPoints(vtkPoints *in, vtkPoints *out)
{
this->Update();
float point[3];
int i;
int n = in->GetNumberOfPoints();
float outPnt[3];
float *inPnt;
for (i = 0; i < n; i++)
{
in->GetPoint(i,point);
this->InternalTransformPoint(point,point);
out->InsertNextPoint(point);
inPnt = in->GetPoint(i);
this->TransformPoint(inPnt,outPnt);
out->InsertNextPoint(outPnt);
}
}
//----------------------------------------------------------------------------
// Transform the normals and vectors using the derivative of the
// transformation. Either inNms or inVrs can be set to NULL.
// Normals are multiplied by the inverse transpose of the transform
// derivative, while vectors are simply multiplied by the derivative.
// Note that the derivative of the inverse transform is simply the
// inverse of the derivative of the forward transform.
void vtkGeneralTransform::TransformPointsNormalsVectors(vtkPoints *inPts,
vtkPoints *outPts,
vtkNormals *inNms,
vtkNormals *outNms,
vtkVectors *inVrs,
vtkVectors *outVrs)
// If the subclass has not defined a TransformNormals method, then
// this method attempts to approximate the normals. This is only
// a second-order approximation and it is quite expensive, so if you can
// override this with a precise analytic calculation, you should.
void vtkGeneralTransform::TransformNormals(vtkPoints *inPts,
vtkPoints *outPts,
vtkNormals *inNms,
vtkNormals *outNms)
{
this->Update();
float matrix[3][3];
float coord[3];
int i;
int n = inPts->GetNumberOfPoints();
float offset1[3];
float offset2[3];
float point1[3];
float point2[3];
float point3[3];
float point4[3];
float outNormal[3];
float outNormalP[3];
float outNormalN[3];
float *inPoint,*outPoint,*inNormal;
float r,f;
for (i = 0; i < n; i++)
{
inPts->GetPoint(i,coord);
this->InternalTransformDerivative(coord,coord,matrix);
outPts->InsertNextPoint(coord);
inNormal = inNms->GetNormal(i);
inPoint = inPts->GetPoint(i);
outPoint = outPts->GetPoint(i);
// Set the scale to use in the
// calculation of the output normal.
f = 0.1;