JavaView® v2.00.008

jvx.geom
Class PwSimplify

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

public class PwSimplify
extends PsObject

Simplifies PgElementSets by removing edges and identifying their ending points. Edges to remove are selected by smallest surface error in the quadric metric.

Version:
01.02.01, 1.20 revised (ur) Enabled refusing of simplification.
20.11.00, 1.10 revised (ur) Updating of boundary polygons improved.
20.09.00, 1.01 revised (ur) Simplifying elementSets with unused vertices is now possible.
15.02.00, 1.00 created (ur)
Author:
Ulrich Reitebuch
See Also:
Serialized Form

Field Summary
protected  boolean m_bBigNeighbourhood
          Flag to maintain up to 2nd order neighboured edges
protected  boolean m_bCheckAngles
          Flag to avoid thin triangles
protected  boolean m_bCheckNormals
          Flag to check, if normals of new and old elements differ by more than m_maxAngle
protected  boolean m_bFlipEdges
          Flag to call PgElementSet.flipEdges before simplifying
protected  boolean m_bForceSimplify
          Flag to force simplify against normal and thin triangle criteria
protected  boolean m_bRetainBoundary
          Flag to leave boundary untouched
protected  boolean m_bRetainMarkedVertices
          Flag to leave marked vertices untouched
 boolean m_bSetSimplified
          Flag to simplify or restore m_elementSet.
protected  boolean m_bUpdateSendet
          Flag to avoid evaluating self sendet updates
protected  PiVector[] m_edgeList
          List of EndPoints of the PgElementSets edges
protected  PiVector[] m_edgesAtVertex
          List of adjacent edges to every vertex of m_elementSet
protected  PiVector[] m_edgesAtVertex2
          List of neighbour edges of second order
protected  PiVector[] m_elementsAtVertex
          List of adjacent elements to every vertex of m_elementSet
protected  PgElementSet m_elementSet
          The PgElementSet to be simplified
protected  PiVector m_index
          IndexVector for heap sort
protected  boolean[] m_isDenied
          Flag, if edge is denied to be removed
protected  int m_lastNode
          Last node-index for heap sort
protected  PiVector m_location
          Inverse information to m_index
protected  double m_maxAngle
          Maximal angle between normals of original and simlified elements
protected  int m_maxIndex
          Last used index in m_index
protected  PdVector m_minValue
          The associate minimal error for replacing edge
protected  PdVector[] m_minVector
          The 3d-point of minmal error to replace an edge with
protected  int m_numEdges
          Number of Edges in m_elementSet
protected  int m_numEl
          Number of Elements in m_elementSet
protected  PdMatrix[] m_quadMatrix
          3x3 Matrix for quadric metric to a vertex of m_elementSet
protected  PdVector m_quadScalar
          Scalar part for quadric metric to a vertex of m_elementSet
protected  PdVector[] m_quadVector
          3d Vector for quadric metric to a vertex of m_elementSet
protected  double minInOut
          Bound value for avoiding thin triangles
 
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
PwSimplify(PgElementSet anElementSet)
          Constructor
 
Method Summary
protected  void checkAngles(boolean flag)
          Appoint, if inner angles of triangles are to be checked
protected  boolean checkEdge(int edgeNr)
          Check, if removing of edge (vertex0-vertex1) causes the topology of elementSet to change and, if edge to remove (vertex0-vertex1) is ending edge of a PgBndPolygon of the PgElementSet, if one ending point of the edge is marked, or edge is boundary edge and therefore should be retained.
protected  boolean checkNewElements(int edgeNr)
          Check, if removing of edge (vertex0-vertex1) causes thin triangles.
protected  void checkNormals(boolean flag)
          Appoint, if normals of new faces are allowed to differ from old normals by more than m_maxAngle.
protected  boolean checkNormals(int edgeNr, boolean adjustNormals)
          Check, if normals of new elements differ by more than m_maxAngle from old normals.
protected  void checkRelation(int i)
          This method is part of heap sort.
protected  void computeMinimum(int edgeNr)
          Compute the 3dVector with minimal error for an edge.
protected  void computeMinInOut()
          Compute minimum value minInOut for avoiding thin triangles.
protected  void computeQuadric(int vertexNr)
          Compute the quadric metric for a vertex of the PgElementSet.
protected  void deleteValue(int i)
          This method is part of heap sort.
protected  void flipEdges(boolean flag)
          Appoint, if PgElementSet.flipEdges should be called before start of simplifying
protected  void forceSimplify(boolean flag)
          Appoint, if the elementSet is to be simplified down to remainElements by making criteria worse.
protected  void generateEdgesAtVertex2()
          Generate edggesAtVertex2 informations: Edges neighbourhood up to 2nd order
static PsDialog getDialog(PgElementSet anElementSet)
          Create a new instance of PwSimplify and return the dialog panel.
 void init()
          Generate all necessary data of connectivity and initialize heap sort.
protected  void markVertices()
          Search for boundary vertices with surface angle less than 130 degrees
protected  void removeEdge(int edge)
          Remove an edge from the elementSet and identify it's endPoints.
protected  void replaceBndVertex(int vert1, int vert0)
          Replace in PgBndPolygons vertex1 by vertex0 and remove edges with identical ending points.
protected  void retainBoundary(boolean flag)
          Appoint, if boundary points of PgElementSet are allowed to be simplified, or not.
protected  void retainMarkedVertices(boolean flag)
          Appoint, if boundary points of PgElementSet are allowed to be simplified, or not.
 boolean simplify(int remainElements)
          Simplify the PgElementSet, until it has few enough elements.
 boolean update(java.lang.Object event)
          Update the class whenever a child has changed.
protected  void valueChanged(int i)
          This method is part of heap sort.
 
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, toString, updatePanels
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_elementSet

protected PgElementSet m_elementSet
The PgElementSet to be simplified

m_edgeList

protected PiVector[] m_edgeList
List of EndPoints of the PgElementSets edges

m_index

protected PiVector m_index
IndexVector for heap sort

m_location

protected PiVector m_location
Inverse information to m_index

m_isDenied

protected boolean[] m_isDenied
Flag, if edge is denied to be removed

m_maxIndex

protected int m_maxIndex
Last used index in m_index

m_lastNode

protected int m_lastNode
Last node-index for heap sort

m_minVector

protected PdVector[] m_minVector
The 3d-point of minmal error to replace an edge with

m_minValue

protected PdVector m_minValue
The associate minimal error for replacing edge

m_numEdges

protected int m_numEdges
Number of Edges in m_elementSet

m_numEl

protected int m_numEl
Number of Elements in m_elementSet

m_quadMatrix

protected PdMatrix[] m_quadMatrix
3x3 Matrix for quadric metric to a vertex of m_elementSet

m_quadVector

protected PdVector[] m_quadVector
3d Vector for quadric metric to a vertex of m_elementSet

m_quadScalar

protected PdVector m_quadScalar
Scalar part for quadric metric to a vertex of m_elementSet

m_edgesAtVertex

protected PiVector[] m_edgesAtVertex
List of adjacent edges to every vertex of m_elementSet

m_edgesAtVertex2

protected PiVector[] m_edgesAtVertex2
List of neighbour edges of second order

m_elementsAtVertex

protected PiVector[] m_elementsAtVertex
List of adjacent elements to every vertex of m_elementSet

m_bRetainBoundary

protected boolean m_bRetainBoundary
Flag to leave boundary untouched

m_bRetainMarkedVertices

protected boolean m_bRetainMarkedVertices
Flag to leave marked vertices untouched

minInOut

protected double minInOut
Bound value for avoiding thin triangles

m_bCheckAngles

protected boolean m_bCheckAngles
Flag to avoid thin triangles

m_bFlipEdges

protected boolean m_bFlipEdges
Flag to call PgElementSet.flipEdges before simplifying

m_bCheckNormals

protected boolean m_bCheckNormals
Flag to check, if normals of new and old elements differ by more than m_maxAngle

m_bForceSimplify

protected boolean m_bForceSimplify
Flag to force simplify against normal and thin triangle criteria

m_maxAngle

protected double m_maxAngle
Maximal angle between normals of original and simlified elements

m_bBigNeighbourhood

protected boolean m_bBigNeighbourhood
Flag to maintain up to 2nd order neighboured edges

m_bUpdateSendet

protected boolean m_bUpdateSendet
Flag to avoid evaluating self sendet updates

m_bSetSimplified

public boolean m_bSetSimplified
Flag to simplify or restore m_elementSet.
Constructor Detail

PwSimplify

public PwSimplify(PgElementSet anElementSet)
Constructor
Method Detail

getDialog

public static PsDialog getDialog(PgElementSet anElementSet)
Create a new instance of PwSimplify and return the dialog panel.

init

public void init()
Generate all necessary data of connectivity and initialize heap sort.
Overrides:
init in class PsObject

update

public boolean update(java.lang.Object event)
Update the class whenever a child has changed. Method is usually invoked from the children.
Overrides:
update in class PsObject
Following copied from class: jv.object.PsObject
See Also:
PsObject.setParent(PsUpdateIf), PsObject.getFather(), PsObject.addUpdateListener(PsUpdateIf)

computeMinInOut

protected void computeMinInOut()
Compute minimum value minInOut for avoiding thin triangles.

generateEdgesAtVertex2

protected void generateEdgesAtVertex2()
Generate edggesAtVertex2 informations: Edges neighbourhood up to 2nd order

markVertices

protected void markVertices()
Search for boundary vertices with surface angle less than 130 degrees

retainBoundary

protected void retainBoundary(boolean flag)
Appoint, if boundary points of PgElementSet are allowed to be simplified, or not.

retainMarkedVertices

protected void retainMarkedVertices(boolean flag)
Appoint, if boundary points of PgElementSet are allowed to be simplified, or not.

checkNormals

protected void checkNormals(boolean flag)
Appoint, if normals of new faces are allowed to differ from old normals by more than m_maxAngle.

forceSimplify

protected void forceSimplify(boolean flag)
Appoint, if the elementSet is to be simplified down to remainElements by making criteria worse.

checkAngles

protected void checkAngles(boolean flag)
Appoint, if inner angles of triangles are to be checked

flipEdges

protected void flipEdges(boolean flag)
Appoint, if PgElementSet.flipEdges should be called before start of simplifying

checkRelation

protected void checkRelation(int i)
This method is part of heap sort. It assures, that at the node i of the heap the value is smaller than the values of all it's followers.

valueChanged

protected void valueChanged(int i)
This method is part of heap sort. It assures the correctness of the heap after changing an edges minimum-error value.

deleteValue

protected void deleteValue(int i)
This method is part of heap sort. It removes a value from the heap.

computeQuadric

protected void computeQuadric(int vertexNr)
Compute the quadric metric for a vertex of the PgElementSet.

computeMinimum

protected void computeMinimum(int edgeNr)
Compute the 3dVector with minimal error for an edge.

removeEdge

protected void removeEdge(int edge)
Remove an edge from the elementSet and identify it's endPoints.

checkNewElements

protected boolean checkNewElements(int edgeNr)
Check, if removing of edge (vertex0-vertex1) causes thin triangles.

checkNormals

protected boolean checkNormals(int edgeNr,
                               boolean adjustNormals)
Check, if normals of new elements differ by more than m_maxAngle from old normals.

checkEdge

protected boolean checkEdge(int edgeNr)
Check, if removing of edge (vertex0-vertex1) causes the topology of elementSet to change and, if edge to remove (vertex0-vertex1) is ending edge of a PgBndPolygon of the PgElementSet, if one ending point of the edge is marked, or edge is boundary edge and therefore should be retained.

replaceBndVertex

protected void replaceBndVertex(int vert1,
                                int vert0)
Replace in PgBndPolygons vertex1 by vertex0 and remove edges with identical ending points.

simplify

public boolean simplify(int remainElements)
Simplify the PgElementSet, until it has few enough elements.

JavaView® v2.00.008

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