Commits (14)
......@@ -246,7 +246,7 @@ int vtkAppendPolyData::ExecuteAppend(vtkPolyData* output,
if (numPts < 1 && numCells < 1)
{
vtkWarningMacro(<<"No data to append!");
vtkDebugMacro(<<"No data to append!");
return 1;
}
this->UpdateProgress(0.10);
......
......@@ -460,13 +460,16 @@ int TestLagrangianIntegrationModel(int, char*[])
nextPos[2] = 0;
odeWavelet->SetInputArrayToProcess(2, 0, 0,
vtkDataObject::FIELD_ASSOCIATION_CELLS, "SurfaceTypeModel");
if (!odeWavelet->ComputeSurfaceInteraction(
part, particles, interactedSurfaceFlatIndex, passThroughParticles))
vtkLagrangianParticle* interactionParticle = odeWavelet->ComputeSurfaceInteraction(
part, particles, interactedSurfaceFlatIndex, passThroughParticles);
if (!interactionParticle)
{
std::cerr << "No interaction with SurfaceTypeModel" << std::endl;
delete part;
return EXIT_FAILURE;
}
delete interactionParticle;
if (nextPos[0] > 10 + tolerance || nextPos[0] < 10 - tolerance
|| nextPos[1] != 0 || nextPos[2] != 0)
{
......@@ -496,13 +499,15 @@ int TestLagrangianIntegrationModel(int, char*[])
nextPos[2] = 0;
odeWavelet->SetInputArrayToProcess(2, 0, 0,
vtkDataObject::FIELD_ASSOCIATION_CELLS, "SurfaceTypeTerm");
if (!odeWavelet->ComputeSurfaceInteraction(
part, particles, interactedSurfaceFlatIndex, passThroughParticles))
vtkLagrangianParticle* interactionParticle2 = odeWavelet->ComputeSurfaceInteraction(
part, particles, interactedSurfaceFlatIndex, passThroughParticles);
if (!interactionParticle2)
{
std::cerr << "No interaction with SurfaceTypeTerm" << std::endl;
delete part;
return EXIT_FAILURE;
}
delete interactionParticle2;
if (nextPos[0] > 10 + tolerance || nextPos[0] < 10 - tolerance
|| nextPos[1] != 0 || nextPos[2] != 0)
{
......@@ -532,13 +537,15 @@ int TestLagrangianIntegrationModel(int, char*[])
nextPos[2] = 0;
odeWavelet->SetInputArrayToProcess(2, 0, 0,
vtkDataObject::FIELD_ASSOCIATION_CELLS, "SurfaceTypeBounce");
if (!odeWavelet->ComputeSurfaceInteraction(
part, particles, interactedSurfaceFlatIndex, passThroughParticles))
vtkLagrangianParticle* interactionParticle3 = odeWavelet->ComputeSurfaceInteraction(
part, particles, interactedSurfaceFlatIndex, passThroughParticles);
if (!interactionParticle3)
{
std::cerr << "No interaction with SurfaceTypeBounce" << std::endl;
delete part;
return EXIT_FAILURE;
}
delete interactionParticle3;
if (nextPos[0] > 10 + tolerance || nextPos[0] < 10 - tolerance
|| nextPos[1] != 0 || nextPos[2] != 0)
{
......@@ -568,12 +575,14 @@ int TestLagrangianIntegrationModel(int, char*[])
nextPos[0] = 12;
nextPos[1] = 0;
nextPos[2] = 0;
if (odeWavelet->ComputeSurfaceInteraction(
part, particles, interactedSurfaceFlatIndex, passThroughParticles))
vtkLagrangianParticle* interactionParticle4 = odeWavelet->ComputeSurfaceInteraction(
part, particles, interactedSurfaceFlatIndex, passThroughParticles);
if (interactionParticle4)
{
std::cerr << "Unexpected interaction with SurfaceTypeBounce perforation management"
<< std::endl;
delete part;
delete interactionParticle4;
return EXIT_FAILURE;
}
if (nextPos[0] > 6 + tolerance || nextPos[0] < 6 - tolerance
......@@ -608,13 +617,15 @@ int TestLagrangianIntegrationModel(int, char*[])
nextPos[2] = 0;
odeWavelet->SetInputArrayToProcess(2, 0, 0,
vtkDataObject::FIELD_ASSOCIATION_CELLS, "SurfaceTypeBreak");
if (!odeWavelet->ComputeSurfaceInteraction(part, particles,
interactedSurfaceFlatIndex, passThroughParticles))
vtkLagrangianParticle* interactionParticle5 = odeWavelet->ComputeSurfaceInteraction(part, particles,
interactedSurfaceFlatIndex, passThroughParticles);
if (!interactionParticle5)
{
std::cerr << "No interaction with SurfaceTypeBreak" << std::endl;
delete part;
return EXIT_FAILURE;
}
delete interactionParticle5;
if (nextPos[0] > 10 + tolerance || nextPos[0] < 10 - tolerance
|| nextPos[1] != 0 || nextPos[2] != 0)
{
......@@ -648,11 +659,13 @@ int TestLagrangianIntegrationModel(int, char*[])
nextPos[2] = 0;
odeWavelet->SetInputArrayToProcess(2, 0, 0,
vtkDataObject::FIELD_ASSOCIATION_CELLS, "SurfaceTypePass");
if (odeWavelet->ComputeSurfaceInteraction(part, particles,
interactedSurfaceFlatIndex, passThroughParticles))
vtkLagrangianParticle* interactionParticle6 = odeWavelet->ComputeSurfaceInteraction(part, particles,
interactedSurfaceFlatIndex, passThroughParticles);
if (interactionParticle6)
{
std::cerr << "Unexpected interaction with SurfaceTypePass" << std::endl;
delete part;
delete interactionParticle6;
return EXIT_FAILURE;
}
......@@ -688,11 +701,13 @@ int TestLagrangianIntegrationModel(int, char*[])
nextPos[2] = 0;
odeWavelet->SetInputArrayToProcess(2, 0, 0,
vtkDataObject::FIELD_ASSOCIATION_CELLS, "SurfaceTypeModel");
if (odeWavelet->ComputeSurfaceInteraction(
part, particles, interactedSurfaceFlatIndex, passThroughParticles))
vtkLagrangianParticle* interactionParticle7 = odeWavelet->ComputeSurfaceInteraction(
part, particles, interactedSurfaceFlatIndex, passThroughParticles);
if (interactionParticle7)
{
std::cerr << "Unexpected interaction with SurfaceTypeModel Cleared"
<< std::endl;
delete interactionParticle7;
delete part;
return EXIT_FAILURE;
}
......
......@@ -49,56 +49,67 @@ int TestLagrangianParticle(int, char*[])
if (p != part->GetPrevPosition())
{
std::cerr << "Prev Position and Equation variables should be the same" << std::endl;
delete part;
return EXIT_FAILURE;
}
if (x != part->GetPosition())
{
std::cerr << "Position and Equation variables should be the same" << std::endl;
delete part;
return EXIT_FAILURE;
}
if (f != part->GetNextPosition())
{
std::cerr << "Next Position and Equation variables should be the same" << std::endl;
delete part;
return EXIT_FAILURE;
}
if (p + 3 != part->GetPrevVelocity())
{
std::cerr << "Prev Velocity and Equation variables should be the same" << std::endl;
delete part;
return EXIT_FAILURE;
}
if (x + 3 != part->GetVelocity())
{
std::cerr << "Velocity and Equation variables should be the same" << std::endl;
delete part;
return EXIT_FAILURE;
}
if (f + 3 != part->GetNextVelocity())
{
std::cerr << "Next Velocity and Equation variables should be the same" << std::endl;
delete part;
return EXIT_FAILURE;
}
if (p + 6 != part->GetPrevUserVariables())
{
std::cerr << "Prev User and Equation variables should be the same" << std::endl;
delete part;
return EXIT_FAILURE;
}
if (x + 6 != part->GetUserVariables())
{
std::cerr << "User and Equation variables should be the same" << std::endl;
delete part;
return EXIT_FAILURE;
}
if (f + 6 != part->GetNextUserVariables())
{
std::cerr << "Next User and Equation variables should be the same" << std::endl;
delete part;
return EXIT_FAILURE;
}
if (part->GetNumberOfVariables() != 7)
{
std::cerr << "Unexpected Number of user variables" << std::endl;
delete part;
return EXIT_FAILURE;
}
if (part->GetNumberOfUserVariables() != 0)
{
std::cerr << "Unexpected Number of user variables" << std::endl;
delete part;
return EXIT_FAILURE;
}
......@@ -130,16 +141,25 @@ int TestLagrangianParticle(int, char*[])
{
std::cerr << "Incorrect equation variables: " << x[i] << " " << x2[i]
<< " " << x3[i] << " " << i << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
if (f[i] != 0 || f2[i] != 0 || f3[i] != 0)
{
std::cerr << "Incorrect next equation variables" << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
if (p[i] != -i || p2[i] != -i || p3[i] != -i)
{
std::cerr << "Incorrect prev equation variables" << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
}
......@@ -147,6 +167,9 @@ int TestLagrangianParticle(int, char*[])
if (std::abs(m3 - 2.23606797749979) > 10e-6)
{
std::cerr << "Unexpected Position Vector Magnitude" << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
......@@ -155,6 +178,9 @@ int TestLagrangianParticle(int, char*[])
part3->GetNumberOfSteps() != 1)
{
std::cerr << "Incorrect Number of step" << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
......@@ -164,6 +190,9 @@ int TestLagrangianParticle(int, char*[])
{
std::cerr << "Incorrect SeedId : " << part->GetSeedId() << " "
<< part2->GetSeedId() << " " << part3->GetSeedId() << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
......@@ -172,12 +201,18 @@ int TestLagrangianParticle(int, char*[])
part3->GetSeedArrayTupleIndex() != seedId + 1)
{
std::cerr << "Incorrect SeedArrayTupleIndex" << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
if (part->GetId() != 0)
{
std::cerr << "Incorrect Id in part : " << part->GetId() << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
if (part2->GetId() != 1 ||
......@@ -185,18 +220,27 @@ int TestLagrangianParticle(int, char*[])
{
std::cerr << "Incorrect Id in part2 or part3: " << part2->GetId() << " "
<< part3->GetId() << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
if (part->GetParentId() != -1)
{
std::cerr << "Incorrect Parent Id in part : " << part->GetParentId() << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
part->SetParentId(0);
if (part->GetParentId() != 0)
{
std::cerr << "SetParentId does not seem to work" << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
......@@ -205,6 +249,9 @@ int TestLagrangianParticle(int, char*[])
{
std::cerr << "Incorrect Parent Id in part2 or part3" << part2->GetParentId()
<< " " << part3->GetParentId() << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
if (part->GetSeedData() != pd.Get() ||
......@@ -212,12 +259,16 @@ int TestLagrangianParticle(int, char*[])
part3->GetSeedData() != pd.Get())
{
std::cerr << "Incorrect Seed data " << std::endl;
delete part;
return EXIT_FAILURE;
}
if (pd->GetArray(0)->GetTuple(1)[0] != 17)
{
std::cerr << "Incorrect Value in Particle data :"
<< pd->GetArray(0)->GetTuple(1)[0] << " != 17" << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
......@@ -227,6 +278,9 @@ int TestLagrangianParticle(int, char*[])
if (part->GetLastDataSet() != poly.Get() || part->GetLastCellId() != cellId)
{
std::cerr << "Incorrect LastCellId or LastDataSet" << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
......@@ -235,6 +289,9 @@ int TestLagrangianParticle(int, char*[])
vtkLagrangianParticle::PARTICLE_TERMINATION_SURF_TERMINATED)
{
std::cerr << "Incorrect Termination" << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
......@@ -243,6 +300,9 @@ int TestLagrangianParticle(int, char*[])
vtkLagrangianParticle::SURFACE_INTERACTION_TERMINATED)
{
std::cerr << "Incorrect Interaction" << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
......@@ -253,6 +313,9 @@ int TestLagrangianParticle(int, char*[])
std::cerr << "Incorrect Step Time or Integration Time: "
<< part->GetIntegrationTime() << " " << part2->GetIntegrationTime()
<< " " << part3->GetIntegrationTime() << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
......@@ -261,6 +324,9 @@ int TestLagrangianParticle(int, char*[])
part3->GetPrevIntegrationTime() != 0)
{
std::cerr << "Incorrect Prev Integration Time" << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
......@@ -268,6 +334,9 @@ int TestLagrangianParticle(int, char*[])
if (part->GetIntegrationTime() != 7.13)
{
std::cerr << "SetIntegrationTime does not seem to work" << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
......@@ -275,6 +344,9 @@ int TestLagrangianParticle(int, char*[])
if (part->GetUserFlag() != 17)
{
std::cerr << "UserFlag does not seem to work" << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
......@@ -282,6 +354,9 @@ int TestLagrangianParticle(int, char*[])
if (!part->GetPInsertPreviousPosition())
{
std::cerr << "PInsertPreviousPosition does not seem to work" << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
......@@ -289,6 +364,9 @@ int TestLagrangianParticle(int, char*[])
if (!part->GetPManualShift())
{
std::cerr << "PManualShift does not seem to work" << std::endl;
delete part;
delete part2;
delete part3;
return EXIT_FAILURE;
}
......@@ -309,28 +387,40 @@ int TestLagrangianParticle(int, char*[])
{
std::cerr << "Incorrect Id in part4 : " << part4->GetId()
<< ". Particle Id problems." << std::endl;
delete part4;
delete part5;
return EXIT_FAILURE;
}
if (part5->GetId() != 1)
{
std::cerr << "Incorrect Id in part5 : " << part5->GetId()
<< ". Particle Id problems." << std::endl;
delete part4;
delete part5;
return EXIT_FAILURE;
}
if (part5->GetNumberOfSteps() != 17)
{
std::cerr << "Incorrect NumberOfSteps in part5." << std::endl;
delete part4;
delete part5;
return EXIT_FAILURE;
}
if (part5->GetIntegrationTime() != 0.17)
{
std::cerr << "Incorrect Integration Time in part5." << std::endl;
delete part4;
delete part5;
return EXIT_FAILURE;
}
if (part5->GetPrevIntegrationTime() != 0.13)
{
std::cerr << "Incorrect Previous Integration Time in part5." << std::endl;
delete part4;
delete part5;
return EXIT_FAILURE;
}
delete part4;
delete part5;
return EXIT_SUCCESS;
}
......@@ -516,11 +516,11 @@ vtkLagrangianBasicIntegrationModel::vtkLagrangianBasicIntegrationModel():
SurfaceArrayDescription surfaceTypeDescription;
surfaceTypeDescription.nComp = 1;
surfaceTypeDescription.type = VTK_INT;
surfaceTypeDescription.enumValues.push_back(std::make_pair(0, "ModelDefined"));
surfaceTypeDescription.enumValues.push_back(std::make_pair(1, "Terminate"));
surfaceTypeDescription.enumValues.push_back(std::make_pair(2, "Bounce"));
surfaceTypeDescription.enumValues.push_back(std::make_pair(3, "BreakUp"));
surfaceTypeDescription.enumValues.push_back(std::make_pair(4, "PassThrough"));
surfaceTypeDescription.enumValues.push_back(std::make_pair(SURFACE_TYPE_MODEL, "ModelDefined"));
surfaceTypeDescription.enumValues.push_back(std::make_pair(SURFACE_TYPE_TERM, "Terminate"));
surfaceTypeDescription.enumValues.push_back(std::make_pair(SURFACE_TYPE_BOUNCE, "Bounce"));
surfaceTypeDescription.enumValues.push_back(std::make_pair(SURFACE_TYPE_BREAK, "BreakUp"));
surfaceTypeDescription.enumValues.push_back(std::make_pair(SURFACE_TYPE_PASS, "PassThrough"));
this->SurfaceArrayDescriptions["SurfaceType"] = surfaceTypeDescription;
this->SeedArrayNames->InsertNextValue("ParticleInitialVelocity");
......@@ -1529,11 +1529,9 @@ bool vtkLagrangianBasicIntegrationModel::ManualIntegration(
//---------------------------------------------------------------------------
void vtkLagrangianBasicIntegrationModel::ComputeSurfaceDefaultValues(
const char* vtkNotUsed(arrayName), vtkDataSet* vtkNotUsed(dataset),
const char* arrayName, vtkDataSet* vtkNotUsed(dataset),
int nComponents, double* defaultValues)
{
for (int i = 0; i < nComponents; i++)
{
defaultValues[i] = 0.f;
}
double defVal = (strcmp(arrayName, "SurfaceType") == 0) ? static_cast<double>(SURFACE_TYPE_TERM) : 0.0;
std::fill(defaultValues, defaultValues + nComponents, defVal);
}
......@@ -71,6 +71,7 @@ vtkLagrangianParticleTracker::vtkLagrangianParticleTracker()
this->ParticlePathsRenderingPointsThreshold = 100;
this->CreateOutOfDomainParticle = false;
this->ParticleCounter = 0;
}
//---------------------------------------------------------------------------
......@@ -115,7 +116,7 @@ void vtkLagrangianParticleTracker::PrintSelf(ostream& os, vtkIndent indent)
<< this->ParticlePathsRenderingPointsThreshold << endl;
os << indent << "MinimumVelocityMagnitude: " << this->MinimumVelocityMagnitude << endl;
os << indent << "MinimumReductionFactor: " << this->MinimumReductionFactor << endl;
os << indent << "ParticleCounter: " << this->ParticleCounter << std::endl;
os << indent << "ParticleCounter: " << this->ParticleCounter << endl;
}
//---------------------------------------------------------------------------
......
......@@ -102,7 +102,6 @@ int AggregateDataSet(int argc, char *argv[])
threshold->ThresholdBetween(0, 500);
threshold->SetInputConnection(wavelet->GetOutputPort());
aggregate->SetInputConnection(threshold->GetOutputPort());
aggregate->SetOutputDataType(VTK_UNSTRUCTURED_GRID);
vtkContourFilter* contour = vtkContourFilter::New();
double scalar_range[2] = {50, 400};
......@@ -111,10 +110,10 @@ int AggregateDataSet(int argc, char *argv[])
mapper->SetInputConnection(contour->GetOutputPort());
mapper->Update();
if (me % 2 == 0 && vtkDataSet::SafeDownCast(aggregate->GetOutput())->GetNumberOfPoints() != 4851)
if (me % 2 == 0 && vtkDataSet::SafeDownCast(aggregate->GetOutput())->GetNumberOfPoints() != 5082)
{
vtkGenericWarningMacro("Wrong number of unstructured grid points on process "
<< me << ". Should be 4851 but is " <<
<< me << ". Should be 5082 but is " <<
vtkDataSet::SafeDownCast(aggregate->GetOutput())->GetNumberOfPoints());
retVal = EXIT_FAILURE;
}
......
......@@ -32,7 +32,6 @@ vtkStandardNewMacro(vtkAggregateDataSetFilter);
//-----------------------------------------------------------------------------
vtkAggregateDataSetFilter::vtkAggregateDataSetFilter()
{
this->OutputDataType = VTK_POLY_DATA;
this->NumberOfTargetProcesses = 1;
}
......@@ -41,24 +40,6 @@ vtkAggregateDataSetFilter::~vtkAggregateDataSetFilter()
{
}
//-----------------------------------------------------------------------------
void vtkAggregateDataSetFilter::SetOutputDataType(int dt)
{
if (dt != this->OutputDataType)
{
if (dt == VTK_POLY_DATA || dt == VTK_UNSTRUCTURED_GRID)
{
this->OutputDataType = dt;
this->Modified();
}
else
{
vtkErrorMacro("Invalid output data type. Only VTK_POLY_DATA (0) "
<< " or VTK_UNSTRUCTURED_GRID (4) supported");
}
}
}
//-----------------------------------------------------------------------------
void vtkAggregateDataSetFilter::SetNumberOfTargetProcesses(int tp)
{
......@@ -87,46 +68,12 @@ void vtkAggregateDataSetFilter::SetNumberOfTargetProcesses(int tp)
//----------------------------------------------------------------------------
int vtkAggregateDataSetFilter::FillInputPortInformation(int, vtkInformation* info)
{
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkDataObject");
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPolyData");
info->Append(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkUnstructuredGrid");
info->Set(vtkAlgorithm::INPUT_IS_OPTIONAL(), 1);
return 1;
}
//-----------------------------------------------------------------------------
int vtkAggregateDataSetFilter::RequestDataObject(
vtkInformation*, vtkInformationVector**, vtkInformationVector* outputVector)
{
vtkDataSet* output = vtkDataSet::GetData(outputVector, 0);
vtkDataSet* outputCopy = 0;
if (this->OutputDataType == VTK_POLY_DATA)
{
if (output && output->IsA("vtkPolyData"))
{
return 1;
}
outputCopy = vtkPolyData::New();
}
else if (this->OutputDataType == VTK_UNSTRUCTURED_GRID)
{
if (output && output->IsA("vtkUnstructuredGrid"))
{
return 1;
}
outputCopy = vtkUnstructuredGrid::New();
}
else
{
vtkErrorMacro("Invalid output type: " << this->OutputDataType
<< ". Cannot create output.");
return 0;
}
outputVector->GetInformationObject(0)->Set(vtkDataObject::DATA_OBJECT(), outputCopy);
outputCopy->Delete();
return 1;
}
//-----------------------------------------------------------------------------
// We should avoid marshalling more than once.
int vtkAggregateDataSetFilter::RequestData(
......@@ -143,7 +90,8 @@ int vtkAggregateDataSetFilter::RequestData(
vtkMultiProcessController* controller =
vtkMultiProcessController::GetGlobalController();
if (controller->GetNumberOfProcesses() == this->NumberOfTargetProcesses)
int numberOfProcesses = controller->GetNumberOfProcesses();
if (numberOfProcesses == this->NumberOfTargetProcesses)
{
if (input)
{
......@@ -161,9 +109,15 @@ int vtkAggregateDataSetFilter::RequestData(
}
else
{
int localColor = controller->GetLocalProcessId() / this->NumberOfTargetProcesses;
int localKey = controller->GetLocalProcessId() % this->NumberOfTargetProcesses;
subController.TakeReference(controller->PartitionController(localColor, localKey));
int localProcessId = controller->GetLocalProcessId();
int numberOfProcessesPerGroup = numberOfProcesses/this->NumberOfTargetProcesses;
int localColor = localProcessId/numberOfProcessesPerGroup;
if (numberOfProcesses % this->NumberOfTargetProcesses)
{
double d = 1.*numberOfProcesses/this->NumberOfTargetProcesses;
localColor = int(localProcessId/d);
}
subController.TakeReference(controller->PartitionController(localColor, 0));
}
int subNumProcs = subController->GetNumberOfProcesses();
......@@ -194,7 +148,7 @@ int vtkAggregateDataSetFilter::RequestData(
{
output->ShallowCopy(input);
}
else if (this->OutputDataType == VTK_POLY_DATA)
else if (input->IsA("vtkPolyData"))
{
vtkNew<vtkAppendPolyData> appendFilter;
for (std::vector<vtkSmartPointer<vtkDataObject> >::iterator it=recvBuffer.begin();
......@@ -205,7 +159,7 @@ int vtkAggregateDataSetFilter::RequestData(
appendFilter->Update();
output->ShallowCopy(appendFilter->GetOutput());
}
else if (this->OutputDataType == VTK_UNSTRUCTURED_GRID)
else if (input->IsA("vtkUnstructuredGrid"))
{
vtkNew<vtkAppendFilter> appendFilter;
appendFilter->MergePointsOn();
......@@ -227,18 +181,5 @@ void vtkAggregateDataSetFilter::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
os << indent << "NumberOfTargetProcesses: " << this->NumberOfTargetProcesses << endl;
os << indent << "OutputDataType: ";
if (this->OutputDataType == VTK_POLY_DATA)
{
os << "VTK_POLY_DATA";
}
else if (this->OutputDataType == VTK_UNSTRUCTURED_GRID)
{
os << "VTK_UNSTRUCTURED_GRID";
}
else
{
os << "Unrecognized output type " << this->OutputDataType;
}
os << endl;
}
......@@ -36,20 +36,6 @@ public:
vtkTypeMacro(vtkAggregateDataSetFilter, vtkPassInputTypeAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
//@{
/**
* Controls the output type. This is required because processes receiving
* data cannot know their output type in RequestDataObject without
* communicating with other processes. Since communicating with other
* processes in RequestDataObject is dangerous (can cause deadlock because
* it may happen out-of-sync), the application has to set the output
* type. The default is VTK_POLY_DATA.
*/
void SetOutputDataType(int);
vtkGetMacro(OutputDataType, int);
//@}
//@{
/**
* Number of target processes. Valid values are between 1 and the total
......@@ -67,15 +53,12 @@ public:
protected:
vtkAggregateDataSetFilter();
~vtkAggregateDataSetFilter();
~vtkAggregateDataSetFilter() VTK_OVERRIDE;
virtual int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
vtkInformationVector* outputVector);
virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
vtkInformationVector* outputVector);
virtual int FillInputPortInformation(int port, vtkInformation* info);
vtkInformationVector* outputVector) VTK_OVERRIDE;
virtual int FillInputPortInformation(int port, vtkInformation* info) VTK_OVERRIDE;
int OutputDataType;
int NumberOfTargetProcesses;
private:
......
vtk_add_test_cxx(${vtk-module}CxxTests tests
TestPLYReader.cxx
TestPLYReaderIntensity.cxx
TestPLYReaderTextureUV.cxx
TestPLYWriter.cxx,NO_VALID
)
......
/*=========================================================================
Program: Visualization Toolkit
Module: TestPLYReaderIntensity.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME Test of vtkPLYReaderIntensity
// .SECTION Description
//
#include "vtkSmartPointer.h"
#include "vtkPLYReader.h"
#include "vtkDebugLeaks.h"
#include "vtkActor.h"
#include "vtkCamera.h"
#include "vtkPolyDataMapper.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRegressionTestImage.h"
#include "vtkTestUtilities.h"
#include "vtkWindowToImageFilter.h"
int TestPLYReaderIntensity( int argc, char *argv[] )
{
// Read file name.
const char* fname = vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/Armadillo.ply");
// Test if the reader thinks it can open the file.
int canRead = vtkPLYReader::CanReadFile(fname);
(void)canRead;
// Create the reader.
vtkSmartPointer<vtkPLYReader> reader =
vtkSmartPointer<vtkPLYReader>::New();
reader->SetFileName(fname);
delete [] fname;
// Create a mapper.
vtkSmartPointer<vtkPolyDataMapper> mapper =
vtkSmartPointer<vtkPolyDataMapper>::New();
mapper->SetInputConnection(reader->GetOutputPort());
mapper->ScalarVisibilityOff();
// Create the actor.
vtkSmartPointer<vtkActor> actor =
vtkSmartPointer<vtkActor>::New();
actor->SetMapper(mapper);
// Basic visualisation.
vtkSmartPointer<vtkRenderWindow> renWin =
vtkSmartPointer<vtkRenderWindow>::New();
vtkSmartPointer<vtkRenderer> ren =
vtkSmartPointer<vtkRenderer>::New();
renWin->AddRenderer(ren);
vtkSmartPointer<vtkRenderWindowInteractor> iren =
vtkSmartPointer<vtkRenderWindowInteractor>::New();
iren->SetRenderWindow(renWin);
ren->AddActor(actor);
ren->SetBackground(.2, .3, .5);
ren->ResetCamera();
ren->GetActiveCamera()->Azimuth(210);
ren->GetActiveCamera()->Elevation(30);
renWin->SetSize(300,300);
// interact with data
renWin->Render();
int retVal = vtkRegressionTestImage( renWin );
if ( retVal == vtkRegressionTester::DO_INTERACTOR)
{
iren->Start();
}
return !retVal;
}
......@@ -302,8 +302,8 @@ int vtkPLYReader::RequestData(
if ( intensityAvailable )
{
vtkPLY::ply_get_property (ply, elemName, &faceProps[1]);
RGBCells->SetNumberOfComponents(1);
RGBCells->SetNumberOfTuples(numPolys);
intensity->SetNumberOfComponents(1);
intensity->SetNumberOfTuples(numPolys);
}
if ( RGBCellsAvailable )
{
......
......@@ -332,11 +332,10 @@ void vtkOpenGLContextDevice2D::Begin(vtkViewport* viewport)
this->RenderWindow = vtkOpenGLRenderWindow::SafeDownCast(this->Renderer->GetRenderWindow());
this->RenderWindow->GetShaderCache()->ReleaseCurrentShader();
// Enable simple line, point and polygon antialiasing if multisampling is on.
// Enable simple line smoothing if multisampling is on.
if (this->Renderer->GetRenderWindow()->GetMultiSamples())
{
glEnable(GL_LINE_SMOOTH);
glEnable(GL_POLYGON_SMOOTH);
}
this->InRender = true;
......@@ -359,11 +358,10 @@ void vtkOpenGLContextDevice2D::End()
// Restore the GL state that we changed
this->Storage->RestoreGLState();
// Disable simple line, point and polygon antialiasing if multisampling is on.
// Disable simple line smoothing if multisampling is on.
if (this->Renderer->GetRenderWindow()->GetMultiSamples())
{
glDisable(GL_LINE_SMOOTH);
glDisable(GL_POLYGON_SMOOTH);
}
this->RenderWindow = NULL;
......
......@@ -16,7 +16,7 @@
#include "vtkNew.h"
#include "vtkRenderWindow.h"
int TestOffscreenIsOffscreen(int argc, char* argv[])
int TestOffscreenIsOffscreen(int, char* [])
{
vtkNew<vtkRenderWindow> renWin;
// This test is only run if VTK_USE_OFFSCREEN is on. So the default should
......
if(ANDROID OR APPLE_IOS) # No gl2ps on mobile
set(gl2ps_depends)
set(gl2ps_test_depends)
if(ANDROID OR APPLE_IOS) # No GL2PS on mobile
return()
elseif(VTK_RENDERING_BACKEND STREQUAL "OpenGL")
set(gl2ps_depends vtkRenderingGL2PS)
set(gl2ps_test_depends vtkIOExportOpenGL)
......
9e68ff1b1cc914ed88cd84f6a8235021