package de.andreasvoelker; import org.jetbrains.annotations.Nullable; public class RenderState { private @Nullable BlochSphere blochSphere = null; private float radius = 3; private float pitch = 0; private float yaw = 0; private float lineWidth = 1.0f; private float nonlinearity = 1.0f; public @Nullable BlochSphere getBlochSphere() { return blochSphere; } public void setBlochSphere(@Nullable BlochSphere blochSphere) { this.blochSphere = blochSphere; } public float getRadius() { return radius; } public void setRadius(float radius) { if (radius < 0) radius = 0; this.radius = radius; } public float getPitch() { return pitch; } public void setPitch(float pitch) { while(pitch > 2*Math.PI) pitch -= (float)2*Math.PI; while(pitch < 0) pitch += (float)2*Math.PI; this.pitch = pitch; } public float getYaw() { return yaw; } public void setYaw(float yaw) { if (yaw > 0.4*Math.PI) yaw = (float) (0.4*Math.PI); if (yaw < -0.4*Math.PI) yaw = (float) (-0.4*Math.PI); this.yaw = yaw; } public float getLineWidth() { return lineWidth; } public void setLineWidth(float lineWidth) { this.lineWidth = lineWidth; } public float getNonlinearity() { return nonlinearity; } public void setNonlinearity(float nonlinearity) { this.nonlinearity = nonlinearity; } }