openGLPlotLive icon indicating copy to clipboard operation
openGLPlotLive copied to clipboard

Exception unhandled

Open pisyakot opened this issue 3 years ago • 4 comments

class AxesArea { std::vector interactorDataX = {}; std::vector interactorDataY = {};

std::vector zoomBoxX = {}; std::vector zoomBoxY = {}; }

// Create Plot myplot = std::make_sharedGLPL::Plot(0.0, 0.0, 1.0, 1.0, getParentDimensions(), 2, 2); std::shared_ptrGLPL::IDrawable myPlotPt = std::dynamic_pointer_castGLPL::IDrawable(myplot); addPlot(myPlotPt);

Crash interactorLine = std::make_shared<Line2D2Vecs>(&interactorDataX, &interactorDataY, newParentPointers);

Line2D2Vecs::Line2D2Vecs() { createAndSetupBuffers(vertDataSizeBytes, indicesDataSizeBytes, &internalData[0], &internalIndices[0], }

because internalData[0] empty, how it works?

pisyakot avatar Dec 15 '22 18:12 pisyakot

I don't seem to be able to reproduce the crash.

So that I can understand what you have run, you're not redefining the AxesArea class, right? Under the create plot section, the addPlot function should be called using a window created further up.

It seems I can force internalData[0] to be a nullptr by starting with an empty vector, but that doesn't seem to cause a crash at that line (though maybe this should be cleaned up regardless).

There's example usage in https://github.com/tbattz/openGLPlotLive/blob/master/apps/examplePlot.cpp, have a look at that and let me know if that helps, or provide a full example to reproduce the issue.

On a side note, what system are you trying to run this on?

tbattz avatar Dec 16 '22 09:12 tbattz

Thanks for response. I`m trying to port this for wxWidgets (win32 visual studio 2022) and yes, i use examplePlot.cpp as example. I will try to compile your examplePlot for glfw.

pisyakot avatar Dec 16 '22 10:12 pisyakot

So I tried to compile your example and still the same error Changing some places like this internalData.data() and // Calculate log widths for(unsigned int i=1; i < 10; ++i) {

and it`s work

pisyakot avatar Dec 19 '22 22:12 pisyakot

I'm still a little confused, so you're trying to embed a plot using openGLPlotLive in a wxWidgets using a wxGLCanvas window, or using the window provied with openGLPlotLive? I'm not sure how well it'd work with the former, but there might be a way to use inheritance to make a window have both classes it needs to function correctly.

But you've now got a working plot making those changes above? Again if you could post a full sample of what you're trying to compile, I might be able to understand what's going wrong. With the log falling over, it might be related to calculating something that isn't defined for the log/that range. The internalData bit might be trying to call it on internalData that is currently empty?

tbattz avatar Dec 20 '22 11:12 tbattz