JavaView® v2.00.008

jvx.geom
Class PwRivaraBisection

java.lang.Object
  |
  +--jv.object.PsObject
        |
        +--jvx.geom.PwRivaraBisection
All Implemented Interfaces:
java.lang.Cloneable, PsUpdateIf, java.io.Serializable

public class PwRivaraBisection
extends PsObject

Rivara bisection algorithm on triangulated surfaces. This class adaptively refines a marked subset of the triangles of a triangulation.

A cache mechanism is added to the element, vertex, and neighbour array. Each array has now a used size and a maximal size. Each time when the used size is greater than the maximal size the array is increased by caNewSize entries.

Version:
01.11.99, 1.10 revised (af) Cache implemented for arrays.
30.09.99, 1.00 created (af)
Author:
Axel Friedrich
See Also:
Serialized Form

Field Summary
protected  int caElementMaxSize
          Number of maximal elements in the element array.
protected  int caElementUsedSize
          Number of used elements in the element array.
protected  int caNeighbourMaxSize
          Number of maximal elements in the neighbour array.
protected  int caNeighbourUsedSize
          Number of used elements in the neighbour array.
protected  int caNewSize
          Number of new array-elements if the cache has to be resized.
protected  int caVertexMaxSize
          Number of maximal elements in the vertex array.
protected  int caVertexUsedSize
          Number of used elements in the vertex array.
protected  PiVector[] m_element
          Copy of the elements.
protected  PgElementSet m_geom
          The geometry that has to be refined.
protected  PiVector[] m_neighbour
          Copy of the neighbours.
protected  PdVector[] m_vertex
          Copy of the vertices.
 
Fields inherited from class jv.object.PsObject
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, m_infoPanel, m_name, m_panelList, m_parent, m_tag, m_updateList, NUM_TAGS
 
Constructor Summary
PwRivaraBisection()
           
 
Method Summary
protected  void finish()
          Copy modified vertices, elements, and neighbours into original element set.
protected  PdVector rivaraRefineEdge(int elementIndex, PdVector point1, PdVector point2)
          Refines an edge (currently at the midpoint of the refinement edge).
protected  int rivaraRefineElement(int currentElement, int[] previousElements, int newVertex)
           
protected  int rivaraRefineElement(int formerElement, int[] previousElements, int currentElement, int previousNewVertex)
           
 boolean rivaraRefinement(PgElementSet geom, int[] refineElements)
          Invokes the Rivara refinement process on the set of marked triangles.
protected  void rivaraSimpleConnect(int element11, int element12, int element21, int element22)
           
protected  boolean setGeometry(PgElementSet geom)
          Assign some instance variables of the current geometry for direct access during refinement.
protected  boolean shareEdge(int element1, int element2, int[] edgeIndices)
          Check whether both elements share a common edge, and store vertex indices of edge.
 
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, init, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, toString, update, updatePanels
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_geom

protected PgElementSet m_geom
The geometry that has to be refined.

m_vertex

protected PdVector[] m_vertex
Copy of the vertices.

m_element

protected PiVector[] m_element
Copy of the elements.

m_neighbour

protected PiVector[] m_neighbour
Copy of the neighbours.

caNewSize

protected int caNewSize
Number of new array-elements if the cache has to be resized.

caElementUsedSize

protected int caElementUsedSize
Number of used elements in the element array.

caElementMaxSize

protected int caElementMaxSize
Number of maximal elements in the element array.

caVertexUsedSize

protected int caVertexUsedSize
Number of used elements in the vertex array.

caVertexMaxSize

protected int caVertexMaxSize
Number of maximal elements in the vertex array.

caNeighbourUsedSize

protected int caNeighbourUsedSize
Number of used elements in the neighbour array.

caNeighbourMaxSize

protected int caNeighbourMaxSize
Number of maximal elements in the neighbour array.
Constructor Detail

PwRivaraBisection

public PwRivaraBisection()
Method Detail

rivaraRefineEdge

protected PdVector rivaraRefineEdge(int elementIndex,
                                    PdVector point1,
                                    PdVector point2)
Refines an edge (currently at the midpoint of the refinement edge). Subclasses can override this method, for example to set the normal at the newly inserted point.

rivaraRefineElement

protected final int rivaraRefineElement(int currentElement,
                                        int[] previousElements,
                                        int newVertex)

shareEdge

protected final boolean shareEdge(int element1,
                                  int element2,
                                  int[] edgeIndices)
Check whether both elements share a common edge, and store vertex indices of edge.
Returns:
true if both elements share a common edge

rivaraSimpleConnect

protected final void rivaraSimpleConnect(int element11,
                                         int element12,
                                         int element21,
                                         int element22)

rivaraRefineElement

protected final int rivaraRefineElement(int formerElement,
                                        int[] previousElements,
                                        int currentElement,
                                        int previousNewVertex)

setGeometry

protected boolean setGeometry(PgElementSet geom)
Assign some instance variables of the current geometry for direct access during refinement. It copies the vertices, the elements, and the neighbours. Subclasses can override this method.
See Also:
rivaraRefinement(jv.geom.PgElementSet, int[])

finish

protected void finish()
Copy modified vertices, elements, and neighbours into original element set. Called by the rivaraRefinement method at the end of the refinement process. Subclasses can override this method.
See Also:
rivaraRefinement(jv.geom.PgElementSet, int[])

rivaraRefinement

public boolean rivaraRefinement(PgElementSet geom,
                                int[] refineElements)
Invokes the Rivara refinement process on the set of marked triangles.
Parameters:
refineElements - an array which holds the indices of the elements that have to be refined
Returns:
false if geometry is empty or not a triangulation.

JavaView® v2.00.008

The software JavaView® is copyright protected. All Rights Reserved.