anar

Class Transform

java.lang.Object
  extended by anar.Parametric
      extended by anar.Transform
All Implemented Interfaces:
iTaggable
Direct Known Subclasses:
Allign, Origine, RotateX, RotateY, RotateZ, Scale, Translate

public class Transform
extends Parametric

Transform

Transformation are operators modifying a geometry.. Transformations are often express on the form of push() and pop() matrix stackingOpenGLreference. While it provide a efficient way to combine matrices, it tends to make more difficult how actual position of a vertex could be traced back. This is due to the primary goals of OpenGL where real-time renderings are crucial. One of the problems with this structure is the lack of evaluation of final position of a point. In CAD systems, on the other hand, the actual position of a point is keep through a database where this problem doesn't exist. Tracking real position of a vertex through a scene is important of some operations such calculation of a length between two points, areas or volumetric calculations. Since the OOG library relies on this type of measurements, it became important to provide a structure more closer to the traditional CAD structure where each final positions are keep through a database. On the other hand, one problem with a database of final positions of vertices is that it often lead to a lack of description of geo-constructional descriptions, only last position are kept (Autocad, FormZ, 3DStudioMax, Maya) and process is only kept through a Undo function framework. One way to combine the two features inside a single framework is two generalize transformation operator in a such way that each operation are kept for a creation of an object. This is the geo-constructional process.

Combined Transformation

Reset reference system to an redefined referential coordinate system (ALLIGN, ...). Similarly to LOGO [abelson1980] language, this feature helps to provide a more intuitive way to describe relationship between objects according to a different referential coordinate system. Each object could be reset to a normalized coordinate system then a new Transform operator is applied and set back to the previous position. The description of an object is the relative to an object a limit the use of an absolute coordinate system.

Everything that will transform a point. Icluding Linear Transformation or more complex


Field Summary
 boolean postTransform
           
 boolean preTransform
           
 
Fields inherited from class anar.Parametric
meta
 
Constructor Summary
Transform()
           
Transform(Pt a)
          initializes a transformation with center a.
Transform(Pt a, Pt b)
          initializes a transformation with center a and direction ab.
Transform(Pt a, Pt b, Pt c)
          initializes a transformation with frame of reference centered in a and with directions ab, ac, ab x ac more technically the point a will be translated back to the origin and the vector ab x ac rotated to concinde with the Z axis before applying other transformations and then transferred back to point a with directions ab, ac and ab x ac.
Transform(Pt a, Pt b, Pt c, Transform t)
           
Transform(Pt a, Pt b, Transform t)
           
Transform(Pt a, Transform t)
           
Transform(Transform... ts)
           
Transform(Transform a)
           
Transform(Transform a, Transform b)
           
 
Method Summary
 void add(Transform t)
           
 Transform apply(Transform t)
           
 PMatrix3D get()
           
 PMatrix3D getInvert()
           
 Transform postTransform()
           
 Transform preTransform()
           
 Transform rotateX(float v)
           
 Transform rotateX(Param v)
           
 Transform rotateY(float v)
           
 Transform rotateY(Param v)
           
 Transform rotateZ(float v)
           
 Transform rotateZ(Param v)
           
 Transform scale(float x)
           
 Transform scale(float x, float y)
           
 void scale(float x, float y, float z)
           
 Transform scale(Param x)
           
 Transform scale(Param x, Param y, Param z)
           
 Transform scale(Pt vector)
           
 void scale(XYZ vector)
           
 Transform set(Meta meta)
           
 void setMatrix(float[] matrix)
           
 Transform setMeta(Meta meta)
           
 Transform tag(Meta tag)
           
 Transform tag(java.lang.String tag)
           
 java.lang.String toString()
           
 java.lang.String toString(java.lang.String indent)
           
 Transform translate(float x)
           
 Transform translate(float x, float y)
           
 Transform translate(float x, float y, float z)
           
 Transform translate(Param x, Param y)
           
 Transform translate(Param x, Param y, Param z)
           
 Transform translate(Pt vector)
           
 Transform translate(XYZ vector)
           
 Transform translateX(float x)
           
 Transform translateX(Param x)
           
 Transform translateY(float y)
           
 Transform translateY(Param y)
           
 Transform translateZ(float z)
           
 Transform translateZ(Param z)
           
 
Methods inherited from class anar.Parametric
child, get, getMeta, getPrimitive, parent, parent, parentList, parentList, parentList, parentListGraphViz, parentListGraphViz, parentListRecursive, parentListRecursiveGraphViz, parentToString, parentToStringRecursive, parentToStringRecursive, primitiveToString, replaceParent, replaceParent, replicate, tag
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

preTransform

public boolean preTransform

postTransform

public boolean postTransform
Constructor Detail

Transform

public Transform()

Transform

public Transform(Pt a)
initializes a transformation with center a. more technically the point a will be translated back to the origin before applying other transformations and then transferred back to point a. note that only translations and scale transformations will behave correctly with their origin in a.


Transform

public Transform(Pt a,
                 Pt b)
initializes a transformation with center a and direction ab. more technically the point a will be translated back to the origin and the vector ab rotated to coincide with the Z axis before applying other transformations and then transferred back to point a with direction ab. note that only translations, scale and rotateZ transformations will behave correctly with their origin in a


Transform

public Transform(Pt a,
                 Pt b,
                 Pt c)
initializes a transformation with frame of reference centered in a and with directions ab, ac, ab x ac more technically the point a will be translated back to the origin and the vector ab x ac rotated to concinde with the Z axis before applying other transformations and then transferred back to point a with directions ab, ac and ab x ac. all transformation have their frame of reference consisting of ab, ac, ab x ac.


Transform

public Transform(Pt a,
                 Transform t)

Transform

public Transform(Pt a,
                 Pt b,
                 Transform t)

Transform

public Transform(Pt a,
                 Pt b,
                 Pt c,
                 Transform t)

Transform

public Transform(Transform a)

Transform

public Transform(Transform a,
                 Transform b)

Transform

public Transform(Transform... ts)
Method Detail

set

public Transform set(Meta meta)

setMeta

public Transform setMeta(Meta meta)

tag

public Transform tag(java.lang.String tag)

tag

public Transform tag(Meta tag)

get

public PMatrix3D get()

getInvert

public PMatrix3D getInvert()

preTransform

public Transform preTransform()
Returns:

postTransform

public Transform postTransform()
Returns:

add

public void add(Transform t)

translate

public Transform translate(Param x,
                           Param y,
                           Param z)

translate

public Transform translate(Param x,
                           Param y)

translate

public Transform translate(float x,
                           float y,
                           float z)

translate

public Transform translate(float x,
                           float y)

translate

public Transform translate(float x)

translate

public Transform translate(Pt vector)

translate

public Transform translate(XYZ vector)

translateX

public Transform translateX(float x)

translateX

public Transform translateX(Param x)

translateY

public Transform translateY(float y)

translateY

public Transform translateY(Param y)

translateZ

public Transform translateZ(float z)

translateZ

public Transform translateZ(Param z)

scale

public Transform scale(Param x)

scale

public Transform scale(Param x,
                       Param y,
                       Param z)

scale

public void scale(float x,
                  float y,
                  float z)

scale

public Transform scale(float x,
                       float y)

scale

public Transform scale(float x)

scale

public Transform scale(Pt vector)

scale

public void scale(XYZ vector)

rotateX

public Transform rotateX(Param v)

rotateX

public Transform rotateX(float v)

rotateY

public Transform rotateY(Param v)

rotateY

public Transform rotateY(float v)

rotateZ

public Transform rotateZ(Param v)

rotateZ

public Transform rotateZ(float v)

apply

public Transform apply(Transform t)

setMatrix

public void setMatrix(float[] matrix)
Parameters:
matrix -

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.String indent)