Module rgg
Package de.grogra.rgg

Class Library

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

public class Library extends Object
This class contains a collection of methods and constants which are useful in RGG modelling, especially in 3D.
Author:
Ole Kniemeyer
  • Field Details

  • Constructor Details

    • Library

      public Library()
  • Method Details

    • console

      public static Console console()
      Returns the currently active Console. This may return null.
      Returns:
      current console or null
    • workbench

      public static Workbench workbench()
      Returns the currently active Workbench. This may return null.
      Returns:
      current workbench or null
    • closeWorkbench

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

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

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

      public static GraphManager getMetaGraph()
      Returns the current meta/registry graph, i.e., the meta/registry graph of the currently active Workbench. This may return null.
      Returns:
      current meta/registry graph or null
    • graphState

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

      @Deprecated public static RGGGraph extent()
      Deprecated.
    • rggGraph

      public static RGGGraph rggGraph()
    • allowNoninjectiveMatchesByDefault

      public static void allowNoninjectiveMatchesByDefault(boolean value)
    • allowNoninjectiveMatchesForNextQuery

      @Deprecated public static void allowNoninjectiveMatchesForNextQuery(boolean value)
      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

      public static Node namedNode(String name)
      Returns a node having the specified name.
      Parameters:
      name - name of a node
      Returns:
      a node whose name is name, or null if no such node exists
      See Also:
    • setStatus

      public static void setStatus(String text)
      Displays text in the current status bar.
      Parameters:
      text - a text to be displayed
    • chart

      public static void chart(DatasetRef ds, int type)
      Shows the data referenced by ds in a chart panel. type is one of the constants declared in ChartPanel, this specifies the type of chart.
      Parameters:
      ds - reference to a Dataset
      type - chart type
    • axisparent

      public static Node axisparent(Node child)
    • isAncestor

      public static boolean isAncestor(Node a, Node d, int edgeMask)
      Tests whether a is an ancestor of d (or d itself), i.e., if a can be reached from d by a backward traversal of edges matching edgeMask (see Edge.testEdgeBits(int)). Note that this method expects the relevant part of the subgraph spanned by matching edges to be a tree.
      Parameters:
      a - the potential ancestor
      d - the potential descendant
      edgeMask - the edge mask to use
      Returns:
      true iff a is an ancestor of d
    • findComplex

      public static Node findComplex(Node n)
      Return node that connect to n with refinement/decomposition edge
      Parameters:
      n - : a node in the current groimp graph
      Returns:
      Complex node of given node n
    • findComponents

      public static Set<Node> findComponents(Node n)
      Return nodes that connect from n with refinement/decomposition edge
      Parameters:
      n - : a node in the current groimp graph
      Returns:
      A set of component nodes of given node n
    • findFinestComponents

      public static Set<Node> findFinestComponents(Node n)
      Return nodes that connect from n 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

      public static Node findParent(Node n)
      Return node that connect to n with successor or branch edge
      Parameters:
      n - : a node in the current groimp graph
      Returns:
      Parent node of given node n
    • findChildren

      public static Set<Node> findChildren(Node n)
      Return nodes that connect from n 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

      public static HashMap<Integer,Set<ManageableType>> getCurrentScaleTypesMap()
    • addOrUpdateTypeGraph

      public static void addOrUpdateTypeGraph()
    • getEdgeBit

      public static int getEdgeBit(String type)
      Returns the GroIMP specific edge bits for a given xml edge type.
      Parameters:
      type -
      Returns:
    • getScaleNumber

      public static int getScaleNumber(Node node)
      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

      public static Set<Node> getRootsAtScale(int scaleNumber)
      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

      public static Set<Node> getNodesAtScale(int scaleNumber)
      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

      public static Set<Node> getGraphNodes()
    • getGraphRoot

      public static Node getGraphRoot()
    • visitGraphNodes

      public static void visitGraphNodes(Set<Node> set, Node node)
      Parameters:
      set -
      node -
    • findAllNodesAtSameScale

      public Set<Node> findAllNodesAtSameScale(Node n)
    • visitNodes

      public void visitNodes(Set<Node> set, Node node)
      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 between min and max (inclusive).
      Parameters:
      min - minimal value
      max - maximal value
      Returns:
      integral random number between min and max
      See Also:
    • random

      public static float random(float min, float max)
      Returns a uniformly distributed pseudorandom number between min and max.
      Parameters:
      min - minimal value
      max - maximal value
      Returns:
      random number between min and max
      See Also:
    • probability

      public static boolean probability(float p)
      Returns the value of a boolean pseudorandom variable whose probability for true is p.
      Parameters:
      p - probability for true
      Returns:
      random value
      See Also:
    • normal

      public static float normal(float mu, float sigma)
      Returns a pseudorandom number which is distributed according to a normal distribution with mean value mu and standard deviation sigma.
      Parameters:
      mu - mean value
      sigma - standard deviation
      Returns:
      normally distributed random number
      See Also:
    • 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 value mu and standard deviation sigma.
      Parameters:
      mu - mean value
      sigma - 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 distribution probabilities. The value i has the probability probabilities[i] for 0 <= i < probabilities.length, the value probabilities.length has the remaining probability, i.e., the difference between the sum of probabilities and 1.
      Parameters:
      probabilities - array of discrete probabilities
      Returns:
      random number according to probabilities
      See Also:
    • setSeed

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

      public static <C extends Node> C ancestor(Node n, Class<C> t)
      Returns the nearest ancestor of n which is an instance of t. Ancestors are those nodes which can be reached by traversing successor- or branch-edges backwards.
      Parameters:
      n - a node
      t - the type so search for
      Returns:
      nearest ancestor of type t, or null
    • minDescendants

      public static <T> Node minDescendants(ObjectConsumer<? super T> cb, Node n, Class<T> t)
      This generator method yields all descendants of n which are instances of t and which have no other instance of t in their path to n. Descendants are those nodes which can be reached by traversing successor- or branch-edges forwards.
      Parameters:
      cb - a consumer instance receiving the nodes (provided by the XL compiler)
      n - a node
      t - the type to seach for
      Returns:
      null
    • ancestor

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

      public static Node successor(Node n, ObjectToBoolean<? super Node> condition)
      Returns the nearest successor of n which fulfills condition. Successors are those nodes which can be reached by traversing successor-edges forwards.
      Parameters:
      n - a node
      condition - a condition
      Returns:
      nearest successor fulfilling condition, or null
    • descendants

      public static <T> Node descendants(ObjectConsumer<? super T> cb, Node n, Class<T> cls)
      This generator method yields all descendants of n which are instances of cls. Descendants are those nodes which can be reached by traversing successor- or branch-edges forwards.
      Parameters:
      cb - a consumer instance receiving the nodes (provided by the XL compiler)
      n - a node
      cls - the type to seach for
      Returns:
      null
    • filter

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

      public static Matrix34d transformation(Node node)
      Computes the global coordinate transformation of the node. The returned matrix must not be modified.
      Parameters:
      node - a node
      Returns:
      the node's global coordinate transformation
    • transformation

      public static Matrix34d transformation(Node node, boolean post)
      Computes the global coordinate transformation of the node. If post is false, the transformation of the node itself is returned, otherwise the transformation of its children. These may differ if node induces a change of coordinates. The returned matrix must not be modified.
      Parameters:
      node - a node
      post - true iff the post-transformation (of the node's children) shall be returned
      Returns:
      the node's global coordinate transformation
    • location

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

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

      public static Point3d location(Node node)
      Computes the location of node in global coordinates. The location is defined by the point (0, 0, 0) in local coordinates.
      Parameters:
      node - a node
      Returns:
      the node's location in global coordinates
      See Also:
    • toPoint3d

      public static Point3d toPoint3d(Node node)
      The same as location(Node). This method is designed as an auto-conversion method.
      Parameters:
      node - a node
      Returns:
      the node's location in global coordinates
    • toTuple3d

      public static Tuple3d toTuple3d(Node node)
    • direction

      public static Vector3d direction(Node node)
      Computes the growth direction of the turtle at node in global coordinates. The direction is defined by the direction (0, 0, 1) in local coordinates.
      Parameters:
      node - a node
      Returns:
      the turtle's growth direction at node
      See Also:
    • extremelocation

      public static ArrayList<Point3d> extremelocation(Node node)
    • getShapeExtremePoints

      public static ArrayList<Point3d> getShapeExtremePoints(Node shapeNode)
    • endlocation

      public static Point3d endlocation(Node node)
      Computes the end location of node in global coordinates. The end location is defined by the point (0, 0, 0) in local coordinates of node's children.
      Parameters:
      node - a node
      Returns:
      the node's end location in global coordinates
      See Also:
    • enddirection

      public static Vector3d enddirection(Node node)
      Computes the growth direction of the turtle at the end of node in global coordinates. The direction is defined by the direction (0, 0, 1) in local coordinates of node's children.
      Parameters:
      node - a node
      Returns:
      the turtle's growth direction at node's children
      See Also:
    • angle

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

      public static double inclination(Node node)
    • angle

      public static double angle(Tuple3d a, Tuple3d b)
    • setRandomTransform

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

      public static double distanceSquared(Node a, Node b)
      Calculate squared distance between node a an node b.
      Parameters:
      a - node a
      b - node b
      Returns:
      squared distance between a and b
    • distance

      public static double distance(Node a, Node b)
      Computes the global distance between two nodes. The distance is measured between the points (0, 0, 0) in the local coordinate systems of the nodes.
      Parameters:
      a - first node
      b - second node
      Returns:
      global distance between nodes
    • cone

      public static Cone cone(Tuple3d origin, Vector3d direction, double angle)
      Returns a cone whose tip is located at origin, whose central axis has direction as direction, and whose half opening angle is angle (in degrees). The cone has no base plane, i.e., it extends to infinity.
      Parameters:
      origin - location of the cone's tip
      direction - direction of the cone's axis
      angle - half opening angle in degrees
      Returns:
      instance of Cone corresponding to the specified geometry
    • cone

      public static Cone cone(Node node, boolean end, double angle)
      Returns a cone whose tip is defined by the location of node. Depending on end, the location or end location of node is used (see location(Tuple3d, Node, boolean)). The axis of the cone points into the local z-direction of the coordinate system of node or node's children (again depending on end). The cone has no base plane, i.e., it extends to infinity.
      Parameters:
      node - node which defines the cone's tip
      end - use location or end location of node
      angle - half opening angle in degrees
      Returns:
      instance of Cone corresponding to the specified geometry
    • ray

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

      public static IntersectionList intersect(Line line, Volume volume)
      Compute all intersections between line and the surface of volume. The returned list is valid until the next invocation of this method within the same thread.
      Parameters:
      line - a line
      volume - a volume
      Returns:
      list containing all intersections of the line and the volume's surface
    • operator$and

      public static IntersectionList operator$and(Line line, Volume volume)
      Parameters:
      line - a line
      volume - a volume
      Returns:
      list containing all intersections of the line and the volume's surface
    • toPoint3d

      public static Point3d toPoint3d(IntersectionList list)
      This autoconversion method returns the first intersection point of list, or null if list is empty. The returned point may be modified.
      Parameters:
      list - list of previously computed intersections
      Returns:
      first intersection point, or null
    • height

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

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

      public static Volume volume(Node node)
      Returns a volume which corresponds to the shape of node. If node has no shape, an empty volume is returned.
      Parameters:
      node - a node
      Returns:
      volume corresponding the node's shape
    • distanceToLine

      public static double distanceToLine(Tuple3d point, Line line)
      Returns the distance between point and line.
      Parameters:
      point - a point
      line - a line
      Returns:
      distance between point and line
      See Also:
    • intersectionLength

      public static double intersectionLength(Line line, Cone cone)
      Determines the fraction of the line which intersects the specified cone.
      Parameters:
      line - line to intersect
      cone - cone to intersect
      Returns:
      fraction of line which intersects cone
    • directionalTropism

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

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

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

      public static Null tropism(Node a, Vector3d direction, float e)
      Return a new node with a transformation matrix set to the desired tropism.
      Parameters:
      a - node containing original orientation
      direction - target direction towards the tropism should orient to
      e - strength of the tropism
      Returns:
      a node with a transformation set to the requested tropism
      See Also:
    • tropism

      public static Null tropism(Node a, Point3d target, float e)
      Return a new node with a transformation matrix set to the desired tropism.
      Parameters:
      a - node containing original orientation
      target - target location towards the tropism should orient to
      e - strength of the tropism
      Returns:
      a node with a transformation set to the requested tropism
      See Also:
    • cloneSubgraph

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

      public static Node cloneNode(Node node) throws CloneNotSupportedException
      Throws:
      CloneNotSupportedException
    • booleanValue

      public static boolean booleanValue(Node w)
      Returns the boolean value which is wrapped in w if w is an instance of BooleanNode. Otherwise this method returns false.
      Parameters:
      w - a node
      Returns:
      wrapped boolean value, or false
    • byteValue

      public static byte byteValue(Node w)
      Returns the byte value which is wrapped in w if w is an instance of ByteNode. Otherwise this method returns 0.
      Parameters:
      w - a node
      Returns:
      wrapped byte value, or 0
    • shortValue

      public static short shortValue(Node w)
      Returns the short value which is wrapped in w if w is an instance of ShortNode. Otherwise this method returns 0.
      Parameters:
      w - a node
      Returns:
      wrapped short value, or 0
    • charValue

      public static char charValue(Node w)
      Returns the char value which is wrapped in w if w is an instance of CharNode. Otherwise this method returns 0.
      Parameters:
      w - a node
      Returns:
      wrapped char value, or 0
    • intValue

      public static int intValue(Node w)
      Returns the int value which is wrapped in w if w is an instance of IntNode. Otherwise this method returns 0.
      Parameters:
      w - a node
      Returns:
      wrapped int value, or 0
    • longValue

      public static long longValue(Node w)
      Returns the long value which is wrapped in w if w is an instance of LongNode. Otherwise this method returns 0.
      Parameters:
      w - a node
      Returns:
      wrapped long value, or 0
    • floatValue

      public static float floatValue(Node w)
      Returns the float value which is wrapped in w if w is an instance of FloatNode. Otherwise this method returns 0.
      Parameters:
      w - a node
      Returns:
      wrapped float value, or 0
    • doubleValue

      public static double doubleValue(Node w)
      Returns the double value which is wrapped in w if w is an instance of DoubleNode. Otherwise this method returns 0.
      Parameters:
      w - a node
      Returns:
      wrapped double value, or 0
    • objectValue

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

      public static boolean isSelected(Node n)
      Determines if n has been selected in the workbench by the user.
      Parameters:
      n - a node
      Returns:
      true iff n is contained in the current selection
    • function

      public static FunctionRef function(String name)
      Returns a Function instance which refers to the function named name. The list of functions in GroIMP is available in the panel "Object Explorers/Math Objects/Functions".
      Parameters:
      name - name of function within GroIMP
      Returns:
      FunctionRef referring to the named function
    • curve

      public static CurveRef curve(String name)
      Returns a CurveRef instance which refers to the curve named name. The list of curves in GroIMP is available in the panel "Object Explorers/Math Objects/Curves".
      Parameters:
      name - name of curve within GroIMP
      Returns:
      CurveRef referring to the named curve
    • surface

      public static SurfaceRef surface(String name)
      Returns a SurfaceRef instance which refers to the surface named name. The list of surfaces in GroIMP is available in the panel "Object Explorers/Math Objects/Surfaces".
      Parameters:
      name - name of surface within GroIMP
      Returns:
      SurfaceRef referring to the named surface
    • dataset

      public static DatasetRef dataset(String name)
      Returns a DatasetRef instance which refers to the dataset named name. The list of datasets in GroIMP is available in the panel "Object Explorers/Datasets".
      Parameters:
      name - name of dataset within GroIMP
      Returns:
      DatasetRef referring to the named dataset
    • shader

      public static ShaderRef shader(String name)
      Returns a ShaderRef instance which refers to the shader named name. The list of shaders in GroIMP is available in the panel "Object Explorers/3D/Shaders".
      Parameters:
      name - name of shader within GroIMP
      Returns:
      ShaderRef referring to the named shader
    • image

      public static ImageRef image(String name)
      Returns an ImageRef instance which refers to the image named name. The list of images in GroIMP is available in the panel "Object Explorers/Images".
      Parameters:
      name - name of image within GroIMP
      Returns:
      ImageRef referring to the named image
    • spectrum

      public static SpectrumRef spectrum(String name)
      Returns a SpectrumRef instance which refers to the spectrum named name. 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

      public static LightDistributionRef light(String name)
      Returns a LightDistributionRef instance which refers to the light distribution named name. The list of light distributionRef in GroIMP is available in the panel "Object Explorers/3D/lights/Light Distribution".
      Parameters:
      name - name of light distribution within GroIMP
      Returns:
      LightDistributionRef referring to the named light distribution.
    • material

      @Deprecated public static MaterialRef material(String name)
      Deprecated.
    • file

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

      public static Reference reference(String name)
      Returns a Reference instance which refers to the object named name. The list of objects in GroIMP is available in the panel "Object Explorers/Objects".
      Parameters:
      name - name of object within GroIMP
      Returns:
      Reference referring to the named object
    • exportGraphToFile

      public static void exportGraphToFile(String fileName)
      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

      public static void list(String key)
      Prints a list of all available commands starting with the specified sequence.
      Parameters:
      prefix - of the commands
    • help

      public static void help(String prefix)
      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

      public 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.
      Parameters:
      fileName - name of the output file
    • makeRenderedImageFlux

      public 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.
      Parameters:
      fileName - name of the output file
      width -
      height -
    • makeRenderedImage

      public 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.
      Parameters:
      fileName - name of the output file
    • makeRenderedImage

      public 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.
      Parameters:
      fileName - name of the output file
      width -
      height -
    • makeRenderedImageHL

      public 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.
      Parameters:
      fileName - name of the output file
    • makeRenderedImageHL

      public 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.
      Parameters:
      fileName - name of the output file
      width -
      height -
    • makeRenderedImage

      public 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.
      Parameters:
      fileName - name of the output file
      cameraName - name of a specific camera
      width -
      height -
    • getCameraPosition

      public static void getCameraPosition(double[] vec)
    • getCameraByName

      public static Camera getCameraByName(String name)
    • makeRenderedImage

      public 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.
      Parameters:
      fileName - name of the output file
      specific - camera
      width -
      height -
    • makeSnapshot

      public static void makeSnapshot(String fileName)
      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 file
      format - target file format
      visibleLayer - 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. Check export3DScene for a subgraph 3d export. Currently supported formats of target files: - dxf - x3d - mtg - stl - ply - obj - tex - webgl
      Parameters:
      file - output file
      format - target file format
      visibleLayer - 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 file
      format - target file format
      onlyVisibleLayer - 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 file
      format - target file format
      onlyVisibleLayer - 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. Check export3DScene 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 file
      format - target file format
      visibleLayer - export only the visibleLayer?
      Throws:
      InvocationTargetException
      IllegalAccessException
      InstantiationException
      NoSuchMethodException
    • export3DScene

      Exports the current 3D scene to the specified target file and format. Check export3DScene for a subgraph 3d export. Currently supported formats of target files: - dxf - x3d - mtg - stl - ply - obj - tex - webgl
      Parameters:
      file - output file
      format - target file format
      visibleLayer - 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 on export3DScene Check export3DScene for other 3d export options. Currently supported formats of target files: - dxf - x3d - mtg - stl - ply - obj - tex - webgl
      Parameters:
      file - output file
      format - target file format
      visibleLayer - 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. Check export3DScene for other 3d export options. Currently supported formats of target files: - dxf - x3d - mtg - stl - ply - obj - tex - webgl
      Parameters:
      file - output file
      format - target file format
      root - the root node of the exported graph
      Throws:
      InvocationTargetException
      IllegalAccessException
      InstantiationException
      NoSuchMethodException
    • leaf

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

      public static MeshNode leaf3d()
      Return a MeshNode in shape of a 3d leaf.
      Returns:
      mash of the default 3d leaf
    • leaf3d

      public static MeshNode leaf3d(int id)
      Return a MeshNode in shape of it indicated default leaf.
      Parameters:
      id - of the indicated leaf
      Returns:
      mash of the default 3d leaf
    • leaf3d

      public static MeshNode leaf3d(float[] pointlist)
      Return a MeshNode in shape of it indicated list of points. The list of points will be automatically triangulated and returned as MeshNode. pointlist={x1,y1,z1, ..., xn,yn,zn).
      Parameters:
      pointlist -
      Returns:
      mash of the pointlist
    • triangulate

      public static MeshNode triangulate(float[] pointlist)
      Return a MeshNode in shape of it indicated list of points. The list of points will be automatically triangulated and returned as MeshNode. pointlist={x1,y1,z1, ..., xn,yn,zn). First point p0={x1,y1,z1}, faces between {{p0,p1,p2}, {p0,p2,p3}, {p0,p3,p4}, ...}
      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 X
      scaling - factor Y
      scaling - factor Z
      pointlist -
      Returns:
      area
    • getMesh

      public static MeshNode getMesh(FloatList vertexData)
      Return a MeshNode in shape of it indicated list of points. The list of points has to be triangulated.
      Parameters:
      vertexData -
      Returns:
      mash of the vertexData
    • triangulate

      public static MeshNode triangulate(Point3d[] pointlist)
      Return a MeshNode in shape of it indicated list of points. The list of points will be automatically triangulated and returned as MeshNode. pointlist={x1,y1,z1, ..., xn,yn,zn). First point p0={x1,y1,z1}, faces between {{p0,p1,p2}, {p0,p2,p3}, {p0,p3,p4}, ...}
      Parameters:
      pointlist -
      Returns:
      mash of the pointlist
    • getAreaOfNonTriangulation

      public static double getAreaOfNonTriangulation(Point3d[] 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}, ...}
      Parameters:
      pointlist -
      Returns:
      area
    • getAreaOfTriangulation

      public static double getAreaOfTriangulation(Point3d[] 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
    • getMesh

      public static MeshNode getMesh(Point3d[] pointlist)
      Return a MeshNode in shape of it indicated list of points. The list of points has to be triangulated.
      Parameters:
      vertexData -
      Returns:
      mash of the vertexData
    • getMesh

      public static MeshNode getMesh(QuickHull3D hull)
      Returns a MeshNode as visualization of the given convex hull.
      Parameters:
      hull -
      Returns:
      mash of the vertexData
    • getMesh

      public static MeshNode getMesh(float[] pointlist)
      Return a MeshNode in shape of it indicated list of points. The list of points has to be triangulated.
      Parameters:
      pointlist -
      Returns:
      mash of the vertexData
    • getMesh

      public static MeshNode getMesh(double[] pointlist)
      Return a MeshNode in shape of it indicated list of points. The list of points has to be triangulated. The values of the input list will be casted to float.
      Parameters:
      pointlist -
      Returns:
      mash of the vertexData
    • getSurfaceArea

      public 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. 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

      public static double getVolume(Node root)
      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

      public static ShadedNull getClosesedObject(Node n)
      Finds the colosed (euclidian distance) object of type ShadedNull to the parameter n. 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

      public static ShadedNull getClosesedObject(Node n, Class<?> cls)
      Finds the colosed (euclidian distance) object of type cls to the parameter n. 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 with disableView3DRepaint().
    • convexhull

      public static QuickHull3D convexhull(Point3d[] points)
      Constructs the convex hull of a set of points.
      Parameters:
      points - input points
    • convexhull

      public static QuickHull3D convexhull(double[] coords)
      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

      public static QuickHull3D convexhull(double[] coords, boolean debug)
      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
      debug - flag
    • convexhull

      public 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). 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

      public static QuickHull3D convexhull(Node root, boolean includeroot)
      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 points
      includeroot - input points
    • convexhull

      public static QuickHull3D convexhull(Node[] nodes)
    • boundingBox

      public static Box boundingBox(Node root, boolean includeroot)
    • boundingBoxCoordinates

      public static double[] boundingBoxCoordinates(Node root, boolean includeroot)
      Calculates the coordinates of the bounding box starting from the root Node.
      Parameters:
      root -
      includeroot -
      Returns:
      {minX, maxX, minY, maxY, minZ, maxZ}
    • getComponentBasedABBHull

      public static QuickHull3D getComponentBasedABBHull(Node complexNode, boolean finestComponentBased)
    • getComponentBasedConvexhull

      public static QuickHull3D getComponentBasedConvexhull(Node complexNode, boolean finestComponentBased)
    • markVertices

      public static void markVertices(QuickHull3D hull)
      Marks all vertices with a Sphere of the given QuickHull3D.
      Parameters:
      hull -
    • markVertices

      public static void markVertices(QuickHull3D hull, float radius)
      Marks all vertices with a Sphere of the specified radius and of the given QuickHull3D.
      Parameters:
      hull -
      radius -
    • markPoints

      public static void markPoints(QuickHull3D hull)
      Marks all points with a Sphere of the given QuickHull3D.
      Parameters:
      hull -
    • markPoints

      public static void markPoints(QuickHull3D hull, float radius)
      Marks all points with a Sphere of the specified radius and of the given QuickHull3D.
      Parameters:
      hull -
      radius -
    • markPoints

      public static void markPoints(Point3d[] points, float radius, RGBAShader shader)
      Marks all points of the specified array with a Sphere of the specified radius and shader.
      Parameters:
      hull -
      radius -
      shader -
    • markPoints

      public static void markPoints(Point3d[] points, float radius, RGBAShader shader, boolean label)
      Marks all points of the specified array with a Sphere of the specified radius and shader. Additionally a TextLabel with a consecutive number can be applyed.
      Parameters:
      hull -
      radius -
      shader -
      label -
    • ColorBar

      public static Null ColorBar(ColorGradient cg, boolean label)
      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 ColorGradient
      label - flag to indicate labeling
      Returns:
      root node of the sequence
    • MeasuringStick

      public static Null MeasuringStick(int steps, float stepsize, boolean label)
      Creates a measuring stick as sequence of steps Cylinder opjects.
      Parameters:
      steps - number of steps
      stepsize - hight of each Cylinder
      label - flag to indicate labeling
      Returns:
      root node of the sequence
    • getXYProjection

      public 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. 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 of alpha (Note: In case the alpha shape is not connected, only the first polygon will be returned)
      Parameters:
      root - node
      method - of projection
      alpha - value, only used for alpha shapes
    • getXYProjection

      public static Point3d[] getXYProjection(Point3d[] pointlist, int type, double alpha)
      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 of alpha (Note: In case the alpha shape is not connected, only the first polygon will be returned) Returns an array of points: [centroid, p0, p1, p2, ..., pn, p0}; (Repeatation of the first point to close the area (during triangulation))
      Parameters:
      input - points
      method - of projection
      alpha - value, only used for alpha shapes
    • getBoundingRectangle

      public static Point3d[] getBoundingRectangle(Point2d[] points)
      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

      public static Point3d[] getConvexHull2D(Point2d[] points)
      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

      public static List<Vector<Point3d>> getAlphaShape(Point2d[] points, double alpha)
      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

      public static List<Vector<Point3d>> getAlphaShape(Node root, double alpha)
      Calculates the alhpa shape of all (visible) nodes that can be reached from the given root Node considerring the choosn alpah value. 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 public static NURBSSurface Surface(BSplineSurface surface)
      Deprecated.
    • Surface

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

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

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

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

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

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

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

      public static void print(Object v, int colour)
      Prints v with the specified colour to the XL console.
      Parameters:
      v - an object
      color - selected printing color (black = 0x000000)
    • print

      public static void print(Object v)
      Prints v to the XL console.
      Parameters:
      v - an object
    • println

      public static void println(Object v, int colour)
      Prints v with the specified colour to the XL console, then terminates the line.
      Parameters:
      v - an object
      color - selected printing color (black = 0x000000)
    • println

      public static void println(Object v)
      Prints v 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

      public static PrintWriter operator$shl(PrintWriter w, Object v)
      This operator method prints v on w.
      Parameters:
      w - a writer
      v - value to be printed on w
      Returns:
      w
    • println

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

      public static void print(boolean v)
      Prints v to the XL console.
      Parameters:
      v - value to be printed
    • println

      public static void println(boolean v)
      Prints v to the XL console, then terminates the line.
      Parameters:
      v - value to be printed
    • operator$shl

      public static PrintWriter operator$shl(PrintWriter w, boolean v)
      This operator method prints v on w.
      Parameters:
      w - a writer
      v - value to be printed on w
      Returns:
      w
    • print

      public static void print(char v)
      Prints v to the XL console.
      Parameters:
      v - value to be printed
    • println

      public static void println(char v)
      Prints v to the XL console, then terminates the line.
      Parameters:
      v - value to be printed
    • operator$shl

      public static PrintWriter operator$shl(PrintWriter w, char v)
      This operator method prints v on w.
      Parameters:
      w - a writer
      v - value to be printed on w
      Returns:
      w
    • print

      public static void print(int v)
      Prints v to the XL console.
      Parameters:
      v - value to be printed
    • println

      public static void println(int v)
      Prints v to the XL console, then terminates the line.
      Parameters:
      v - value to be printed
    • operator$shl

      public static PrintWriter operator$shl(PrintWriter w, int v)
      This operator method prints v on w.
      Parameters:
      w - a writer
      v - value to be printed on w
      Returns:
      w
    • print

      public static void print(long v)
      Prints v to the XL console.
      Parameters:
      v - value to be printed
    • println

      public static void println(long v)
      Prints v to the XL console, then terminates the line.
      Parameters:
      v - value to be printed
    • operator$shl

      public static PrintWriter operator$shl(PrintWriter w, long v)
      This operator method prints v on w.
      Parameters:
      w - a writer
      v - value to be printed on w
      Returns:
      w
    • print

      public static void print(float v)
      Prints v to the XL console.
      Parameters:
      v - value to be printed
    • println

      public static void println(float v)
      Prints v to the XL console, then terminates the line.
      Parameters:
      v - value to be printed
    • operator$shl

      public static PrintWriter operator$shl(PrintWriter w, float v)
      This operator method prints v on w.
      Parameters:
      w - a writer
      v - value to be printed on w
      Returns:
      w
    • print

      public static void print(double v)
      Prints v to the XL console.
      Parameters:
      v - value to be printed
    • println

      public static void println(double v)
      Prints v to the XL console, then terminates the line.
      Parameters:
      v - value to be printed
    • operator$shl

      public static PrintWriter operator$shl(PrintWriter w, double v)
      This operator method prints v on w.
      Parameters:
      w - a writer
      v - value to be printed on w
      Returns:
      w
    • operator$index

      public static float operator$index(FloatToFloat func, float x)
      This operator method is an alias for func.evaluateFloat(x).
      Parameters:
      func - a function
      x - argument to the function
      Returns:
      evaluation of func at x
    • operator$shl

      public static <E> List<E> operator$shl(List<E> list, E value)
      This operator method adds value as last element to list.
      Parameters:
      list - a list
      value - value to add as last element
      Returns:
      list
    • operator$index

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

      public static <T> boolean operator$in(T value, Collection<? super T> set)
      This operator method returns true iff set is not null and set.contains(value) returns true.
      Parameters:
      value - a value
      set - a collection
      Returns:
      true iff value is in set
    • synthesize

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

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

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

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

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

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

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

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

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

      public static boolean operator$index(BooleanList list, int index)
      This operator method is an alias for list.get(index).
      Parameters:
      list - a list
      index - an index
      Returns:
      element at index in list
    • operator$shl

      public static BooleanList operator$shl(BooleanList list, boolean value)
      This operator method adds value as last element to list.
      Parameters:
      list - a list
      value - value to add as last element
      Returns:
      list
    • operator$index

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

      public static byte operator$index(ByteList list, int index)
      This operator method is an alias for list.get(index).
      Parameters:
      list - a list
      index - an index
      Returns:
      element at index in list
    • operator$shl

      public static ByteList operator$shl(ByteList list, byte value)
      This operator method adds value as last element to list.
      Parameters:
      list - a list
      value - value to add as last element
      Returns:
      list
    • operator$index

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

      public static short operator$index(ShortList list, int index)
      This operator method is an alias for list.get(index).
      Parameters:
      list - a list
      index - an index
      Returns:
      element at index in list
    • operator$shl

      public static ShortList operator$shl(ShortList list, short value)
      This operator method adds value as last element to list.
      Parameters:
      list - a list
      value - value to add as last element
      Returns:
      list
    • operator$index

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

      public static char operator$index(CharList list, int index)
      This operator method is an alias for list.get(index).
      Parameters:
      list - a list
      index - an index
      Returns:
      element at index in list
    • operator$shl

      public static CharList operator$shl(CharList list, char value)
      This operator method adds value as last element to list.
      Parameters:
      list - a list
      value - value to add as last element
      Returns:
      list
    • operator$index

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

      public static int operator$index(IntList list, int index)
      This operator method is an alias for list.get(index).
      Parameters:
      list - a list
      index - an index
      Returns:
      element at index in list
    • operator$shl

      public static IntList operator$shl(IntList list, int value)
      This operator method adds value as last element to list.
      Parameters:
      list - a list
      value - value to add as last element
      Returns:
      list
    • operator$index

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

      public static long operator$index(LongList list, int index)
      This operator method is an alias for list.get(index).
      Parameters:
      list - a list
      index - an index
      Returns:
      element at index in list
    • operator$shl

      public static LongList operator$shl(LongList list, long value)
      This operator method adds value as last element to list.
      Parameters:
      list - a list
      value - value to add as last element
      Returns:
      list
    • operator$index

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

      public static float operator$index(FloatList list, int index)
      This operator method is an alias for list.get(index).
      Parameters:
      list - a list
      index - an index
      Returns:
      element at index in list
    • operator$shl

      public static FloatList operator$shl(FloatList list, float value)
      This operator method adds value as last element to list.
      Parameters:
      list - a list
      value - value to add as last element
      Returns:
      list
    • operator$index

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

      public static double operator$index(DoubleList list, int index)
      This operator method is an alias for list.get(index).
      Parameters:
      list - a list
      index - an index
      Returns:
      element at index in list
    • operator$shl

      public static DoubleList operator$shl(DoubleList list, double value)
      This operator method adds value as last element to list.
      Parameters:
      list - a list
      value - value to add as last element
      Returns:
      list
    • operator$index

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

      public static Node operator$index(Node node, int index)
      This operator method is an alias for node.getChild(index).
      Parameters:
      node - a node
      index - an index
      Returns:
      index-th child of code
      See Also:
    • operator$lt

      public static boolean operator$lt(Node a, Node b)
      This operator method compares two nodes based on their id: It returns true iff a.getId () < b.getId ().
      Parameters:
      a - a node
      b - another node
      Returns:
      a.getId () < b.getId ()
      See Also:
    • operator$le

      public static boolean operator$le(Node a, Node b)
      This operator method compares two nodes based on their id: It returns true iff a.getId () <= b.getId ().
      Parameters:
      a - a node
      b - another node
      Returns:
      a.getId () <= b.getId ()
      See Also:
    • operator$gt

      public static boolean operator$gt(Node a, Node b)
      This operator method compares two nodes based on their id: It returns true iff a.getId () > b.getId ().
      Parameters:
      a - a node
      b - another node
      Returns:
      a.getId () > b.getId ()
      See Also:
    • operator$ge

      public static boolean operator$ge(Node a, Node b)
      This operator method compares two nodes based on their id: It returns true iff a.getId () >= b.getId ().
      Parameters:
      a - a node
      b - another node
      Returns:
      a.getId () >= b.getId ()
      See Also:
    • operator$index

      public static int operator$index(Node n, NodeToInt f)
      This operator method applies the function f to node n. It is an alias for f.get(n).
      Parameters:
      n - a node
      f - a function of nodes
      Returns:
      evaluation of f at n
    • operator$index

      public static float operator$index(Node n, NodeToFloat f)
      This operator method applies the function f to node n. It is an alias for f.get(n).
      Parameters:
      n - a node
      f - a function of nodes
      Returns:
      evaluation of f at n
    • operator$index

      public static double operator$index(Node n, NodeToDouble f)
      This operator method applies the function f to node n. It is an alias for f.get(n).
      Parameters:
      n - a node
      f - a function of nodes
      Returns:
      evaluation of f at n
    • operator$index

      public static Point3d operator$index(Node n, Location l)
      This operator method returns the location of n. It is an alias for location(n).
      Parameters:
      n - a node
      l - dummy parameter, its value is ignored
      Returns:
      location of n in global coordinates
      See Also:
    • mean

      public static void mean(Aggregate a, Tuple3f value)
      This aggregate method computes the mean of a sequence of Tuple3f's.
      Parameters:
      a - aggregate instance (provided by the XL compiler)
      value - a value of the sequence of values
    • mean

      public static void mean(Aggregate a, Tuple3d value)
      This aggregate method computes the mean of a sequence of Tuple3d's.
      Parameters:
      a - aggregate instance (provided by the XL compiler)
      value - a value of the sequence of values
    • plot

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

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

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

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

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

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

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

      public static int select(Aggregate a, Node value)
    • apply

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

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

      @Deprecated public static void passBoundary()
      Deprecated.
      replaced by derive()
    • apply

      @Deprecated public static void apply()
      Deprecated.
      replaced by derive()
    • 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

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

      public static DisposableIterator interpretiveRules()
    • removeInterpretiveNodes

      public static void removeInterpretiveNodes()
    • moveToExtent

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

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

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

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

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

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

      Parameters:
      root - root node of subgraph
    • mergeTransformations

      public static void mergeTransformations(Node root, boolean allowShape)
      This method replaces chains of transformation nodes with single Null nodes which perform the aggregated transformation of the chains. This is the same as mergeTransformations(root, null).
      Parameters:
      root - root node of subgraph where chains should be replaced
      allowShape - store aggregated transformation in shape node at chain end if possible
      See Also:
    • mergeNonTropismTransformations

      public static void mergeNonTropismTransformations(Node root, boolean allowShape)
      This method replaces chains of transformation nodes with single Null node which perform the aggregated transformation of the chain; however, transformation nodes which are tropisms are not allowed to be part of the chains. This is the same as mergeNonTropismTransformations(root, null).
      Parameters:
      root - root node of subgraph where chains should be replaced
      allowShape - store aggregated transformation in shape node at chain end if possible
      See Also:
    • mergeNonTropismTransformations

      public static void mergeNonTropismTransformations(Node root, ObjectToBoolean<? super Node> filter, boolean allowShape)
      This method replaces chains of transformation nodes passing filter with single Null nodes which perform the aggregated transformation of the chains; however, transformation nodes which are tropisms are not allowed to be part of the chains. Tropisms are defined by the subclasses of Tropism.
      Parameters:
      root - root node of subgraph where chains should be replaced
      filter - only merge nodes which pass this filter. If null is specified, every non-tropism transformation node is considered for merging
      See Also:
    • mergeTransformations

      public static void mergeTransformations(Node root, ObjectToBoolean<? super Node> filter, boolean allowShape)
      This method replaces chains of transformation nodes passing filter with single Null nodes which perform the aggregated transformation of the chains. A node is considered to be a transformation node if it has a transformation attribute, but no shape attribute. If it additionally passes filter and is part of a chain of such nodes, this chain will be replaced by an equivalent single node of class Null.
      Parameters:
      root - root node of subgraph where chains should be replaced
      filter - only merge nodes which pass this filter. If null is specified, every transformation node is considered for merging
      allowShape - if possible, store aggregated transformation in existing shape node at chain end (instead of creating a new Null node)
    • removeTransformationLeaves

      public static void removeTransformationLeaves(Node root)
      Removes all leaf nodes from the graph which are pure transformation nodes (see removeTransformationLeaves(Node, ObjectToBoolean)).
      Parameters:
      root - root node of subgraph whose leaves shall be removed
      See Also:
    • removeTransformationLeaves

      public static void removeTransformationLeaves(Node root, ObjectToBoolean<? super Node> filter)
      Removes all leaf nodes from the graph which are pure transformation nodes and which pass filter, starting at root (see removeLeaves(de.grogra.graph.impl.Node, de.grogra.xl.lang.ObjectToBoolean<? 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 removed
      filter - only leaf nodes which pass this filter are removed. If null, all transformation nodes are considered
      See Also:
    • removeLeaves

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

      public static Statistics statistics(Aggregate a, double value)
      This aggregate method computes a Statistics object for a series of values a.
      Parameters:
      a - aggregate instance (provided by the XL compiler)
      value - a value of the sequence of values
      Returns:
      statistics of the series of values
    • defer

      public static void defer(Runnable r)
      Put runnable into modification queue and execute later when derive() is called.
      Parameters:
      r -
    • randomDirection

      public static Vector3d randomDirection()
      Pick a random point on the surface of a unit sphere and return it as direction vector.
      Returns:
      random uniformly distributed direction vector
    • getPathToProjectDirectory

      public static String 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

      public static String 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

      public static String getPathToHomeDirectory()
      Return the path to the home directory. Independent from the OS used.
    • getPathToProjectFileSystem

      public static String getPathToProjectFileSystem()
    • getFileFromProject

      public static Object getFileFromProject(String fileName)
      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

      public static InputStream getInputStreamFromProject(String fileName) throws IOException
      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