Skip to content

Cannot navigate  #28

Open
Open

Description

@minglok943

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?

Activity

  1. wpalfi commented on Mar 5, 2022

    @wpalfi
    Contributor

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

  2. minglok943 commented on Mar 5, 2022

    @minglok943
    Author
    ~/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

  3. wpalfi commented on Mar 11, 2022

    @wpalfi
    Contributor

    I tried your example and it works fine on Ubuntu (WSL2) with mouse navigation. Maybe you want to set a breakpoint here

    cv::setMouseCallback(_windowName, [](int event, int x, int y, int flags, void* userdata) {

    and/or here
    Window& window = *static_cast<Window*>(userdata);

    to see what's going wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions