Class LineAppearance
java.lang.Object
eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance
Factory for creating Line objects with consistent appearance settings.
This class encapsulates common line styling parameters (width and color) to avoid redundant configuration. It provides multiple constructors for flexibility and ensures default values are used when not specified.
Example usage:
// Create a line appearance with default color and width 2.0
LineAppearance appearance = new LineAppearance(2.0, Color.RED);
// Create multiple lines with the same appearance
Line line1 = appearance.getLine(new Point3D(0, 0, 100), new Point3D(10, 0, 100));
Line line2 = appearance.getLine(new Point3D(0, 10, 100), new Point3D(10, 10, 100));
// Override color for a specific line
Line blueLine = appearance.getLine(p1, p2, Color.BLUE);
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a line appearance with default width (1.0) and default color (light blue).LineAppearance(double lineWidth) Creates a line appearance with the specified width and default color (light blue).LineAppearance(double lineWidth, Color color) Creates a line appearance with the specified width and color. -
Method Summary
Modifier and TypeMethodDescriptionCreates a line between two points using this appearance's width and color.Creates a line between two points using this appearance's width and a custom color.doubleReturns the line width configured for this appearance.
-
Constructor Details
-
LineAppearance
public LineAppearance()Creates a line appearance with default width (1.0) and default color (light blue). -
LineAppearance
public LineAppearance(double lineWidth) Creates a line appearance with the specified width and default color (light blue).- Parameters:
lineWidth- the line width in world units
-
LineAppearance
Creates a line appearance with the specified width and color.- Parameters:
lineWidth- the line width in world unitscolor- the line color
-
-
Method Details
-
getLine
Creates a line between two points using this appearance's width and color.- Parameters:
point1- the starting point of the linepoint2- the ending point of the line- Returns:
- a new Line instance
-
getLine
Creates a line between two points using this appearance's width and a custom color.- Parameters:
point1- the starting point of the linepoint2- the ending point of the linecolor- the color for this specific line (overrides the default)- Returns:
- a new Line instance
-
getLineWidth
public double getLineWidth()Returns the line width configured for this appearance.- Returns:
- the line width in world units
-