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

Class PgGeometry

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PgGeometryIf
    Direct Known Subclasses:
    PgAxes, PgJvxSrc, PgPointSet, PgSurfacePair, PgVectorField, PsKeyframe


    public abstract class PgGeometry
    extends PsObject
    implements PgGeometryIf
    Abstract class for all geometry classes in JavaView, and implementation of PgGeometryIf. Users may derive their own geometry classes either from this class resp. its subclasses, or by writing a class implementing the interface PgGeometryIf. Either of the two options is required to view the geometry in a JavaView display.
    See Also:
    PgGeometryIf, PvDisplayIf, Serialized Form
    Author:
    Konrad Polthier
    Version:
    11.11.07, 3.80 revised (kp) Correct get/setJVX() when geometry has ambient space or projection.
    12.06.04, 3.70 revised (kp) Color of labels improved.
    29.07.03, 3.60 revised (kp) Get/setState() methods implemented to replace some of the internal flags.
    25.07.03, 3.50 revised (kp) Adjust the default labeling of elements to be at the element center.
    28.12.01, 3.40 revised (kp) New method getDisplayList() which replaces getDisplays().
    20.12.01, 3.40 revised (ep) Internationalization.
    15.09.01, 3.30 revised (ur) Modification of method fillMethodMenu for reorganization of Method Menus.
    29.04.01, 3.20 revised (kp) Modeling matrix of ambient space added.
    22.06.00, 3.10 revised (kp) Variable m_dimOfSimplex added.
    02.04.00, 3.00 revised (kp) PdColor replaced with Color in lists.
    30.09.99, 2.60 created (kp) Methods to print indices in display added.
    19.08.99, 2.50 revised (kp) Most code from update() moved to PsObject, display in hash table.
    14.11.98, 2.00 revised (kp) Clean up and documenting.
    00.00.97, 1.00 created (kp)
    • Constructor Detail

      • PgGeometry

        public PgGeometry()
        Constructor.
      • PgGeometry

        public PgGeometry(int aDim)
        Constructor with dimension of geometric points, must be constant for all points. The initial value of the dimension is a required argument of the constructor.
        Parameters:
        aDim - dimension of geometric points
        See Also:
        getDimOfVertices()
    • Method Detail

      • init

        public void init()
        Initializes and resets geometry.
        Overrides:
        init in class PsObject
      • isEnabledInstanceSharing

        public boolean isEnabledInstanceSharing()
        Determines if sharing of vertices and other instances with a base geometry is enabled when this instance is filled in PgGeomtry#getJvx().
        Since:
        JavaView 3.84.012
        Version:
        04.02.05, 1.00 created (kp)
      • setEnabledInstanceSharing

        public void setEnabledInstanceSharing(boolean flag)
        Determines if sharing of vertices and other instances with a base geometry is enabled when this instance is filled in PgGeomtry#getJvx().

        If sharing is enabled then base geometry and this container physically share memory of many instance arrays such as vertex, normal, face etc arrays. Sharing should be carefully enabled and special care must be taken.

        Since:
        JavaView 3.84.012
        Version:
        04.02.05, 1.00 created (kp)
      • setAuthorInfo

        public void setAuthorInfo(PsAuthorInfo authorInfo)
        Set author information by copying or cloning the argument author info. If argument is null then this author info is also nulled.
        Specified by:
        setAuthorInfo in interface PgGeometryIf
      • getAuthors

        public PsAuthorInfo getAuthors()
        Deprecated. used getAuthorInfo()
        Get author information.
      • setAuthors

        public void setAuthors(PsAuthorInfo author)
        Deprecated. used setAuthorInfo(PsAuthorInfo)
        Set author information.
      • setGeometryInfo

        public void setGeometryInfo(PsGeometryInfo geometryInfo)
        Set geometry information by copying or cloning the argument geometry info. If argument is null then this geometry info is also nulled.
        Specified by:
        setGeometryInfo in interface PgGeometryIf
      • getVersion

        public java.lang.String getVersion()
      • setVersion

        public void setVersion(java.lang.String version)
      • getVersionType

        public java.lang.String getVersionType()
      • setVersionType

        public void setVersionType(java.lang.String versionType)
      • getDiameter

        public double getDiameter()
        Get diameter of object which is the diagonal in the bounding box.
      • getBounds

        public PdVector[] getBounds()
        Compute bounding box of the vertices which are transformed with ambient and model matrix.

        The two returned bounding box vectors are 3-dimensional. If dimension of vertices is less than 3 then remaining components are zeroed.

        Note, transformation not supported yet.

        Returns:
        two 3d vectors which are the extremal corners of the bounding cube
        See Also:
        getAmbientBounds()
        Version:
        14.05.01, 1.10 revised (kp) Dimension of bounding box vectors now always 3.
      • getAmbientBounds

        public PdVector[] getAmbientBounds()
        Compute bounding box of this geometry from the set of all vertices, or return null if no vertices. Method returns two vectors whose size is equal to the dimension of this geometry. The two bounding vectors are first, the minimal corner, and second, the maximal corner of the bounding m_dim-cube. Both vectors uniquely determine the bounding box.

        Subclasses may return null if no geometric size information available, for example, no vertices allocated yet.

        Note, the bounding box does not include transformations from the ambient or model matrix.

        Returns:
        two vectors which are the extremal corners of the bounding cube
        See Also:
        getBounds()
        Version:
        14.05.01, 1.00 created (kp)
      • getCenter

        public PdVector getCenter()
        Get center of geometry which local transformations use as origin. If the center has not been set then the origin of the world is returned, which is usually (0,0,0).
        Returns:
        a vector which is the local origin of the geometry
        Version:
        21.10.00, 1.10 revised (kp) Allocate center of it does not exist.
      • setCenter

        public void setCenter(PdVector center)
        Set center of geometry which local transformations use as origin. This method sets an instance variable and does not modify vertices.
        Parameters:
        center - vector which becomes the local origin of the geometry
        Version:
        21.10.00, 1.10 revised (kp) Allocate center of it does not exist.
      • isConfigurable

        public boolean isConfigurable(int panel)
        Determine whether class has a configuration panel of a given type. Default status is that class has no configuration panel. Possible choices of argument are HAS_INFO_PANEL or HAS_MATERIAL_PANEL or HAS_TEXTURE_PANEL or HAS_CONFIG_PANEL.
        Specified by:
        isConfigurable in interface PgGeometryIf
        Parameters:
        panel - Identifier of panel
        Version:
        16.09.00, 1.10 revised (kp) Int argument panel added.
        01.08.00, 1.00 created (kp)
      • getDimOfSimplex

        public int getDimOfSimplex()
        Get dimension of simplicial complex, i.e. maximal dimension of occurring simplices. For example, polygonal curves have simplex dimension 1, triangulated surfaces 2, and volumes have 3. Usually, this variable must be set in the constructor of a class.
        Specified by:
        getDimOfSimplex in interface PgGeometryIf
        Since:
        JavaView 1.95
        See Also:
        setDimOfSimplex(int)
      • setDimOfSimplex

        public void setDimOfSimplex(int dim)
        Set dimension of simplicial complex, i.e. maximal dimension of occurring simplices. For example, polygonal curves have simplex dimension 1, triangulated surfaces 2, and volumes have 3. Usually, this variable must be set in the constructor of a class.
        Since:
        JavaView 1.95
        See Also:
        getDimOfSimplex()
      • getJvx

        public PgJvxSrc getJvx()
        Fills a geometry object with data from this instance, for example, to print to file.
        Specified by:
        getJvx in interface PgGeometryIf
        Returns:
        src a geometry source filled with data from this instance.
      • setJvx

        public void setJvx(PgJvxSrc src)
        Fill this instance with data from a geometry source, for example, previously read from file.
        Specified by:
        setJvx in interface PgGeometryIf
        Parameters:
        src - a geometry source used to fill this instance with data.
      • toString

        public java.lang.String toString()
        Create a multi-line string representation with detailed information about all instance variables.
        Specified by:
        toString in interface PgGeometryIf
        Overrides:
        toString in class PsObject
      • clone

        public java.lang.Object clone()
        Duplicate geometry by recursively cloning all instance variables except inspector panels and lists of registered listeners. The parent relationship is maintained only within this class but not to external classes. In general, all links of the clone to external objects are set to null.

        Display list is not cloned but set to null. Method menu is not cloned.

        Specified by:
        clone in interface PgGeometryIf
        Overrides:
        clone in class PsObject
        See Also:
        copy(PsObject)
        Version:
        21.12.00, 1.25 revised (kp) No longer clone method menu.
        12.12.00, 1.20 revised (kp) Descriptions moved from PgJvxSrc to this class.
        21.10.00, 1.10 revised (kp) Missing cloning of method menu added.
        05.07.00, 1.00 created (kp)
      • copy

        public void copy(PsObject object)
        Copy argument object into this object by recursively copying all instance variables. Does not copy dimension of vertices, author info, geometry info, and visibility attributes.

        The argument was changed from PgGeometry to PsObject since there were problems in J/Link which preferred to use PsObject#copy(PsObject) instead of PgGeometry#copy(PsObject).

        Overrides:
        copy in class PsObject
        See Also:
        PsObject.clone()
        Version:
        24.03.02, 2.10 revised (kp) No longer copy the type.
        19.03.02, 2.00 revised (kp) Additional instance variables copied.
        08.11.02, 1.10 revised (kp) Argument changed to PsObject from PgGeometry.
      • update

        public boolean update(java.lang.Object event)
        Update method of geometry updates registered panels, update listeners, and invokes a repaint in the registered displays.

        Usage:

        1. 1. event == this : geometry has changed, all panels will be updated.
        2. 2. event == null : geometry has changed, no need to update a panel.
        3. 3. event == a panel : geometry has changed, all panels except 'panel' will be updated.
        4. 4. event == else : unhandled event, error.
        Panels are not updated if they have not been created yet, or if they are not visible.

        Any update is forwarded to the parent of the geometry with the geometry as event.

        Any update is forwarded to each registered display with the geometry as event which leads to a repaint of the display.

        Specified by:
        update in interface PsUpdateIf
        Overrides:
        update in class PsObject
        Parameters:
        event - carries a lot of information
        Returns:
        true if event has been handled, otherwise false
        See Also:
        PsObject.setParent(PsUpdateIf), PsObject.getFather(), PsObject.addUpdateListener(PsUpdateIf)
      • getDimOfVertices

        public int getDimOfVertices()
        Retrieve dimension of vertices, which must be the same for all vertices. An initial value of the dimension is a required argument of the constructor. The dimension of vertices is read-only.
        Specified by:
        getDimOfVertices in interface PgGeometryIf
        See Also:
        PgGeometry(int)
      • setDimOfVertices

        public void setDimOfVertices(int dim)
        Set dimension of vertices. Internal use only, public access must assign dimension of vertices in the constructor.
        Version:
        14.11.07, 1.10 revised (kp) Made public since interfaces need access.
      • getAmbientSpace

        public int getAmbientSpace()
        Get ambient space used in model transformations.
        Specified by:
        getAmbientSpace in interface PgGeometryIf
        Returns:
        One of the values PgGeometryIf#AMBIENT_...
      • setAmbientSpace

        public void setAmbientSpace(int mode)
        Set ambient space used in model transformations.
        Specified by:
        setAmbientSpace in interface PgGeometryIf
        Parameters:
        mode - One of the values PgGeometryIf#AMBIENT_...
      • getAmbientProjection

        public int getAmbientProjection()
        Get projection mode of ambient space used in model transformations.
        Specified by:
        getAmbientProjection in interface PgGeometryIf
        Returns:
        One of the values PgGeometryIf#PROJ_...
      • setAmbientProjection

        public void setAmbientProjection(int mode)
        Set projection mode of ambient space used in model transformations.
        Specified by:
        setAmbientProjection in interface PgGeometryIf
        Parameters:
        mode - One of the values PgGeometryIf#PROJ_...
      • getState

        public boolean getState(int aKey)
        Get a drawing flag of this geometry. Method used be overwritten by subclasses to catch specific states. Currently, this method is not intended for public use.

        This method catches unhandled keys of subclasses. Subclasses should overwrite this method and call super for unhandled keys.

        Parameters:
        aKey - flag to be set, choose among PvGeometryIf.SHOW_...
        Returns:
        boolean state of this key
        Since:
        JavaView 2.89.000
        Version:
        29.07.03, 1.00 created (kp)
      • setState

        public void setState(int aKey,
                             boolean aState)
        Set a drawing flag of this geometry. Method used be overwritten by subclasses to catch specific states. Currently, this method is not intended for public use.

        This method catches unhandled keys of subclasses. Subclasses should overwrite this method and call super for unhandled keys.

        Specified by:
        setState in interface PgGeometryIf
        Parameters:
        aKey - flag to be set, choose among PvGeometryIf.SHOW_...
        aState - enable or disable state
        Since:
        JavaView 2.89.000
        Version:
        29.07.03, 1.00 created (kp)
      • getModelMatrix

        public PdMatrix getModelMatrix()
        Get a copy of the model matrix of geometry. If geometry has no model matrix, then create and assign the identity matrix and return it.
        Specified by:
        getModelMatrix in interface PgGeometryIf
      • hasModelMatrix

        public boolean hasModelMatrix()
        Check if geometry has a model matrix.
        Specified by:
        hasModelMatrix in interface PgGeometryIf
      • setModelMatrix

        public void setModelMatrix(PdMatrix modelMat)
        Set model matrix of geometry to copy of argument matrix. If argument is null then model matrix is removed.
        Specified by:
        setModelMatrix in interface PgGeometryIf
      • applyModelingMatrix

        public boolean applyModelingMatrix()
        Multiply the modeling matrix to all geometry items. Method of this class does nothing. Subclasses are expected to reset the modeling matrix of this geometry to the identity matrix.
        Returns:
        true if this geometry has a model matrix.
        Since:
        JavaView 3.24
        Version:
        16.05.04, 1.00 created (kp)
      • applyAmbientMatrix

        public boolean applyAmbientMatrix()
        Multiply the ambient matrix to all geometry items. Method of this class does nothing. Subclasses are expected to reset the ambient matrix of this geometry to the identity matrix.
        Returns:
        true if this geometry has a ambient matrix.
        Since:
        JavaView 3.24
        Version:
        16.05.04, 1.00 created (kp)
      • getAmbientMatrix

        public PdMatrix getAmbientMatrix()
        Get a reference of the ambient model matrix of geometry. If geometry has no ambient matrix, then create and assign the identity matrix and return it.
        Specified by:
        getAmbientMatrix in interface PgGeometryIf
      • getAmbientInvMatrix

        public PdMatrix getAmbientInvMatrix()
        Get a reference of the inverse ambient model matrix of geometry. If geometry has no ambient matrix, then create and assign the identity matrix and return it.
        Specified by:
        getAmbientInvMatrix in interface PgGeometryIf
      • hasAmbientMatrix

        public boolean hasAmbientMatrix()
        Check for ambient model matrix of geometry.
        Specified by:
        hasAmbientMatrix in interface PgGeometryIf
      • setAmbientMatrix

        public void setAmbientMatrix(PdMatrix ambientMat,
                                     PdMatrix ambientInvMat)
        Set ambient model matrix of geometry to copy of argument matrix. If one argument is null then the ambient model matrices are removed. Note, the ambient projection remains unchanged.
        Specified by:
        setAmbientMatrix in interface PgGeometryIf
      • projectFromAmbientSpace

        public boolean projectFromAmbientSpace()
        Apply projection matrix and perform projection determined by projection flag of the surface in a Euclidean model R3, R2, or R1 with parallel projection. Dimension of vertices may be decremented by one after this operation.
        Returns:
        true if operation was applied successfully.
        Since:
        JavaView 3.24.001
        Version:
        16.05.04, 1.00 created (kp) Moved here from PgPointSet.
      • isVisible

        public boolean isVisible()
        Check the visibility flag of the geometry. A geometry may be hidden to be invisible in all displays by setting the visibility flag.
        Specified by:
        isVisible in interface PgGeometryIf
        See Also:
        setVisible(boolean)
      • setVisible

        public void setVisible(boolean flag)
        Set the visibility flag of the geometry. A geometry may be hidden to be invisible in all displays by setting the visibility flag. This does not remove the geometries from the displays but just deactivates their drawing.
        Specified by:
        setVisible in interface PgGeometryIf
        See Also:
        isVisible()
      • isShowingName

        public boolean isShowingName()
        Check whether showing of name of geometry is switched on. On default, showing of name is disabled.
        Since:
        JavaView 2.47
        See Also:
        showTitle(boolean), PsObject.setName(String)
        Version:
        26.11.02, 1.00 created (kp)
      • showName

        public void showName(boolean flag)
        Enable and disable showing of name of geometry in display. On default, showing of title is disabled.
        Since:
        JavaView 2.47
        See Also:
        showTitle(boolean), PsObject.setName(String)
        Version:
        26.11.02, 1.00 created (kp)
      • isShowingBndBox

        public boolean isShowingBndBox()
        Get flag if drawing of bounding box is enabled.
      • showBndBox

        public void showBndBox(boolean flag)
        Set flag to enable drawing of bounding box.
      • isShowingCenter

        public boolean isShowingCenter()
        Get flag if drawing of center of geometry is enabled.
      • showCenter

        public void showCenter(boolean flag)
        Set flag to enable drawing of center of geometry.
      • getLabelAttribute

        public PiVector getLabelAttribute(int type)
        Get offset vector in pixel coordinates of label w.r.t. base point. First two components are pixel coordinates. Third component is in [1..3] and indices whether head, center or tail is located at base+offset. Fourth component indicates font. Note, (0,0) is in the upper left corner of the screen. For possible type see PvGeometryIf#GEOM_ITEM_POINT and other items.
        Parameters:
        type - type of label, vertex, polygon, element or title labels.
        Returns:
        vector with three components, x, y, and position on string.
      • setLabelAttribute

        public boolean setLabelAttribute(int type,
                                         int xOffset,
                                         int yOffset,
                                         int horAdjust,
                                         int verAdjust,
                                         int font)
        Set offset vector in pixel coordinates of label w.r.t. base point. The base point of vertices is the vertex, the base point of elements and edges and polygon edges is the barycenter, i.e. midpoint.

        First two components of attr are pixel coordinates determining the offset with respect to the base point. For example, an offset pair (1,-2) locates label center 1 to the right and 2 pixels up of the base point (since the upper left corner of the display is (0,0) in screen coordinates).

        Third component of attr is PgGeometryIf.LABEL_HEAD or PgGeometryIf.LABEL_CENTER or PgGeometryIf.LABEL_TAIL and indicates whether head, tail, or center of label is located at base+offset.

        Fourth component of attr is PgGeometryIf.LABEL_TOP or PgGeometryIf.LABEL_MIDDLE or PgGeometryIf.LABEL_BASE and indicates whether top, middle, or base of label is located at base+offset. Not implemented yet.

        Fifth component of attr indicates font. For possible fonts see PsConfig.

        Note, it is currently not possible to set the label attribute, say, of a single vertex unless you have a geometry with just one vertex.

        There exist one vector for each of the basic primitive types GEOM_ITEM_POINT, GEOM_ITEM_EDGE,GEOM_ITEM_POLYGON,GEOM_ITEM_ELEMENT,GEOM_ITEM_TETRA, GEOM_ITEM_NAME and GEOM_ITEM_TITLE. For possible type see PvGeometryIf#GEOM_ITEM_POINT and other items.

        Parameters:
        type - Type of geometry items affected by this setting
        xOffset - Offset in x-direction in pixels.
        yOffset - Offset in y-direction in pixels.
        horAdjust - Layout in horizontal direction, see PgGeometryIf#LABEL_.
        verAdjust - Layout in vertical direction, see PgGeometryIf#LABEL_.
        font - Identifier of font, see PsConfig#FONT_
        Returns:
        false if type is unknown.
        Version:
        11.09.00, 1.10 revised (kp) Argument changes to sequence of int's from PiVector.
        10.08.00, 1.00 created (kp)
      • setLabelAttribute

        public boolean setLabelAttribute(int type,
                                         PiVector labelAtt)
        Set attributes of labels of given type. Methods just calls setLabelAttribute(int,int,int,int,int,int) with integer arguments. Length of vector must be equal to (or larger than) 5.
        Parameters:
        type - Type of geometry items affected by this setting
        labelAtt - Vector with different attribute values
      • getLabelColor

        public java.awt.Color getLabelColor(int type)
        Get color of specified label type.

        Basic primitive types are GEOM_ITEM_POINT, GEOM_ITEM_EDGE, GEOM_ITEM_POLYGON, GEOM_ITEM_ELEMENT, GEOM_ITEM_TETRA, GEOM_ITEM_NAME and GEOM_ITEM_TITLE. For possible type see PvGeometryIf#GEOM_ITEM_POINT.

        Parameters:
        type - Type of geometry items affected by this setting
        Since:
        JavaView 3.28.002
        Version:
        12.06.04, 1.00 created (kp)
      • setLabelColor

        public void setLabelColor(int type,
                                  java.awt.Color color)
        Set color of specified label type.

        Basic primitive types are GEOM_ITEM_POINT, GEOM_ITEM_EDGE, GEOM_ITEM_POLYGON, GEOM_ITEM_ELEMENT, GEOM_ITEM_TETRA, GEOM_ITEM_NAME and GEOM_ITEM_TITLE. For possible type see PvGeometryIf#GEOM_ITEM_POINT.

        Parameters:
        type - Type of geometry items affected by this setting
        color - Color used to draw the label
        Since:
        JavaView 3.05.003
        Version:
        22.01.04, 1.00 created (kp)
      • getLabelSize

        public double getLabelSize(int type)
        Get font size of specified label type.

        Basic primitive types are GEOM_ITEM_POINT, GEOM_ITEM_EDGE, GEOM_ITEM_POLYGON, GEOM_ITEM_ELEMENT, GEOM_ITEM_TETRA, GEOM_ITEM_NAME and GEOM_ITEM_TITLE. For possible type see PvGeometryIf#GEOM_ITEM_POINT.

        Parameters:
        type - Type of geometry items affected by this setting
        Since:
        JavaView 3.52.001
        Version:
        15.08.04, 1.00 created (kp)
      • setLabelSize

        public void setLabelSize(int type,
                                 double size)
        Set font size of specified label type.

        Basic primitive types are GEOM_ITEM_POINT, GEOM_ITEM_EDGE, GEOM_ITEM_POLYGON, GEOM_ITEM_ELEMENT, GEOM_ITEM_TETRA, GEOM_ITEM_NAME and GEOM_ITEM_TITLE. For possible type see PvGeometryIf#GEOM_ITEM_POINT.

        Parameters:
        type - Type of geometry items affected by this setting
        size - Font size used to draw the label
        Since:
        JavaView 3.52.001
        Version:
        15.08.04, 1.00 created (kp)
      • getLabelFont

        public java.lang.String getLabelFont(int type)
        Get font name of specified label type.

        Basic primitive types are GEOM_ITEM_POINT, GEOM_ITEM_EDGE, GEOM_ITEM_POLYGON, GEOM_ITEM_ELEMENT, GEOM_ITEM_TETRA, GEOM_ITEM_NAME and GEOM_ITEM_TITLE. For possible type see PvGeometryIf#GEOM_ITEM_POINT.

        Parameters:
        type - Type of geometry items affected by this setting
        Since:
        JavaView 3.52.001
        Version:
        15.08.04, 1.00 created (kp)
      • setLabelFont

        public void setLabelFont(int type,
                                 java.lang.String font)
        Set font name of specified label type.

        Basic primitive types are GEOM_ITEM_POINT, GEOM_ITEM_EDGE, GEOM_ITEM_POLYGON, GEOM_ITEM_ELEMENT, GEOM_ITEM_TETRA, GEOM_ITEM_NAME and GEOM_ITEM_TITLE. For possible type see PvGeometryIf#GEOM_ITEM_POINT.

        Parameters:
        type - Type of geometry items affected by this setting
        font - Font used to draw the label
        Since:
        JavaView 3.52.001
        Version:
        15.08.04, 1.00 created (kp)
      • getLabelStyle

        public int getLabelStyle(int type)
        Get font style of specified label type.

        Basic primitive types are GEOM_ITEM_POINT, GEOM_ITEM_EDGE, GEOM_ITEM_POLYGON, GEOM_ITEM_ELEMENT, GEOM_ITEM_TETRA, GEOM_ITEM_NAME and GEOM_ITEM_TITLE. For possible type see PvGeometryIf#GEOM_ITEM_POINT.

        Parameters:
        type - Type of geometry items affected by this setting
        Since:
        JavaView 3.52.001
        Version:
        15.08.04, 1.00 created (kp)
      • setLabelStyle

        public void setLabelStyle(int type,
                                  int style)
        Set font style of specified label type.

        Basic primitive types are GEOM_ITEM_POINT, GEOM_ITEM_EDGE, GEOM_ITEM_POLYGON, GEOM_ITEM_ELEMENT, GEOM_ITEM_TETRA, GEOM_ITEM_NAME and GEOM_ITEM_TITLE. For possible type see PvGeometryIf#GEOM_ITEM_POINT.

        Parameters:
        type - Type of geometry items affected by this setting
        style - Font style used to draw the label
        Since:
        JavaView 3.52.001
        Version:
        15.08.04, 1.00 created (kp)
      • getMaterialPanel

        public PsPanel getMaterialPanel()
        Get material panel - if it does not exist try to allocate it. Standard panel for inspecting material properties of geometry.

        Method is a shortcut to avoid checking, creating, and adding the panel to the inspector list.

        Specified by:
        getMaterialPanel in interface PgGeometryIf
        Version:
        03.06.01, 2.00 revised (kp) Method simply calls assureInspector().
        07.06.00, 1.10 revised (kp) Recreate panel if language has changed.
      • getControlPanel

        public PsPanel getControlPanel()
        Get control panel - if it does not exist try to allocate it. Standard panel for inspecting functional data of a geometry, usually used by subclasses of geometry classes which have additional functionality.

        Method is a shortcut to avoid checking, creating, and adding the panel to the inspector list.

        Specified by:
        getControlPanel in interface PgGeometryIf
        Version:
        03.06.01, 2.00 revised (kp) Method simply calls assureInspector().
        07.06.00, 1.10 revised (kp) Recreate panel if language has changed.
      • fillMethodMenu

        public java.awt.Menu fillMethodMenu(java.awt.Menu menu)
        Deprecated. use fillMethodMenu(Menu, PvViewerIf)
        Fill menu with items to invoke advanced methods of this geometry.
        Specified by:
        fillMethodMenu in interface PgGeometryIf
        Version:
        04.02.02, 1.20 revised (kp) Initiate an update of a menu right after calling its init() method.
        11.09.01, 1.10 revised (ur) Adding contents of jvx methods to m_methodMenu modified.
      • fillMethodMenu

        public java.awt.Menu fillMethodMenu(java.awt.Menu menu,
                                            PvViewerIf viewer)
        Fill menu with items to invoke advanced methods of this geometry. Via the optional parameter viewer the methods invoked by the menu may access the displays and inspectors of the environment.
        Specified by:
        fillMethodMenu in interface PgGeometryIf
        Parameters:
        menu - parent menu to which this menu is added.
        viewer - optional viewer manager from which methods may access displays and inspectors.
        Since:
        JavaView 2.45
        Version:
        08.02.07, 1.60 revised (kp) Further method menus may be specified, comma separated in PsJavaView.FILE_MENU.
        05.07.04, 1.50 revised (kp) Menus from archive dev added (currently only in application mode).
        04.02.02, 1.20 revised (kp) Initiate an update of a menu right after calling its init() method.
        11.09.01, 1.10 revised (ur) Adding contents of jvx methods to m_methodMenu modified.
      • removeMethodMenus

        public void removeMethodMenus()
        Remove all menus with items to invoke advanced methods of this geometry.
        Specified by:
        removeMethodMenus in interface PgGeometryIf
        Version:
        05.06.02, 1.00 revised (kp)
        05.06.02, 1.00 created (kp)
      • addDisplay

        public boolean addDisplay(PvDisplayIf display)
        Register a new display. Display will be informed by update() whenever geometry changes require a repaint of the display. For example, method is called from PvDisplay when registering the geometry in the display.
        Specified by:
        addDisplay in interface PgGeometryIf
        Parameters:
        display - Display to be registered
        Returns:
        false if instance already registered.
        See Also:
        getDisplays()
      • getDisplayList

        public java.util.Vector getDisplayList()
        Get all registered displays as vector.
        Returns:
        Enumeration of registered displays, null if no displays found.
        See Also:
        getDisplays()
      • removeDisplay

        public boolean removeDisplay(PvDisplayIf display)
        Remove a registered display from list of registered displays. For example, method is called from PvDisplay when removing the geometry from the display.
        Specified by:
        removeDisplay in interface PgGeometryIf
        Parameters:
        display - Registered display to be removed
        Returns:
        false if display does not exists.
        See Also:
        addDisplay(PvDisplayIf)
      • addVertex

        public int addVertex(PdVector aVertex)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        addVertex in interface PgGeometryIf
        Parameters:
        aVertex - vector with new vertex coordinates
      • getVertex

        public PdVector getVertex(int anIndex)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        getVertex in interface PgGeometryIf
        Parameters:
        anIndex - index of vertex to be returned
        Returns:
        reference to vertex vector with given index
      • removeVertex

        public int[] removeVertex(int anIndex)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        removeVertex in interface PgGeometryIf
        Parameters:
        anIndex - index of vertex to be removed
        Returns:
        array with indices of new positions of vertices
      • setVertex

        public boolean setVertex(int anIndex,
                                 PdVector aVertex)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        setVertex in interface PgGeometryIf
        Parameters:
        anIndex - index of vertex to be changed
        aVertex - vector with new vertex coordinates
      • addPolygon

        public int addPolygon(PiVector aPolygon)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        addPolygon in interface PgGeometryIf
        Parameters:
        aPolygon - vector with indices of vertices in global vertex array
      • getPolygon

        public PiVector getPolygon(int anIndex)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        getPolygon in interface PgGeometryIf
        Parameters:
        anIndex - index of polygon to be returned
        Returns:
        reference to polygon vector with given index
      • removePolygon

        public int[] removePolygon(int anIndex)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        removePolygon in interface PgGeometryIf
        Parameters:
        anIndex - index of polygon to be removed
        Returns:
        array with indices of new positions of polygons
      • setPolygon

        public boolean setPolygon(int anIndex,
                                  PiVector aPolygon)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        setPolygon in interface PgGeometryIf
        Parameters:
        anIndex - index of polygon to be changed
        aPolygon - vector with indices of vertices in global vertex array
      • addElement

        public int addElement(PiVector anElement)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        addElement in interface PgGeometryIf
        Parameters:
        anElement - vector with indices of vertices in global vertex array
      • getElement

        public PiVector getElement(int anIndex)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        getElement in interface PgGeometryIf
        Parameters:
        anIndex - index of element to be returned
        Returns:
        reference to element vector with given index
      • removeElement

        public int[] removeElement(int anIndex)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        removeElement in interface PgGeometryIf
        Parameters:
        anIndex - index of element to be removed
        Returns:
        array with indices of new positions of elements
      • setElement

        public boolean setElement(int anIndex,
                                  PiVector aElement)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        setElement in interface PgGeometryIf
        Parameters:
        anIndex - index of element to be changed
        aElement - vector with indices of vertices in global vertex array
      • clearTagVertex

        public void clearTagVertex(int index,
                                   int aTag)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        clearTagVertex in interface PgGeometryIf
      • hasTagVertex

        public boolean hasTagVertex(int index,
                                    int aTag)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        hasTagVertex in interface PgGeometryIf
      • setTagVertex

        public void setTagVertex(int index,
                                 int aTag)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        setTagVertex in interface PgGeometryIf
      • clearTagPolygon

        public void clearTagPolygon(int index,
                                    int aTag)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        clearTagPolygon in interface PgGeometryIf
      • hasTagPolygon

        public boolean hasTagPolygon(int index,
                                     int aTag)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        hasTagPolygon in interface PgGeometryIf
      • setTagPolygon

        public void setTagPolygon(int index,
                                  int aTag)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        setTagPolygon in interface PgGeometryIf
      • clearTagElement

        public void clearTagElement(int index,
                                    int aTag)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        clearTagElement in interface PgGeometryIf
      • hasTagElement

        public boolean hasTagElement(int index,
                                     int aTag)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        hasTagElement in interface PgGeometryIf
      • setTagElement

        public void setTagElement(int index,
                                  int aTag)
        Method does nothing and may be overridden by subclasses.
        Specified by:
        setTagElement in interface PgGeometryIf
      • convertWorldToModel

        public static void convertWorldToModel(PgGeometryIf geom,
                                               PdVector baseWorld,
                                               PdVector dirWorld,
                                               PdVector baseModel,
                                               PdVector dirModel)
        Convert 3D world coordinates into 3D model coordinates of current geometry by multiplication of world coordinates with the inverse model matrix.

        If geometry has no model matrix then no operation is performed.

        Parameters:
        geom - geometry whose model matrix is used, if it exists
        baseWorld - 3D world coordinates of view point
        dirWorld - 3D world coordinates of view direction
        baseModel - 3D model coordinates of view point
        dirModel - 3D model coordinates of view direction
        Version:
        01.04.06, 1.00 created (kp)
      • blend

        public boolean blend(double s,
                             PgGeometry a,
                             double t,
                             PgGeometry b)
        Blend between two geometries, used in interpolation and computing the associate surfaces this = s*a + t*b.
        Specified by:
        blend in interface PgGeometryIf
        Parameters:
        s - weight of vertices of first elementSet
        t - weight of vertices of second elementSet
        a - first source geometry used for blending
        b - second source geometry used for blending
        Returns:
        true on success
        Author:
        Konrad Polthier
        Version:
        02.08.03, 1.10 revised (kp) Copying of status tags added.
        31.12.97, 1.00 created (kp)
      • merge

        public boolean merge(PgGeometryIf geomIf)
        Add another of same geometry of same type to this geometry. If types of geometries are different then nothing is done.

        Method applies model and ambient matrices to argument geometry if such local transformation matrices exist.

        Specified by:
        merge in interface PgGeometryIf
        Parameters:
        geomIf - geometry merged into the current geometry
        Returns:
        true on success
        Version:
        16.05.04, 2.00 revised (kp) Apply ambient and model matrices before merging.
      • getCenterOfElement

        public static PdVector getCenterOfElement(PdVector center,
                                                  PdVector[] vertex,
                                                  int[] vertInd)
        Compute the barycenter of a geometry element like face or polygon edge.
        Parameters:
        center - existing vector of dimension m_dim which will be filled and returned
        vertex - vertex array to which the index vector refers
        vertInd - index vector with indices in the vertex array
        Returns:
        Argument center is filled with the position of the barycenter
        Author:
        Konrad Polthier
        Version:
        03.07.07, 1.10 revised (fk) First argument may now be null. 23.08.00, 1.00 created (kp)
      • reflect

        public PgGeometry reflect(PdMatrix mat,
                                  boolean bOrient,
                                  boolean bVector)
        Generate a cloned geometry and transform vertices by a matrix. For example, this method is called to calculate mirror images of a geometry. Orientation of geometry affects surface vectors.
        Specified by:
        reflect in interface PgGeometryIf
        Parameters:
        mat - 3*3 or 4*4 transformation matrix
        bOrient - flag whether to keep the orientation of the geometry
        bVector - flag whether to keep the orientation of vectors
        Returns:
        new reflected copy of the geometry
        Author:
        Konrad Polthier
        Version:
        12.12.00, 1.10 revised (kp) Additional argument added for orientation of vectors.
        16.11.00, 1.00 created (kp)
      • getTextureImageName

        public java.lang.String getTextureImageName()
        Get name of texture image, a full URL or a relative file name.
        Specified by:
        getTextureImageName in interface PgGeometryIf
      • setTextureImageName

        public void setTextureImageName(java.lang.String name)
        Set name of texture image, a URL or a relative file name.
        Specified by:
        setTextureImageName in interface PgGeometryIf
      • getTextureImage

        public java.awt.Image getTextureImage()
        Get image of texture.
        Specified by:
        getTextureImage in interface PgGeometryIf
      • setTextureImage

        public void setTextureImage(java.awt.Image img)
        Set texture image for vertex and element textures.
        Specified by:
        setTextureImage in interface PgGeometryIf
"JavaView? v5.03.003"

"

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

You see the box below because you did not login.