Commit 00ab53a4 authored by Ken Martin's avatar Ken Martin

ENH: merges from the main tree

parent e21d1e45
......@@ -130,15 +130,6 @@ vtkWindowLevelLookupTable.cxx
vtkXMLFileOutputWindow.cxx
)
IF (WIN32)
IF (NOT VTK_USE_X)
SET(Kit_SRCS ${Kit_SRCS} vtkWin32OutputWindow.cxx
vtkWin32ProcessOutputWindow.cxx vtkWin32OutputWindowProcessEncoded.c)
SET_SOURCE_FILES_PROPERTIES(vtkWin32OutputWindowProcessEncoded.c
PROPERTIES WRAP_EXCLUDE 1)
ENDIF (NOT VTK_USE_X)
ENDIF (WIN32)
SET_SOURCE_FILES_PROPERTIES(
# vtkObjectBase is marked ABSTRACT so that instantiators are happy.
vtkAbstractTransform
......@@ -189,6 +180,16 @@ SET(Kit_TCL_EXTRA_SRCS vtkTclUtil.cxx)
SET(Kit_PYTHON_EXTRA_SRCS vtkPythonUtil.cxx)
SET(Kit_JAVA_EXTRA_SRCS vtkJavaUtil.cxx)
IF (WIN32)
IF (NOT VTK_USE_X)
SET(Kit_SRCS ${Kit_SRCS} vtkWin32OutputWindow.cxx
vtkWin32ProcessOutputWindow.cxx)
SET(Kit_EXTRA_SRCS ${Kit_EXTRA_SRCS} vtkWin32OutputWindowProcessEncoded.c)
SET_SOURCE_FILES_PROPERTIES(vtkWin32OutputWindowProcessEncoded.c
PROPERTIES WRAP_EXCLUDE 1)
ENDIF (NOT VTK_USE_X)
ENDIF (WIN32)
# -----------------------------------------------------------------
# Start of common section
......@@ -309,6 +310,7 @@ ENDIF(VTK_WRAP_JAVA)
INSTALL_FILES(/include/vtk .txx
vtkDataArrayTemplate
vtkDataArrayTemplateImplicit
)
INSTALL_FILES(/lib/vtk/testing FILES
......
......@@ -29,11 +29,13 @@ SET(CTEST_CUSTOM_MEMCHECK_IGNORE
TestSetObjectMacro-Patented
TestSetObjectMacro-Rendering
Install
Example-vtkMy
)
SET(CTEST_CUSTOM_MEMCHECK_IGNORE
${CTEST_CUSTOM_MEMCHECK_IGNORE}
largeImageOffset-image
largeImageParallel-image
Sockets-image
)
......@@ -15,7 +15,7 @@
#include "vtkAmoebaMinimizer.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkAmoebaMinimizer, "1.3");
vtkCxxRevisionMacro(vtkAmoebaMinimizer, "1.3.4.1");
vtkStandardNewMacro(vtkAmoebaMinimizer);
//----------------------------------------------------------------------------
......@@ -86,7 +86,7 @@ vtkAmoebaMinimizer::~vtkAmoebaMinimizer()
//----------------------------------------------------------------------------
void vtkAmoebaMinimizer::PrintSelf(ostream& os, vtkIndent indent)
{
this->vtkObject::PrintSelf(os, indent);
this->Superclass::PrintSelf(os, indent);
os << indent << "NumberOfParameters: " << this->GetNumberOfParameters() << "\n";
if (this->NumberOfParameters > 0)
{
......
......@@ -54,10 +54,7 @@ static const char *vtkCommandEventStrings[] = {
"StartWindowLevelEvent",
"EndWindowLevelEvent",
"ResetWindowLevelEvent",
"NextDataEvent",
"PushDataStartEvent",
"SetOutputEvent",
"EndOfDataEvent",
"ErrorEvent",
"WarningEvent",
"StartInteractionEvent",
......
......@@ -134,10 +134,7 @@ public:
StartWindowLevelEvent,
EndWindowLevelEvent,
ResetWindowLevelEvent,
NextDataEvent,
PushDataStartEvent,
SetOutputEvent,
EndOfDataEvent,
ErrorEvent,
WarningEvent,
StartInteractionEvent, //mainly used by vtkInteractorObservers
......
......@@ -30,7 +30,7 @@
#include "vtkUnsignedLongArray.h"
#include "vtkUnsignedShortArray.h"
vtkCxxRevisionMacro(vtkDataArray, "1.63.4.1");
vtkCxxRevisionMacro(vtkDataArray, "1.63.4.2");
// Construct object with default tuple dimension (number of components) of 1.
vtkDataArray::vtkDataArray(vtkIdType numComp)
......@@ -524,7 +524,7 @@ unsigned long vtkDataArray::GetDataTypeSize(int type)
switch (type)
{
case VTK_BIT:
return 0;
return 1;
break;
case VTK_CHAR:
......
......@@ -300,6 +300,9 @@ public:
// Description:
// Return the range of the array values for the given component.
// Range is copied into the array provided.
// If comp is equal to -1, it returns the range of the magnitude
// (if the number of components is equal to 1 it still returns the range of
// component 0).
void GetRange(double range[2], int comp)
{
this->ComputeRange(comp);
......
......@@ -78,6 +78,8 @@ void vtkDataArrayTemplate<T>::SetArray(T* array, vtkIdType size, int save)
template <class T>
int vtkDataArrayTemplate<T>::Allocate(vtkIdType sz, vtkIdType)
{
this->MaxId = -1;
if(sz > this->Size)
{
if(this->Array && !this->SaveUserArray)
......@@ -85,17 +87,19 @@ int vtkDataArrayTemplate<T>::Allocate(vtkIdType sz, vtkIdType)
delete [] this->Array;
}
this->Size = ( sz > 0 ? sz : 1);
this->Array = new T[this->Size];
this->Array = 0;
this->Size = 0;
this->SaveUserArray = 0;
int newSize = (sz > 0 ? sz : 1);
this->Array = new T[newSize];
if(!this->Array)
{
return 0;
}
this->SaveUserArray = 0;
this->Size = newSize;
}
this->MaxId = -1;
return 1;
}
......
......@@ -38,6 +38,11 @@ vtkOStreamWrapper::vtkOStreamWrapper(vtkOStreamWrapper& r): ostr(r.ostr)
{
}
//----------------------------------------------------------------------------
vtkOStreamWrapper::~vtkOStreamWrapper()
{
}
//----------------------------------------------------------------------------
vtkOStreamWrapper& vtkOStreamWrapper::operator << (const EndlType&)
{
......
......@@ -42,6 +42,9 @@ public:
vtkOStreamWrapper(ostream& os);
vtkOStreamWrapper(vtkOStreamWrapper& r);
// Description:
virtual ~vtkOStreamWrapper();
// Description:
// Type for a fake endl.
struct EndlType {};
......
......@@ -18,7 +18,7 @@
#include "vtkCommand.h"
#include "vtkTimeStamp.h"
vtkCxxRevisionMacro(vtkObject, "1.90");
vtkCxxRevisionMacro(vtkObject, "1.90.2.1");
// Initialize static member that controls warning display
static int vtkObjectGlobalWarningDisplay = 1;
......@@ -160,13 +160,15 @@ void vtkObject::PrintSelf(ostream& os, vtkIndent indent)
os << indent << "Debug: " << (this->Debug ? "On\n" : "Off\n");
os << indent << "Modified Time: " << this->GetMTime() << "\n";
this->Superclass::PrintSelf(os, indent);
os << indent << "Registered Events: ";
if ( this->SubjectHelper )
{
this->SubjectHelper->PrintSelf(os,indent);
os << endl;
this->SubjectHelper->PrintSelf(os,indent.GetNextIndent());
}
else
{
os << indent << "Registered Events: (none)\n";
os << "(none)\n";
}
}
......
......@@ -417,18 +417,9 @@ extern VTK_COMMON_EXPORT void vtkOutputWindowDisplayDebugText(const char*);
// This macro is used for debug statements in instance methods
// vtkDebugMacro(<< "this is debug info" << this->SomeVariable);
//
#ifdef VTK_LEAN_AND_MEAN
#define vtkDebugMacro(x)
#else
#define vtkDebugMacro(x) \
{ if (this->Debug && vtkObject::GetGlobalWarningDisplay()) \
{ vtkOStreamWrapper::EndlType endl; \
vtkOStreamWrapper::UseEndl(endl); \
vtkOStrStreamWrapper vtkmsg; \
vtkmsg << "Debug: In " __FILE__ ", line " << __LINE__ << "\n" << this->GetClassName() << " (" << this << "): " x << "\n\n"; \
vtkOutputWindowDisplayDebugText(vtkmsg.str());\
vtkmsg.rdbuf()->freeze(0);}}
#endif
vtkDebugWithObjectMacro(this,x)
//
// This macro is used to print out warning messages.
// vtkWarningMacro(<< "Warning message" << variable);
......@@ -495,7 +486,23 @@ extern VTK_COMMON_EXPORT void vtkOutputWindowDisplayDebugText(const char*);
} \
}
#ifdef VTK_LEAN_AND_MEAN
# define vtkDebugWithObjectMacro(self, x)
#else
# define vtkDebugWithObjectMacro(self, x) \
{ \
if (self->GetDebug() && vtkObject::GetGlobalWarningDisplay()) \
{ \
vtkOStreamWrapper::EndlType endl; \
vtkOStreamWrapper::UseEndl(endl); \
vtkOStrStreamWrapper vtkmsg; \
vtkmsg << "Debug: In " __FILE__ ", line " << __LINE__ << "\n" \
<< self->GetClassName() << " (" << self << "): " x << "\n\n"; \
vtkOutputWindowDisplayDebugText(vtkmsg.str()); \
vtkmsg.rdbuf()->freeze(0); \
} \
}
#endif
//
// This macro is used to quiet compiler warnings about unused parameters
......
......@@ -27,6 +27,9 @@
class VTK_COMMON_EXPORT vtkSmartPointerBase
{
private:
struct SafeBoolDummy { void Dummy() {} };
typedef void (SafeBoolDummy::* SafeBool)();
public:
// Description:
// Initialize smart pointer to NULL.
......@@ -59,6 +62,20 @@ public:
// inlined.
return this->Object;
}
// Description:
// Return true if pointer is set to non-null.
operator SafeBool()
{
return this->Object? &SafeBoolDummy::Dummy : 0;
}
// Description:
// Return true if pointer is set to null.
SafeBool operator!()
{
return this->Object? 0 : &SafeBoolDummy::Dummy;
}
protected:
// Initialize smart pointer to given object, but do not increment
......@@ -77,7 +94,7 @@ private:
};
//----------------------------------------------------------------------------
// Need to use vtkstd_bool type because vtkstd::less requires bool return
// Need to use vtkstd_bool type because std: :less requires bool return
// type from operators. This example should not be used to justify
// using bool elsewhere in VTK.
......
......@@ -18,7 +18,7 @@
// The vtkSystemIncludes centralizes the inclusion of system include
// files. (This is particularly important as VTK moves towards ANSI
// C++.) For example, this include file enables user's to build VTK
// with STL (i.e., use ostream and other standard ANSI C++
// with STL (i.e., use std: :ostream and other standard ANSI C++
// functionality). A configured flag in vtkConfigure.h
// (VTK_USE_ANSI_STDLIB) must be set to enable ANSI C++ compliance.
......@@ -148,6 +148,7 @@ typedef int vtkIdType;
#define VTK_HIERARCHICAL_DATA_SET 12
#define VTK_MULTI_BLOCK_DATA_SET 13
#define VTK_HIERARCHICAL_BOX_DATA_SET 14
#define VTK_GENERIC_DATA_SET 15
// These types define error codes for vtk functions
#define VTK_OK 1
......
......@@ -81,6 +81,12 @@ Do_not_include_vtkWin32Header_directly__vtkSystemIncludes_includes_it;
#define VTK_IMAGING_EXPORT __declspec( dllimport )
#endif
#if defined(vtkGenericFiltering_EXPORTS)
#define VTK_GENERIC_FILTERING_EXPORT __declspec( dllexport )
#else
#define VTK_GENERIC_FILTERING_EXPORT __declspec( dllimport )
#endif
#if defined(vtkGraphics_EXPORTS)
#define VTK_GRAPHICS_EXPORT __declspec( dllexport )
#else
......@@ -119,6 +125,7 @@ Do_not_include_vtkWin32Header_directly__vtkSystemIncludes_includes_it;
#else
#define VTK_COMMON_EXPORT
#define VTK_FILTERING_EXPORT
#define VTK_GENERIC_FILTERING_EXPORT
#define VTK_GRAPHICS_EXPORT
#define VTK_IMAGING_EXPORT
#define VTK_IO_EXPORT
......
......@@ -116,7 +116,7 @@ vtkImageTracerWidget itw
# Set the initial rotation of the glyph if desired. The default glyph
# set internally by the widget is a '+' so rotating 45 deg. gives a 'x'
#
itw SetGlyphAngle 45.0
[itw GetGlyphSource] SetRotationAngle 45.0
[itw GetGlyphSource] Modified
itw ProjectToPlaneOn
itw SetProjectionNormalToXAxes
......
......@@ -271,6 +271,7 @@ LRESULT CVtkMDIView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
case WM_MOUSEMOVE:
case WM_MOUSEWHEEL:
case WM_CHAR:
case WM_TIMER:
if (this->iren->GetInitialized())
......
......@@ -285,6 +285,7 @@ LRESULT CVtkSDIView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
case WM_MOUSEMOVE:
case WM_MOUSEWHEEL:
case WM_CHAR:
case WM_TIMER:
if (this->iren->GetInitialized())
......
......@@ -53,8 +53,7 @@ void SetIsoValueRMI(void *localArg, void* vtkNotUsed(remoteArg),
{
float val;
vtkContourFilter *iso;
iso = (vtkContourFilter *)localArg;
vtkContourFilter *iso = reinterpret_cast<vtkContourFilter *>(localArg);
val = iso->GetValue(0);
iso->SetValue(0, val + ISO_STEP);
}
......@@ -119,7 +118,7 @@ void MyMain( vtkMultiProcessController *controller, void *arg )
// Loop which processes RMI requests.
// Use vtkMultiProcessController::BREAK_RMI_TAG to break it.
// The root process with send a ISO_VALUE_RMI_TAG to make this
// The root process will send an ISO_VALUE_RMI_TAG to make this
// process change it's contour value.
upPort->WaitForUpdate();
......@@ -256,7 +255,7 @@ int main( int argc, char* argv[] )
char* fname = vtkTestUtilities::ExpandDataFileName(argc, argv,
"Data/headsq/quarter");
controller->SetSingleMethod(MyMain, reinterpret_cast<void*>(fname));
controller->SetSingleMethod(MyMain, (void*)fname );
// When using MPI, the number of processes is determined
// by the external program which launches this application.
......
......@@ -16,6 +16,7 @@
#include "vtkAlgorithmOutput.h"
#include "vtkCommand.h"
#include "vtkDataObject.h"
#include "vtkGarbageCollector.h"
#include "vtkInformation.h"
#include "vtkInformationInformationVectorKey.h"
......@@ -29,7 +30,7 @@
#include <vtkstd/set>
#include <vtkstd/vector>
vtkCxxRevisionMacro(vtkAlgorithm, "1.1.2.5");
vtkCxxRevisionMacro(vtkAlgorithm, "1.1.2.6");
vtkStandardNewMacro(vtkAlgorithm);
vtkCxxSetObjectMacro(vtkAlgorithm,Information,vtkInformation);
......@@ -785,3 +786,28 @@ void vtkAlgorithm::ConvertTotalInputToPortConnection(
}
}
//----------------------------------------------------------------------------
void vtkAlgorithm::ReleaseDataFlagOn()
{
if(vtkDemandDrivenPipeline* ddp =
vtkDemandDrivenPipeline::SafeDownCast(this->GetExecutive()))
{
for(int i=0; i < this->GetNumberOfOutputPorts(); ++i)
{
ddp->SetReleaseDataFlag(i, 1);
}
}
}
//----------------------------------------------------------------------------
void vtkAlgorithm::ReleaseDataFlagOff()
{
if(vtkDemandDrivenPipeline* ddp =
vtkDemandDrivenPipeline::SafeDownCast(this->GetExecutive()))
{
for(int i=0; i < this->GetNumberOfOutputPorts(); ++i)
{
ddp->SetReleaseDataFlag(i, 0);
}
}
}
......@@ -210,6 +210,20 @@ public:
// connections to a port, connecction pair
void ConvertTotalInputToPortConnection(int ind, int &port, int &conn);
//======================================================================
//The followling block of code is to support old style VTK applications. If
//you are using these calls there are better ways to do it in the new
//pipeline
//======================================================================
// Description:
// Turn release data flag on or off for all output ports.
void ReleaseDataFlagOn();
void ReleaseDataFlagOff();
//========================================================================
protected:
vtkAlgorithm();
~vtkAlgorithm();
......
......@@ -25,7 +25,7 @@
#include "vtkTetra.h"
#include "vtkTriangle.h"
vtkCxxRevisionMacro(vtkConvexPointSet, "1.1");
vtkCxxRevisionMacro(vtkConvexPointSet, "1.1.2.1");
vtkStandardNewMacro(vtkConvexPointSet);
//----------------------------------------------------------------------------
......@@ -43,6 +43,7 @@ vtkConvexPointSet::vtkConvexPointSet()
this->Triangulator = vtkOrderedTriangulator::New();
this->Triangulator->PreSortedOff();
this->Triangulator->UseTemplatesOff();
this->ParametricCoords = NULL;
}
//----------------------------------------------------------------------------
......
......@@ -31,7 +31,7 @@ static int PRIME_NUMBERS[] = {1, 3, 7, 13, 31, 61, 127, 251, 509, 1021,
// 1572869, 3145739, 6291469, 12582917, 25165843,
vtkCxxRevisionMacro(vtkGenericEdgeTable, "1.1");
vtkCxxRevisionMacro(vtkGenericEdgeTable, "1.1.2.1");
vtkStandardNewMacro(vtkGenericEdgeTable);
class vtkEdgeTablePoints
......@@ -145,7 +145,6 @@ void vtkEdgeTableEdge::LoadFactor()
VectorEdgeTableType v = Vector[i];
numEntry += v.size();
if(v.size()) numBins++;
//std::cerr << v.size() << ",";
}
cerr << "\n";
cerr << size << "," << numEntry << "," << numBins << "," << Modulo
......@@ -534,6 +533,22 @@ void vtkGenericEdgeTable::Initialize(vtkIdType start)
this->LastPointId = start;
}
//-----------------------------------------------------------------------------
// Description:
// Return the last point id inserted.
vtkIdType vtkGenericEdgeTable::GetLastPointId()
{
return this->LastPointId;
}
//-----------------------------------------------------------------------------
// Description:
// Increment the last point id.
void vtkGenericEdgeTable::IncrementLastPointId()
{
++this->LastPointId;
}
//-----------------------------------------------------------------------------
vtkIdType vtkGenericEdgeTable::HashFunction(vtkIdType ptId)
{
......
......@@ -81,6 +81,14 @@ public:
// To specify the starting point id.
void Initialize(vtkIdType start);
// Description:
// Return the last point id inserted.
vtkIdType GetLastPointId();
// Description:
// Increment the last point id.
void IncrementLastPointId();
// Description:
// Check if a point is already in the point table.
int CheckPoint(vtkIdType ptId);
......@@ -118,6 +126,9 @@ public:
this->Coord[0] = -100;
this->Coord[1] = -100;
this->Coord[2] = -100;
this->Scalar[0] = -200;
this->Scalar[1] = -200;
this->Scalar[2] = -200;
}
~PointEntry() {}
......
......@@ -35,6 +35,7 @@
class vtkGenericAttributeCollection;
class vtkGenericAdaptorCell;
class vtkGenericDataSet;
class VTK_FILTERING_EXPORT vtkGenericSubdivisionErrorMetric : public vtkObject
{
......@@ -49,12 +50,61 @@ public:
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Specify the error value used to control the subdivision.
vtkGetMacro(Error, double);
vtkSetMacro(Error, double);
// Specify the number of component to interpolate
// This is for internal use only
vtkGetMacro(GeometricTolerance, double);
// Description:
// Set the geometric accuracy with an absolute value.
// This is the geometric object-based accuracy.
// Subdivision will be required if the square distance between the real
// point and the interpolated point is greater than `value'. For instance
// 0.01 will give better result than 0.1.
// \pre positive_value: value>0
void SetAbsoluteGeometricTolerance(double value);
// Description:
// Set the geometric accuracy with a value relative to the length of the
// bounding box of the dataset. Internally compute the absolute tolerance.
// For instance 0.01 will give better result than 0.1.
// \pre valid_range_value: value>0 && value<1
// \pre ds_exists: ds!=0
void SetRelativeGeometricTolerance(double value,
vtkGenericDataSet *ds);
// Description:
// Subdivision is required if the square distance between the projection of
// the real point and the projection of the interpolated point is greater
// than PixelTolerance.
// This is the geometric screen-based accuracy.
// An accuracy less or equal to 0.25 means that the two projected point are
// on the same pixel.
// CAN WE HAVE A VALUE <0.25 with antialiasing ?
vtkGetMacro(PixelTolerance, double);
// Description:
// Set the pixel accuracy to `value'. See GetPixelTolerance() for details.
// \pre valid_value: value>=0.25
void SetPixelTolerance(double value);
// Description:
// Relative tolerance of the active scalar (attribute+component).
// Subdivision is required if the square distance between the real attribute
// at the mid point on the edge and the interpolated attribute is greater
// than AttributeTolerance.
// This is the attribute accuracy.
// 0.01 will give better result than 0.1.
vtkGetMacro(AttributeTolerance, double);
// Description:
// Set the relative attribute accuracy to `value'. See
// GetAttributeTolerance() for details.
// \pre valid_range_value: value>0 && value<1
void SetAttributeTolerance(double value);
// Description:
// Return whether the indicated edge exceeds the error metric.
// e1 and e2 are in parametric coordinates.
virtual bool EvaluateEdge( double* e1, double* e2 );
// Description:
......@@ -83,7 +133,35 @@ protected:
vtkGenericSubdivisionErrorMetric();
virtual ~vtkGenericSubdivisionErrorMetric();
double Error;
// Description:
// Compute the absolute attribute tolerance, only if the cached value is
// obsolete.
void ComputeAbsoluteAttributeTolerance();
// Description:
// Compute world coordinates of the vertices `e1' and `e2' defining the edge.
// The result is in Edge1Cache and Edge2Cache. The middle of the straight
// line is InterpolatedCenterCache, the middle of the arc is RealCenterCache.
void ComputeCoordinates(double *e1,
double *e2);
// Description:
// Square distance between a straight line (defined by points x and y)
// and a point z. Property: if x and y are equal, the line is a point and
// the result is the square distance between points x and z.
double Distance2LinePoint(double x[3],
double y[3],
double z[3]);
double GeometricTolerance;
double PixelTolerance;
double AttributeTolerance;
double AbsoluteAttributeTolerance; // cached value computed from
// AttributeTolerance and active attribute/component
vtkTimeStamp AbsoluteAttributeToleranceComputeTime;
vtkGenericAttributeCollection *AttributeCollection;
vtkGenericAdaptorCell *GenericCell;
vtkTimeStamp SubdivisionMTime;
......@@ -92,6 +170,10 @@ protected:
double *Edge1Cache;
double *Edge2Cache;
// Format: xyz
double RealCenterCache[3];
double InterpolatedCenterCache[3];
double EvaluateGeometricError(double *e1, double *e2);
double EvaluateAttributesError(double *e1, double *e2);
......
......@@ -29,7 +29,7 @@
#include "vtkMath.h"
#include "vtkPoints.h"
vtkCxxRevisionMacro(vtkHexagonalPrism, "1.1");
vtkCxxRevisionMacro(vtkHexagonalPrism, "1.1.2.1");
vtkStandardNewMacro(<