java.lang.Object
de.grogra.rgg.Library
This class contains a collection of methods and constants which are
useful in RGG modelling, especially in 3D.
- Author:
- Ole Kniemeyer
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
This is a redefinition ofGraph.BRANCH_EDGE
.static final int
This is a redefinition ofGraph.CONTAINMENT_EDGE
.static final int
static float[][]
static String[]
static final double
Conversion factor from degree to radians.static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final Vector3d
Vector pointing in the z-direction (the turtle's head axis).static final I18NBundle
The resource bundle for thede.grogra.rgg
package.static final Vector3d
Vector pointing in the x-direction (the turtle's left axis).static final RGGProducer.Creator
static final int
This is a redefinition ofGraph.MARK_EDGE
.static final int
This is a redefinition ofInstance3D.MASTER
.static final int
This is a redefinition ofGraph.NOTIFIES_EDGE
.static final Point3d
Point having coordinates (0, 0, 0).static final PrintWriter
This field provides aPrintWriter
to write to the XL console.static final double
Conversion factor from radians to degree.static final int
This is a redefinition ofGraph.REFINEMENT_EDGE
.static HashMap<Integer,
Set<ManageableType>> static final byte
Constant forNURBSSurface(byte)
indicating a skinned surface (defined by a set of profile curves in space).static final int
This is a redefinition ofGraph.SUCCESSOR_EDGE
.static final byte
Constant forNURBSSurface(byte)
indicating a swept surface (defined by a set of vertices in space).static final Vector3d
Vector pointing in the y-direction (the turtle's up axis).static final int
This is a redefinition ofFieldUpdater.UPDATES
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static void
allowNoninjectiveMatchesByDefault
(boolean value) static void
allowNoninjectiveMatchesForNextQuery
(boolean value) Deprecated.static Node
ancestor
(Node n, ObjectToBoolean<? super Node> condition) Returns the nearest ancestor ofn
which fulfillscondition
.static <C extends Node>
CReturns the nearest ancestor ofn
which is an instance oft
.static double
Computes the rotation angle in degrees of the transformation defined bynode
.static double
static void
apply()
Deprecated.static DisposableIterator
apply
(int count) This finish iterator (see the XL Language Specification) is used in afor
-statement to execute its bodycount
times.static DisposableIterator
This finish iterator (see the XL Language Specification) is used in afor
-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 Box
boundingBox
(Node root, boolean includeroot) static double[]
boundingBoxCoordinates
(Node root, boolean includeroot) Calculates the coordinates of the bounding box starting from the root Node.static byte
static void
chart
(DatasetRef ds, int type) Shows the data referenced byds
in a chart panel.static char
static void
Clears the current console.static Node
static Node
cloneSubgraph
(Node root) This method clones the subgraph starting atroot
and returns the cloned node which corresponds toroot
.static void
Closes the currently activeWorkbench
if such a workbench exists.static Null
ColorBar
(ColorGradient cg, boolean label) Generates a ColorBar as sequence of 100 Cylinder objects based on the passed ColorGradient instance.static Cone
Returns a cone whose tip is defined by the location ofnode
.static Cone
Returns a cone whose tip is located atorigin
, whose central axis hasdirection
as direction, and whose half opening angle isangle
(in degrees).static Console
console()
Returns the currently activeConsole
.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 (including the root node).static QuickHull3D
convexhull
(Node[] nodes) static QuickHull3D
convexhull
(Node root, boolean includeroot) Constructs the convex hull of all points that can be reached starting from the indicated root node.static QuickHull3D
convexhull
(Point3d[] points) Constructs the convex hull of a set of points.static CurveRef
Returns aCurveRef
instance which refers to the curve namedname
.static DatasetRef
Returns aDatasetRef
instance which refers to the dataset namedname
.static void
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, Class<T> cls) This generator method yields all descendants ofn
which are instances ofcls
.static Vector3d
Computes the growth direction of the turtle atnode
in global coordinates.static void
Computes the growth direction of the turtle atnode
in global coordinates.static boolean
directionalTropism
(Matrix34d m, Tuple3d direction, float e, Matrix4d out) Computes the rotation matrix which implements a directional tropism towards adirection
.static void
Disables repaint of View3D panel.static double
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 betweenpoint
andline
.static int
distribution
(float[] probabilities) Returns an integral pseudorandom number according to the discrete distributionprobabilities
.static double
doubleValue
(Node w) static void
Enables repaint of View3D panel after it was deactivated withdisableView3DRepaint()
.static Vector3d
enddirection
(Node node) Computes the growth direction of the turtle at the end ofnode
in global coordinates.static Point3d
endlocation
(Node node) Computes the end location ofnode
in global coordinates.static void
export3DScene
(File file, MimeType format, Boolean onlyVisibleLayer) Exports the current 3D scene to the specified target file and format.static void
export3DScene
(File file, String format) Exports the current 3D scene to the specified target file and format.static void
export3DScene
(File file, String format, Node root) Exports the specified root node and its children to the specified target file and format.static void
export3DScene
(File file, String format, Boolean onlyVisibleLayer) Exports the current 3D scene to the specified target file and format.static void
export3DScene
(String fileName, MimeType format, Boolean onlyVisibleLayer) Exports the current 3D scene to the specified target file and format.static void
export3DScene
(String fileName, String format) Exports the current 3D scene to the specified target file and format.static void
export3DScene
(String fileName, String format, Node root) Exports the specified root node and its children to the specified target file and format.static void
export3DScene
(String fileName, String format, Boolean onlyVisibleLayer) Exports the current 3D scene to the specified target file and format.static void
exportGraphToFile
(String fileName) Writes the current graph to a file.static RGGGraph
extent()
Deprecated.extremelocation
(Node node) static FileRef
Returns aFileRef
instance which refers to the file namedname
.static NodeFilter<Node>
Creates a condition which is fulfilled for an object iff it is an instance of at least one of the specifiedclasses
(or iff it is not an instance in caseisTrue
isfalse
).findChildren
(Node n) Return nodes that connect fromn
with successor or branch edgestatic Node
findComplex
(Node n) Return node that connect ton
with refinement/decomposition edgeReturn nodes that connect fromn
with refinement/decomposition edgeReturn nodes that connect fromn
through one or more refinement/decomposition steps, and without any outgoing decomposition edge.static Node
findParent
(Node n) Return node that connect ton
with successor or branch edgestatic float
floatValue
(Node w) static FunctionRef
Returns aFunction
instance which refers to the function namedname
.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.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 Camera
getCameraByName
(String name) static void
getCameraPosition
(double[] vec) static ShadedNull
Finds the colosed (euclidian distance) object of typeShadedNull
to the parametern
.static ShadedNull
getClosesedObject
(Node n, Class<?> cls) Finds the colosed (euclidian distance) object of typecls
to the parametern
.static QuickHull3D
getComponentBasedABBHull
(Node complexNode, boolean finestComponentBased) static QuickHull3D
getComponentBasedConvexhull
(Node complexNode, boolean finestComponentBased) static Point3d[]
getConvexHull2D
(Point2d[] points) Calculates the convex hull of the given array of points.static HashMap<Integer,
Set<ManageableType>> static int
getEdgeBit
(String type) Returns the GroIMP specific edge bits for a given xml edge type.static Object
getFileFromProject
(String fileName) return the object of a file in the Project from its name.static Node
static int
Get the amount of scale in current groimp multiscale graph.static int
Number of nodes in the main graph.static InputStream
getInputStreamFromProject
(String fileName) Return the input stream of a file from the project.static int
static MeshNode
getMesh
(double[] pointlist) Return aMeshNode
in shape of it indicated list of points.static MeshNode
getMesh
(float[] pointlist) Return aMeshNode
in shape of it indicated list of points.static MeshNode
getMesh
(QuickHull3D hull) Returns aMeshNode
as visualization of the given convex hull.static MeshNode
Return aMeshNode
in shape of it indicated list of points.static MeshNode
Return aMeshNode
in shape of it indicated list of points.static GraphManager
Returns the current meta/registry graph, i.e., the meta/registry graph of the currently activeWorkbench
.getNodesAtScale
(int scaleNumber) static OutputStream
getOutputStreamFromProject
(String fileName, boolean add) Return the output stream of a file from the project.static String
Return the path to the home directory.static String
Return the relative path to the current opened workbench.static String
static GraphManager
Returns the current project graph, i.e., the project graph of the currently activeWorkbench
.getRootsAtScale
(int scaleNumber) static int
getScaleNumber
(Node node) Get the scale number, a given node locates at the scalestatic int
Number of nodes in the scene graphgetShapeExtremePoints
(Node shapeNode) 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
Determine the time for one repaint of the 3D View window.static double
Determine the time for traversing the whole graph (touching each node once).static double
Calculates the volume of all nodes of the subgraph with the node root as root node.static String
getWD()
Short for the method getPathToProjectDirectory().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 activeWorkbench
.static GraphState
Returns the current graph state, i.e., the current graph state of the project graph of the currently activeWorkbench
.static double
This method returns the height of a volume at a point(x, y)
(in global coordinates).static void
Prints the JavaDoc description of all available commands starting with the specified prefix on the XL console window.static void
Hides the subgraph starting atroot
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
Returns anImageRef
instance which refers to the image namedname
.static double
inclination
(Node node) static DisposableIterator
static IntersectionList
Compute all intersections betweenline
and the surface ofvolume
.static double
intersectionLength
(Line line, Cone cone) Determines the fraction of theline
which intersects the specifiedcone
.static int
static int
irandom
(int min, int max) Returns a uniformly distributed integral pseudorandom number betweenmin
andmax
(inclusive).static boolean
isAncestor
(Node a, Node d, int edgeMask) Tests whethera
is an ancestor ofd
(ord
itself), i.e., ifa
can be reached fromd
by a backward traversal of edges matchingedgeMask
(seeEdge.testEdgeBits(int)
).static boolean
isSelected
(Node n) Determines ifn
has been selected in the workbench by the user.static Parallelogram
leaf
(float length, float width) Returns a new, rectangular instance ofParallelogram
created by the constructor invocationParallogram(length, width)
and havingRGBAShader.GREEN
as its shader.static MeshNode
leaf3d()
Return aMeshNode
in shape of a 3d leaf.static MeshNode
leaf3d
(float[] pointlist) Return aMeshNode
in shape of it indicated list of points.static MeshNode
leaf3d
(int id) Return aMeshNode
in shape of it indicated default leaf.static LightDistributionRef
Returns aLightDistributionRef
instance which refers to the light distribution namedname
.static void
list()
Prints the JavaDoc description of all available commands on the XL console window.static void
Prints a list of all available commands starting with the specified sequence.static Point3d
Computes the location ofnode
in global coordinates.static void
Computes the location ofnode
in global coordinates.static double
lognormal
(double mu, double sigma) static long
static void
makeRenderedImage
(String fileName) Creates a Twilight rendered image of the actual scene with the default camera position and a fixed image size of 800x600.static void
makeRenderedImage
(String fileName, int width, int height) Creates a Twilight rendered image of the actual scene with the default camera position and a variable image size.static void
makeRenderedImage
(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
(String fileName, String cameraName, int width, int height) Creates a Twilight rendered image of the actual scene with the specified camera and a variable image size.static void
makeRenderedImageFlux
(String fileName) Creates a Flux rendered image of the actual scene with the default camera position and a fixed image size of 800x600.static void
makeRenderedImageFlux
(String fileName, int width, int height) Creates a Flux rendered image of the actual scene with the default camera position and a variable image size.static void
makeRenderedImageHL
(String fileName) Creates a Twilight rendered image of the actual scene if no View3D instance is available as it is when running headless, using the default camera position and a fixed image size of 800x600.static void
makeRenderedImageHL
(String fileName, int width, int height) Creates a Twilight rendered image of the actual scene if no View3D instance is available as it is when running headless, using the default camera position and a variable image size.static void
makeSnapshot
(String fileName) Creates a snapshot of the actual scene.static void
markPoints
(QuickHull3D hull) Marks all points with a Sphere of the givenQuickHull3D
.static void
markPoints
(QuickHull3D hull, float radius) Marks all points with a Sphere of the specifiedradius
and of the givenQuickHull3D
.static void
markPoints
(Point3d[] points, float radius, RGBAShader shader) Marks all points of the specified array with a Sphere of the specifiedradius
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 specifiedradius
and shader.static void
markVertices
(QuickHull3D hull) Marks all vertices with a Sphere of the givenQuickHull3D
.static void
markVertices
(QuickHull3D hull, float radius) Marks all vertices with a Sphere of the specifiedradius
and of the givenQuickHull3D
.static MaterialRef
Deprecated.static void
This aggregate method computes the mean of a sequence ofTuple3d
's.static void
This aggregate method computes the mean of a sequence ofTuple3f
's.static Null
MeasuringStick
(int steps, float stepsize, boolean label) Creates a measuring stick as sequence of steps Cylinder opjects.static void
mergeNonTropismTransformations
(Node root, boolean allowShape) This method replaces chains of transformation nodes with singleNull
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 passingfilter
with singleNull
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 singleNull
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 passingfilter
with singleNull
nodes which perform the aggregated transformation of the chains.static <T> Node
minDescendants
(ObjectConsumer<? super T> cb, Node n, Class<T> t) This generator method yields all descendants ofn
which are instances oft
and which have no other instance oft
in their path ton
.static void
moveToExtent
(RGGProducer ps, Node root, int index) static Node
Returns a node having the specifiedname
.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 valuemu
and standard deviationsigma
.static float
normal
(float mu, float sigma) Returns a pseudorandom number which is distributed according to a normal distribution with mean valuemu
and standard deviationsigma
.static Object
objectValue
(Node w) Returns theObject
value which is wrapped inw
ifw
is an instance ofObjectNode
,NURBSCurve
(aNURBSCurve
node wraps its containedBSplineCurve
) orNURBSSurface
(aNURBSSurface
node wraps its containedBSplineSurface
).static IntersectionList
operator$and
(Line line, Volume volume) This operator method is an alias forintersect(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 returnstrue
iffa.getId () >= b.getId ()
.static boolean
operator$gt
(Node a, Node b) This operator method compares two nodes based on their id: It returnstrue
iffa.getId () > b.getId ()
.static <T> boolean
operator$in
(T value, Collection<? super T> set) This operator method returnstrue
iffset
is notnull
andset.contains(value)
returnstrue
.static Node
operator$index
(Node node, int index) This operator method is an alias fornode.getChild(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 int
operator$index
(Node node, IntAttribute attr) static long
operator$index
(Node node, LongAttribute attr) static <T> T
operator$index
(Node node, ObjectAttribute<T> attr) static short
operator$index
(Node node, ShortAttribute attr) static Point3d
operator$index
(Node n, Location l) This operator method returns the location ofn
.static double
operator$index
(Node n, NodeToDouble f) This operator method applies the functionf
to noden
.static float
operator$index
(Node n, NodeToFloat f) This operator method applies the functionf
to noden
.static int
operator$index
(Node n, NodeToInt f) This operator method applies the functionf
to noden
.static float
operator$index
(FloatToFloat func, float x) This operator method is an alias forfunc.evaluateFloat(x)
.static boolean
operator$index
(BooleanList list, int index) This operator method is an alias forlist.get(index)
.static byte
operator$index
(ByteList list, int index) This operator method is an alias forlist.get(index)
.static char
operator$index
(CharList list, int index) This operator method is an alias forlist.get(index)
.static double
operator$index
(DoubleList list, int index) This operator method is an alias forlist.get(index)
.static float
operator$index
(FloatList list, int index) This operator method is an alias forlist.get(index)
.static int
operator$index
(IntList list, int index) This operator method is an alias forlist.get(index)
.static long
operator$index
(LongList list, int index) This operator method is an alias forlist.get(index)
.static short
operator$index
(ShortList list, int index) This operator method is an alias forlist.get(index)
.static boolean
operator$le
(Node a, Node b) This operator method compares two nodes based on their id: It returnstrue
iffa.getId () <= b.getId ()
.static boolean
operator$lt
(Node a, Node b) This operator method compares two nodes based on their id: It returnstrue
iffa.getId () < b.getId ()
.static BooleanList
operator$shl
(BooleanList list, boolean value) This operator method addsvalue
as last element tolist
.static ByteList
operator$shl
(ByteList list, byte value) This operator method addsvalue
as last element tolist
.static CharList
operator$shl
(CharList list, char value) This operator method addsvalue
as last element tolist
.static DoubleList
operator$shl
(DoubleList list, double value) This operator method addsvalue
as last element tolist
.static FloatList
operator$shl
(FloatList list, float value) This operator method addsvalue
as last element tolist
.static IntList
operator$shl
(IntList list, int value) This operator method addsvalue
as last element tolist
.static LongList
operator$shl
(LongList list, long value) This operator method addsvalue
as last element tolist
.static ShortList
operator$shl
(ShortList list, short value) This operator method addsvalue
as last element tolist
.static PrintWriter
operator$shl
(PrintWriter w, boolean v) This operator method printsv
onw
.static PrintWriter
operator$shl
(PrintWriter w, char v) This operator method printsv
onw
.static PrintWriter
operator$shl
(PrintWriter w, double v) This operator method printsv
onw
.static PrintWriter
operator$shl
(PrintWriter w, float v) This operator method printsv
onw
.static PrintWriter
operator$shl
(PrintWriter w, int v) This operator method printsv
onw
.static PrintWriter
operator$shl
(PrintWriter w, long v) This operator method printsv
onw
.static PrintWriter
operator$shl
(PrintWriter w, Object v) This operator method printsv
onw
.static <E> List<E>
operator$shl
(List<E> list, E value) This operator method addsvalue
as last element tolist
.static boolean
orthogonalTropism
(Matrix34d m, Tuple3d direction, float e, Matrix4d out) Computes the rotation matrix which implements an orthogonal tropism into a plane perpendicular todirection
.static void
Deprecated.replaced byderive()
static boolean
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 atarget
location.static void
print
(boolean v) Printsv
to the XL console.static void
print
(char v) Printsv
to the XL console.static void
print
(double v) Printsv
to the XL console.static void
print
(float v) Printsv
to the XL console.static void
print
(int v) Printsv
to the XL console.static void
print
(long v) Printsv
to the XL console.static void
Printsv
to the XL console.static void
Printsv
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) Printsv
to the XL console, then terminates the line.static void
println
(char v) Printsv
to the XL console, then terminates the line.static void
println
(double v) Printsv
to the XL console, then terminates the line.static void
println
(float v) Printsv
to the XL console, then terminates the line.static void
println
(int v) Printsv
to the XL console, then terminates the line.static void
println
(long v) Printsv
to the XL console, then terminates the line.static void
Printsv
to the XL console, then terminates the line.static void
Printsv
with the specified colour to the XL console, then terminates the line.static boolean
probability
(float p) Returns the value of aboolean
pseudorandom variable whose probability fortrue
isp
.static float
random
(float min, float max) Returns a uniformly distributed pseudorandom number betweenmin
andmax
.static Vector3d
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
Constructs aLine
which represents a ray emanating atorigin
in the specifieddirection
.static Reference
Returns aReference
instance which refers to the object namedname
.static void
static void
removeLeaves
(Node root, ObjectToBoolean<? super Node> filter) Removes all leaf nodes from the graph which passfilter
, starting atroot
.static void
Removes all leaf nodes from the graph which are pure transformation nodes (seeremoveTransformationLeaves(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 passfilter
, starting atroot
(seeremoveLeaves(de.grogra.graph.impl.Node, de.grogra.xl.lang.ObjectToBoolean<? super de.grogra.graph.impl.Node>)
).static void
Repaints the View3D panel.static RGGGraph
rggGraph()
static int
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
Displaystext
in the current status bar.static void
setViewCamera
(double rx, double ry, double rz, double tx, double ty, double tz, double scalefactor) Set the position, direction and scaling of the View3D window.static ShaderRef
Returns aShaderRef
instance which refers to the shader namedname
.static short
shortValue
(Node w) static SpectrumRef
Returns aSpectrumRef
instance which refers to the spectrum namedname
.static Statistics
statistics
(Aggregate a, double value) This aggregate method computes aStatistics
object for a series of valuesa
.static Node
successor
(Node n, ObjectToBoolean<? super Node> condition) Returns the nearest successor ofn
which fulfillscondition
.static SurfaceRef
Returns aSurfaceRef
instance which refers to the surface namedname
.static NURBSSurface
Surface
(byte type) Deprecated.static NURBSSurface
Deprecated.static NURBSSurface
Surface
(float radius) Deprecated.static NURBSSurface
Surface
(BSplineCurve profile) Deprecated.static NURBSSurface
Surface
(BSplineCurveList profiles) Deprecated.static NURBSSurface
Surface
(BSplineCurve profile, String name, boolean useRail) Deprecated.static NURBSSurface
Surface
(BSplineSurface surface) Deprecated.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 long
tic()
Start stopwatch timer tic starts a stopwatch timer to measure performance.static long
toc()
Read elapsed time from stopwatch toc reads the elapsed time from the stopwatch timer started by the tic function.static Line
Returns a line which corresponds to the central line ofnode
.static ObjectToDouble<double[]>
static Point3d
The same aslocation(Node)
.static Point3d
toPoint3d
(IntersectionList list) This autoconversion method returns the first intersection point oflist
, ornull
iflist
is empty.static Tuple3d
static Matrix34d
transformation
(Node node) Computes the global coordinate transformation of thenode
.static Matrix34d
transformation
(Node node, boolean post) Computes the global coordinate transformation of thenode
.static MeshNode
triangulate
(float[] pointlist) Return aMeshNode
in shape of it indicated list of points.static MeshNode
triangulate
(Point3d[] pointlist) Return aMeshNode
in shape of it indicated list of points.static Null
Return a new node with a transformation matrix set to the desired tropism.static Null
Return a new node with a transformation matrix set to the desired tropism.static void
undo()
Undo the last derivation step.static void
visitGraphNodes
(Set<Node> set, Node node) void
visitNodes
(Set<Node> set, Node node) Put node into the set and visit child nodes.static RGBAShader
visualizeAsColor
(double x) Returns a color shader whose color represents the value ofx
which has to lie between -1 and 1.static Volume
Returns a volume which corresponds to the shape ofnode
.static Workbench
Returns the currently activeWorkbench
.
-
Field Details
-
successor
public static final int successorThis is a redefinition ofGraph.SUCCESSOR_EDGE
.- See Also:
-
branch
public static final int branchThis is a redefinition ofGraph.BRANCH_EDGE
.- See Also:
-
contains
public static final int containsThis is a redefinition ofGraph.CONTAINMENT_EDGE
.- See Also:
-
refine
public static final int refineThis is a redefinition ofGraph.REFINEMENT_EDGE
.- See Also:
-
notifies
public static final int notifiesThis is a redefinition ofGraph.NOTIFIES_EDGE
.- See Also:
-
mark
public static final int markThis is a redefinition ofGraph.MARK_EDGE
.- See Also:
-
updates
public static final int updatesThis is a redefinition ofFieldUpdater.UPDATES
.- See Also:
-
master
public static final int masterThis is a redefinition ofInstance3D.MASTER
.- See Also:
-
EDGE_0
public static final int EDGE_0- See Also:
-
EDGE_1
public static final int EDGE_1- See Also:
-
EDGE_2
public static final int EDGE_2- See Also:
-
EDGE_3
public static final int EDGE_3- See Also:
-
EDGE_4
public static final int EDGE_4- See Also:
-
EDGE_5
public static final int EDGE_5- See Also:
-
EDGE_6
public static final int EDGE_6- See Also:
-
EDGE_7
public static final int EDGE_7- See Also:
-
EDGE_8
public static final int EDGE_8- See Also:
-
EDGE_9
public static final int EDGE_9- See Also:
-
EDGE_10
public static final int EDGE_10- See Also:
-
EDGE_11
public static final int EDGE_11- See Also:
-
EDGE_12
public static final int EDGE_12- See Also:
-
EDGE_13
public static final int EDGE_13- See Also:
-
EDGE_14
public static final int EDGE_14- See Also:
-
SKIN
public static final byte SKINConstant forNURBSSurface(byte)
indicating a skinned surface (defined by a set of profile curves in space).- See Also:
-
SWEEP
public static final byte SWEEPConstant forNURBSSurface(byte)
indicating a swept surface (defined by a set of vertices in space).- See Also:
-
I18N
The resource bundle for thede.grogra.rgg
package. -
DEG
public static final double DEGConversion factor from degree to radians.- See Also:
-
R2D
public static final double R2DConversion factor from radians to degree.- See Also:
-
LEFT
Vector pointing in the x-direction (the turtle's left axis). Do not modify its contents. -
UP
Vector pointing in the y-direction (the turtle's up axis). Do not modify its contents. -
HEAD
Vector pointing in the z-direction (the turtle's head axis). Do not modify its contents. -
ORIGIN
Point having coordinates (0, 0, 0). Do not modify its contents. -
makeGraph
-
CONVEXHULL
public static final int CONVEXHULL- See Also:
-
BOUNDING_RECTANGLE
public static final int BOUNDING_RECTANGLE- See Also:
-
ALPHA_SHAPE
public static final int ALPHA_SHAPE- See Also:
-
DEFAULT_LEAF3D
public static float[][] DEFAULT_LEAF3D -
DEFAULT_LEAF3D_NAME
-
out
This field provides aPrintWriter
to write to the XL console. -
scaleTypeMap
-
-
Constructor Details
-
Library
public Library()
-
-
Method Details
-
console
Returns the currently activeConsole
. This may returnnull
.- Returns:
- current console or
null
-
workbench
Returns the currently activeWorkbench
. This may returnnull
.- Returns:
- current workbench or
null
-
closeWorkbench
public static void closeWorkbench()Closes the currently activeWorkbench
if such a workbench exists. Note that unsaved modifications are lost, because the user is not asked. -
graph
Returns the current project graph, i.e., the project graph of the currently activeWorkbench
. This may returnnull
.- Returns:
- current project graph or
null
-
getProjectGraph
Returns the current project graph, i.e., the project graph of the currently activeWorkbench
. This may returnnull
.- Returns:
- current project graph or
null
-
getMetaGraph
Returns the current meta/registry graph, i.e., the meta/registry graph of the currently activeWorkbench
. This may returnnull
.- Returns:
- current meta/registry graph or
null
-
graphState
Returns the current graph state, i.e., the current graph state of the project graph of the currently activeWorkbench
.- Returns:
- current graph state
-
extent
Deprecated. -
rggGraph
-
allowNoninjectiveMatchesByDefault
public static void allowNoninjectiveMatchesByDefault(boolean value) -
allowNoninjectiveMatchesForNextQuery
Deprecated. -
setDerivationMode
public static void setDerivationMode(int mode) -
tic
public static long tic()Start stopwatch timer tic starts a stopwatch timer to measure performance. The function records the internal time at execution of the tic command. Display the elapsed time with the toc function.- Returns:
- returns the value of the internal timer [ms] at the execution of the tic command
-
toc
public static long toc()Read elapsed time from stopwatch toc reads the elapsed time from the stopwatch timer started by the tic function. The function reads the internal time at the execution of the toc command, and displays the elapsed time since the most recent call to the tic function, in milliseconds.- Returns:
- returns the elapsed time; -1, if tic was not called in advance
-
undo
public static void undo()Undo the last derivation step. -
namedNode
Returns a node having the specifiedname
.- Parameters:
name
- name of a node- Returns:
- a node whose name is
name
, ornull
if no such node exists - See Also:
-
setStatus
Displaystext
in the current status bar.- Parameters:
text
- a text to be displayed
-
chart
Shows the data referenced byds
in a chart panel.type
is one of the constants declared inChartPanel
, this specifies the type of chart.- Parameters:
ds
- reference to aDataset
type
- chart type
-
axisparent
-
isAncestor
Tests whethera
is an ancestor ofd
(ord
itself), i.e., ifa
can be reached fromd
by a backward traversal of edges matchingedgeMask
(seeEdge.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 ancestord
- the potential descendantedgeMask
- the edge mask to use- Returns:
true
iffa
is an ancestor ofd
-
findComplex
Return node that connect ton
with refinement/decomposition edge- Parameters:
n
- : a node in the current groimp graph- Returns:
- Complex node of given node n
-
findComponents
Return nodes that connect fromn
with refinement/decomposition edge- Parameters:
n
- : a node in the current groimp graph- Returns:
- A set of component nodes of given node n
-
findFinestComponents
Return nodes that connect fromn
through one or more refinement/decomposition steps, and without any outgoing decomposition edge.- Parameters:
n
- : a node in the current groimp graph- Returns:
- A set of component nodes of given node n
-
findParent
Return node that connect ton
with successor or branch edge- Parameters:
n
- : a node in the current groimp graph- Returns:
- Parent node of given node n
-
findChildren
Return nodes that connect fromn
with successor or branch edge- Parameters:
n
- : a node in the current groimp graph- Returns:
- A set of child nodes of given node n
-
getCurrentScaleTypesMap
-
addOrUpdateTypeGraph
public static void addOrUpdateTypeGraph() -
getEdgeBit
Returns the GroIMP specific edge bits for a given xml edge type.- Parameters:
type
-- Returns:
-
getScaleNumber
Get the scale number, a given node locates at the scale- Parameters:
node
-- Returns:
- a sequence number that refers to a scale on the current multiscale groimp graph.
-
getRootsAtScale
- Parameters:
scaleNumber
- : a sequence number that refers to a scale on the current multiscale groimp graph. Attention: the scaleNumber counts from from RGGRoot which is 0- Returns:
- a set if root nodes at given scale indicating by a sequence number
-
getNodesAtScale
- Parameters:
scaleNumber
- : a sequence number that refers to a scale on the current multiscale groimp graph. Attention: the scaleNumber counts from from RGGRoot which is 0- Returns:
- a set if nodes at given scale indicating by a sequence number
-
getMaxScaleNumber
public static int getMaxScaleNumber()- Returns:
- the max sequence number on the the current multiscale groimp graph.
-
getGraphScaleNumber
public static int getGraphScaleNumber()Get the amount of scale in current groimp multiscale graph.- Returns:
- an integer stands for the amount of scale
-
getGraphNodes
-
getGraphRoot
-
visitGraphNodes
- Parameters:
set
-node
-
-
findAllNodesAtSameScale
-
visitNodes
Put node into the set and visit child nodes.- Parameters:
set
-node
-
-
irandom
public static int irandom(int min, int max) Returns a uniformly distributed integral pseudorandom number betweenmin
andmax
(inclusive).- Parameters:
min
- minimal valuemax
- maximal value- Returns:
- integral random number between
min
andmax
- See Also:
-
random
public static float random(float min, float max) Returns a uniformly distributed pseudorandom number betweenmin
andmax
.- Parameters:
min
- minimal valuemax
- maximal value- Returns:
- random number between
min
andmax
- See Also:
-
probability
public static boolean probability(float p) Returns the value of aboolean
pseudorandom variable whose probability fortrue
isp
.- Parameters:
p
- probability fortrue
- Returns:
- random value
- See Also:
-
normal
public static float normal(float mu, float sigma) Returns a pseudorandom number which is distributed according to a normal distribution with mean valuemu
and standard deviationsigma
.- Parameters:
mu
- mean valuesigma
- standard deviation- Returns:
- normally distributed random number
- See Also:
-
lognormal
public static double lognormal(double mu, double sigma) -
normal
public static double normal(double mu, double sigma) Returns a pseudorandom number which is distributed according to a normal distribution with mean valuemu
and standard deviationsigma
.- Parameters:
mu
- mean valuesigma
- standard deviation- Returns:
- normally distributed random number
- See Also:
-
distribution
public static int distribution(float[] probabilities) Returns an integral pseudorandom number according to the discrete distributionprobabilities
. The valuei
has the probabilityprobabilities[i]
for0 <= i < probabilities.length
, the valueprobabilities.length
has the remaining probability, i.e., the difference between the sum ofprobabilities
and1
.- Parameters:
probabilities
- array of discrete probabilities- Returns:
- random number according to
probabilities
- See Also:
-
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 byOperators.getRandomGenerator()
within the current thread.- Parameters:
seed
- a seed
-
ancestor
Returns the nearest ancestor ofn
which is an instance oft
. Ancestors are those nodes which can be reached by traversingsuccessor
- orbranch
-edges backwards.- Parameters:
n
- a nodet
- the type so search for- Returns:
- nearest ancestor of type
t
, ornull
-
minDescendants
This generator method yields all descendants ofn
which are instances oft
and which have no other instance oft
in their path ton
. Descendants are those nodes which can be reached by traversingsuccessor
- orbranch
-edges forwards.- Parameters:
cb
- a consumer instance receiving the nodes (provided by the XL compiler)n
- a nodet
- the type to seach for- Returns:
null
-
ancestor
Returns the nearest ancestor ofn
which fulfillscondition
. Ancestors are those nodes which can be reached by traversingsuccessor
- orbranch
-edges backwards.- Parameters:
n
- a nodecondition
- a condition- Returns:
- nearest ancestor fulfilling
condition
, ornull
-
successor
Returns the nearest successor ofn
which fulfillscondition
. Successors are those nodes which can be reached by traversingsuccessor
-edges forwards.- Parameters:
n
- a nodecondition
- a condition- Returns:
- nearest successor fulfilling
condition
, ornull
-
descendants
This generator method yields all descendants ofn
which are instances ofcls
. Descendants are those nodes which can be reached by traversingsuccessor
- orbranch
-edges forwards.- Parameters:
cb
- a consumer instance receiving the nodes (provided by the XL compiler)n
- a nodecls
- the type to seach for- Returns:
null
-
filter
Creates a condition which is fulfilled for an object iff it is an instance of at least one of the specifiedclasses
(or iff it is not an instance in caseisTrue
isfalse
).- Parameters:
classes
- list of classesisTrue
- condition value iff object is an instance of one ofclasses
- Returns:
- a condition
-
transformation
Computes the global coordinate transformation of thenode
. The returned matrix must not be modified.- Parameters:
node
- a node- Returns:
- the node's global coordinate transformation
-
transformation
Computes the global coordinate transformation of thenode
. Ifpost
isfalse
, the transformation of thenode
itself is returned, otherwise the transformation of its children. These may differ ifnode
induces a change of coordinates. The returned matrix must not be modified.- Parameters:
node
- a nodepost
-true
iff the post-transformation (of the node's children) shall be returned- Returns:
- the node's global coordinate transformation
-
location
Computes the location ofnode
in global coordinates. The computed value is written tolocation
. The location is defined by the point (0, 0, 0) in local coordinates of thenode
ifend
isfalse
, or of thenode
's children ifend
istrue
.- Parameters:
loc
- receives the locationnode
- a nodeend
- use location or end location ofnode
-
direction
Computes the growth direction of the turtle atnode
in global coordinates. The computed value is written todirection
. The direction is defined by the direction (0, 0, 1) in local coordinates of thenode
ifend
isfalse
, or of thenode
's children ifend
istrue
.- Parameters:
dir
- receives the directionnode
- a nodeend
- use location or end location ofnode
-
location
Computes the location ofnode
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:
-
toPoint3d
The same aslocation(Node)
. This method is designed as an auto-conversion method.- Parameters:
node
- a node- Returns:
- the
node
's location in global coordinates
-
toTuple3d
-
direction
Computes the growth direction of the turtle atnode
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:
-
extremelocation
-
getShapeExtremePoints
-
endlocation
Computes the end location ofnode
in global coordinates. The end location is defined by the point (0, 0, 0) in local coordinates ofnode
's children.- Parameters:
node
- a node- Returns:
- the
node
's end location in global coordinates - See Also:
-
enddirection
Computes the growth direction of the turtle at the end ofnode
in global coordinates. The direction is defined by the direction (0, 0, 1) in local coordinates ofnode
's children.- Parameters:
node
- a node- Returns:
- the turtle's growth direction at
node
's children - See Also:
-
angle
Computes the rotation angle in degrees of the transformation defined bynode
. 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
-
inclination
-
angle
-
setRandomTransform
public static void setRandomTransform(Null target, Transform3D center, double sigma, double minX, double minY, double maxX, double maxY) -
distanceSquared
Calculate squared distance between node a an node b.- Parameters:
a
- node ab
- node b- Returns:
- squared distance between a and b
-
distance
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 nodeb
- second node- Returns:
- global distance between nodes
-
cone
Returns a cone whose tip is located atorigin
, whose central axis hasdirection
as direction, and whose half opening angle isangle
(in degrees). The cone has no base plane, i.e., it extends to infinity.- Parameters:
origin
- location of the cone's tipdirection
- direction of the cone's axisangle
- half opening angle in degrees- Returns:
- instance of
Cone
corresponding to the specified geometry
-
cone
Returns a cone whose tip is defined by the location ofnode
. Depending onend
, the location or end location ofnode
is used (seelocation(Tuple3d, Node, boolean)
). The axis of the cone points into the local z-direction of the coordinate system ofnode
ornode
's children (again depending onend
). The cone has no base plane, i.e., it extends to infinity.- Parameters:
node
- node which defines the cone's tipend
- use location or end location ofnode
angle
- half opening angle in degrees- Returns:
- instance of
Cone
corresponding to the specified geometry
-
ray
Constructs aLine
which represents a ray emanating atorigin
in the specifieddirection
. Thestart
parameter of the line is set to 0, theend
parameter is set to infinity.- Parameters:
origin
- origin of the raydirection
- direction of the ray- Returns:
- new ray
-
intersect
Compute all intersections betweenline
and the surface ofvolume
. The returned list is valid until the next invocation of this method within the same thread.- Parameters:
line
- a linevolume
- a volume- Returns:
- list containing all intersections of the line and the volume's surface
-
operator$and
This operator method is an alias forintersect(de.grogra.vecmath.geom.Line, de.grogra.vecmath.geom.Volume)
.- Parameters:
line
- a linevolume
- a volume- Returns:
- list containing all intersections of the line and the volume's surface
-
toPoint3d
This autoconversion method returns the first intersection point oflist
, ornull
iflist
is empty. The returned point may be modified.- Parameters:
list
- list of previously computed intersections- Returns:
- first intersection point, or
null
-
height
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 volumex
- global x-coordinatey
- global y-coordinate- Returns:
- height of
volume
at(x, y)
, or 0
-
toLine
Returns a line which corresponds to the central line ofnode
. The central line starts at thelocation(Node)
of the node and extends to theendlocation(Node)
of the node.- Parameters:
node
- a node- Returns:
- central line of the node
-
volume
Returns a volume which corresponds to the shape ofnode
. Ifnode
has no shape, an empty volume is returned.- Parameters:
node
- a node- Returns:
- volume corresponding the
node
's shape
-
distanceToLine
Returns the distance betweenpoint
andline
.- Parameters:
point
- a pointline
- a line- Returns:
- distance between
point
andline
- See Also:
-
intersectionLength
Determines the fraction of theline
which intersects the specifiedcone
.- Parameters:
line
- line to intersectcone
- cone to intersect- Returns:
- fraction of
line
which intersectscone
-
directionalTropism
Computes the rotation matrix which implements a directional tropism towards adirection
. This is done as follows: The matrixm
is interpreted as the transformation matrix from local to global coordinates. Thus, the local z-direction (the growth direction) has the valuev = (m.m02, m.m12, m.m22)
in global coordinates. Now the cross productd = v0 × direction
, wherev0
is the unit vector in direction ofv
, 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 ofm
, andout
is set to a rotation about this transformed direction, its angle being the length ofd
multiplied bye
(in radians).
If the absolute value of the angle is less than1e-10
, no rotation matrix is computed and this method returnsfalse
. Thenout
does not contain a valid rotation matrix and should be ignored. This case happens when the growth direction is (anti-)parallel to the desireddirection
of the tropism.- Parameters:
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 istrue
)- Returns:
true
iff a rotation matrix has been computed
-
positionalTropism
Computes the rotation matrix which implements a positional tropism towards atarget
location. For the details of computation, seedirectionalTropism(de.grogra.vecmath.Matrix34d, javax.vecmath.Tuple3d, float, javax.vecmath.Matrix4d)
, where thedirection
argument is the normalized direction vector from the origin of the local coordinate system(m.m03, m.m13, m.m23)
totarget
.
If, for mathematical reasons, no rotation matrix can be computed or if no rotation is needed because the local growth direction already points totarget
, this method returnsfalse
. In this case,out
does not contain a valid rotation matrix and should be ignored.- Parameters:
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 istrue
)- Returns:
true
iff a rotation matrix has been computed
-
orthogonalTropism
Computes the rotation matrix which implements an orthogonal tropism into a plane perpendicular todirection
. This is done as follows: The matrixm
is interpreted as the transformation matrix from local to global coordinates. Thus, the local z-direction (the growth direction) has the valuev = (m.m02, m.m12, m.m22)
in global coordinates. Now the cross productd = v0 × direction
, wherev0
is the unit vector in direction ofv
, 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 ofm
, andout
is set to a rotation about this transformed direction, its angle being the negated value of the scalar productv0 · direction
multiplied bye
(in radians).
If the absolute value of the angle is less than1e-10
, no rotation matrix is computed and this method returnsfalse
. Thenout
does not contain a valid rotation matrix and should be ignored. This case happens when the growth direction is (anti-)parallel to the desireddirection
of the tropism.- Parameters:
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 istrue
)- Returns:
true
iff a rotation matrix has been computed
-
tropism
Return a new node with a transformation matrix set to the desired tropism.- Parameters:
a
- node containing original orientationdirection
- target direction towards the tropism should orient toe
- strength of the tropism- Returns:
- a node with a transformation set to the requested tropism
- See Also:
-
tropism
Return a new node with a transformation matrix set to the desired tropism.- Parameters:
a
- node containing original orientationtarget
- target location towards the tropism should orient toe
- strength of the tropism- Returns:
- a node with a transformation set to the requested tropism
- See Also:
-
cloneSubgraph
This method clones the subgraph starting atroot
and returns the cloned node which corresponds toroot
. 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:
CloneNotSupportedException
-
cloneNode
- Throws:
CloneNotSupportedException
-
booleanValue
Returns theboolean
value which is wrapped inw
ifw
is an instance ofBooleanNode
. Otherwise this method returns false.- Parameters:
w
- a node- Returns:
- wrapped
boolean
value, or false
-
byteValue
Returns thebyte
value which is wrapped inw
ifw
is an instance ofByteNode
. Otherwise this method returns 0.- Parameters:
w
- a node- Returns:
- wrapped
byte
value, or 0
-
shortValue
Returns theshort
value which is wrapped inw
ifw
is an instance ofShortNode
. Otherwise this method returns 0.- Parameters:
w
- a node- Returns:
- wrapped
short
value, or 0
-
charValue
Returns thechar
value which is wrapped inw
ifw
is an instance ofCharNode
. Otherwise this method returns 0.- Parameters:
w
- a node- Returns:
- wrapped
char
value, or 0
-
intValue
Returns theint
value which is wrapped inw
ifw
is an instance ofIntNode
. Otherwise this method returns 0.- Parameters:
w
- a node- Returns:
- wrapped
int
value, or 0
-
longValue
Returns thelong
value which is wrapped inw
ifw
is an instance ofLongNode
. Otherwise this method returns 0.- Parameters:
w
- a node- Returns:
- wrapped
long
value, or 0
-
floatValue
Returns thefloat
value which is wrapped inw
ifw
is an instance ofFloatNode
. Otherwise this method returns 0.- Parameters:
w
- a node- Returns:
- wrapped
float
value, or 0
-
doubleValue
Returns thedouble
value which is wrapped inw
ifw
is an instance ofDoubleNode
. Otherwise this method returns 0.- Parameters:
w
- a node- Returns:
- wrapped
double
value, or 0
-
objectValue
Returns theObject
value which is wrapped inw
ifw
is an instance ofObjectNode
,NURBSCurve
(aNURBSCurve
node wraps its containedBSplineCurve
) orNURBSSurface
(aNURBSSurface
node wraps its containedBSplineSurface
). Otherwise this method returns null.- Parameters:
w
- a node- Returns:
- wrapped
Object
value, or null
-
isSelected
Determines ifn
has been selected in the workbench by the user.- Parameters:
n
- a node- Returns:
true
iffn
is contained in the current selection
-
function
Returns aFunction
instance which refers to the function namedname
. 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
-
curve
Returns aCurveRef
instance which refers to the curve namedname
. 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
-
surface
Returns aSurfaceRef
instance which refers to the surface namedname
. 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
-
dataset
Returns aDatasetRef
instance which refers to the dataset namedname
. 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
-
shader
Returns aShaderRef
instance which refers to the shader namedname
. 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
-
image
Returns anImageRef
instance which refers to the image namedname
. 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
-
spectrum
Returns aSpectrumRef
instance which refers to the spectrum namedname
. The list of spectra in GroIMP is available in the panel "Object Explorers/Light Spectra".- Parameters:
name
- name of spectrum within GroIMP- Returns:
ImageRef
referring to the named spectrum
-
light
Returns aLightDistributionRef
instance which refers to the light distribution namedname
. The list of light distributionRef in GroIMP is available in the panel "Object Explorers/3D/lights/Light Distribution".- Parameters:
name
- name of light distribution within GroIMP- Returns:
LightDistributionRef
referring to the named light distribution.
-
material
Deprecated. -
file
Returns aFileRef
instance which refers to the file namedname
. The list of files in GroIMP is available in the panel "File Explorer".
Ifname
does not contain the character '/' or the characterIO.SYSTEM_ID_SEPARATOR
,name
is prefixed byIO.PROJECT_FS
followed byIO.SYSTEM_ID_SEPARATOR
. Thus, in this casename
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
-
reference
Returns aReference
instance which refers to the object namedname
. 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
-
exportGraphToFile
Writes the current graph to a file.- Parameters:
fileName
- name of the output file
-
list
public static void list()Prints the JavaDoc description of all available commands on the XL console window. -
list
Prints a list of all available commands starting with the specified sequence.- Parameters:
prefix
- of the commands
-
help
Prints the JavaDoc description of all available commands starting with the specified prefix on the XL console window.- Parameters:
prefix
- of the commands for those the description should be printed
-
makeRenderedImageFlux
Creates a Flux 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
-
makeRenderedImageFlux
Creates a Flux rendered image of the actual scene with the default camera position and a variable image size.- Parameters:
fileName
- name of the output filewidth
-height
-
-
makeRenderedImage
Creates a Twilight 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
Creates a Twilight rendered image of the actual scene with the default camera position and a variable image size.- Parameters:
fileName
- name of the output filewidth
-height
-
-
makeRenderedImageHL
Creates a Twilight rendered image of the actual scene if no View3D instance is available as it is when running headless, using the default camera position and a fixed image size of 800x600.- Parameters:
fileName
- name of the output file
-
makeRenderedImageHL
Creates a Twilight rendered image of the actual scene if no View3D instance is available as it is when running headless, using the default camera position and a variable image size.- Parameters:
fileName
- name of the output filewidth
-height
-
-
makeRenderedImage
Creates a Twilight rendered image of the actual scene with the specified camera and a variable image size.- Parameters:
fileName
- name of the output filecameraName
- name of a specific camerawidth
-height
-
-
getCameraPosition
public static void getCameraPosition(double[] vec) -
getCameraByName
-
makeRenderedImage
Creates a rendered image of the actual scene with the specified camera and a variable image size.- Parameters:
fileName
- name of the output filespecific
- camerawidth
-height
-
-
makeSnapshot
Creates a snapshot of the actual scene.- Parameters:
fileName
- name of the output file
-
setViewCamera
public static void setViewCamera(double rx, double ry, double rz, double tx, double ty, double tz, double scalefactor) Set the position, direction and scaling of the View3D window. Use the function to manually control the viewing angle, zoom and position. E.g., setViewCamera(-1.0,0,0.7, 0,-0.5,-5, 0.5);- Parameters:
rx
- rotation about the x-axes [rad]ry
- rotation about the y-axes [rad]rz
- rotation about the z-axes [rad]tx
- translation along the x-axes [m]ty
- translation along the y-axes [m]tz
- translation along the z-axes [m]scalefactor
- [-]
-
export3DScene
public static void export3DScene(String fileName, String format, Boolean onlyVisibleLayer) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException Exports the current 3D scene to the specified target file and format. Currently supported formats of target files: - dxf - x3d - mtg - stl - ply - obj - tex - webgl- Parameters:
fileName
- name of the output fileformat
- target file formatvisibleLayer
- export only the visibleLayer?- Throws:
InvocationTargetException
IllegalAccessException
InstantiationException
NoSuchMethodException
-
export3DScene
public static void export3DScene(File file, String format, Boolean onlyVisibleLayer) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException Exports the current 3D scene to the specified target file and format. Checkexport3DScene
for a subgraph 3d export. Currently supported formats of target files: - dxf - x3d - mtg - stl - ply - obj - tex - webgl- Parameters:
file
- output fileformat
- target file formatvisibleLayer
- export only the visibleLayer?- Throws:
InvocationTargetException
IllegalAccessException
InstantiationException
NoSuchMethodException
-
export3DScene
public static void export3DScene(String fileName, MimeType format, Boolean onlyVisibleLayer) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException Exports the current 3D scene to the specified target file and format.- Parameters:
fileName
- name of the output fileformat
- target file formatonlyVisibleLayer
- export only the visibleLayer?- Throws:
InvocationTargetException
IllegalAccessException
InstantiationException
NoSuchMethodException
-
export3DScene
public static void export3DScene(File file, MimeType format, Boolean onlyVisibleLayer) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException Exports the current 3D scene to the specified target file and format.- Parameters:
fileName
- name of the output fileformat
- target file formatonlyVisibleLayer
- export only the visibleLayer?- Throws:
InvocationTargetException
IllegalAccessException
InstantiationException
NoSuchMethodException
-
export3DScene
public static void export3DScene(String fileName, String format) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException Exports the current 3D scene to the specified target file and format. Checkexport3DScene
for a subgraph 3d export. Currently supported formats of target files: - dxf - x3d - mtg - stl - ply - obj - tex - webgl- Parameters:
fileName
- name of the output fileformat
- target file formatvisibleLayer
- export only the visibleLayer?- Throws:
InvocationTargetException
IllegalAccessException
InstantiationException
NoSuchMethodException
-
export3DScene
public static void export3DScene(File file, String format) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException Exports the current 3D scene to the specified target file and format. Checkexport3DScene
for a subgraph 3d export. Currently supported formats of target files: - dxf - x3d - mtg - stl - ply - obj - tex - webgl- Parameters:
file
- output fileformat
- target file formatvisibleLayer
- export only the visibleLayer?- Throws:
InvocationTargetException
IllegalAccessException
InstantiationException
NoSuchMethodException
-
export3DScene
public static void export3DScene(File file, String format, Node root) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException Exports the specified root node and its children to the specified target file and format. Based onexport3DScene
Checkexport3DScene
for other 3d export options. Currently supported formats of target files: - dxf - x3d - mtg - stl - ply - obj - tex - webgl- Parameters:
file
- output fileformat
- target file formatvisibleLayer
- export only the visibleLayer?- Throws:
InvocationTargetException
IllegalAccessException
InstantiationException
NoSuchMethodException
-
export3DScene
public static void export3DScene(String fileName, String format, Node root) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException Exports the specified root node and its children to the specified target file and format. Checkexport3DScene
for other 3d export options. Currently supported formats of target files: - dxf - x3d - mtg - stl - ply - obj - tex - webgl- Parameters:
file
- output fileformat
- target file formatroot
- the root node of the exported graph- Throws:
InvocationTargetException
IllegalAccessException
InstantiationException
NoSuchMethodException
-
leaf
Returns a new, rectangular instance ofParallelogram
created by the constructor invocationParallogram(length, width)
and havingRGBAShader.GREEN
as its shader.- Parameters:
length
- length of rectanglewidth
- width of rectangle- Returns:
- green rectangle
-
leaf3d
Return aMeshNode
in shape of a 3d leaf.- Returns:
- mash of the default 3d leaf
-
leaf3d
Return aMeshNode
in shape of it indicated default leaf.- Parameters:
id
- of the indicated leaf- Returns:
- mash of the default 3d leaf
-
leaf3d
Return aMeshNode
in shape of it indicated list of points. The list of points will be automatically triangulated and returned asMeshNode
. pointlist={x1,y1,z1, ..., xn,yn,zn).- Parameters:
pointlist
-- Returns:
- mash of the pointlist
-
triangulate
Return aMeshNode
in shape of it indicated list of points. The list of points will be automatically triangulated and returned asMeshNode
. pointlist={x1,y1,z1, ..., xn,yn,zn). First point p0={x1,y1,z1}, faces between {{p0,p1,p2}, {p0,p2,p3}, {p0,p3,p4}, ...}- Parameters:
pointlist
-- Returns:
- mash of the pointlist
-
getAreaOfNonTriangulation
public static double getAreaOfNonTriangulation(float[] pointlist) Calculates the area of the surface generated by the specified list of points. The list of points will be automatically triangulated. pointlist={x1,y1,z1, ..., xn,yn,zn). First point p0={x1,y1,z1}, faces between {{p0,p1,p2}, {p0,p2,p3}, {p0,p3,p4}, ...} Note: Calculation will be wrong, when the described shape is too concave. the resulting area will be too large in this case.- Parameters:
pointlist
-- Returns:
- area
-
getAreaOfTriangulation
public static double getAreaOfTriangulation(float[] pointlist) Calculates the area of the surface generated by the specified list of points. It is assumed, that the list of points is triangulated. pointlist={x1,y1,z1, ..., xn,yn,zn). First point p0={x1,y1,z1}, faces between {{p0,p1,p2}, {p3,p4,p5}, {p6,p7,p8}, ...}- Parameters:
pointlist
-- Returns:
- area
-
getAreaOfTriangulation
public static double getAreaOfTriangulation(float scaleX, float scaleY, float scaleZ, float[] pointlist) Calculates the area of the surface generated by the specified list of points. It is assumed, that the list of points is triangulated. pointlist={x1,y1,z1, ..., xn,yn,zn). First point p0={x1,y1,z1}, faces between {{p0,p1,p2}, {p3,p4,p5}, {p6,p7,p8}, ...} Before the area calculation takes please a scaling is performed.- Parameters:
scaling
- factor Xscaling
- factor Yscaling
- factor Zpointlist
-- Returns:
- area
-
getMesh
Return aMeshNode
in shape of it indicated list of points. The list of points has to be triangulated.- Parameters:
vertexData
-- Returns:
- mash of the vertexData
-
triangulate
Return aMeshNode
in shape of it indicated list of points. The list of points will be automatically triangulated and returned asMeshNode
. pointlist={x1,y1,z1, ..., xn,yn,zn). First point p0={x1,y1,z1}, faces between {{p0,p1,p2}, {p0,p2,p3}, {p0,p3,p4}, ...}- Parameters:
pointlist
-- Returns:
- mash of the pointlist
-
getAreaOfNonTriangulation
Calculates the area of the surface generated by the specified list of points. The list of points will be automatically triangulated. pointlist={x1,y1,z1, ..., xn,yn,zn). First point p0={x1,y1,z1}, faces between {{p0,p1,p2}, {p0,p2,p3}, {p0,p3,p4}, ...}- Parameters:
pointlist
-- Returns:
- area
-
getAreaOfTriangulation
Calculates the area of the surface generated by the specified list of points. It is assumed, that the list of points is triangulated. pointlist={x1,y1,z1, ..., xn,yn,zn). First point p0={x1,y1,z1}, faces between {{p0,p1,p2}, {p3,p4,p5}, {p6,p7,p8}, ...}- Parameters:
pointlist
-- Returns:
- area
-
getMesh
Return aMeshNode
in shape of it indicated list of points. The list of points has to be triangulated.- Parameters:
vertexData
-- Returns:
- mash of the vertexData
-
getMesh
Returns aMeshNode
as visualization of the given convex hull.- Parameters:
hull
-- Returns:
- mash of the vertexData
-
getMesh
Return aMeshNode
in shape of it indicated list of points. The list of points has to be triangulated.- Parameters:
pointlist
-- Returns:
- mash of the vertexData
-
getMesh
Return aMeshNode
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.- Parameters:
pointlist
-- Returns:
- mash of the vertexData
-
getSurfaceArea
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. Keep in mind, that the getSurfaceArea function is only implemented for basic primitive object. For all other objects it will return zero.- Returns:
- volume
-
getVolume
Calculates the volume of all nodes of the subgraph with the node root as root node. Intersection with other object are not considered.The total volume will be calculated. Keep in mind, that the getVolume function is only implemented for basic primitive object. For all other objects it will return zero.- Returns:
- volume
-
getClosesedObject
Finds the colosed (euclidian distance) object of typeShadedNull
to the parametern
. If there are several nodes with the same shortesed distance, only the first one will be returned- Parameters:
n
- node from for that the closesed neightbour should be searched.- Returns:
- instance of the closesed node
-
getClosesedObject
Finds the colosed (euclidian distance) object of typecls
to the parametern
. If there are several nodes with the same shortesed distance, only the first one will be returned- Parameters:
n
- node from for that the closesed neightbour should be searched.cls
- class/type of the wanted node to be found- Returns:
- instance of the closesed node
-
repaintView3D
public static void repaintView3D()Repaints the View3D panel. When repaint of View3D is deactivated it will be reactivated, repainted and disabled again. Makes use of Dummy nodes (and/or artificial changes of the graph to trigger an repaint) unnecessary. -
disableView3DRepaint
public static void disableView3DRepaint()Disables repaint of View3D panel. -
enableView3DRepaint
public static void enableView3DRepaint()Enables repaint of View3D panel after it was deactivated withdisableView3DRepaint()
. -
convexhull
Constructs the convex hull of a set of points.- Parameters:
points
- input points
-
convexhull
Constructs the convex hull of a set of coordinates. Assuming 3 values for each point: {x0,y0,z0, x1,y1,z1, ...}- Parameters:
points
- input points
-
convexhull
Constructs the convex hull of a set of coordinates. Assuming 3 values for each point: {x0,y0,z0, x1,y1,z1, ...}- Parameters:
points
- input pointsdebug
- flag
-
convexhull
Constructs the convex hull of all points that can be reached starting from the indicated root node (including the root node). Only "visible" nodes (nodes instance of ShadedNull) will be take into account. The location (Library.location(Node)
) of each node will be taken as position.- Parameters:
points
- input points
-
convexhull
Constructs the convex hull of all points that can be reached starting from the indicated root node. Only "visible" nodes (nodes instance of ShadedNull) will be take into account. The location (Library.location(Node)
) of each node will be taken as position.- Parameters:
points
- input pointsincluderoot
- input points
-
convexhull
-
boundingBox
-
boundingBoxCoordinates
Calculates the coordinates of the bounding box starting from the root Node.- Parameters:
root
-includeroot
-- Returns:
- {minX, maxX, minY, maxY, minZ, maxZ}
-
getComponentBasedABBHull
-
getComponentBasedConvexhull
public static QuickHull3D getComponentBasedConvexhull(Node complexNode, boolean finestComponentBased) -
markVertices
Marks all vertices with a Sphere of the givenQuickHull3D
.- Parameters:
hull
-
-
markVertices
Marks all vertices with a Sphere of the specifiedradius
and of the givenQuickHull3D
.- Parameters:
hull
-radius
-
-
markPoints
Marks all points with a Sphere of the givenQuickHull3D
.- Parameters:
hull
-
-
markPoints
Marks all points with a Sphere of the specifiedradius
and of the givenQuickHull3D
.- Parameters:
hull
-radius
-
-
markPoints
Marks all points of the specified array with a Sphere of the specifiedradius
and shader.- Parameters:
hull
-radius
-shader
-
-
markPoints
Marks all points of the specified array with a Sphere of the specifiedradius
and shader. Additionally a TextLabel with a consecutive number can be applyed.- Parameters:
hull
-radius
-shader
-label
-
-
ColorBar
Generates a ColorBar as sequence of 100 Cylinder objects based on the passed ColorGradient instance. hight 1m, radius=0.1m- Parameters:
cg
- instance of the ColorGradientlabel
- flag to indicate labeling- Returns:
- root node of the sequence
-
MeasuringStick
Creates a measuring stick as sequence of steps Cylinder opjects.- Parameters:
steps
- number of stepsstepsize
- hight of each Cylinderlabel
- flag to indicate labeling- Returns:
- root node of the sequence
-
getXYProjection
Constructs the selected XY-projection of all points that can be reached starting from the indicated root node. Only "visible" nodes (nodes instance of ShadedNull) will be take into account. The location (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 ofalpha
(Note: In case the alpha shape is not connected, only the first polygon will be returned)
- Parameters:
root
- nodemethod
- of projectionalpha
- value, only used for alpha shapes
-
getXYProjection
Constructs the selected XY-projection of all points in the list. Currently implemented methods: CONVEXHULL .. the convex hull BOUNDING_RECTANGLE .. bounding rectangle ALPHA_SHAPE .. alpha shape with alpha ofalpha
(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))
- Parameters:
input
- pointsmethod
- of projectionalpha
- value, only used for alpha shapes
-
getBoundingRectangle
Calculates the bounding rectangle of the given array of points. Returns an array of points: [centroid, (maxX,maxY,0), (minX,maxY,0), (minX,minY,0), (maxX,minY,0), (maxX,maxY,0)}; (Repeatation of the first point to close the area (during triangulation))- Parameters:
points
-- Returns:
- array of points
-
getConvexHull2D
Calculates the convex hull of the given array of points. Returns an array of points: [centroid, p0, p1, p2, ..., pn, p0}; (Repeatation of the first point to close the area (during triangulation))- Parameters:
points
-- Returns:
- array of points
-
getAlphaShape
Calculates the alhpa shape of the given array of points considerring the choosn alpah value. Returns a List of Vectors of Point3d. Each Vector contains the points of one polygon. In case the resoulting surface is not coherent the List will contain more then one Vector.- Parameters:
points
-alpha
- value- Returns:
- List of Vectors of Point3d, one Vector for each polegon of the surface
-
getAlphaShape
Calculates the alhpa shape of all (visible) nodes that can be reached from the given root Node considerring the choosn alpah value. Returns a List of Vectors of Point3d. Each Vector contains the points of one polygon. In case the resoulting surface is not coherent the List will contain more then one Vector.- Parameters:
points
-alpha
- value- Returns:
- List of Vectors of Point3d, one Vector for each polegon of the surface
-
Surface
Deprecated. -
Surface
Deprecated. -
Surface
Deprecated. -
Surface
Deprecated. -
Surface
Deprecated. -
Surface
Deprecated. -
Surface
Deprecated. -
visualizeAsColor
Returns a color shader whose color represents the value ofx
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
-
print
Printsv
with the specified colour to the XL console.- Parameters:
v
- an objectcolor
- selected printing color (black = 0x000000)
-
print
Printsv
to the XL console.- Parameters:
v
- an object
-
println
Printsv
with the specified colour to the XL console, then terminates the line.- Parameters:
v
- an objectcolor
- selected printing color (black = 0x000000)
-
println
Printsv
to the XL console, then terminates the line.- Parameters:
v
- an object
-
clearConsole
public static void clearConsole()Clears the current console. -
getTimeForRepaint
public static double getTimeForRepaint()Determine the time for one repaint of the 3D View window.- Returns:
- time in milliseconds [ms]
-
getTimeForTraversingGraph
public static double getTimeForTraversingGraph()Determine the time for traversing the whole graph (touching each node once).- Returns:
- time in milliseconds [ms]
-
getGraphSize
public static int getGraphSize()Number of nodes in the main graph. same as count((* Node *))- Returns:
- int, size of the graph
-
getSceneGraphSize
public static int getSceneGraphSize()Number of nodes in the scene graph. * same as count((* ShadedNull *))- Returns:
- int, size of the graph
-
operator$shl
This operator method printsv
onw
.- Parameters:
w
- a writerv
- value to be printed onw
- Returns:
w
-
println
public static void println()Terminate the current line by writing the line separator string. -
print
public static void print(boolean v) Printsv
to the XL console.- Parameters:
v
- value to be printed
-
println
public static void println(boolean v) Printsv
to the XL console, then terminates the line.- Parameters:
v
- value to be printed
-
operator$shl
This operator method printsv
onw
.- Parameters:
w
- a writerv
- value to be printed onw
- Returns:
w
-
print
public static void print(char v) Printsv
to the XL console.- Parameters:
v
- value to be printed
-
println
public static void println(char v) Printsv
to the XL console, then terminates the line.- Parameters:
v
- value to be printed
-
operator$shl
This operator method printsv
onw
.- Parameters:
w
- a writerv
- value to be printed onw
- Returns:
w
-
print
public static void print(int v) Printsv
to the XL console.- Parameters:
v
- value to be printed
-
println
public static void println(int v) Printsv
to the XL console, then terminates the line.- Parameters:
v
- value to be printed
-
operator$shl
This operator method printsv
onw
.- Parameters:
w
- a writerv
- value to be printed onw
- Returns:
w
-
print
public static void print(long v) Printsv
to the XL console.- Parameters:
v
- value to be printed
-
println
public static void println(long v) Printsv
to the XL console, then terminates the line.- Parameters:
v
- value to be printed
-
operator$shl
This operator method printsv
onw
.- Parameters:
w
- a writerv
- value to be printed onw
- Returns:
w
-
print
public static void print(float v) Printsv
to the XL console.- Parameters:
v
- value to be printed
-
println
public static void println(float v) Printsv
to the XL console, then terminates the line.- Parameters:
v
- value to be printed
-
operator$shl
This operator method printsv
onw
.- Parameters:
w
- a writerv
- value to be printed onw
- Returns:
w
-
print
public static void print(double v) Printsv
to the XL console.- Parameters:
v
- value to be printed
-
println
public static void println(double v) Printsv
to the XL console, then terminates the line.- Parameters:
v
- value to be printed
-
operator$shl
This operator method printsv
onw
.- Parameters:
w
- a writerv
- value to be printed onw
- Returns:
w
-
operator$index
This operator method is an alias forfunc.evaluateFloat(x)
.- Parameters:
func
- a functionx
- argument to the function- Returns:
- evaluation of
func
atx
-
operator$shl
This operator method addsvalue
as last element tolist
.- Parameters:
list
- a listvalue
- value to add as last element- Returns:
list
-
operator$index
-
operator$in
This operator method returnstrue
iffset
is notnull
andset.contains(value)
returnstrue
.- Parameters:
value
- a valueset
- a collection- Returns:
true
iffvalue
is inset
-
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, andsynth
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 tosynth
.- Type Parameters:
T
- the type of nodes- Parameters:
root
- 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 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, andsynth
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 tosynth
.- Type Parameters:
T
- the type of nodes- Parameters:
root
- 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 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, andsynth
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 tosynth
.- Type Parameters:
T
- the type of nodes- Parameters:
root
- 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 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, andsynth
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 tosynth
.- Type Parameters:
T
- the type of nodes- Parameters:
root
- 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 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, andsynth
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 tosynth
.- Type Parameters:
T
- the type of nodes- Parameters:
root
- 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 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, andsynth
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 tosynth
.- Type Parameters:
T
- the type of nodes- Parameters:
root
- 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 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, andsynth
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 tosynth
.- Type Parameters:
T
- the type of nodes- Parameters:
root
- 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 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, andsynth
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 tosynth
.- Type Parameters:
T
- the type of nodes- Parameters:
root
- 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 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, andsynth
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 tosynth
.- Type Parameters:
T
- the type of nodesV
- the type of values of the synthesized attribute- Parameters:
root
- 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 children- Returns:
- value of synthesized attribute at
root
-
operator$index
This operator method is an alias forlist.get(index)
.- Parameters:
list
- a listindex
- an index- Returns:
- element at
index
inlist
-
operator$shl
This operator method addsvalue
as last element tolist
.- Parameters:
list
- a listvalue
- value to add as last element- Returns:
list
-
operator$index
-
operator$index
This operator method is an alias forlist.get(index)
.- Parameters:
list
- a listindex
- an index- Returns:
- element at
index
inlist
-
operator$shl
This operator method addsvalue
as last element tolist
.- Parameters:
list
- a listvalue
- value to add as last element- Returns:
list
-
operator$index
-
operator$index
This operator method is an alias forlist.get(index)
.- Parameters:
list
- a listindex
- an index- Returns:
- element at
index
inlist
-
operator$shl
This operator method addsvalue
as last element tolist
.- Parameters:
list
- a listvalue
- value to add as last element- Returns:
list
-
operator$index
-
operator$index
This operator method is an alias forlist.get(index)
.- Parameters:
list
- a listindex
- an index- Returns:
- element at
index
inlist
-
operator$shl
This operator method addsvalue
as last element tolist
.- Parameters:
list
- a listvalue
- value to add as last element- Returns:
list
-
operator$index
-
operator$index
This operator method is an alias forlist.get(index)
.- Parameters:
list
- a listindex
- an index- Returns:
- element at
index
inlist
-
operator$shl
This operator method addsvalue
as last element tolist
.- Parameters:
list
- a listvalue
- value to add as last element- Returns:
list
-
operator$index
-
operator$index
This operator method is an alias forlist.get(index)
.- Parameters:
list
- a listindex
- an index- Returns:
- element at
index
inlist
-
operator$shl
This operator method addsvalue
as last element tolist
.- Parameters:
list
- a listvalue
- value to add as last element- Returns:
list
-
operator$index
-
operator$index
This operator method is an alias forlist.get(index)
.- Parameters:
list
- a listindex
- an index- Returns:
- element at
index
inlist
-
operator$shl
This operator method addsvalue
as last element tolist
.- Parameters:
list
- a listvalue
- value to add as last element- Returns:
list
-
operator$index
-
operator$index
This operator method is an alias forlist.get(index)
.- Parameters:
list
- a listindex
- an index- Returns:
- element at
index
inlist
-
operator$shl
This operator method addsvalue
as last element tolist
.- Parameters:
list
- a listvalue
- value to add as last element- Returns:
list
-
operator$index
-
operator$index
This operator method is an alias fornode.getChild(index)
.- Parameters:
node
- a nodeindex
- an index- Returns:
index
-th child ofcode
- See Also:
-
operator$lt
This operator method compares two nodes based on their id: It returnstrue
iffa.getId () < b.getId ()
.- Parameters:
a
- a nodeb
- another node- Returns:
a.getId () < b.getId ()
- See Also:
-
operator$le
This operator method compares two nodes based on their id: It returnstrue
iffa.getId () <= b.getId ()
.- Parameters:
a
- a nodeb
- another node- Returns:
a.getId () <= b.getId ()
- See Also:
-
operator$gt
This operator method compares two nodes based on their id: It returnstrue
iffa.getId () > b.getId ()
.- Parameters:
a
- a nodeb
- another node- Returns:
a.getId () > b.getId ()
- See Also:
-
operator$ge
This operator method compares two nodes based on their id: It returnstrue
iffa.getId () >= b.getId ()
.- Parameters:
a
- a nodeb
- another node- Returns:
a.getId () >= b.getId ()
- See Also:
-
operator$index
This operator method applies the functionf
to noden
. It is an alias forf.get(n)
.- Parameters:
n
- a nodef
- a function of nodes- Returns:
- evaluation of
f
atn
-
operator$index
This operator method applies the functionf
to noden
. It is an alias forf.get(n)
.- Parameters:
n
- a nodef
- a function of nodes- Returns:
- evaluation of
f
atn
-
operator$index
This operator method applies the functionf
to noden
. It is an alias forf.get(n)
.- Parameters:
n
- a nodef
- a function of nodes- Returns:
- evaluation of
f
atn
-
operator$index
This operator method returns the location ofn
. It is an alias forlocation(n)
.- Parameters:
n
- a nodel
- dummy parameter, its value is ignored- Returns:
- location of
n
in global coordinates - See Also:
-
mean
This aggregate method computes the mean of a sequence ofTuple3f
's.- Parameters:
a
- aggregate instance (provided by the XL compiler)value
- a value of the sequence of values
-
mean
This aggregate method computes the mean of a sequence ofTuple3d
's.- Parameters:
a
- aggregate instance (provided by the XL compiler)value
- a value of the sequence of values
-
plot
-
plot
-
toObjectToDouble
-
plot
-
plotPoints
-
range
-
range
-
select
-
apply
This finish iterator (see the XL Language Specification) is used in afor
-statement to execute its bodycount
times. Each execution is surrounded by a transformation boundary (seederive()
).- Parameters:
count
- number of iterations- Returns:
- a finish iterator
-
applyUntilFinished
This finish iterator (see the XL Language Specification) is used in afor
-statement to execute its body as long as the body makes modifications to the graph. Each execution is surrounded by a transformation boundary (seederive()
).- Returns:
- a finish iterator
-
passBoundary
Deprecated.replaced byderive()
-
apply
Deprecated.replaced byderive()
-
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. -
newGRSVertices
-
interpretiveRules
-
removeInterpretiveNodes
public static void removeInterpretiveNodes() -
moveToExtent
Sets theextentIndex
property ofroot
and its subgraph spanned byEdgePatternImpl.TREE
toindex
. Ifps
isnull
, the property is modified as part of the active transaction of the graph. Otherwise, thePropertyQueue
ofps
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, ornull
root
- root node of subgraphindex
- new value of theextentTail
property of the nodes
-
hide
Hides the subgraph starting atroot
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 theRGGRoot
of this graph, the connection being established by an edge of typeGraph.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
-
mergeTransformations
This method replaces chains of transformation nodes with singleNull
nodes which perform the aggregated transformation of the chains. This is the same asmergeTransformations(root, null)
.- Parameters:
root
- root node of subgraph where chains should be replacedallowShape
- store aggregated transformation in shape node at chain end if possible- See Also:
-
mergeNonTropismTransformations
This method replaces chains of transformation nodes with singleNull
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 asmergeNonTropismTransformations(root, null)
.- Parameters:
root
- root node of subgraph where chains should be replacedallowShape
- store aggregated transformation in shape node at chain end if possible- See Also:
-
mergeNonTropismTransformations
public static void mergeNonTropismTransformations(Node root, ObjectToBoolean<? super Node> filter, boolean allowShape) This method replaces chains of transformation nodes passingfilter
with singleNull
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 ofTropism
.- Parameters:
root
- root node of subgraph where chains should be replacedfilter
- only merge nodes which pass this filter. Ifnull
is specified, every non-tropism transformation node is considered for merging- See Also:
-
mergeTransformations
public static void mergeTransformations(Node root, ObjectToBoolean<? super Node> filter, boolean allowShape) This method replaces chains of transformation nodes passingfilter
with singleNull
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 passesfilter
and is part of a chain of such nodes, this chain will be replaced by an equivalent single node of classNull
.- Parameters:
root
- root node of subgraph where chains should be replacedfilter
- only merge nodes which pass this filter. Ifnull
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 newNull
node)
-
removeTransformationLeaves
Removes all leaf nodes from the graph which are pure transformation nodes (seeremoveTransformationLeaves(Node, ObjectToBoolean)
).- Parameters:
root
- root node of subgraph whose leaves shall be removed- See Also:
-
removeTransformationLeaves
Removes all leaf nodes from the graph which are pure transformation nodes and which passfilter
, starting atroot
(seeremoveLeaves(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.- Parameters:
root
- root node of subgraph whose leaves shall be removedfilter
- only leaf nodes which pass this filter are removed. Ifnull
, all transformation nodes are considered- See Also:
-
removeLeaves
Removes all leaf nodes from the graph which passfilter
, starting atroot
. A leaf is a node which can be reached from theroot
by traversingbranch
orsuccessor
edges in forward direction and which has no outgoing edge. If a node which passesfilter
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 passfilter
.- Parameters:
root
- root node of subgraph whose leaves shall be removedfilter
- only leaf nodes which pass this filter are removed
-
statistics
This aggregate method computes aStatistics
object for a series of valuesa
.- Parameters:
a
- aggregate instance (provided by the XL compiler)value
- a value of the sequence of values- Returns:
- statistics of the series of values
-
defer
Put runnable into modification queue and execute later when derive() is called.- Parameters:
r
-
-
randomDirection
Pick a random point on the surface of a unit sphere and return it as direction vector.- Returns:
- random uniformly distributed direction vector
-
getPathToProjectDirectory
Return the relative path to the current opened workbench. The path leads to the .gs or .gsz opened. If the project has not been saved yet, or that the path is set to null. It returns the path to the Home directory. -
getWD
Short for the method getPathToProjectDirectory(). Return the relative path to the current opened workbench. The path leads to the .gs or .gsz opened. If the project has not been saved yet, or that the path is set to null. It returns the path to the Home directory. -
getPathToHomeDirectory
Return the path to the home directory. Independent from the OS used. -
getPathToProjectFileSystem
-
getFileFromProject
return the object of a file in the Project from its name. The returned object is of type File if the project is saved as a .gs. And of type MemoryFileSystem.File if the project is either not saved or saved as .gsz -
getInputStreamFromProject
Return the input stream of a file from the project. The input stream MUST be closed.- Throws:
IOException
-
getOutputStreamFromProject
public static OutputStream getOutputStreamFromProject(String fileName, boolean add) throws IOException Return the output stream of a file from the project. The output stream MUST be closed.- Throws:
IOException
-
derive()