Class ContourPlot.Lines
- All Implemented Interfaces:
ContourPlot.Renderable
- Enclosing class:
ContourPlot
ContourPlot.Lines object (not per segment).
Each segment has a single picking color.
The picking color is the color with which the segment is rendered into the (invisible) picking color attachment
of an
invalid reference
FBO
There is also a global alpha multiplier (
invalid reference
#setGlobalAlphaMultiplier(double)
Similarly, the global thickness multiplier (setGlobalThicknessMultiplier(double)) can be used to
scale every segment's thickness of this Lines object by a specific factor.
The segments of this object can be rendered using a stroke pattern (
invalid reference
#setStrokePattern(int)
- Author:
- hageldave
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DoubleSupplierprotected DoubleSupplierprotected DoubleSupplierprotected booleanprotected booleanprotected ArrayList<ContourPlot.SegmentDetails> protected floatprotected shortprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddSegment(double x1, double y1, double x2, double y2) Adds a new line segment to this object.addSegment(Point2D p1, Point2D p2) Adds a new line segment to this object.floatfloatfloatfloatReturns the stroke length in pixels, which is by default 16 pixels.shortReturns thisContourPlot.Linesobject's stroke patternbooleanWhether this Lines object has a stroke pattern other than 0xffff (completely solid).booleanintersects(Rectangle2D rect) tests if thisContourPlot.Renderableintersects or contains the specified rectangle.booleanisDirty()if true, indicates that a call tois necessary to sync this objects GL resources to its current state.invalid reference
#updateGL(boolean)booleanisHidden()Indicates whether this Renderable is hidden i.e. will not be drawn.booleanintRemoves all segments of this object.setDirty()Sets theisDirty()state of this renderable to true.setGlobalThicknessMultiplier(double thickness) Sets the line thickness multiplier for thisContourPlot.Linesobject in pixels.setGlobalThicknessMultiplier(DoubleSupplier thickness) Sets the line thickness multiplier for thisContourPlot.Linesobject in pixels.setVertexRoundingEnabled(boolean useVertexRounding) En/Disables vertex rounding for this Lines object.
-
Field Details
-
segments
-
globalSaturationMultiplier
-
globalThicknessMultiplier
-
isDirty
protected boolean isDirty -
globalAlphaMultiplier
-
useVertexRounding
protected boolean useVertexRounding -
strokePattern
protected short strokePattern -
strokeLength
protected float strokeLength
-
-
Constructor Details
-
Lines
public Lines()
-
-
Method Details
-
setDirty
Sets theisDirty()state of this renderable to true. This indicates that ancall is necessary to sync GL resources.invalid reference
#updateGL(boolean, double, double)- Returns:
- this for chaining
-
isDirty
public boolean isDirty()Description copied from interface:ContourPlot.Renderableif true, indicates that a call tois necessary to sync this objects GL resources to its current state.invalid reference
#updateGL(boolean)- Specified by:
isDirtyin interfaceContourPlot.Renderable- Returns:
- true if dirty
-
numSegments
public int numSegments()- Returns:
- the number of line segments in this
ContourPlot.Linesobject
-
addSegment
Adds a new line segment to this object. Sets theisDirty()state to true.- Parameters:
p1- start pointp2- end point- Returns:
- the added segment
-
addSegment
Adds a new line segment to this object. Sets theisDirty()state to true.- Parameters:
x1- x coordinate of start pointy1- y coordinate of start pointx2- x coordinate of end pointy2- y coordinate of end point- Returns:
- the added segment
-
getSegments
- Returns:
- the line segments list.
Make sure to call
setDirty()when manipulating.
-
getGlobalAlphaMultiplier
public float getGlobalAlphaMultiplier()- Returns:
- the global alpha multiplier of the segments in this collection
-
removeAllSegments
Removes all segments of this object. Sets theisDirty()state to true.- Returns:
- this for chaining
-
intersects
Description copied from interface:ContourPlot.Renderabletests if thisContourPlot.Renderableintersects or contains the specified rectangle.- Specified by:
intersectsin interfaceContourPlot.Renderable- Parameters:
rect- rectangle to test- Returns:
- true when intersecting
-
isHidden
public boolean isHidden()Description copied from interface:ContourPlot.RenderableIndicates whether this Renderable is hidden i.e. will not be drawn.- Specified by:
isHiddenin interfaceContourPlot.Renderable- Returns:
- true when hidden
-
setVertexRoundingEnabled
En/Disables vertex rounding for this Lines object. This indicates if theContourPlot.LinesRenderer's shader will round vertex positions of the quad vertices (that a segment is expanded to) to integer values.This has the effect of sharpening horizontal and vertical lines, but can affect differently oriented lines to shrink in thickness or even vanish.
Also this only makes sense when the Lines object is of integer valued thickness.
- Parameters:
useVertexRounding- will enable if true- Returns:
- this for chaining
-
setGlobalThicknessMultiplier
Sets the line thickness multiplier for thisContourPlot.Linesobject in pixels. The effective thickness of a segment results from multiplication of its thickness with this value.- Parameters:
thickness- of the lines, default is 1.- Returns:
- this for chaining
-
setGlobalThicknessMultiplier
Sets the line thickness multiplier for thisContourPlot.Linesobject in pixels. The effective thickness of a segment results from multiplication of its thickness with this value.- Parameters:
thickness- of the lines, default is 1.- Returns:
- this for chaining
-
getGlobalThicknessMultiplier
public float getGlobalThicknessMultiplier()- Returns:
- the line thickness multiplier of this
ContourPlot.Linesobject
-
hasStrokePattern
public boolean hasStrokePattern()Whether this Lines object has a stroke pattern other than 0xffff (completely solid).- Returns:
- true when stroke pattern != 0xffff
-
getStrokePattern
public short getStrokePattern()Returns thisContourPlot.Linesobject's stroke pattern- Returns:
- stroke pattern
-
getStrokeLength
public float getStrokeLength()Returns the stroke length in pixels, which is by default 16 pixels.- Returns:
- stroke length
-
getGlobalSaturationMultiplier
public float getGlobalSaturationMultiplier()- Returns:
- the saturation multiplier of this renderable
-
isVertexRoundingEnabled
public boolean isVertexRoundingEnabled()- Returns:
- whether vertex rounding is enabled. This indicates if
the
ContourPlot.LinesRenderer's shader will round vertex positions of the quad vertices (that a segment is expanded to) to integer values.This has the effect of sharpening horizontal and vertical lines, but can affect differently oriented lines to shrink in thickness or even vanish.
-