simplification of cloud collection
This commit is contained in:
parent
e3ff28dacc
commit
f930f2f19d
@ -112,15 +112,8 @@ void cv::viz::WCloudCollection::addCloud(InputArray cloud, InputArray colors, co
|
|||||||
vtkSmartPointer<vtkCloudMatSource> source = vtkSmartPointer<vtkCloudMatSource>::New();
|
vtkSmartPointer<vtkCloudMatSource> source = vtkSmartPointer<vtkCloudMatSource>::New();
|
||||||
source->SetColorCloud(cloud, colors);
|
source->SetColorCloud(cloud, colors);
|
||||||
|
|
||||||
vtkSmartPointer<vtkTransform> transform = vtkSmartPointer<vtkTransform>::New();
|
vtkSmartPointer<vtkPolyData> polydata = VtkUtils::TransformPolydata(source->GetOutputPort(), pose);
|
||||||
transform->SetMatrix(pose.matrix.val);
|
|
||||||
|
|
||||||
vtkSmartPointer<vtkTransformPolyDataFilter> transform_filter = vtkSmartPointer<vtkTransformPolyDataFilter>::New();
|
|
||||||
transform_filter->SetInputConnection(source->GetOutputPort());
|
|
||||||
transform_filter->SetTransform(transform);
|
|
||||||
transform_filter->Update();
|
|
||||||
|
|
||||||
vtkSmartPointer<vtkPolyData> polydata = transform_filter->GetOutput();
|
|
||||||
vtkSmartPointer<vtkLODActor> actor = vtkLODActor::SafeDownCast(WidgetAccessor::getProp(*this));
|
vtkSmartPointer<vtkLODActor> actor = vtkLODActor::SafeDownCast(WidgetAccessor::getProp(*this));
|
||||||
CV_Assert("Incompatible widget type." && actor);
|
CV_Assert("Incompatible widget type." && actor);
|
||||||
|
|
||||||
|
@ -256,17 +256,22 @@ namespace cv
|
|||||||
return normals_generator->GetOutput();
|
return normals_generator->GetOutput();
|
||||||
}
|
}
|
||||||
|
|
||||||
static vtkSmartPointer<vtkPolyData> TransformPolydata(vtkSmartPointer<vtkPolyData> polydata, const Affine3d& pose)
|
static vtkSmartPointer<vtkPolyData> TransformPolydata(vtkSmartPointer<vtkAlgorithmOutput> algorithm_output_port, const Affine3d& pose)
|
||||||
{
|
{
|
||||||
vtkSmartPointer<vtkTransform> transform = vtkSmartPointer<vtkTransform>::New();
|
vtkSmartPointer<vtkTransform> transform = vtkSmartPointer<vtkTransform>::New();
|
||||||
transform->SetMatrix(vtkmatrix(pose.matrix));
|
transform->SetMatrix(vtkmatrix(pose.matrix));
|
||||||
|
|
||||||
vtkSmartPointer<vtkTransformPolyDataFilter> transform_filter = vtkSmartPointer<vtkTransformPolyDataFilter>::New();
|
vtkSmartPointer<vtkTransformPolyDataFilter> transform_filter = vtkSmartPointer<vtkTransformPolyDataFilter>::New();
|
||||||
transform_filter->SetTransform(transform);
|
transform_filter->SetTransform(transform);
|
||||||
transform_filter->SetInputConnection(polydata->GetProducerPort());
|
transform_filter->SetInputConnection(algorithm_output_port);
|
||||||
transform_filter->Update();
|
transform_filter->Update();
|
||||||
return transform_filter->GetOutput();
|
return transform_filter->GetOutput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static vtkSmartPointer<vtkPolyData> TransformPolydata(vtkSmartPointer<vtkPolyData> polydata, const Affine3d& pose)
|
||||||
|
{
|
||||||
|
return TransformPolydata(polydata->GetProducerPort(), pose);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user