de.grogra.rgg
public class Library extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
ALPHA_SHAPE |
static int |
BOUNDING_RECTANGLE |
static int |
branch
This is a redefinition of
Graph.BRANCH_EDGE. |
static int |
contains
This is a redefinition of
Graph.CONTAINMENT_EDGE. |
static int |
CONVEXHULL |
static float[][] |
DEFAULT_LEAF3D |
static java.lang.String[] |
DEFAULT_LEAF3D_NAME |
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 and Description |
|---|
Library() |
| Modifier and Type | Method and Description |
|---|---|
static void |
allowNoninjectiveMatchesByDefault(boolean value) |
static void |
allowNoninjectiveMatchesForNextQuery(boolean value)
Deprecated.
|
static <C extends Node> |
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)
|
static byte |
byteValue(Node w)
|
static void |
chart(DatasetRef ds,
int type)
Shows the data referenced by
ds in a chart panel. |
static char |
charValue(Node w)
|
static void |
clearConsole()
Clears the current console.
|
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 QuickHull3D |
convexhull(double[] coords)
Constructs the convex hull of a set of coordinates.
|
static QuickHull3D |
convexhull(double[] coords,
boolean debug)
Constructs the convex hull of a set of coordinates.
|
static QuickHull3D |
convexhull(Node root)
Constructs the convex hull of all points that can be reached starting from
the indicated root node.
|
static QuickHull3D |
convexhull(Node[] nodes) |
static QuickHull3D |
convexhull(Point3d[] points)
Constructs the convex hull of a set of points.
|
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 void |
disableView3DRepaint()
Disables repaint of View3D panel.
|
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)
|
static void |
enableView3DRepaint()
Enables repaint of View3D panel after it was deactivated with
disableView3DRepaint(). |
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 void |
export3DScene(java.io.File file,
java.lang.String format)
Exports the current 3D scene to the specified target file and format.
|
static void |
export3DScene(java.lang.String fileName,
java.lang.String format)
Exports the current 3D scene to the specified target file and format.
|
static void |
exportGraphToFile(java.lang.String fileName)
Writes the current graph to a file.
|
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)
|
static FunctionRef |
function(java.lang.String name)
Returns a
Function instance which refers
to the function named name. |
static java.util.List<java.util.Vector<Point3d>> |
getAlphaShape(Node root,
double alpha)
Calculates the alhpa shape of all (visible) nodes that can be reached from the given
root Node considerring the choosn alpah value.
|
static java.util.List<java.util.Vector<Point3d>> |
getAlphaShape(Point2d[] points,
double alpha)
Calculates the alhpa shape of the given array of points considerring the choosn alpah value.
|
static double |
getAreaOfNonTriangulation(float[] pointlist)
Calculates the area of the surface generated by the specified list of points.
|
static double |
getAreaOfNonTriangulation(Point3d[] pointlist)
Calculates the area of the surface generated by the specified list of points.
|
static double |
getAreaOfTriangulation(float[] pointlist)
Calculates the area of the surface generated by the specified list of points.
|
static double |
getAreaOfTriangulation(float scaleX,
float scaleY,
float scaleZ,
float[] pointlist)
Calculates the area of the surface generated by the specified list of points.
|
static double |
getAreaOfTriangulation(Point3d[] pointlist)
Calculates the area of the surface generated by the specified list of points.
|
static Point3d[] |
getBoundingRectangle(Point2d[] points)
Calculates the bounding rectangle of the given array of points.
|
static void |
getCameraPosition(double[] vec) |
static Point3d[] |
getConvexHull2D(Point2d[] points)
Calculates the convex hull of the given array of points.
|
static int |
getGraphSize()
Number of nodes in the main graph.
|
static MeshNode |
getMesh(double[] pointlist)
Return a
MeshNode in shape of it indicated list of points. |
static MeshNode |
getMesh(float[] pointlist)
Return a
MeshNode in shape of it indicated list of points. |
static MeshNode |
getMesh(FloatList vertexData)
Return a
MeshNode in shape of it indicated list of points. |
static MeshNode |
getMesh(Point3d[] pointlist)
Return a
MeshNode in shape of it indicated list of points. |
static MeshNode |
getMesh(QuickHull3D hull)
Returns a
MeshNode as visualization of the given convex hull. |
static GraphManager |
getMetaGraph()
Returns the current meta/registry graph, i.e., the meta/registry graph of the
currently active
Workbench. |
static GraphManager |
getProjectGraph()
Returns the current project graph, i.e., the project graph of the
currently active
Workbench. |
static int |
getSceneGraphSize()
Number of nodes in the scene graph
|
static double |
getSurfaceArea(Node root)
Calculates the area of all nodes of the subgraph with the node root as root node
Intersection with other object are not considered.The total area will be calculated.
|
static double |
getTimeForRepaint()
Determine the time for one repaint of the 3D View window.
|
static double |
getTimeForTraversingGraph()
Determine the time for traversing the whole graph (touching each node once).
|
static double |
getVolume(Node root)
Calculates the volume of all nodes of the subgraph with the node root as root node.
|
static Point3d[] |
getXYProjection(Node root,
int type,
double alpha)
Constructs the selected XY-projection of all points that can be reached starting from
the indicated root node.
|
static Point3d[] |
getXYProjection(Point3d[] pointlist,
int type,
double alpha)
Constructs the selected XY-projection of all points in the list.
|
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 |
help(java.lang.String prefix)
Prints the JavaDoc description of all available commands starting with
the specified prefix on the XL console window.
|
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)
|
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 MeshNode |
leaf3d()
Return a
MeshNode in shape of a 3d leaf. |
static MeshNode |
leaf3d(float[] pointlist)
Return a
MeshNode in shape of it indicated list of points. |
static MeshNode |
leaf3d(int id)
Return a
MeshNode in shape of it indicated default leaf. |
static LightDistributionRef |
light(java.lang.String name)
Returns a
LightDistributionRef instance which refers
to the light distribution named name. |
static void |
list()
Prints the JavaDoc description of all available commands on the XL console window.
|
static void |
list(java.lang.String key)
Prints a list of all available commands starting with the specified sequence.
|
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)
|
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,
Camera camera,
int width,
int height)
Creates a rendered image of the actual scene with the
specified camera and a variable image size.
|
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 void |
markPoints(Point3d[] points,
float radius,
RGBAShader shader)
Marks all points of the specified array with a Sphere of the specified
radius and shader. |
static void |
markPoints(Point3d[] points,
float radius,
RGBAShader shader,
boolean label)
Marks all points of the specified array with a Sphere of the specified
radius and shader. |
static void |
markPoints(QuickHull3D hull)
Marks all points with a Sphere of the given
QuickHull3D. |
static void |
markPoints(QuickHull3D hull,
float radius)
Marks all points with a Sphere of the specified
radius and
of the given QuickHull3D. |
static void |
markVertices(QuickHull3D hull)
Marks all vertices with a Sphere of the given
QuickHull3D. |
static void |
markVertices(QuickHull3D hull,
float radius)
Marks all vertices with a Sphere of the specified
radius and
of the given QuickHull3D. |
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)
|
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 |
print(java.lang.Object v,
int colour)
Prints
v with the specified colour 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 void |
println(java.lang.Object v,
int colour)
Prints
v with the specified colour 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 super de.grogra.graph.impl.Node>)). |
static void |
repaintView3D()
Repaints the View3D panel.
|
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)
|
static SpectrumRef |
spectrum(java.lang.String name)
Returns a
SpectrumRef instance which refers
to the spectrum named name. |
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 MeshNode |
triangulate(float[] pointlist)
Return a
MeshNode in shape of it indicated list of points. |
static MeshNode |
triangulate(Point3d[] pointlist)
Return a
MeshNode in shape of it indicated list of points. |
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 void |
undo()
Undo the last derivation step.
|
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. |
public static final int ALPHA_SHAPE
public static final int BOUNDING_RECTANGLE
public static final int branch
Graph.BRANCH_EDGE.public static final int contains
Graph.CONTAINMENT_EDGE.public static final int CONVEXHULL
public static float[][] DEFAULT_LEAF3D
public static java.lang.String[] DEFAULT_LEAF3D_NAME
public static final double DEG
public static final int EDGE_0
public static final int EDGE_1
public static final int EDGE_10
public static final int EDGE_11
public static final int EDGE_12
public static final int EDGE_13
public static final int EDGE_14
public static final int EDGE_2
public static final int EDGE_3
public static final int EDGE_4
public static final int EDGE_5
public static final int EDGE_6
public static final int EDGE_7
public static final int EDGE_8
public static final int EDGE_9
public static final Vector3d HEAD
public static final I18NBundle I18N
de.grogra.rgg package.public static final Vector3d LEFT
public static final RGGProducer.Creator makeGraph
public static final int mark
Graph.MARK_EDGE.public static final int master
Instance3D.MASTER.public static final int notifies
Graph.NOTIFIES_EDGE.public static final Point3d ORIGIN
public static final java.io.PrintWriter out
PrintWriter to write
to the XL console.public static final double R2D
public static final int refine
Graph.REFINEMENT_EDGE.public static final byte SKIN
NURBSSurface.NURBSSurface(byte) indicating a
skinned surface (defined by a set of profile curves in space).public static final int successor
Graph.SUCCESSOR_EDGE.public static final byte SWEEP
NURBSSurface.NURBSSurface(byte) indicating a
swept surface (defined by a set of vertices in space).public static final Vector3d UP
public static final int updates
FieldUpdater.UPDATES.public static void allowNoninjectiveMatchesByDefault(boolean value)
@Deprecated public static void allowNoninjectiveMatchesForNextQuery(boolean value)
public static <C extends Node> C ancestor(Node n, java.lang.Class<C> t)
n which is an instance
of t. Ancestors are those nodes which can be reached by
traversing successor- or branch-edges backwards.n - a nodet - the type so search fort, or nullpublic static Node ancestor(Node n, ObjectToBoolean<? super Node> condition)
n which fulfills
condition. Ancestors are those nodes which can be reached by
traversing successor- or branch-edges backwards.n - a nodecondition - a conditioncondition, or nullpublic static double angle(Node node)
node. The computed value will be correct
if the transformation is a rotation, possibly combined with a uniform
scaling.node - a nodenode,
in degreespublic static DisposableIterator apply(int count)
for-statement to execute its body
count times. Each execution is surrounded
by a transformation boundary (see derive()).count - number of iterationspublic static DisposableIterator applyUntilFinished()
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()).public static boolean booleanValue(Node w)
boolean value which is wrapped
in w if w is an instance of
BooleanNode. Otherwise this method returns
false.w - a nodeboolean value, or falsepublic static byte byteValue(Node w)
byte value which is wrapped
in w if w is an instance of
ByteNode. Otherwise this method returns
0.w - a nodebyte value, or 0public static void chart(DatasetRef ds, int type)
ds in a chart panel.
type is one of the constants declared in
ChartPanel, this specifies the type of chart.ds - reference to a Datasettype - chart typepublic static char charValue(Node w)
char value which is wrapped
in w if w is an instance of
CharNode. Otherwise this method returns
0.w - a nodechar value, or 0public static void clearConsole()
public static Node cloneNode(Node node) throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedExceptionpublic static Node cloneSubgraph(Node root) throws java.lang.CloneNotSupportedException
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.root - root node of subgraphjava.lang.CloneNotSupportedExceptionpublic static void closeWorkbench()
Workbench if such a workbench
exists. Note that unsaved modifications are lost, because the user is
not asked.public static Cone cone(Node node, boolean end, double angle)
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.node - node which defines the cone's tipend - use location or end location of nodeangle - half opening angle in degreesCone corresponding to the specified geometrypublic static Cone cone(Tuple3d origin, Vector3d direction, double angle)
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.origin - location of the cone's tipdirection - direction of the cone's axisangle - half opening angle in degreesCone corresponding to the specified geometrypublic static Console console()
Console. This may return
null.nullpublic static QuickHull3D convexhull(double[] coords)
points - input pointspublic static QuickHull3D convexhull(double[] coords, boolean debug)
points - input pointsdebug - flagpublic static QuickHull3D convexhull(Node root)
Library.location(Node)) of each node will be taken as position.points - input pointspublic static QuickHull3D convexhull(Node[] nodes)
public static QuickHull3D convexhull(Point3d[] points)
points - input pointspublic static CurveRef curve(java.lang.String name)
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".name - name of curve within GroIMPCurveRef referring to the named curvepublic static DatasetRef dataset(java.lang.String name)
DatasetRef instance which refers
to the dataset named name. The list of datasets
in GroIMP is available in the panel
"Object Explorers/Datasets".name - name of dataset within GroIMPDatasetRef referring to the named datasetpublic static void defer(java.lang.Runnable r)
r - public static void derive()
public static <T> Node descendants(ObjectConsumer<? super T> cb, Node n, java.lang.Class<T> cls)
n
which are instances of cls.
Descendants are those nodes which can be reached by
traversing successor- or branch-edges forwards.cb - a consumer instance receiving the nodes (provided by the XL compiler)n - a nodecls - the type to seach fornullpublic static Vector3d direction(Node node)
node in global coordinates.
The direction is defined by the direction (0, 0, 1) in local coordinates.node - a nodenodedirection(Tuple3d, Node, boolean)public static void direction(Tuple3d dir, Node node, boolean end)
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.dir - receives the directionnode - a nodeend - use location or end location of nodepublic static boolean directionalTropism(Matrix34d m, Tuple3d direction, float e, Matrix4d out)
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).
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.m - transformation matrix from local to global coordinatesdirection - direction of the tropism in global coordinatese - strength of the tropismout - the computed rotation matrix is placed in here (only
valid if the returned value is true)true iff a rotation matrix has been computedpublic static void disableView3DRepaint()
public static double distance(Node a, Node b)
a - first nodeb - second nodepublic static double distanceSquared(Node a, Node b)
a - node ab - node bpublic static double distanceToLine(Tuple3d point, Line line)
point and
line.point - a pointline - a linepoint and lineLine.distance(Tuple3d)public static int distribution(float[] probabilities)
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.probabilities - array of discrete probabilitiesprobabilitiessetSeed(long)public static double doubleValue(Node w)
double value which is wrapped
in w if w is an instance of
DoubleNode. Otherwise this method returns
0.w - a nodedouble value, or 0public static void enableView3DRepaint()
disableView3DRepaint().public static Vector3d enddirection(Node node)
node in global coordinates.
The direction is defined by the direction (0, 0, 1) in
local coordinates of node's children.node - a nodenode's
childrendirection(Tuple3d, Node, boolean)public static Point3d endlocation(Node node)
node in global coordinates.
The end location is defined by the point (0, 0, 0) in local coordinates
of node's children.node - a nodenode's end location in global coordinateslocation(Tuple3d, Node, boolean)public static void export3DScene(java.io.File file,
java.lang.String format)
file - output fileformat - target file formatpublic static void export3DScene(java.lang.String fileName,
java.lang.String format)
fileName - name of the output fileformat - target file formatpublic static void exportGraphToFile(java.lang.String fileName)
fileName - name of the output file@Deprecated public static RGGGraph extent()
public static FileRef file(java.lang.String name)
FileRef instance which refers
to the file named name. The list of files
in GroIMP is available in the panel
"File Explorer".
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.name - name of file within GroIMPFileRef referring to the named filepublic static NodeFilter<Node> filter(java.lang.Class[] classes, boolean isTrue)
classes (or iff it is not an instance
in case isTrue is false).classes - list of classesisTrue - condition value iff object is an instance of one of classespublic static float floatValue(Node w)
float value which is wrapped
in w if w is an instance of
FloatNode. Otherwise this method returns
0.w - a nodefloat value, or 0public static FunctionRef function(java.lang.String name)
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".name - name of function within GroIMPFunctionRef referring to the named functionpublic static java.util.List<java.util.Vector<Point3d>> getAlphaShape(Node root, double alpha)
points - alpha - valuepublic static java.util.List<java.util.Vector<Point3d>> getAlphaShape(Point2d[] points, double alpha)
points - alpha - valuepublic static double getAreaOfNonTriangulation(float[] pointlist)
pointlist - public static double getAreaOfNonTriangulation(Point3d[] pointlist)
pointlist - public static double getAreaOfTriangulation(float[] pointlist)
pointlist - public static double getAreaOfTriangulation(float scaleX,
float scaleY,
float scaleZ,
float[] pointlist)
scaling - factor Xscaling - factor Yscaling - factor Zpointlist - public static double getAreaOfTriangulation(Point3d[] pointlist)
pointlist - public static Point3d[] getBoundingRectangle(Point2d[] points)
points - public static void getCameraPosition(double[] vec)
public static Point3d[] getConvexHull2D(Point2d[] points)
points - public static int getGraphSize()
public static MeshNode getMesh(double[] pointlist)
MeshNode in shape of it indicated list of points.
The list of points has to be triangulated.
The values of the input list will be casted to float.pointlist - public static MeshNode getMesh(float[] pointlist)
MeshNode in shape of it indicated list of points.
The list of points has to be triangulated.pointlist - public static MeshNode getMesh(FloatList vertexData)
MeshNode in shape of it indicated list of points.
The list of points has to be triangulated.vertexData - public static MeshNode getMesh(Point3d[] pointlist)
MeshNode in shape of it indicated list of points.
The list of points has to be triangulated.vertexData - public static MeshNode getMesh(QuickHull3D hull)
MeshNode as visualization of the given convex hull.hull - public static GraphManager getMetaGraph()
Workbench. This may return
null.nullpublic static GraphManager getProjectGraph()
Workbench. This may return
null.nullpublic static int getSceneGraphSize()
public static double getSurfaceArea(Node root)
public static double getTimeForRepaint()
public static double getTimeForTraversingGraph()
public static double getVolume(Node root)
public static Point3d[] getXYProjection(Node root, int type, double alpha)
Library.location(Node)) of each node will be taken as position.
Currently implemented methods:
CONVEXHULL .. the convex hull
BOUNDING_RECTANGLE .. bounding rectangle
ALPHA_SHAPE .. alpha shape with alpha of alpha (Note: In case the alpha shape is not connected, only the first polygon will be returned)root - nodemethod - of projectionalpha - value, only used for alpha shapespublic static Point3d[] getXYProjection(Point3d[] pointlist, int type, double alpha)
alpha (Note: In case the alpha shape is not connected, only the first polygon will be returned)
Returns an array of points: [centroid, p0, p1, p2, ..., pn, p0};
(Repeatation of the first point to close the area (during triangulation))input - pointsmethod - of projectionalpha - value, only used for alpha shapespublic static GraphManager graph()
Workbench. This may return
null.nullpublic static GraphState graphState()
Workbench.public static double height(Volume volume, double x, double y)
(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.volume - a volumex - global x-coordinatey - global y-coordinatevolume at (x, y), or 0public static void help(java.lang.String prefix)
prefix - of the commands for those the description should be printedpublic static void hide(Node root)
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.
root - root node of subgraphpublic static ImageRef image(java.lang.String name)
ImageRef instance which refers
to the image named name. The list of images
in GroIMP is available in the panel
"Object Explorers/Images".name - name of image within GroIMPImageRef referring to the named imagepublic static double inclination(Node node)
public static DisposableIterator interpretiveRules()
public static IntersectionList intersect(Line line, Volume volume)
line and the surface
of volume. The returned list is valid until the next
invocation of this method within the same thread.line - a linevolume - a volumepublic static double intersectionLength(Line line, Cone cone)
line which
intersects the specified cone.line - line to intersectcone - cone to intersectline which intersects conepublic static int intValue(Node w)
int value which is wrapped
in w if w is an instance of
IntNode. Otherwise this method returns
0.w - a nodeint value, or 0public static int irandom(int min,
int max)
min and max (inclusive).min - minimal valuemax - maximal valuemin and maxsetSeed(long)public static boolean isAncestor(Node a, Node d, int edgeMask)
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.a - the potential ancestord - the potential descendantedgeMask - the edge mask to usetrue iff a is an ancestor
of dpublic static boolean isSelected(Node n)
n has been selected in the
workbench by the user.n - a nodetrue iff n is contained
in the current selectionpublic static Parallelogram leaf(float length, float width)
Parallelogram
created by the constructor invocation
Parallogram(length, width) and having
RGBAShader.GREEN as its shader.length - length of rectanglewidth - width of rectanglepublic static MeshNode leaf3d()
MeshNode in shape of a 3d leaf.public static MeshNode leaf3d(float[] pointlist)
MeshNode in shape of it indicated list of points.
The list of points will be automatically triangulated and returned as MeshNode.
pointlist={x1,y1,z1, ..., xn,yn,zn).pointlist - public static MeshNode leaf3d(int id)
MeshNode in shape of it indicated default leaf.id - of the indicated leafpublic static LightDistributionRef light(java.lang.String name)
LightDistributionRef instance which refers
to the light distribution named name. The list of light distributionRef
in GroIMP is available in the panel
"Object Explorers/3D/lights/Light Distribution".name - name of light distribution within GroIMPLightDistributionRef referring to the named light distributionpublic static void list()
public static void list(java.lang.String key)
prefix - of the commandspublic static Point3d location(Node node)
node in global coordinates.
The location is defined by the point (0, 0, 0) in local coordinates.node - a nodenode's location in global coordinateslocation(Tuple3d, Node, boolean)public static void location(Tuple3d loc, Node node, boolean end)
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.loc - receives the locationnode - a nodeend - use location or end location of nodepublic static double lognormal(double mu,
double sigma)
public static long longValue(Node w)
long value which is wrapped
in w if w is an instance of
LongNode. Otherwise this method returns
0.w - a nodelong value, or 0public static void makeRenderedImage(java.lang.String fileName)
fileName - name of the output filepublic static void makeRenderedImage(java.lang.String fileName,
Camera camera,
int width,
int height)
fileName - name of the output filespecific - camerawidth - height - public static void makeRenderedImage(java.lang.String fileName,
int width,
int height)
fileName - name of the output filewidth - height - public static void makeRenderedImage(java.lang.String fileName,
java.lang.String cameraName,
int width,
int height)
fileName - name of the output filecameraName - name of a specific camerawidth - height - public static void makeSnapshot(java.lang.String fileName)
fileName - name of the output filepublic static void markPoints(Point3d[] points, float radius, RGBAShader shader)
radius and shader.hull - radius - shader - public static void markPoints(Point3d[] points, float radius, RGBAShader shader, boolean label)
radius and shader.
Additionally a TextLabel with a consecutive number can be applyed.hull - radius - shader - label - public static void markPoints(QuickHull3D hull)
QuickHull3D.hull - public static void markPoints(QuickHull3D hull, float radius)
radius and
of the given QuickHull3D.hull - radius - public static void markVertices(QuickHull3D hull)
QuickHull3D.hull - public static void markVertices(QuickHull3D hull, float radius)
radius and
of the given QuickHull3D.hull - radius - @Deprecated public static MaterialRef material(java.lang.String name)
public static void mean(Aggregate a, Tuple3d value)
Tuple3d's.a - aggregate instance (provided by the XL compiler)value - a value of the sequence of valuespublic static void mean(Aggregate a, Tuple3f value)
Tuple3f's.a - aggregate instance (provided by the XL compiler)value - a value of the sequence of valuespublic static void mergeNonTropismTransformations(Node root, boolean allowShape)
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).root - root node of subgraph where chains should be replacedallowShape - store aggregated transformation in shape node at
chain end if possiblemergeNonTropismTransformations(Node, ObjectToBoolean, boolean)public static void mergeNonTropismTransformations(Node root, ObjectToBoolean<? super Node> filter, boolean allowShape)
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.root - root node of subgraph where chains should be replacedfilter - only merge nodes which pass this filter. If null
is specified, every non-tropism transformation node is considered for mergingmergeTransformations(Node, ObjectToBoolean, boolean)public static void mergeTransformations(Node root, boolean allowShape)
Null nodes which perform
the aggregated transformation of the chains. This is the same
as mergeTransformations(root, null).root - root node of subgraph where chains should be replacedallowShape - store aggregated transformation in shape node at
chain end if possiblemergeTransformations(Node, ObjectToBoolean, boolean)public static void mergeTransformations(Node root, ObjectToBoolean<? super Node> filter, boolean allowShape)
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.root - root node of subgraph where chains should be replacedfilter - only merge nodes which pass this filter. If null
is specified, every transformation node is considered for mergingallowShape - if possible, store aggregated transformation in
existing shape node at chain end
(instead of creating a new Null node)public static <T> Node minDescendants(ObjectConsumer<? super T> cb, Node n, java.lang.Class<T> t)
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.cb - a consumer instance receiving the nodes (provided by the XL compiler)n - a nodet - the type to seach fornullpublic static void moveToExtent(RGGProducer ps, Node root, int index)
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.
ps - producer to obtain a modification queue, or nullroot - root node of subgraphindex - new value of the extentTail property of the nodespublic static Node namedNode(java.lang.String name)
name.name - name of a nodename, or null
if no such node existsGraphManager.getNodeForName(java.lang.String)public static GRSVertex newGRSVertices(ObjectConsumer<? super GRSVertex> cons)
public static double normal(double mu,
double sigma)
mu and standard
deviation sigma.mu - mean valuesigma - standard deviationsetSeed(long)public static float normal(float mu,
float sigma)
mu and standard
deviation sigma.mu - mean valuesigma - standard deviationsetSeed(long)public static java.lang.Object objectValue(Node w)
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.w - a nodeObject value, or nullpublic static IntersectionList operator$and(Line line, Volume volume)
intersect(de.grogra.vecmath.geom.Line, de.grogra.vecmath.geom.Volume).line - a linevolume - a volumepublic static boolean operator$ge(Node a, Node b)
true iff
a.getId () >= b.getId ().a - a nodeb - another nodea.getId () >= b.getId ()Node.getId()public static boolean operator$gt(Node a, Node b)
true iff
a.getId () > b.getId ().a - a nodeb - another nodea.getId () > b.getId ()Node.getId()public static <T> boolean operator$in(T value,
java.util.Collection<? super T> set)
true iff
set is not null and
set.contains(value) returns true.value - a valueset - a collectiontrue iff value is in setpublic static boolean operator$index(BooleanList list, int index)
list.get(index).list - a listindex - an indexindex in listpublic static byte operator$index(ByteList list, int index)
list.get(index).list - a listindex - an indexindex in listpublic static char operator$index(CharList list, int index)
list.get(index).list - a listindex - an indexindex in listpublic static double operator$index(DoubleList list, int index)
list.get(index).list - a listindex - an indexindex in listpublic static float operator$index(FloatList list, int index)
list.get(index).list - a listindex - an indexindex in listpublic static float operator$index(FloatToFloat func, float x)
func.evaluateFloat(x).func - a functionx - argument to the functionfunc at xpublic static int operator$index(IntList list, int index)
list.get(index).list - a listindex - an indexindex in listpublic static long operator$index(LongList list, int index)
list.get(index).list - a listindex - an indexindex in listpublic static boolean operator$index(Node node, BooleanAttribute attr)
public static byte operator$index(Node node, ByteAttribute attr)
public static char operator$index(Node node, CharAttribute attr)
public static double operator$index(Node node, DoubleAttribute attr)
public static float operator$index(Node node, FloatAttribute attr)
public static Node operator$index(Node node, int index)
node.getChild(index).node - a nodeindex - an indexindex-th child of codeNode.getBranchNode(int)public static int operator$index(Node node, IntAttribute attr)
public static Point3d operator$index(Node n, Location l)
n.
It is an alias for location(n).n - a nodel - dummy parameter, its value is ignoredn in global coordinateslocation(Node)public static long operator$index(Node node, LongAttribute attr)
public static double operator$index(Node n, NodeToDouble f)
f to node n. It is an alias for
f.get(n).n - a nodef - a function of nodesf at npublic static float operator$index(Node n, NodeToFloat f)
f to node n. It is an alias for
f.get(n).n - a nodef - a function of nodesf at npublic static int operator$index(Node n, NodeToInt f)
f to node n. It is an alias for
f.get(n).n - a nodef - a function of nodesf at npublic static <T> T operator$index(Node node, ObjectAttribute<T> attr)
public static short operator$index(Node node, ShortAttribute attr)
public static short operator$index(ShortList list, int index)
list.get(index).list - a listindex - an indexindex in listpublic static boolean operator$le(Node a, Node b)
true iff
a.getId () <= b.getId ().a - a nodeb - another nodea.getId () <= b.getId ()Node.getId()public static boolean operator$lt(Node a, Node b)
true iff
a.getId () < b.getId ().a - a nodeb - another nodea.getId () < b.getId ()Node.getId()public static BooleanList operator$shl(BooleanList list, boolean value)
value as last element to
list.list - a listvalue - value to add as last elementlistpublic static ByteList operator$shl(ByteList list, byte value)
value as last element to
list.list - a listvalue - value to add as last elementlistpublic static CharList operator$shl(CharList list, char value)
value as last element to
list.list - a listvalue - value to add as last elementlistpublic static DoubleList operator$shl(DoubleList list, double value)
value as last element to
list.list - a listvalue - value to add as last elementlistpublic static FloatList operator$shl(FloatList list, float value)
value as last element to
list.list - a listvalue - value to add as last elementlistpublic static IntList operator$shl(IntList list, int value)
value as last element to
list.list - a listvalue - value to add as last elementlistpublic static <E> java.util.List<E> operator$shl(java.util.List<E> list,
E value)
value as last element to
list.list - a listvalue - value to add as last elementlistpublic static LongList operator$shl(LongList list, long value)
value as last element to
list.list - a listvalue - value to add as last elementlistpublic static java.io.PrintWriter operator$shl(java.io.PrintWriter w,
boolean v)
v on w.w - a writerv - value to be printed on wwpublic static java.io.PrintWriter operator$shl(java.io.PrintWriter w,
char v)
v on w.w - a writerv - value to be printed on wwpublic static java.io.PrintWriter operator$shl(java.io.PrintWriter w,
double v)
v on w.w - a writerv - value to be printed on wwpublic static java.io.PrintWriter operator$shl(java.io.PrintWriter w,
float v)
v on w.w - a writerv - value to be printed on wwpublic static java.io.PrintWriter operator$shl(java.io.PrintWriter w,
int v)
v on w.w - a writerv - value to be printed on wwpublic static java.io.PrintWriter operator$shl(java.io.PrintWriter w,
long v)
v on w.w - a writerv - value to be printed on wwpublic static java.io.PrintWriter operator$shl(java.io.PrintWriter w,
java.lang.Object v)
v on w.w - a writerv - value to be printed on wwpublic static ShortList operator$shl(ShortList list, short value)
value as last element to
list.list - a listvalue - value to add as last elementlistpublic static boolean orthogonalTropism(Matrix34d m, Tuple3d direction, float e, Matrix4d out)
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).
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.m - transformation matrix from local to global coordinatesdirection - direction of the tropism in global coordinatese - strength of the tropismout - the computed rotation matrix is placed in here (only
valid if the returned value is true)true iff a rotation matrix has been computedpublic static boolean plot(Aggregate a, double x, double y)
public static boolean plot(Aggregate a, DoubleToDouble function, double x)
public static boolean plot(Aggregate a, IntToDouble function, int x)
public static boolean plotPoints(Aggregate a, double x, double y)
public static boolean positionalTropism(Matrix34d m, Tuple3d target, float e, Matrix4d out)
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.
target, this method returns
false. In this case, out does not
contain a valid rotation matrix and should be ignored.m - transformation matrix from local to global coordinatestarget - target location of the tropism in global coordinatese - strength of the tropismout - the computed rotation matrix is placed in here (only
valid if the returned value is true)true iff a rotation matrix has been computedpublic static void print(boolean v)
v to the XL console.v - value to be printedpublic static void print(char v)
v to the XL console.v - value to be printedpublic static void print(double v)
v to the XL console.v - value to be printedpublic static void print(float v)
v to the XL console.v - value to be printedpublic static void print(int v)
v to the XL console.v - value to be printedpublic static void print(long v)
v to the XL console.v - value to be printedpublic static void print(java.lang.Object v)
v to the XL console.v - an objectpublic static void print(java.lang.Object v,
int colour)
v with the specified colour to the XL console.v - an objectcolor - selected printing color (black = 0x000000)public static void println()
public static void println(boolean v)
v to the XL console, then
terminates the line.v - value to be printedpublic static void println(char v)
v to the XL console, then
terminates the line.v - value to be printedpublic static void println(double v)
v to the XL console, then
terminates the line.v - value to be printedpublic static void println(float v)
v to the XL console, then
terminates the line.v - value to be printedpublic static void println(int v)
v to the XL console, then
terminates the line.v - value to be printedpublic static void println(long v)
v to the XL console, then
terminates the line.v - value to be printedpublic static void println(java.lang.Object v)
v to the XL console, then
terminates the line.v - an objectpublic static void println(java.lang.Object v,
int colour)
v with the specified colour to the XL console, then
terminates the line.v - an objectcolor - selected printing color (black = 0x000000)public static boolean probability(float p)
boolean pseudorandom variable
whose probability for true is p.p - probability for truesetSeed(long)public static float random(float min,
float max)
min and max.min - minimal valuemax - maximal valuemin and maxsetSeed(long)public static Vector3d randomDirection()
public static void range(DoubleConsumer consumer, double min, double max)
public static void range(DoubleConsumer consumer, double min, double max, int n)
public static Line ray(Tuple3d origin, Tuple3d direction)
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.origin - origin of the raydirection - direction of the raypublic static Reference reference(java.lang.String name)
Reference instance which refers
to the object named name. The list of objects
in GroIMP is available in the panel
"Object Explorers/Objects".name - name of object within GroIMPReference referring to the named objectpublic static void removeInterpretiveNodes()
public static void removeLeaves(Node root, ObjectToBoolean<? super Node> filter)
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.root - root node of subgraph whose leaves shall be removedfilter - only leaf nodes which pass this filter are removedpublic static void removeTransformationLeaves(Node root)
removeTransformationLeaves(Node, ObjectToBoolean)).root - root node of subgraph whose leaves shall be removedremoveLeaves(de.grogra.graph.impl.Node, de.grogra.xl.lang.ObjectToBoolean super de.grogra.graph.impl.Node>)public static void removeTransformationLeaves(Node root, ObjectToBoolean<? super Node> filter)
filter,
starting at root (see removeLeaves(de.grogra.graph.impl.Node, de.grogra.xl.lang.ObjectToBoolean super de.grogra.graph.impl.Node>)).
A node is considered to be a pure transformation node if it has a
transformation attribute,
but no
shape attribute.root - root node of subgraph whose leaves shall be removedfilter - only leaf nodes which pass this filter are removed.
If null, all transformation nodes are consideredremoveLeaves(de.grogra.graph.impl.Node, de.grogra.xl.lang.ObjectToBoolean super de.grogra.graph.impl.Node>)public static void repaintView3D()
public static RGGGraph rggGraph()
public static void setDerivationMode(int mode)
public static void setRandomTransform(Null target, Transform3D center, double sigma, double minX, double minY, double maxX, double maxY)
public static void setSeed(long seed)
Operators.getRandomGenerator()
within the current thread.seed - a seedpublic static void setStatus(java.lang.String text)
text in the current status bar.text - a text to be displayedpublic static ShaderRef shader(java.lang.String name)
ShaderRef instance which refers
to the shader named name. The list of shaders
in GroIMP is available in the panel
"Object Explorers/3D/Shaders".name - name of shader within GroIMPShaderRef referring to the named shaderpublic static short shortValue(Node w)
short value which is wrapped
in w if w is an instance of
ShortNode. Otherwise this method returns
0.w - a nodeshort value, or 0public static SpectrumRef spectrum(java.lang.String name)
SpectrumRef instance which refers
to the spectrum named name. The list of spectra
in GroIMP is available in the panel
"Object Explorers/Light Spectra".name - name of spectrum within GroIMPImageRef referring to the named spectrumpublic static Statistics statistics(Aggregate a, double value)
Statistics
object for a series of values a.a - aggregate instance (provided by the XL compiler)value - a value of the sequence of valuespublic static Node successor(Node n, ObjectToBoolean<? super Node> condition)
n which fulfills
condition. Successors are those nodes which can be reached by
traversing successor-edges forwards.n - a nodecondition - a conditioncondition, or null@Deprecated public static NURBSSurface Surface(BSplineCurve profile)
@Deprecated public static NURBSSurface Surface(BSplineCurveList profiles)
@Deprecated public static NURBSSurface Surface(BSplineCurve profile, java.lang.String name, boolean useRail)
@Deprecated public static NURBSSurface Surface(BSplineSurface surface)
@Deprecated public static NURBSSurface Surface(byte type)
@Deprecated public static NURBSSurface Surface(byte type, java.lang.String name, boolean useRail)
@Deprecated public static NURBSSurface Surface(float radius)
public static SurfaceRef surface(java.lang.String name)
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".name - name of surface within GroIMPSurfaceRef referring to the named surfacepublic static <T> boolean synthesize(T root,
ObjectToObjectGenerator<? super T,? extends T> generator,
ObjectToBoolean<BooleanSynth<? super T>> synth)
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.T - the type of nodesroot - root node of structuregenerator - the generator is used to obtain the direct children
of the current nodesynth - this function is used to compute the value of the
synthesized attribute at a node, given the values of its childrenrootpublic static <T> byte synthesize(T root,
ObjectToObjectGenerator<? super T,? extends T> generator,
ObjectToByte<ByteSynth<? super T>> synth)
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.T - the type of nodesroot - root node of structuregenerator - the generator is used to obtain the direct children
of the current nodesynth - this function is used to compute the value of the
synthesized attribute at a node, given the values of its childrenrootpublic static <T> char synthesize(T root,
ObjectToObjectGenerator<? super T,? extends T> generator,
ObjectToChar<CharSynth<? super T>> synth)
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.T - the type of nodesroot - root node of structuregenerator - the generator is used to obtain the direct children
of the current nodesynth - this function is used to compute the value of the
synthesized attribute at a node, given the values of its childrenrootpublic static <T> double synthesize(T root,
ObjectToObjectGenerator<? super T,? extends T> generator,
ObjectToDouble<DoubleSynth<? super T>> synth)
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.T - the type of nodesroot - root node of structuregenerator - the generator is used to obtain the direct children
of the current nodesynth - this function is used to compute the value of the
synthesized attribute at a node, given the values of its childrenrootpublic static <T> float synthesize(T root,
ObjectToObjectGenerator<? super T,? extends T> generator,
ObjectToFloat<FloatSynth<? super T>> synth)
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.T - the type of nodesroot - root node of structuregenerator - the generator is used to obtain the direct children
of the current nodesynth - this function is used to compute the value of the
synthesized attribute at a node, given the values of its childrenrootpublic static <T> int synthesize(T root,
ObjectToObjectGenerator<? super T,? extends T> generator,
ObjectToInt<IntSynth<? super T>> synth)
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.T - the type of nodesroot - root node of structuregenerator - the generator is used to obtain the direct children
of the current nodesynth - this function is used to compute the value of the
synthesized attribute at a node, given the values of its childrenrootpublic static <T> long synthesize(T root,
ObjectToObjectGenerator<? super T,? extends T> generator,
ObjectToLong<LongSynth<? super T>> synth)
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.T - the type of nodesroot - root node of structuregenerator - the generator is used to obtain the direct children
of the current nodesynth - this function is used to compute the value of the
synthesized attribute at a node, given the values of its childrenrootpublic static <T,V> V synthesize(T root,
ObjectToObjectGenerator<? super T,? extends T> generator,
ObjectToObject<ObjectSynth<? super T,? super V>,? extends V> synth)
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.T - the type of nodesV - the type of values of the synthesized attributeroot - root node of structuregenerator - the generator is used to obtain the direct children
of the current nodesynth - this function is used to compute the value of the
synthesized attribute at a node, given the values of its childrenrootpublic static <T> short synthesize(T root,
ObjectToObjectGenerator<? super T,? extends T> generator,
ObjectToShort<ShortSynth<? super T>> synth)
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.T - the type of nodesroot - root node of structuregenerator - the generator is used to obtain the direct children
of the current nodesynth - this function is used to compute the value of the
synthesized attribute at a node, given the values of its childrenrootpublic static Line toLine(Node node)
node.
The central line starts at the location(Node) of the node
and extends to the endlocation(Node) of the node.node - a nodepublic static ObjectToDouble<double[]> toObjectToDouble(DoubleToDouble f)
public static Point3d toPoint3d(IntersectionList list)
list, or null if list is empty.
The returned point may be modified.list - list of previously computed intersectionsnullpublic static Point3d toPoint3d(Node node)
location(Node). This method is designed
as an auto-conversion method.node - a nodenode's location in global coordinatespublic static Matrix34d transformation(Node node)
node.
The returned matrix must not be modified.node - a nodepublic static Matrix34d transformation(Node node, boolean post)
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.node - a nodepost - true iff the post-transformation (of the
node's children) shall be returnedpublic static MeshNode triangulate(float[] pointlist)
MeshNode in shape of it indicated list of points.
The list of points will be automatically triangulated and returned as MeshNode.
pointlist={x1,y1,z1, ..., xn,yn,zn). First point p0={x1,y1,z1},
faces between {{p0,p1,p2}, {p0,p2,p3}, {p0,p3,p4}, ...}pointlist - public static MeshNode triangulate(Point3d[] pointlist)
MeshNode in shape of it indicated list of points.
The list of points will be automatically triangulated and returned as MeshNode.
pointlist={x1,y1,z1, ..., xn,yn,zn). First point p0={x1,y1,z1},
faces between {{p0,p1,p2}, {p0,p2,p3}, {p0,p3,p4}, ...}pointlist - public static Null tropism(Node a, Point3d target, float e)
a - node containing original orientationtarget - target location towards the tropism should orient toe - strength of the tropismpositionalTropism(de.grogra.vecmath.Matrix34d, javax.vecmath.Tuple3d, float, javax.vecmath.Matrix4d)public static Null tropism(Node a, Vector3d direction, float e)
a - node containing original orientationdirection - target direction towards the tropism should orient toe - strength of the tropismdirectionalTropism(de.grogra.vecmath.Matrix34d, javax.vecmath.Tuple3d, float, javax.vecmath.Matrix4d)public static void undo()
public static RGBAShader visualizeAsColor(double x)
x which has to lie between -1 and 1. The color
is interpolated between green for 1, white for 0 and
red for -1.x - a value between -1 and 1xpublic static Volume volume(Node node)
node. If node has no shape, an empty
volume is returned.node - a nodenode's shapepublic static IMPWorkbench workbench()
Workbench. This may return
null.null