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

Approximate VTK 2.3 release

The VTK 2.3 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.
......@@ -119,7 +119,7 @@ install_tcl_java: install_tcl
@${srcdir}/../${INSTALL} libVTK${ME}Java${SHLIB_SUFFIX} $(LIB_INSTALL_DIR)/libVTK${ME}Java${SHLIB_SUFFIX}
@chmod 555 $(LIB_INSTALL_DIR)/libVTK${ME}Java${SHLIB_SUFFIX}
install_java: install build_java
install_java: install
@echo "Installing libVTK${ME}Java${SHLIB_SUFFIX}"
@${srcdir}/../${INSTALL} libVTK${ME}Java${SHLIB_SUFFIX} $(LIB_INSTALL_DIR)/libVTK${ME}Java${SHLIB_SUFFIX}
@chmod 555 $(LIB_INSTALL_DIR)/libVTK${ME}Java${SHLIB_SUFFIX}
......
......@@ -129,7 +129,6 @@ install_contrib:
do_install_tcl_java: do_install_tcl
do_install_java:
cd java; ${MAKE} -${MAKEFLAGS} install
do_install:
......
......@@ -47,6 +47,3 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#ifdef VTK_USE_IMAGING
#include "../imaging/vtkImaging.h"
#endif
#ifdef VTK_USE_CONTRIB
#include "../contrib/vtkContrib.h"
#endif
......@@ -7,7 +7,7 @@
Version: $Revision$
Copyright (c) 1993-1999 Ken Martin, Will Schroeder, Bill Lorensen.
Copyright (c) 1993-1998 Ken Martin, Will Schroeder, Bill Lorensen.
This software is copyrighted by Ken Martin, Will Schroeder and Bill Lorensen.
The following terms apply to all files associated with the software unless
......@@ -38,10 +38,6 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
=========================================================================*/
#include "vtkActor2D.h"
#include "vtkActor2DCollection.h"
#include "vtkAttributeData.h"
#include "vtkBitArray.h"
#include "vtkByteSwap.h"
#include "vtkCell.h"
......@@ -51,16 +47,10 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#include "vtkCellTypes.h"
#include "vtkCharArray.h"
#include "vtkCollection.h"
#include "vtkContourValues.h"
#include "vtkCoordinate.h"
#include "vtkDataArray.h"
#include "vtkDataObject.h"
#include "vtkDataSet.h"
#include "vtkDataSetAttributes.h"
#include "vtkDataSetCollection.h"
#include "vtkDoubleArray.h"
#include "vtkEdgeTable.h"
#include "vtkEmptyCell.h"
#include "vtkFieldData.h"
#include "vtkFloatArray.h"
#include "vtkFloatNormals.h"
......@@ -69,16 +59,11 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#include "vtkFloatTCoords.h"
#include "vtkFloatTensors.h"
#include "vtkFloatVectors.h"
#include "vtkGenericCell.h"
#include "vtkHexahedron.h"
#include "vtkIdList.h"
#include "vtkImageCache.h"
#include "vtkImageData.h"
#include "vtkImageSimpleCache.h"
#include "vtkImageSource.h"
#include "vtkImageToStructuredPoints.h"
#include "vtkImplicitFunction.h"
#include "vtkImplicitFunctionCollection.h"
#include "vtkIndent.h"
#include "vtkIntArray.h"
#include "vtkLine.h"
......@@ -86,32 +71,20 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#include "vtkLogLookupTable.h"
#include "vtkLongArray.h"
#include "vtkLookupTable.h"
#include "vtkMapper2D.h"
#include "vtkMath.h"
#include "vtkMatrix4x4.h"
#include "vtkMergePoints2D.h"
#include "vtkMultiThreader.h"
#include "vtkMutexLock.h"
#include "vtkNormals.h"
#include "vtkObject.h"
#include "vtkPixel.h"
#include "vtkPlane.h"
#include "vtkPointData.h"
#include "vtkPointLocator.h"
#include "vtkPointLocator2D.h"
#include "vtkPointSet.h"
#include "vtkPoints.h"
#include "vtkPolyData.h"
#include "vtkPolyLine.h"
#include "vtkPolyVertex.h"
#include "vtkPolygon.h"
#include "vtkPriorityQueue.h"
#include "vtkProcessObject.h"
#include "vtkProcessStatistics.h"
#include "vtkProp.h"
#include "vtkPropCollection.h"
#include "vtkProperty2D.h"
#include "vtkPyramid.h"
#include "vtkQuad.h"
#include "vtkRectilinearGrid.h"
#include "vtkObject.h"
......@@ -122,15 +95,11 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#include "vtkStructuredData.h"
#include "vtkStructuredGrid.h"
#include "vtkStructuredPoints.h"
#include "vtkStructuredPointsSource.h"
#include "vtkStructuredPointsToImage.h"
#include "vtkTCoords.h"
#include "vtkTensors.h"
#include "vtkTetra.h"
#include "vtkTimeStamp.h"
#include "vtkTimerLog.h"
#include "vtkTransform.h"
#include "vtkTransformCollection.h"
#include "vtkTriangle.h"
#include "vtkTriangleStrip.h"
#include "vtkUnsignedCharArray.h"
......@@ -139,12 +108,8 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#include "vtkUnsignedLongArray.h"
#include "vtkUnstructuredGrid.h"
#include "vtkVectors.h"
#include "vtkVersion.h"
#include "vtkVertex.h"
#include "vtkViewport.h"
#include "vtkVoidArray.h"
#include "vtkVoxel.h"
#include "vtkWedge.h"
#include "vtkWindow.h"
#include "vtkWindowLevelLookupTable.h"
#include "vtkWindowToImageFilter.h"
......@@ -38,35 +38,10 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
=========================================================================*/
// .NAME vtkCoordinate - perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
// .NAME vtkCoordinate
// .SECTION Description
// vtkCoordinate represents position in a variety of coordinate systems, and
// converts position to other coordinate systems. It also supports relative
// positioning, so you can create a cascade of vtkCoordinate objects (no loops
// please!) that refer to each other. The typical usage of this object is
// to set the coordinate system in which to represent a position (e.g.,
// SetCoordinateSystemToNormalizedDisplay()), set the value of the coordinate
// (e.g., SetValue()), and then invoke the appropriate method to convert to
// another coordinate system (e.g., GetComputedWorldValue()).
//
// The coordinate systems in vtk are as follows:
//<PRE>
// DISPLAY - x-y pixel values in window
// NORMALIZED DISPLAY - x-y (0,1) normalized values
// VIEWPORT - x-y pixel values in viewport
// NORMALIZED VIEWPORT - x-y (0,1) normalized value in viewport
// VIEW - x-y-z (-1,1) values in camera coords. (z is depth)
// WORLD - x-y-z global coordinate values
//</PRE>
//
// If you cascade vtkCoordinate objects, you refer to another vtkCoordinate
// object which in turn can refer to others, and so on. This allows you to
// create composite groups of things like vtkActor2D that are positioned
// relative to one another. Note that in cascaded sequences, each
// vtkCoordinate object may be specified in different coordinate systems!
// .SECTION See Also
// vtkProp2D vtkActor2D vtkScalarBarActor
// vtkCoordinate represents a location or position. It supports multiple
// coordinate systems and relative positioning.
#ifndef __vtkCoordinate_h
#define __vtkCoordinate_h
......@@ -74,6 +49,7 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#include "vtkObject.h"
class vtkViewport;
#define VTK_DISPLAY 0
#define VTK_NORMALIZED_DISPLAY 1
#define VTK_VIEWPORT 2
......@@ -84,18 +60,21 @@ class vtkViewport;
class VTK_EXPORT vtkCoordinate : public vtkObject
{
public:
// Description:
// Creates an Coordinate with the following defaults:
// value of 0, 0, 0 in world coordinates
vtkCoordinate();
~vtkCoordinate();
void PrintSelf(ostream& os, vtkIndent indent);
const char *GetClassName() {return "vtkCoordinate";};
// Description:
// Creates an instance of this class with the following defaults:
// value of (0,0,0) in world coordinates.
// Destroy a Coordinate.
~vtkCoordinate();
static vtkCoordinate* New() {return new vtkCoordinate;};
void PrintSelf(ostream& os, vtkIndent indent);
const char *GetClassName() {return "vtkCoordinate";};
// Description:
// Set/get the coordinate system which this coordinate
// Set/get the coordinate system which this corrdinate
// is defined in. The options are Display, Normalized Display,
// Viewport, Normalized Viewport, View, and World.
vtkSetMacro(CoordinateSystem, int);
......@@ -138,9 +117,8 @@ public:
int *GetComputedDisplayValue(vtkViewport *);
int *GetComputedLocalDisplayValue(vtkViewport *);
// Description:
// GetComputedValue() will return either World, Viewport or
// Display based on what has been set as the coordinate system.
// GetComputed Value will return either World, Viewport or
// Display based on what has been set as the coordinate system
// This is good for objects like vtkLineSource, where the
// user might want to use them as World or Viewport coordinates
float *GetComputedValue(vtkViewport *);
......
......@@ -138,61 +138,6 @@ void vtkDataArray::GetData(int tupleMin, int tupleMax, int compMin, int compMax,
*ptr++ = tuple[i];
}
}
delete [] tuple;
}
// default double behaviour
void vtkDataArray::GetTuple(const int i, double * tuple)
{
int c;
int numComp=this->GetNumberOfComponents();
float *ftuple=new float[numComp];
this->GetTuple(i,ftuple);
for (c = 0; c < numComp; c++)
{
tuple[c] = ftuple[c];
}
delete [] ftuple;
}
void vtkDataArray::SetTuple(const int i, const double * tuple)
{
int c;
int numComp=this->GetNumberOfComponents();
float *ftuple=new float[numComp];
for (c = 0; c < numComp; c++)
{
ftuple[c] = (float)(tuple[c]);
}
this->SetTuple(i,ftuple);
delete [] ftuple;
}
void vtkDataArray::InsertTuple(const int i, const double * tuple)
{
int c;
int numComp=this->GetNumberOfComponents();
float *ftuple=new float[numComp];
for (c = 0; c < numComp; c++)
{
ftuple[c] = (float)(tuple[c]);
}
this->InsertTuple(i,ftuple);
delete [] ftuple;
}
int vtkDataArray::InsertNextTuple(const double * tuple)
{
int c;
int numComp=this->GetNumberOfComponents();
float *ftuple=new float[numComp];
for (c = 0; c < numComp; c++)
{
ftuple[c] = (float)(tuple[c]);
}
int ret = this->InsertNextTuple(ftuple);
delete [] ftuple;
return ret;
}
void vtkDataArray::PrintSelf(ostream& os, vtkIndent indent)
......
......@@ -116,27 +116,23 @@ public:
// Make sure that your array is large enough to hold the NumberOfComponents
// amount of data being returned.
virtual void GetTuple(const int i, float * tuple) = 0;
virtual void GetTuple(const int i, double * tuple);
// Description:
// Set the data tuple at ith location. Note that range checking or
// memory allocation is not performed; use this method in conjunction
// with SetNumberOfTuples() to allocate space.
virtual void SetTuple(const int i, const float * tuple) = 0;
virtual void SetTuple(const int i, const double * tuple);
// Description:
// Insert the data tuple at ith location. Note that memory allocation
// is performed as necessary to hold the data.
virtual void InsertTuple(const int i, const float * tuple) = 0;
virtual void InsertTuple(const int i, const double * tuple);
// Description:
// Insert the data tuple at the end of the array and return the location at
// which the data was inserted. Memory is allocated as necessary to hold
// the data.
virtual int InsertNextTuple(const float * tuple) = 0;
virtual int InsertNextTuple(const double * tuple);
// Description:
// Return the data component at the ith tuple and jth component location.
......
......@@ -57,6 +57,16 @@ vtkDataObject::~vtkDataObject()
this->FieldData->Delete();
}
// Used only by the source. No reference counting.
void vtkDataObject::SetSource(vtkSource *source)
{
if (this->Source != source)
{
this->Source = source;
this->Modified();
}
}
// Determine the modified time of this object
unsigned long int vtkDataObject::GetMTime()
{
......@@ -151,31 +161,3 @@ void vtkDataObject::PrintSelf(ostream& os, vtkIndent indent)
this->FieldData->PrintSelf(os,indent.GetNextIndent());
}
void vtkDataObject::SetSource(vtkSource *_arg)
{
vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting Source to " << _arg );
if (this->Source != _arg)
{
vtkSource *tmp = this->Source;
this->Source = _arg;
if (tmp != NULL) { tmp->UnRegister(this); }
if (this->Source != NULL) { this->Source->Register(this); }
this->Modified();
}
}
//----------------------------------------------------------------------------
void vtkDataObject::UnRegister(vtkObject *o)
{
// detect the circular loop source <-> data
// If we have two references and one of them is my data
// and I am not being unregistered by my data, break the loop.
if (this->ReferenceCount == 2 && this->Source != NULL &&
o != this->Source && this->Source->InRegisterLoop(this))
{
this->SetSource(NULL);
}
this->vtkObject::UnRegister(o);
}
......@@ -60,6 +60,7 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#include "vtkObject.h"
#include "vtkFieldData.h"
class vtkSource;
class VTK_EXPORT vtkDataObject : public vtkObject
......@@ -76,9 +77,8 @@ public:
virtual vtkDataObject *MakeObject() {return new vtkDataObject;};
// Description:
// Set/Get the source object creating this data object.
// Get the source object creating this data object.
vtkGetObjectMacro(Source,vtkSource);
void SetSource(vtkSource *s);
// Description:
// Data objects are composite objects and need to check each part for MTime.
......@@ -132,16 +132,14 @@ public:
vtkSetObjectMacro(FieldData,vtkFieldData);
vtkGetObjectMacro(FieldData,vtkFieldData);
//BTX - begin tcl exclude
// Description:
// Handle the source/data loop.
void UnRegister(vtkObject *o);
// Description:
// Get the net reference count. That is the count minus
// any self created loops. This is used in the Source/Data
// registration to properly free the objects.
virtual int GetNetReferenceCount() {return this->ReferenceCount;};
// This method is to be used only by the source (i.e., the filter generating
// this data object). The source is not reference counted by this data object to
// avoid mutually referencing loops.
void SetSource(vtkSource *source);
//ETX
protected:
vtkSource *Source;
vtkFieldData *FieldData; //General field data associated with data object
......
......@@ -241,14 +241,6 @@ void vtkDoubleArray::GetTuple(const int i, float * tuple)
tuple[j] = (float)t[j];
}
}
void vtkDoubleArray::GetTuple(const int i, double * tuple)
{
double *t = this->Array + this->NumberOfComponents*i;
for (int j=0; j<this->NumberOfComponents; j++)
{
tuple[j] = t[j];
}
}
// Set the tuple value at the ith location in the array.
void vtkDoubleArray::SetTuple(const int i, const float * tuple)
......@@ -259,14 +251,6 @@ void vtkDoubleArray::SetTuple(const int i, const float * tuple)
this->Array[loc+j] = (double)tuple[j];
}
}
void vtkDoubleArray::SetTuple(const int i, const double * tuple)
{
int loc = i * this->NumberOfComponents;
for (int j=0; j<this->NumberOfComponents; j++)
{
this->Array[loc+j] = tuple[j];
}
}
// Insert (memory allocation performed) the tuple into the ith location
// in the array.
......@@ -279,15 +263,6 @@ void vtkDoubleArray::InsertTuple(const int i, const float * tuple)
*t++ = (double)*tuple++;
}
}
void vtkDoubleArray::InsertTuple(const int i, const double * tuple)
{
double *t = this->WritePointer(i*this->NumberOfComponents,this->NumberOfComponents);
for (int j=0; j<this->NumberOfComponents; j++)
{
*t++ = *tuple++;
}
}
// Insert (memory allocation performed) the tuple onto the end of the array.
int vtkDoubleArray::InsertNextTuple(const float * tuple)
......@@ -302,16 +277,3 @@ int vtkDoubleArray::InsertNextTuple(const float * tuple)
return this->MaxId / this->NumberOfComponents;
}
int vtkDoubleArray::InsertNextTuple(const double * tuple)
{
int i = this->MaxId + 1;
double *t = this->WritePointer(i,this->NumberOfComponents);
for (i=0; i<this->NumberOfComponents; i++)
{
*t++ = *tuple++;
}
return this->MaxId / this->NumberOfComponents;
}
......@@ -87,23 +87,19 @@ public:
// Description:
// Copy the tuple value into a user-provided array.
void GetTuple(const int i, float * tuple);
virtual void GetTuple(const int i, double * tuple);
// Description:
// Set the tuple value at the ith location in the array.
void SetTuple(const int i, const float * tuple);
virtual void SetTuple(const int i, const double * tuple);
// Description:
// Insert (memory allocation performed) the tuple into the ith location
// in the array.
void InsertTuple(const int i, const float * tuple);
virtual void InsertTuple(const int i, const double * tuple);
// Description:
// Insert (memory allocation performed) the tuple onto the end of the array.
int InsertNextTuple(const float * tuple);
virtual int InsertNextTuple(const double * tuple);
// Description:
// Resize object to just fit data requirement. Reclaims extra memory.
......
......@@ -83,6 +83,10 @@ vtkImageCache::vtkImageCache()
//----------------------------------------------------------------------------
vtkImageCache::~vtkImageCache()
{
if (this->ImageToStructuredPoints)
{
this->ImageToStructuredPoints->Delete();
}
this->ReleaseData();
// get rid of reference count.
this->SetSource(NULL);
......@@ -541,35 +545,35 @@ long vtkImageCache::GetUpdateExtentMemorySize()
//----------------------------------------------------------------------------
// This method is used translparently by the "SetInput(vtkImageCache *)"
// method to connect the image pipeline to the visualization pipeline.
vtkImageToStructuredPoints *vtkImageCache::MakeImageToStructuredPoints()
vtkImageToStructuredPoints *vtkImageCache::GetImageToStructuredPoints()
{
if ( ! this->ImageToStructuredPoints)
{
this->ImageToStructuredPoints = vtkImageToStructuredPoints::New();
this->ImageToStructuredPoints->SetInput(this);
}
else
{
// we must up the ref count because this is a Make method
// it will be matched by a Delete
this->ImageToStructuredPoints->Register(this);
}
return this->ImageToStructuredPoints;
}
//----------------------------------------------------------------------------
// Check to see if we own an ImageToStructuredPoints which has registered
// this cache.
void vtkImageCache::UnRegister(vtkObject* o)
{
// detect the circular loop source <-> cache
// If we have two references and one of them is my cache
// and I am not being unregistered by my cache, break the loop.
if (this->ReferenceCount == 2 && this->Source != NULL &&
this->Source->GetOutput() == this && o != this->Source &&
this->Source->GetReferenceCount() == 1)
// detect the circular loop cache <-> ImageToStructuredPoints
// If we have two references and one of them is my itosp
// and I am not being unregistered by my itosp, break the loop.
if (this->GetReferenceCount() == 2 &&
this->ImageToStructuredPoints != NULL &&
this->ImageToStructuredPoints->GetInput() == this &&
this->ImageToStructuredPoints != o)
{
this->SetSource(NULL);
vtkImageToStructuredPoints *temp = this->ImageToStructuredPoints;
this->ImageToStructuredPoints = NULL;
temp->Delete();
}
this->vtkObject::UnRegister(o);
}
......
......@@ -169,7 +169,7 @@ public:
// Description:
// This method is used translparently by the "SetInput(vtkImageCache *)"
// method to connect the image pipeline to the visualization pipeline.
vtkImageToStructuredPoints *MakeImageToStructuredPoints();
vtkImageToStructuredPoints *GetImageToStructuredPoints();
// Description:
// Set the data scalar type of the regions created by this cache.
......
......@@ -296,8 +296,7 @@ void vtkImageSource::UnRegister(vtkObject *o)
// If we have two references and one of them is my cache
// and I am not being unregistered by my cache, break the loop.
if (this->ReferenceCount == 2 && this->Output != NULL &&
this->Output->GetSource() == this && o != this->Output &&
this->Output->GetReferenceCount() == 1)
this->Output->GetSource() == this && o != this->Output)
{
this->Output->SetSource(NULL);
}
......
......@@ -80,11 +80,6 @@ static void vtk_release_mutex() {
}
#define VTK_GET_MUTEX() vtk_get_mutex()
#define VTK_RELEASE_MUTEX() vtk_release_mutex()
#elif defined(__FreeBSD__) || defined(__linux__) || defined(sgi)
#include <pthread.h>
pthread_mutex_t vtkGlobalMutex;
#define VTK_GET_MUTEX() pthread_mutex_lock(&vtkGlobalMutex)
#define VTK_RELEASE_MUTEX() pthread_mutex_unlock(&vtkGlobalMutex)
#else
// for solaris
#include <thread.h>
......@@ -532,12 +527,3 @@ JNIEXPORT void vtkJavaVoidFuncArgDelete(void* arg)
delete arg2;
}
jobject vtkJavaExportedGetObjectFromPointer(void *ptr)
{
return vtkJavaGetObjectFromPointer(ptr);
}
void* vtkJavaExportedGetPointerFromObject(JNIEnv *env,jobject obj, char *result_type)
{
return vtkJavaGetPointerFromObject(env, obj, result_type);
}
......@@ -91,35 +91,21 @@ public:
static float Norm(float x[3])
{return sqrt(x[0]*x[0] + x[1]*x[1] + x[2]*x[2]);};
// Description:
// Compute the norm of 3-vector (double-precision version).
static double Norm(double x[3])
{return sqrt(x[0]*x[0] + x[1]*x[1] + x[2]*x[2]);};
// Description:
// Normalize (in place) a 3-vector. Returns norm of vector.
static float Normalize(float x[3]);
// Description:
// Normalize (in place) a 3-vector. Returns norm of vector
// (double-precision version).
static double Normalize(double x[3]);
// Description:
// Compute distance squared between two points.
static float Distance2BetweenPoints(float x[3], float y[3]);
// Description:
// Compute distance squared between two points (double precision version).
static double Distance2BetweenPoints(double x[3], double y[3]);
// Description:
// Dot product of two 2-vectors. The third (z) component is ignored.
static float Dot2D(float x[3], float