public class PwSymmetry extends PjWorkshop
| Modifier and Type | Field and Description |
|---|---|
static long |
serialVersionUID
Set to indicate serialization compatibility with a previous version of the class.
|
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_TAGSMODE_BUG, MODE_STANDARD, MODE_VALIDATE| Constructor and Description |
|---|
PwSymmetry()
Initialize and set names of project and sliders.
|
| Modifier and Type | Method and Description |
|---|---|
PdVector |
approxNormal(PdVector p,
PdVector q,
PdVector r)
Approximate normal of plane derived from the PdVector class but with an epsilon-tolerance.
|
void |
colorGeoms(boolean show)
Colors different geometries in different colors if show is true and resets
to the original coloring if false.
|
void |
createGeo(PdMatrix[] mat)
Create mirrored geometries from matrices given.
|
boolean |
epsEqual(PdVector vec1,
PdVector vec2,
double eps)
Compares the two PdVectors vec1 and vec2 component-wise and marks them equal if they
differ maximally by eps in each component.
|
jvx.geom.EquiPoint[] |
getEquivalents(PdVector start,
PdMatrix[] M,
int numMatrices,
double eps)
Returns pairs of words which are equivalent.
|
jvx.geom.EquiPoint |
getEquiWords(int i,
int j,
int k,
java.util.Vector list)
Returns two equivalent words of points which are already known to be the same.
|
PdVector |
getHomogCenter(PgElementSet geom)
Get the center of a geometry in homogeneous coordinates.
|
int |
getPolyDimension(PgPointSet poly)
This method returns the dimension of a given PgPointSet, which it spans in space.
|
double |
getShortestPointDist(PgElementSet geom)
Get the shortest distance between two points of a geometry (faster with kdtree?).
|
void |
getSymmAndGeom()
Computes the symmetries of m_geom and shows its mirrored geometries.
|
PdMatrix[] |
getSymmetries(int m_maxdepth,
int critAngle,
double eps)
Computes the symmetries of a given object.
|
PdMatrix[] |
getSymmetryMatrices(PgPolygon[] bound)
Creates symmetry matrices from the planes given in bound.
|
void |
getTreeAndEqui(PdVector start,
PdMatrix[] M,
int numMatrices,
double eps,
int m_maxdepth)
Returns equivalent words in "eq" and the tree in "tmplist" in the variables given.
|
PiVector |
getWord(int i,
java.util.Vector list)
Returns the word for a single element of the tree.
|
PiVector |
getWord(int i,
jvx.geom.WordPoint[] list)
Returns the word for a single element of the tree.
|
PdMatrix[] |
getWordMatrices(PiVector[] words,
PdMatrix[] M)
Returns the matrices which generate the whole space.
|
PdMatrix[] |
getWordMatrices(jvx.geom.WordPoint[] list,
PdMatrix[] M)
Returns the matrices which generate the whole space.
|
PiVector[] |
getWords(jvx.geom.WordPoint[] list)
Returns the words of a matrix composition given through a tree containing letters.
|
int |
hasEquivPoint(java.util.Vector list,
PdVector check,
double eps)
Method that checks if a given point is already contained in a wordlist or not.
|
void |
init()
Configure and initialize the viewer and the panel.
|
PgBndPolygon[] |
makeBoundaries(int critAngle,
PgElementSet geom)
Creates the boundary for an ElementSet adding a neighbour relation and splitting
at points which do not fulfill the angle criterion (i.e. mostly that the polygon is not planar there).
|
jvx.geom.WordPoint[] |
makeTree(PdVector start,
PdMatrix[] M,
int numMatrices,
double eps)
Creates a tree in a vector of self-referring entries of type WordPoint.
|
PdVector |
matmult(PdMatrix M,
PdVector x)
Multiply PdMatrix with PdVector and get a PdVector.
|
void |
mergeVis()
Merges the currently visible geometries and removes the invisible ones from the workshop.
|
void |
mirrorAlongSelected()
Mirrors the geometry along all those edges which have at least two vertices marked.
|
PdMatrix |
mirrorBoundary(int i,
PgBndPolygon[] bound,
PgElementSet geom)
This function computes a reflection matrix if the i-th component of m_bound is 2 dimensional,
a matrix which rotates by Pi if it is 1-dimensional or returns the zero matrix in any other cases.
|
void |
partialMerge()
Merges geometries into an overlay geometry which makes it possible to mark all
vertices of the mirrored geometries
but leaves the mirrored parts for further work.
|
void |
reset()
Resets to the initial state, which the workshop had at startup.
|
void |
resetOptions()
Resets the Checkboxes and their actions in the display.
|
void |
restoreColors(PgElementSet geom)
Restores original coloring of the geometry.
|
void |
saveColors()
Saves the color and properties of the generating geometry.
|
int[] |
selectBoundaries(PgPolygon[] bound,
PgPointSet selPoints)
This method returns an integer-array which contains the indices of the polygons
which contain at least two points from the pointcloud "selpoints".
|
PgPointSet |
selectPoints(PgElementSet geom)
Returns a pointset which contains all selected points of the given geometry.
|
void |
setCheckGeometricOverlap(boolean check) |
void |
setGeometry(PgGeometry geom)
Set the geometry for this workshop, adjust sliders and viewer accurately.
|
void |
showAllGeoms()
Show all of the mirrored geometries and merge them.
|
void |
showBoundaries(boolean show)
Show or hide the boundaries of a geometry.
|
void |
showBoundaries(PgBndPolygon[] bound)
Shows the given boundaries in different coloring.
|
void |
showMirroredGeoms(int elemNum,
PgElementSet geom)
Shows mirrored geometries.
|
boolean |
update(java.lang.Object event)
Handles the slider-events.
|
cancel, close, getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, ok, removeGeometry, setDisplay, setDisplays, setModal, setMode, setStandalone, setVieweraddInspector, 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, updatePanelsequals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFather, getName, setParentpublic static final long serialVersionUID
public void init()
init in class PjWorkshoppublic void setGeometry(PgGeometry geom)
setGeometry in interface PjWorkshopIfsetGeometry in class PjWorkshopgeom - the workshop modifies this geometry.public boolean update(java.lang.Object event)
update in interface PsUpdateIfupdate in class PjWorkshopevent - sender of this update.PsObject.setParent(PsUpdateIf),
PsObject.getFather(),
PsObject.addUpdateListener(PsUpdateIf)public void reset()
reset in class PjWorkshoppublic void resetOptions()
public void setCheckGeometricOverlap(boolean check)
check - public void showMirroredGeoms(int elemNum,
PgElementSet geom)
elemNum - is the number of elements which are supposed to be drawn- in order of the tree.geom - is the geometry, which was mirrored.public void showAllGeoms()
public void partialMerge()
public void mergeVis()
public PdVector approxNormal(PdVector p, PdVector q, PdVector r)
p - is the first vector defining the plane.q - is the second vector defining the plane.r - is the third vector defining the plane.public void colorGeoms(boolean show)
show - Indicates if geometries will be colored differently or not.public void saveColors()
public void restoreColors(PgElementSet geom)
geom - geometry, whose color is to be restored.public int[] selectBoundaries(PgPolygon[] bound, PgPointSet selPoints)
bound - the bpolygon (boundary) to be compared with the given pointcloudselPoints - the currently by user selected vertices.public PgBndPolygon[] makeBoundaries(int critAngle, PgElementSet geom)
critAngle - is the critical angle for splitting of the boundary.geom - is the geometry, of which a boundary will be created.public void showBoundaries(boolean show)
show - indicates whether the boundary will be shown or not.public void showBoundaries(PgBndPolygon[] bound)
bound - is a set of boundary-polygons to be highlighted in different colors.public PgPointSet selectPoints(PgElementSet geom)
geom - geometry which is checked for selected points.geom.public void mirrorAlongSelected()
public PdMatrix mirrorBoundary(int i, PgBndPolygon[] bound, PgElementSet geom)
i - is the index of the boundary for which the reflection matrix will be computed.bound - is the boundary of geom.geom - is the geometry working with.public int getPolyDimension(PgPointSet poly)
poly - Given pointset which is to be checked for dimensionpublic void getSymmAndGeom()
public void createGeo(PdMatrix[] mat)
mat - Reflection matrices that define the mirrored geometries generated from m_elSet.public PdMatrix[] getSymmetries(int m_maxdepth, int critAngle, double eps)
m_maxdepth - is the maximal tree depth to which the symmetries are computed.critAngle - is the critical angle for the boundary splitting.eps - is the tolerance for the tree computation.public PdMatrix[] getSymmetryMatrices(PgPolygon[] bound)
bound - is a boundary polygon.public void getTreeAndEqui(PdVector start, PdMatrix[] M, int numMatrices, double eps, int m_maxdepth)
start - StartpointM - MatricesnumMatrices - Number of Matrices usedeps - Tolerancem_maxdepth - maximal tree depth.public jvx.geom.WordPoint[] makeTree(PdVector start, PdMatrix[] M, int numMatrices, double eps)
start - The (well chosen) starting pointM - The base-matrices to generate the symmetries withnumMatrices - The number of matrices given (hopefully obsolete in the future)eps - The tolerance below which the difference between two vectors is
(component wise) considered equal.public jvx.geom.EquiPoint[] getEquivalents(PdVector start, PdMatrix[] M, int numMatrices, double eps)
start - is the startpoint for the geometrical equivalence check.M - is an array of matrices which is to be checked for equivalence.numMatrices - is the number of matrices in M.eps - is the tolerance for the computation.public jvx.geom.EquiPoint getEquiWords(int i,
int j,
int k,
java.util.Vector list)
i - letter of dead endj - index of first point with same coordinatesk - index of second point with same coordinateslist - the treepublic PdMatrix[] getWordMatrices(PiVector[] words, PdMatrix[] M)
words - The words which generate an elementM - The base-matrices.public PdMatrix[] getWordMatrices(jvx.geom.WordPoint[] list, PdMatrix[] M)
list - The list which contains the treeM - The base-matricespublic PiVector getWord(int i, java.util.Vector list)
i - The index of the element to get the word forlist - The tree.public PiVector getWord(int i, jvx.geom.WordPoint[] list)
i - The index of the element to get the word forlist - The tree.public PiVector[] getWords(jvx.geom.WordPoint[] list)
list - The tree to generate words from.public double getShortestPointDist(PgElementSet geom)
geom - geometry whose edge is to be checked.public PdVector getHomogCenter(PgElementSet geom)
geom - geometry whose center is to be found.public int hasEquivPoint(java.util.Vector list,
PdVector check,
double eps)
list - the list, which contains the points.check - the vector to be compared with the listeps - tolerance for equality-checkpublic boolean epsEqual(PdVector vec1, PdVector vec2, double eps)
vec1 - first vector to be checked for equalityvec2 - second vector to be checked for equalityeps - equality-threshold"