public class PwSmooth extends PjWorkshop implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
static int |
METHOD_ANISOTROPIC
This smoothing method preserves features and sharpens linear feature.
|
static int |
METHOD_ANSIO_PRECRIBED
This smoothing method preserves features and sharpens non-linear feature.
|
PvViewer |
viewer |
HAS_BOUNDARY_PANEL, 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
MODE_BUG, MODE_STANDARD, MODE_VALIDATE
Constructor and Description |
---|
PwSmooth()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel operation of this workshop by resetting the assigned geometry,
and finally close this workshop.
|
static java.awt.Color |
colorMap(double d)
Maps (0,1) onto a Color, starting from white to red.
|
static java.awt.Color |
colorMapGray(double d)
Maps (0,1) onto a Color using only gray levels.
|
double |
getFeatureDetect()
Get parameter that determines what is regareded as a feature when smoothing.
|
boolean |
getKeepBoundary()
Get flag to enable/disable moving of boundary vertices during smoothing.
|
boolean |
getKeepSelected()
Get flag to enable/disable moving of selected vertices during smoothing.
|
int |
getMaxNumLoops()
A smooting process is stoped after this number of loops
have been performed cp
start . |
int |
getMethod()
Get method used for smoothing.
|
double |
getStepWidth()
The step width is a factor the gradient of the actual
flow is multiplied with at each iteration step.
|
void |
init()
Initializations
|
boolean |
isRunning()
Check whether smoothing prcess will be stopped.
|
boolean |
isStopped()
Check whether smoothing prcess is currently NOT running a thread.
|
boolean |
isUsingImplicit()
See if implicit method to integrate the flow is used.
|
void |
run()
Do energy minimization until
m_numLoops are done or until a call of stop(). |
static boolean |
scaleGeomByVolume(PgElementSet geom,
double volume,
double eps,
int maxSteps)
Rescale geometry to have a given volume.
|
void |
setFeatureDetect(double value)
Set parameter that determines what is regareded as a feature when smoothing.
|
void |
setGeometry(PgElementSet geom)
Assign a geometry on which this workshop operates,
and create a backup copy if workshop is cancelled.
|
void |
setKeepBoundary(boolean bKeepBoundary)
Enable/Disable moving of boundary vertices during smoothing.
|
void |
setKeepSelected(boolean bKeepSelected)
Enable/Disable moving of selected vertices during smoothing.
|
void |
setMaxNumLoops(int numLoops)
A smooting process is stoped after the given number of loops
have been performed cp
start . |
void |
setMethod(int method)
Set method used for smoothing.
|
void |
setStepWidth(double stepWidth)
The step width is a factor the gradient of the actual
flow is multiplied with at each iteration step.
|
void |
smoothingStep()
Perform one step of smoothing using the actually choosen method and settings.
|
void |
start()
Start smoothing in separate thread.
|
void |
stop()
Stop smoothing in separate thread.
|
boolean |
update(java.lang.Object event)
Update the class whenever a child has changed.
|
void |
useImplicit(boolean flag)
Use implicit instead of explicit method to integrate the flow.
|
close, getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, ok, openDialog, removeGeometry, reset, setDisplay, setDisplays, setGeometry, setModal, setMode, setStandalone, setViewer
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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFather, getName, setParent
public static int METHOD_ANISOTROPIC
public static int METHOD_ANSIO_PRECRIBED
public PvViewer viewer
public void init()
init
in class PjWorkshop
public boolean update(java.lang.Object event)
update
in interface PsUpdateIf
update
in class PjWorkshop
event
- sender of this update.PsObject.setParent(PsUpdateIf)
,
PsObject.getFather()
,
PsObject.addUpdateListener(PsUpdateIf)
public void setGeometry(PgElementSet geom)
public void cancel()
PjWorkshop
If necessary, the duplicate of the original geometry is restored into the geometry. The update method of the geometry is called.
cancel
in class PjWorkshop
public void setMethod(int method)
METHOD_ANISOTROPIC
and METHOD_ANSIO_PRECRIBED
.public int getMethod()
METHOD_ANISOTROPIC
and METHOD_ANSIO_PRECRIBED
.public void setFeatureDetect(double value)
public double getFeatureDetect()
public void useImplicit(boolean flag)
public boolean isUsingImplicit()
public void setStepWidth(double stepWidth)
public double getStepWidth()
public void setMaxNumLoops(int numLoops)
start
.public int getMaxNumLoops()
start
.public void setKeepBoundary(boolean bKeepBoundary)
public boolean getKeepBoundary()
public void setKeepSelected(boolean bKeepSelected)
public boolean getKeepSelected()
public void smoothingStep()
public static java.awt.Color colorMapGray(double d)
public static java.awt.Color colorMap(double d)
public static boolean scaleGeomByVolume(PgElementSet geom, double volume, double eps, int maxSteps)
geom
- geometry to be scaled.volume
- volume the geometry willhave after rescaling.eps
- rescaling stops when actual volume and given volume differ less than eps.maxSteps
- stop when maximal number of steps have benn performed.public boolean isRunning()
public boolean isStopped()
public void start()
stop()
public void stop()
public void run()
m_numLoops
are done or until a call of stop().run
in interface java.lang.Runnable
"