Documentation of 'jv.viewer.PvGeometry' Java class
PvGeometry ("JavaView Reference Manual")
"JavaView? v5.03.003"
jv.viewer

Class PvGeometry

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PgGeometryIf, PvGeometryIf


    public final class PvGeometry
    extends PgJvxSrc
    implements PvGeometryIf
    Container class for display. This class can hold a point set, polygon set, element set, and other subclasses of PgGeometry. Each PgGeometry registered in a PvDisplay has an associated PvGeometry, which is filled each time the display receives an update event from the real geometry. Then PvGeometry calls PgGeometry.paint(this) to allow the PgGeometry to set new values.

    A subclass of PgGeometry has access to all methods of PvGeometry listed in PvGeometryIf.

    See Also:
    PvGeometryIf, PgGeometry, PvDisplay, PvScene, Serialized Form
    Author:
    Konrad Polthier
    Version:
    23.11.14, 6.40 revised (kp) URL handling improved.
    16.11.06, 6.30 revised (kp) Better checks if m_bInstanceSharing is enabled.
    11.10.06, 6.20 revised (kp) Avoid nullPtr when smoothEdgeColors where enabled.
    29.02.04, 6.10 revised (kp) Methods on vectorFields removed which were deprecated before JavaView v2.21.
    29.02.04, 6.00 revised (kp) Optimization and number of methods reduced.
    30.01.04, 5.30 revised (kp) Remove transformed vertex and element normals if there are no normals any more.
    29.01.04, 5.20 revised (kp) Edge arrows now respect vertex size.
    23.01.04, 5.10 revised (kp) Marked, picked and focused vertices and edges are now drawn even if thickness is zero.
    18.01.04, 5.00 revised (kp) Lighting of textured surfaces implemented, other lighting improved.
    17.01.04, 4.95 revised (kp) Several unused methods removed which assign data for individual elements.
    13.08.03, 4.90 revised (kp) New internal variable m_bIsClippable determines if a geometry is clipped at all.
    15.05.03, 4.80 revised (kp) Range plot now also works for elements. First alpha version.
    17.03.03, 4.70 revised (kp) Scene bounding box clipping implemented.
    13.03.03, 4.60 revised (kp) Auto-clipping in perspective mode enabled.
    07.12.02, 4.50 revised (kp) Perspectivity implemented.
    25.11.02, 4.30 revised (kp) Providing direct access to polygon and edge offset for each edge.
    20.07.02, 4.20 revised (kp) No longer correct depth of vector fields in z-buffer, antialias.
    23.06.02, 4.10 revised (kp) Blending and filtering of texture implemented.
    08.06.02, 4.00 revised (kp) Alpha channel in texture and lighting.
    19.05.01, 3.50 revised (kp) Most vector methods moved to PgJvxSrc, or deprecated.
    12.05.01, 3.30 revised (kp) Display of vertices not referenced by elements and polygons implemented.
    13.12.00, 3.20 revised (kp) Rename instance variable m_vectorField from m_vectorfield.
    05.12.00, 3.10 revised (kp) Unused methods add/remove/setGeometryPolyygon() removed.
    26.09.00, 3.00 revised (kp) Superclass changed to PgJvxSrc from PgGeometry.
    02.04.00, 2.30 revised (kp) Everywhere PdColor replaced with Color except static calls.
    09.02.00, 2.20 revised (kp) Outline mode added.
    20.01.00, 2.10 revised (kp) Vector drawn with arrows.
    20.11.99, 2.00 revised (kp) Aura along edges.
    23.10.99, 1.90 created (kp) Edge Once Drawing of edges disabled since 10% slower.
    04.10.99, 1.80 created (kp) Occurrence of Face replaced with Element.
    30.09.99, 1.70 created (kp) Checkbox to print indices in display added.
    29.08.99, 1.60 revised (kp) Thick edges added. Some globalSizes changed to integers since check for equality is cheaper.
    01.08.99, 1.50 revised (kp) Texture activated.
    21.06.99, 1.11 revised (kp) Clipping w.r.t. viewing direction activated.
    25.04.99, 1.10 revised (kp) Handling of tagged vertices improved.
    02.01.99, 1.01 revised (kp) Additional integer argument for setList calls
    00.00.97, 1.00 created (kp)
    • Field Detail

      • m_bPerspectivity

        public boolean m_bPerspectivity
        HACK JOGL Flag if perspectivity is enabled.
    • Constructor Detail

      • PvGeometry

        public PvGeometry(int dim)
        Constructor with dimension of vertices.
    • Method Detail

      • init

        public void init()
        Description copied from class: PgJvxSrc
        Initializes and resets geometry.
        Specified by:
        init in interface PvGeometryIf
        Overrides:
        init in class PgJvxSrc
      • setDimOfVertices

        public void setDimOfVertices(int dim)
        Description copied from class: PgJvxSrc
        Assign dimension of vertices. This method only adjusts the size of vertices, and for example, not of vectors. Note, this class is not intended for changing the geometry data once it is assigned.
        Specified by:
        setDimOfVertices in interface PvGeometryIf
        Overrides:
        setDimOfVertices in class PgJvxSrc
      • setLabelAttributes

        public boolean setLabelAttributes(PiVector[] attr)
        Set offset vector in pixel coordinates of label w.r.t. base point. Third component is in [1..3] and indices whether head, center or tail is located at base+offset. Note, (0,0) is in the upper left corner of the screen.
        Specified by:
        setLabelAttributes in interface PvGeometryIf
        Parameters:
        attr - vector with label attributes of all label types.
      • setLabelColors

        public void setLabelColors(java.awt.Color[] col)
        Set color of all different label type.
        Specified by:
        setLabelColors in interface PvGeometryIf
        Parameters:
        col - color of all label types.
        Version:
        22.01.04, 1.00 created (kp) since JavaView 3.05.003
      • setLabelSizes

        public void setLabelSizes(PdVector size)
        Set font sizes of all label types.
        Specified by:
        setLabelSizes in interface PvGeometryIf
        Parameters:
        size - Vector with font sizes
        Since:
        JavaView 3.52.002
        Version:
        15.08.04, 1.00 created (kp)
      • setLabelStyles

        public void setLabelStyles(PiVector style)
        Set font styles of all label types.
        Specified by:
        setLabelStyles in interface PvGeometryIf
        Parameters:
        style - Vector with font sizes
        Since:
        JavaView 3.52.002
        Version:
        15.08.04, 1.00 created (kp)
      • setLabelFonts

        public void setLabelFonts(java.lang.String[] name)
        Set font sizes of all label types.
        Specified by:
        setLabelFonts in interface PvGeometryIf
        Parameters:
        name - Array with font names
        Since:
        JavaView 3.52.002
        Version:
        15.08.04, 1.00 created (kp)
      • getDrawingOrder

        public int getDrawingOrder()
        Get position of geometry in z-direction in display. Possible values: BACK, STANDARD, FRONT Currently, only the set of item from geometries of type STANDARD are z-sorted.
        Specified by:
        getDrawingOrder in interface PvGeometryIf
      • setDrawingOrder

        public void setDrawingOrder(int pos)
        Set position of geometry in z-direction in display. Possible values: BACK, STANDARD, FRONT Currently, only the set of item from geometries of type STANDARD are z-sorted.
        Specified by:
        setDrawingOrder in interface PvGeometryIf
      • isSpecial

        public boolean isSpecial()
        Check if this geometry is a special geometry, for example, bounding box or light.
        Returns:
        true if this geometry is special
      • setSpecial

        public void setSpecial(boolean flag)
        Set status that this geometry is a special geometry, for example, bounding box or light.
        Parameters:
        flag - true if this geometry is special
      • setGeometry

        public void setGeometry(PgGeometryIf aGeometry)
        Set geometry to be displayed. Name of current container is set to name of geometry with suffix "_Container".
        Specified by:
        setGeometry in interface PvGeometryIf
      • getState

        public boolean getState(int aKey)
        Method only partially implemented.
        Overrides:
        getState in class PgGeometry
        Parameters:
        aKey - flag to be set, choose among PvGeometryIf.SHOW_...
        Returns:
        boolean state of this key
      • setState

        public void setState(int aKey,
                             boolean state)
        Set drawing flags of the geometry. TODO: create a BitSet for all these flags.
        Specified by:
        setState in interface PgGeometryIf
        Specified by:
        setState in interface PvGeometryIf
        Overrides:
        setState in class PgJvxSrc
        Parameters:
        aKey - flag to be set, choose among PvGeometryIf.SHOW_...
        state - enable or disable state
      • setStateFromDisplay

        public void setStateFromDisplay(int aKey,
                                        boolean state)
        Set drawing flags of the geometry from display.
      • getBounds

        public PdVector[] getBounds(boolean bScene)
        Compute bounding box if geometry has number of vertices, otherwise return null. This methods assigns the internal instance variable m_bndBox which is used, for example, to place the title of a geometry.
      • drawSpline

        public void drawSpline(java.awt.Graphics g,
                               int x1,
                               int y1,
                               int z1,
                               int x2,
                               int y2,
                               int z2,
                               int x3,
                               int y3,
                               int z3)
        Draw a three-point spline.
      • setTexture

        public void setTexture(int[] texturePix,
                               int width,
                               int height,
                               int blendingMode,
                               int filteringType)
        Set texture image as array of pixels and image dimensions with no multiple repetition.
        Specified by:
        setTexture in interface PvGeometryIf
        See Also:
        setTexture(int [], int, int, int, int, int, int, int, int)
        Version:
        15.11.00, 1.10 revised (kp) Reset texture flags if null image passed.
      • setTexture

        public void setTexture(int[] texturePix,
                               int width,
                               int height,
                               int tilingWidth,
                               int tilingHeight,
                               int periodic,
                               int blendingMode,
                               int filteringType,
                               int textureSide)
        Set texture image as array of pixels and image dimensions with multiple repetition.
        Specified by:
        setTexture in interface PvGeometryIf
        Since:
        JavaView 3.96.012
        See Also:
        setTexture(int [], int, int, int, int)
        Version:
        18.06.06, 2.10 revised (kp) Parameter textureSide added.
        04.06.06, 2.00 created (kp) Created from body of setTexture(int[],int,int,int,int).
        15.11.00, 1.10 revised (kp) Reset texture flags if null image passed.
      • setTransparency

        public void setTransparency(double trans)
        Transparency is in [0, 1.] where 0. corresponds to opaque and 1. to fully transparent.
        Specified by:
        setTransparency in interface PvGeometryIf
        Overrides:
        setTransparency in class PgJvxSrc
      • setPolygons

        public void setPolygons(PiVector[] polygon)
        Copy the first m_numPolygons of given array into polygon array. Must call setNumPolygons(int) before to allocate argument array. If argument array too small do nothing.
        Specified by:
        setPolygons in interface PvGeometryIf
        Overrides:
        setPolygons in class PgJvxSrc
        Parameters:
        polygon - array of polygon vectors to be copied
      • addPolygon

        public int addPolygon(PiVector aPolygon)
        Increment the number of polygons and add given polygon.
        Specified by:
        addPolygon in interface PgGeometryIf
        Overrides:
        addPolygon in class PgJvxSrc
        Parameters:
        aPolygon - polygon to be added to polygon list
        Returns:
        int index of added polygon in polygon list
      • setVertexNormals

        public void setVertexNormals(PdVector[] normalList)
        Method uses superclass to assign and remove vertex normals, but during removal also removes also the transformed vertex normels.
        Specified by:
        setVertexNormals in interface PvGeometryIf
        Overrides:
        setVertexNormals in class PgJvxSrc
        Parameters:
        normalList - array with new vertex normals, or null.
        Since:
        JavaView 3.07.001
        Version:
        30.01.04, 1.00 created (kp)
      • assureVertexNormals

        public void assureVertexNormals()
        Assures respectively allocates correct length of transformed element normal array. Length of array is equal to length of element array. Dimension of normal vectors is equal to dimension of transformed vertices.
        Overrides:
        assureVertexNormals in class PgJvxSrc
      • setElementNormals

        public void setElementNormals(PdVector[] normalList)
        Method uses superclass to assign and remove element normals, but during removal also removes also the transformed element normels.
        Specified by:
        setElementNormals in interface PvGeometryIf
        Overrides:
        setElementNormals in class PgJvxSrc
        Parameters:
        normalList - array with new element normals, or null.
        Since:
        JavaView 3.07.001
        Version:
        30.01.04, 1.00 created (kp)
      • assureElementNormals

        public void assureElementNormals()
        Assures respectively allocates correct length of transformed element normal array. Length of array is equal to length of element array. Dimension of normal vectors is equal to dimension of transformed vertices.
        Overrides:
        assureElementNormals in class PgJvxSrc
      • setNumVectorFields

        public void setNumVectorFields(int num)
        Set number of allocated and used vector fields. This methods calls the same method of superclass, and allocates arrays for projected vectors.
        Specified by:
        setNumVectorFields in interface PvGeometryIf
        Overrides:
        setNumVectorFields in class PgJvxSrc
        Parameters:
        num - number of vector fields
      • setNumVectors

        public void setNumVectors(int ind,
                                  int num,
                                  int dimOfVectors)
        Set number of vectors of a vector field with given index. After calling same method of superclass, we allocate space for the projected vectors.
        Specified by:
        setNumVectors in interface PvGeometryIf
        Overrides:
        setNumVectors in class PgJvxSrc
        Parameters:
        ind - index of vector field
        num - number of vectors in that vector field
        dimOfVectors - dim of vectors in that vector field
"JavaView? v5.03.003"

"

The software JavaView? is copyright protected. All Rights Reserved.
"

You see the box below because you did not login.