sphere widget implementation

This commit is contained in:
ozantonkal
2013-07-04 16:32:06 +03:00
parent 3d3e3fd470
commit d80a965f97
3 changed files with 34 additions and 2 deletions

View File

@@ -66,5 +66,27 @@ temp_viz::PlaneWidget::PlaneWidget(const Vec4f& coefs, const Point3f& pt, const
vtkSmartPointer<vtkLODActor> actor = WidgetAccessor::getActor(*this);
actor->SetMapper(mapper);
setColor(color);
}
///////////////////////////////////////////////////////////////////////////////////////////////
/// sphere widget implementation
temp_viz::SphereWidget::SphereWidget(const cv::Point3f &center, float radius, int sphere_resolution, const Color &color)
{
vtkSmartPointer<vtkSphereSource> sphere = vtkSmartPointer<vtkSphereSource>::New ();
sphere->SetRadius (radius);
sphere->SetCenter (center.x, center.y, center.z);
sphere->SetPhiResolution (sphere_resolution);
sphere->SetThetaResolution (sphere_resolution);
sphere->LatLongTessellationOff ();
sphere->Update ();
vtkSmartPointer<vtkDataSetMapper> mapper = vtkSmartPointer<vtkDataSetMapper>::New ();
mapper->SetInput(sphere->GetOutput ());
vtkSmartPointer<vtkLODActor> actor = WidgetAccessor::getActor(*this);
actor->SetMapper(mapper);
setColor(color);
}