/** * Changes this color palette to have the hue component be variable with a default resolution of {@value #DEFAULT_RESOLUTION} and given the new constant values for the saturation and brightness components. * @param saturationConstant the new constant value for the saturation component. * @param brightnessConstant the new constant value for the brightness component. */ public void setHueBased(double saturationConstant, double brightnessConstant) { setHueBased(DEFAULT_RESOLUTION, saturationConstant, brightnessConstant); }
/** * Changes this color palette to have the brightness component be variable with a default resolution of {@value #DEFAULT_RESOLUTION} and given the new constant values for the hue and saturation components. * @param hueConstant the new constant value for the hue. * @param saturationConstant the new constant value for the saturation. */ public void setBrightnessBased(double hueConstant, double saturationConstant) { setBrightnessBased(DEFAULT_RESOLUTION, hueConstant, saturationConstant); }
/** * Changes this color palette to have the saturation component be variable with a default resolution of {@value #DEFAULT_RESOLUTION} and given the new constant values for the hue and brightness components. * @param hueConstant the new constant value for the hue component. * @param brightnessConstant the new constant value for the brightness component. */ public void setSaturationBased(double hueConstant, double brightnessConstant) { setSaturationBased(DEFAULT_RESOLUTION, hueConstant, brightnessConstant); }
public LidarScanLogViewer() { JavaFXCoordinateSystem lidarFrame = new JavaFXCoordinateSystem(0.1); lidarFrame.getTransforms().add(lidarPose); root.getChildren().addAll(lidarFrame, scans); TextureColorPalette1D scanColorPalette = new TextureColorPalette1D(); scanColorPalette.setHueBased(1.0, 1.0); scanMeshBuilder = new JavaFXMultiColorMeshBuilder(scanColorPalette); }
/** * Changes this color palette to have the saturation component be variable with a given resolution and given the new constant values for the hue and brightness components. * @param saturationResolution resolution to use for the saturation component. * @param hueConstant the new constant value for the hue component. * @param brightnessConstant the new constant value for the brightness component. */ public void setSaturationBased(int saturationResolution, double hueConstant, double brightnessConstant) { MathTools.checkGreaterThanOrEquals(saturationResolution, 1); MathTools.checkIntervalContains(brightnessConstant, 0.0, 1.0); this.hueResolution = -1; this.saturationResolution = saturationResolution; this.brightnessResolution = -1; this.hueConstant = hueConstant; this.saturationConstant = brightnessConstant; this.brightnessConstant = Double.NaN; updateColorPalette(); }
pw.setColor(x, y, getColorAtIndex(x));
public LidarScanLogViewer() { JavaFXCoordinateSystem lidarFrame = new JavaFXCoordinateSystem(0.1); lidarFrame.getTransforms().add(lidarPose); root.getChildren().addAll(lidarFrame, scans); TextureColorPalette1D scanColorPalette = new TextureColorPalette1D(); scanColorPalette.setHueBased(1.0, 1.0); scanMeshBuilder = new JavaFXMultiColorMeshBuilder(scanColorPalette); }
/** * Changes this color palette to have the brightness component be variable with a given resolution and given the new constant values for the hue and saturation components. * @param brightnessResolution resolution to use for the brightness component. * @param hueConstant the new constant value for the hue component. * @param saturationConstant the new constant value for the saturation component. */ public void setBrightnessBased(int brightnessResolution, double hueConstant, double saturationConstant) { MathTools.checkIfGreaterOrEqual(brightnessResolution, 1); MathTools.checkIfInRange(saturationConstant, 0.0, 1.0); this.hueResolution = -1; this.saturationResolution = -1; this.brightnessResolution = brightnessResolution; this.hueConstant = hueConstant; this.saturationConstant = saturationConstant; this.brightnessConstant = Double.NaN; updateColorPalette(); }
pw.setColor(x, y, getColorAtIndex(x));
public ArrowGraphic(double radius, double length, Color color) { TextureColorPalette1D colorPalette = new TextureColorPalette1D(); colorPalette.setHueBased(1.0, 1.0); JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(colorPalette); double coneHeight = 0.10 * length; double coneRadius = 1.5 * radius; meshBuilder.addCylinder(length, radius, new Point3D(), new AxisAngle(0.0, 1.0, 0.0, Math.PI / 2.0), color); meshBuilder.addCone(coneHeight, coneRadius, new Point3D(length, 0.0, 0.0), new AxisAngle(0.0, 1.0, 0.0, Math.PI / 2.0), color); this.arrow = new MeshView(meshBuilder.generateMesh()); arrow.setMaterial(meshBuilder.generateMaterial()); getChildren().add(arrow); }
/** * Changes this color palette to have the hue component be variable with a default resolution of {@value #DEFAULT_RESOLUTION} and given the new constant values for the saturation and brightness components. * @param saturationConstant the new constant value for the saturation component. * @param brightnessConstant the new constant value for the brightness component. */ public void setHueBased(double saturationConstant, double brightnessConstant) { setHueBased(DEFAULT_RESOLUTION, saturationConstant, brightnessConstant); }
/** * Changes this color palette to have the brightness component be variable with a given resolution and given the new constant values for the hue and saturation components. * @param brightnessResolution resolution to use for the brightness component. * @param hueConstant the new constant value for the hue component. * @param saturationConstant the new constant value for the saturation component. */ public void setBrightnessBased(int brightnessResolution, double hueConstant, double saturationConstant) { MathTools.checkGreaterThanOrEquals(brightnessResolution, 1); MathTools.checkIntervalContains(saturationConstant, 0.0, 1.0); this.hueResolution = -1; this.saturationResolution = -1; this.brightnessResolution = brightnessResolution; this.hueConstant = hueConstant; this.saturationConstant = saturationConstant; this.brightnessConstant = Double.NaN; updateColorPalette(); }
/** * Changes this color palette to have the brightness component be variable with a default resolution of {@value #DEFAULT_RESOLUTION} and given the new constant values for the hue and saturation components. * @param hueConstant the new constant value for the hue. * @param saturationConstant the new constant value for the saturation. */ public void setBrightnessBased(double hueConstant, double saturationConstant) { setBrightnessBased(DEFAULT_RESOLUTION, hueConstant, saturationConstant); }
/** * Changes this color palette to have the saturation component be variable with a default resolution of {@value #DEFAULT_RESOLUTION} and given the new constant values for the hue and brightness components. * @param hueConstant the new constant value for the hue component. * @param brightnessConstant the new constant value for the brightness component. */ public void setSaturationBased(double hueConstant, double brightnessConstant) { setSaturationBased(DEFAULT_RESOLUTION, hueConstant, brightnessConstant); }
public JavaFXCoordinateSystem(double length) { TextureColorPalette1D colorPalette = new TextureColorPalette1D(); colorPalette.setHueBased(1.0, 1.0); JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(colorPalette); double radius = 0.02 * length; double coneHeight = 0.10 * length; double coneRadius = 0.05 * length; meshBuilder.addCylinder(length, radius, new Point3D(), new AxisAngle(0.0, 1.0, 0.0, Math.PI / 2.0), Color.RED); meshBuilder.addCone(coneHeight, coneRadius, new Point3D(length, 0.0, 0.0), new AxisAngle(0.0, 1.0, 0.0, Math.PI / 2.0), Color.RED); meshBuilder.addCylinder(length, radius, new Point3D(), new AxisAngle(1.0, 0.0, 0.0, -Math.PI / 2.0), Color.GREEN); meshBuilder.addCone(coneHeight, coneRadius, new Point3D(0.0, length, 0.0), new AxisAngle(1.0, 0.0, 0.0, -Math.PI / 2.0), Color.GREEN); meshBuilder.addCylinder(length, radius, new Point3D(), Color.BLUE); meshBuilder.addCone(coneHeight, coneRadius, new Point3D(0.0, 0.0, length), Color.BLUE); MeshView coordinateSystem = new MeshView(meshBuilder.generateMesh()); coordinateSystem.setMaterial(meshBuilder.generateMaterial()); getChildren().addAll(coordinateSystem); } }
/** * Creates a color palette with the hue component set as the variable with a resolution of {@value #DEFAULT_RESOLUTION} and the saturation and brightness set to {@code 1.0}. */ public TextureColorPalette1D() { setHueBased(1.0, 1.0); }
/** * Changes this color palette to have the saturation component be variable with a given resolution and given the new constant values for the hue and brightness components. * @param saturationResolution resolution to use for the saturation component. * @param hueConstant the new constant value for the hue component. * @param brightnessConstant the new constant value for the brightness component. */ public void setSaturationBased(int saturationResolution, double hueConstant, double brightnessConstant) { MathTools.checkIfGreaterOrEqual(saturationResolution, 1); MathTools.checkIfInRange(brightnessConstant, 0.0, 1.0); this.hueResolution = -1; this.saturationResolution = saturationResolution; this.brightnessResolution = -1; this.hueConstant = hueConstant; this.saturationConstant = brightnessConstant; this.brightnessConstant = Double.NaN; updateColorPalette(); }
public JavaFXCoordinateSystem(double length) { TextureColorPalette1D colorPalette = new TextureColorPalette1D(); colorPalette.setHueBased(1.0, 1.0); JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(colorPalette); double radius = 0.02 * length; double coneHeight = 0.10 * length; double coneRadius = 0.05 * length; meshBuilder.addCylinder(length, radius, new Point3d(), new AxisAngle4d(0.0, 1.0, 0.0, Math.PI / 2.0), Color.RED); meshBuilder.addCone(coneHeight, coneRadius, new Point3d(length, 0.0, 0.0), new AxisAngle4d(0.0, 1.0, 0.0, Math.PI / 2.0), Color.RED); meshBuilder.addCylinder(length, radius, new Point3d(), new AxisAngle4d(1.0, 0.0, 0.0, -Math.PI / 2.0), Color.GREEN); meshBuilder.addCone(coneHeight, coneRadius, new Point3d(0.0, length, 0.0), new AxisAngle4d(1.0, 0.0, 0.0, -Math.PI / 2.0), Color.GREEN); meshBuilder.addCylinder(length, radius, new Point3d(), Color.BLUE); meshBuilder.addCone(coneHeight, coneRadius, new Point3d(0.0, 0.0, length), Color.BLUE); MeshView coordinateSystem = new MeshView(meshBuilder.generateMesh()); coordinateSystem.setMaterial(meshBuilder.generateMaterial()); getChildren().addAll(coordinateSystem); } }
/** * Creates a color palette with the hue component set as the variable with a resolution of {@value #DEFAULT_RESOLUTION} and the saturation and brightness set to {@code 1.0}. */ public TextureColorPalette1D() { setHueBased(1.0, 1.0); }
/** * Changes this color palette to have the hue component be variable with a given resolution and given the new constant values for the saturation and brightness components. * @param hueResolution resolution to use for the hue component. * @param saturationConstant the new constant value for the saturation component. * @param brightnessConstant the new constant value for the brightness component. */ public void setHueBased(int hueResolution, double saturationConstant, double brightnessConstant) { MathTools.checkIfGreaterOrEqual(hueResolution, 1); MathTools.checkIfInRange(saturationConstant, 0.0, 1.0); MathTools.checkIfInRange(brightnessConstant, 0.0, 1.0); this.hueResolution = hueResolution; this.saturationResolution = -1; this.brightnessResolution = -1; this.hueConstant = Double.NaN; this.saturationConstant = saturationConstant; this.brightnessConstant = brightnessConstant; updateColorPalette(); }