Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pangolin::Plotter change linewidth #934

Open
Neoyning opened this issue May 31, 2024 · 3 comments
Open

pangolin::Plotter change linewidth #934

Neoyning opened this issue May 31, 2024 · 3 comments

Comments

@Neoyning
Copy link

Hi,

I am using pangolin::Plotter for plotting figures, notice that there are solid line, dashed line, and dotted line for line style. Is there an option for changing the line width of the plot?

Thanks

@christian-rauch
Copy link
Collaborator

There is no parameter that you can change at runtime. You need to add a glLineWidth() with your desired line width before glDrawArrays here:

if(shouldRender) {
// Draw geometry
glDrawArrays(ps.drawing_mode, 0, (GLsizei)block->Samples());
ps.used = true;
}

E.g. with glLineWidth(i*3); I get:
Bildschirmfoto vom 2024-06-10 21-45-33

It would be nice to have a runtime option for this. Interested in sending a PR? :-)

@lvllvl
Copy link

lvllvl commented Nov 10, 2024

Hi @christian-rauch I'd like to try and contribute a solution for this but I want to run my approach by you first. Here's the initial plan:

Proposed solution

  1. Add a runtime option: Introduce a runtime parameter for setting line width where the glDrawArrays function is used.
  2. New variable/method: possibly add a new variable or method in the pangolin::Plotter class to allow users to specify line width dynamically
  3. Dynamic line width with glLineWidth(): Use glLineWidth() with this new parameter, enabling dynamic line width adjustment based on user input.

Additional questions:

  • Are there specific design requirements I should follow when adding new runtime options in pangolin::Plotter?
  • What kind of documentation/test cases / comments should be included in this PR
  • Is there a specific way to handle defaults? e.g., a specific default line width

@christian-rauch
Copy link
Collaborator

If this becomes an option for the plotting, it should be per plot and not just change all the line widths. This needs to be synchronised with the pangolin::DataLog, i.e. every data sequence needs its own settings. The defaults should of course stay as they are now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants