Class WireframeDrawing
java.lang.Object
eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape
eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base.AbstractCompositeShape
eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.WireframeDrawing
A freeform polyline drawing tool that connects sequential points with line
segments. Points are added one at a time via
addPoint(Point3D);
each new point is connected to the previously added point by a line.
The first point added establishes the starting position without drawing a line. Each subsequent point creates a new line segment from the previous point to the new one.
This shape is useful for drawing paths, trails, trajectories, or arbitrary wireframe shapes that are defined as a sequence of vertices.
Usage example:
LineAppearance appearance = new LineAppearance(2, Color.YELLOW);
WireframeDrawing drawing = new WireframeDrawing(appearance);
drawing.addPoint(new Point3D(0, 0, 0));
drawing.addPoint(new Point3D(100, 50, 0));
drawing.addPoint(new Point3D(200, 0, 0));
shapeCollection.addShape(drawing);
- See Also:
-
Field Summary
Fields inherited from class AbstractShape
cachedBoundingBox, mouseInteractionController -
Constructor Summary
ConstructorsConstructorDescriptionWireframeDrawing(LineAppearance lineAppearance) Constructs a new empty wireframe drawing with the given line appearance. -
Method Summary
Methods inherited from class AbstractCompositeShape
addShape, addShape, beforeTransformHook, extractSolidPolygons, getBoundingBox, getGroup, getLocation, getSubShapesRegistry, getTransform, getViewSpaceTracker, hideGroup, intersect, removeGroup, setBackfaceCulling, setCacheNeedsRebuild, setColor, setGroupForUngrouped, setMouseInteractionController, setRootComposite, setShadingEnabled, setTransform, showGroup, subtract, transform, unionMethods inherited from class AbstractShape
invalidateBounds
-
Constructor Details
-
WireframeDrawing
Constructs a new empty wireframe drawing with the given line appearance.- Parameters:
lineAppearance- the line appearance (color, width) used for all line segments added to this drawing
-
-
Method Details
-
addPoint
Adds a new point to the drawing. If this is the first point, it sets the starting position. Otherwise, a line segment is created from the previous point to this new point.The point is defensively copied, so subsequent modifications to the passed
point3dobject will not affect the drawing.- Parameters:
point3d- the point to add to the polyline
-