JavaView© v3.95.000

jvx.geom
Class PwRefinePolygon

java.lang.Object
  extended byjv.object.PsObject
      extended byjvx.project.PjWorkshop
          extended byjvx.geom.PwRefinePolygon
All Implemented Interfaces:
java.lang.Cloneable, PjWorkshopIf, PsUpdateIf, java.io.Serializable

public class PwRefinePolygon
extends PjWorkshop

Class to refine or coarsen a PgPolygon

See Also:
Serialized Form

Field Summary
static int COARSEN_CHAIKIN
           
static int COARSEN_DLG
           
static int REFINE_CHAIKIN
           
static int REFINE_DLG
           
 
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
 
Constructor Summary
PwRefinePolygon()
          Constructor
 
Method Summary
 void addSequenceEntry(int entry)
          Store a new refinement step to the refinement sequence.
 void close()
          Remove the control polygon from the display and destroy this workshop.
static void coarsenChaikin(PgPolygon poly)
          Coarsen a PgPolygon global by a reversed Chaikin algorithm.
static void coarsenChaikin(PgPolygonSet polySet)
          Coarsen a PgPolygonSet global by a reversed Chaikin algorithm.
static void coarsenDLG(PgPolygon poly)
          Coarsen a PgPolygon by removing every second vertex.
static void coarsenDLG(PgPolygonSet polySet)
          Coarsen a PgPolygonSet by removing every second vertex.
 boolean isShowingControlGrid()
          Checks if control grid of polygon is visible.
static void refineChaikin(PgPolygon poly)
          Refine a PgPolygon global by Chaikin's algorithm.
static void refineChaikin(PgPolygonSet polySet)
          Refine a PgPolygonSet global by Chaikin's algorithm.
static void refineDLG(PgPolygon poly)
          Refine a PgPolygon global by DLG scheme.
static void refineDLG(PgPolygonSet polySet)
          Refine a PgPolygonSet global by DLG scheme.
 void reset()
          Remove all previously done refining and and coarsening and set the workshop to its initial status.
 void sequenceRefine()
          Recompute all refinement steps.
 void setGeometry(PgPolygon geom)
          Assign a geometry on which this workshop operates, and create two backup copies: One for canceling and one to be used as control polygon for the refined geometry.
 void setGeometry(PgPolygonSet geom)
          Assign a geometry on which this workshop operates, and create two backup copies: One for canceling and one to be used as control polygonSet for the refined geometry.
 void showControlGrid(boolean bShow)
          Set the control polygon visible or invisible in the display.
 boolean update(java.lang.Object event)
          Update the class whenever a child has changed.
 
Methods inherited from class jvx.project.PjWorkshop
cancel, getDisplay, getDisplays, getGeometry, getSavedGeometry, getViewer, init, isModal, ok, removeGeometry, setDisplay, setDisplays, setGeometry, setModal, setViewer
 
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, updatePanels
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jv.object.PsUpdateIf
getFather, getName, setParent
 

Field Detail

REFINE_DLG

public static final int REFINE_DLG
See Also:
Constant Field Values

COARSEN_DLG

public static final int COARSEN_DLG
See Also:
Constant Field Values

REFINE_CHAIKIN

public static final int REFINE_CHAIKIN
See Also:
Constant Field Values

COARSEN_CHAIKIN

public static final int COARSEN_CHAIKIN
See Also:
Constant Field Values
Constructor Detail

PwRefinePolygon

public PwRefinePolygon()
Constructor

Method Detail

setGeometry

public void setGeometry(PgPolygon geom)
Assign a geometry on which this workshop operates, and create two backup copies: One for canceling and one to be used as control polygon for the refined geometry.


setGeometry

public void setGeometry(PgPolygonSet geom)
Assign a geometry on which this workshop operates, and create two backup copies: One for canceling and one to be used as control polygonSet for the refined geometry.


update

public boolean update(java.lang.Object event)
Update the class whenever a child has changed. Method is usually invoked from the children.

Specified by:
update in interface PsUpdateIf
Overrides:
update in class PjWorkshop
Parameters:
event - sender of this update.
Returns:
true if update was correctly handled by superclass.

reset

public void reset()
Remove all previously done refining and and coarsening and set the workshop to its initial status.

Overrides:
reset in class PjWorkshop

isShowingControlGrid

public boolean isShowingControlGrid()
Checks if control grid of polygon is visible. By default, control grid is not visible.


showControlGrid

public void showControlGrid(boolean bShow)
Set the control polygon visible or invisible in the display.


close

public void close()
Remove the control polygon from the display and destroy this workshop.

Overrides:
close in class PjWorkshop

addSequenceEntry

public void addSequenceEntry(int entry)
Store a new refinement step to the refinement sequence.


sequenceRefine

public void sequenceRefine()
Recompute all refinement steps.


refineDLG

public static void refineDLG(PgPolygon poly)
Refine a PgPolygon global by DLG scheme. Afterwards the polygon will have twice as much vertices, the vertices v(i) at even indices are the original vertices of the polygon, the vertices at odd indices are blended from the next two vertices in both directions by 1/16(-v(i-1) + 9v(i) + 9v(i+1) - v(i+2)).


coarsenDLG

public static void coarsenDLG(PgPolygon poly)
Coarsen a PgPolygon by removing every second vertex. This is the reverse algorithm for interpolating refinement algorithms.


refineChaikin

public static void refineChaikin(PgPolygon poly)
Refine a PgPolygon global by Chaikin's algorithm. On each edge of the polygon two vertices of the refined polygon will be computed at 1/4 and 3/4 length.


coarsenChaikin

public static void coarsenChaikin(PgPolygon poly)
Coarsen a PgPolygon global by a reversed Chaikin algorithm. Each vertex of the coarsened polygon gets blended from two of the extrapolated ancestor vertices of the edges v(i-2) to v(i-1) and v(i) to v(i+1).


refineDLG

public static void refineDLG(PgPolygonSet polySet)
Refine a PgPolygonSet global by DLG scheme. Afterwards the polygon will have twice as much vertices, the vertices v(i) at even indices are the original vertices of the polygon, the vertices at odd indices are blended from the next two vertices in both directions by 1/16(-v(i-1) + 9v(i) + 9v(i+1) - v(i+2)).


coarsenDLG

public static void coarsenDLG(PgPolygonSet polySet)
Coarsen a PgPolygonSet by removing every second vertex. This is the reverse algorithm for interpolating refinement algorithms.


refineChaikin

public static void refineChaikin(PgPolygonSet polySet)
Refine a PgPolygonSet global by Chaikin's algorithm. On each edge of the polygon two vertices of the refined polygon will be computed at 1/4 and 3/4 length.


coarsenChaikin

public static void coarsenChaikin(PgPolygonSet polySet)
Coarsen a PgPolygonSet global by a reversed Chaikin algorithm. Each vertex of the coarsened polygon gets blended from two of the extrapolated ancestor vertices of the edges v(i-2) to v(i-1) and v(i) to v(i+1).


JavaView© v3.95.000

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