Commit 4d6be94b authored by Chuck Atkins's avatar Chuck Atkins

Merge branches 'deprecate-classes', 'zlib-soversion', 'unlink-agl',...

Merge branches 'deprecate-classes', 'zlib-soversion', 'unlink-agl', 'osmesa_32', 'matrix-cleanup2', 'solveleastsquares-memory-leak', 'python3_vtk_qt_fixes', '15914-reslice-mapper', 'release_splat_memory', 'km_coverity1', 'fix-cxx11-cmake-warning', 'fix-for-special-chars-in-dir' and 'ios-9.2-vtk7' into release

* deprecate-classes:
  Deprecating vtkVolumeRaycastMapper and vtkVolumeTextureMapper2D/3D.

* zlib-soversion:
  zlib 2015-12-14 (751703ae)
  zlib: remove zlib1.rc from the list of used files.
  zlib 2015-12-09 (acc12639)
  ThirdParty: Improve update script default merge message behavior
  ThirdParty: Teach update script to find upstream hash in commit message
  ThirdParty: Teach update script to store upstream hash in commit message
  metaio 2015-11-23 (4c85a18e)
  jsoncpp 2015-10-01 (eb1ddde0)
  png 2015-12-07 (63adbb10)
  zlib 2015-11-18 (0abb295c)

* unlink-agl:
  Remove AGL.framework from OS X OPENGL_LIBRARIES.

* osmesa_32:
  get a 3.2 context from OS mesa using new funcs

* matrix-cleanup2:
  Change deprecation warning to "VTK 7.0".
  Synchronize vtkMatrix3x3 with vtkMatrix4x4.
  Remove warning about deprecated method usage.
  Eliminate C-style casts from vtkMatrix4x4.
  Rename Element parameter to element.
  Mark legacy methods as "legacy".
  Remove the legacy BTX/ETX markers.
  Move some comments so they become visible to doxygen.

* solveleastsquares-memory-leak:
  Fix memory leak in vtkMath::SolveLeastSquares.

* python3_vtk_qt_fixes:
  Fixes QTVTKRenderWindowInteractor for python3

* 15914-reslice-mapper:
  BUG 15914: Fix corrupt image from vtkImageResliceMapper

* release_splat_memory:
  Free up memory in the point gaussian

* km_coverity1:
  Fix some coverity issues

* fix-cxx11-cmake-warning:
  fix a cmake warning for users of VTK

* fix-for-special-chars-in-dir:
  Fix CMake error if in directory with ++ in name.

* ios-9.2-vtk7:
  ios: fix newline-at-end-of-file
  update for newer versions of iOS
......@@ -6,7 +6,8 @@
# to load VTK's settings for an external project.
@VTK_CONFIG_CODE@
if (@VTK_USE_CXX11_FEATURES@)
set(VTK_USE_CXX11_FEATURES @VTK_USE_CXX11_FEATURES@)
if (VTK_USE_CXX11_FEATURES)
if (CMAKE_VERSION VERSION_LESS "3.1")
message(FATAL_ERROR "VTK was built with C++11 features using CMake's CXX_STANDARD_REQUIRED feature. Configuring projects this way requires a newer version of CMake. Please update to CMake 3.1 or newer")
endif()
......
......@@ -77,7 +77,13 @@ if (NOT CMAKE_OSX_SYSROOT)
iPhoneOS7.1.sdk
iPhoneOS8.0.sdk
iPhoneOS9.0.sdk
iPhoneOS9.1.sdk)
iPhoneOS9.1.sdk
iPhoneOS9.2.sdk
iPhoneOS9.3.sdk # guess
iPhoneOS9.4.sdk # guess
iPhoneOS10.0.sdk # guess
iPhoneOS10.1.sdk # guess
)
if (EXISTS ${sdk_root}/${sdk} AND IS_DIRECTORY ${sdk_root}/${sdk})
set(CMAKE_OSX_SYSROOT ${sdk_root}/${sdk})
endif()
......
......@@ -86,7 +86,13 @@ if (NOT CMAKE_OSX_SYSROOT)
iPhoneSimulator7.1.sdk
iPhoneSimulator8.0.sdk
iPhoneSimulator9.0.sdk
iPhoneSimulator9.1.sdk)
iPhoneSimulator9.1.sdk
iPhoneSimulator9.2.sdk
iPhoneSimulator9.3.sdk # guess
iPhoneSimulator9.4.sdk # guess
iPhoneSimulator10.0.sdk # guess
iPhoneSimulator10.1.sdk # guess
)
if (EXISTS ${sdk_root}/${sdk} AND IS_DIRECTORY ${sdk_root}/${sdk})
set(CMAKE_OSX_SYSROOT ${sdk_root}/${sdk})
endif()
......
......@@ -64,6 +64,21 @@ elseif(VTK_USE_OFFSCREEN_EGL)
else()
find_package(OpenGL REQUIRED)
include_directories(SYSTEM ${OPENGL_INCLUDE_DIR})
if(APPLE)
# Remove the deprecated AGL framework found by FindOpenGL.cmake
# (this is only required for CMake 3.4.1 and earlier)
set(_new_libs)
foreach(_lib ${OPENGL_LIBRARIES})
get_filename_component(_name "${_lib}" NAME)
string(TOLOWER "${_name}" _name)
if(NOT "${_name}" STREQUAL "agl.framework")
list(APPEND _new_libs ${_lib})
endif()
endforeach()
set(OPENGL_LIBRARIES ${_new_libs})
unset(_new_libs)
unset(_name)
endif()
endif()
# Function to link a VTK target to the necessary OpenGL libraries.
......
......@@ -1014,6 +1014,7 @@ int vtkMath::SolveLeastSquares(int numberOfSamples, double **xt, int xOrder,
double **hmt = NULL;
int homogRC = 0;
int *homogenFlags = new int[yOrder];
int successFlag;
// Ok, first init some flags check and see if all the systems are homogeneous
if (checkHomogeneous)
......@@ -1138,22 +1139,20 @@ int vtkMath::SolveLeastSquares(int numberOfSamples, double **xt, int xOrder,
}
}
// next get the inverse of XXt
if (!(vtkMath::InvertMatrix(XXt, XXtI, xOrder)))
{
delete [] homogenFlags;
return 0;
}
successFlag = vtkMath::InvertMatrix(XXt, XXtI, xOrder);
// next get m
for (i = 0; i < xOrder; i++)
// next get the inverse of XXt
if (successFlag)
{
for (j = 0; j < yOrder; j++)
for (i = 0; i < xOrder; i++)
{
mt[i][j] = 0.0;
for (k = 0; k < xOrder; k++)
for (j = 0; j < yOrder; j++)
{
mt[i][j] += XXtI[i][k] * XYt[k][j];
mt[i][j] = 0.0;
for (k = 0; k < xOrder; k++)
{
mt[i][j] += XXtI[i][k] * XYt[k][j];
}
}
}
}
......@@ -1198,11 +1197,11 @@ int vtkMath::SolveLeastSquares(int numberOfSamples, double **xt, int xOrder,
if (someHomogeneous)
{
return homogRC;
return homogRC && successFlag;
}
else
{
return 1;
return successFlag;
}
}
......
......@@ -38,28 +38,16 @@ int TestMatrix3x3(int,char *[])
// Check copying and comparison
vtkNew<vtkMatrix3x3> matrix2;
matrix2->DeepCopy(matrix.GetPointer());
if (*matrix.GetPointer() != *matrix2.GetPointer())
{
vtkGenericWarningMacro("DeepCopy of vtkMatrix3x3 failed.");
return 1;
}
if (!(*matrix.GetPointer() == *matrix2.GetPointer()))
for (int i = 0; i < 3; ++i)
{
vtkGenericWarningMacro("Problem with vtkMatrix3x3::operator==");
return 1;
for (int j = 0; j < 3; ++j)
if (matrix->GetElement(i, j) != matrix2->GetElement(i, j))
{
vtkGenericWarningMacro("DeepCopy of vtkMatrix3x3 failed.");
return 1;
}
}
matrix2->SetElement(0, 0, 5.0);
if (!(*matrix.GetPointer() != *matrix2.GetPointer()))
{
vtkGenericWarningMacro("Problem with vtkMatrix3x3::operator!=");
return 1;
}
if (*matrix.GetPointer() == *matrix2.GetPointer())
{
vtkGenericWarningMacro("Problem with vtkMatrix3x3::operator==");
return 1;
}
if (!vtkMathUtilities::FuzzyCompare(matrix2->GetElement(0, 0), 5.0))
{
vtkGenericWarningMacro("Value not stored in matrix properly.");
......
This diff is collapsed.
......@@ -51,32 +51,26 @@ public:
// of the source Matrix.
void DeepCopy(vtkMatrix3x3 *source)
{vtkMatrix3x3::DeepCopy(*this->Element,source); this->Modified(); }
//BTX
static void DeepCopy(double Elements[9], vtkMatrix3x3 *source)
{vtkMatrix3x3::DeepCopy(Elements,*source->Element); }
static void DeepCopy(double Elements[9], const double newElements[9]);
//ETX
static void DeepCopy(double elements[9], vtkMatrix3x3 *source)
{vtkMatrix3x3::DeepCopy(elements,*source->Element); }
static void DeepCopy(double elements[9], const double newElements[9]);
// Description:
// Non-static member function. Assigns *from* elements array
void DeepCopy(const double Elements[9])
{ this->DeepCopy(*this->Element,Elements); this->Modified(); }
void DeepCopy(const double elements[9])
{ this->DeepCopy(*this->Element,elements); this->Modified(); }
// Description:
// Set all of the elements to zero.
void Zero()
{ vtkMatrix3x3::Zero(*this->Element); this->Modified(); }
//BTX
static void Zero(double Elements[9]);
//ETX
static void Zero(double elements[9]);
// Description:
// Set equal to Identity matrix
void Identity()
{ vtkMatrix3x3::Identity(*this->Element); this->Modified();}
//BTX
static void Identity(double Elements[9]);
//ETX
static void Identity(double elements[9]);
// Description:
// Matrix Inversion (adapted from Richard Carling in "Graphics Gems,"
......@@ -85,10 +79,7 @@ public:
{vtkMatrix3x3::Invert(*in->Element,*out->Element); out->Modified(); }
void Invert()
{ vtkMatrix3x3::Invert(this,this); }
//BTX
static void Invert(const double inElements[9], double outElements[9]);
//ETX
// Description:
// Transpose the matrix and put it into out.
......@@ -96,9 +87,7 @@ public:
{vtkMatrix3x3::Transpose(*in->Element,*out->Element); out->Modified(); }
void Transpose()
{ vtkMatrix3x3::Transpose(this,this); }
//BTX
static void Transpose(const double inElements[9], double outElements[9]);
//ETX
// Description:
// Multiply a homogeneous coordinate by this matrix, i.e. out = A*in.
......@@ -108,36 +97,28 @@ public:
void MultiplyPoint(const double in[3], double out[3])
{vtkMatrix3x3::MultiplyPoint(*this->Element,in,out); }
//BTX
static void MultiplyPoint(const double Elements[9],
static void MultiplyPoint(const double elements[9],
const float in[3], float out[3]);
static void MultiplyPoint(const double Elements[9],
static void MultiplyPoint(const double elements[9],
const double in[3], double out[3]);
//ETX
// Description:
// Multiplies matrices a and b and stores the result in c (c=a*b).
static void Multiply3x3(vtkMatrix3x3 *a, vtkMatrix3x3 *b, vtkMatrix3x3 *c) {
vtkMatrix3x3::Multiply3x3(*a->Element,*b->Element,*c->Element); }
//BTX
static void Multiply3x3(const double a[9], const double b[9],
double c[9]);
//ETX
// Description:
// Compute adjoint of the matrix and put it into out.
void Adjoint(vtkMatrix3x3 *in, vtkMatrix3x3 *out)
{vtkMatrix3x3::Adjoint(*in->Element,*out->Element);}
//BTX
static void Adjoint(const double inElements[9], double outElements[9]);
//ETX
// Description:
// Compute the determinant of the matrix and return it.
double Determinant() {return vtkMatrix3x3::Determinant(*this->Element);}
//BTX
static double Determinant(const double Elements[9]);
//ETX
static double Determinant(const double elements[9]);
// Description:
// Sets the element i,j in the matrix.
......@@ -148,28 +129,21 @@ public:
double GetElement(int i, int j) const
{return this->Element[i][j];}
//BTX
double *operator[](const unsigned int i)
{return &(this->Element[i][0]);}
const double *operator[](unsigned int i) const
{ return &(this->Element[i][0]); }
bool operator==(const vtkMatrix3x3&);
bool operator!=(const vtkMatrix3x3&);
void Adjoint(vtkMatrix3x3 &in,vtkMatrix3x3 &out)
{this->Adjoint(&in,&out);}
double Determinant(vtkMatrix3x3 &in)
{return this->Determinant(&in);}
double Determinant(vtkMatrix3x3 *in)
{return vtkMatrix3x3::Determinant(*in->Element);}
void Invert(vtkMatrix3x3 &in,vtkMatrix3x3 &out)
{this->Invert(&in,&out);}
void Transpose(vtkMatrix3x3 &in,vtkMatrix3x3 &out)
{this->Transpose(&in,&out);}
static void PointMultiply(const double Elements[9],
const float in[3], float out[3]);
static void PointMultiply(const double Elements[9],
const double in[3], double out[3]);
//ETX
// Description:
// Legacy methods. Do not use.
VTK_LEGACY(double *operator[](const unsigned int i));
VTK_LEGACY(const double *operator[](unsigned int i) const);
VTK_LEGACY(bool operator==(const vtkMatrix3x3&));
VTK_LEGACY(bool operator!=(const vtkMatrix3x3&));
VTK_LEGACY(void Adjoint(vtkMatrix3x3 &in,vtkMatrix3x3 &out));
VTK_LEGACY(double Determinant(vtkMatrix3x3 &in));
VTK_LEGACY(double Determinant(vtkMatrix3x3 *));
VTK_LEGACY(void Invert(vtkMatrix3x3 &in,vtkMatrix3x3 &out));
VTK_LEGACY(void Transpose(vtkMatrix3x3 &in,vtkMatrix3x3 &out));
VTK_LEGACY(static void PointMultiply(const double [9],
const float [3], float [3]));
VTK_LEGACY(static void PointMultiply(const double [9],
const double [3], double [3]));
// Descption:
// Returns true if this matrix is equal to the identity matrix.
......@@ -179,7 +153,6 @@ public:
// Return a pointer to the first element of the matrix (double[9]).
double * GetData() { return *this->Element; }
//BTX
protected:
vtkMatrix3x3();
~vtkMatrix3x3();
......@@ -189,7 +162,6 @@ protected:
private:
vtkMatrix3x3(const vtkMatrix3x3&); // Not implemented
void operator=(const vtkMatrix3x3&); // Not implemented
//ETX
};
inline void vtkMatrix3x3::SetElement(int i, int j, double value)
......@@ -216,34 +188,4 @@ inline bool vtkMatrix3x3::IsIdentity()
}
}
inline bool vtkMatrix3x3::operator==(const vtkMatrix3x3 &other)
{
for (int i = 0; i < 3; ++i)
{
for (int j = 0; j < 3; ++j)
{
if (Element[i][j] != other.Element[i][j])
{
return false;
}
}
}
return true;
}
inline bool vtkMatrix3x3::operator!=(const vtkMatrix3x3 &other)
{
for (int i = 0; i < 3; ++i)
{
for (int j = 0; j < 3; ++j)
{
if (Element[i][j] != other.Element[i][j])
{
return true;
}
}
}
return false;
}
#endif
This diff is collapsed.
......@@ -17,7 +17,9 @@
// vtkMatrix4x4 is a class to represent and manipulate 4x4 matrices.
// Specifically, it is designed to work on 4x4 transformation matrices
// found in 3D rendering using homogeneous coordinates [x y z w].
// Many of the methods take an array of 16 doubles in row-major format.
// Note that OpenGL stores matrices in column-major format, so the matrix
// contents must be transposed when they are moved between OpenGL and VTK.
// .SECTION See Also
// vtkTransform
......@@ -29,16 +31,8 @@
class VTKCOMMONMATH_EXPORT vtkMatrix4x4 : public vtkObject
{
// Some of the methods in here have a corresponding static (class)
// method taking a pointer to 16 doubles that constitutes a user
// supplied matrix. This allows C++ clients to allocate double arrays
// on the stack and manipulate them using vtkMatrix4x4 methods.
// This is an alternative to allowing vtkMatrix4x4 instances to be
// created on the stack (which is frowned upon) or doing lots of
// temporary heap allocation within vtkTransform and vtkActor methods,
// which is inefficient.
public:
/// The internal data is public for historical reasons. Do not use!
double Element[4][4];
// Description:
......@@ -53,32 +47,26 @@ public:
// of the source Matrix.
void DeepCopy(const vtkMatrix4x4 *source)
{vtkMatrix4x4::DeepCopy(*this->Element,source); this->Modified(); }
//BTX
static void DeepCopy(double Elements[16], const vtkMatrix4x4 *source)
{vtkMatrix4x4::DeepCopy(Elements,*source->Element); }
static void DeepCopy(double Elements[16], const double newElements[16]);
//ETX
static void DeepCopy(double elements[16], const vtkMatrix4x4 *source)
{vtkMatrix4x4::DeepCopy(elements,*source->Element); }
static void DeepCopy(double elements[16], const double newElements[16]);
// Description:
// Non-static member function. Assigns *from* elements array
void DeepCopy(const double Elements[16])
{ this->DeepCopy(*this->Element,Elements); this->Modified(); }
void DeepCopy(const double elements[16])
{ this->DeepCopy(*this->Element,elements); this->Modified(); }
// Description:
// Set all of the elements to zero.
void Zero()
{ vtkMatrix4x4::Zero(*this->Element); this->Modified(); }
//BTX
static void Zero(double Elements[16]);
//ETX
static void Zero(double elements[16]);
// Description:
// Set equal to Identity matrix
void Identity()
{ vtkMatrix4x4::Identity(*this->Element); this->Modified();}
//BTX
static void Identity(double Elements[16]);
//ETX
static void Identity(double elements[16]);
// Description:
// Matrix Inversion (adapted from Richard Carling in "Graphics Gems,"
......@@ -87,10 +75,7 @@ public:
{vtkMatrix4x4::Invert(*in->Element,*out->Element); out->Modified(); }
void Invert()
{ vtkMatrix4x4::Invert(this,this); }
//BTX
static void Invert(const double inElements[16], double outElements[16]);
//ETX
// Description:
// Transpose the matrix and put it into out.
......@@ -98,9 +83,7 @@ public:
{vtkMatrix4x4::Transpose(*in->Element,*out->Element); out->Modified(); }
void Transpose()
{ vtkMatrix4x4::Transpose(this,this); }
//BTX
static void Transpose(const double inElements[16], double outElements[16]);
//ETX
// Description:
// Multiply a homogeneous coordinate by this matrix, i.e. out = A*in.
......@@ -110,12 +93,10 @@ public:
void MultiplyPoint(const double in[4], double out[4])
{vtkMatrix4x4::MultiplyPoint(*this->Element,in,out); }
//BTX
static void MultiplyPoint(const double Elements[16],
static void MultiplyPoint(const double elements[16],
const float in[4], float out[4]);
static void MultiplyPoint(const double Elements[16],
static void MultiplyPoint(const double elements[16],
const double in[4], double out[4]);
//ETX
// Description:
// For use in Java, Python or Tcl. The default MultiplyPoint() uses
......@@ -131,25 +112,19 @@ public:
// Multiplies matrices a and b and stores the result in c.
static void Multiply4x4(const vtkMatrix4x4 *a, const vtkMatrix4x4 *b,
vtkMatrix4x4 *c);
//BTX
static void Multiply4x4(const double a[16], const double b[16],
double c[16]);
//ETX
// Description:
// Compute adjoint of the matrix and put it into out.
void Adjoint(const vtkMatrix4x4 *in, vtkMatrix4x4 *out)
{vtkMatrix4x4::Adjoint(*in->Element,*out->Element);}
//BTX
static void Adjoint(const double inElements[16], double outElements[16]);
//ETX
// Description:
// Compute the determinant of the matrix and return it.
double Determinant() {return vtkMatrix4x4::Determinant(*this->Element);}
//BTX
static double Determinant(const double Elements[16]);
//ETX
static double Determinant(const double elements[16]);
// Description:
// Sets the element i,j in the matrix.
......@@ -160,26 +135,19 @@ public:
double GetElement(int i, int j) const
{return this->Element[i][j];}
//BTX
double *operator[](const unsigned int i)
{return &(this->Element[i][0]);}
const double *operator[](unsigned int i) const
{ return &(this->Element[i][0]); }
void Adjoint(vtkMatrix4x4 &in,vtkMatrix4x4 &out)
{this->Adjoint(&in,&out);}
double Determinant(vtkMatrix4x4 &in)
{return this->Determinant(&in);}
double Determinant(vtkMatrix4x4 *in)
{return vtkMatrix4x4::Determinant(*in->Element);}
void Invert(vtkMatrix4x4 &in,vtkMatrix4x4 &out)
{this->Invert(&in,&out);}
void Transpose(vtkMatrix4x4 &in,vtkMatrix4x4 &out)
{this->Transpose(&in,&out);}
static void PointMultiply(const double Elements[16],
const float in[4], float out[4]);
static void PointMultiply(const double Elements[16],
const double in[4], double out[4]);
//ETX
// Description:
// Legacy methods. Do not use.
VTK_LEGACY(double *operator[](const unsigned int i));
VTK_LEGACY(const double *operator[](unsigned int i) const);
VTK_LEGACY(void Adjoint(vtkMatrix4x4 &in,vtkMatrix4x4 &out));
VTK_LEGACY(double Determinant(vtkMatrix4x4 &in));
VTK_LEGACY(double Determinant(vtkMatrix4x4 *));
VTK_LEGACY(void Invert(vtkMatrix4x4 &in,vtkMatrix4x4 &out));
VTK_LEGACY(void Transpose(vtkMatrix4x4 &in,vtkMatrix4x4 &out));
VTK_LEGACY(static void PointMultiply(const double [16],
const float [4], float [4]));
VTK_LEGACY(static void PointMultiply(const double [16],
const double [4], double [4]));
protected:
vtkMatrix4x4() { vtkMatrix4x4::Identity(*this->Element); };
......@@ -187,11 +155,8 @@ protected:
float FloatPoint[4];
double DoublePoint[4];
private:
// Useful for viewing a double[16] as a double[4][4]
typedef double (*SqMatPtr)[4];
typedef const double (*ConstSqMatPtr)[4];
private:
vtkMatrix4x4(const vtkMatrix4x4&); // Not implemented
void operator= (const vtkMatrix4x4&); // Not implemented
};
......@@ -201,25 +166,23 @@ private:
inline void vtkMatrix4x4::Multiply4x4(const double a[16], const double b[16],
double c[16])
{
ConstSqMatPtr aMat = reinterpret_cast<ConstSqMatPtr>(a);
ConstSqMatPtr bMat = reinterpret_cast<ConstSqMatPtr>(b);
double tmp[16];
SqMatPtr cMat = reinterpret_cast<SqMatPtr>(tmp);
for (int i = 0; i < 4; i++)
for (int i = 0; i < 16; i += 4)
{
for (int k = 0; k < 4; k++)
for (int j = 0; j < 4; j++)
{
cMat[i][k] = aMat[i][0] * bMat[0][k] +
aMat[i][1] * bMat[1][k] +
aMat[i][2] * bMat[2][k] +
aMat[i][3] * bMat[3][k];
tmp[i + j] = a[i + 0] * b[j + 0] +
a[i + 1] * b[j + 4] +
a[i + 2] * b[j + 8] +
a[i + 3] * b[j + 12];
}
}
// Copy to final dest
memcpy(c, tmp, 16 * sizeof(double));
for (int k = 0; k < 16; k++)
{
c[k] = tmp[k];
}
}
//----------------------------------------------------------------------------
......
......@@ -24,12 +24,16 @@ include(${VTK_USE_FILE})
add_executable(Medical1 MACOSX_BUNDLE Medical1.cxx)
add_executable(Medical2 MACOSX_BUNDLE Medical2.cxx)
add_executable(Medical3 MACOSX_BUNDLE Medical3.cxx)
if (NOT VTK_LEGACY_REMOVE)
add_executable(Medical4 MACOSX_BUNDLE Medical4.cxx)
endif()
target_link_libraries(Medical1 ${VTK_LIBRARIES})
target_link_libraries(Medical2 ${VTK_LIBRARIES})
target_link_libraries(Medical3 ${VTK_LIBRARIES})
if (NOT VTK_LEGACY_REMOVE)
target_link_libraries(Medical4 ${VTK_LIBRARIES})
endif()
add_executable(GenerateModelsFromLabels MACOSX_BUNDLE GenerateModelsFromLabels.cxx)
add_executable(GenerateCubesFromLabels MACOSX_BUNDLE GenerateCubesFromLabels.cxx)
......@@ -43,13 +47,19 @@ if(BUILD_TESTING)
set(TestMedical1_ARGS ${VTK_TEST_DATA_DIR}/Data/headsq/quarter)
set(TestMedical2_ARGS ${VTK_TEST_DATA_DIR}/Data/headsq/quarter)
set(TestMedical3_ARGS ${VTK_TEST_DATA_DIR}/Data/headsq/quarter)
if (NOT VTK_LEGACY_REMOVE)
set(TestMedical4_ARGS ${VTK_TEST_DATA_DIR}/Data/headsq/quarter)
endif()
vtk_add_test_cxx(${vtk-example}CxxTests tests
TestMedical1.cxx
TestMedical2.cxx
TestMedical3.cxx
)
if (NOT VTK_LEGACY_REMOVE)
vtk_add_test_cxx(${vtk-example}CxxTests tests
TestMedical4.cxx
)
endif()
vtk_test_cxx_executable(${vtk-example}CxxTests tests
RENDERING_FACTORY
)
......
......@@ -111,9 +111,14 @@ endif()
# These tests depend on volume rendering classes not build for OpenGL2
if(VTK_RENDERING_BACKEND STREQUAL "OpenGL")
vtk_add_test_cxx(${vtk-module}CxxTests tests
TestButtonWidget.cxx
TestImageCroppingRegionsWidget.cxx
)
if(NOT VTK_LEGACY_REMOVE)
vtk_add_test_cxx(${vtk-module}CxxTests tests
TestButtonWidget.cxx
)
endif()
endif()
set(all_tests
......
......@@ -963,14 +963,20 @@ void vtkBrokenLineWidget::Spin( double *p1, double *p2, double *vpn )
if ( this->ProjectToPlane )
{
if ( this->ProjectionNormal == VTK_PROJECTION_OBLIQUE && \
this->PlaneSource != NULL )
if ( this->ProjectionNormal == VTK_PROJECTION_OBLIQUE)
{
double* normal = this->PlaneSource->GetNormal();
axis[0] = normal[0];
axis[1] = normal[1];
axis[2] = normal[2];
vtkMath::Normalize( axis );
if (this->PlaneSource != NULL )
{
double* normal = this->PlaneSource->GetNormal();
axis[0] = normal[0];
axis[1] = normal[1];
axis[2] = normal[2];
vtkMath::Normalize( axis );
}
else
{
axis[0] = 1.;
}
}
else
{
......
......@@ -458,18 +458,24 @@ void vtkCurveRepresentation::Spin(double *p1, double *p2, double *vpn)
if ( this->ProjectToPlane )
{
if ( this->ProjectionNormal == VTK_PROJECTION_OBLIQUE && \
this->PlaneSource != NULL )
if ( this->ProjectionNormal == VTK_PROJECTION_OBLIQUE)
{
double* normal = this->PlaneSource->GetNormal();
axis[0] = normal[0];
axis[1] = normal[1];
axis[2] = normal[2];
vtkMath::Normalize(axis);
if (this->PlaneSource != NULL )
{
double* normal = this->PlaneSource->GetNormal();
axis[0] = normal[0];
axis[1] = normal[1];
axis[2] = normal[2];
vtkMath::Normalize( axis );
}
else
{
axis[0] = 1.;
}
}
else
{
axis[ this->ProjectionNormal ] = 1.0;
axis[ this->ProjectionNormal ] = 1.;