cv-plot icon indicating copy to clipboard operation
cv-plot copied to clipboard

Cannot navigate

Open minglok943 opened this issue 2 years ago • 3 comments

I use the header only integration method. Adding -I./inc in Makefile to compile CvPlot library. But I cannot navigate on any windows of plot. Could you help?

minglok943 avatar Mar 05 '22 07:03 minglok943

Are you using cv::imshow() maybe? Mouse navigation requires CvPlot::show(). If that does not help, please give a minimal complete example.

wpalfi avatar Mar 05 '22 10:03 wpalfi

~/Desktop/OpencvC++/myPlot$ tree
.
├── inc
│   └── CvPlot
│       ├── core
│       │   ├── Axes.h
│       │   ├── DrawableDeque.h
│       │   ├── Drawable.h
│       │   ├── makeAxes.h
│       │   ├── Projection.h
│       │   ├── RenderTarget.h
│       │   └── Transformation.h
│       ├── core.h
│       ├── cvplot.h
│       ├── drawables
│       │   ├── Border.h
│       │   ├── Group.h
│       │   ├── HorizontalGrid.h
│       │   ├── HorizontalLine.h
│       │   ├── Image.h
│       │   ├── LineBase.h
│       │   ├── LineType.h
│       │   ├── MarkerType.h
│       │   ├── Series.h
│       │   ├── Title.h
│       │   ├── VerticalGrid.h
│       │   ├── VerticalLine.h
│       │   ├── XAxis.h
│       │   ├── XLabel.h
│       │   ├── YAxis.h
│       │   └── YLabel.h
│       ├── gui
│       │   ├── MouseAdapter.h
│       │   ├── MouseEvent.h
│       │   ├── show.h
│       │   └── Window.h
│       ├── gui.h
│       ├── imp
│       │   ├── Axes.ipp
│       │   ├── Border.ipp
│       │   ├── cvplot.ipp
│       │   ├── DrawableDeque.ipp
│       │   ├── Drawable.ipp
│       │   ├── Group.ipp
│       │   ├── HorizontalGrid.ipp
│       │   ├── HorizontalLine.ipp
│       │   ├── Image.ipp
│       │   ├── LineBase.ipp
│       │   ├── makeAxes.ipp
│       │   ├── MouseAdapter.ipp
│       │   ├── Series.ipp
│       │   ├── Title.ipp
│       │   ├── util.ipp
│       │   ├── version.ipp
│       │   ├── VerticalGrid.ipp
│       │   ├── VerticalLine.ipp
│       │   ├── XAxis.ipp
│       │   ├── XLabel.ipp
│       │   ├── YAxis.ipp
│       │   └── YLabel.ipp
│       ├── Internal
│       │   ├── LinearProjection.h
│       │   ├── no_warning.h
│       │   ├── Pimpl.h
│       │   ├── RawProjection.h
│       │   └── util.h
│       ├── libdef.h
│       └── version.h
├── main.cpp
├── Makefile
└── tune

This is my directory

#define CVPLOT_HEADER_ONLY
#include "CvPlot/cvplot.h"


using namespace cv;
using namespace std;

int main(int argc, char **argv)
{
	auto axes = CvPlot::plot(std::vector<double>{ 3, 3, 4, 6, 4, 3 }, "-o");
	cv::Mat mat = axes.render(300, 400);
	CvPlot::show("mywindow", axes);

	return 0;
}

This is my code

CC = "g++"
PROJECT = tune
SRC = main.cpp

LIBS = `pkg-config opencv4 --cflags --libs`

$(PROJECT) : $(SRC)
	$(CC) $(SRC) $(LIBS) -I./inc -o $(PROJECT) 

This is my Makefile

minglok943 avatar Mar 05 '22 11:03 minglok943

I tried your example and it works fine on Ubuntu (WSL2) with mouse navigation. Maybe you want to set a breakpoint here https://github.com/Profactor/cv-plot/blob/64281a2541aa23bcc3a138d5f2effcfe2a6cd2b8/CvPlot/inc/CvPlot/gui/Window.h#L144 and/or here https://github.com/Profactor/cv-plot/blob/64281a2541aa23bcc3a138d5f2effcfe2a6cd2b8/CvPlot/inc/CvPlot/gui/Window.h#L145 to see what's going wrong?

wpalfi avatar Mar 11 '22 09:03 wpalfi