jvx.geom
Class PwTransform
- java.lang.Object
-
- jv.object.PsObject
-
- jvx.project.PjWorkshop
-
- jvx.geom.PwTransform
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PjWorkshopIf
public class PwTransform extends PjWorkshop
Workshop to perform simple transformations like scaling, translating or rotating on a geometry. All operations are performed for each coordinate axis individually. Rotations and scalings use the center of each geometry as reference point. New tabPanels for mapping of ambient space using functional expressions, or mapping of texture coordinates have been added.- See Also:
- Serialized Form
- Author:
- Klaus Hildebrandt, Konrad Polthier, Matthias Nieser
- Version:
- 07.02.17, 1.90 revised (ur) Bug fix in security check for vector field rotation.
25.09.09, 1.80 revised (mn) Add rotation and scaling of vector fields.
08.08.08, 1.70 revised (kp) New tabPanel for function mappings on ambient space added.
07.08.08, 1.60 revised (kp) Reorganisation of constructor and init, some constructors removed..
21.01.07, 1.50 revised (ah) Added default constructor, setDimension(int). setGeometry now overloads PjWorkshop.setGeometry.
22.07.06, 1.40 revised (mn) Cleaned code. Added 2d rotation and transformation of textures.
05.07.05, 1.30 revised (mn) Added functionality: transform selected geometries, scale around fixed center.
27.10.04, 1.20 revised (kh) Added functionality: transform whole scene, modify center of rotation,...
23.08.03, 1.10 revised (kp) Initialization of scaleOld moved to init() from constructor.
21.05.03, 1.00 created (kh)
-
-
Field Summary
-
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 PwTransform()Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclose()Close workshop and remove itself as listener from various classes.voidcompute(PgPointSet geom, boolean selectedOnly)Perform all functional evaluations on vertex set of geometry.voidinit()Initialize the workshop.voidreset()Reset workshop and reset the geometry with its backup version.static voidrotate(PgPointSet geom, double angle, int coord)Method rotates the given geometry around the specified coordinate axis.static voidrotate(PgPointSet geom, double angle, int coord, boolean selectedOnly)Method rotates the given geometry around the specified coordinate axis.static voidrotate(PgPointSet geom, double angle, int coord, PdVector centerOfRotation)Method rotates the given geometry around the specified coordinate axis.static voidrotate(PgPointSet geom, double angle, int coord, PdVector centerOfRotation, boolean selectedOnly)Method rotates the given geometry around the specified coordinate axis.static voidscale(PgPointSet geom, double value)Method scales the geometry geometry by a given factor.static voidscale(PgPointSet geom, double value, int coord)Method scales one coordinate of the geometry geometry by a given factor.static voidscale(PgPointSet geom, double value, int coord, PdVector center, boolean selectedOnly)Method scales one coordinate of the geometry geometry by a given factor.static voidscale(PgPointSet geom, double value, PdVector center, boolean selectedOnly)Method scales the geometry geometry by a given factor.voidsetDimension(int dim)Initialize the workshop with the given dimension.voidsetGeometry(PgGeometry geom)Assign a geometry on which this workshop operates, and create a backup copy if workshop is canceled.static voidtranslate(PgPointSet geom, double value, int coord)Method translates the given geometry in the directions of the given coordinate axis.static voidtranslate(PgPointSet geom, double value, int coord, boolean selectedOnly)Method translates the given geometry in the directions of the given coordinate axis.booleanupdate(java.lang.Object event)Update the class whenever a child has changed.-
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
-
-
-
-
Method Detail
-
init
public void init()
Initialize the workshop.- Overrides:
initin classPjWorkshop
-
reset
public void reset()
Reset workshop and reset the geometry with its backup version.- Overrides:
resetin classPjWorkshop
-
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:
closein classPjWorkshop
-
setGeometry
public void setGeometry(PgGeometry geom)
Assign a geometry on which this workshop operates, and create a backup copy if workshop is canceled.- 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).
-
setDimension
public void setDimension(int dim)
Initialize the workshop with the given dimension.- Parameters:
dim- dimensions of space, number of rotation axis.
-
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)
-
compute
public void compute(PgPointSet geom, boolean selectedOnly)
Perform all functional evaluations on vertex set of geometry.- Since:
- JavaView v.3.99.031
- Version:
- 07.08.08, 1.00 created (kp)
-
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 translatedvalue- length of the translationcoord- translation in direction of the specified coordinate axis
-
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 translatedvalue- length of the translationcoord- translation in direction of the specified coordinate axisselectedOnly- 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 scaledvalue- factor of the scaling
-
scale
public static void scale(PgPointSet geom, double value, PdVector center, boolean selectedOnly)
Method scales the geometry geometry by a given factor. The center is the base point of the scaling.- Parameters:
geom- geom that will be scaledvalue- factor of the scalingcenter- Center for scalingselectedOnly- 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 scaledvalue- factor of the scalingcoord- scale only of the specified coordinate
-
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 is the base point of the scaling.- Parameters:
geom- geom that will be scaledvalue- factor of the scalingcoord- scale only of the specified coordinateselectedOnly- transform the selected vertices only
-
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 2 or 3-space.- Parameters:
geom- geom that will be rotatedangle- angle of the rotation in radianscoord- rotation 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 specified. Only works for geometries in 2 or 3-space.- Parameters:
geom- geom that will be rotatedangle- angle of the rotation in radianscoord- rotation around the specified coordinate axisselectedOnly- 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 2 or 3-space.- Parameters:
geom- geom that will be rotatedangle- angle of the rotation in radianscoord- rotation around the specified coordinate axiscenterOfRotation- rotate geometry around the specified centerselectedOnly- 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 2 or 3-space.- Parameters:
geom- geom that will be rotatedangle- angle of the rotation in radianscoord- rotation around the specified coordinate axiscenterOfRotation- rotate geometry around the specified center
-
-
"