Commit d394e233 authored by ozantonkal's avatar ozantonkal

cube widget wireframe

parent 653eda45
...@@ -81,7 +81,7 @@ namespace temp_viz ...@@ -81,7 +81,7 @@ namespace temp_viz
class CV_EXPORTS CubeWidget : public Widget class CV_EXPORTS CubeWidget : public Widget
{ {
public: public:
CubeWidget(const Point3f& pt_min, const Point3f& pt_max, const Color &color = Color::white()); CubeWidget(const Point3f& pt_min, const Point3f& pt_max, bool wire_frame = true, const Color &color = Color::white());
}; };
class CV_EXPORTS CoordinateSystemWidget : public Widget class CV_EXPORTS CoordinateSystemWidget : public Widget
......
...@@ -211,7 +211,7 @@ temp_viz::CylinderWidget::CylinderWidget(const Point3f& pt_on_axis, const Point3 ...@@ -211,7 +211,7 @@ temp_viz::CylinderWidget::CylinderWidget(const Point3f& pt_on_axis, const Point3
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
/// cylinder widget implementation /// cylinder widget implementation
temp_viz::CubeWidget::CubeWidget(const Point3f& pt_min, const Point3f& pt_max, const Color &color) temp_viz::CubeWidget::CubeWidget(const Point3f& pt_min, const Point3f& pt_max, bool wire_frame, const Color &color)
{ {
vtkSmartPointer<vtkCubeSource> cube = vtkSmartPointer<vtkCubeSource>::New (); 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); cube->SetBounds (pt_min.x, pt_max.x, pt_min.y, pt_max.y, pt_min.z, pt_max.z);
...@@ -222,6 +222,9 @@ temp_viz::CubeWidget::CubeWidget(const Point3f& pt_min, const Point3f& pt_max, c ...@@ -222,6 +222,9 @@ temp_viz::CubeWidget::CubeWidget(const Point3f& pt_min, const Point3f& pt_max, c
vtkSmartPointer<vtkLODActor> actor = vtkLODActor::SafeDownCast(WidgetAccessor::getActor(*this)); vtkSmartPointer<vtkLODActor> actor = vtkLODActor::SafeDownCast(WidgetAccessor::getActor(*this));
actor->SetMapper(mapper); actor->SetMapper(mapper);
if (wire_frame)
actor->GetProperty ()->SetRepresentationToWireframe ();
setColor(color); setColor(color);
} }
......
...@@ -96,7 +96,7 @@ TEST(Viz_viz3d, accuracy) ...@@ -96,7 +96,7 @@ TEST(Viz_viz3d, accuracy)
temp_viz::ArrowWidget aw(cv::Point3f(0,0,0), cv::Point3f(1,1,1), temp_viz::Color(255,0,0)); 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), 0.5, 0.01, temp_viz::Color(0,255,0)); temp_viz::CircleWidget cw(cv::Point3f(0,0,0), 0.5, 0.01, 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::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)); temp_viz::CubeWidget cuw(cv::Point3f(-2,-2,-2), cv::Point3f(-1,-1,-1));
temp_viz::CoordinateSystemWidget csw(1.0f, cv::Affine3f::Identity()); temp_viz::CoordinateSystemWidget csw(1.0f, cv::Affine3f::Identity());
temp_viz::TextWidget tw("TEST", cv::Point2i(100,100), 20); temp_viz::TextWidget tw("TEST", cv::Point2i(100,100), 20);
...@@ -106,7 +106,7 @@ TEST(Viz_viz3d, accuracy) ...@@ -106,7 +106,7 @@ TEST(Viz_viz3d, accuracy)
// v.showWidget("arrow", aw); // v.showWidget("arrow", aw);
// v.showWidget("circle", cw); // v.showWidget("circle", cw);
// v.showWidget("cylinder", cyw); // v.showWidget("cylinder", cyw);
// v.showWidget("cube", cuw); v.showWidget("cube", cuw);
v.showWidget("coordinateSystem", csw); v.showWidget("coordinateSystem", csw);
v.showWidget("text",tw); v.showWidget("text",tw);
......
Markdown is supported
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