Skip to content

[Feature] ImPlot3DSpec #166

Description

@brenocq

Feature description
As discussed in epezent/implot#519 and epezent/implot#330, ImPlot will soon migrate to a new styling method called ImPlotSpec, this style is a quality of life improvement to allow the user to more easily define the plot style (color, weight, etc).

Previously, ImPlot3D relied on the Push/Pop style and SetNext style

ImVec4 green(0, 1, 0, 1);

// Push/Pop style
ImPlot3D::PushStyleColor(ImPlotCol_Line, green);
ImPlot3D::PlotLine("Green Line", x, y, z, size);
ImPlot3D::PopStyleColor();

// SetNext style
ImPlot3D::SetNextLineStyle(green);
ImPlot3D::PlotLine("Green Line", x, y, z, size);

The new Spec style will look like the following:

ImPlot3DSpec spec;
spec.LineColor = green;
ImPlot3D::PlotLine("Green Line", x, y, z, size, spec);

// Or
ImPlot3D::PlotLine("Green Line", x, y, z, size, {
    ImPlot3DProp_LineColor, green,
});

Tasks

  • Define ImPlot3DProps
  • Create ImPlot3DSpec struct
  • Migrate examples to spec styling

Activity

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

Metadata

Metadata

Assignees

Labels

prio:highHigh prioritystatus:doneTask completed successfullytype:featNew feature or request

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions