MCPcopy Create free account
hub / github.com/brenocq/implot3d / SetupAxisScale

Function SetupAxisScale

implot3d.cpp:1948–1978  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1946}
1947
1948void SetupAxisScale(ImAxis3D idx, ImPlot3DScale scale) {
1949 ImPlot3DContext& gp = *GImPlot3D;
1950 IM_ASSERT_USER_ERROR(gp.CurrentPlot != nullptr && !gp.CurrentPlot->SetupLocked,
1951 "Setup needs to be called after BeginPlot and before any setup locking functions (e.g. PlotX)!");
1952 ImPlot3DPlot& plot = *gp.CurrentPlot;
1953 ImPlot3DAxis& axis = plot.Axes[idx];
1954 axis.Scale = scale;
1955 switch (scale) {
1956 case ImPlot3DScale_Log10:
1957 axis.TransformForward = TransformForward_Log10;
1958 axis.TransformInverse = TransformInverse_Log10;
1959 axis.TransformData = nullptr;
1960 axis.Locator = Locator_Log10;
1961 axis.ConstraintRange = ImPlot3DRange(FLT_MIN, INFINITY);
1962 break;
1963 case ImPlot3DScale_SymLog:
1964 axis.TransformForward = TransformForward_SymLog;
1965 axis.TransformInverse = TransformInverse_SymLog;
1966 axis.TransformData = nullptr;
1967 axis.Locator = Locator_SymLog;
1968 axis.ConstraintRange = ImPlot3DRange(-INFINITY, INFINITY);
1969 break;
1970 default:
1971 axis.TransformForward = nullptr;
1972 axis.TransformInverse = nullptr;
1973 axis.TransformData = nullptr;
1974 axis.Locator = nullptr;
1975 axis.ConstraintRange = ImPlot3DRange(-INFINITY, INFINITY);
1976 break;
1977 }
1978}
1979
1980void SetupAxisScale(ImAxis3D idx, ImPlot3DTransform forward, ImPlot3DTransform inverse, void* data) {
1981 ImPlot3DContext& gp = *GImPlot3D;

Callers 2

Demo_LogScaleFunction · 0.85
Demo_SymmetricLogScaleFunction · 0.85

Calls 1

ImPlot3DRangeClass · 0.85

Tested by

no test coverage detected