Commit baee8c3a authored by Anatoly Baksheev's avatar Anatoly Baksheev

refactored Mesh, added tests, added failing "twice spin()" test

parent 70a81db5
......@@ -65,14 +65,14 @@ namespace cv
SHADING
};
enum RenderingRepresentationProperties
enum RepresentationValues
{
REPRESENTATION_POINTS,
REPRESENTATION_WIREFRAME,
REPRESENTATION_SURFACE
};
enum ShadingRepresentationProperties
enum ShadingValues
{
SHADING_FLAT,
SHADING_GOURAUD,
......
This diff is collapsed.
......@@ -163,14 +163,14 @@ int cv::viz::vtkCloudMatSource::filterNanCopy(const Mat& cloud)
points->Allocate(cloud.total());
points->SetNumberOfPoints(cloud.total());
int cn = cloud.channels();
int s_chs = cloud.channels();
int total = 0;
for (int y = 0; y < cloud.rows; ++y)
{
const _Tp* srow = cloud.ptr<_Tp>(y);
const _Tp* send = srow + cloud.cols * cn;
const _Tp* send = srow + cloud.cols * s_chs;
for (; srow != send; srow += cn)
for (; srow != send; srow += s_chs)
if (!isNan(srow))
points->SetPoint(total++, srow);
}
......
......@@ -100,3 +100,37 @@ TEST(Viz, DISABLED_show_cloud_collection)
viz.showWidget("ccol", ccol);
viz.spin();
}
TEST(Viz, DISABLED_show_mesh)
{
Mesh3d mesh = Mesh3d::load(get_dragon_ply_file_path());
Viz3d viz("show_mesh");
viz.showWidget("coosys", WCoordinateSystem());
viz.showWidget("mesh", WMesh(mesh));
viz.spin();
}
TEST(Viz, DISABLED_show_mesh_random_colors)
{
Mesh3d mesh = Mesh3d::load(get_dragon_ply_file_path());
theRNG().fill(mesh.colors, RNG::UNIFORM, 0, 255);
Viz3d viz("show_mesh_random_color");
viz.showWidget("coosys", WCoordinateSystem());
viz.showWidget("mesh", WMesh(mesh));
viz.setRenderingProperty("mesh", SHADING, SHADING_PHONG);
viz.spin();
}
TEST(Viz, DISABLED_spin_twice_____________________________TODO_UI_BUG)
{
Mesh3d mesh = Mesh3d::load(get_dragon_ply_file_path());
Viz3d viz("spin_twice");
viz.showWidget("coosys", WCoordinateSystem());
viz.showWidget("mesh", WMesh(mesh));
viz.spin();
viz.spin();
}
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