@Override public void update() { if (hasChanged.getAndSet(false)) { if ((!pointOne.containsNaN()) && (!pointTwo.containsNaN()) && (!pointThree.containsNaN())) { instruction.setMesh(MeshDataGenerator.Polygon(new Point3DReadOnly[] { pointOne, pointTwo, pointThree })); } else { instruction.setMesh(null); } } }
@Override public void update() { verticesToDisplay.clear(); for (int i = yoFrameConvexPolygon2d.getNumberOfVertices() - 1; i >= 0; i--) { /* * Using the unsafe getter as this instance of the polygon might not be * recognized as up-to-date. This can occur when displaying a remote * YoGraphic. In such scenario, the coordinates of the vertices are * updated under the hood and this polygon only serves as a data * holder. */ verticesToDisplay.add(yoFrameConvexPolygon2d.getVertexUnsafe(i)); } instruction.setMesh(MeshDataGenerator.ExtrudedPolygon(verticesToDisplay, height)); }
@Override public void update() { if (numberOfPoints.getIntegerValue() < 3) { instruction.setMesh(EMPTY_MESH); return; } for (int i = 0; i < numberOfPoints.getIntegerValue(); i++) ccwOrderedPoints.get(i).set(ccwOrderedYoFramePoints[i]); instruction.setMesh(MeshDataGenerator.Polygon(ccwOrderedPoints, numberOfPoints.getIntegerValue())); instruction.setAppearance(appearance); }
@Override public void update() { if (yoFrameConvexPolygon2d.getHasChangedAndReset()) { instruction.setMesh(MeshDataGenerator.ExtrudedPolygon(yoFrameConvexPolygon2d.getConvexPolygon2d(), height)); } }
@Override public void update() { if (hasChanged.getAndSet(false)) { if ((!pointOne.containsNaN()) && (!pointTwo.containsNaN()) && (!pointThree.containsNaN())) { instruction.setMesh(MeshDataGenerator.Polygon(new Point3d[] { pointOne.getPoint3dCopy(), pointTwo.getPoint3dCopy(), pointThree.getPoint3dCopy() })); } else { instruction.setMesh(null); } } }
/** * Update the mesh that will display a portion of the {@link PlanarRegionsList} being processed. * This method only reads the YoVariables to update the mesh. * * When used as a remote YoGraphic, only this method should be called. */ @Override public void update() { if (yoGraphicJob == YoGraphicJob.READER) { // Notify the updater that a reader exists and the updater must synchronize. waitForReader.set(true); hasReaderProcessedMesh.set(true); } if (currentMeshIndex.getIntegerValue() == -1) return; MeshDataHolder polygonMesh = createCurrentMesh(); polygonMesh.setName("PlanarRegion"); AppearanceDefinition appearance = getCurrentAppearance(); Graphics3DAddMeshDataInstruction instructionToUpdate = meshBuffer.get(currentMeshIndex.getIntegerValue()); instructionToUpdate.setMesh(polygonMesh); instructionToUpdate.setAppearance(appearance); if (isPlanarRegionsListComplete.getBooleanValue()) { // Clear the rest of meshes that are not needed. for (int meshIndex = currentMeshIndex.getIntegerValue() + 1; meshIndex < meshBufferSize; meshIndex++) meshBuffer.get(meshIndex).setMesh(null); } }
meshDataInstruction.setMesh(null); dirtyGraphic.set(false); return; segmentedLine3DMeshGenerator.compute(intermediatePositions, intermediateVelocities); for (int i = 0; i < resolution - 1; i++) graphics3DAddMeshDataInstructions[i].setMesh(segmentedLine3DMeshGenerator.getMeshDataHolders()[i]); break; pointCloud3DMeshGenerator.compute(intermediatePositions); for (int i = 0; i < resolution - 1; i++) graphics3DAddMeshDataInstructions[i].setMesh(pointCloud3DMeshGenerator.getMeshDataHolders()[i]); break; default: