jvx.geom
Class PgTube
java.lang.Object
jv.object.PsObject
jv.project.PgGeometry
jv.geom.PgPointSet
jv.geom.PgElementSet
jvx.geom.PgTube
- All Implemented Interfaces:
- java.lang.Cloneable, PgGeometryIf, PsUpdateIf, java.io.Serializable
- 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
| Fields inherited from class jv.object.PsObject |
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS |
| Fields inherited from interface jv.project.PgGeometryIf |
AMBIENT_H2_HYPERBOLIC, AMBIENT_H3_HYPERBOLIC, AMBIENT_H4_HYPERBOLIC, AMBIENT_PROJECTIONS, AMBIENT_R1_EUCLIDEAN, AMBIENT_R2_EUCLIDEAN, AMBIENT_R3_EUCLIDEAN, AMBIENT_R4_EUCLIDEAN, AMBIENT_R5_EUCLIDEAN, AMBIENT_S1_SPHERE, AMBIENT_S2_SPHERE, AMBIENT_S3_SPHERE, AMBIENT_S4_SPHERE, AMBIENT_SPACES, HAS_METHOD_MENU, INSPECTOR_CONTROL, INSPECTOR_CONTROL_EXT, INSPECTOR_MATERIAL, INSPECTOR_MATERIAL_EXT, INSPECTOR_TEXTURE, INSPECTOR_TEXTURE_EXT, LABEL_BASE, LABEL_CENTER, LABEL_HEAD, LABEL_MIDDLE, LABEL_TAIL, LABEL_TOP, m_numLabelTypes, METHOD_EXT, PROJ_KLEIN_BALL, PROJ_PARALLEL, PROJ_POINCARE_BALL, PROJ_STEREOGRAPHIC, PROJ_UPPER_HALFSPACE |
|
Constructor Summary |
PgTube(int aDim)
Constructs a tube with given dimension of vertices.
|
|
Method Summary |
java.lang.Object |
clone()
Duplicate geometry by recursively cloning all instance variables
except inspector panels and lists of registered listeners. |
void |
computeTube()
Recompute the tube after configuration parameters of the tube
have been changed. |
PgFrame[] |
generateFrames()
Parallel translate a frame along the polygon and store one frame per polygon vertex.
|
PgFrame[] |
generatePolygonSetFrames()
Parallel translate a frame along the polygons of a polygonSet and store one frame
per polygon vertex. |
void |
generateThickEdges()
Make tube around edges of elementSet using instance variables m_disr and m_thickness.
|
void |
generateTube()
Make tube around polygon using array of previously computed frames
and instance variables m_discr and m_thickness.
|
PuDouble |
getArrowLength()
Get length of arrows in percent of arrow diameter. |
PuDouble |
getArrowThickness()
Get radius of arrow in percent of tube radius. |
PuInteger |
getDiscr()
Get number of vertices around the tube. |
PuDouble |
getThickness()
Get radius respectively thickness of the tube. |
void |
init()
Initialize tube parameters to default values. |
boolean |
isEnabled()
Check if tube is enabled or disabled, including its components. |
boolean |
isEnabledArrowPanel()
Check if showing of arrow panel in control panel of tube is enabled. |
boolean |
isEnabledEndArrow()
Check flag if arrow is shown at the tail of each tube. |
boolean |
isEnabledInduceColors()
Check flag whether color of tube are induced from the base geometry.
|
boolean |
isEnabledStartArrow()
Check flag if arrow is shown at the head of each tube. |
void |
removeElementSet()
Remove the current element set.
|
void |
removePolygon()
Remove the current polygon.
|
void |
removePolygonSet()
Remove the current polygonSet.
|
void |
setArrowLength(double percent)
Set length of arrows in percent of arrow diameter. |
void |
setArrowThickness(double percent)
Set thickness of arrow in percent of tube radius. |
void |
setDefArrowLength(double defArrLen)
Set default length of arrows in percent of arrow diameter. |
void |
setDefArrowLengthBounds(double min,
double max,
double lineIncr,
double pageIncr)
Set default bounds of arrows in percent of arrow diameter. |
void |
setDefArrowThickness(double defArrThick)
Set default thickness of arrow in percent of tube radius. |
void |
setDefArrowThicknessBounds(double min,
double max,
double lineIncr,
double pageIncr)
Set default bounds for thickness of arrows in percent of tube radius. |
void |
setDefDiscr(int defDiscr)
Set default number of vertices around the tube. |
void |
setDefDiscrBounds(int min,
int max,
int lineIncr,
int pageIncr)
Set default bounds for discretization slider. |
void |
setDefThickness(double defThickness)
Set default radius respectively thickness of the tube. |
void |
setDefThicknessBounds(double min,
double max,
double lineIncr,
double pageIncr)
Set default bounds for radius slider. |
void |
setDiscr(int discr)
Set number of vertices around the tube. |
void |
setElementSet(PgElementSet elementSet)
Set elementSet to compute thick edges from.
|
void |
setEnabled(boolean flag)
Enable or disable the tube for interactive use. |
void |
setEnabledArrowPanel(boolean flag)
Enable showing of arrow panel in control panel of tube. |
void |
setEnabledEndArrow(boolean flag)
Set flag if arrow is shown at the tail of each tube. |
void |
setEnabledInduceColors(boolean flag)
Set flag whether color of tube are induced from the base geometry.
|
void |
setEnabledStartArrow(boolean flag)
Set flag if arrow is shown at the head of each tube. |
void |
setPolygon(PgPolygon polygon)
Set polygon, but does not compute the tube.
|
void |
setPolygonSet(PgPolygonSet polygonSet)
Set polygonSet, but does not compute the tube.
|
void |
setThickness(double thickness)
Set radius respectively thickness of the tube. |
boolean |
update(java.lang.Object event)
A call of update with the polygon as set by setPolygon(PgPolygon)
re-computes frames and tube. |
| Methods inherited from class jv.geom.PgElementSet |
addElement, addElement, applyModelingMatrix, assureBoundary, assureDimOfElements, assureElementBackColors, assureElementColors, assureElementNormals, assureElementTextures, blend, buildPolygon, buildQuadr, buildQuadrFromCurve, buildTriangle, buildTriangleFromCurve, checkNeighbour, checkNeighbour, clearTagElement, close, computeCone, computeCylinder, computeDisk, computePlane, computeRotation, computeSnail, computeSphere, computeTorus, copy, copyConnectivity, copyElementSet, fixBoundaries, flipEdges, flipOrientation, getArea, getAreaOfElement, getBoundaries, getCreaseAngle, getDimOfElement, getDimOfElements, getEdge, getEdge, getEdgeLength, getEdgeList, getEdges, getElement, getElementBackColor, getElementBackColors, getElementColor, getElementColors, getElementNormal, getElementNormals, getElements, getElementTexture, getElementTextures, getElementVertices, getElementWithVertex, getFVector, getGlobalBndColor, getGlobalBndSize, getGlobalBndTagColor, getGlobalEdgeColor, getGlobalEdgeSize, getGlobalEdgeTagColor, getGlobalElementBackColor, getGlobalElementColor, getGlobalElementNormalColor, getGlobalElementNormalLength, getGlobalElementNormalSize, getGlobalElementTagColor, getJvx, getL2Matrix, getL2Norm, getMaxDimOfElements, getMaxNumElements, getNeighbour, getNeighbourLocInd, getNeighbours, getNumBoundaries, getNumBoundaryComponents, getNumBoundaryEdges, getNumBoundaryVertices, getNumEdges, getNumElementIndices, getNumElements, getNumUnusedVertices, getOppVertexInd, getOppVertexLocInd, getSavedElements, getSavedNumVertices, getVertexAngle, getVertexTextures, getVertexValence, getVolume, getVolumeOfElement, hasBoundary, hasEdges, hasElementBackColors, hasElementColors, hasElementNormals, hasElementTextures, hasTagElement, intersectionWithLine, isConforming, isShowingBackface, isShowingBoundaries, isShowingEdgeColorFromElements, isShowingEdgeColors, isShowingEdgeLabels, isShowingEdges, isShowingElementBackColor, isShowingElementBackColors, isShowingElementColors, isShowingElementFromVertexColors, isShowingElementLabels, isShowingElementNormalArrow, isShowingElementNormals, isShowingElements, isShowingElementTexture, isShowingElementTextures, isShowingSilhouette, isShowingSmoothElementColors, isShowingSmoothLighting, isShowingTaggedBoundaries, isShowingTaggedEdges, isShowingTaggedElements, makeAlternatingQuadrConn, makeCylinderConn, makeElementColorsFromXYZ, makeElementColorsFromZ, makeElementColorsFromZHue, makeElementFromVertexColors, makeElementFromVertexTexture, makeElementNormals, makeNeighbour, makeQuadrBnd, makeQuadrConn, makeQuadrElementTexture, makeTriangleBnd, makeTriangleConn, makeVertexFromElementColors, makeVertexNormals, markBoundary, merge, paint, printEdgeList, refineGlobalIntoFour, refineGlobalIntoFour, reflect, removeBoundaries, removeDeletedBoundaries, removeElement, removeElementBackColors, removeElementColors, removeElementNormals, removeMarkedElements, removeMarkedVertices, removeTexture, removeUnusedVertices, resetBoundaryNormals, setBoundary, setConforming, setCreaseAngle, setDimOfColors, setDimOfElement, setDimOfElements, setDimOfVectors, setDimOfVertices, setEdge, setEdges, setElement, setElement, setElement, setElement, setElementBackColor, setElementBackColors, setElementColor, setElementColors, setElementNormal, setElementNormals, setElements, setElementTexture, setElementTextures, setElementTexturesFromList, setElementVertices, setGlobalBndColor, setGlobalBndSize, setGlobalBndTagColor, setGlobalEdgeColor, setGlobalEdgeSize, setGlobalEdgeTagColor, setGlobalElementBackColor, setGlobalElementColor, setGlobalElementNormalColor, setGlobalElementNormalLength, setGlobalElementNormalSize, setGlobalElementTagColor, setGlobalVertexNormalColor, setGlobalVertexNormalLength, setGlobalVertexNormalSize, setJvx, setNeighbour, setNeighbours, setNumEdges, setNumElements, setSavedElements, setSavedNumVertices, setTagElement, showBackface, showBoundaries, showEdgeColorFromElements, showEdgeColors, showEdgeLabels, showEdges, showElementBackColor, showElementBackColors, showElementColors, showElementFromVertexColors, showElementLabels, showElementNormalArrow, showElementNormals, showElements, showElementTexture, showSilhouette, showSmoothElementColors, showSmoothLighting, showTaggedBoundaries, showTaggedEdges, showTaggedElements, showVertexTexture, toString, triangulate |
| Methods inherited from class jv.geom.PgPointSet |
addVectorField, addVertex, applyAmbientMatrix, assureVertexColors, assureVertexNormals, assureVertexSizes, assureVertexTextures, clearTagVertex, getAmbientBounds, getBounds, getCenterOfBndBox, getCenterOfGravity, getDimOfColors, getDimOfTextures, getDimOfVectors, getEulerCharacteristic, getGlobalVectorColor, getGlobalVectorLength, getGlobalVectorSize, getGlobalVertexColor, getGlobalVertexNormalColor, getGlobalVertexNormalLength, getGlobalVertexNormalSize, getGlobalVertexSize, getGlobalVertexTagColor, getIndexOfVectorField, getMarkedVertices, getMaxNumVertices, getNumVectorFields, getNumVertices, getSelectedVectorField, getShininess, getSpecularColor, getTexture, getTextureImage, getTextureImageName, getTransparency, getVectorField, getVectorField, getVertex, getVertexColor, getVertexColors, getVertexNormal, getVertexNormals, getVertexSize, getVertexSizes, getVertexTexture, getVertices, hasTagVertex, hasVertex, hasVertex, hasVertexColors, hasVertexNormals, hasVertexSizes, hasVertexTextures, isDefaultLabelEnabled, isEnabledIndexLabels, isShowingIndices, isShowingSingleVectorField, isShowingTaggedVertices, isShowingTransparency, isShowingVectorArrow, isShowingVectorArrows, isShowingVectorColors, isShowingVectorField, isShowingVectorFields, isShowingVertexColors, isShowingVertexLabels, isShowingVertexNormalArrow, isShowingVertexNormals, isShowingVertexOutline, isShowingVertexSizes, isShowingVertexTexture, isShowingVertices, makeColorFromVectorLength, makeQuadrVertexTexture, makeVertexColorsFromXYZ, makeVertexColorsFromZ, makeVertexColorsFromZHue, makeVertexTextureFromBndBox, makeVertexTextureFromCylinder, makeVertexTextureFromSphere, makeVertexTextureFromUV, projectFromAmbientSpace, projectToSphere, removeAllVectorFields, removeHiddenVectorFields, removeVectorField, removeVertex, removeVertexColors, removeVertexNormals, removeVertexSizes, scale, scale, selectVectorField, setCenterOfBndBox, setDefaultLabelEnabled, setDimOfTextures, setEnabledIndexLabels, setGlobalVectorColor, setGlobalVectorLength, setGlobalVectorSize, setGlobalVertexColor, setGlobalVertexSize, setGlobalVertexSize, setGlobalVertexTagColor, setNumVertices, setShininess, setSpecularColor, setState, setTagVertex, setTexture, setTextureImage, setTextureImageName, setTransparency, setVertex, setVertex, setVertex, setVertex, setVertexColor, setVertexColors, setVertexNormal, setVertexNormals, setVertexSize, setVertexSizes, setVertexTexture, setVertexTextures, setVertices, showIndices, showSingleVectorField, showTaggedVertices, showTransparency, showVectorArrow, showVectorArrows, showVectorColors, showVectorField, showVectorFields, showVertexColors, showVertexLabels, showVertexNormalArrow, showVertexNormals, showVertexOutline, showVertexSizes, showVertices, translate |
| Methods inherited from class jv.project.PgGeometry |
addDisplay, addPolygon, clearTagPolygon, fillMethodMenu, fillMethodMenu, getAmbientInvMatrix, getAmbientMatrix, getAmbientProjection, getAmbientSpace, getAuthorInfo, getAuthors, getCenter, getCenterOfElement, getControlPanel, getDiameter, getDimOfSimplex, getDimOfVertices, getDisplayList, getDisplays, getGeometryInfo, getLabelAttribute, getLabelColor, getLabelFont, getLabelSize, getLabelStyle, getMaterialPanel, getModelMatrix, getPolygon, getState, getTitle, getType, getVersion, getVersionType, hasAmbientMatrix, hasDisplay, hasModelMatrix, hasTagPolygon, isConfigurable, isEnabledInstanceSharing, isShowingBndBox, isShowingCenter, isShowingName, isShowingTitle, isVisible, removeDisplay, removeMethodMenus, removePolygon, setAmbientMatrix, setAmbientProjection, setAmbientSpace, setAuthorInfo, setAuthors, setCenter, setDimOfSimplex, setEnabledInstanceSharing, setGeometryInfo, setLabelAttribute, setLabelAttribute, setLabelColor, setLabelFont, setLabelSize, setLabelStyle, setModelMatrix, setPolygon, setTagPolygon, setTitle, setType, setVersion, setVersionType, setVisible, showBndBox, showCenter, showName, showTitle |
| Methods inherited from class jv.object.PsObject |
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, updatePanels |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PgTube
public PgTube(int aDim)
- Constructs a tube with given dimension of vertices.
Note: Currently, the dimension of vertices must be 3.
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
setEnabledArrowPanel
public void setEnabledArrowPanel(boolean flag)
- Enable showing of arrow panel in control panel of tube.
- Since:
- JavaView 2.99.040
isEnabled
public boolean isEnabled()
- Check if tube is enabled or disabled, including its components.
- Since:
- JavaView 2.99.012
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
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.
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
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
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)
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)
removeElementSet
public void removeElementSet()
- Remove the current element set.
Method removes this class as updateListener of the element set.
- See Also:
setElementSet(PgElementSet)
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)
removePolygon
public void removePolygon()
- Remove the current polygon.
Method removes this class as updateListener of the polygon.
- See Also:
setPolygon(PgPolygon)
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)
removePolygonSet
public void removePolygonSet()
- Remove the current polygonSet.
Method de-registers this class as updateListener in the polygonSet.
- See Also:
setPolygon(PgPolygon)
update
public boolean update(java.lang.Object event)
- A call of
update with the polygon as set by setPolygon(PgPolygon)
re-computes frames and tube.
- Specified by:
update in interface PsUpdateIf- Overrides:
update in class PgElementSet
- See Also:
setPolygon(PgPolygon),
generateFrames(),
generateTube()
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 geometrix polygon vertex
- See Also:
generateTube(),
PgFrame
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
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()
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()
The software JavaView© is copyright protected. All Rights Reserved.