Commit 887062a9 authored by George Zagaris's avatar George Zagaris
Browse files

Merge remote-tracking branch 'origin/master' into AMR-Refactoring

parents 2f8581ad 4d0a6044
......@@ -121,6 +121,7 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
"vtkfreetype.*note: initialized from here"
"vtkfreetype.*warning: .* may be used uninitialized in this function"
"vtkfreetype.*note: .* was declared here"
"vtkfreetype/.*warning: .* set but not used"
# vtknetcdf occasionally has warnings for things that are not a problem.
"vtknetcdf.*warning: dereferencing type-punned pointer"
"vtknetcdf.*warning: passing argument .* of .* as .*signed due to prototype"
......@@ -206,11 +207,13 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
"Utilities.vtksqlite.vtk_sqlite3.c.*warning: negative integer implicitly converted to unsigned type"
"Utilities.vtksqlite.vtk_sqlite3.c.*warning: assuming signed overflow"
"Utilities.vtksqlite.vtk_sqlite3.c.*warning: .* may be used uninitialized in this function"
"Utilities.vtksqlite.vtk_sqlite3.c.*warning: .* set but not used"
"Utilities.vtkexodus2.*warning.*assignment discards qualifiers from pointer target type"
"Utilities.vtkexodus2.*warning.*initialization discards qualifiers from pointer target type"
"Utilities.vtkexodus2.*warning.*assignment discards qualifiers from pointer target type"
"Utilities.vtkexodus2.*warning.*passing argument .* of .* as unsigned due to prototype"
"Utilities.vtkexodus2.*warning.*possible loss of data"
"Uitilties/vtkexodus2.*warning: .* set but not used"
# gcc -Wsign-conversion
"Utilities.vtkexodus2.*warning.*conversion to .* from .* may change the sign of the result"
# gcc -Wconversion
......@@ -254,14 +257,17 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
"Utilities.vtkpng.*warning: variable .* might be clobbered by"
"Utilities/vtkjpeg.*warning: conversion to .* from .* may change the sign of the result"
"Utilities/vtkjpeg.*warning: conversion to .* from .* may alter its value"
"Utilities/vtkjpeg.*.warning: .* set but not used"
"Utilities/DICOMParser.*warning: conversion to .* from .* may alter its value"
"Utilities/DICOMParser.*warning: conversion to .* from .* may change the sign of the result"
# gcc -Wsign-conversion
"Utilities/vtkmetaio.*warning: conversion to '.*' from '.*' may change the sign of the result"
# gcc -Wconversion
"Utilities/vtkmetaio.*warning: conversion to '.*' from '.*' may alter its value"
"Uitilties/vtkmetaio/.*warning: .* set but not used"
# gcc -Wsign-conversion
"Utilities/vtkalglib.*warning: conversion to .* from .* may change the sign of the result"
"Uitilties/vtkalglib/.*warning: .* set but not used"
# gcc -Wsign-conversion
"Utilities/ftgl/src/.*warning: conversion to .* from .* may change the sign of the result"
# gcc -Wconversion
......@@ -275,6 +281,8 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
"Utilities/mrmpi/.*warning: conversion to .* from .* may change the sign of the result"
# gcc -Wunused-result
"Utilities/mrmpi/.*warning: ignoring return value of .size_t fread.void.. size_t. size_t. FILE.... declared with attribute warn_unused_result"
"Uitilties/vtklibproj4/.*warning: .* set but not used"
)
IF(APPLE)
......
......@@ -164,7 +164,9 @@ vtkIdType vtkColorTransferControlPointsItem::AddPoint(double* newPos)
vtkIdType expectedPoint = this->vtkControlPointsItem::AddPoint(newPos);
double rgb[3] = {0., 0., 0.};
this->ColorTransferFunction->GetColor(newPos[0], rgb);
vtkIdType addedPoint = this->ColorTransferFunction->AddRGBPoint(newPos[0], rgb[0], rgb[1], rgb[2]);
vtkIdType addedPoint =
this->ColorTransferFunction->AddRGBPoint(newPos[0], rgb[0], rgb[1], rgb[2]);
vtkNotUsed(expectedPoint);
assert(addedPoint == expectedPoint);
return addedPoint;
}
......@@ -176,8 +178,11 @@ vtkIdType vtkColorTransferControlPointsItem::RemovePoint(double* currentPoint)
{
return -1;
}
vtkIdType expectedPoint = this->vtkControlPointsItem::RemovePoint(currentPoint);
vtkIdType removedPoint = this->ColorTransferFunction->RemovePoint(currentPoint[0]);
vtkIdType expectedPoint =
this->vtkControlPointsItem::RemovePoint(currentPoint);
vtkIdType removedPoint =
this->ColorTransferFunction->RemovePoint(currentPoint[0]);
vtkNotUsed(expectedPoint);
assert(removedPoint == expectedPoint);
return removedPoint;
}
......@@ -893,10 +893,11 @@ void vtkControlPointsItem::Stroke(const vtkVector2f& newPos)
}
}
}
int size = this->GetNumberOfPoints();
const int oldNumberOfPoints = this->GetNumberOfPoints();
vtkIdType addedPoint = this->AddPoint(pos);
this->SetCurrentPoint(addedPoint);
assert(size + 1 == this->GetNumberOfPoints());
vtkNotUsed(oldNumberOfPoints);
assert(oldNumberOfPoints + 1 == this->GetNumberOfPoints());
}
//-----------------------------------------------------------------------------
......
......@@ -152,8 +152,11 @@ vtkIdType vtkPiecewiseControlPointsItem::RemovePoint(double* currentPoint)
{
return -1;
}
vtkIdType expectedPoint = this->vtkControlPointsItem::RemovePoint(currentPoint);
vtkIdType removedPoint = this->PiecewiseFunction->RemovePoint(currentPoint[0]);
vtkIdType expectedPoint =
this->vtkControlPointsItem::RemovePoint(currentPoint);
vtkIdType removedPoint =
this->PiecewiseFunction->RemovePoint(currentPoint[0]);
vtkNotUsed(expectedPoint);
assert(removedPoint == expectedPoint);
return removedPoint;
}
......@@ -517,7 +517,7 @@ int vtkPlotPoints::GetNearestPoint(const vtkVector2f& point,
// Get the lowest point we might hit within the supplied tolerance
vtkIndexedVector2f lowPoint;
lowPoint.index = -1;
lowPoint.index = 0;
lowPoint.pos = vtkVector2f(point.X()-tol.X(), 0.0f);
low = std::lower_bound(v.begin(), v.end(), lowPoint, compVector3fX);
......
......@@ -169,13 +169,6 @@ IF (VTK_USE_RENDERING AND VTK_USE_DISPLAY)
${CXX_TEST_PATH}/${CXX_TEST_CONFIG}/TestParallelKMeansStatisticsMPI
${VTK_MPI_POSTFLAGS}
)
ADD_TEST(TestRealDataPDescriptiveStatisticsMPI
${VTK_MPIRUN_EXE} ${VTK_MPI_PRENUMPROC_FLAGS} ${VTK_MPI_NUMPROC_FLAG} ${VTK_MPI_MAX_NUMPROCS}
${VTK_MPI_PREFLAGS}
${CXX_TEST_PATH}/${CXX_TEST_CONFIG}/TestRealDataPDescriptiveStatisticsMPI
${VTK_MPI_POSTFLAGS}
)
ENDIF (VTK_MPIRUN_EXE)
ENDIF (VTK_USE_PARALLEL AND VTK_USE_MPI)
......
......@@ -42,7 +42,6 @@ PURPOSE. See the above copyright notice for more information.
struct RealDataDescriptiveStatisticsArgs
{
int nVals;
int* retVal;
int ioRank;
vtkStdString fileName;
......@@ -229,8 +228,8 @@ void RealDataDescriptiveStatistics( vtkMultiProcessController* controller, void*
myDataDim[0] = myBlockBounds[1][0] - myBlockBounds[0][0] + 1;
myDataDim[1] = myBlockBounds[1][1] - myBlockBounds[0][1] + 1;
myDataDim[2] = myBlockBounds[1][2] - myBlockBounds[0][2] + 1;
vtkIdType myDataSize = myDataDim[0] * myDataDim[1] * myDataDim[2];
float* buffer = new float[myDataSize];
vtkIdType card_l = myDataDim[0] * myDataDim[1] * myDataDim[2];
float* buffer = new float[card_l];
ReadFloatDataBlockFromFile( ifs,
args->dataDim,
......@@ -244,16 +243,11 @@ void RealDataDescriptiveStatistics( vtkMultiProcessController* controller, void*
floatArr->SetNumberOfComponents( 1 );
floatArr->SetName( varName );
for ( vtkIdType i = 0; i < myDataSize; ++ i )
for ( vtkIdType i = 0; i < card_l; ++ i )
{
floatArr->InsertNextValue( buffer[i] );
}
cout << "\n# Cardinality on process "
<< myRank
<< ": "
<< myDataSize
<< "\n";
vtkTable* inputData = vtkTable::New();
inputData->AddColumn( floatArr );
......@@ -269,10 +263,11 @@ void RealDataDescriptiveStatistics( vtkMultiProcessController* controller, void*
// Select column of interest
pcs->AddColumn( varName );
// Test (in parallel) with Learn, Derive, and Assess options turned on
// Test (in parallel) with Learn and Derive options turned on
pcs->SetLearnOption( true );
pcs->SetDeriveOption( true );
pcs->SetAssessOption( true );
pcs->SetTestOption( false );
pcs->SetAssessOption( false );
pcs->Update();
// Get output data and meta tables
......@@ -286,10 +281,7 @@ void RealDataDescriptiveStatistics( vtkMultiProcessController* controller, void*
if ( com->GetLocalProcessId() == args->ioRank )
{
cout << "\n## Completed parallel calculation of descriptive statistics (with assessment):\n"
<< " Total sample size: "
<< outputPrimary->GetValueByName( 0, "Cardinality" ).ToInt()
<< " \n"
cout << "\n## Completed parallel calculation of descriptive statistics (without assessment):\n"
<< " Wall time: "
<< timer->GetElapsedTime()
<< " sec.\n";
......@@ -323,6 +315,52 @@ void RealDataDescriptiveStatistics( vtkMultiProcessController* controller, void*
}
}
// Verify that sizes of read data sets sums up to the calculated global cardinality
if ( com->GetLocalProcessId() == args->ioRank )
{
cout << "\n## Verifying that sizes of read data sets sums up to the calculated global cardinality.\n";
}
// Gather all cardinalities
int numProcs = controller->GetNumberOfProcesses();
vtkIdType* card_g = new vtkIdType[numProcs];
com->AllGather( &card_l,
card_g,
1 );
// Calculated global cardinality
vtkIdType testIntValue = outputPrimary->GetValueByName( 0, "Cardinality" ).ToInt();
// Print and verify some results
if ( com->GetLocalProcessId() == args->ioRank )
{
vtkIdType sumCards = 0;
for ( int i = 0; i < numProcs; ++ i )
{
cout << " Cardinality of data set read on process "
<< i
<< ": "
<< card_g[i]
<< "\n";
sumCards += card_g[i];
}
cout << " Cardinality of global data set: "
<< sumCards
<< " \n";
if ( sumCards != testIntValue )
{
vtkGenericWarningMacro("Incorrect calculated global cardinality:"
<< testIntValue
<< " <> "
<< sumCards
<< ")");
*(args->retVal) = 1;
}
}
// Clean up
pcs->Delete();
inputData->Delete();
......@@ -500,8 +538,8 @@ int main( int argc, char** argv )
}
// Fill process dimensionality with ones if not provided or incomplete
unsigned int missingDim = 3 - procDim.size();
for ( unsigned int d = 0; d < missingDim; ++ d )
int missingDim = 3 - static_cast<int>( procDim.size() );
for ( int d = 0; d < missingDim; ++ d )
{
procDim.push_back( 1 );
}
......@@ -547,7 +585,6 @@ int main( int argc, char** argv )
int testValue = 0;
RealDataDescriptiveStatisticsArgs args;
args.nVals = 100000;
args.retVal = &testValue;
args.ioRank = ioRank;
args.fileName = fileName;
......
......@@ -411,7 +411,23 @@ void vtkSynchronizedRenderers::RendererInfo::Save(vtkMultiProcessStream& stream)
<< this->CameraClippingRange[0]
<< this->CameraClippingRange[1]
<< this->CameraViewAngle
<< this->CameraParallelScale;
<< this->CameraParallelScale
<< this->HeadPose[0]
<< this->HeadPose[1]
<< this->HeadPose[2]
<< this->HeadPose[3]
<< this->HeadPose[4]
<< this->HeadPose[5]
<< this->HeadPose[6]
<< this->HeadPose[7]
<< this->HeadPose[8]
<< this->HeadPose[9]
<< this->HeadPose[10]
<< this->HeadPose[11]
<< this->HeadPose[12]
<< this->HeadPose[13]
<< this->HeadPose[14]
<< this->HeadPose[15] ;
}
//----------------------------------------------------------------------------
......@@ -426,9 +442,9 @@ bool vtkSynchronizedRenderers::RendererInfo::Restore(vtkMultiProcessStream& stre
stream >> this->ImageReductionFactor
>> this->Draw
>> this->CameraParallelProjection
>> this->Viewport[0]
>> this->Viewport[0]
>> this->Viewport[1]
>> this->Viewport[2]
>> this->Viewport[2]
>> this->Viewport[3]
>> this->CameraPosition[0]
>> this->CameraPosition[1]
......@@ -444,7 +460,23 @@ bool vtkSynchronizedRenderers::RendererInfo::Restore(vtkMultiProcessStream& stre
>> this->CameraClippingRange[0]
>> this->CameraClippingRange[1]
>> this->CameraViewAngle
>> this->CameraParallelScale;
>> this->CameraParallelScale
>> this->HeadPose[0]
>> this->HeadPose[1]
>> this->HeadPose[2]
>> this->HeadPose[3]
>> this->HeadPose[4]
>> this->HeadPose[5]
>> this->HeadPose[6]
>> this->HeadPose[7]
>> this->HeadPose[8]
>> this->HeadPose[9]
>> this->HeadPose[10]
>> this->HeadPose[11]
>> this->HeadPose[12]
>> this->HeadPose[13]
>> this->HeadPose[14]
>> this->HeadPose[15];
return true;
}
......@@ -462,6 +494,7 @@ void vtkSynchronizedRenderers::RendererInfo::CopyFrom(vtkRenderer* ren)
cam->GetClippingRange(this->CameraClippingRange);
this->CameraViewAngle = cam->GetViewAngle();
this->CameraParallelScale = cam->GetParallelScale();
cam->GetHeadPose( this->HeadPose );
}
//----------------------------------------------------------------------------
......@@ -475,10 +508,26 @@ void vtkSynchronizedRenderers::RendererInfo::CopyTo(vtkRenderer* ren)
cam->SetFocalPoint(this->CameraFocalPoint);
cam->SetViewUp(this->CameraViewUp);
cam->SetWindowCenter(this->CameraWindowCenter[0],
this->CameraWindowCenter[1]);
this->CameraWindowCenter[1]);
cam->SetClippingRange(this->CameraClippingRange);
cam->SetViewAngle(this->CameraViewAngle);
cam->SetParallelScale(this->CameraParallelScale);
cam->SetHeadPose(this->HeadPose[0],
this->HeadPose[1],
this->HeadPose[2],
this->HeadPose[3],
this->HeadPose[4],
this->HeadPose[5],
this->HeadPose[6],
this->HeadPose[7],
this->HeadPose[8],
this->HeadPose[9],
this->HeadPose[10],
this->HeadPose[11],
this->HeadPose[12],
this->HeadPose[13],
this->HeadPose[14],
this->HeadPose[15] );
}
......@@ -669,7 +718,7 @@ bool vtkSynchronizedRenderers::vtkRawImage::Capture(vtkRenderer* ren)
static_cast<int>(window_size[0] * viewport[2])-1,
static_cast<int>(window_size[1] * viewport[3])-1,
ren->GetRenderWindow()->GetDoubleBuffer()? 0 : 1,
this->GetRawPtr());
this->GetRawPtr());
this->MarkValid();
return true;
}
......@@ -107,7 +107,7 @@ public:
vtkBooleanMacro(AutomaticEventHandling, bool);
//BTX
enum
enum
{
SYNC_RENDERER_TAG = 15101,
RESET_CAMERA_TAG = 15102,
......@@ -140,8 +140,8 @@ public:
void MarkInValid() { this->Valid = false; }
bool IsValid() { return this->Valid; }
int GetWidth() { return this->Size[0];}
int GetHeight() { return this->Size[1];}
int GetWidth() { return this->Size[0];}
int GetHeight() { return this->Size[1];}
vtkUnsignedCharArray* GetRawPtr()
{ return this->Data; }
......@@ -185,6 +185,7 @@ protected:
double CameraClippingRange[2];
double CameraViewAngle;
double CameraParallelScale;
double HeadPose[16];
// Save/restore the struct to/from a stream.
void Save(vtkMultiProcessStream& stream);
......@@ -221,7 +222,7 @@ protected:
// Can be used in HandleEndRender(), MasterEndRender() or SlaveEndRender()
// calls to paste back the image from either this->ReducedImage or
// this->FullImage info the viewport.
void PushImageToScreen();
void PushImageToScreen();
vtkSynchronizedRenderers* CaptureDelegate;
vtkRawImage ReducedImage;
......
......@@ -864,8 +864,13 @@ void vtkCamera::SetHeadPose( double x00, double x01, double x02, double x03,
double x20, double x21, double x22, double x23,
double x30, double x31, double x32, double x33 )
{
vtkDebugMacro( <<"vtkCamera::HeadTracked = " << this->HeadTracked );
vtkDebugMacro( << "vtkCamera::SetHeadPose( "
<< x00 << " " << x01 << " " << x02 << " " << x03
<< x10 << " " << x11 << " " << x12 << " " << x13
<< x20 << " " << x21 << " " << x22 << " " << x23
<< x30 << " " << x31 << " " << x32 << " " << x33
<< ")" );
this->HeadPose->SetElement( 0,0,x00 );
this->HeadPose->SetElement( 0,1,x01 );
this->HeadPose->SetElement( 0,2,x02 );
......@@ -885,8 +890,30 @@ void vtkCamera::SetHeadPose( double x00, double x01, double x02, double x03,
this->HeadPose->SetElement( 3,1,x31 );
this->HeadPose->SetElement( 3,2,x32 );
this->HeadPose->SetElement( 3,3,x33 );
// this->ComputeProjAndViewParams();
// this->ComputeViewTransform();
}
// -----------------------------------------------------------------HeadTracked
void vtkCamera::GetHeadPose( double x[16] )
{
x[0] = this->HeadPose->GetElement( 0,0 );
x[1] = this->HeadPose->GetElement( 0,1 );
x[2] = this->HeadPose->GetElement( 0,2 );
x[3] = this->HeadPose->GetElement( 0,3 );
x[4] = this->HeadPose->GetElement( 1,0 );
x[5] = this->HeadPose->GetElement( 1,1 );
x[6] = this->HeadPose->GetElement( 1,2 );
x[7] = this->HeadPose->GetElement( 1,3 );
x[8] = this->HeadPose->GetElement( 2,0 );
x[9] = this->HeadPose->GetElement( 2,1 );
x[10] = this->HeadPose->GetElement( 2,2 );
x[11] = this->HeadPose->GetElement( 2,3 );
x[12] = this->HeadPose->GetElement( 3,0 );
x[13] = this->HeadPose->GetElement( 3,1 );
x[14] = this->HeadPose->GetElement( 3,2 );
x[15] = this->HeadPose->GetElement( 3,3 );
}
//------------------------------------------------------------------HeadTracked
......
......@@ -428,6 +428,7 @@ public:
void SetConfigParams( double o2screen, double o2right, double o2left,
double o2top, double o2bottom , double interOccDist,
double scale, vtkMatrix4x4 * surfaceRot );
// Description:
// This function is a convinience function intended for the Paraview
// ServerManager
......@@ -436,6 +437,11 @@ public:
double x20, double x21, double x22, double x23,
double x30, double x31, double x32, double x33 );
// Description:
// This is a convenience function to get the current head position. This is
// typically used by ParaView for head-tracking support
void GetHeadPose( double *x );
// Description:
// HeadTracker mode. It impacts on the computation of the transforms.
// Initial value is false.
......
......@@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011)
SET(KWSYS_DATE_STAMP_MONTH 05)
# KWSys version date day component. Format is DD.
SET(KWSYS_DATE_STAMP_DAY 04)
SET(KWSYS_DATE_STAMP_DAY 05)
......@@ -285,12 +285,12 @@ ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
IF (NOT WIN32)
include(CheckCXXCompilerFlag)
include(CheckCCompilerFlag)
check_cxx_compiler_flag(-std=c99 HAVE_STD_C99)
check_cxx_compiler_flag(-fomit-frame-pointer HAVE_OMIT_FRAME_POINTER)
check_cxx_compiler_flag(-finline-functions HAVE_INLINE_FUNCTIONS)
check_cxx_compiler_flag(-fno-common HAVE_NO_COMMON)
check_c_compiler_flag(-std=c99 HAVE_STD_C99)
check_c_compiler_flag(-fomit-frame-pointer HAVE_OMIT_FRAME_POINTER)
check_c_compiler_flag(-finline-functions HAVE_INLINE_FUNCTIONS)
check_c_compiler_flag(-fno-common HAVE_NO_COMMON)
if(HAVE_STD_C99)
set(STD_C99 "-std=c99")
endif()
......
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