 |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Go to the documentation of this file.
10 #include <vtkCommand.h>
11 #include <vtkSmartPointer.h>
21 virtual void Execute(vtkObject *caller,
unsigned long,
void *);
32 bool m_preview =
true;
virtual ~ImageViewer()
Destructor.
Definition: image_viewer.cpp:99
bool addText(unsigned int x, unsigned int y, const std::string &text, double r, double g, double b, const std::string &layer_id="line", double opacity=1.0)
Add a 2D text with a given color.
Definition: image_viewer.cpp:823
double colors[3]
Definition: TriangleMeshIO.cpp:53
Definition: MaterialConverter.h:18
virtual void set(float _x, float _y, float _w, float _h)
Definition: pcl_context_item.cpp:84
normal_z rgb
Definition: my_point_types.h:168
void showFloatImage(const float *data, unsigned int width, unsigned int height, float min_value=std::numeric_limits< float >::min(), float max_value=std::numeric_limits< float >::max(), bool grayscale=false, const std::string &layer_id="float_image", double opacity=1.0)
Show a 2D image (float) on screen.
Definition: image_viewer.cpp:264
bool Paint(vtkContext2D *painter) override
Definition: pcl_context_item.cpp:177
bool Paint(vtkContext2D *painter) override
Definition: pcl_context_item.cpp:236
void setColors(unsigned char r, unsigned char g, unsigned char b)
Definition: pcl_context_item.cpp:41
normal_z x
Definition: my_point_types.h:165
virtual void set(float _x, float _y, float _r)
Definition: pcl_context_item.cpp:73
void showAngleImage(const float *data, unsigned width, unsigned height, const std::string &layer_id="angle_image", double opacity=1.0)
Show a 2D image on screen representing angle data.
Definition: image_viewer.cpp:291
vtkRenderWindowInteractor * vtkRenderWindowInteractorFixNew()
Definition: vtkRenderWindowInteractorFix.cpp:19
PCLContextImageItem()
Definition: pcl_context_item.cpp:254
bool addFilledRectangle(unsigned int x_min, unsigned int x_max, unsigned int y_min, unsigned int y_max, const std::string &layer_id="boxes", double opacity=0.5)
Add a 2D box and fill it in with a given color.
Definition: image_viewer.cpp:676
void showRGBImage(const unsigned char *data, unsigned width, unsigned height, const std::string &layer_id="rgb_image", double opacity=1.0)
Show a 2D RGB image on screen.
Definition: image_viewer.cpp:141
GraphType data
Definition: graph_cut.cc:138
void setSize(int xw, int yw)
Set the window size in screen coordinates.
Definition: image_viewer.cpp:1064
void emitKeyboardEvent(unsigned long event_id)
Fire up a keyboard event with a specified event ID.
Definition: image_viewer.cpp:499
bool addRectangle(const pcl::PointXY &min_pt, const pcl::PointXY &max_pt, const std::string &layer_id="rectangles", double opacity=1.0)
Add a 2D box and color its edges with a given color.
Definition: image_viewer.cpp:768
void OnChar() override
Definition: image_viewer.cpp:983
vtkStandardNewMacro(Point)
ImageViewer is a class for 2D image visualization.
Definition: image_viewer.h:83
void removeLayer(const std::string &layer_id)
Remove a 2D layer given by its ID.
Definition: image_viewer.cpp:577
void resetStoppedFlag()
Set the stopped flag back to false.
Definition: image_viewer.h:1010
ImageViewerInteractorStyle()
Definition: image_viewer.cpp:980
Definition: WidgetMap.h:20
vtkSmartPointer< ExitCallback > exit_callback_
Definition: image_viewer.h:1098
Eigen::Array< unsigned char, 3, 1 > Vector3ub
Definition: image_viewer.h:32
static void MouseCallback(vtkObject *, unsigned long eid, void *clientdata, void *calldata)
Definition: image_viewer.cpp:509
void OnLeftButtonDown() override
Definition: image_viewer.cpp:1025
unsigned char colors[3]
Definition: pcl_context_item.h:33
vtkSmartPointer< vtkCallbackCommand > keyboard_command_
Definition: image_viewer.h:1093
vtkRenderWindowInteractor * vtkRenderWindowInteractorFixNew()
Definition: vtkRenderWindowInteractorFix.cpp:19
bool addCircle(unsigned int x, unsigned int y, double radius, const std::string &layer_id="circles", double opacity=1.0)
Add a circle shape from a point and a radius.
Definition: image_viewer.cpp:629
void addRGBImage(const unsigned char *data, unsigned width, unsigned height, const std::string &layer_id="rgb_image", double opacity=1.0, bool autoresize=true)
Add an RGB 2D image layer, but do not render it (use spin/spinOnce to update).
Definition: image_viewer.cpp:104
int width
Definition: FileIOFactory.cpp:142
An image viewer interactor style, tailored for ImageViewer.
Definition: image_viewer.h:41
bool addLine(unsigned int x_min, unsigned int y_min, unsigned int x_max, unsigned int y_max, double r, double g, double b, const std::string &layer_id="line", double opacity=1.0)
Add a 2D line with a given color.
Definition: image_viewer.cpp:776
int size
Definition: FileIOFactory.cpp:130
int height
Definition: FileIOFactory.cpp:143
void set(float _x, float _y, vtkImageData *_image)
Definition: pcl_context_item.cpp:50
normal_z y
Definition: my_point_types.h:168
bool Paint(vtkContext2D *painter) override
Definition: pcl_context_item.cpp:207
MouseEvent event
Definition: BitmapWindowSystem.cpp:61
void markPoint(std::size_t u, std::size_t v, Vector3ub fg_color, Vector3ub bg_color=red_color, double radius=3.0, const std::string &layer_id="points", double opacity=1.0)
Sets the pixel at coordinates(u,v) to color while setting the neighborhood to another.
Definition: image_viewer.cpp:866
bool Paint(vtkContext2D *painter) override
Definition: pcl_context_item.cpp:118
virtual void set(float _x, float _y)
Definition: pcl_context_item.cpp:66
virtual void set(float x, float y, const std::string &_text)
Definition: pcl_context_item.cpp:108
Definition: image_viewer.h:1141
void addAngleImage(const float *data, unsigned width, unsigned height, const std::string &layer_id="angle_image", double opacity=1.0)
Add an angle 2D image layer, but do not render it (use spin/spinOnce to update).
Definition: image_viewer.cpp:279
static void KeyboardCallback(vtkObject *, unsigned long eid, void *clientdata, void *calldata)
Definition: image_viewer.cpp:518
void addFloatImage(const float *data, unsigned int width, unsigned int height, float min_value=std::numeric_limits< float >::min(), float max_value=std::numeric_limits< float >::max(), bool grayscale=false, const std::string &layer_id="float_image", double opacity=1.0)
Add a float 2D image layer, but do not render it (use spin/spinOnce to update).
Definition: image_viewer.cpp:249
void spin()
Spin method. Calls the interactor and runs an internal loop.
Definition: image_viewer.cpp:357
bool Paint(vtkContext2D *painter) override
Definition: pcl_context_item.cpp:189
vtkSmartPointer< vtkImageFlip > algo_
Image reslice, used for flipping the image.
Definition: image_viewer.h:1134
bool Paint(vtkContext2D *painter) override
Definition: pcl_context_item.cpp:142
virtual void set(float _x_1, float _y_1, float _x_2, float _y_2)
Definition: pcl_context_item.cpp:96
void markPoints(const std::vector< int > &uv, Vector3ub fg_color, Vector3ub bg_color=red_color, double size=3.0, const std::string &layer_id="markers", double opacity=1.0)
Sets the pixel at coordinates(u,v) to color while setting the neighborhood to another.
Definition: image_viewer.cpp:905
std::shared_ptr< core::Tensor > image
Definition: FilamentRenderer.cpp:184
bool Paint(vtkContext2D *painter) override
Definition: pcl_context_item.cpp:168
std::function< void(std::shared_ptr< core::Tensor >)> callback
Definition: FilamentRenderer.cpp:183
void convertIntensityCloud8uToUChar(const pcl::PointCloud< pcl::Intensity8u > &cloud, boost::shared_array< unsigned char > data)
Convert the Intensity8u information in a PointCloud<Intensity8u> to an unsigned char array.
Definition: image_viewer.cpp:969
LayerMap::iterator createLayer(const std::string &layer_id, int width, int height, double opacity=0.5, bool fill_box=true)
Add a new 2D rendering layer to the viewer.
Definition: image_viewer.cpp:528
Eigen::Vector3d origin
Definition: VoxelGridIO.cpp:26
void spinOnce(int time=1, bool force_redraw=true)
Spin once method. Calls the interactor and updates the screen once.
Definition: image_viewer.cpp:366
ImageViewer(const std::string &window_title="")
Constructor.
Definition: image_viewer.cpp:28
vtkSmartPointer< vtkCallbackCommand > mouse_command_
Definition: image_viewer.h:1092
void addShortImage(const unsigned short *short_image, unsigned int width, unsigned int height, unsigned short min_value=std::numeric_limits< unsigned short >::min(), unsigned short max_value=std::numeric_limits< unsigned short >::max(), bool grayscale=false, const std::string &layer_id="short_image", double opacity=1.0)
Add a short 2D image layer, but do not render it (use spin/spinOnce to update).
Definition: image_viewer.cpp:326
vtkSmartPointer< ImageViewerInteractorStyle > interactor_style_
The interactor style.
Definition: image_viewer.h:1113
vtkSmartPointer< vtkImageSlice > slice_
Global prop. This is the actual "actor".
Definition: image_viewer.h:1110
void render()
Trigger a render call.
Definition: image_viewer.cpp:952
bool Paint(vtkContext2D *painter) override
Definition: pcl_context_item.cpp:198
void Execute(const ccPointCloud &pcd, std::shared_ptr< ccMesh > &out_mesh, std::vector< double > &out_densities, int depth, size_t width, float scale, bool linear_fit, float point_weight, float samples_per_node, UIntPack< FEMSigs... >)
Definition: SurfaceReconstructionPoisson.cpp:437
vtkSmartPointer< vtkContextActor > actor
Definition: image_viewer.h:1066
void setPosition(int x, int y)
Set the position in screen coordinates.
Definition: image_viewer.cpp:1056
math::float2 uv
Definition: PointCloudBuffers.cpp:51
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15
std::vector< Eigen::Vector3f > Points
Definition: FastGlobalRegistration.h:13
void setPointColors(unsigned char r, unsigned char g, unsigned char b)
Definition: pcl_context_item.cpp:222
boost::signals2::connection registerKeyboardCallback(void(*callback)(const pcl::visualization::KeyboardEvent &, void *), void *cookie=nullptr)
Register a callback function for keyboard events.
Definition: image_viewer.h:488
int * getSize()
Return the window size in pixels.
Definition: image_viewer.cpp:1061
void showShortImage(const unsigned short *short_image, unsigned int width, unsigned int height, unsigned short min_value=std::numeric_limits< unsigned short >::min(), unsigned short max_value=std::numeric_limits< unsigned short >::max(), bool grayscale=false, const std::string &layer_id="short_image", double opacity=1.0)
Show a 2D image (unsigned short) on screen.
Definition: image_viewer.cpp:342
void showMonoImage(const unsigned char *data, unsigned width, unsigned height, const std::string &layer_id="mono_image", double opacity=1.0)
Show a monochrome 2D image on screen.
Definition: image_viewer.cpp:188
void DrawImage(vtkImageData *image)
Definition: pcl_image_canvas_source_2d.cpp:20
void addHalfAngleImage(const float *data, unsigned width, unsigned height, const std::string &layer_id="half_angle_image", double opacity=1.0)
Add a half angle 2D image layer, but do not render it (use spin/spinOnce to update).
Definition: image_viewer.cpp:302
std::string layer_name
Definition: image_viewer.h:1067
Unit circle.
Definition: ccMouseCircle.cpp:17
Internal structure describing a layer.
Definition: image_viewer.h:1064
bool addLayer(const std::string &layer_id, int width, int height, double opacity=0.5)
Add a new 2D rendering layer to the viewer.
Definition: image_viewer.cpp:555
void showHalfAngleImage(const float *data, unsigned width, unsigned height, const std::string &layer_id="half_angle_image", double opacity=1.0)
Show a 2D image on screen representing half angle data.
Definition: image_viewer.cpp:315
bool Paint(vtkContext2D *painter) override
Definition: pcl_context_item.cpp:130
void emitMouseEvent(unsigned long event_id)
Fire up a mouse event with a specified event ID.
Definition: image_viewer.cpp:427
void addMonoImage(const unsigned char *data, unsigned width, unsigned height, const std::string &layer_id="mono_image", double opacity=1.0)
Add a monochrome 2D image layer, but do not render it (use spin/spinOnce to update).
Definition: image_viewer.cpp:152
vtkSmartPointer< vtkRenderer > ren_
The renderer.
Definition: image_viewer.h:1107
vtkSmartPointer< vtkRenderWindowInteractor > interactor_
Definition: image_viewer.h:1091
boost::signals2::connection registerMouseCallback(void(*callback)(const pcl::visualization::MouseEvent &, void *), void *cookie=nullptr)
Register a callback std::function for mouse events.
Definition: image_viewer.h:530
void adjustCamera(vtkImageData *image, vtkRenderer *ren)
Definition: image_viewer.cpp:991
vtkSmartPointer< ExitMainLoopTimerCallback > exit_main_loop_timer_callback_
Callback object enabling us to leave the main loop, when a timer fires.
Definition: image_viewer.h:1097
void setWindowTitle(const std::string &name)
Set the window title name.
Definition: image_viewer.cpp:1051
bool Paint(vtkContext2D *painter) override
Definition: pcl_context_item.cpp:155
bool Paint(vtkContext2D *painter) override
Definition: pcl_context_item.cpp:59
vtkStandardNewMacro(ImageViewerInteractorStyle)
std::string name
Definition: FileIOFactory.cpp:129
vtkSmartPointer< vtkRenderWindow > win_
The render window.
Definition: image_viewer.h:1104
void convertIntensityCloudToUChar(const pcl::PointCloud< pcl::Intensity > &cloud, boost::shared_array< unsigned char > data)
Convert the Intensity information in a PointCloud<Intensity> to an unsigned char array.
Definition: image_viewer.cpp:959