|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Canvas
javax.media.j3d.Canvas3D
org.jcae.viewer3d.View
org.jcae.viewer3d.post.TextureFitter
public class TextureFitter
A special View which allows to fit a texture on a given geometry. It helps to compute the transformation which will match the texture on the geometry. The texture is mapped with an orthogonal projection on the geometry. The projection is done by OpenGL. The transformation applied on the texture before being projected is computed using 2 user specified triangles, one in the geometry space (3D) and one in the texture space (3D with z=0). If the specified triangles are not similar (the angles of one are equal to the corresponding angles of the other) the computed transformation is normalized to ensure that the projection is not deformant.
| Nested Class Summary | |
|---|---|
static class |
TextureFitter.PickViewableCAD
A special ViewableCAD which allows picking points on a surface. |
| Nested classes/interfaces inherited from class java.awt.Canvas |
|---|
java.awt.Canvas.AccessibleAWTCanvas |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class org.jcae.viewer3d.View |
|---|
BACK, BackClipDistanceFactor, BOTTOM, FRONT, FrontClipDistanceFactor, LEFT, orbit, RIGHT, TOP |
| Fields inherited from class javax.media.j3d.Canvas3D |
|---|
FIELD_ALL, FIELD_LEFT, FIELD_RIGHT |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
TextureFitter(java.awt.Window frame)
|
|
| Method Summary | |
|---|---|
static void |
displayMatrixInfo(javax.vecmath.Matrix4d matrix)
|
Viewable |
displayTexture(org.jcae.opencascade.jni.TopoDS_Shape shape,
javax.vecmath.Point3d[] triangle2d,
javax.vecmath.Point3d[] triangle3d,
java.awt.image.BufferedImage image)
Display the texture with a normalized projection |
Viewable |
displayTexture(org.jcae.opencascade.jni.TopoDS_Shape shape,
javax.vecmath.Point3d[] triangle2d,
javax.vecmath.Point3d[] triangle3d,
java.awt.image.BufferedImage image,
boolean normalize)
|
Viewable |
drawPoint(double x,
double y,
double z)
|
static void |
getEulerAngles(javax.vecmath.Tuple3d angles,
javax.vecmath.Quat4d q1)
from http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/ |
static double |
getOrthogonality(javax.vecmath.Matrix4d m)
Return the sum in absolute value of scalar product of column vector of the matrix. |
static javax.vecmath.Vector3d |
getScaling(javax.vecmath.Matrix4d m)
Return the scaling factor in the 3 direction for the given transformation. |
static org.jcae.opencascade.jni.TopoDS_Compound |
getSelectFaces(ViewableCAD viewable,
org.jcae.opencascade.jni.TopoDS_Shape shape)
Return selected faces in a viewable |
static javax.vecmath.Matrix4d |
getTransform(javax.vecmath.Point3d[] dst,
javax.vecmath.Point3d[] src)
Compute the normalized transformation of triangle src to triangle dst |
static javax.vecmath.Matrix4d |
getTransform(javax.vecmath.Point3d[] dst,
javax.vecmath.Point3d[] src,
boolean normalize)
Compute the transformation of triangle src to triangle dst |
void |
print3DProperties(java.io.PrintStream out)
Display 3D properties for debugging purpose It use Canvas3D.queryProperties |
void |
removeTexture(Viewable viewable)
|
void |
updateTexture(Viewable viewable,
javax.vecmath.Point3d[] triangle2d,
javax.vecmath.Point3d[] triangle3d)
Move the texture. |
void |
updateTexture(Viewable viewable,
javax.vecmath.Point3d[] triangle2d,
javax.vecmath.Point3d[] triangle3d,
boolean normalize)
Move the texture |
| Methods inherited from class javax.media.j3d.Canvas3D |
|---|
addNotify, getBounds, getBounds, getCenterEyeInImagePlate, getDoubleBufferAvailable, getDoubleBufferEnable, getGraphics2D, getGraphicsContext3D, getHeight, getImagePlateToVworld, getInverseVworldProjection, getLeftEyeInImagePlate, getLeftManualEyeInImagePlate, getLocation, getLocation, getLocationOnScreen, getMonoscopicViewPolicy, getOffScreenBuffer, getOffScreenLocation, getOffScreenLocation, getPhysicalHeight, getPhysicalWidth, getPixelLocationFromImagePlate, getPixelLocationInImagePlate, getPixelLocationInImagePlate, getRightEyeInImagePlate, getRightManualEyeInImagePlate, getSceneAntialiasingAvailable, getScreen3D, getSize, getSize, getStereoAvailable, getStereoEnable, getView, getVworldProjection, getVworldToImagePlate, getWidth, getX, getY, isOffScreen, isRendererRunning, isShadingLanguageSupported, paint, preRender, queryProperties, removeNotify, renderField, renderOffScreenBuffer, setDoubleBufferEnable, setLeftManualEyeInImagePlate, setMonoscopicViewPolicy, setOffScreenBuffer, setOffScreenLocation, setOffScreenLocation, setRightManualEyeInImagePlate, setStereoEnable, startRenderer, stopRenderer, swap, waitForOffScreenRendering |
| Methods inherited from class java.awt.Canvas |
|---|
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TextureFitter(java.awt.Window frame)
frame - the window owning the widget| Method Detail |
|---|
public static org.jcae.opencascade.jni.TopoDS_Compound getSelectFaces(ViewableCAD viewable,
org.jcae.opencascade.jni.TopoDS_Shape shape)
viewable - The viewable on witch picking has been doneshape - The shape from which faces are selected. This is the one
used to create the viewable.
public static javax.vecmath.Matrix4d getTransform(javax.vecmath.Point3d[] dst,
javax.vecmath.Point3d[] src)
dst - The 3 transformed pointssrc - The 3 points to transform
public static javax.vecmath.Matrix4d getTransform(javax.vecmath.Point3d[] dst,
javax.vecmath.Point3d[] src,
boolean normalize)
dst - The 3 transformed pointssrc - The 3 points to transformtrue - to normalize the transformationpublic static javax.vecmath.Vector3d getScaling(javax.vecmath.Matrix4d m)
public static double getOrthogonality(javax.vecmath.Matrix4d m)
public static void displayMatrixInfo(javax.vecmath.Matrix4d matrix)
public static void getEulerAngles(javax.vecmath.Tuple3d angles,
javax.vecmath.Quat4d q1)
public Viewable displayTexture(org.jcae.opencascade.jni.TopoDS_Shape shape,
javax.vecmath.Point3d[] triangle2d,
javax.vecmath.Point3d[] triangle3d,
java.awt.image.BufferedImage image)
shape - The shape on which the texture must be displayedtriangle2d - The 2D points (z=0) picked on the bitmaptriangle3d - The 3D points picked on the geometryimage - The image to displaytrue - to normalize
public Viewable displayTexture(org.jcae.opencascade.jni.TopoDS_Shape shape,
javax.vecmath.Point3d[] triangle2d,
javax.vecmath.Point3d[] triangle3d,
java.awt.image.BufferedImage image,
boolean normalize)
shape - The shape on which the texture must be displayedtriangle2d - The 2D points (z=0) picked on the bitmaptriangle3d - The 3D points picked on the geometryimage - The image to displaytrue - to normalize
public void removeTexture(Viewable viewable)
public void updateTexture(Viewable viewable,
javax.vecmath.Point3d[] triangle2d,
javax.vecmath.Point3d[] triangle3d)
triangle2d - The 2D points (z=0) picked on the bitmaptriangle3d - The 3D points picked on the geometry
public void updateTexture(Viewable viewable,
javax.vecmath.Point3d[] triangle2d,
javax.vecmath.Point3d[] triangle3d,
boolean normalize)
triangle2d - The 2D points (z=0) picked on the bitmaptriangle3d - The 3D points picked on the geometrytrue - to normalizepublic void print3DProperties(java.io.PrintStream out)
out - The PrintStream where to print (i.e. System.out)
public Viewable drawPoint(double x,
double y,
double z)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||