Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: vtk version handling in ImageViewer (PCLVisualizer) #998

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions visualization/include/pcl/visualization/impl/image_viewer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ pcl::visualization::ImageViewer::addRectangle (
if (pp_2d[i].x > max_pt_2d.x) max_pt_2d.x = pp_2d[i].x;
if (pp_2d[i].y > max_pt_2d.y) max_pt_2d.y = pp_2d[i].y;
}
#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION <= 7))
#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION <= 10))
min_pt_2d.y = float (image->height) - min_pt_2d.y;
max_pt_2d.y = float (image->height) - max_pt_2d.y;
#endif
Expand Down Expand Up @@ -334,7 +334,7 @@ pcl::visualization::ImageViewer::addRectangle (
if (pp_2d[i].x > max_pt_2d.x) max_pt_2d.x = pp_2d[i].x;
if (pp_2d[i].y > max_pt_2d.y) max_pt_2d.y = pp_2d[i].y;
}
#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION <= 7))
#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION <= 10))
min_pt_2d.y = float (image->height) - min_pt_2d.y;
max_pt_2d.y = float (image->height) - max_pt_2d.y;
#endif
Expand Down
12 changes: 6 additions & 6 deletions visualization/src/image_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ pcl::visualization::ImageViewer::addCircle (
static_cast<unsigned char> (255.0 * g),
static_cast<unsigned char> (255.0 * b));
circle->setOpacity (opacity);
#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION > 10))
#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION > 7))
circle->set (static_cast<float> (x), static_cast<float> (y), static_cast<float> (radius));
#else
circle->set (static_cast<float> (x), static_cast<float> (getSize ()[1] - y), static_cast<float> (radius));
Expand Down Expand Up @@ -732,7 +732,7 @@ pcl::visualization::ImageViewer::addFilledRectangle (
static_cast<unsigned char> (255.0 * g),
static_cast<unsigned char> (255.0 * b));
rect->setOpacity (opacity);
#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION > 10))
#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION > 7))
rect->set (static_cast<float> (x_min), static_cast<float> (y_min),
static_cast<float> (x_max - x_min), static_cast<float> (y_max - y_min));
#else
Expand Down Expand Up @@ -860,7 +860,7 @@ pcl::visualization::ImageViewer::addLine (unsigned int x_min, unsigned int y_min
static_cast<unsigned char> (255.0 * g),
static_cast<unsigned char> (255.0 * b));
line->setOpacity (opacity);
#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION > 10))
#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION > 7))
line->set (static_cast<float> (x_min), static_cast<float> (y_min),
static_cast<float> (x_max), static_cast<float> (y_max));
#else
Expand Down Expand Up @@ -904,7 +904,7 @@ pcl::visualization::ImageViewer::addText (unsigned int x, unsigned int y,
static_cast<unsigned char> (255.0 * g),
static_cast<unsigned char> (255.0 * b));
text->setOpacity (opacity);
#if ((VTK_MAJOR_VERSION == 5) && (VTKOR_VERSION > 10))
#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION > 7))
text->set (static_cast<float> (x), static_cast<float> (y), text_string);
#else
text->set (static_cast<float> (x), static_cast<float> (getSize ()[1] - y), text_string);
Expand Down Expand Up @@ -947,7 +947,7 @@ pcl::visualization::ImageViewer::markPoint (
disk->setColors (bg_color[0], bg_color[1], bg_color[2]);
disk->setOpacity (opacity);

#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION > 10))
#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION > 7))
point->set (static_cast<float> (u), static_cast<float> (v));
disk->set (static_cast<float> (u), static_cast<float> (v), static_cast<float> (radius));
#else
Expand Down Expand Up @@ -989,7 +989,7 @@ pcl::visualization::ImageViewer::markPoints (
{
PCL_DEBUG ("[pcl::visualization::ImageViewer::markPoint] No layer with ID='%s' found. Creating new one...\n", layer_id.c_str ());
am_it = createLayer (layer_id, getSize ()[0] - 1, getSize ()[1] - 1, opacity, false);
#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION > 10))
#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION > 7))
interactor_style_->adjustCamera (ren_);
#endif
}
Expand Down