Package gov.nih.mipav.model.algorithms
Interface ContourPlot.Glyph
-
- Enclosing class:
- ContourPlot
public static interface ContourPlot.Glyph
The Glyph interface has to be implemented by a class that realizes a graphical representation of a 2D point (e.g. a cross or a circle). The interface declares the#fillVertexArray(VertexArray)
method that fills a vertex array so that it contains the vertices for the shape of the glyph. The other methods describe how the glyph has to be drawn by thePointsRenderer
.- Author:
- hageldave
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.apache.pdfbox.pdmodel.edit.PDPageContentStream
createPDFElement(org.apache.pdfbox.pdmodel.edit.PDPageContentStream contentStream)
Creates PDF elements that will be appended to the content stream.void
drawFallback(java.awt.Graphics2D g, float scaling)
Fallback rendering path when OpenGL is not available.java.lang.String
glyphName()
boolean
isFilled()
int
numVertices()
int
pixelSize()
int
primitiveType()
boolean
useElementsDrawCall()
-
-
-
Method Detail
-
numVertices
int numVertices()
- Returns:
- number of vertices this glyph has.
-
primitiveType
int primitiveType()
- Returns:
- the GL primitive to be used for drawing.
For example
GL11#GL_LINES
orGL11#GL_TRIANGLE_STRIP
-
pixelSize
int pixelSize()
- Returns:
- the size in pixels this glyph should be scaled to.
-
useElementsDrawCall
boolean useElementsDrawCall()
- Returns:
- true if an elements draw call is to be used e.g.
GL31#glDrawElementsInstanced(int, int, int, long, int)
, false if an arrays draw call is to be used e.g.GL31#glDrawArraysInstanced(int, int, int, int)
.
Of course an elements draw call can only be used if the VertexArray has indices, i.e. the ELEMENT_ARRAY_BUFFER is set. AContourPlot.Glyph
implementation has to guarantee for that.
-
createPDFElement
org.apache.pdfbox.pdmodel.edit.PDPageContentStream createPDFElement(org.apache.pdfbox.pdmodel.edit.PDPageContentStream contentStream)
Creates PDF elements that will be appended to the content stream. This is used to create an SVGsymbol
. TheisFilled()
method determines whether the "fill" or "stroke" attribute is used for coloring an instance of the symbol.- Parameters:
contentStream
- content stream that the glyph will be added to- Returns:
- content stream that holds the glyph written to the document
-
drawFallback
void drawFallback(java.awt.Graphics2D g, float scaling)
Fallback rendering path when OpenGL is not available. Draws this glyph to the specifiedGraphics2D
object with the specified scaling.- Parameters:
g
- graphics to draw toscaling
- factor by which to scale this glyph
-
glyphName
java.lang.String glyphName()
- Returns:
- name of this Glyph, used as part of an SVG identifier for the corresponding symbol definition.
-
isFilled
boolean isFilled()
- Returns:
- whether this glyph is filled or not, e.g. a cross is not filled but a circle can.
-
-