Codota Logo
TextureColorAdaptivePalette
Code IndexAdd Codota to your IDE (free)

How to use
TextureColorAdaptivePalette
in
us.ihmc.javaFXToolkit.shapes

Best Java code snippets using us.ihmc.javaFXToolkit.shapes.TextureColorAdaptivePalette (Showing top 19 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: us.ihmc/ihmc-javafx-toolkit

  /**
  * Note that calling this method will clear the palette when {@link #autoClear} is equal to true.
  */
  @Override
  public Image getColorPalette()
  {
   WritableImage ret = colorPalette;
   if (PRINT_PALETTE)
   {
     // save for testing purposes
     try
     {
      ImageIO.write(SwingFXUtils.fromFXImage(colorPalette, null), "png", new File("palette.png"));
     }
     catch (IOException ex)
     {
      ex.printStackTrace();
     }
   }
   if (autoClear)
     clearPalette();
   return ret;
  }
}
origin: us.ihmc/ihmc-javafx-toolkit

@Override
public float[] getTextureLocation(Color color)
{
 if (colorPalette == null)
   initializePalette();
 Integer pixelIndex = registeredColors.get(color);
 if (pixelIndex != null)
 {
   return getTextureLocation(pixelIndex);
 }
 else
 {
   int newPixelIndex = colorList.size();
   if (newPixelIndex <= paletteSize * paletteSize)
   {
    colorList.add(color);
    registeredColors.put(color, newPixelIndex);
    writePixel(newPixelIndex, color);
    return getTextureLocation(newPixelIndex);
   }
   else
   {
    LogTools.error("Reached maximum capacity of the palette. Next colors will be wrong.");
    return new float[] {0.0f, 0.0f};
   }
 }
}
origin: us.ihmc/robot-environment-awareness-visualizers

private Node createConvexPolygonGraphics(PlanarRegion data)
{
 List<ConvexPolygon2D> convexPolygons = new ArrayList<>();
 for (int i = 0; i < data.getNumberOfConvexPolygons(); i++)
   convexPolygons.add(data.getConvexPolygon(i));
 JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(new TextureColorAdaptivePalette(64));
 int regionId = data.getRegionId();
 RigidBodyTransform rigidBodyTransform = new RigidBodyTransform();
 data.getTransformToWorld(rigidBodyTransform);
 Color regionColor = OcTreeMeshBuilder.getRegionColor(regionId);
 for (int i = 0; i < convexPolygons.size(); i++)
 {
   ConvexPolygon2D convexPolygon = convexPolygons.get(i);
   Color color = Color.hsb(regionColor.getHue(), 0.9, 0.5 + 0.5 * ((double) i / (double) convexPolygons.size()));
   meshBuilder.addPolygon(rigidBodyTransform, convexPolygon, color);
 }
 MeshView meshView = new MeshView(meshBuilder.generateMesh());
 meshView.setMaterial(meshBuilder.generateMaterial());
 return meshView;
}
origin: us.ihmc/robot-environment-awareness-visualizers

private Node createConvexDecompositionGraphics(PlanarRegionSegmentationRawData rawData,
                       ConcaveHullFactoryResult concaveHullFactoryResult)
{
 ConcaveHullCollection concaveHullCollection = concaveHullFactoryResult.getConcaveHullCollection();
 double depthThreshold = polygonizerParameters.getDepthThreshold();
 List<ConvexPolygon2D> convexPolygons = new ArrayList<>();
 ConcaveHullDecomposition.recursiveApproximateDecomposition(concaveHullCollection, depthThreshold, convexPolygons);
 JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(new TextureColorAdaptivePalette(64));
 int regionId = rawData.getRegionId();
 RigidBodyTransform rigidBodyTransform = rawData.getTransformFromLocalToWorld();
 Color regionColor = OcTreeMeshBuilder.getRegionColor(regionId);
 for (int i = 0; i < convexPolygons.size(); i++)
 {
   ConvexPolygon2D convexPolygon = convexPolygons.get(i);
   Color color = Color.hsb(regionColor.getHue(), 0.9, 0.5 + 0.5 * ((double) i / (double) convexPolygons.size()));
   meshBuilder.addPolygon(rigidBodyTransform, convexPolygon, color);
 }
 MeshView meshView = new MeshView(meshBuilder.generateMesh());
 meshView.setMaterial(meshBuilder.generateMaterial());
 return meshView;
}
origin: us.ihmc/IHMCJavaFXToolkit

  /**
  * Note that calling this method will clear the palette when {@link #autoClear} is equal to true.
  */
  @Override
  public Image getColorPalette()
  {
   WritableImage ret = colorPalette;
   if (PRINT_PALETTE)
   {
     // save for testing purposes
     try
     {
      ImageIO.write(SwingFXUtils.fromFXImage(colorPalette, null), "png", new File("palette.png"));
     }
     catch (IOException ex)
     {
      ex.printStackTrace();
     }
   }
   if (autoClear)
     clearPalette();
   return ret;
  }
}
origin: us.ihmc/IHMCJavaFXToolkit

@Override
public float[] getTextureLocation(Color color)
{
 if (colorPalette == null)
   initializePalette();
 Integer pixelIndex = registeredColors.get(color);
 if (pixelIndex != null)
 {
   return getTextureLocation(pixelIndex);
 }
 else
 {
   int newPixelIndex = colorList.size();
   if (newPixelIndex <= paletteSize * paletteSize)
   {
    colorList.add(color);
    registeredColors.put(color, newPixelIndex);
    writePixel(newPixelIndex, color);
    return getTextureLocation(newPixelIndex);
   }
   else
   {
    PrintTools.error(this, "Reached maximum capacity of the palette. Next colors will be wrong.");
    return new float[] {0.0f, 0.0f};
   }
 }
}
origin: us.ihmc/robot-environment-awareness-visualizers

private Node createBorderTrianglesGraphics(PlanarRegionSegmentationRawData rawData,
                     ConcaveHullFactoryResult concaveHullFactoryResult)
{
 JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(new TextureColorAdaptivePalette(512));
 Point3D planeOrigin = rawData.getOrigin();
 Vector3D planeNormal = rawData.getNormal();
 for (ConcaveHullVariables intermediateVariables : concaveHullFactoryResult.getIntermediateVariables())
 {
   Set<QuadEdgeTriangle> borderTriangles = intermediateVariables.getBorderTriangles();
   for (QuadEdgeTriangle borderTriangle : borderTriangles)
   {
    List<Point2D> triangleVerticesLocal = Arrays.stream(borderTriangle.getVertices()).map(v -> new Point2D(v.getX(), v.getY()))
       .collect(Collectors.toList());
    List<Point3D> triangleVerticesWorld = PolygonizerTools.toPointsInWorld(triangleVerticesLocal, planeOrigin, planeNormal);
    double hue = 360.0 * random.nextDouble();
    double saturation = 0.8 * random.nextDouble() + 0.1;
    double brightness = 0.9;
    meshBuilder.addPolyon(triangleVerticesWorld, Color.hsb(hue, saturation, brightness));
   }
 }
 MeshView trianglesMeshView = new MeshView(meshBuilder.generateMesh());
 trianglesMeshView.setMaterial(meshBuilder.generateMaterial());
 return trianglesMeshView;
}
origin: us.ihmc/ihmc-footstep-planning-visualizers

private void processBodyPath(List<? extends Point3DReadOnly> bodyPath)
{
 if (bodyPath == null || bodyPath.isEmpty())
 {
   bodyPathMeshToRender.set(new Pair<>(null, null));
   activeBodyPathReference.set(null);
   if (VERBOSE)
    PrintTools.warn("Received body path that is null.");
   return;
 }
 // First let's make a deep copy for later usage.
 bodyPath = bodyPath.stream().map(Point3D::new).collect(Collectors.toList());
 if (VERBOSE)
   PrintTools.info(this, "Building mesh for body path.");
 double totalPathLength = PathTools.computePathLength(bodyPath);
 double currentLength = 0.0;
 palette.clearPalette();
 JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(palette);
 for (int segmentIndex = 0; segmentIndex < bodyPath.size() - 1; segmentIndex++)
 {
   Point3DReadOnly lineStart = bodyPath.get(segmentIndex);
   Point3DReadOnly lineEnd = bodyPath.get(segmentIndex + 1);
   double lineStartHue = EuclidCoreTools.interpolate(startColorHue, goalColorHue, currentLength / totalPathLength);
   currentLength += lineStart.distance(lineEnd);
   double lineEndHue = EuclidCoreTools.interpolate(startColorHue, goalColorHue, currentLength / totalPathLength);
   meshBuilder.addLine(lineStart, lineEnd, BODYPATH_LINE_THICKNESS, Color.hsb(lineStartHue, 1.0, 0.5), Color.hsb(lineEndHue, 1.0, 1.0));
 }
 bodyPathMeshToRender.set(new Pair<>(meshBuilder.generateMesh(), meshBuilder.generateMaterial()));
 activeBodyPathReference.set(bodyPath);
}
origin: us.ihmc/robot-environment-awareness-visualizers

private Node createConcaveHullGraphics(PlanarRegion data)
{
 int regionId = data.getRegionId();
 JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(new TextureColorAdaptivePalette(16));
 RigidBodyTransform transform = new RigidBodyTransform();
 data.getTransformToWorld(transform);
 Point2D[] concaveHullVerticesLocal = data.getConcaveHull();
 Color regionColor = OcTreeMeshBuilder.getRegionColor(regionId);
 List<Point3D> concaveHullVertices = Arrays.stream(concaveHullVerticesLocal).map(Point3D::new).map(p -> {
   transform.transform(p);
   return p;
 }).collect(Collectors.toList());
 for (int vertexIndex = 0; vertexIndex < concaveHullVertices.size(); vertexIndex++)
 {
   Point3D vertex = concaveHullVertices.get(vertexIndex);
   Point3D nextVertex = ListWrappingIndexTools.getNext(vertexIndex, concaveHullVertices);
   Color lineColor = Color.hsb(regionColor.getHue(), regionColor.getSaturation(), regionColor.getBrightness());
   meshBuilder.addLine(vertex, nextVertex, 0.0015, lineColor);
 }
 MeshView meshView = new MeshView(meshBuilder.generateMesh());
 meshView.setMaterial(meshBuilder.generateMaterial());
 meshView.setMouseTransparent(true);
 return meshView;
}
origin: us.ihmc/ihmc-path-planning-visualizers

private void processBodyPath(List<Point3DReadOnly> bodyPath)
{
 if (bodyPath == null || bodyPath.isEmpty())
 {
   bodyPathMeshToRender.set(new Pair<>(null, null));
   activeBodyPathReference.set(null);
   PrintTools.warn("Received body path that is null.");
   return;
 }
 // First let's make a deep copy for later usage.
 bodyPath = bodyPath.stream().map(Point3D::new).collect(Collectors.toList());
 if (VERBOSE)
   PrintTools.info(this, "Building mesh for body path.");
 double totalPathLength = PathTools.computePathLength(bodyPath);
 double currentLength = 0.0;
 palette.clearPalette();
 JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(palette);
 for (int segmentIndex = 0; segmentIndex < bodyPath.size() - 1; segmentIndex++)
 {
   Point3DReadOnly lineStart = bodyPath.get(segmentIndex);
   Point3DReadOnly lineEnd = bodyPath.get(segmentIndex + 1);
   double lineStartHue = EuclidCoreTools.interpolate(startColorHue, goalColorHue, currentLength / totalPathLength);
   currentLength += lineStart.distance(lineEnd);
   double lineEndHue = EuclidCoreTools.interpolate(startColorHue, goalColorHue, currentLength / totalPathLength);
   meshBuilder.addLine(lineStart, lineEnd, BODYPATH_LINE_THICKNESS, Color.hsb(lineStartHue, 1.0, 0.5), Color.hsb(lineEndHue, 1.0, 1.0));
 }
 bodyPathMeshToRender.set(new Pair<>(meshBuilder.generateMesh(), meshBuilder.generateMaterial()));
 activeBodyPathReference.set(bodyPath);
 currentWalkerDistanceInPath.set(0.0);
}
origin: us.ihmc/robot-environment-awareness-visualizers

private Node createDelaunayTriangulationGraphics(PlanarRegionSegmentationRawData rawData,
                        ConcaveHullFactoryResult concaveHullFactoryResult)
{
 JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(new TextureColorAdaptivePalette(512));
 Point3D planeOrigin = rawData.getOrigin();
 Vector3D planeNormal = rawData.getNormal();
 List<QuadEdgeTriangle> allTriangles = concaveHullFactoryResult.getAllTriangles();
 for (QuadEdgeTriangle triangle : allTriangles)
 {
   List<Point2D> triangleVerticesLocal = Arrays.stream(triangle.getVertices()).map(v -> new Point2D(v.getX(), v.getY())).collect(Collectors.toList());
   triangleVerticesLocal.forEach(vertex -> {
    vertex.setX(vertex.getX() * scaleX);
    vertex.setY(vertex.getY() * scaleY);
   });
   List<Point3D> triangleVerticesWorld = PolygonizerTools.toPointsInWorld(triangleVerticesLocal, planeOrigin, planeNormal);
   double hue = 360.0 * random.nextDouble();
   double saturation = 0.8 * random.nextDouble() + 0.1;
   double brightness = 0.9;
   meshBuilder.addPolyon(triangleVerticesWorld, Color.hsb(hue, saturation, brightness));
 }
 MeshView trianglesMeshView = new MeshView(meshBuilder.generateMesh());
 trianglesMeshView.setMaterial(meshBuilder.generateMaterial());
 return trianglesMeshView;
}
origin: us.ihmc/ihmc-footstep-planning-visualizers

private void processOccupancyMapMessage(FootstepPlannerOccupancyMapMessage message)
{
 palette.clearPalette();
 JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(palette);
 Object<FootstepPlannerCellMessage> occupiedCells = message.getOccupiedCells();
 for (int i = 0; i < occupiedCells.size(); i++)
 {
   FootstepPlannerCellMessage cell = occupiedCells.get(i);
   double x = cell.getXIndex() * FootstepNode.gridSizeXY;
   double y = cell.getYIndex() * FootstepNode.gridSizeXY;
   double z = getHeightAtPoint(x, y) + nodeOffsetZ;
   RigidBodyTransform transform = new RigidBodyTransform();
   transform.setTranslation(x, y, z);
   if (cell.getNodeIsValid())
    meshBuilder.addPolygon(transform, cellPolygon, validCellColor);
   else
    meshBuilder.addPolygon(transform, cellPolygon, rejectedCellColor);
 }
 footstepGraphToRender.set(new Pair<>(meshBuilder.generateMesh(), meshBuilder.generateMaterial()));
}
origin: us.ihmc/robot-environment-awareness-visualizers

private Node createIntersectionsGraphics(PlanarRegionSegmentationRawData rawData)
{
 JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(new TextureColorAdaptivePalette(32));
 List<LineSegment2D> intersections2d = rawData.getIntersections();
 Point3D planeOrigin = rawData.getOrigin();
 Vector3D planeNormal = rawData.getNormal();
 List<LineSegment3D> intersections = PolygonizerTools.toLineSegmentsInWorld(intersections2d, planeOrigin, planeNormal);
 for (LineSegment3D intersection : intersections)
 {
   meshBuilder.addLine(intersection.getFirstEndpoint(), intersection.getSecondEndpoint(), 0.0025, Color.RED);
 }
 MeshView meshView = new MeshView(meshBuilder.generateMesh());
 meshView.setMaterial(meshBuilder.generateMaterial());
 meshView.visibleProperty().bind(showIntersections);
 return meshView;
}
origin: us.ihmc/robot-environment-awareness-visualizers

private Node createPriorityQueueGraphics(PlanarRegionSegmentationRawData rawData, ConcaveHullFactoryResult concaveHullFactoryResult)
{
 JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(new TextureColorAdaptivePalette(512));
 Point3D planeOrigin = rawData.getOrigin();
 Quaternion planeOrientation = rawData.getOrientation();
 Color regionColor = OcTreeMeshBuilder.getRegionColor(rawData.getRegionId());
 for (ConcaveHullVariables intermediateVariables : concaveHullFactoryResult.getIntermediateVariables())
 {
   PriorityQueue<Pair<QuadEdge, QuadEdgeTriangle>> queue = intermediateVariables.getSortedByLengthQueue();
   for (Pair<QuadEdge, QuadEdgeTriangle> edgeAndTriangle : queue)
   {
    QuadEdge edge = edgeAndTriangle.getLeft();
    Point3D dest = PolygonizerTools.toPointInWorld(edge.dest().getX(), edge.dest().getY(), planeOrigin, planeOrientation);
    Point3D orig = PolygonizerTools.toPointInWorld(edge.orig().getX(), edge.orig().getY(), planeOrigin, planeOrientation);
    boolean isEdgeTooLong = dest.distance(orig) > parameters.getEdgeLengthThreshold();
    Color lineColor = Color.hsb(regionColor.getHue(), regionColor.getSaturation(), isEdgeTooLong ? 0.25 : regionColor.getBrightness());
    meshBuilder.addLine(dest, orig, 0.0015, lineColor);
    QuadEdgeTriangle triangle = edgeAndTriangle.getRight();
    List<Point2D> triangleVerticesLocal = Arrays.stream(triangle.getVertices()).map(v -> new Point2D(v.getX(), v.getY())).collect(Collectors.toList());
    List<Point3D> triangleVerticesWorld = PolygonizerTools.toPointsInWorld(triangleVerticesLocal, planeOrigin, planeOrientation);
    double hue = 360.0 * random.nextDouble();
    double saturation = 0.8 * random.nextDouble() + 0.1;
    double brightness = 0.9;
    meshBuilder.addPolyon(triangleVerticesWorld, Color.hsb(hue, saturation, brightness));
   }
 }
 MeshView trianglesMeshView = new MeshView(meshBuilder.generateMesh());
 trianglesMeshView.setMaterial(meshBuilder.generateMaterial());
 return trianglesMeshView;
}
origin: us.ihmc/robot-environment-awareness-visualizers

@SuppressWarnings("unchecked")
private static Node createOrderedBorderEdgesGraphics(QuadEdgeSubdivision quadEdgeSubdivision, PlanarRegionSegmentationRawData rawData)
{
 List<QuadEdgeTriangle> delaunayTriangles = QuadEdgeTriangle.createOn(quadEdgeSubdivision);
 List<QuadEdge> orderedBorderEdges = SimpleConcaveHullFactory.computeIntermediateVariables(delaunayTriangles, null).getOrderedBorderEdges();
 JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(new TextureColorAdaptivePalette(16));
 Point3D planeOrigin = rawData.getOrigin();
 Quaternion planeOrientation = rawData.getOrientation();
 double startHue = 0.0;
 double endHue = 240.0;
 double lineStartBirghtness = 0.2;
 double lineEndBirghtness = 1.0;
 for (int edgeIndex = 0; edgeIndex < orderedBorderEdges.size(); edgeIndex++)
 {
   QuadEdge edge = orderedBorderEdges.get(edgeIndex);
   Point3D dest = PolygonizerTools.toPointInWorld(edge.dest().getX(), edge.dest().getY(), planeOrigin, planeOrientation);
   Point3D orig = PolygonizerTools.toPointInWorld(edge.orig().getX(), edge.orig().getY(), planeOrigin, planeOrientation);
   double alpha = edgeIndex / (double) orderedBorderEdges.size();
   double lineHue = (1.0 - alpha) * startHue + alpha * endHue;
   Color startColor = Color.hsb(lineHue, 0.9, lineStartBirghtness);
   Color endColor = Color.hsb(lineHue, 0.9, lineEndBirghtness);
   meshBuilder.addLine(orig, dest, 0.002, startColor, endColor);
 }
 MeshView meshView = new MeshView(meshBuilder.generateMesh());
 meshView.setMaterial(meshBuilder.generateMaterial());
 return meshView;
}
origin: us.ihmc/robot-environment-awareness-visualizers

private Node createConcaveHullGraphics(PlanarRegionSegmentationRawData rawData, ConcaveHullFactoryResult concaveHullFactoryResult)
 JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(new TextureColorAdaptivePalette(16));
 Point3D planeOrigin = rawData.getOrigin();
 Vector3D planeNormal = rawData.getNormal();
origin: us.ihmc/robot-environment-awareness-visualizers

@SuppressWarnings("unchecked")
private static Node createPrimaryEdgesGraphics(QuadEdgeSubdivision quadEdgeSubdivision, PlanarRegionSegmentationRawData rawData)
{
 List<QuadEdge> primaryEdges = (List<QuadEdge>) quadEdgeSubdivision.getPrimaryEdges(false);
 int regionId = rawData.getRegionId();
 JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(new TextureColorAdaptivePalette(16));
 Point3D planeOrigin = rawData.getOrigin();
 Quaternion planeOrientation = rawData.getOrientation();
 Color regionColor = OcTreeMeshBuilder.getRegionColor(regionId);
 for (QuadEdge edge : primaryEdges)
 {
   Point3D dest = PolygonizerTools.toPointInWorld(edge.dest().getX(), edge.dest().getY(), planeOrigin, planeOrientation);
   Point3D orig = PolygonizerTools.toPointInWorld(edge.orig().getX(), edge.orig().getY(), planeOrigin, planeOrientation);
   meshBuilder.addLine(dest, orig, 0.0015, regionColor);
 }
 MeshView meshView = new MeshView(meshBuilder.generateMesh());
 meshView.setMaterial(meshBuilder.generateMaterial());
 meshView.setMouseTransparent(true);
 return meshView;
}
origin: us.ihmc/robot-environment-awareness-visualizers

@SuppressWarnings("unchecked")
private static Node createEdgesGraphics(QuadEdgeSubdivision quadEdgeSubdivision, PlanarRegionSegmentationRawData rawData)
{
 List<QuadEdge> edges = (List<QuadEdge>) quadEdgeSubdivision.getEdges();
 int regionId = rawData.getRegionId();
 JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(new TextureColorAdaptivePalette(16));
 Point3D planeOrigin = rawData.getOrigin();
 Quaternion planeOrientation = rawData.getOrientation();
 Color regionColor = OcTreeMeshBuilder.getRegionColor(regionId);
 for (QuadEdge edge : edges)
 {
   Point3D dest = PolygonizerTools.toPointInWorld(edge.dest().getX(), edge.dest().getY(), planeOrigin, planeOrientation);
   Point3D orig = PolygonizerTools.toPointInWorld(edge.orig().getX(), edge.orig().getY(), planeOrigin, planeOrientation);
   meshBuilder.addLine(dest, orig, 0.0015, regionColor);
 }
 MeshView meshView = new MeshView(meshBuilder.generateMesh());
 meshView.setMaterial(meshBuilder.generateMaterial());
 meshView.setMouseTransparent(true);
 return meshView;
}
origin: us.ihmc/robot-environment-awareness-visualizers

private Node createBorderEdgesGraphics(PlanarRegionSegmentationRawData rawData, ConcaveHullFactoryResult concaveHullFactoryResult)
{
 int regionId = rawData.getRegionId();
 JavaFXMultiColorMeshBuilder meshBuilder = new JavaFXMultiColorMeshBuilder(new TextureColorAdaptivePalette(16));
 Point3D planeOrigin = rawData.getOrigin();
 Quaternion planeOrientation = rawData.getOrientation();
 Color regionColor = OcTreeMeshBuilder.getRegionColor(regionId);
 for (ConcaveHullVariables intermediateVariables : concaveHullFactoryResult.getIntermediateVariables())
 {
   Set<QuadEdge> borderEdges = intermediateVariables.getBorderEdges();
   for (QuadEdge edge : borderEdges)
   {
    Point3D dest = PolygonizerTools.toPointInWorld(edge.dest().getX(), edge.dest().getY(), planeOrigin, planeOrientation);
    Point3D orig = PolygonizerTools.toPointInWorld(edge.orig().getX(), edge.orig().getY(), planeOrigin, planeOrientation);
    boolean isEdgeTooLong = dest.distance(orig) > parameters.getEdgeLengthThreshold();
    Color lineColor = Color.hsb(regionColor.getHue(), regionColor.getSaturation(), isEdgeTooLong ? 0.25 : regionColor.getBrightness());
    meshBuilder.addLine(dest, orig, 0.0015, lineColor);
   }
 }
 MeshView meshView = new MeshView(meshBuilder.generateMesh());
 meshView.setMaterial(meshBuilder.generateMaterial());
 meshView.setMouseTransparent(true);
 return meshView;
}
us.ihmc.javaFXToolkit.shapesTextureColorAdaptivePalette

Javadoc

Provides an color palette that expands as new colors are being accessed instead of being pre-generated as in TextureColorPalette2D and TextureColorPalette1D. The main advantage over the other color palettes is the guarantee of an exact restitution of the colors. However, the approximate number of colors that will be used needs to be known in advance as the color palette has a fixed size and only a certain number of colors can be registered. By default, the image used by this color palette is automatically cleared every time #getColorPalette() is called. This behavior can cause a noticeable slow down of the rendering thread when creating numerous Images. In such scenario, it is preferred to initialize #autoClear to false and to reuse as much as possible the same Image.

Most used methods

  • clearPalette
    Clears the image currently in use by this color palette. Allows to empty the buffer in order to regi
  • getTextureLocation
  • initializePalette
  • writePixel
  • <init>
    Creates a color palette of size #DEFAULT_PALETTE_SIZE * #DEFAULT_PALETTE_SIZE.

Popular in Java

  • Running tasks concurrently on multiple threads
  • findViewById (Activity)
  • requestLocationUpdates (LocationManager)
  • orElseThrow (Optional)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • String (java.lang)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • JTextField (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now