/** * Constructs an OmnidirectionalSightline that displays the line-of-sight from a specified center position and * range. Visible features are displayed in the specified attributes, while occluded features are displayed in red. * * @param position the position where the sightline is centered * @param range the sightline's range in meters from its position * @param attributes a reference to an attributes bundle used by this sightline when not highlighted * * @throws IllegalArgumentException If the position is null, or if the range is negative */ public OmnidirectionalSightline(Position position, double range, ShapeAttributes attributes) { if (position == null) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "OmnidirectionalSightline", "constructor", "missingPosition")); } if (range < 0) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "OmnidirectionalSightline", "constructor", "invalidRange")); } this.position.set(position); this.range = range; this.attributes = attributes; this.occludeAttributes = new ShapeAttributes(); this.occludeAttributes.setInteriorColor(new Color(1, 0, 0, 1)); // red }
/** * Constructs an OmnidirectionalSightline that displays the line-of-sight from a specified center position and * range. Visible features are displayed in white, while occluded features are displayed in red. * * @param position the position where the sightline is centered * @param range the sightline's range in meters from its position * * @throws IllegalArgumentException If the position is null, or if the range is negative */ public OmnidirectionalSightline(Position position, double range) { if (position == null) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "OmnidirectionalSightline", "constructor", "missingPosition")); } if (range < 0) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "OmnidirectionalSightline", "constructor", "invalidRange")); } this.position.set(position); this.range = range; this.attributes = new ShapeAttributes(); this.occludeAttributes = new ShapeAttributes(); this.occludeAttributes.setInteriorColor(new Color(1, 0, 0, 1)); // red }
polygon.setDisplayName(fields[1]); polygon.setAttributes(new ShapeAttributes(commonAttrs)); polygon.getAttributes().setInteriorColor(new Color(random.nextFloat(), random.nextFloat(), random.nextFloat(), 0.3f)); polygon.setHighlightAttributes(highlightAttrs);
@Test public void testSetInteriorColor() throws Exception { ShapeAttributes attributes = new ShapeAttributes(); Color black = new Color(0, 0, 0, 1); attributes.setInteriorColor(black); // Verify that the object is an equivalent deep copy. assertEquals(black, attributes.interiorColor); assertTrue(black != attributes.interiorColor); }
visibleAttributes.setInteriorColor(new Color(0f, 1f, 0f, 0.5f)); occludedAttributes.setInteriorColor(new Color(0.1f, 0.1f, 0.1f, 0.8f));
ShapeAttributes attrs = new ShapeAttributes(); attrs.setDrawVerticals(true); // display the extruded verticals attrs.setInteriorColor(new Color(1, 1, 1, 0.5f)); // 50% transparent white attrs.setOutlineWidth(3); path = new Path(positions, attrs);
@Test public void testConstructorWithAttriubutes() { Position position = new Position(12, 34, 56); double majorRadius = 1000; double minorRadius = 500; ShapeAttributes attrs = new ShapeAttributes(); attrs.setInteriorColor(new Color(0, 1, 0, 1)); attrs.setDrawOutline(false); Ellipse ellipse = new Ellipse(position, majorRadius, minorRadius, attrs); assertEquals("constructor position", position, ellipse.center); assertEquals("constructor major radius", majorRadius, ellipse.majorRadius, 1e-9); assertEquals("constructor minor radius", minorRadius, ellipse.minorRadius, 1e-9); assertEquals("constructor attributes", attrs, ellipse.attributes); }
viewableRegions.setInteriorColor(new Color(0f, 1f, 0f, 0.5f)); blockedRegions.setInteriorColor(new Color(0.1f, 0.1f, 0.1f, 0.8f));
ShapeAttributes attrs = new ShapeAttributes(); attrs.setDrawVerticals(true); // display the extruded verticals attrs.setInteriorColor(new Color(1, 1, 1, 0.5f)); // 50% transparent white attrs.setOutlineWidth(3); poly = new Polygon(positions, attrs);
attrs.setInteriorColor(new Color(1, 1, 1, 0.5f)); // 50% transparent white attrs.setOutlineWidth(3); ellipse = new Ellipse(new Position(45, -100, 0), 500000, 300000, attrs); attrs.setInteriorColor(new Color(1, 1, 1, 0.5f)); // 50% transparent white attrs.setDrawVerticals(true); ellipse = new Ellipse(new Position(25, -100, 200e3), 500000, 300000, attrs);