JavaView© v3.95.000

jvx.geom
Class PwTransform

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

public class PwTransform
extends PjWorkshop

Workshop to perform simple transformations like scaling, translating or rotating on a geometry. All operatins are performed for each coordinate axis individually. Rotations and scalings use the center of each geometry as reference point.

See Also:
Serialized Form

Field Summary
 
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
PwTransform(int dim)
          Constructor, with dimension of vertices.
PwTransform(PgPointSet geom)
          Constructor, with geometry.
 
Method Summary
 void close()
          Close workshop and remove itself as listener from various classes.
 void init()
          Initialize the workshop.
 void reset()
          Reset workshop and reset the geometry with its backup version.
static void rotate(PgPointSet geom, double angle, int coord)
          Method rotates the given geometry around the specified coordinate axis.
static void rotate(PgPointSet geom, double angle, int coord, boolean selectedOnly)
          Method rotates the given geometry around the specified coordinate axis.
static void rotate(PgPointSet geom, double angle, int coord, PdVector centerOfRotation)
          Method rotates the given geometry around the specified coordinate axis.
static void rotate(PgPointSet geom, double angle, int coord, PdVector centerOfRotation, boolean selectedOnly)
          Method rotates the given geometry around the specified coordinate axis.
static void scale(PgPointSet geom, double value)
          Method scales the geometry geometry by a given factor.
static void scale(PgPointSet geom, double value, int coord)
          Method scales one coordinate of the geometry geometry by a given factor.
static void scale(PgPointSet geom, double value, int coord, PdVector center, boolean selectedOnly)
          Method scales one coordinate of the geometry geometry by a given factor.
static void scale(PgPointSet geom, double value, PdVector center, boolean selectedOnly)
          Method scales the geometry geometry by a given factor.
 void setGeometry(PgPointSet geom)
          Assign a geometry on which this workshop operates, and create a backup copy if workshop is cancelled.
static void translate(PgPointSet geom, double value, int coord)
          Method translates the given geometry in the directions of the given coordinate axis.
static void translate(PgPointSet geom, double value, int coord, boolean selectedOnly)
          Method translates the given geometry in the directions of the given coordinate axis.
 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, 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
 

Constructor Detail

PwTransform

public PwTransform(PgPointSet geom)
Constructor, with geometry.


PwTransform

public PwTransform(int dim)
Constructor, with dimension of vertices.

Method Detail

init

public void init()
Initialize the workshop.

Overrides:
init in class PjWorkshop

reset

public void reset()
Reset workshop and reset the geometry with its backup version.

Overrides:
reset in class PjWorkshop

close

public void close()
Close workshop and remove itself as listener from various classes. The workshop will no longer be working after this call.

Overrides:
close in class PjWorkshop

setGeometry

public void setGeometry(PgPointSet geom)
Assign a geometry on which this workshop operates, and create a backup copy if workshop is cancelled.


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.

translate

public static void translate(PgPointSet geom,
                             double value,
                             int coord,
                             boolean selectedOnly)
Method translates the given geometry in the directions of the given coordinate axis.

Parameters:
geom - geom that will be translated
value - length of the translation
coord - translation in direction of the specified coordinate axis
selectedOnly - transform the selected vertices only

translate

public static void translate(PgPointSet geom,
                             double value,
                             int coord)
Method translates the given geometry in the directions of the given coordinate axis.

Parameters:
geom - geom that will be translated
value - length of the translation
coord - translation in direction of the specified coordinate axis

scale

public static void scale(PgPointSet geom,
                         double value,
                         PdVector center,
                         boolean selectedOnly)
Method scales the geometry geometry by a given factor. The center of gravity is the base point of the scaling.

Parameters:
geom - geom that will be scaled
value - factor of the scaling
center - Center for scaling
selectedOnly - transform the selected vertices only

scale

public static void scale(PgPointSet geom,
                         double value)
Method scales the geometry geometry by a given factor. The center of gravity is the base point of the scaling.

Parameters:
geom - geom that will be scaled
value - factor of the scaling

scale

public static void scale(PgPointSet geom,
                         double value,
                         int coord,
                         PdVector center,
                         boolean selectedOnly)
Method scales one coordinate of the geometry geometry by a given factor. The center of gravity is the base point of the scaling.

Parameters:
geom - geom that will be scaled
value - factor of the scaling
coord - scale only of the specified coordinate
selectedOnly - transform the selected vertices only

scale

public static void scale(PgPointSet geom,
                         double value,
                         int coord)
Method scales one coordinate of the geometry geometry by a given factor. The center of gravity is the base point of the scaling.

Parameters:
geom - geom that will be scaled
value - factor of the scaling
coord - scale only of the specified coordinate

rotate

public static void rotate(PgPointSet geom,
                          double angle,
                          int coord)
Method rotates the given geometry around the specified coordinate axis. The center of the rotation is the center of gravity of the geometry. Only works for geometries in 3-space.

Parameters:
geom - geom that will be rotated
angle - angle of the rotation in radians
coord - rotatation around the specified coordinate axis

rotate

public static void rotate(PgPointSet geom,
                          double angle,
                          int coord,
                          boolean selectedOnly)
Method rotates the given geometry around the specified coordinate axis. The center of the rotation is the center of gravity of the geometry. Only works for geometries in 3-space.

Parameters:
geom - geom that will be rotated
angle - angle of the rotation in radians
coord - rotatation around the specified coordinate axis
selectedOnly - transform the selected vertices only

rotate

public static void rotate(PgPointSet geom,
                          double angle,
                          int coord,
                          PdVector centerOfRotation,
                          boolean selectedOnly)
Method rotates the given geometry around the specified coordinate axis. Only works for geometries in 3-space.

Parameters:
geom - geom that will be rotated
angle - angle of the rotation in radians
coord - rotatation around the specified coordinate axis
centerOfRotation - rotate geometry around the specified center
selectedOnly - transform the selected vertices only

rotate

public static void rotate(PgPointSet geom,
                          double angle,
                          int coord,
                          PdVector centerOfRotation)
Method rotates the given geometry around the specified coordinate axis. Only works for geometries in 3-space.

Parameters:
geom - geom that will be rotated
angle - angle of the rotation in radians
coord - rotatation around the specified coordinate axis
centerOfRotation - rotate geometry around the specified center

JavaView© v3.95.000

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