Commit bf5fba2b authored by Mike Rye's avatar Mike Rye
Browse files

Add and update VTK error macros.

parent 3847f605
......@@ -15,6 +15,11 @@
// limitations under the License.
//==============================================================================
/*!
* @file
* @deprecated This file will likely be removed in the near future.
*/
#ifndef _PCLP_FeatureExtractor_h
#define _PCLP_FeatureExtractor_h
......
......@@ -136,6 +136,7 @@ int vtkPCLMovingLeastSquaresFilter::ApplyPCLFilter(
#define _statement(PointType) return this->InternalApplyPCLFilter<PointType>(input, output);
PCLP_INVOKE_WITH_PCL_XYZ_POINT_TYPE(index, _statement)
#undef _statement
vtkErrorMacro(<< "no XYZ point data in input")
return 0;
}
......@@ -155,6 +156,7 @@ int vtkPCLMovingLeastSquaresFilter::InternalApplyPCLFilter(
#define _statement(NormalPointType) return this->InternalInternalApplyPCLFilter<PointType, NormalPointType>(input, output);
PCLP_INVOKE_WITH_XYZ_NORMAL_POINT_TYPE(index, _statement)
#undef _statement
vtkErrorMacro(<< "failed to determine a corresponding point type with normal attributes")
return 0;
}
else
......
......@@ -51,6 +51,7 @@ int vtkPCLNormalEstimationFilter::ApplyPCLFilter(
#define _statement(PointType) return this->InternalApplyPCLFilter<PointType>(input, output);
PCLP_INVOKE_WITH_PCL_XYZ_POINT_TYPE(index, _statement)
#undef _statement
vtkErrorMacro(<< "no XYZ point data in input")
return 0;
}
......@@ -73,6 +74,7 @@ int vtkPCLNormalEstimationFilter::InternalApplyPCLFilter(
#define _statement(NormalPointType) return this->EstimateNormals<PointType, NormalPointType>(inputCloud, input, output);
PCLP_INVOKE_WITH_PCL_NORMAL_POINT_TYPE(index, _statement)
#undef _statement
vtkErrorMacro(<< "failed to determine a corresponding point type with normal attributes")
return 0;
}
......
......@@ -69,6 +69,7 @@ int vtkPCLPassThroughFilter::ApplyPCLFilter(
// If control reaches this point then no switch statement was executed and no
// filter was applied. Return 0 to indicate this.
vtkErrorMacro(<< "no XYZ point data in input")
return 0;
}
......
......@@ -51,6 +51,7 @@ int vtkPCLStatisticalOutlierRemovalFilter::ApplyPCLFilter(
#define _statement(PointType) return this->InternalApplyPCLFilter<PointType>(input, output);
PCLP_INVOKE_WITH_PCL_XYZ_POINT_TYPE(index, _statement)
#undef _statement
vtkErrorMacro(<< "no XYZ point data in input")
return 0;
}
......
......@@ -50,6 +50,7 @@ int vtkPCLVoxelGridFilter::ApplyPCLFilter(
#define _statement(PointType) return this->InternalApplyPCLFilter<PointType>(input, output);
PCLP_INVOKE_WITH_PCL_XYZ_POINT_TYPE(index, _statement)
#undef _statement
vtkErrorMacro(<< "no XYZ point data in input")
return 0;
}
......
......@@ -64,6 +64,7 @@ int vtkPCLBRigidAlignmentFilter2::ApplyPCLFilter2(
#define _statement(PointType) return this->InternalApplyPCLFilter2<PointType,pcl::Normal,pcl::FPFHSignature33>(input, target, output);
PCLP_INVOKE_WITH_PCL_XYZ_POINT_TYPE(index, _statement)
#undef _statement
vtkErrorMacro(<< "no XYZ point data in input")
return 0;
}
......@@ -129,6 +130,7 @@ int vtkPCLBRigidAlignmentFilter2::InternalApplyPCLFilter2(
ransacFilter.setProbability(this->Probability);
if (! (ransacFilter.computeModel() && ransacFilter.refineModel()))
{
vtkErrorMacro(<< "failed to compute random sample consensus")
return 0;
}
......
......@@ -70,6 +70,7 @@ int vtkPCLFPFHEstimationFilter2::ApplyPCLFilter2(
#undef _statement
}
vtkErrorMacro(<< "no XYZ point data in input")
return 0;
}
......
......@@ -78,7 +78,7 @@ int vtkPCLIntensityGradientEstimationFilter2::InternalApplyPCLFilter2(
#define _statement(NPointType) return this->InternalInternalApplyPCLFilter2<IPointType, NPointType>(intensities, normals, output);
PCLP_INVOKE_WITH_PCL_NORMAL_POINT_TYPE(index, _statement)
#undef _statement
vtkErrorMacro(<< "normal data input does not contain normal components")
vtkErrorMacro(<< "failed to determine normal point type from normals input")
return 0;
}
......
......@@ -56,6 +56,7 @@ int vtkPCLIterativeClosestPointFilter2::ApplyPCLFilter2(
#define _statement(PointType) return this->InternalApplyPCLFilter2<PointType>(input, target, output);
PCLP_INVOKE_WITH_PCL_XYZ_POINT_TYPE(index, _statement)
#undef _statement
vtkErrorMacro(<< "no XYZ point data in input")
return 0;
}
......
......@@ -55,12 +55,12 @@ int vtkPCLRSDEstimationFilter2::ApplyPCLFilter2(
// normals.
if (normals == nullptr)
{
std::cout << "normals is null" << std::endl;
std::set<std::string> requiredFieldNames { "normal_x", "normal_y", "normal_z" };
int index = vtkPCLConversions::GetPointTypeIndex(points, requiredFieldNames);
#define _statement(PointType) return this->InternalApplyPCLFilter2<PointType>(points, features);
PCLP_INVOKE_WITH_XYZ_NORMAL_POINT_TYPE(index, _statement)
#undef _statement
vtkErrorMacro(<< "failed to determine a corresponding point type with normal attributes")
}
// Otherwise both the point and normal type have to be determined.
......@@ -70,6 +70,7 @@ int vtkPCLRSDEstimationFilter2::ApplyPCLFilter2(
#define _statement(PointType) return this->InternalApplyPCLFilter2<PointType, pcl::Normal>(points, normals, features);
PCLP_INVOKE_WITH_PCL_XYZ_POINT_TYPE(index, _statement)
#undef _statement
vtkErrorMacro(<< "no XYZ point data in input")
}
return 0;
......
......@@ -59,6 +59,7 @@ int vtkPCLSampleConsensusInitialAlignmentFilter2::ApplyPCLFilter2(
#define _statement(PointType) return this->InternalApplyPCLFilter2<PointType>(input, target, output);
PCLP_INVOKE_WITH_PCL_XYZ_POINT_TYPE(index, _statement)
#undef _statement
vtkErrorMacro(<< "no XYZ point data in input")
return 0;
}
......
......@@ -65,7 +65,7 @@ int vtkPCLBSampleConsensusModelRegistrationFilter4::ApplyPCLFilter4(
#define _statement(PointType) return this->InternalApplyPCLFilter4<PointType>(sourcePointsPD, sourceFeaturesPD, targetPointsPD, targetFeaturesPD, output);
PCLP_INVOKE_WITH_PCL_XYZ_POINT_TYPE(index, _statement)
#undef _statement
vtkErrorMacro(<< "no XYZ data in source points input")
vtkErrorMacro(<< "no XYZ point data in input")
return 0;
// return this->InternalInternalApplyPCLFilter4<pcl::PointNormal,pcl::FPFHSignature33>(sourcePointsPD, sourceFeaturesPD, targetPointsPD, targetFeaturesPD, output);
......@@ -86,7 +86,7 @@ int vtkPCLBSampleConsensusModelRegistrationFilter4::InternalApplyPCLFilter4(
#define _statement(FeatureType) return this->InternalInternalApplyPCLFilter4<PointType,FeatureType>(sourcePointsPD, sourceFeaturesPD, targetPointsPD, targetFeaturesPD, output);
PCLP_INVOKE_WITH_PCL_FEATURE_POINT_TYPE(index, _statement)
#undef _statement
vtkErrorMacro(<< "no feature data in source features input")
vtkErrorMacro(<< "input did not match any feature point type")
return 0;
// return this->InternalInternalApplyPCLFilter4<PointType,pcl::FPFHSignature33>(sourcePointsPD, sourceFeaturesPD, targetPointsPD, targetFeaturesPD, output);
......
......@@ -53,6 +53,7 @@ int vtkPCLPCDFileReader::LoadPCLReader(
{
if (this->FileName == "")
{
vtkErrorMacro(<< "no file name given")
return 0;
}
......@@ -85,6 +86,7 @@ int vtkPCLPCDFileReader::LoadPCLReader(
#define _statement(PointType) return this->InternalLoadPCLReader<PointType>(output);
PCLP_INVOKE_WITH_PCL_POINT_TYPE(index, _statement)
#undef _statement
vtkErrorMacro(<< "failed to determine PCL point type from file")
return 0;
}
......@@ -98,6 +100,7 @@ int vtkPCLPCDFileReader::InternalLoadPCLReader(
typename CloudT::Ptr outputCloud(new CloudT);
if (pcl::io::loadPCDFile(this->FileName, (* outputCloud)) == -1)
{
vtkErrorMacro(<< "failed to load file")
return 0;
}
else
......
......@@ -53,6 +53,7 @@ int vtkPCLPCDFileWriter::WritePCL(
{
if (this->FileName == nullptr)
{
vtkErrorMacro(<< "no file name given")
return 0;
}
......@@ -60,6 +61,7 @@ int vtkPCLPCDFileWriter::WritePCL(
#define _statement(PointType) return this->InternalWritePCL<PointType>(input);
PCLP_INVOKE_WITH_PCL_POINT_TYPE(index, _statement)
#undef _statement
vtkErrorMacro(<< "failed to determine PCL point type")
return 0;
}
......
Supports Markdown
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