In file gfx/libcoords/Coords.hxx:

class Coords::CoordSys

A single "final" transform, possibly defined hierarchically through others.

Documentation

A single "final" transform, possibly defined hierarchically through others.

If you get a CoordSys from somewhere, the only methods you should need to call are vertex(), transform(), getInverse(), nonlinearity(), canPerformGL(), performGL() and dump(). All other methods are for use by CoordSet or other classes constructing coordinate systems.


Inheritance:

CoordSys


Public Methods

[more]virtual void setSuper (CoordSys** super)
Set the parent(s) and determining coordinate systems of this coordsys.
[more]virtual void setParams (float* params)
Set the parameters of this coordsys from the given float array.
[more]CoordSys* getInverse ()
Get the inverse of this coordinate system.
[more]virtual void vertex (const ZPt &p) const
Call glVertex with the given ZPt transformed into this coordinate system
[more]virtual ZPt transform (const ZPt &p) const
Return the given ZPt transformed into this coordinate system.
[more]virtual float nonlinearity (const ZPt &p, float radius)
How nonlinear is the coordinate system at the given point.
[more]virtual bool canPerformGL ()
Whether this transformation can be performed by OpenGL alone
[more]virtual bool performGL ()
Try to perform the GL operations to set this coordinate system in the current matrix.
[more]virtual void dump (ostream &out)
Print this coordinate system into the given ostream
[more]virtual bool shouldBeDrawn ()
Check whether this coordinate system should be drawn with the current parameters.
[more]virtual bool getOthertypeParams (int type, float* into)
Get the parameters of a compatible type.
[more]virtual Pt getSqSize ()
Get the size of the "unit square" of this coordinate system.

Protected Fields

[more]bool ownInverse
True if this object owns the object pointed to by the inverse pointer

Protected Methods

[more]virtual CoordSys* createInverse ()
Don't use; use getInverse instead!

obool ownInverse
True if this object owns the object pointed to by the inverse pointer

ovirtual CoordSys* createInverse()
Don't use; use getInverse instead! This is the internal

ovirtual void setSuper(CoordSys** super)
Set the parent(s) and determining coordinate systems of this coordsys. The number of pointers pointed to by super depends on the type of this CoordSys.

ovirtual void setParams(float* params) = 0
Set the parameters of this coordsys from the given float array. The number of parameters read from nparams depends on the type of this CoordSys.

Always call setSuper first!

oCoordSys* getInverse()
Get the inverse of this coordinate system. Always returns non-null but it is not guaranteed that this will work properly. (XXX canInvert() ?) The returned inverse is owned by this object and mustn't be deleted by the caller.

ovirtual void vertex(const ZPt &p) const = 0
Call glVertex with the given ZPt transformed into this coordinate system

ovirtual ZPt transform(const ZPt &p) const = 0
Return the given ZPt transformed into this coordinate system. Note that some "coordinate systems" may overload this to return e.g. a color in the ZPt always, without regard to the parameter.

ovirtual float nonlinearity(const ZPt &p, float radius)
How nonlinear is the coordinate system at the given point. The return value is 1/l where l would be a reasonable length for dicing. Returns 0 if dicing is not required. XXX This needs more thought.

ovirtual bool canPerformGL()
Whether this transformation can be performed by OpenGL alone

ovirtual bool performGL()
Try to perform the GL operations to set this coordinate system in the current matrix. Only the topmost matrix on the matrix stack may be altered by this routine, no other GL state. The matrix used is determined by the GL current matrix state.

This method will NOT set up vertex programs or change any other OpenGL state.

Returns:
True if successful, but if false is returned, then the matrix is in an undefined state. If this is not acecptable, try canPerformGL() first.

ovirtual void dump(ostream &out)
Print this coordinate system into the given ostream

ovirtual bool shouldBeDrawn()
Check whether this coordinate system should be drawn with the current parameters. This method should not recurse; the parents will already have been asked. It should only consider the parameters of the current coordinate system.

ovirtual bool getOthertypeParams(int type, float* into)
Get the parameters of a compatible type. Does not find mutual ancestor etc; simply converts if it can and if not, fails.
Parameters:
type - The internal type code to transform into.
into - The vector into which the resulting floats should be written.
Returns:
true if successful, and into is filled, or false if conversion cannot be performed.

ovirtual Pt getSqSize()
Get the size of the "unit square" of this coordinate system. For most coordinate systems, this will be Pt(1,1) but there are some which alter this, for the purpose of catching mouse clicks at a larger area. A mouse click is "in" this coordinate system, if it is in the area Pt(0,0) .. getSqSize()

NOTE: Must be implemented also at GLVobCoorder.java.


This class has no child classes.

Alphabetic index Hierarchy of classes



This page was generated with the help of DOC++.