jvx.geom
Class PwNoise
- java.lang.Object
-
- jv.object.PsObject
-
- jvx.project.PjWorkshop
-
- jvx.geom.PwNoise
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PjWorkshopIf
public class PwNoise extends PjWorkshop
This workshop moves all vertices of a PgPointSet randomly away from their original position. The random direction may be constrained to vertex normal or tangential directions. Boundaries and marked vertices may be kept fix.- See Also:
- Serialized Form
- Author:
- Ulrich Reitebuch, Konrad Polthier
- Version:
- 21.01.07, 2.10 revised (ah) Method setGeometry() now overloads PjWorkshop.setGeometry.
30.03.03, 2.00 revised (kp) Better sync with PjWorkshop concept, update mechanism.
30.03.03, 1.60 revised (kp) Update element normals if they exist and normal update enabled.
12.02.03, 1.50 revised (ur) Handles moved to here from info panel class, frequency is now independent from new noise.
25.04.02, 1.40 revised (kp) Some tunings.
25.04.02, 1.30 revised (ur) Bug in updating removed, some tunings.
23.01.02, 1.20 revised (ur) New option: Keep boundary unchanged.
12.01.02, 1.10 revised (ur) Changed to extend PjWorkshop.
26.09.01, 1.00 created (ur)
-
-
Field Summary
Fields Modifier and Type Field and Description static intGAUSSIANIdentifier for noise with normal distributed distance.intm_noiseModeMode identifier defining the type of noise to compute.static intUNIFORM_BOXIdentifier for uniform noise in a [-1.0; 1.0]^dim box.static intUNIFORM_SPHERICALIdentifier for uniform noise in a unit ball.-
Fields inherited from class jv.object.PsObject
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
-
Fields inherited from interface jv.project.PjWorkshopIf
MODE_BUG, MODE_STANDARD, MODE_VALIDATE
-
-
Constructor Summary
Constructors Constructor and Description PwNoise()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description voidclose()Close workshop and remove workshop from geometry as update listener.doublegetAmplitude()Get amplitude of noise.intgetNoiseMode()Get noise mode.voidinit()Initialization.booleanisEnabledKeepBoundary()Get flag to keep boundary vertices fixed during noising.booleanisEnabledKeepSelected()Get flag to keep selected vertices fixed during noising.booleanisEnabledNoiseNormal()Get flag to enable movement of vertices in vertex normal direction.booleanisEnabledNoiseTangential()Get flag to enable movement of vertices in tangential direction.booleanisEnabledUpdateNormals()Get flag to update vertex normals after noising.voidkeepBoundary(boolean flag)Deprecated.use setEnabledKeepBoundary.voidkeepSelected(boolean flag)Deprecated.use setEnabledKeepSelected.voidnewFrequence()Select by random vertices to be noised.voidnewNoise()Generate new random noise directions for all vertices.voidnoise()Move all vertices by their individual noise directions.voidnoise(double factor, boolean bNormal, boolean bTangential, boolean bKeepBoundary, boolean bKeepSelected)Deprecated.set options first and use noise() method instead.(ur)voidnoiseNormal(boolean flag)Deprecated.use setEnabledNoiseNormal.voidnoiseTangential(boolean flag)Deprecated.use setEnabledNoiseTangential.voidreset()ResetvoidsetAmplitude(double value)Set amplitude of noise.voidsetEnabledKeepBoundary(boolean flag)Set flag to keep boundary vertices fixed during noising.voidsetEnabledKeepSelected(boolean flag)Set flag to keep selected vertices fixed during noising.voidsetEnabledNoiseNormal(boolean flag)Set flag to enable movement of vertices in vertex normal direction.voidsetEnabledNoiseTangential(boolean flag)Set flag to enable movement of vertices in tangential direction.voidsetEnabledUpdateNormals(boolean flag)Set flag to update vertex normals after noising.voidsetGeometry(PgGeometry geom)Store geometry to be noised.voidsetNoiseMode(int mode)Set noise mode.booleanupdate(java.lang.Object event)Update the class whenever a child has changed.voidupdateNormals(boolean flag)Deprecated.use setEnabledUpdateNormals.-
Methods inherited from class jvx.project.PjWorkshop
cancel, getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, ok, removeGeometry, setDisplay, setDisplays, setModal, setMode, setStandalone, 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
-
UNIFORM_SPHERICAL
public static final int UNIFORM_SPHERICAL
Identifier for uniform noise in a unit ball.- See Also:
- Constant Field Values
-
UNIFORM_BOX
public static final int UNIFORM_BOX
Identifier for uniform noise in a [-1.0; 1.0]^dim box.- See Also:
- Constant Field Values
-
GAUSSIAN
public static final int GAUSSIAN
Identifier for noise with normal distributed distance.- See Also:
- Constant Field Values
-
m_noiseMode
public int m_noiseMode
Mode identifier defining the type of noise to compute.
-
-
Method Detail
-
init
public void init()
Initialization.- Overrides:
initin classPjWorkshop
-
reset
public void reset()
Reset- Overrides:
resetin classPjWorkshop
-
setGeometry
public void setGeometry(PgGeometry geom)
Store geometry to be noised.- Specified by:
setGeometryin interfacePjWorkshopIf- Overrides:
setGeometryin classPjWorkshop- Parameters:
geom- the workshop modifies this geometry.- Version:
- 03.02.07, 2.00 revised (kp) Method now overloads PjWorkshop#setGeometry(PgGeometry).
-
setAmplitude
public void setAmplitude(double value)
Set amplitude of noise.
-
getAmplitude
public double getAmplitude()
Get amplitude of noise.
-
setNoiseMode
public void setNoiseMode(int mode)
Set noise mode.
-
getNoiseMode
public int getNoiseMode()
Get noise mode.
-
isEnabledKeepBoundary
public boolean isEnabledKeepBoundary()
Get flag to keep boundary vertices fixed during noising.- Since:
- JavaView 2.66
- Version:
- 30.03.03, 1.00 created (kp)
-
setEnabledKeepBoundary
public void setEnabledKeepBoundary(boolean flag)
Set flag to keep boundary vertices fixed during noising.- Since:
- JavaView 2.66
- Version:
- 30.03.03, 1.00 created (kp)
-
isEnabledKeepSelected
public boolean isEnabledKeepSelected()
Get flag to keep selected vertices fixed during noising.- Since:
- JavaView 2.66
- Version:
- 30.03.03, 1.00 created (kp)
-
setEnabledKeepSelected
public void setEnabledKeepSelected(boolean flag)
Set flag to keep selected vertices fixed during noising.- Since:
- JavaView 2.66
- Version:
- 30.03.03, 1.00 created (kp)
-
isEnabledNoiseTangential
public boolean isEnabledNoiseTangential()
Get flag to enable movement of vertices in tangential direction.- Since:
- JavaView 2.66
- Version:
- 30.03.03, 1.00 created (kp)
-
setEnabledNoiseTangential
public void setEnabledNoiseTangential(boolean flag)
Set flag to enable movement of vertices in tangential direction.- Since:
- JavaView 2.66
- Version:
- 30.03.03, 1.00 created (kp)
-
isEnabledNoiseNormal
public boolean isEnabledNoiseNormal()
Get flag to enable movement of vertices in vertex normal direction.- Since:
- JavaView 2.66
- Version:
- 30.03.03, 1.00 created (kp)
-
setEnabledNoiseNormal
public void setEnabledNoiseNormal(boolean flag)
Set flag to enable movement of vertices in vertex normal direction.- Since:
- JavaView 2.66
- Version:
- 30.03.03, 1.00 created (kp)
-
isEnabledUpdateNormals
public boolean isEnabledUpdateNormals()
Get flag to update vertex normals after noising.- Since:
- JavaView 2.66
- Version:
- 30.03.03, 1.00 created (kp)
-
setEnabledUpdateNormals
public void setEnabledUpdateNormals(boolean flag)
Set flag to update vertex normals after noising.- Since:
- JavaView 2.66
- Version:
- 30.03.03, 1.00 created (kp)
-
keepBoundary
public void keepBoundary(boolean flag)
Deprecated. use setEnabledKeepBoundary.Set flag to keep or not keep boundary vertices un-noised.
-
keepSelected
public void keepSelected(boolean flag)
Deprecated. use setEnabledKeepSelected.Set flag to keep or not keep selected vertices un-noised.
-
noiseTangential
public void noiseTangential(boolean flag)
Deprecated. use setEnabledNoiseTangential.Set Flag to noise or not noise vertices in tangential direction.
-
noiseNormal
public void noiseNormal(boolean flag)
Deprecated. use setEnabledNoiseNormal.Set Flag to noise or not noise vertices in vertex normal direction.
-
updateNormals
public void updateNormals(boolean flag)
Deprecated. use setEnabledUpdateNormals.Set flag to update or not update vertex normals after noising.
-
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:
updatein interfacePsUpdateIf- Overrides:
updatein classPjWorkshop- Parameters:
event- sender of this update.- Returns:
- true if update was correctly handled by superclass.
- See Also:
PsObject.setParent(PsUpdateIf),PsObject.getFather(),PsObject.addUpdateListener(PsUpdateIf)
-
close
public void close()
Close workshop and remove workshop from geometry as update listener. Instance variables of this workshop are nulled.- Overrides:
closein classPjWorkshop
-
newFrequence
public void newFrequence()
Select by random vertices to be noised.
-
newNoise
public void newNoise()
Generate new random noise directions for all vertices.
-
noise
public void noise(double factor, boolean bNormal, boolean bTangential, boolean bKeepBoundary, boolean bKeepSelected)Deprecated. set options first and use noise() method instead.(ur)
-
noise
public void noise()
Move all vertices by their individual noise directions. Successive calls of this method will use the same noise vector per vertex unless the noise vector has been updated inbetween.Vertex and element normals of the geometry are update if the original geometry had respective normal vectors.
- Since:
- JavaView 2.49.015
- Author:
- Ulrich Reitebuch
- Version:
- 30.03.03, 1.10 revised (kp) No longer call update(this) which must now be invoked from elsewhere. 12.02.03, 1.00 revised (ur) Method created using the body of method noise(double, boolean, boolean, boolean, boolean).
-
-
"