Commit 445d99ff authored by Mike Rye's avatar Mike Rye
Browse files

Initialize members at declaration.

parent ffda93b9
......@@ -27,7 +27,6 @@ vtkStandardNewMacro(vtkPCLNormalEstimationFilter);
//------------------------------------------------------------------------------
vtkPCLNormalEstimationFilter::vtkPCLNormalEstimationFilter()
{
this->Radius = 0.05;
}
//------------------------------------------------------------------------------
......
......@@ -41,7 +41,7 @@ private:
//------------------------------------------------------------------------------
// Filter parameters.
private:
double Radius;
double Radius {0.05};
public:
vtkSetMacro(Radius, double);
......
......@@ -26,12 +26,6 @@ vtkStandardNewMacro(vtkPCLPassThroughFilter);
//------------------------------------------------------------------------------
vtkPCLPassThroughFilter::vtkPCLPassThroughFilter()
{
// Initialize the filter parameters. These values should match the values set
// in the ServerManager proxy.
this->SetFieldName("x");
this->Limits[0] = 0.0;
this->Limits[1] = 1.0;
this->Invert = false;
}
//------------------------------------------------------------------------------
......
......@@ -42,9 +42,11 @@ private:
// Filter parameters and their getters/setters. These are exposed through the
// ServerManager proxy.
private:
char * FieldName;
double Limits[2];
bool Invert;
// Initialize the filter parameters. These values should match the values set
// in the ServerManager proxy.
char * FieldName = nullptr;
double Limits[2] {0.0, 0.1};
bool Invert {false};
public:
vtkSetStringMacro(FieldName);
......
......@@ -26,8 +26,6 @@ vtkStandardNewMacro(vtkPCLStatisticalOutlierRemovalFilter);
//------------------------------------------------------------------------------
vtkPCLStatisticalOutlierRemovalFilter::vtkPCLStatisticalOutlierRemovalFilter()
{
this->MeanK = 50.0;
this->StddevMulThresh = 1.0;
}
//------------------------------------------------------------------------------
......
......@@ -41,8 +41,8 @@ private:
//------------------------------------------------------------------------------
// Filter parameters.
private:
double MeanK;
double StddevMulThresh;
double MeanK {50.0};
double StddevMulThresh {1.0};
public:
vtkSetMacro(MeanK, double);
......
......@@ -26,9 +26,6 @@ vtkStandardNewMacro(vtkPCLVoxelGridFilter);
//------------------------------------------------------------------------------
vtkPCLVoxelGridFilter::vtkPCLVoxelGridFilter()
{
this->LeafSize[0] = 0.01;
this->LeafSize[1] = 0.01;
this->LeafSize[2] = 0.01;
}
//------------------------------------------------------------------------------
......
......@@ -41,7 +41,7 @@ private:
//------------------------------------------------------------------------------
// Filter parameters.
private:
float LeafSize[3];
float LeafSize[3] {0.01, 0.01, 0.01};
public:
vtkSetVector3Macro(LeafSize, float);
......
......@@ -32,12 +32,6 @@ vtkStandardNewMacro(vtkPCLBRigidAlignmentFilter2);
//------------------------------------------------------------------------------
vtkPCLBRigidAlignmentFilter2::vtkPCLBRigidAlignmentFilter2()
{
this->NormalRadius = 0.02;
this->FeatureRadius = 0.02;
this->DistanceThreshold = 0.02;
this->MaxIterations = 50;
this->Probability = 1.0;
}
//------------------------------------------------------------------------------
......
......@@ -42,16 +42,16 @@ private:
//------------------------------------------------------------------------------
// Parameters specific to this filter.
private:
double NormalRadius;
double FeatureRadius;
double NormalRadius {0.02};
double FeatureRadius {0.02};
double DistanceThreshold;
int MaxIterations;
double Probability;
double DistanceThreshold {0.02};
int MaxIterations {2500};
double Probability {1.0};
Eigen::Matrix4f TransformationMatrix;
bool HasTransformation;
bool ReuseTransformation;
Eigen::Matrix4f TransformationMatrix {Eigen::Matrix4f::Identity()};
bool HasTransformation {false};
bool ReuseTransformation {false};
public:
vtkGetMacro(NormalRadius, double);
......
......@@ -28,7 +28,6 @@ vtkStandardNewMacro(vtkPCLFPFHEstimationFilter2);
vtkPCLFPFHEstimationFilter2::vtkPCLFPFHEstimationFilter2()
{
this->SecondPortOptional = true;
this->Radius = 0.05;
}
//------------------------------------------------------------------------------
......
......@@ -44,7 +44,7 @@ private:
private:
typedef pcl::FPFHSignature33 FeatureType;
typedef pcl::PointCloud<FeatureType> FeatureCloudT;
double Radius;
double Radius {0.07};
public:
vtkSetMacro(Radius, double);
......
......@@ -31,7 +31,6 @@ vtkStandardNewMacro(vtkPCLIntensityGradientEstimationFilter2);
//------------------------------------------------------------------------------
vtkPCLIntensityGradientEstimationFilter2::vtkPCLIntensityGradientEstimationFilter2()
{
this->RadiusSearch = 0.10;
}
//------------------------------------------------------------------------------
......
......@@ -42,7 +42,7 @@ private:
//------------------------------------------------------------------------------
// Parameters specific to this filter.
private:
float RadiusSearch;
float RadiusSearch {0.10};
public:
vtkGetMacro(RadiusSearch, float);
......
......@@ -28,9 +28,6 @@ vtkStandardNewMacro(vtkPCLRSDEstimationFilter2);
vtkPCLRSDEstimationFilter2::vtkPCLRSDEstimationFilter2()
{
this->SecondPortOptional = true;
this->SaveHistograms = false;
this->RadiusSearch = 0.05;
this->PlaneRadius = 0.5;
}
//------------------------------------------------------------------------------
......
......@@ -48,9 +48,9 @@ private:
// TODO
// Maybe add NrSubdivisions. Supporting this will require supporting arbitrary
// Histogram<N> types up to some limit, where N = max(NrSubdivisions)^2.
double PlaneRadius;
double RadiusSearch;
bool SaveHistograms;
double PlaneRadius {0.5};
double RadiusSearch {0.05};
bool SaveHistograms {false};
public:
vtkSetMacro(PlaneRadius, double);
......
......@@ -45,17 +45,17 @@ private:
//------------------------------------------------------------------------------
protected:
// Registration convergence criteria.
double MaxCorrespondenceDistance;
unsigned int MaximumIterations;
double TransformationEpsilon;
double TransformationRotationEpsilon;
double EuclideanFitnessEpsilon;
double MaxCorrespondenceDistance {0.05};
unsigned int MaximumIterations {50};
double TransformationEpsilon {1e-8};
double TransformationRotationEpsilon {1e-8};
double EuclideanFitnessEpsilon {1.0};
protected:
// Transformation caching.
Eigen::Matrix4f TransformationMatrix;
bool HasTransformation;
bool ReuseTransformation;
Eigen::Matrix4f TransformationMatrix {Eigen::Matrix4f::Identity()};
bool HasTransformation {false};
bool ReuseTransformation {false};
public:
vtkGetMacro(MaxCorrespondenceDistance, double);
......
......@@ -23,15 +23,6 @@
//------------------------------------------------------------------------------
inline
vtkPCLRegistrationFilter2::vtkPCLRegistrationFilter2()
: MaxCorrespondenceDistance { 0.05 }
, MaximumIterations { 50 }
, TransformationEpsilon { 1e-8 }
, TransformationRotationEpsilon { 1e-8 }
, EuclideanFitnessEpsilon { 1 }
, TransformationMatrix { decltype(TransformationMatrix)::Identity() }
, HasTransformation { false }
, ReuseTransformation { false }
{
}
......
......@@ -32,7 +32,6 @@ vtkStandardNewMacro(vtkPCLSampleConsensusInitialAlignmentFilter2);
//------------------------------------------------------------------------------
vtkPCLSampleConsensusInitialAlignmentFilter2::vtkPCLSampleConsensusInitialAlignmentFilter2()
{
this->MinSampleDistance = 0.05;
}
//------------------------------------------------------------------------------
......
......@@ -42,9 +42,9 @@ private:
//------------------------------------------------------------------------------
// Parameters specific to this filter.
private:
float MinSampleDistance;
float NormalRadius;
float FeatureRadius;
float MinSampleDistance {0.05};
float NormalRadius {0.05};
float FeatureRadius {0.07};
public:
vtkGetMacro(MinSampleDistance, float);
......
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