Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors how points are managed and drawn in the plotting examples, standardizing the use of the
Plot2Dclass and simplifying point rendering logic. The changes remove manual array management of points, instead leveragingPlot2D'spoint_cellfor storage and rendering. Additionally, the resource management inPlot2Dis updated to use automatic stack allocation rather than raw pointers.Refactoring and simplification of plotting logic:
Pointobjects with the use ofPlot2D::point_cellfor storing and managing points inExamples/Curve Bezier/Graphite.cppandExamples/Sin/Graphite.cpp. Drawing is now handled by a single call toplot.draw(), removing explicit loops over points. [1] [2] [3] [4] [5] [6]Examples/Plots/Graphite.cppto useplot.point_cellfor consistent point management.Code cleanup and dependency management:
Plot2D.h,Math.h, andstdio.hfrom example files, reducing dependencies and improving clarity. [1] [2] [3]Resource management and rendering improvements in
Plot2D:Plot2Dto use stack-allocatedMeshandDrawShaderobjects instead of raw pointers, simplifying construction, destruction, and usage of these objects. [1] [2] [3] [4]drawPointmethod to use the new stack-allocated objects and modernized method calls (e.g., usingshader.bind()instead ofshader->bind()).These changes collectively make the plotting code more robust, easier to maintain, and less error-prone by leveraging higher-level abstractions and modern C++ practices.