de.grogra.rgg
Class Library

java.lang.Object
  extended by de.grogra.rgg.Library

public class Library
extends java.lang.Object

This class contains a collection of methods and constants which are useful in RGG modelling, especially in 3D.

Author:
Ole Kniemeyer

Field Summary
static int branch
          This is a redefinition of Graph.BRANCH_EDGE.
static int contains
          This is a redefinition of Graph.CONTAINMENT_EDGE.
static double DEG
          Conversion factor from degree to radians.
static int EDGE_0
           
static int EDGE_1
           
static int EDGE_10
           
static int EDGE_11
           
static int EDGE_12
           
static int EDGE_13
           
static int EDGE_14
           
static int EDGE_2
           
static int EDGE_3
           
static int EDGE_4
           
static int EDGE_5
           
static int EDGE_6
           
static int EDGE_7
           
static int EDGE_8
           
static int EDGE_9
           
static Vector3d HEAD
          Vector pointing in the z-direction (the turtle's head axis).
static I18NBundle I18N
          The resource bundle for the de.grogra.rgg package.
static Vector3d LEFT
          Vector pointing in the x-direction (the turtle's left axis).
static RGGProducer.Creator makeGraph
           
static int mark
          This is a redefinition of Graph.MARK_EDGE.
static int master
          This is a redefinition of Instance3D.MASTER.
static int notifies
          This is a redefinition of Graph.NOTIFIES_EDGE.
static Point3d ORIGIN
          Point having coordinates (0, 0, 0).
static java.io.PrintWriter out
          This field provides a PrintWriter to write to the XL console.
static double R2D
          Conversion factor from radians to degree.
static int refine
          This is a redefinition of Graph.REFINEMENT_EDGE.
static byte SKIN
          Constant for NURBSSurface.NURBSSurface(byte) indicating a skinned surface (defined by a set of profile curves in space).
static int successor
          This is a redefinition of Graph.SUCCESSOR_EDGE.
static byte SWEEP
          Constant for NURBSSurface.NURBSSurface(byte) indicating a swept surface (defined by a set of vertices in space).
static Vector3d UP
          Vector pointing in the y-direction (the turtle's up axis).
static int updates
          This is a redefinition of FieldUpdater.UPDATES.
 
Constructor Summary
Library()
           
 
Method Summary
static void allowNoninjectiveMatchesByDefault(boolean value)
           
static void allowNoninjectiveMatchesForNextQuery(boolean value)
          Deprecated. 
static
<C extends Node>
C
ancestor(Node n, java.lang.Class<C> t)
          Returns the nearest ancestor of n which is an instance of t.
static Node ancestor(Node n, ObjectToBoolean<? super Node> condition)
          Returns the nearest ancestor of n which fulfills condition.
static double angle(Node node)
          Computes the rotation angle in degrees of the transformation defined by node.
static double angle(Tuple3d a, Tuple3d b)
           
static DisposableIterator apply(int count)
          This finish iterator (see the XL Language Specification) is used in a for-statement to execute its body count times.
static DisposableIterator applyUntilFinished()
          This finish iterator (see the XL Language Specification) is used in a for-statement to execute its body as long as the body makes modifications to the graph.
static Node axisparent(Node child)
           
static boolean booleanValue(Node w)
          Returns the boolean value which is wrapped in w if w is an instance of BooleanNode.
static byte byteValue(Node w)
          Returns the byte value which is wrapped in w if w is an instance of ByteNode.
static void chart(DatasetRef ds, int type)
          Shows the data referenced by ds in a chart panel.
static char charValue(Node w)
          Returns the char value which is wrapped in w if w is an instance of CharNode.
static Node cloneNode(Node node)
           
static Node cloneSubgraph(Node root)
          This method clones the subgraph starting at root and returns the cloned node which corresponds to root.
static void closeWorkbench()
          Closes the currently active Workbench if such a workbench exists.
static Cone cone(Node node, boolean end, double angle)
          Returns a cone whose tip is defined by the location of node.
static Cone cone(Tuple3d origin, Vector3d direction, double angle)
          Returns a cone whose tip is located at origin, whose central axis has direction as direction, and whose half opening angle is angle (in degrees).
static Console console()
          Returns the currently active Console.
static CurveRef curve(java.lang.String name)
          Returns a CurveRef instance which refers to the curve named name.
static DatasetRef dataset(java.lang.String name)
          Returns a DatasetRef instance which refers to the dataset named name.
static void defer(java.lang.Runnable r)
          Put runnable into modification queue and execute later when derive() is called.
static void derive()
          This method induces a transformation boundary on the current RGG extent (see the XL Language Specification).
static
<T> Node
descendants(ObjectConsumer<? super T> cb, Node n, java.lang.Class<T> cls)
          This generator method yields all descendants of n which are instances of cls.
static Vector3d direction(Node node)
          Computes the growth direction of the turtle at node in global coordinates.
static void direction(Tuple3d dir, Node node, boolean end)
          Computes the growth direction of the turtle at node in global coordinates.
static boolean directionalTropism(Matrix34d m, Tuple3d direction, float e, Matrix4d out)
          Computes the rotation matrix which implements a directional tropism towards a direction.
static double distance(Node a, Node b)
          Computes the global distance between two nodes.
static double distanceSquared(Node a, Node b)
          Calculate squared distance between node a an node b.
static double distanceToLine(Tuple3d point, Line line)
          Returns the distance between point and line.
static int distribution(float[] probabilities)
          Returns an integral pseudorandom number according to the discrete distribution probabilities.
static double doubleValue(Node w)
          Returns the double value which is wrapped in w if w is an instance of DoubleNode.
static Vector3d enddirection(Node node)
          Computes the growth direction of the turtle at the end of node in global coordinates.
static Point3d endlocation(Node node)
          Computes the end location of node in global coordinates.
static RGGGraph extent()
          Deprecated. 
static FileRef file(java.lang.String name)
          Returns a FileRef instance which refers to the file named name.
static NodeFilter<Node> filter(java.lang.Class[] classes, boolean isTrue)
          Creates a condition which is fulfilled for an object iff it is an instance of at least one of the specified classes (or iff it is not an instance in case isTrue is false).
static float floatValue(Node w)
          Returns the float value which is wrapped in w if w is an instance of FloatNode.
static FunctionRef function(java.lang.String name)
          Returns a Function instance which refers to the function named name.
static GraphManager graph()
          Returns the current project graph, i.e., the project graph of the currently active Workbench.
static GraphState graphState()
          Returns the current graph state, i.e., the current graph state of the project graph of the currently active Workbench.
static double height(Volume volume, double x, double y)
          This method returns the height of a volume at a point (x, y) (in global coordinates).
static void hide(Node root)
          Hides the subgraph starting at root so that it is no longer visible and will not be reported as part of graph queries (and left hand sides of rules, thus).
static ImageRef image(java.lang.String name)
          Returns an ImageRef instance which refers to the image named name.
static double inclination(Node node)
           
static DisposableIterator interpretiveRules()
           
static IntersectionList intersect(Line line, Volume volume)
          Compute all intersections between line and the surface of volume.
static double intersectionLength(Line line, Cone cone)
          Determines the fraction of the line which intersects the specified cone.
static int intValue(Node w)
          Returns the int value which is wrapped in w if w is an instance of IntNode.
static int irandom(int min, int max)
          Returns a uniformly distributed integral pseudorandom number between min and max (inclusive).
static boolean isAncestor(Node a, Node d, int edgeMask)
          Tests whether a is an ancestor of d (or d itself), i.e., if a can be reached from d by a backward traversal of edges matching edgeMask (see Edge.testEdgeBits(int)).
static boolean isSelected(Node n)
          Determines if n has been selected in the workbench by the user.
static Parallelogram leaf(float length, float width)
          Returns a new, rectangular instance of Parallelogram created by the constructor invocation Parallogram(length, width) and having RGBAShader.GREEN as its shader.
static Point3d location(Node node)
          Computes the location of node in global coordinates.
static void location(Tuple3d loc, Node node, boolean end)
          Computes the location of node in global coordinates.
static double lognormal(double mu, double sigma)
           
static long longValue(Node w)
          Returns the long value which is wrapped in w if w is an instance of LongNode.
static void makeRenderedImage(java.lang.String fileName)
          Creates a rendered image of the actual scene with the default camera position and a fixed image size of 800x600.
static void makeRenderedImage(java.lang.String fileName, int width, int height)
          Creates a rendered image of the actual scene with the default camera position and a variable image size.
static void makeRenderedImage(java.lang.String fileName, java.lang.String cameraName, int width, int height)
          Creates a rendered image of the actual scene with the specified camera and a variable image size.
static void makeSnapshot(java.lang.String fileName)
          Creates a snapshot of the actual scene.
static MaterialRef material(java.lang.String name)
          Deprecated. 
static void mean(Aggregate a, Tuple3d value)
          This aggregate method computes the mean of a sequence of Tuple3d's.
static void mean(Aggregate a, Tuple3f value)
          This aggregate method computes the mean of a sequence of Tuple3f's.
static void mergeNonTropismTransformations(Node root, boolean allowShape)
          This method replaces chains of transformation nodes with single Null node which perform the aggregated transformation of the chain; however, transformation nodes which are tropisms are not allowed to be part of the chains.
static void mergeNonTropismTransformations(Node root, ObjectToBoolean<? super Node> filter, boolean allowShape)
          This method replaces chains of transformation nodes passing filter with single Null nodes which perform the aggregated transformation of the chains; however, transformation nodes which are tropisms are not allowed to be part of the chains.
static void mergeTransformations(Node root, boolean allowShape)
          This method replaces chains of transformation nodes with single Null nodes which perform the aggregated transformation of the chains.
static void mergeTransformations(Node root, ObjectToBoolean<? super Node> filter, boolean allowShape)
          This method replaces chains of transformation nodes passing filter with single Null nodes which perform the aggregated transformation of the chains.
static
<T> Node
minDescendants(ObjectConsumer<? super T> cb, Node n, java.lang.Class<T> t)
          This generator method yields all descendants of n which are instances of t and which have no other instance of t in their path to n.
static void moveToExtent(RGGProducer ps, Node root, int index)
          Sets the extentIndex property of root and its subgraph spanned by EdgePatternImpl.TREE to index.
static Node namedNode(java.lang.String name)
          Returns a node having the specified name.
static GRSVertex newGRSVertices(ObjectConsumer<? super GRSVertex> cons)
           
static double normal(double mu, double sigma)
          Returns a pseudorandom number which is distributed according to a normal distribution with mean value mu and standard deviation sigma.
static float normal(float mu, float sigma)
          Returns a pseudorandom number which is distributed according to a normal distribution with mean value mu and standard deviation sigma.
static java.lang.Object objectValue(Node w)
          Returns the Object value which is wrapped in w if w is an instance of ObjectNode, NURBSCurve (a NURBSCurve node wraps its contained BSplineCurve) or NURBSSurface (a NURBSSurface node wraps its contained BSplineSurface).
static IntersectionList operator$and(Line line, Volume volume)
          This operator method is an alias for intersect(de.grogra.vecmath.geom.Line, de.grogra.vecmath.geom.Volume).
static boolean operator$ge(Node a, Node b)
          This operator method compares two nodes based on their id: It returns true iff a.getId () >= b.getId ().
static boolean operator$gt(Node a, Node b)
          This operator method compares two nodes based on their id: It returns true iff a.getId () > b.getId ().
static
<T> boolean
operator$in(T value, java.util.Collection<? super T> set)
          This operator method returns true iff set is not null and set.contains(value) returns true.
static boolean operator$index(BooleanList list, int index)
          This operator method is an alias for list.get(index).
static byte operator$index(ByteList list, int index)
          This operator method is an alias for list.get(index).
static char operator$index(CharList list, int index)
          This operator method is an alias for list.get(index).
static double operator$index(DoubleList list, int index)
          This operator method is an alias for list.get(index).
static float operator$index(FloatList list, int index)
          This operator method is an alias for list.get(index).
static float operator$index(FloatToFloat func, float x)
          This operator method is an alias for func.evaluateFloat(x).
static int operator$index(IntList list, int index)
          This operator method is an alias for list.get(index).
static long operator$index(LongList list, int index)
          This operator method is an alias for list.get(index).
static boolean operator$index(Node node, BooleanAttribute attr)
           
static byte operator$index(Node node, ByteAttribute attr)
           
static char operator$index(Node node, CharAttribute attr)
           
static double operator$index(Node node, DoubleAttribute attr)
           
static float operator$index(Node node, FloatAttribute attr)
           
static Node operator$index(Node node, int index)
          This operator method is an alias for node.getChild(index).
static int operator$index(Node node, IntAttribute attr)
           
static Point3d operator$index(Node n, Location l)
          This operator method returns the location of n.
static long operator$index(Node node, LongAttribute attr)
           
static double operator$index(Node n, NodeToDouble f)
          This operator method applies the function f to node n.
static float operator$index(Node n, NodeToFloat f)
          This operator method applies the function f to node n.
static int operator$index(Node n, NodeToInt f)
          This operator method applies the function f to node n.
static
<T> T
operator$index(Node node, ObjectAttribute<T> attr)
           
static short operator$index(Node node, ShortAttribute attr)
           
static short operator$index(ShortList list, int index)
          This operator method is an alias for list.get(index).
static boolean operator$le(Node a, Node b)
          This operator method compares two nodes based on their id: It returns true iff a.getId () <= b.getId ().
static boolean operator$lt(Node a, Node b)
          This operator method compares two nodes based on their id: It returns true iff a.getId () < b.getId ().
static BooleanList operator$shl(BooleanList list, boolean value)
          This operator method adds value as last element to list.
static ByteList operator$shl(ByteList list, byte value)
          This operator method adds value as last element to list.
static CharList operator$shl(CharList list, char value)
          This operator method adds value as last element to list.
static DoubleList operator$shl(DoubleList list, double value)
          This operator method adds value as last element to list.
static FloatList operator$shl(FloatList list, float value)
          This operator method adds value as last element to list.
static IntList operator$shl(IntList list, int value)
          This operator method adds value as last element to list.
static
<E> java.util.List<E>
operator$shl(java.util.List<E> list, E value)
          This operator method adds value as last element to list.
static LongList operator$shl(LongList list, long value)
          This operator method adds value as last element to list.
static java.io.PrintWriter operator$shl(java.io.PrintWriter w, boolean v)
          This operator method prints v on w.
static java.io.PrintWriter operator$shl(java.io.PrintWriter w, char v)
          This operator method prints v on w.
static java.io.PrintWriter operator$shl(java.io.PrintWriter w, double v)
          This operator method prints v on w.
static java.io.PrintWriter operator$shl(java.io.PrintWriter w, float v)
          This operator method prints v on w.
static java.io.PrintWriter operator$shl(java.io.PrintWriter w, int v)
          This operator method prints v on w.
static java.io.PrintWriter operator$shl(java.io.PrintWriter w, long v)
          This operator method prints v on w.
static java.io.PrintWriter operator$shl(java.io.PrintWriter w, java.lang.Object v)
          This operator method prints v on w.
static ShortList operator$shl(ShortList list, short value)
          This operator method adds value as last element to list.
static boolean orthogonalTropism(Matrix34d m, Tuple3d direction, float e, Matrix4d out)
          Computes the rotation matrix which implements an orthogonal tropism into a plane perpendicular to direction.
static boolean plot(Aggregate a, double x, double y)
           
static boolean plot(Aggregate a, DoubleToDouble function, double x)
           
static boolean plot(Aggregate a, IntToDouble function, int x)
           
static boolean plotPoints(Aggregate a, double x, double y)
           
static boolean positionalTropism(Matrix34d m, Tuple3d target, float e, Matrix4d out)
          Computes the rotation matrix which implements a positional tropism towards a target location.
static void print(boolean v)
          Prints v to the XL console.
static void print(char v)
          Prints v to the XL console.
static void print(double v)
          Prints v to the XL console.
static void print(float v)
          Prints v to the XL console.
static void print(int v)
          Prints v to the XL console.
static void print(long v)
          Prints v to the XL console.
static void print(java.lang.Object v)
          Prints v to the XL console.
static void println()
          Terminate the current line by writing the line separator string.
static void println(boolean v)
          Prints v to the XL console, then terminates the line.
static void println(char v)
          Prints v to the XL console, then terminates the line.
static void println(double v)
          Prints v to the XL console, then terminates the line.
static void println(float v)
          Prints v to the XL console, then terminates the line.
static void println(int v)
          Prints v to the XL console, then terminates the line.
static void println(long v)
          Prints v to the XL console, then terminates the line.
static void println(java.lang.Object v)
          Prints v to the XL console, then terminates the line.
static boolean probability(float p)
          Returns the value of a boolean pseudorandom variable whose probability for true is p.
static float random(float min, float max)
          Returns a uniformly distributed pseudorandom number between min and max.
static Vector3d randomDirection()
          Pick a random point on the surface of a unit sphere and return it as direction vector.
static void range(DoubleConsumer consumer, double min, double max)
           
static void range(DoubleConsumer consumer, double min, double max, int n)
           
static Line ray(Tuple3d origin, Tuple3d direction)
          Constructs a Line which represents a ray emanating at origin in the specified direction.
static Reference reference(java.lang.String name)
          Returns a Reference instance which refers to the object named name.
static void removeInterpretiveNodes()
           
static void removeLeaves(Node root, ObjectToBoolean<? super Node> filter)
          Removes all leaf nodes from the graph which pass filter, starting at root.
static void removeTransformationLeaves(Node root)
          Removes all leaf nodes from the graph which are pure transformation nodes (see removeTransformationLeaves(Node, ObjectToBoolean)).
static void removeTransformationLeaves(Node root, ObjectToBoolean<? super Node> filter)
          Removes all leaf nodes from the graph which are pure transformation nodes and which pass filter, starting at root (see removeLeaves(de.grogra.graph.impl.Node, de.grogra.xl.lang.ObjectToBoolean)).
static RGGGraph rggGraph()
           
static int select(Aggregate a, Node value)
           
static void setDerivationMode(int mode)
           
static void setRandomTransform(Null target, Transform3D center, double sigma, double minX, double minY, double maxX, double maxY)
           
static void setSeed(long seed)
          This method sets the seed for the pseudorandom number generator which is used by the random methods in this class.
static void setStatus(java.lang.String text)
          Displays text in the current status bar.
static ShaderRef shader(java.lang.String name)
          Returns a ShaderRef instance which refers to the shader named name.
static short shortValue(Node w)
          Returns the short value which is wrapped in w if w is an instance of ShortNode.
static Statistics statistics(Aggregate a, double value)
          This aggregate method computes a Statistics object for a series of values a.
static Node successor(Node n, ObjectToBoolean<? super Node> condition)
          Returns the nearest successor of n which fulfills condition.
static NURBSSurface Surface(BSplineCurve profile)
          Deprecated. 
static NURBSSurface Surface(BSplineCurveList profiles)
          Deprecated. 
static NURBSSurface Surface(BSplineCurve profile, java.lang.String name, boolean useRail)
          Deprecated. 
static NURBSSurface Surface(BSplineSurface surface)
          Deprecated. 
static NURBSSurface Surface(byte type)
          Deprecated. 
static NURBSSurface Surface(byte type, java.lang.String name, boolean useRail)
          Deprecated. 
static NURBSSurface Surface(float radius)
          Deprecated. 
static SurfaceRef surface(java.lang.String name)
          Returns a SurfaceRef instance which refers to the surface named name.
static
<T> boolean
synthesize(T root, ObjectToObjectGenerator<? super T,? extends T> generator, ObjectToBoolean<BooleanSynth<? super T>> synth)
          This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure.
static
<T> byte
synthesize(T root, ObjectToObjectGenerator<? super T,? extends T> generator, ObjectToByte<ByteSynth<? super T>> synth)
          This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure.
static
<T> char
synthesize(T root, ObjectToObjectGenerator<? super T,? extends T> generator, ObjectToChar<CharSynth<? super T>> synth)
          This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure.
static
<T> double
synthesize(T root, ObjectToObjectGenerator<? super T,? extends T> generator, ObjectToDouble<DoubleSynth<? super T>> synth)
          This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure.
static
<T> float
synthesize(T root, ObjectToObjectGenerator<? super T,? extends T> generator, ObjectToFloat<FloatSynth<? super T>> synth)
          This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure.
static
<T> int
synthesize(T root, ObjectToObjectGenerator<? super T,? extends T> generator, ObjectToInt<IntSynth<? super T>> synth)
          This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure.
static
<T> long
synthesize(T root, ObjectToObjectGenerator<? super T,? extends T> generator, ObjectToLong<LongSynth<? super T>> synth)
          This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure.
static
<T,V> V
synthesize(T root, ObjectToObjectGenerator<? super T,? extends T> generator, ObjectToObject<ObjectSynth<? super T,? super V>,? extends V> synth)
          This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure.
static
<T> short
synthesize(T root, ObjectToObjectGenerator<? super T,? extends T> generator, ObjectToShort<ShortSynth<? super T>> synth)
          This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure.
static Line toLine(Node node)
          Returns a line which corresponds to the central line of node.
static ObjectToDouble<double[]> toObjectToDouble(DoubleToDouble f)
           
static Point3d toPoint3d(IntersectionList list)
          This autoconversion method returns the first intersection point of list, or null if list is empty.
static Point3d toPoint3d(Node node)
          The same as location(Node).
static Tuple3d toTuple3d(Node node)
           
static Matrix34d transformation(Node node)
          Computes the global coordinate transformation of the node.
static Matrix34d transformation(Node node, boolean post)
          Computes the global coordinate transformation of the node.
static Null tropism(Node a, Point3d target, float e)
          Return a new node with a transformation matrix set to the desired tropism.
static Null tropism(Node a, Vector3d direction, float e)
          Return a new node with a transformation matrix set to the desired tropism.
static RGBAShader visualizeAsColor(double x)
          Returns a color shader whose color represents the value of x which has to lie between -1 and 1.
static Volume volume(Node node)
          Returns a volume which corresponds to the shape of node.
static IMPWorkbench workbench()
          Returns the currently active Workbench.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

branch

public static final int branch
This is a redefinition of Graph.BRANCH_EDGE.

See Also:
Constant Field Values

contains

public static final int contains
This is a redefinition of Graph.CONTAINMENT_EDGE.

See Also:
Constant Field Values

DEG

public static final double DEG
Conversion factor from degree to radians.

See Also:
Constant Field Values

EDGE_0

public static final int EDGE_0
See Also:
Constant Field Values

EDGE_1

public static final int EDGE_1
See Also:
Constant Field Values

EDGE_10

public static final int EDGE_10
See Also:
Constant Field Values

EDGE_11

public static final int EDGE_11
See Also:
Constant Field Values

EDGE_12

public static final int EDGE_12
See Also:
Constant Field Values

EDGE_13

public static final int EDGE_13
See Also:
Constant Field Values

EDGE_14

public static final int EDGE_14
See Also:
Constant Field Values

EDGE_2

public static final int EDGE_2
See Also:
Constant Field Values

EDGE_3

public static final int EDGE_3
See Also:
Constant Field Values

EDGE_4

public static final int EDGE_4
See Also:
Constant Field Values

EDGE_5

public static final int EDGE_5
See Also:
Constant Field Values

EDGE_6

public static final int EDGE_6
See Also:
Constant Field Values

EDGE_7

public static final int EDGE_7
See Also:
Constant Field Values

EDGE_8

public static final int EDGE_8
See Also:
Constant Field Values

EDGE_9

public static final int EDGE_9
See Also:
Constant Field Values

HEAD

public static final Vector3d HEAD
Vector pointing in the z-direction (the turtle's head axis). Do not modify its contents.


I18N

public static final I18NBundle I18N
The resource bundle for the de.grogra.rgg package.


LEFT

public static final Vector3d LEFT
Vector pointing in the x-direction (the turtle's left axis). Do not modify its contents.


makeGraph

public static final RGGProducer.Creator makeGraph

mark

public static final int mark
This is a redefinition of Graph.MARK_EDGE.

See Also:
Constant Field Values

master

public static final int master
This is a redefinition of Instance3D.MASTER.

See Also:
Constant Field Values

notifies

public static final int notifies
This is a redefinition of Graph.NOTIFIES_EDGE.

See Also:
Constant Field Values

ORIGIN

public static final Point3d ORIGIN
Point having coordinates (0, 0, 0). Do not modify its contents.


out

public static final java.io.PrintWriter out
This field provides a PrintWriter to write to the XL console.


R2D

public static final double R2D
Conversion factor from radians to degree.

See Also:
Constant Field Values

refine

public static final int refine
This is a redefinition of Graph.REFINEMENT_EDGE.

See Also:
Constant Field Values

SKIN

public static final byte SKIN
Constant for NURBSSurface.NURBSSurface(byte) indicating a skinned surface (defined by a set of profile curves in space).

See Also:
Constant Field Values

successor

public static final int successor
This is a redefinition of Graph.SUCCESSOR_EDGE.

See Also:
Constant Field Values

SWEEP

public static final byte SWEEP
Constant for NURBSSurface.NURBSSurface(byte) indicating a swept surface (defined by a set of vertices in space).

See Also:
Constant Field Values

UP

public static final Vector3d UP
Vector pointing in the y-direction (the turtle's up axis). Do not modify its contents.


updates

public static final int updates
This is a redefinition of FieldUpdater.UPDATES.

See Also:
Constant Field Values
Constructor Detail

Library

public Library()
Method Detail

allowNoninjectiveMatchesByDefault

public static void allowNoninjectiveMatchesByDefault(boolean value)

allowNoninjectiveMatchesForNextQuery

@Deprecated
public static void allowNoninjectiveMatchesForNextQuery(boolean value)
Deprecated. 


ancestor

public static <C extends Node> C ancestor(Node n,
                                          java.lang.Class<C> t)
Returns the nearest ancestor of n which is an instance of t. Ancestors are those nodes which can be reached by traversing successor- or branch-edges backwards.

Parameters:
n - a node
t - the type so search for
Returns:
nearest ancestor of type t, or null

ancestor

public static Node ancestor(Node n,
                            ObjectToBoolean<? super Node> condition)
Returns the nearest ancestor of n which fulfills condition. Ancestors are those nodes which can be reached by traversing successor- or branch-edges backwards.

Parameters:
n - a node
condition - a condition
Returns:
nearest ancestor fulfilling condition, or null

angle

public static double angle(Node node)
Computes the rotation angle in degrees of the transformation defined by node. The computed value will be correct if the transformation is a rotation, possibly combined with a uniform scaling.

Parameters:
node - a node
Returns:
the rotation angle of the transformation of node, in degrees

angle

public static double angle(Tuple3d a,
                           Tuple3d b)

apply

public static DisposableIterator apply(int count)
This finish iterator (see the XL Language Specification) is used in a for-statement to execute its body count times. Each execution is surrounded by a transformation boundary (see derive()).

Parameters:
count - number of iterations
Returns:
a finish iterator

applyUntilFinished

public static DisposableIterator applyUntilFinished()
This finish iterator (see the XL Language Specification) is used in a for-statement to execute its body as long as the body makes modifications to the graph. Each execution is surrounded by a transformation boundary (see derive()).

Returns:
a finish iterator

axisparent

public static Node axisparent(Node child)

booleanValue

public static boolean booleanValue(Node w)
Returns the boolean value which is wrapped in w if w is an instance of BooleanNode. Otherwise this method returns false.

Parameters:
w - a node
Returns:
wrapped boolean value, or false

byteValue

public static byte byteValue(Node w)
Returns the byte value which is wrapped in w if w is an instance of ByteNode. Otherwise this method returns 0.

Parameters:
w - a node
Returns:
wrapped byte value, or 0

chart

public static void chart(DatasetRef ds,
                         int type)
Shows the data referenced by ds in a chart panel. type is one of the constants declared in ChartPanel, this specifies the type of chart.

Parameters:
ds - reference to a Dataset
type - chart type

charValue

public static char charValue(Node w)
Returns the char value which is wrapped in w if w is an instance of CharNode. Otherwise this method returns 0.

Parameters:
w - a node
Returns:
wrapped char value, or 0

cloneNode

public static Node cloneNode(Node node)
                      throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException

cloneSubgraph

public static Node cloneSubgraph(Node root)
                          throws java.lang.CloneNotSupportedException
This method clones the subgraph starting at root and returns the cloned node which corresponds to root. The subgraph consists of all nodes which can be reached by traversing edges in forward direction. Nodes are cloned deeply, i.e., field values are cloned, too.

Parameters:
root - root node of subgraph
Returns:
corresponding root node of cloned subgraph
Throws:
java.lang.CloneNotSupportedException

closeWorkbench

public static void closeWorkbench()
Closes the currently active Workbench if such a workbench exists. Note that unsaved modifications are lost, because the user is not asked.


cone

public static Cone cone(Node node,
                        boolean end,
                        double angle)
Returns a cone whose tip is defined by the location of node. Depending on end, the location or end location of node is used (see location(Tuple3d, Node, boolean)). The axis of the cone points into the local z-direction of the coordinate system of node or node's children (again depending on end). The cone has no base plane, i.e., it extends to infinity.

Parameters:
node - node which defines the cone's tip
end - use location or end location of node
angle - half opening angle in degrees
Returns:
instance of Cone corresponding to the specified geometry

cone

public static Cone cone(Tuple3d origin,
                        Vector3d direction,
                        double angle)
Returns a cone whose tip is located at origin, whose central axis has direction as direction, and whose half opening angle is angle (in degrees). The cone has no base plane, i.e., it extends to infinity.

Parameters:
origin - location of the cone's tip
direction - direction of the cone's axis
angle - half opening angle in degrees
Returns:
instance of Cone corresponding to the specified geometry

console

public static Console console()
Returns the currently active Console. This may return null.

Returns:
current console or null

curve

public static CurveRef curve(java.lang.String name)
Returns a CurveRef instance which refers to the curve named name. The list of curves in GroIMP is available in the panel "Object Explorers/Math Objects/Curves".

Parameters:
name - name of curve within GroIMP
Returns:
CurveRef referring to the named curve

dataset

public static DatasetRef dataset(java.lang.String name)
Returns a DatasetRef instance which refers to the dataset named name. The list of datasets in GroIMP is available in the panel "Object Explorers/Datasets".

Parameters:
name - name of dataset within GroIMP
Returns:
DatasetRef referring to the named dataset

defer

public static void defer(java.lang.Runnable r)
Put runnable into modification queue and execute later when derive() is called.

Parameters:
r -

derive

public static void derive()
This method induces a transformation boundary on the current RGG extent (see the XL Language Specification). This means that all pending graph modifications are applied to the graph.


descendants

public static <T> Node descendants(ObjectConsumer<? super T> cb,
                                   Node n,
                                   java.lang.Class<T> cls)
This generator method yields all descendants of n which are instances of cls. Descendants are those nodes which can be reached by traversing successor- or branch-edges forwards.

Parameters:
cb - a consumer instance receiving the nodes (provided by the XL compiler)
n - a node
cls - the type to seach for
Returns:
null

direction

public static Vector3d direction(Node node)
Computes the growth direction of the turtle at node in global coordinates. The direction is defined by the direction (0, 0, 1) in local coordinates.

Parameters:
node - a node
Returns:
the turtle's growth direction at node
See Also:
direction(Tuple3d, Node, boolean)

direction

public static void direction(Tuple3d dir,
                             Node node,
                             boolean end)
Computes the growth direction of the turtle at node in global coordinates. The computed value is written to direction. The direction is defined by the direction (0, 0, 1) in local coordinates of the node if end is false, or of the node's children if end is true.

Parameters:
dir - receives the direction
node - a node
end - use location or end location of node

directionalTropism

public static boolean directionalTropism(Matrix34d m,
                                         Tuple3d direction,
                                         float e,
                                         Matrix4d out)
Computes the rotation matrix which implements a directional tropism towards a direction. This is done as follows: The matrix m is interpreted as the transformation matrix from local to global coordinates. Thus, the local z-direction (the growth direction) has the value v = (m.m02, m.m12, m.m22) in global coordinates. Now the cross product d = v0 × direction, where v0 is the unit vector in direction of v, defines the axis about which a rotation has to be performed in order to achieve the desired tropism. This direction is transformed to the local coordinates of m, and out is set to a rotation about this transformed direction, its angle being the length of d multiplied by e (in radians).
If the absolute value of the angle is less than 1e-10, no rotation matrix is computed and this method returns false. Then out does not contain a valid rotation matrix and should be ignored. This case happens when the growth direction is (anti-)parallel to the desired direction of the tropism.

Parameters:
m - transformation matrix from local to global coordinates
direction - direction of the tropism in global coordinates
e - strength of the tropism
out - the computed rotation matrix is placed in here (only valid if the returned value is true)
Returns:
true iff a rotation matrix has been computed

distance

public static double distance(Node a,
                              Node b)
Computes the global distance between two nodes. The distance is measured between the points (0, 0, 0) in the local coordinate systems of the nodes.

Parameters:
a - first node
b - second node
Returns:
global distance between nodes

distanceSquared

public static double distanceSquared(Node a,
                                     Node b)
Calculate squared distance between node a an node b.

Parameters:
a - node a
b - node b
Returns:
squared distance between a and b

distanceToLine

public static double distanceToLine(Tuple3d point,
                                    Line line)
Returns the distance between point and line.

Parameters:
point - a point
line - a line
Returns:
distance between point and line
See Also:
Line.distance(Tuple3d)

distribution

public static int distribution(float[] probabilities)
Returns an integral pseudorandom number according to the discrete distribution probabilities. The value i has the probability probabilities[i] for 0 <= i < probabilities.length, the value probabilities.length has the remaining probability, i.e., the difference between the sum of probabilities and 1.

Parameters:
probabilities - array of discrete probabilities
Returns:
random number according to probabilities
See Also:
setSeed(long)

doubleValue

public static double doubleValue(Node w)
Returns the double value which is wrapped in w if w is an instance of DoubleNode. Otherwise this method returns 0.

Parameters:
w - a node
Returns:
wrapped double value, or 0

enddirection

public static Vector3d enddirection(Node node)
Computes the growth direction of the turtle at the end of node in global coordinates. The direction is defined by the direction (0, 0, 1) in local coordinates of node's children.

Parameters:
node - a node
Returns:
the turtle's growth direction at node's children
See Also:
direction(Tuple3d, Node, boolean)

endlocation

public static Point3d endlocation(Node node)
Computes the end location of node in global coordinates. The end location is defined by the point (0, 0, 0) in local coordinates of node's children.

Parameters:
node - a node
Returns:
the node's end location in global coordinates
See Also:
location(Tuple3d, Node, boolean)

extent

@Deprecated
public static RGGGraph extent()
Deprecated. 


file

public static FileRef file(java.lang.String name)
Returns a FileRef instance which refers to the file named name. The list of files in GroIMP is available in the panel "File Explorer".
If name does not contain the character '/' or the character IO.SYSTEM_ID_SEPARATOR, name is prefixed by IO.PROJECT_FS followed by IO.SYSTEM_ID_SEPARATOR. Thus, in this case name is assumed to refer to a file in the virtual file system of the project.

Parameters:
name - name of file within GroIMP
Returns:
FileRef referring to the named file

filter

public static NodeFilter<Node> filter(java.lang.Class[] classes,
                                      boolean isTrue)
Creates a condition which is fulfilled for an object iff it is an instance of at least one of the specified classes (or iff it is not an instance in case isTrue is false).

Parameters:
classes - list of classes
isTrue - condition value iff object is an instance of one of classes
Returns:
a condition

floatValue

public static float floatValue(Node w)
Returns the float value which is wrapped in w if w is an instance of FloatNode. Otherwise this method returns 0.

Parameters:
w - a node
Returns:
wrapped float value, or 0

function

public static FunctionRef function(java.lang.String name)
Returns a Function instance which refers to the function named name. The list of functions in GroIMP is available in the panel "Object Explorers/Math Objects/Functions".

Parameters:
name - name of function within GroIMP
Returns:
FunctionRef referring to the named function

graph

public static GraphManager graph()
Returns the current project graph, i.e., the project graph of the currently active Workbench. This may return null.

Returns:
current project graph or null

graphState

public static GraphState graphState()
Returns the current graph state, i.e., the current graph state of the project graph of the currently active Workbench.

Returns:
current graph state

height

public static double height(Volume volume,
                            double x,
                            double y)
This method returns the height of a volume at a point (x, y) (in global coordinates). This is the maximum z-coordinate of the volume at (x, y). If the volume does not contain a point with matching xy-coordinates, 0 is returned.

Parameters:
volume - a volume
x - global x-coordinate
y - global y-coordinate
Returns:
height of volume at (x, y), or 0

hide

public static void hide(Node root)
Hides the subgraph starting at root so that it is no longer visible and will not be reported as part of graph queries (and left hand sides of rules, thus).

Technically, this behaviour is achieved by two steps: At first, root is reparented such that it becomes the child of the RGGRoot of this graph, the connection being established by an edge of type Graph.MARK_EDGE. This makes the subgraph invisible. Afterwards, moveToExtent(de.grogra.rgg.model.RGGProducer, de.grogra.graph.impl.Node, int) is invoked in order to move the subgraph to the last list of the type extent. Under normal operation, this excludes the subgraph from being returned as part of graph queries.

The modifications are made as part of the active transaction of the graph.

Parameters:
root - root node of subgraph

image

public static ImageRef image(java.lang.String name)
Returns an ImageRef instance which refers to the image named name. The list of images in GroIMP is available in the panel "Object Explorers/Images".

Parameters:
name - name of image within GroIMP
Returns:
ImageRef referring to the named image

inclination

public static double inclination(Node node)

interpretiveRules

public static DisposableIterator interpretiveRules()

intersect

public static IntersectionList intersect(Line line,
                                         Volume volume)
Compute all intersections between line and the surface of volume. The returned list is valid until the next invocation of this method within the same thread.

Parameters:
line - a line
volume - a volume
Returns:
list containing all intersections of the line and the volume's surface

intersectionLength

public static double intersectionLength(Line line,
                                        Cone cone)
Determines the fraction of the line which intersects the specified cone.

Parameters:
line - line to intersect
cone - cone to intersect
Returns:
fraction of line which intersects cone

intValue

public static int intValue(Node w)
Returns the int value which is wrapped in w if w is an instance of IntNode. Otherwise this method returns 0.

Parameters:
w - a node
Returns:
wrapped int value, or 0

irandom

public static int irandom(int min,
                          int max)
Returns a uniformly distributed integral pseudorandom number between min and max (inclusive).

Parameters:
min - minimal value
max - maximal value
Returns:
integral random number between min and max
See Also:
setSeed(long)

isAncestor

public static boolean isAncestor(Node a,
                                 Node d,
                                 int edgeMask)
Tests whether a is an ancestor of d (or d itself), i.e., if a can be reached from d by a backward traversal of edges matching edgeMask (see Edge.testEdgeBits(int)). Note that this method expects the relevant part of the subgraph spanned by matching edges to be a tree.

Parameters:
a - the potential ancestor
d - the potential descendant
edgeMask - the edge mask to use
Returns:
true iff a is an ancestor of d

isSelected

public static boolean isSelected(Node n)
Determines if n has been selected in the workbench by the user.

Parameters:
n - a node
Returns:
true iff n is contained in the current selection

leaf

public static Parallelogram leaf(float length,
                                 float width)
Returns a new, rectangular instance of Parallelogram created by the constructor invocation Parallogram(length, width) and having RGBAShader.GREEN as its shader.

Parameters:
length - length of rectangle
width - width of rectangle
Returns:
green rectangle

location

public static Point3d location(Node node)
Computes the location of node in global coordinates. The location is defined by the point (0, 0, 0) in local coordinates.

Parameters:
node - a node
Returns:
the node's location in global coordinates
See Also:
location(Tuple3d, Node, boolean)

location

public static void location(Tuple3d loc,
                            Node node,
                            boolean end)
Computes the location of node in global coordinates. The computed value is written to location. The location is defined by the point (0, 0, 0) in local coordinates of the node if end is false, or of the node's children if end is true.

Parameters:
loc - receives the location
node - a node
end - use location or end location of node

lognormal

public static double lognormal(double mu,
                               double sigma)

longValue

public static long longValue(Node w)
Returns the long value which is wrapped in w if w is an instance of LongNode. Otherwise this method returns 0.

Parameters:
w - a node
Returns:
wrapped long value, or 0

makeRenderedImage

public static void makeRenderedImage(java.lang.String fileName)
Creates a rendered image of the actual scene with the default camera position and a fixed image size of 800x600.

Parameters:
fileName - name of the output file

makeRenderedImage

public static void makeRenderedImage(java.lang.String fileName,
                                     int width,
                                     int height)
Creates a rendered image of the actual scene with the default camera position and a variable image size.

Parameters:
fileName - name of the output file
width -
height -

makeRenderedImage

public static void makeRenderedImage(java.lang.String fileName,
                                     java.lang.String cameraName,
                                     int width,
                                     int height)
Creates a rendered image of the actual scene with the specified camera and a variable image size.

Parameters:
fileName - name of the output file
cameraName - name of a specific camera
width -
height -

makeSnapshot

public static void makeSnapshot(java.lang.String fileName)
Creates a snapshot of the actual scene.

Parameters:
fileName - name of the output file

material

@Deprecated
public static MaterialRef material(java.lang.String name)
Deprecated. 


mean

public static void mean(Aggregate a,
                        Tuple3d value)
This aggregate method computes the mean of a sequence of Tuple3d's.

Parameters:
a - aggregate instance (provided by the XL compiler)
value - a value of the sequence of values

mean

public static void mean(Aggregate a,
                        Tuple3f value)
This aggregate method computes the mean of a sequence of Tuple3f's.

Parameters:
a - aggregate instance (provided by the XL compiler)
value - a value of the sequence of values

mergeNonTropismTransformations

public static void mergeNonTropismTransformations(Node root,
                                                  boolean allowShape)
This method replaces chains of transformation nodes with single Null node which perform the aggregated transformation of the chain; however, transformation nodes which are tropisms are not allowed to be part of the chains. This is the same as mergeNonTropismTransformations(root, null).

Parameters:
root - root node of subgraph where chains should be replaced
allowShape - store aggregated transformation in shape node at chain end if possible
See Also:
mergeNonTropismTransformations(Node, ObjectToBoolean, boolean)

mergeNonTropismTransformations

public static void mergeNonTropismTransformations(Node root,
                                                  ObjectToBoolean<? super Node> filter,
                                                  boolean allowShape)
This method replaces chains of transformation nodes passing filter with single Null nodes which perform the aggregated transformation of the chains; however, transformation nodes which are tropisms are not allowed to be part of the chains. Tropisms are defined by the subclasses of Tropism.

Parameters:
root - root node of subgraph where chains should be replaced
filter - only merge nodes which pass this filter. If null is specified, every non-tropism transformation node is considered for merging
See Also:
mergeTransformations(Node, ObjectToBoolean, boolean)

mergeTransformations

public static void mergeTransformations(Node root,
                                        boolean allowShape)
This method replaces chains of transformation nodes with single Null nodes which perform the aggregated transformation of the chains. This is the same as mergeTransformations(root, null).

Parameters:
root - root node of subgraph where chains should be replaced
allowShape - store aggregated transformation in shape node at chain end if possible
See Also:
mergeTransformations(Node, ObjectToBoolean, boolean)

mergeTransformations

public static void mergeTransformations(Node root,
                                        ObjectToBoolean<? super Node> filter,
                                        boolean allowShape)
This method replaces chains of transformation nodes passing filter with single Null nodes which perform the aggregated transformation of the chains. A node is considered to be a transformation node if it has a transformation attribute, but no shape attribute. If it additionally passes filter and is part of a chain of such nodes, this chain will be replaced by an equivalent single node of class Null.

Parameters:
root - root node of subgraph where chains should be replaced
filter - only merge nodes which pass this filter. If null is specified, every transformation node is considered for merging
allowShape - if possible, store aggregated transformation in existing shape node at chain end (instead of creating a new Null node)

minDescendants

public static <T> Node minDescendants(ObjectConsumer<? super T> cb,
                                      Node n,
                                      java.lang.Class<T> t)
This generator method yields all descendants of n which are instances of t and which have no other instance of t in their path to n. Descendants are those nodes which can be reached by traversing successor- or branch-edges forwards.

Parameters:
cb - a consumer instance receiving the nodes (provided by the XL compiler)
n - a node
t - the type to seach for
Returns:
null

moveToExtent

public static void moveToExtent(RGGProducer ps,
                                Node root,
                                int index)
Sets the extentIndex property of root and its subgraph spanned by EdgePatternImpl.TREE to index. If ps is null, the property is modified as part of the active transaction of the graph. Otherwise, the PropertyQueue of ps is used to enqueue the modifications.

Note that under normal operation, nodes at the Node.LAST_EXTENT_INDEX of the type extent are not returned as part of graph queries.

Parameters:
ps - producer to obtain a modification queue, or null
root - root node of subgraph
index - new value of the extentTail property of the nodes

namedNode

public static Node namedNode(java.lang.String name)
Returns a node having the specified name.

Parameters:
name - name of a node
Returns:
a node whose name is name, or null if no such node exists
See Also:
GraphManager.getNodeForName(java.lang.String)

newGRSVertices

public static GRSVertex newGRSVertices(ObjectConsumer<? super GRSVertex> cons)

normal

public static double normal(double mu,
                            double sigma)
Returns a pseudorandom number which is distributed according to a normal distribution with mean value mu and standard deviation sigma.

Parameters:
mu - mean value
sigma - standard deviation
Returns:
normally distributed random number
See Also:
setSeed(long)

normal

public static float normal(float mu,
                           float sigma)
Returns a pseudorandom number which is distributed according to a normal distribution with mean value mu and standard deviation sigma.

Parameters:
mu - mean value
sigma - standard deviation
Returns:
normally distributed random number
See Also:
setSeed(long)

objectValue

public static java.lang.Object objectValue(Node w)
Returns the Object value which is wrapped in w if w is an instance of ObjectNode, NURBSCurve (a NURBSCurve node wraps its contained BSplineCurve) or NURBSSurface (a NURBSSurface node wraps its contained BSplineSurface). Otherwise this method returns null.

Parameters:
w - a node
Returns:
wrapped Object value, or null

operator$and

public static IntersectionList operator$and(Line line,
                                            Volume volume)
This operator method is an alias for intersect(de.grogra.vecmath.geom.Line, de.grogra.vecmath.geom.Volume).

Parameters:
line - a line
volume - a volume
Returns:
list containing all intersections of the line and the volume's surface

operator$ge

public static boolean operator$ge(Node a,
                                  Node b)
This operator method compares two nodes based on their id: It returns true iff a.getId () >= b.getId ().

Parameters:
a - a node
b - another node
Returns:
a.getId () >= b.getId ()
See Also:
Node.getId()

operator$gt

public static boolean operator$gt(Node a,
                                  Node b)
This operator method compares two nodes based on their id: It returns true iff a.getId () > b.getId ().

Parameters:
a - a node
b - another node
Returns:
a.getId () > b.getId ()
See Also:
Node.getId()

operator$in

public static <T> boolean operator$in(T value,
                                      java.util.Collection<? super T> set)
This operator method returns true iff set is not null and set.contains(value) returns true.

Parameters:
value - a value
set - a collection
Returns:
true iff value is in set

operator$index

public static boolean operator$index(BooleanList list,
                                     int index)
This operator method is an alias for list.get(index).

Parameters:
list - a list
index - an index
Returns:
element at index in list

operator$index

public static byte operator$index(ByteList list,
                                  int index)
This operator method is an alias for list.get(index).

Parameters:
list - a list
index - an index
Returns:
element at index in list

operator$index

public static char operator$index(CharList list,
                                  int index)
This operator method is an alias for list.get(index).

Parameters:
list - a list
index - an index
Returns:
element at index in list

operator$index

public static double operator$index(DoubleList list,
                                    int index)
This operator method is an alias for list.get(index).

Parameters:
list - a list
index - an index
Returns:
element at index in list

operator$index

public static float operator$index(FloatList list,
                                   int index)
This operator method is an alias for list.get(index).

Parameters:
list - a list
index - an index
Returns:
element at index in list

operator$index

public static float operator$index(FloatToFloat func,
                                   float x)
This operator method is an alias for func.evaluateFloat(x).

Parameters:
func - a function
x - argument to the function
Returns:
evaluation of func at x

operator$index

public static int operator$index(IntList list,
                                 int index)
This operator method is an alias for list.get(index).

Parameters:
list - a list
index - an index
Returns:
element at index in list

operator$index

public static long operator$index(LongList list,
                                  int index)
This operator method is an alias for list.get(index).

Parameters:
list - a list
index - an index
Returns:
element at index in list

operator$index

public static boolean operator$index(Node node,
                                     BooleanAttribute attr)

operator$index

public static byte operator$index(Node node,
                                  ByteAttribute attr)

operator$index

public static char operator$index(Node node,
                                  CharAttribute attr)

operator$index

public static double operator$index(Node node,
                                    DoubleAttribute attr)

operator$index

public static float operator$index(Node node,
                                   FloatAttribute attr)

operator$index

public static Node operator$index(Node node,
                                  int index)
This operator method is an alias for node.getChild(index).

Parameters:
node - a node
index - an index
Returns:
index-th child of code
See Also:
Node.getBranchNode(int)

operator$index

public static int operator$index(Node node,
                                 IntAttribute attr)

operator$index

public static Point3d operator$index(Node n,
                                     Location l)
This operator method returns the location of n. It is an alias for location(n).

Parameters:
n - a node
l - dummy parameter, its value is ignored
Returns:
location of n in global coordinates
See Also:
location(Node)

operator$index

public static long operator$index(Node node,
                                  LongAttribute attr)

operator$index

public static double operator$index(Node n,
                                    NodeToDouble f)
This operator method applies the function f to node n. It is an alias for f.get(n).

Parameters:
n - a node
f - a function of nodes
Returns:
evaluation of f at n

operator$index

public static float operator$index(Node n,
                                   NodeToFloat f)
This operator method applies the function f to node n. It is an alias for f.get(n).

Parameters:
n - a node
f - a function of nodes
Returns:
evaluation of f at n

operator$index

public static int operator$index(Node n,
                                 NodeToInt f)
This operator method applies the function f to node n. It is an alias for f.get(n).

Parameters:
n - a node
f - a function of nodes
Returns:
evaluation of f at n

operator$index

public static <T> T operator$index(Node node,
                                   ObjectAttribute<T> attr)

operator$index

public static short operator$index(Node node,
                                   ShortAttribute attr)

operator$index

public static short operator$index(ShortList list,
                                   int index)
This operator method is an alias for list.get(index).

Parameters:
list - a list
index - an index
Returns:
element at index in list

operator$le

public static boolean operator$le(Node a,
                                  Node b)
This operator method compares two nodes based on their id: It returns true iff a.getId () <= b.getId ().

Parameters:
a - a node
b - another node
Returns:
a.getId () <= b.getId ()
See Also:
Node.getId()

operator$lt

public static boolean operator$lt(Node a,
                                  Node b)
This operator method compares two nodes based on their id: It returns true iff a.getId () < b.getId ().

Parameters:
a - a node
b - another node
Returns:
a.getId () < b.getId ()
See Also:
Node.getId()

operator$shl

public static BooleanList operator$shl(BooleanList list,
                                       boolean value)
This operator method adds value as last element to list.

Parameters:
list - a list
value - value to add as last element
Returns:
list

operator$shl

public static ByteList operator$shl(ByteList list,
                                    byte value)
This operator method adds value as last element to list.

Parameters:
list - a list
value - value to add as last element
Returns:
list

operator$shl

public static CharList operator$shl(CharList list,
                                    char value)
This operator method adds value as last element to list.

Parameters:
list - a list
value - value to add as last element
Returns:
list

operator$shl

public static DoubleList operator$shl(DoubleList list,
                                      double value)
This operator method adds value as last element to list.

Parameters:
list - a list
value - value to add as last element
Returns:
list

operator$shl

public static FloatList operator$shl(FloatList list,
                                     float value)
This operator method adds value as last element to list.

Parameters:
list - a list
value - value to add as last element
Returns:
list

operator$shl

public static IntList operator$shl(IntList list,
                                   int value)
This operator method adds value as last element to list.

Parameters:
list - a list
value - value to add as last element
Returns:
list

operator$shl

public static <E> java.util.List<E> operator$shl(java.util.List<E> list,
                                                 E value)
This operator method adds value as last element to list.

Parameters:
list - a list
value - value to add as last element
Returns:
list

operator$shl

public static LongList operator$shl(LongList list,
                                    long value)
This operator method adds value as last element to list.

Parameters:
list - a list
value - value to add as last element
Returns:
list

operator$shl

public static java.io.PrintWriter operator$shl(java.io.PrintWriter w,
                                               boolean v)
This operator method prints v on w.

Parameters:
w - a writer
v - value to be printed on w
Returns:
w

operator$shl

public static java.io.PrintWriter operator$shl(java.io.PrintWriter w,
                                               char v)
This operator method prints v on w.

Parameters:
w - a writer
v - value to be printed on w
Returns:
w

operator$shl

public static java.io.PrintWriter operator$shl(java.io.PrintWriter w,
                                               double v)
This operator method prints v on w.

Parameters:
w - a writer
v - value to be printed on w
Returns:
w

operator$shl

public static java.io.PrintWriter operator$shl(java.io.PrintWriter w,
                                               float v)
This operator method prints v on w.

Parameters:
w - a writer
v - value to be printed on w
Returns:
w

operator$shl

public static java.io.PrintWriter operator$shl(java.io.PrintWriter w,
                                               int v)
This operator method prints v on w.

Parameters:
w - a writer
v - value to be printed on w
Returns:
w

operator$shl

public static java.io.PrintWriter operator$shl(java.io.PrintWriter w,
                                               long v)
This operator method prints v on w.

Parameters:
w - a writer
v - value to be printed on w
Returns:
w

operator$shl

public static java.io.PrintWriter operator$shl(java.io.PrintWriter w,
                                               java.lang.Object v)
This operator method prints v on w.

Parameters:
w - a writer
v - value to be printed on w
Returns:
w

operator$shl

public static ShortList operator$shl(ShortList list,
                                     short value)
This operator method adds value as last element to list.

Parameters:
list - a list
value - value to add as last element
Returns:
list

orthogonalTropism

public static boolean orthogonalTropism(Matrix34d m,
                                        Tuple3d direction,
                                        float e,
                                        Matrix4d out)
Computes the rotation matrix which implements an orthogonal tropism into a plane perpendicular to direction. This is done as follows: The matrix m is interpreted as the transformation matrix from local to global coordinates. Thus, the local z-direction (the growth direction) has the value v = (m.m02, m.m12, m.m22) in global coordinates. Now the cross product d = v0 × direction, where v0 is the unit vector in direction of v, defines the axis about which a rotation has to be performed in order to achieve the desired tropism. This direction is transformed to the local coordinates of m, and out is set to a rotation about this transformed direction, its angle being the negated value of the scalar product v0 · direction multiplied by e (in radians).
If the absolute value of the angle is less than 1e-10, no rotation matrix is computed and this method returns false. Then out does not contain a valid rotation matrix and should be ignored. This case happens when the growth direction is (anti-)parallel to the desired direction of the tropism.

Parameters:
m - transformation matrix from local to global coordinates
direction - direction of the tropism in global coordinates
e - strength of the tropism
out - the computed rotation matrix is placed in here (only valid if the returned value is true)
Returns:
true iff a rotation matrix has been computed

plot

public static boolean plot(Aggregate a,
                           double x,
                           double y)

plot

public static boolean plot(Aggregate a,
                           DoubleToDouble function,
                           double x)

plot

public static boolean plot(Aggregate a,
                           IntToDouble function,
                           int x)

plotPoints

public static boolean plotPoints(Aggregate a,
                                 double x,
                                 double y)

positionalTropism

public static boolean positionalTropism(Matrix34d m,
                                        Tuple3d target,
                                        float e,
                                        Matrix4d out)
Computes the rotation matrix which implements a positional tropism towards a target location. For the details of computation, see directionalTropism(de.grogra.vecmath.Matrix34d, javax.vecmath.Tuple3d, float, javax.vecmath.Matrix4d), where the direction argument is the normalized direction vector from the origin of the local coordinate system (m.m03, m.m13, m.m23) to target.
If, for mathematical reasons, no rotation matrix can be computed or if no rotation is needed because the local growth direction already points to target, this method returns false. In this case, out does not contain a valid rotation matrix and should be ignored.

Parameters:
m - transformation matrix from local to global coordinates
target - target location of the tropism in global coordinates
e - strength of the tropism
out - the computed rotation matrix is placed in here (only valid if the returned value is true)
Returns:
true iff a rotation matrix has been computed

print

public static void print(boolean v)
Prints v to the XL console.

Parameters:
v - value to be printed

print

public static void print(char v)
Prints v to the XL console.

Parameters:
v - value to be printed

print

public static void print(double v)
Prints v to the XL console.

Parameters:
v - value to be printed

print

public static void print(float v)
Prints v to the XL console.

Parameters:
v - value to be printed

print

public static void print(int v)
Prints v to the XL console.

Parameters:
v - value to be printed

print

public static void print(long v)
Prints v to the XL console.

Parameters:
v - value to be printed

print

public static void print(java.lang.Object v)
Prints v to the XL console.

Parameters:
v - an object

println

public static void println()
Terminate the current line by writing the line separator string.


println

public static void println(boolean v)
Prints v to the XL console, then terminates the line.

Parameters:
v - value to be printed

println

public static void println(char v)
Prints v to the XL console, then terminates the line.

Parameters:
v - value to be printed

println

public static void println(double v)
Prints v to the XL console, then terminates the line.

Parameters:
v - value to be printed

println

public static void println(float v)
Prints v to the XL console, then terminates the line.

Parameters:
v - value to be printed

println

public static void println(int v)
Prints v to the XL console, then terminates the line.

Parameters:
v - value to be printed

println

public static void println(long v)
Prints v to the XL console, then terminates the line.

Parameters:
v - value to be printed

println

public static void println(java.lang.Object v)
Prints v to the XL console, then terminates the line.

Parameters:
v - an object

probability

public static boolean probability(float p)
Returns the value of a boolean pseudorandom variable whose probability for true is p.

Parameters:
p - probability for true
Returns:
random value
See Also:
setSeed(long)

random

public static float random(float min,
                           float max)
Returns a uniformly distributed pseudorandom number between min and max.

Parameters:
min - minimal value
max - maximal value
Returns:
random number between min and max
See Also:
setSeed(long)

randomDirection

public static Vector3d randomDirection()
Pick a random point on the surface of a unit sphere and return it as direction vector.

Returns:
random uniformly distributed direction vector

range

public static void range(DoubleConsumer consumer,
                         double min,
                         double max)

range

public static void range(DoubleConsumer consumer,
                         double min,
                         double max,
                         int n)

ray

public static Line ray(Tuple3d origin,
                       Tuple3d direction)
Constructs a Line which represents a ray emanating at origin in the specified direction. The start parameter of the line is set to 0, the end parameter is set to infinity.

Parameters:
origin - origin of the ray
direction - direction of the ray
Returns:
new ray

reference

public static Reference reference(java.lang.String name)
Returns a Reference instance which refers to the object named name. The list of objects in GroIMP is available in the panel "Object Explorers/Objects".

Parameters:
name - name of object within GroIMP
Returns:
Reference referring to the named object

removeInterpretiveNodes

public static void removeInterpretiveNodes()

removeLeaves

public static void removeLeaves(Node root,
                                ObjectToBoolean<? super Node> filter)
Removes all leaf nodes from the graph which pass filter, starting at root. A leaf is a node which can be reached from the root by traversing branch or successor edges in forward direction and which has no outgoing edge. If a node which passes filter is no leaf initially, but becomes a leaf due to the removal of its children, it is also removed itself. As a result, the graph finally does not contain any leaves which pass filter.

Parameters:
root - root node of subgraph whose leaves shall be removed
filter - only leaf nodes which pass this filter are removed

removeTransformationLeaves

public static void removeTransformationLeaves(Node root)
Removes all leaf nodes from the graph which are pure transformation nodes (see removeTransformationLeaves(Node, ObjectToBoolean)).

Parameters:
root - root node of subgraph whose leaves shall be removed
See Also:
removeLeaves(de.grogra.graph.impl.Node, de.grogra.xl.lang.ObjectToBoolean)

removeTransformationLeaves

public static void removeTransformationLeaves(Node root,
                                              ObjectToBoolean<? super Node> filter)
Removes all leaf nodes from the graph which are pure transformation nodes and which pass filter, starting at root (see removeLeaves(de.grogra.graph.impl.Node, de.grogra.xl.lang.ObjectToBoolean)). A node is considered to be a pure transformation node if it has a transformation attribute, but no shape attribute.

Parameters:
root - root node of subgraph whose leaves shall be removed
filter - only leaf nodes which pass this filter are removed. If null, all transformation nodes are considered
See Also:
removeLeaves(de.grogra.graph.impl.Node, de.grogra.xl.lang.ObjectToBoolean)

rggGraph

public static RGGGraph rggGraph()

select

public static int select(Aggregate a,
                         Node value)

setDerivationMode

public static void setDerivationMode(int mode)

setRandomTransform

public static void setRandomTransform(Null target,
                                      Transform3D center,
                                      double sigma,
                                      double minX,
                                      double minY,
                                      double maxX,
                                      double maxY)

setSeed

public static void setSeed(long seed)
This method sets the seed for the pseudorandom number generator which is used by the random methods in this class. This is the generator obtained by Operators.getRandomGenerator() within the current thread.

Parameters:
seed - a seed

setStatus

public static void setStatus(java.lang.String text)
Displays text in the current status bar.

Parameters:
text - a text to be displayed

shader

public static ShaderRef shader(java.lang.String name)
Returns a ShaderRef instance which refers to the shader named name. The list of shaders in GroIMP is available in the panel "Object Explorers/3D/Shaders".

Parameters:
name - name of shader within GroIMP
Returns:
ShaderRef referring to the named shader

shortValue

public static short shortValue(Node w)
Returns the short value which is wrapped in w if w is an instance of ShortNode. Otherwise this method returns 0.

Parameters:
w - a node
Returns:
wrapped short value, or 0

statistics

public static Statistics statistics(Aggregate a,
                                    double value)
This aggregate method computes a Statistics object for a series of values a.

Parameters:
a - aggregate instance (provided by the XL compiler)
value - a value of the sequence of values
Returns:
statistics of the series of values

successor

public static Node successor(Node n,
                             ObjectToBoolean<? super Node> condition)
Returns the nearest successor of n which fulfills condition. Successors are those nodes which can be reached by traversing successor-edges forwards.

Parameters:
n - a node
condition - a condition
Returns:
nearest successor fulfilling condition, or null

Surface

@Deprecated
public static NURBSSurface Surface(BSplineCurve profile)
Deprecated. 


Surface

@Deprecated
public static NURBSSurface Surface(BSplineCurveList profiles)
Deprecated. 


Surface

@Deprecated
public static NURBSSurface Surface(BSplineCurve profile,
                                              java.lang.String name,
                                              boolean useRail)
Deprecated. 


Surface

@Deprecated
public static NURBSSurface Surface(BSplineSurface surface)
Deprecated. 


Surface

@Deprecated
public static NURBSSurface Surface(byte type)
Deprecated. 


Surface

@Deprecated
public static NURBSSurface Surface(byte type,
                                              java.lang.String name,
                                              boolean useRail)
Deprecated. 


Surface

@Deprecated
public static NURBSSurface Surface(float radius)
Deprecated. 


surface

public static SurfaceRef surface(java.lang.String name)
Returns a SurfaceRef instance which refers to the surface named name. The list of surfaces in GroIMP is available in the panel "Object Explorers/Math Objects/Surfaces".

Parameters:
name - name of surface within GroIMP
Returns:
SurfaceRef referring to the named surface

synthesize

public static <T> boolean synthesize(T root,
                                     ObjectToObjectGenerator<? super T,? extends T> generator,
                                     ObjectToBoolean<BooleanSynth<? super T>> synth)
This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure. A synthesized attribute is an attribute for a node whose value depends on the node and its descendants. root defines the root of the tree-like structure, generator is used to obtain the children of a node, and synth to compute the value of the synthesized attribute at the current node, where the values of its children have been computed previously and are passed to synth.

Type Parameters:
T - the type of nodes
Parameters:
root - root node of structure
generator - the generator is used to obtain the direct children of the current node
synth - this function is used to compute the value of the synthesized attribute at a node, given the values of its children
Returns:
value of synthesized attribute at root

synthesize

public static <T> byte synthesize(T root,
                                  ObjectToObjectGenerator<? super T,? extends T> generator,
                                  ObjectToByte<ByteSynth<? super T>> synth)
This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure. A synthesized attribute is an attribute for a node whose value depends on the node and its descendants. root defines the root of the tree-like structure, generator is used to obtain the children of a node, and synth to compute the value of the synthesized attribute at the current node, where the values of its children have been computed previously and are passed to synth.

Type Parameters:
T - the type of nodes
Parameters:
root - root node of structure
generator - the generator is used to obtain the direct children of the current node
synth - this function is used to compute the value of the synthesized attribute at a node, given the values of its children
Returns:
value of synthesized attribute at root

synthesize

public static <T> char synthesize(T root,
                                  ObjectToObjectGenerator<? super T,? extends T> generator,
                                  ObjectToChar<CharSynth<? super T>> synth)
This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure. A synthesized attribute is an attribute for a node whose value depends on the node and its descendants. root defines the root of the tree-like structure, generator is used to obtain the children of a node, and synth to compute the value of the synthesized attribute at the current node, where the values of its children have been computed previously and are passed to synth.

Type Parameters:
T - the type of nodes
Parameters:
root - root node of structure
generator - the generator is used to obtain the direct children of the current node
synth - this function is used to compute the value of the synthesized attribute at a node, given the values of its children
Returns:
value of synthesized attribute at root

synthesize

public static <T> double synthesize(T root,
                                    ObjectToObjectGenerator<? super T,? extends T> generator,
                                    ObjectToDouble<DoubleSynth<? super T>> synth)
This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure. A synthesized attribute is an attribute for a node whose value depends on the node and its descendants. root defines the root of the tree-like structure, generator is used to obtain the children of a node, and synth to compute the value of the synthesized attribute at the current node, where the values of its children have been computed previously and are passed to synth.

Type Parameters:
T - the type of nodes
Parameters:
root - root node of structure
generator - the generator is used to obtain the direct children of the current node
synth - this function is used to compute the value of the synthesized attribute at a node, given the values of its children
Returns:
value of synthesized attribute at root

synthesize

public static <T> float synthesize(T root,
                                   ObjectToObjectGenerator<? super T,? extends T> generator,
                                   ObjectToFloat<FloatSynth<? super T>> synth)
This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure. A synthesized attribute is an attribute for a node whose value depends on the node and its descendants. root defines the root of the tree-like structure, generator is used to obtain the children of a node, and synth to compute the value of the synthesized attribute at the current node, where the values of its children have been computed previously and are passed to synth.

Type Parameters:
T - the type of nodes
Parameters:
root - root node of structure
generator - the generator is used to obtain the direct children of the current node
synth - this function is used to compute the value of the synthesized attribute at a node, given the values of its children
Returns:
value of synthesized attribute at root

synthesize

public static <T> int synthesize(T root,
                                 ObjectToObjectGenerator<? super T,? extends T> generator,
                                 ObjectToInt<IntSynth<? super T>> synth)
This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure. A synthesized attribute is an attribute for a node whose value depends on the node and its descendants. root defines the root of the tree-like structure, generator is used to obtain the children of a node, and synth to compute the value of the synthesized attribute at the current node, where the values of its children have been computed previously and are passed to synth.

Type Parameters:
T - the type of nodes
Parameters:
root - root node of structure
generator - the generator is used to obtain the direct children of the current node
synth - this function is used to compute the value of the synthesized attribute at a node, given the values of its children
Returns:
value of synthesized attribute at root

synthesize

public static <T> long synthesize(T root,
                                  ObjectToObjectGenerator<? super T,? extends T> generator,
                                  ObjectToLong<LongSynth<? super T>> synth)
This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure. A synthesized attribute is an attribute for a node whose value depends on the node and its descendants. root defines the root of the tree-like structure, generator is used to obtain the children of a node, and synth to compute the value of the synthesized attribute at the current node, where the values of its children have been computed previously and are passed to synth.

Type Parameters:
T - the type of nodes
Parameters:
root - root node of structure
generator - the generator is used to obtain the direct children of the current node
synth - this function is used to compute the value of the synthesized attribute at a node, given the values of its children
Returns:
value of synthesized attribute at root

synthesize

public static <T,V> V synthesize(T root,
                                 ObjectToObjectGenerator<? super T,? extends T> generator,
                                 ObjectToObject<ObjectSynth<? super T,? super V>,? extends V> synth)
This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure. A synthesized attribute is an attribute for a node whose value depends on the node and its descendants. root defines the root of the tree-like structure, generator is used to obtain the children of a node, and synth to compute the value of the synthesized attribute at the current node, where the values of its children have been computed previously and are passed to synth.

Type Parameters:
T - the type of nodes
V - the type of values of the synthesized attribute
Parameters:
root - root node of structure
generator - the generator is used to obtain the direct children of the current node
synth - this function is used to compute the value of the synthesized attribute at a node, given the values of its children
Returns:
value of synthesized attribute at root

synthesize

public static <T> short synthesize(T root,
                                   ObjectToObjectGenerator<? super T,? extends T> generator,
                                   ObjectToShort<ShortSynth<? super T>> synth)
This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure. A synthesized attribute is an attribute for a node whose value depends on the node and its descendants. root defines the root of the tree-like structure, generator is used to obtain the children of a node, and synth to compute the value of the synthesized attribute at the current node, where the values of its children have been computed previously and are passed to synth.

Type Parameters:
T - the type of nodes
Parameters:
root - root node of structure
generator - the generator is used to obtain the direct children of the current node
synth - this function is used to compute the value of the synthesized attribute at a node, given the values of its children
Returns:
value of synthesized attribute at root

toLine

public static Line toLine(Node node)
Returns a line which corresponds to the central line of node. The central line starts at the location(Node) of the node and extends to the endlocation(Node) of the node.

Parameters:
node - a node
Returns:
central line of the node

toObjectToDouble

public static ObjectToDouble<double[]> toObjectToDouble(DoubleToDouble f)

toPoint3d

public static Point3d toPoint3d(IntersectionList list)
This autoconversion method returns the first intersection point of list, or null if list is empty. The returned point may be modified.

Parameters:
list - list of previously computed intersections
Returns:
first intersection point, or null

toPoint3d

public static Point3d toPoint3d(Node node)
The same as location(Node). This method is designed as an auto-conversion method.

Parameters:
node - a node
Returns:
the node's location in global coordinates

toTuple3d

public static Tuple3d toTuple3d(Node node)

transformation

public static Matrix34d transformation(Node node)
Computes the global coordinate transformation of the node. The returned matrix must not be modified.

Parameters:
node - a node
Returns:
the node's global coordinate transformation

transformation

public static Matrix34d transformation(Node node,
                                       boolean post)
Computes the global coordinate transformation of the node. If post is false, the transformation of the node itself is returned, otherwise the transformation of its children. These may differ if node induces a change of coordinates. The returned matrix must not be modified.

Parameters:
node - a node
post - true iff the post-transformation (of the node's children) shall be returned
Returns:
the node's global coordinate transformation

tropism

public static Null tropism(Node a,
                           Point3d target,
                           float e)
Return a new node with a transformation matrix set to the desired tropism.

Parameters:
a - node containing original orientation
target - target location towards the tropism should orient to
e - strength of the tropism
Returns:
a node with a transformation set to the requested tropism
See Also:
positionalTropism(de.grogra.vecmath.Matrix34d, javax.vecmath.Tuple3d, float, javax.vecmath.Matrix4d)

tropism

public static Null tropism(Node a,
                           Vector3d direction,
                           float e)
Return a new node with a transformation matrix set to the desired tropism.

Parameters:
a - node containing original orientation
direction - target direction towards the tropism should orient to
e - strength of the tropism
Returns:
a node with a transformation set to the requested tropism
See Also:
directionalTropism(de.grogra.vecmath.Matrix34d, javax.vecmath.Tuple3d, float, javax.vecmath.Matrix4d)

visualizeAsColor

public static RGBAShader visualizeAsColor(double x)
Returns a color shader whose color represents the value of x which has to lie between -1 and 1. The color is interpolated between green for 1, white for 0 and red for -1.

Parameters:
x - a value between -1 and 1
Returns:
a color shader which visualizes x

volume

public static Volume volume(Node node)
Returns a volume which corresponds to the shape of node. If node has no shape, an empty volume is returned.

Parameters:
node - a node
Returns:
volume corresponding the node's shape

workbench

public static IMPWorkbench workbench()
Returns the currently active Workbench. This may return null.

Returns:
current workbench or null