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 the PointsRenderer.
    Author:
    hageldave
    • 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 or GL11#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. A ContourPlot.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 SVG symbol. The isFilled() 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 specified Graphics2D object with the specified scaling.
        Parameters:
        g - graphics to draw to
        scaling - 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.