| 1946 | } |
| 1947 | |
| 1948 | void 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 | |
| 1980 | void SetupAxisScale(ImAxis3D idx, ImPlot3DTransform forward, ImPlot3DTransform inverse, void* data) { |
| 1981 | ImPlot3DContext& gp = *GImPlot3D; |
no test coverage detected