public:
CylinderWidget(const Point3f& pt_on_axis, const Point3f& axis_direction, double radius, int numsides = 30, const Color &color = Color::white());
};
+
+ class CV_EXPORTS CubeWidget : public Widget
+ {
+ public:
+ CubeWidget(const Point3f& pt_min, const Point3f& pt_max, const Color &color = Color::white());
+ };
}
setColor(color);
}
+
+///////////////////////////////////////////////////////////////////////////////////////////////
+/// cylinder widget implementation
+
+temp_viz::CubeWidget::CubeWidget(const Point3f& pt_min, const Point3f& pt_max, const Color &color)
+{
+ vtkSmartPointer<vtkCubeSource> cube = vtkSmartPointer<vtkCubeSource>::New ();
+ cube->SetBounds (pt_min.x, pt_max.x, pt_min.y, pt_max.y, pt_min.z, pt_max.z);
+
+ vtkSmartPointer<vtkDataSetMapper> mapper = vtkSmartPointer<vtkDataSetMapper>::New ();
+ mapper->SetInput(cube->GetOutput ());
+
+ vtkSmartPointer<vtkLODActor> actor = WidgetAccessor::getActor(*this);
+ actor->SetMapper(mapper);
+
+ setColor(color);
+}
temp_viz::ArrowWidget aw(cv::Point3f(0,0,0), cv::Point3f(1,1,1), temp_viz::Color(255,0,0));
temp_viz::CircleWidget cw(cv::Point3f(0,0,0), 1.0, temp_viz::Color(0,255,0));
temp_viz::CylinderWidget cyw(cv::Point3f(0,0,0), cv::Point3f(-1,-1,-1), 0.5, 30, temp_viz::Color(0,255,0));
+ temp_viz::CubeWidget cuw(cv::Point3f(-2,-2,-2), cv::Point3f(-1,-1,-1), temp_viz::Color(0,0,255));
v.showWidget("line", lw);
v.showWidget("plane", pw);
v.showWidget("arrow", aw);
v.showWidget("circle", cw);
v.showWidget("cylinder", cyw);
+ v.showWidget("cube", cuw);
temp_viz::LineWidget lw2 = lw;
cw.setPose(cloudPosition);
cyw.setPose(cloudPosition);
lw.setPose(cloudPosition);
+ cuw.setPose(cloudPosition);
angle_x += 0.1f;
angle_y -= 0.1f;