/** * Rotates, translates, then combines the given mesh with the mesh contained in this builder. * @param meshDataHolder the mesh to translate and combine. Not Modified. * @param offset the translation to apply to the given mesh. Not modified. * @param orientation the axis-angle describing the rotation to apply to the given mesh. Not modified. * @param color color of the given mesh. Color accuracy depends on the color palette in use. */ public void addMesh(MeshDataHolder meshDataHolder, Tuple3DReadOnly offset, AxisAngle orientation, Color color) { meshBuilder.addMesh(setColor(meshDataHolder, color), offset, orientation); }
public JavaFXPlanarRegionsViewer() { TextureColorPalette2D colorPalette = new TextureColorPalette2D(); colorPalette.setHueBrightnessBased(0.9); meshBuilder = new JavaFXMultiColorMeshBuilder(colorPalette); renderer = new AnimationTimer() { @Override public void handle(long now) { render(); } }; }
/** * Changes this color palette to allow variation in hue and brightness. The two other components have a resolution of {@value #DEFAULT_RESOLUTION}. * @param saturationConstant the new constant value for the saturation component. */ public void setHueBrightnessBased(double saturationConstant) { setHueBrightnessBased(DEFAULT_RESOLUTION, DEFAULT_RESOLUTION, saturationConstant); }
/** * 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); }
/** * Creates an empty mesh builder using the default texture color palette. */ public JavaFXMultiColorMeshBuilder() { colorPalette = new TextureColorPalette2D(); }
/** * Clears the meshes contained in this builder. */ public void clear() { meshBuilder.clear(); }
/** * 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); }
/** * Retrieves the texture coordinates of a given {@code (red, green, blue)} in the image of this {@link TextureColorPalette}. * @param red the red component, in the range {@code 0.0-1.0}. * @param green the green component, in the range {@code 0.0-1.0}. * @param blue the blue component, in the range {@code 0.0-1.0}. * @return the corresponding texture coordinates. */ public default float[] getTextureLocation(double red, double green, double blue) { return getTextureLocation((int) (255 * red), (int) (255 * green), (int) (255 * blue)); }
/** * @return the resulting mesh as an immutable mesh ready to be interpreted by the adequate mesh data interpreter. */ public MeshDataHolder generateMeshDataHolder() { return meshBuilder.generateMeshDataHolder(); }
/** * Changes this color palette to allow variation in hue and saturation component. * @param brightnessConstant the new constant value for the brightness component. */ public void setHueSaturationBased(double brightnessConstant) { setHueSaturationBased(DEFAULT_RESOLUTION, DEFAULT_RESOLUTION, brightnessConstant); }
/** * 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); }
/** * 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); }
/** * Translates then combines the given mesh with the mesh contained in this builder. * @param meshDataHolder the mesh to translate and combine. Not Modified. * @param offset the translation to apply to the given mesh. Not modified. * @param color color of the given mesh. Color accuracy depends on the color palette in use. */ public void addMesh(MeshDataHolder meshDataHolder, Tuple3DReadOnly offset, Color color) { meshBuilder.addMesh(setColor(meshDataHolder, color), offset); }
/** * 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); }
/** * Combines the given mesh with the mesh contained in this builder while specifying the color of the given mesh. * @param meshDataHolder the mesh to combine. Not modified. * @param color color of the given mesh. Color accuracy depends on the color palette in use. */ public void addMesh(MeshDataHolder meshDataHolder, Color color) { meshBuilder.addMesh(setColor(meshDataHolder, color)); }
/** * 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); }
/** * Translates then combines the given mesh with the mesh contained in this builder. * @param meshDataHolder the mesh to translate and combine. Not Modified. * @param offset the translation to apply to the given mesh. Not modified. * @param color color of the given mesh. Color accuracy depends on the color palette in use. */ public void addMesh(MeshDataHolder meshDataHolder, Tuple3d offset, Color color) { meshBuilder.addMesh(setColor(meshDataHolder, color), offset); }
/** * Translates then combines the given mesh with the mesh contained in this builder. * @param meshDataHolder the mesh to translate and combine. Not Modified. * @param offset the translation to apply to the given mesh. Not modified. * @param color color of the given mesh. Color accuracy depends on the color palette in use. */ public void addMesh(MeshDataHolder meshDataHolder, Tuple3f offset, Color color) { meshBuilder.addMesh(setColor(meshDataHolder, color), offset); }
/** * Rotates, translates, then combines the given mesh with the mesh contained in this builder. * @param meshDataHolder the mesh to translate and combine. Not Modified. * @param offset the translation to apply to the given mesh. Not modified. * @param orientation the axis-angle describing the rotation to apply to the given mesh. Not modified. * @param color color of the given mesh. Color accuracy depends on the color palette in use. */ public void addMesh(MeshDataHolder meshDataHolder, Tuple3d offset, AxisAngle4d orientation, Color color) { meshBuilder.addMesh(setColor(meshDataHolder, color), offset, orientation); }
/** * Combines the given mesh with the mesh contained in this builder while specifying the color of the given mesh. * @param meshDataHolder the mesh to combine. Not modified. * @param color color of the given mesh. Color accuracy depends on the color palette in use. */ public void addMesh(MeshDataHolder meshDataHolder, Color color) { meshBuilder.addMesh(setColor(meshDataHolder, color)); }