 |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Go to the documentation of this file.
26 #include <vtkSmartPointer.h>
30 class vtkRenderWindow;
31 class vtkRenderWindowInteractor;
32 #if VTK_MAJOR_VERSION >= 6
34 class vtkImageSliceMapper;
46 ImageVis(
const std::string& viewerName,
bool autoInit =
false);
58 void setRenderWindowInteractor(
68 bool contains(
const std::string&
id)
const;
70 Layer* getLayer(
const std::string&
id);
71 void changeOpacity(
double opacity,
const std::string& viewID);
72 void hideShowActors(
bool visibility,
const std::string& viewID);
77 void removeLayer(
const std::string& layer_id);
87 LayerMap::iterator createLayer(
const std::string& layer_id,
93 bool fill_box =
true);
95 void addRGBImage(
const QImage& qimage,
98 const std::string& layer_id,
99 double opacity = 1.0);
106 void addQImage(
const QImage& qimage,
107 const std::string& layer_id =
"image",
108 double opacity = 1.0);
110 bool addText(
unsigned int x,
112 const std::string& text_string,
116 const std::string& layer_id =
"line",
117 double opacity = 1.0,
122 void enable2Dviewer(
bool state);
124 std::string pickItem(
int x,
int y);
127 void mouseEventProcess(
const pcl::visualization::MouseEvent&
event,
129 boost::signals2::connection m_mouseConnection;
130 std::string pickItem(
const pcl::visualization::MouseEvent&
event);
133 static void WindowResizeCallback(vtkObject* caller,
134 unsigned long eventId,
137 void onWindowResize();
138 void updateImageScales();
139 #if VTK_MAJOR_VERSION >= 6
140 void updateImageSliceTransform(vtkImageSlice* imageSlice,
148 void setImageInteractorStyle();
159 struct CameraParams {
160 bool parallelProjection;
161 double focalPoint[3];
165 double parallelScale;
166 double clippingRange[2];
168 CameraParams m_originalCameraParams;
169 bool m_cameraParamsSaved;
173 unsigned originalWidth;
174 unsigned originalHeight;
175 #if VTK_MAJOR_VERSION >= 6
180 std::map<std::string, ImageInfo> m_imageInfoMap;
Definition: MaterialConverter.h:18
void setRenderWindowInteractor(vtkSmartPointer< vtkRenderWindowInteractor > interactor)
Definition: ImageVis.cpp:212
LayerMap layer_map_
Internal list with different 2D layers shapes.
Definition: image_viewer.h:1131
normal_z x
Definition: my_point_types.h:165
vtkSmartPointer< vtkRenderer > getRender()
The renderer.
Definition: ImageVis.cpp:239
vtkRenderWindowInteractor * vtkRenderWindowInteractorFixNew()
Definition: vtkRenderWindowInteractorFix.cpp:19
bool addText(unsigned int x, unsigned int y, const std::string &text_string, double r, double g, double b, const std::string &layer_id="line", double opacity=1.0, int fontSize=10, bool bold=false)
Definition: ImageVis.cpp:528
void enable2Dviewer(bool state)
Definition: ImageVis.cpp:128
void changeOpacity(double opacity, const std::string &viewID)
Definition: ImageVis.cpp:301
static bool PrintVerbose(const char *format,...)
Prints out a verbose formatted message in console.
Definition: CVLog.cpp:103
math::float3 position
Definition: LineSetBuffers.cpp:44
static bool Print(const char *format,...)
Prints out a formatted message in console.
Definition: CVLog.cpp:113
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
LayerMap::iterator createLayer(const std::string &layer_id, int x, int y, int width, int height, double opacity=0.5, bool fill_box=true)
Add a new 2D rendering layer to the viewer.
Definition: ImageVis.cpp:381
void addQImage(const QImage &qimage, const std::string &layer_id="image", double opacity=1.0)
Add a QImage directly (ParaView-style, using vtkQImageToImageSource).
Definition: ImageVis.cpp:522
void setRenderWindow(vtkSmartPointer< vtkRenderWindow > win)
Definition: ImageVis.cpp:195
vtkSmartPointer< vtkRenderWindowInteractor > getRenderWindowInteractor()
Definition: ImageVis.cpp:208
void resetStoppedFlag()
Set the stopped flag back to false.
Definition: image_viewer.h:1010
Definition: CustomContextItem.cpp:18
vtkSmartPointer< ExitCallback > exit_callback_
Definition: image_viewer.h:1098
std::string pickItem(int x, int y)
Definition: ImageVis.cpp:170
Definition: ImageVis.h:38
int width
Definition: FileIOFactory.cpp:142
bool contains(const std::string &id) const
Check if the image with the given id was already added to this visualizer.
Definition: ImageVis.cpp:246
ImGuiContext * context
Definition: Window.cpp:76
int height
Definition: FileIOFactory.cpp:143
void removeLayer(const std::string &layer_id)
Remove a layer from the viewer.
Definition: ImageVis.cpp:335
normal_z y
Definition: my_point_types.h:168
MouseEvent event
Definition: BitmapWindowSystem.cpp:61
std::shared_ptr< ImageVis > ImageVisPtr
Definition: ImageVis.h:183
void hideShowActors(bool visibility, const std::string &viewID)
Definition: ImageVis.cpp:275
void setRender(vtkSmartPointer< vtkRenderer > render)
Definition: ImageVis.cpp:241
Definition: image_viewer.h:1141
int timer_id_
Global timer ID. Used in destructor only.
Definition: image_viewer.h:1125
vtkSmartPointer< vtkImageViewer > image_viewer_
The ImageViewer widget.
Definition: image_viewer.h:1101
vtkSmartPointer< ImageViewerInteractorStyle > interactor_style_
The interactor style.
Definition: image_viewer.h:1113
void addRGBImage(const QImage &qimage, unsigned x, unsigned y, const std::string &layer_id, double opacity=1.0)
Definition: ImageVis.cpp:415
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
vtkSmartPointer< vtkContextActor > actor
Definition: image_viewer.h:1066
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
Definition: CVLog.cpp:133
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15
int * getSize()
Return the window size in pixels.
Definition: image_viewer.cpp:1061
std::string layer_name
Definition: image_viewer.h:1067
Internal structure describing a layer.
Definition: image_viewer.h:1064
vtkSmartPointer< vtkRenderer > ren_
The renderer.
Definition: image_viewer.h:1107
Layer * getLayer(const std::string &id)
Definition: ImageVis.cpp:265
vtkSmartPointer< vtkRenderWindowInteractor > interactor_
Definition: image_viewer.h:1091
Definition: pcl_context_item.h:82
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
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 setupInteractor(vtkSmartPointer< vtkRenderWindowInteractor > interactor, vtkSmartPointer< vtkRenderWindow > win)
Set up our unique PCL interactor style for a given vtkRenderWindowInteractor object attached to a giv...
Definition: ImageVis.cpp:116
vtkSmartPointer< vtkRenderWindow > getRenderWindow()
Definition: ImageVis.cpp:112
Generic visualizer 2D interface.
Definition: ecvGenericVisualizer2D.h:13
vtkSmartPointer< vtkRenderWindow > win_
The render window.
Definition: image_viewer.h:1104