Documentation of 'jvx.curve.PgTube' Java class
PgTube ("JavaView Reference Manual")
"JavaView? v5.03.003"
jvx.curve

Class PgTube

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


    public class PgTube
    extends PgElementSet
    Class generates a tube either around a given polygon or around edges of an elementSet. In case of polygons tube is generated e.g. by parallel translating a frame. It requires an existing polygon of class PgPolygon and produces a tube which is a subclass of PgElementSet. In case of element sets tube is generated by using vertex normals.

    Note: Currently, the dimension of vertices of tube and of base geometry must be 3.

    See Also:
    PgPolygon, PgPolygonSet, PgElementSet, Serialized Form
    Author:
    Konrad Polthier
    Version:
    29.10.03, 4.30 revised (kp) Method setEnabledArrowPanel() added.
    30.08.03, 4.20 revised (kp) Method setEnabled() added.
    23.06.03, 4.10 revised (ur) Missing color handling for PgElementSets added.
    01.06.03, 4.00 revised (kp) Handling of color and update improved.
    05.05.03, 3.80 revised (ep) Arrow and tube colors from polygon.
    02.05.03, 3.70 revised (ep) Arrow colors from polygon set.
    19.11.02, 3.60 revised (ep) Tube arrows added.
    13.03.02, 3.50 revised (ur) Distribute distortion evenly for closed polygons;
    use polygon colors in PolygonSets to generate ElementColors.
    16.01.02, 3.40 revised (ep) Internationalization.
    29.12.01, 3.30 revised (kp) Two new methods to set the default bounds.
    26.11.01, 3.20 revised (ur) Extended to work on PgPolygonSets.
    11.06.01, 3.10 revised (ur) Set tube as updateListener of polygon/elementSet.
    01.04.00, 3.00 revised (kp) Moved from package jv.rsrc to jvx.geom.
    07.11.99, 2.02 revised (kp) Lower limit of tube discr increased to 2.
    16.07.99, 2.01 revised (kp) update() now ensures that info panel is updated.
    14.02.99, 2.00 revised (kp) Extended to thicken edges of elementSets too.
    13.02.99, 1.50 revised (kp) Tube is now subclass of PgElementSet instead of PgPolygon.
    00.00.97, 1.00 created (kp)
    • Constructor Detail

      • PgTube

        public PgTube(int aDim)
        Constructs a tube with given dimension of vertices. Note: Currently, the dimension of vertices must be 3.
    • Method Detail

      • init

        public void init()
        Initialize tube parameters to default values.
        Overrides:
        init in class PgElementSet
      • isEnabledArrowPanel

        public boolean isEnabledArrowPanel()
        Check if showing of arrow panel in control panel of tube is enabled.
        Since:
        JavaView 2.99.040
        Version:
        29.10.03, 1.00 created (kp)
      • setEnabledArrowPanel

        public void setEnabledArrowPanel(boolean flag)
        Enable showing of arrow panel in control panel of tube.
        Since:
        JavaView 2.99.040
        Version:
        29.10.03, 1.00 created (kp)
      • isEnabled

        public boolean isEnabled()
        Check if tube is enabled or disabled, including its components.
        Since:
        JavaView 2.99.012
        Version:
        30.08.03, 1.00 created (kp)
      • setEnabled

        public void setEnabled(boolean flag)
        Enable or disable the tube for interactive use. If disabled, then the tube can still be modified by method calls and its sliders are always updated.
        Since:
        JavaView 2.99.012
        Version:
        30.08.03, 1.00 created (kp)
      • getDiscr

        public PuInteger getDiscr()
        Get number of vertices around the tube.
      • setDiscr

        public void setDiscr(int discr)
        Set number of vertices around the tube.
      • setDefDiscr

        public void setDefDiscr(int defDiscr)
        Set default number of vertices around the tube.
      • setDefDiscrBounds

        public void setDefDiscrBounds(int min,
                                      int max,
                                      int lineIncr,
                                      int pageIncr)
        Set default bounds for discretization slider.
      • guessThicknessFromDiameter

        public boolean guessThicknessFromDiameter(double diam)
        Based on given diameter of a geometry the method guesses value and bounds of the thickness slider. Internally applied when a new geometry is assigned.
        Parameters:
        diam - diameter of parent geometry
        Returns:
        true if thickness has been changed.
      • getThickness

        public PuDouble getThickness()
        Get radius respectively thickness of the tube.
      • setThickness

        public void setThickness(double thickness)
        Set radius respectively thickness of the tube.
      • setDefThickness

        public void setDefThickness(double defThickness)
        Set default radius respectively thickness of the tube.
      • setDefThicknessBounds

        public void setDefThicknessBounds(double min,
                                          double max,
                                          double lineIncr,
                                          double pageIncr)
        Set default bounds for radius slider.
      • getArrowThickness

        public PuDouble getArrowThickness()
        Get radius of arrow in percent of tube radius.
        Since:
        JavaView 2.44
      • setArrowThickness

        public void setArrowThickness(double percent)
        Set thickness of arrow in percent of tube radius.
        Since:
        JavaView 2.44
      • setDefArrowThickness

        public void setDefArrowThickness(double defArrThick)
        Set default thickness of arrow in percent of tube radius.
        Since:
        JavaView 2.44
      • setDefArrowThicknessBounds

        public void setDefArrowThicknessBounds(double min,
                                               double max,
                                               double lineIncr,
                                               double pageIncr)
        Set default bounds for thickness of arrows in percent of tube radius.
        Since:
        JavaView 2.44
      • getArrowLength

        public PuDouble getArrowLength()
        Get length of arrows in percent of arrow diameter.
        Since:
        JavaView 2.44
      • setArrowLength

        public void setArrowLength(double percent)
        Set length of arrows in percent of arrow diameter.
        Since:
        JavaView 2.44
      • setDefArrowLength

        public void setDefArrowLength(double defArrLen)
        Set default length of arrows in percent of arrow diameter.
        Since:
        JavaView 2.44
      • setDefArrowLengthBounds

        public void setDefArrowLengthBounds(double min,
                                            double max,
                                            double lineIncr,
                                            double pageIncr)
        Set default bounds of arrows in percent of arrow diameter.
        Since:
        JavaView 2.44
      • isEnabledStartArrow

        public boolean isEnabledStartArrow()
        Check flag if arrow is shown at the head of each tube.
      • setEnabledStartArrow

        public void setEnabledStartArrow(boolean flag)
        Set flag if arrow is shown at the head of each tube.
        Since:
        JavaView 2.44
      • isEnabledEndArrow

        public boolean isEnabledEndArrow()
        Check flag if arrow is shown at the tail of each tube.
      • setEnabledEndArrow

        public void setEnabledEndArrow(boolean flag)
        Set flag if arrow is shown at the tail of each tube.
        Since:
        JavaView 2.44
      • isEnabledInduceColors

        public boolean isEnabledInduceColors()
        Check flag whether color of tube are induced from the base geometry. If true then both global and local colors are induced.
        Since:
        JavaView 2.80
        Version:
        31.05.03, 1.00 created (kp)
      • setEnabledInduceColors

        public void setEnabledInduceColors(boolean flag)
        Set flag whether color of tube are induced from the base geometry. If true then both global and local colors are induced. If parameter is false then vertex and element colors are removed from tube.

        Changing this flag will automatically adjust the visibility of local element colors.

        Since:
        JavaView 2.80
        Version:
        16.11.03, 1.20 revised (kp) Synchronize flag for showing element colors.
        30.08.03, 1.10 revised (kp) Remove local colors when argument is false.
        31.05.03, 1.00 created (kp)
      • 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.
        Specified by:
        clone in interface PgGeometryIf
        Overrides:
        clone in class PgElementSet
        See Also:
        PgElementSet.copy(PsObject)
        Version:
        04.08.08, 2.00 revised (kp) All sliders now have correct parents.
        18.03.02, 1.00 created (ur)
      • copy

        public void copy(PsObject object)
        Copy instance variables by duplication, not by copying a reference.
        Overrides:
        copy in class PgElementSet
        See Also:
        clone()
        Version:
        04.08.08, 1.00 created (kp)
      • setElementSet

        public void setElementSet(PgElementSet elementSet)
        Set elementSet to compute thick edges from. You must compute frames and tube per hand or send an update with the polygon as argument.

        Method registers this class as updateListener in the polygon.

        If argument is already registered, method just return. If current elementSet is not null, then it is removed.

        See Also:
        generateThickEdges(), update(Object)
        Version:
        06.10.02, 1.10 revised (kp) Check existing elementSet.
      • removeElementSet

        public void removeElementSet()
        Remove the current element set.

        Method removes this class as updateListener of the element set.

        See Also:
        setElementSet(PgElementSet)
        Version:
        16.11.03, 1.10 revised (kp) No longer initialize this tube when parent is removed.
      • setPolygon

        public void setPolygon(PgPolygon polygon)
        Set polygon, but does not compute the tube. You must compute frames and tube per hand or send an update with the polygon as argument.

        Method registers this class as updateListener in the polygon.

        If argument is already registered, method just return. If current polygon is not null, then it is removed.

        See Also:
        generateFrames(), generateTube(), update(Object)
        Version:
        06.10.02, 1.10 revised (kp) Check existing polygon.
      • removePolygon

        public void removePolygon()
        Remove the current polygon.

        Method removes this class as updateListener of the polygon.

        See Also:
        setPolygon(PgPolygon)
        Version:
        16.11.03, 1.10 revised (kp) No longer initialize this tube when parent is removed.
      • setPolygonSet

        public void setPolygonSet(PgPolygonSet polygonSet)
        Set polygonSet, but does not compute the tube. You must compute frames and tube per hand or send an update with the polygonSet as argument.

        Method registers this class as updateListener in the polygonSet.

        If argument is already registered, method just return. If current polygonSet is not null, then it is removed.

        See Also:
        generateFrames(), generateTube(), update(Object)
        Version:
        06.10.02, 1.10 revised (kp) Check existing polygonSet.
      • removePolygonSet

        public void removePolygonSet()
        Remove the current polygonSet.

        Method de-registers this class as updateListener in the polygonSet.

        See Also:
        setPolygon(PgPolygon)
        Version:
        16.11.03, 1.10 revised (kp) No longer initialize this tube when parent is removed.
      • computeTube

        public void computeTube()
        Recompute the tube after configuration parameters of the tube have been changed. Method assumes that base geometries have not changed.
      • generateFrames

        public PgFrame[] generateFrames()
        Parallel translate a frame along the polygon and store one frame per polygon vertex. This methods must be called whenever the geometry or discretization of the polygon changes. Currently, this method is automatically invoked by PgTube#update.

        Method ignores edges of length 0, therefore, the number of returned frames may be different than the number of vertices.

        The returned frames are later used by method PgTube#generateTube().

        Returns:
        array of frames, one frame for each geometric polygon vertex
        See Also:
        generateTube(), PgFrame
        Author:
        Konrad Polthier
        Version:
        13.03.02, 1.10 revised (ur) Distribute distortion of closed polygons evenly.
        21.09.01, 1.10 revised (kp) Frames are created within this method.
        21.09.01, 1.09 revised (kp) Close polygons are handled.
        08.09.00, 1.02 revised (kp) Return value changed to PgFrame[] from void.
        16.07.99, 1.01 revised (kp) Degenerate frame for 2-vertex polygon removed.
        00.00.98, 1.00 created (kp)
      • generatePolygonSetFrames

        public PgFrame[] generatePolygonSetFrames()
        Parallel translate a frame along the polygons of a polygonSet and store one frame per polygon vertex. This methods must be called whenever the geometry or discretization of the polygonSet changes. Currently, this method is automatically invoked by PgTube#update.

        Method ignores edges of length 0, therefore, the number of returned frames may be different than the number of vertices.

        The returned frames are later used by method PgTube#generateTube().

        Returns:
        array of frames, one frame for each polygon vertex
        See Also:
        generateTube(), PgFrame
        Author:
        Konrad Polthier
        Version:
        13.03.02, 1.10 revised (ur) Distribute distortion of closed polygons evenly.
        26.11.01, 1.00 created (ur)
      • generateTube

        public void generateTube()
        Make tube around polygon using array of previously computed frames and instance variables m_discr and m_thickness.

        Method generateFrames() must be called prior to this method.

        See Also:
        getDiscr(), getThickness(), generateFrames()
        Author:
        Konrad Polthier
        Version:
        13.02.99, 1.01 revised (kp)
        00.00.98, 1.00 created (kp)
      • generateThickEdges

        public void generateThickEdges()
        Make tube around edges of elementSet using instance variables m_disr and m_thickness. Vertex and element normals are recomputed.
        See Also:
        getDiscr(), getThickness()
        Author:
        Konrad Polthier
        Version:
        23.06.03, 1.20 revised (ur) Induce colors to the tubes from vertex or element colors.
        21.09.01, 1.10 revised (kp) Orientation of thick edges changed and normals computed.
        12.07.99, 1.03 revised (kp) makeNeighbour() added at the end of method.
        02.06.99, 1.02 revised (kp) Now check for enough vertex normals instead of equal.
        14.02.99, 1.01 revised (kp) Adapted as method of PgTube.
        23.11.97, 1.00 created (kp) Original version was method of PgElementSet.
"JavaView? v5.03.003"

"

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

You see the box below because you did not login.