java.lang.Object
de.grogra.rgg.Library
This class contains a collection of methods and constants which are
useful in RGG modelling, especially in 3D.
- Author:
- Ole Kniemeyer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intThis is a redefinition ofGraph.BRANCH_EDGE.static final intThis is a redefinition ofGraph.CONTAINMENT_EDGE.static final intstatic float[][]static String[]static final doubleConversion factor from degree to radians.static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final Vector3dVector pointing in the z-direction (the turtle's head axis).static final I18NBundleThe resource bundle for thede.grogra.rggpackage.static final Vector3dVector pointing in the x-direction (the turtle's left axis).static final RGGProducer.Creatorstatic final intThis is a redefinition ofGraph.MARK_EDGE.static final intThis is a redefinition ofInstance3D.MASTER.static final intThis is a redefinition ofGraph.NOTIFIES_EDGE.static final Point3dPoint having coordinates (0, 0, 0).static final PrintWriterThis field provides aPrintWriterto write to the XL console.static final doubleConversion factor from radians to degree.static final intThis is a redefinition ofGraph.REFINEMENT_EDGE.static HashMap<Integer, Set<ManageableType>> static final byteConstant forNURBSSurface(byte)indicating a skinned surface (defined by a set of profile curves in space).static final intThis is a redefinition ofGraph.SUCCESSOR_EDGE.static final byteConstant forNURBSSurface(byte)indicating a swept surface (defined by a set of vertices in space).static final Vector3dVector pointing in the y-direction (the turtle's up axis).static final intThis is a redefinition ofFieldUpdater.UPDATES. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidallowNoninjectiveMatchesByDefault(boolean value) static voidallowNoninjectiveMatchesForNextQuery(boolean value) Deprecated.static Nodeancestor(Node n, ObjectToBoolean<? super Node> condition) Returns the nearest ancestor ofnwhich fulfillscondition.static <C extends Node>
CReturns the nearest ancestor ofnwhich is an instance oft.static doubleComputes the rotation angle in degrees of the transformation defined bynode.static doublestatic voidapply()Deprecated.static DisposableIteratorapply(int count) This finish iterator (see the XL Language Specification) is used in afor-statement to execute its bodycounttimes.static DisposableIteratorThis finish iterator (see the XL Language Specification) is used in afor-statement to execute its body as long as the body makes modifications to the graph.static Nodeaxisparent(Node child) static booleanbooleanValue(Node w) static BoxboundingBox(Node root, boolean includeroot) static double[]boundingBoxCoordinates(Node root, boolean includeroot) Calculates the coordinates of the bounding box starting from the root Node.static bytestatic voidchart(DatasetRef ds, int type) Shows the data referenced bydsin a chart panel.static charstatic voidClears the current console.static Nodestatic NodecloneSubgraph(Node root) This method clones the subgraph starting atrootand returns the cloned node which corresponds toroot.static voidCloses the currently activeWorkbenchif such a workbench exists.static NullColorBar(ColorGradient cg, boolean label) Generates a ColorBar as sequence of 100 Cylinder objects based on the passed ColorGradient instance.static ConeReturns a cone whose tip is defined by the location ofnode.static ConeReturns a cone whose tip is located atorigin, whose central axis hasdirectionas direction, and whose half opening angle isangle(in degrees).static Consoleconsole()Returns the currently activeConsole.static QuickHull3Dconvexhull(double[] coords) Constructs the convex hull of a set of coordinates.static QuickHull3Dconvexhull(double[] coords, boolean debug) Constructs the convex hull of a set of coordinates.static QuickHull3Dconvexhull(Node root) Constructs the convex hull of all points that can be reached starting from the indicated root node (including the root node).static QuickHull3Dconvexhull(Node[] nodes) static QuickHull3Dconvexhull(Node root, boolean includeroot) Constructs the convex hull of all points that can be reached starting from the indicated root node.static QuickHull3Dconvexhull(Point3d[] points) Constructs the convex hull of a set of points.static CurveRefReturns aCurveRefinstance which refers to the curve namedname.static DatasetRefReturns aDatasetRefinstance which refers to the dataset namedname.static voidPut runnable into modification queue and execute later when derive() is called.static voidderive()This method induces a transformation boundary on the current RGG extent (see the XL Language Specification).static <T> Nodedescendants(ObjectConsumer<? super T> cb, Node n, Class<T> cls) This generator method yields all descendants ofnwhich are instances ofcls.static Vector3dComputes the growth direction of the turtle atnodein global coordinates.static voidComputes the growth direction of the turtle atnodein global coordinates.static booleandirectionalTropism(Matrix34d m, Tuple3d direction, float e, Matrix4d out) Computes the rotation matrix which implements a directional tropism towards adirection.static voidDisables repaint of View3D panel.static doubleComputes the global distance between two nodes.static doubledistanceSquared(Node a, Node b) Calculate squared distance between node a an node b.static doubledistanceToLine(Tuple3d point, Line line) Returns the distance betweenpointandline.static intdistribution(float[] probabilities) Returns an integral pseudorandom number according to the discrete distributionprobabilities.static doubledoubleValue(Node w) static voidEnables repaint of View3D panel after it was deactivated withdisableView3DRepaint().static Vector3denddirection(Node node) Computes the growth direction of the turtle at the end ofnodein global coordinates.static Point3dendlocation(Node node) Computes the end location ofnodein global coordinates.static voidexport3DScene(File file, MimeType format, Boolean onlyVisibleLayer) Exports the current 3D scene to the specified target file and format.static voidexport3DScene(File file, String format) Exports the current 3D scene to the specified target file and format.static voidexport3DScene(File file, String format, Node root) Exports the specified root node and its children to the specified target file and format.static voidexport3DScene(File file, String format, Boolean onlyVisibleLayer) Exports the current 3D scene to the specified target file and format.static voidexport3DScene(String fileName, MimeType format, Boolean onlyVisibleLayer) Exports the current 3D scene to the specified target file and format.static voidexport3DScene(String fileName, String format) Exports the current 3D scene to the specified target file and format.static voidexport3DScene(String fileName, String format, Node root) Exports the specified root node and its children to the specified target file and format.static voidexport3DScene(String fileName, String format, Boolean onlyVisibleLayer) Exports the current 3D scene to the specified target file and format.static voidexportGraphToFile(String fileName) Writes the current graph to a file.static RGGGraphextent()Deprecated.extremelocation(Node node) static FileRefReturns aFileRefinstance which refers to the file namedname.static NodeFilter<Node> Creates a condition which is fulfilled for an object iff it is an instance of at least one of the specifiedclasses(or iff it is not an instance in caseisTrueisfalse).findChildren(Node n) Return nodes that connect fromnwith successor or branch edgestatic NodefindComplex(Node n) Return node that connect tonwith refinement/decomposition edgeReturn nodes that connect fromnwith refinement/decomposition edgeReturn nodes that connect fromnthrough one or more refinement/decomposition steps, and without any outgoing decomposition edge.static NodefindParent(Node n) Return node that connect tonwith successor or branch edgestatic floatfloatValue(Node w) static FunctionRefReturns aFunctioninstance which refers to the function namedname.getAlphaShape(Node root, double alpha) Calculates the alhpa shape of all (visible) nodes that can be reached from the given root Node considerring the choosn alpah value.getAlphaShape(Point2d[] points, double alpha) Calculates the alhpa shape of the given array of points considerring the choosn alpah value.static doublegetAreaOfNonTriangulation(float[] pointlist) Calculates the area of the surface generated by the specified list of points.static doublegetAreaOfNonTriangulation(Point3d[] pointlist) Calculates the area of the surface generated by the specified list of points.static doublegetAreaOfTriangulation(float[] pointlist) Calculates the area of the surface generated by the specified list of points.static doublegetAreaOfTriangulation(float scaleX, float scaleY, float scaleZ, float[] pointlist) Calculates the area of the surface generated by the specified list of points.static doublegetAreaOfTriangulation(Point3d[] pointlist) Calculates the area of the surface generated by the specified list of points.static Point3d[]getBoundingRectangle(Point2d[] points) Calculates the bounding rectangle of the given array of points.static CameragetCameraByName(String name) static voidgetCameraPosition(double[] vec) static ShadedNullFinds the colosed (euclidian distance) object of typeShadedNullto the parametern.static ShadedNullgetClosesedObject(Node n, Class<?> cls) Finds the colosed (euclidian distance) object of typeclsto the parametern.static QuickHull3DgetComponentBasedABBHull(Node complexNode, boolean finestComponentBased) static QuickHull3DgetComponentBasedConvexhull(Node complexNode, boolean finestComponentBased) static Point3d[]getConvexHull2D(Point2d[] points) Calculates the convex hull of the given array of points.static HashMap<Integer, Set<ManageableType>> static intgetEdgeBit(String type) Returns the GroIMP specific edge bits for a given xml edge type.static ObjectgetFileFromProject(String fileName) return the object of a file in the Project from its name.static Nodestatic intGet the amount of scale in current groimp multiscale graph.static intNumber of nodes in the main graph.static InputStreamgetInputStreamFromProject(String fileName) Return the input stream of a file from the project.static intstatic MeshNodegetMesh(double[] pointlist) Return aMeshNodein shape of it indicated list of points.static MeshNodegetMesh(float[] pointlist) Return aMeshNodein shape of it indicated list of points.static MeshNodegetMesh(QuickHull3D hull) Returns aMeshNodeas visualization of the given convex hull.static MeshNodeReturn aMeshNodein shape of it indicated list of points.static MeshNodeReturn aMeshNodein shape of it indicated list of points.static GraphManagerReturns the current meta/registry graph, i.e., the meta/registry graph of the currently activeWorkbench.getNodesAtScale(int scaleNumber) static OutputStreamgetOutputStreamFromProject(String fileName, boolean add) Return the output stream of a file from the project.static StringReturn the path to the home directory.static StringReturn the relative path to the current opened workbench.static Stringstatic GraphManagerReturns the current project graph, i.e., the project graph of the currently activeWorkbench.getRootsAtScale(int scaleNumber) static intgetScaleNumber(Node node) Get the scale number, a given node locates at the scalestatic intNumber of nodes in the scene graphgetShapeExtremePoints(Node shapeNode) static doublegetSurfaceArea(Node root) Calculates the area of all nodes of the subgraph with the node root as root node Intersection with other object are not considered.The total area will be calculated.static doubleDetermine the time for one repaint of the 3D View window.static doubleDetermine the time for traversing the whole graph (touching each node once).static doubleCalculates the volume of all nodes of the subgraph with the node root as root node.static StringgetWD()Short for the method getPathToProjectDirectory().static Point3d[]getXYProjection(Node root, int type, double alpha) Constructs the selected XY-projection of all points that can be reached starting from the indicated root node.static Point3d[]getXYProjection(Point3d[] pointlist, int type, double alpha) Constructs the selected XY-projection of all points in the list.static GraphManagergraph()Returns the current project graph, i.e., the project graph of the currently activeWorkbench.static GraphStateReturns the current graph state, i.e., the current graph state of the project graph of the currently activeWorkbench.static doubleThis method returns the height of a volume at a point(x, y)(in global coordinates).static voidPrints the JavaDoc description of all available commands starting with the specified prefix on the XL console window.static voidHides the subgraph starting atrootso that it is no longer visible and will not be reported as part of graph queries (and left hand sides of rules, thus).static ImageRefReturns anImageRefinstance which refers to the image namedname.static voidimportNodeFromFile(String in, String mt) import file (from file path) and add it to the scenestatic voidimportNodeFromStream(InputStream in, String mt) import file (from inputStream) and add it to the scenestatic doubleinclination(Node node) static DisposableIteratorstatic IntersectionListCompute all intersections betweenlineand the surface ofvolume.static doubleintersectionLength(Line line, Cone cone) Determines the fraction of thelinewhich intersects the specifiedcone.static intstatic intirandom(int min, int max) Returns a uniformly distributed integral pseudorandom number betweenminandmax(inclusive).static booleanisAncestor(Node a, Node d, int edgeMask) Tests whetherais an ancestor ofd(orditself), i.e., ifacan be reached fromdby a backward traversal of edges matchingedgeMask(seeEdge.testEdgeBits(int)).static booleanisSelected(Node n) Determines ifnhas been selected in the workbench by the user.static Parallelogramleaf(float length, float width) Returns a new, rectangular instance ofParallelogramcreated by the constructor invocationParallogram(length, width)and havingRGBAShader.GREENas its shader.static MeshNodeleaf3d()Return aMeshNodein shape of a 3d leaf.static MeshNodeleaf3d(float[] pointlist) Return aMeshNodein shape of it indicated list of points.static MeshNodeleaf3d(int id) Return aMeshNodein shape of it indicated default leaf.static LightDistributionRefReturns aLightDistributionRefinstance which refers to the light distribution namedname.static voidlist()Prints the JavaDoc description of all available commands on the XL console window.static voidPrints a list of all available commands starting with the specified sequence.static NodeloadNodeFromFile(String in, String mt) load file (from file path) and return the root of the created graph structurestatic NodeloadNodeFromStream(InputStream in, String mt) load file (from file input stream) and return the root of the created graph structurestatic Point3dComputes the location ofnodein global coordinates.static voidComputes the location ofnodein global coordinates.static doublelognormal(double mu, double sigma) static longstatic voidmakeRenderedImage(String fileName) Creates a Twilight rendered image of the actual scene with the default camera position and a fixed image size of 800x600.static voidmakeRenderedImage(String fileName, int width, int height) Creates a Twilight rendered image of the actual scene with the default camera position and a variable image size.static voidmakeRenderedImage(String fileName, Camera camera, int width, int height) Creates a rendered image of the actual scene with the specified camera and a variable image size.static voidmakeRenderedImage(String fileName, String cameraName, int width, int height) Creates a Twilight rendered image of the actual scene with the specified camera and a variable image size.static voidmakeRenderedImageFlux(String fileName) Creates a Flux rendered image of the actual scene with the default camera position and a fixed image size of 800x600.static voidmakeRenderedImageFlux(String fileName, int width, int height) Creates a Flux rendered image of the actual scene with the default camera position and a variable image size.static voidmakeRenderedImageHL(String fileName) Creates a Twilight rendered image of the actual scene if no View3D instance is available as it is when running headless, using the default camera position and a fixed image size of 800x600.static voidmakeRenderedImageHL(String fileName, int width, int height) Creates a Twilight rendered image of the actual scene if no View3D instance is available as it is when running headless, using the default camera position and a variable image size.static voidmakeSnapshot(String fileName) Creates a snapshot of the actual scene.static voidmarkPoints(QuickHull3D hull) Marks all points with a Sphere of the givenQuickHull3D.static voidmarkPoints(QuickHull3D hull, float radius) Marks all points with a Sphere of the specifiedradiusand of the givenQuickHull3D.static voidmarkPoints(Point3d[] points, float radius, RGBAShader shader) Marks all points of the specified array with a Sphere of the specifiedradiusand shader.static voidmarkPoints(Point3d[] points, float radius, RGBAShader shader, boolean label) Marks all points of the specified array with a Sphere of the specifiedradiusand shader.static voidmarkVertices(QuickHull3D hull) Marks all vertices with a Sphere of the givenQuickHull3D.static voidmarkVertices(QuickHull3D hull, float radius) Marks all vertices with a Sphere of the specifiedradiusand of the givenQuickHull3D.static MaterialRefDeprecated.static voidThis aggregate method computes the mean of a sequence ofTuple3d's.static voidThis aggregate method computes the mean of a sequence ofTuple3f's.static NullMeasuringStick(int steps, float stepsize, boolean label) Creates a measuring stick as sequence of steps Cylinder opjects.static voidmergeNonTropismTransformations(Node root, boolean allowShape) This method replaces chains of transformation nodes with singleNullnode which perform the aggregated transformation of the chain; however, transformation nodes which are tropisms are not allowed to be part of the chains.static voidmergeNonTropismTransformations(Node root, ObjectToBoolean<? super Node> filter, boolean allowShape) This method replaces chains of transformation nodes passingfilterwith singleNullnodes which perform the aggregated transformation of the chains; however, transformation nodes which are tropisms are not allowed to be part of the chains.static voidmergeTransformations(Node root, boolean allowShape) This method replaces chains of transformation nodes with singleNullnodes which perform the aggregated transformation of the chains.static voidmergeTransformations(Node root, ObjectToBoolean<? super Node> filter, boolean allowShape) This method replaces chains of transformation nodes passingfilterwith singleNullnodes which perform the aggregated transformation of the chains.static <T> NodeminDescendants(ObjectConsumer<? super T> cb, Node n, Class<T> t) This generator method yields all descendants ofnwhich are instances oftand which have no other instance oftin their path ton.static voidmoveToExtent(RGGProducer ps, Node root, int index) static NodeReturns a node having the specifiedname.static GRSVertexnewGRSVertices(ObjectConsumer<? super GRSVertex> cons) static doublenormal(double mu, double sigma) Returns a pseudorandom number which is distributed according to a normal distribution with mean valuemuand standard deviationsigma.static floatnormal(float mu, float sigma) Returns a pseudorandom number which is distributed according to a normal distribution with mean valuemuand standard deviationsigma.static ObjectobjectValue(Node w) Returns theObjectvalue which is wrapped inwifwis an instance ofObjectNode,NURBSCurve(aNURBSCurvenode wraps its containedBSplineCurve) orNURBSSurface(aNURBSSurfacenode wraps its containedBSplineSurface).static IntersectionListoperator$and(Line line, Volume volume) This operator method is an alias forintersect(de.grogra.vecmath.geom.Line, de.grogra.vecmath.geom.Volume).static booleanoperator$ge(Node a, Node b) This operator method compares two nodes based on their id: It returnstrueiffa.getId () >= b.getId ().static booleanoperator$gt(Node a, Node b) This operator method compares two nodes based on their id: It returnstrueiffa.getId () > b.getId ().static <T> booleanoperator$in(T value, Collection<? super T> set) This operator method returnstrueiffsetis notnullandset.contains(value)returnstrue.static Nodeoperator$index(Node node, int index) This operator method is an alias fornode.getChild(index).static booleanoperator$index(Node node, BooleanAttribute attr) static byteoperator$index(Node node, ByteAttribute attr) static charoperator$index(Node node, CharAttribute attr) static doubleoperator$index(Node node, DoubleAttribute attr) static floatoperator$index(Node node, FloatAttribute attr) static intoperator$index(Node node, IntAttribute attr) static longoperator$index(Node node, LongAttribute attr) static <T> Toperator$index(Node node, ObjectAttribute<T> attr) static shortoperator$index(Node node, ShortAttribute attr) static Point3doperator$index(Node n, Location l) This operator method returns the location ofn.static doubleoperator$index(Node n, NodeToDouble f) This operator method applies the functionfto noden.static floatoperator$index(Node n, NodeToFloat f) This operator method applies the functionfto noden.static intoperator$index(Node n, NodeToInt f) This operator method applies the functionfto noden.static floatoperator$index(FloatToFloat func, float x) This operator method is an alias forfunc.evaluateFloat(x).static booleanoperator$index(BooleanList list, int index) This operator method is an alias forlist.get(index).static byteoperator$index(ByteList list, int index) This operator method is an alias forlist.get(index).static charoperator$index(CharList list, int index) This operator method is an alias forlist.get(index).static doubleoperator$index(DoubleList list, int index) This operator method is an alias forlist.get(index).static floatoperator$index(FloatList list, int index) This operator method is an alias forlist.get(index).static intoperator$index(IntList list, int index) This operator method is an alias forlist.get(index).static longoperator$index(LongList list, int index) This operator method is an alias forlist.get(index).static shortoperator$index(ShortList list, int index) This operator method is an alias forlist.get(index).static booleanoperator$le(Node a, Node b) This operator method compares two nodes based on their id: It returnstrueiffa.getId () invalid input: '<'= b.getId ().static booleanoperator$lt(Node a, Node b) This operator method compares two nodes based on their id: It returnstrueiffa.getId () invalid input: '<' b.getId ().static BooleanListoperator$shl(BooleanList list, boolean value) This operator method addsvalueas last element tolist.static ByteListoperator$shl(ByteList list, byte value) This operator method addsvalueas last element tolist.static CharListoperator$shl(CharList list, char value) This operator method addsvalueas last element tolist.static DoubleListoperator$shl(DoubleList list, double value) This operator method addsvalueas last element tolist.static FloatListoperator$shl(FloatList list, float value) This operator method addsvalueas last element tolist.static IntListoperator$shl(IntList list, int value) This operator method addsvalueas last element tolist.static LongListoperator$shl(LongList list, long value) This operator method addsvalueas last element tolist.static ShortListoperator$shl(ShortList list, short value) This operator method addsvalueas last element tolist.static PrintWriteroperator$shl(PrintWriter w, boolean v) This operator method printsvonw.static PrintWriteroperator$shl(PrintWriter w, char v) This operator method printsvonw.static PrintWriteroperator$shl(PrintWriter w, double v) This operator method printsvonw.static PrintWriteroperator$shl(PrintWriter w, float v) This operator method printsvonw.static PrintWriteroperator$shl(PrintWriter w, int v) This operator method printsvonw.static PrintWriteroperator$shl(PrintWriter w, long v) This operator method printsvonw.static PrintWriteroperator$shl(PrintWriter w, Object v) This operator method printsvonw.static <E> List<E> operator$shl(List<E> list, E value) This operator method addsvalueas last element tolist.static booleanorthogonalTropism(Matrix34d m, Tuple3d direction, float e, Matrix4d out) Computes the rotation matrix which implements an orthogonal tropism into a plane perpendicular todirection.static voidDeprecated.replaced byderive()static booleanstatic booleanplot(Aggregate a, DoubleToDouble function, double x) static booleanplot(Aggregate a, IntToDouble function, int x) static booleanplotPoints(Aggregate a, double x, double y) static booleanpositionalTropism(Matrix34d m, Tuple3d target, float e, Matrix4d out) Computes the rotation matrix which implements a positional tropism towards atargetlocation.static voidprint(boolean v) Printsvto the XL console.static voidprint(char v) Printsvto the XL console.static voidprint(double v) Printsvto the XL console.static voidprint(float v) Printsvto the XL console.static voidprint(int v) Printsvto the XL console.static voidprint(long v) Printsvto the XL console.static voidPrintsvto the XL console.static voidPrintsvwith the specified colour to the XL console.static voidprintln()Terminate the current line by writing the line separator string.static voidprintln(boolean v) Printsvto the XL console, then terminates the line.static voidprintln(char v) Printsvto the XL console, then terminates the line.static voidprintln(double v) Printsvto the XL console, then terminates the line.static voidprintln(float v) Printsvto the XL console, then terminates the line.static voidprintln(int v) Printsvto the XL console, then terminates the line.static voidprintln(long v) Printsvto the XL console, then terminates the line.static voidPrintsvto the XL console, then terminates the line.static voidPrintsvwith the specified colour to the XL console, then terminates the line.static booleanprobability(float p) Returns the value of abooleanpseudorandom variable whose probability fortrueisp.static floatrandom(float min, float max) Returns a uniformly distributed pseudorandom number betweenminandmax.static Vector3dPick a random point on the surface of a unit sphere and return it as direction vector.static voidrange(DoubleConsumer consumer, double min, double max) static voidrange(DoubleConsumer consumer, double min, double max, int n) static LineConstructs aLinewhich represents a ray emanating atoriginin the specifieddirection.static ReferenceReturns aReferenceinstance which refers to the object namedname.static voidstatic voidremoveLeaves(Node root, ObjectToBoolean<? super Node> filter) Removes all leaf nodes from the graph which passfilter, starting atroot.static voidRemoves all leaf nodes from the graph which are pure transformation nodes (seeremoveTransformationLeaves(Node, ObjectToBoolean)).static voidremoveTransformationLeaves(Node root, ObjectToBoolean<? super Node> filter) Removes all leaf nodes from the graph which are pure transformation nodes and which passfilter, starting atroot(seeremoveLeaves(de.grogra.graph.impl.Node, de.grogra.xl.lang.ObjectToBoolean<? super de.grogra.graph.impl.Node>)).static voidRepaints the View3D panel.static RGGGraphrggGraph()static voidsaveProjectAs(File file) Save the current project into a .gs or .gsz file.static voidsaveProjectAs(String file) Save the current project into a .gs or .gsz file.static intstatic voidsetDerivationMode(int mode) static voidsetRandomTransform(Null target, Transform3D center, double sigma, double minX, double minY, double maxX, double maxY) static voidsetSeed(long seed) This method sets the seed for the pseudorandom number generator which is used by the random methods in this class.static voidDisplaystextin the current status bar.static voidsetViewCamera(double rx, double ry, double rz, double tx, double ty, double tz, double scalefactor) Set the position, direction and scaling of the View3D window.static ShaderRefReturns aShaderRefinstance which refers to the shader namedname.static shortshortValue(Node w) static SpectrumRefReturns aSpectrumRefinstance which refers to the spectrum namedname.static Statisticsstatistics(Aggregate a, double value) This aggregate method computes aStatisticsobject for a series of valuesa.static Nodesuccessor(Node n, ObjectToBoolean<? super Node> condition) Returns the nearest successor ofnwhich fulfillscondition.static SurfaceRefReturns aSurfaceRefinstance which refers to the surface namedname.static NURBSSurfaceSurface(byte type) Deprecated.static NURBSSurfaceDeprecated.static NURBSSurfaceSurface(float radius) Deprecated.static NURBSSurfaceSurface(BSplineCurve profile) Deprecated.static NURBSSurfaceSurface(BSplineCurveList profiles) Deprecated.static NURBSSurfaceSurface(BSplineCurve profile, String name, boolean useRail) Deprecated.static NURBSSurfaceSurface(BSplineSurface surface) Deprecated.static <T> booleansynthesize(T root, ObjectToObjectGenerator<? super T, ? extends T> generator, ObjectToBoolean<BooleanSynth<? super T>> synth) This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure.static <T> bytesynthesize(T root, ObjectToObjectGenerator<? super T, ? extends T> generator, ObjectToByte<ByteSynth<? super T>> synth) This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure.static <T> charsynthesize(T root, ObjectToObjectGenerator<? super T, ? extends T> generator, ObjectToChar<CharSynth<? super T>> synth) This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure.static <T> doublesynthesize(T root, ObjectToObjectGenerator<? super T, ? extends T> generator, ObjectToDouble<DoubleSynth<? super T>> synth) This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure.static <T> floatsynthesize(T root, ObjectToObjectGenerator<? super T, ? extends T> generator, ObjectToFloat<FloatSynth<? super T>> synth) This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure.static <T> intsynthesize(T root, ObjectToObjectGenerator<? super T, ? extends T> generator, ObjectToInt<IntSynth<? super T>> synth) This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure.static <T> longsynthesize(T root, ObjectToObjectGenerator<? super T, ? extends T> generator, ObjectToLong<LongSynth<? super T>> synth) This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure.static <T,V> V synthesize(T root, ObjectToObjectGenerator<? super T, ? extends T> generator, ObjectToObject<ObjectSynth<? super T, ? super V>, ? extends V> synth) This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure.static <T> shortsynthesize(T root, ObjectToObjectGenerator<? super T, ? extends T> generator, ObjectToShort<ShortSynth<? super T>> synth) This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure.static longtic()Start stopwatch timer tic starts a stopwatch timer to measure performance.static longtoc()Read elapsed time from stopwatch toc reads the elapsed time from the stopwatch timer started by the tic function.static LineReturns a line which corresponds to the central line ofnode.static ObjectToDouble<double[]> static Point3dThe same aslocation(Node).static Point3dtoPoint3d(IntersectionList list) This autoconversion method returns the first intersection point oflist, ornulliflistis empty.static Tuple3dstatic Matrix34dtransformation(Node node) Computes the global coordinate transformation of thenode.static Matrix34dtransformation(Node node, boolean post) Computes the global coordinate transformation of thenode.static MeshNodetriangulate(float[] pointlist) Return aMeshNodein shape of it indicated list of points.static MeshNodetriangulate(Point3d[] pointlist) Return aMeshNodein shape of it indicated list of points.static NullReturn a new node with a transformation matrix set to the desired tropism.static NullReturn a new node with a transformation matrix set to the desired tropism.static voidundo()Undo the last derivation step.static voidvisitGraphNodes(Set<Node> set, Node node) voidvisitNodes(Set<Node> set, Node node) Put node into the set and visit child nodes.static RGBAShadervisualizeAsColor(double x) Returns a color shader whose color represents the value ofxwhich has to lie between -1 and 1.static VolumeReturns a volume which corresponds to the shape ofnode.static WorkbenchReturns the currently activeWorkbench.
-
Field Details
-
successor
public static final int successorThis is a redefinition ofGraph.SUCCESSOR_EDGE.- See Also:
-
branch
public static final int branchThis is a redefinition ofGraph.BRANCH_EDGE.- See Also:
-
contains
public static final int containsThis is a redefinition ofGraph.CONTAINMENT_EDGE.- See Also:
-
refine
public static final int refineThis is a redefinition ofGraph.REFINEMENT_EDGE.- See Also:
-
notifies
public static final int notifiesThis is a redefinition ofGraph.NOTIFIES_EDGE.- See Also:
-
mark
public static final int markThis is a redefinition ofGraph.MARK_EDGE.- See Also:
-
updates
public static final int updatesThis is a redefinition ofFieldUpdater.UPDATES.- See Also:
-
master
public static final int masterThis is a redefinition ofInstance3D.MASTER.- See Also:
-
EDGE_0
public static final int EDGE_0- See Also:
-
EDGE_1
public static final int EDGE_1- See Also:
-
EDGE_2
public static final int EDGE_2- See Also:
-
EDGE_3
public static final int EDGE_3- See Also:
-
EDGE_4
public static final int EDGE_4- See Also:
-
EDGE_5
public static final int EDGE_5- See Also:
-
EDGE_6
public static final int EDGE_6- See Also:
-
EDGE_7
public static final int EDGE_7- See Also:
-
EDGE_8
public static final int EDGE_8- See Also:
-
EDGE_9
public static final int EDGE_9- See Also:
-
EDGE_10
public static final int EDGE_10- See Also:
-
EDGE_11
public static final int EDGE_11- See Also:
-
EDGE_12
public static final int EDGE_12- See Also:
-
EDGE_13
public static final int EDGE_13- See Also:
-
EDGE_14
public static final int EDGE_14- See Also:
-
SKIN
public static final byte SKINConstant forNURBSSurface(byte)indicating a skinned surface (defined by a set of profile curves in space).- See Also:
-
SWEEP
public static final byte SWEEPConstant forNURBSSurface(byte)indicating a swept surface (defined by a set of vertices in space).- See Also:
-
I18N
The resource bundle for thede.grogra.rggpackage. -
DEG
public static final double DEGConversion factor from degree to radians.- See Also:
-
R2D
public static final double R2DConversion factor from radians to degree.- See Also:
-
LEFT
Vector pointing in the x-direction (the turtle's left axis). Do not modify its contents. -
UP
Vector pointing in the y-direction (the turtle's up axis). Do not modify its contents. -
HEAD
Vector pointing in the z-direction (the turtle's head axis). Do not modify its contents. -
ORIGIN
Point having coordinates (0, 0, 0). Do not modify its contents. -
makeGraph
-
CONVEXHULL
public static final int CONVEXHULL- See Also:
-
BOUNDING_RECTANGLE
public static final int BOUNDING_RECTANGLE- See Also:
-
ALPHA_SHAPE
public static final int ALPHA_SHAPE- See Also:
-
DEFAULT_LEAF3D
public static float[][] DEFAULT_LEAF3D -
DEFAULT_LEAF3D_NAME
-
out
This field provides aPrintWriterto write to the XL console. -
scaleTypeMap
-
-
Constructor Details
-
Library
public Library()
-
-
Method Details
-
console
Returns the currently activeConsole. This may returnnull.- Returns:
- current console or
null
-
workbench
Returns the currently activeWorkbench. This may returnnull.- Returns:
- current workbench or
null
-
closeWorkbench
public static void closeWorkbench()Closes the currently activeWorkbenchif such a workbench exists. Note that unsaved modifications are lost, because the user is not asked. -
graph
Returns the current project graph, i.e., the project graph of the currently activeWorkbench. This may returnnull.- Returns:
- current project graph or
null
-
getProjectGraph
Returns the current project graph, i.e., the project graph of the currently activeWorkbench. This may returnnull.- Returns:
- current project graph or
null
-
getMetaGraph
Returns the current meta/registry graph, i.e., the meta/registry graph of the currently activeWorkbench. This may returnnull.- Returns:
- current meta/registry graph or
null
-
graphState
Returns the current graph state, i.e., the current graph state of the project graph of the currently activeWorkbench.- Returns:
- current graph state
-
extent
Deprecated. -
rggGraph
-
allowNoninjectiveMatchesByDefault
public static void allowNoninjectiveMatchesByDefault(boolean value) -
allowNoninjectiveMatchesForNextQuery
Deprecated. -
setDerivationMode
public static void setDerivationMode(int mode) -
tic
public static long tic()Start stopwatch timer tic starts a stopwatch timer to measure performance. The function records the internal time at execution of the tic command. Display the elapsed time with the toc function.- Returns:
- returns the value of the internal timer [ms] at the execution of the tic command
-
toc
public static long toc()Read elapsed time from stopwatch toc reads the elapsed time from the stopwatch timer started by the tic function. The function reads the internal time at the execution of the toc command, and displays the elapsed time since the most recent call to the tic function, in milliseconds.- Returns:
- returns the elapsed time; -1, if tic was not called in advance
-
undo
public static void undo()Undo the last derivation step. -
namedNode
Returns a node having the specifiedname.- Parameters:
name- name of a node- Returns:
- a node whose name is
name, ornullif no such node exists - See Also:
-
setStatus
Displaystextin the current status bar.- Parameters:
text- a text to be displayed
-
chart
Shows the data referenced bydsin a chart panel.typeis one of the constants declared inChartPanel, this specifies the type of chart.- Parameters:
ds- reference to aDatasettype- chart type
-
axisparent
-
isAncestor
Tests whetherais an ancestor ofd(orditself), i.e., ifacan be reached fromdby a backward traversal of edges matchingedgeMask(seeEdge.testEdgeBits(int)). Note that this method expects the relevant part of the subgraph spanned by matching edges to be a tree.- Parameters:
a- the potential ancestord- the potential descendantedgeMask- the edge mask to use- Returns:
trueiffais an ancestor ofd
-
findComplex
Return node that connect tonwith refinement/decomposition edge- Parameters:
n- : a node in the current groimp graph- Returns:
- Complex node of given node n
-
findComponents
Return nodes that connect fromnwith refinement/decomposition edge- Parameters:
n- : a node in the current groimp graph- Returns:
- A set of component nodes of given node n
-
findFinestComponents
Return nodes that connect fromnthrough one or more refinement/decomposition steps, and without any outgoing decomposition edge.- Parameters:
n- : a node in the current groimp graph- Returns:
- A set of component nodes of given node n
-
findParent
Return node that connect tonwith successor or branch edge- Parameters:
n- : a node in the current groimp graph- Returns:
- Parent node of given node n
-
findChildren
Return nodes that connect fromnwith successor or branch edge- Parameters:
n- : a node in the current groimp graph- Returns:
- A set of child nodes of given node n
-
getCurrentScaleTypesMap
-
addOrUpdateTypeGraph
public static void addOrUpdateTypeGraph() -
getEdgeBit
Returns the GroIMP specific edge bits for a given xml edge type.- Parameters:
type-- Returns:
-
getScaleNumber
Get the scale number, a given node locates at the scale- Parameters:
node-- Returns:
- a sequence number that refers to a scale on the current multiscale groimp graph.
-
getRootsAtScale
- Parameters:
scaleNumber- : a sequence number that refers to a scale on the current multiscale groimp graph. Attention: the scaleNumber counts from from RGGRoot which is 0- Returns:
- a set if root nodes at given scale indicating by a sequence number
-
getNodesAtScale
- Parameters:
scaleNumber- : a sequence number that refers to a scale on the current multiscale groimp graph. Attention: the scaleNumber counts from from RGGRoot which is 0- Returns:
- a set if nodes at given scale indicating by a sequence number
-
getMaxScaleNumber
public static int getMaxScaleNumber()- Returns:
- the max sequence number on the the current multiscale groimp graph.
-
getGraphScaleNumber
public static int getGraphScaleNumber()Get the amount of scale in current groimp multiscale graph.- Returns:
- an integer stands for the amount of scale
-
getGraphNodes
-
getGraphRoot
-
visitGraphNodes
- Parameters:
set-node-
-
findAllNodesAtSameScale
-
visitNodes
Put node into the set and visit child nodes.- Parameters:
set-node-
-
irandom
public static int irandom(int min, int max) Returns a uniformly distributed integral pseudorandom number betweenminandmax(inclusive).- Parameters:
min- minimal valuemax- maximal value- Returns:
- integral random number between
minandmax - See Also:
-
random
public static float random(float min, float max) Returns a uniformly distributed pseudorandom number betweenminandmax.- Parameters:
min- minimal valuemax- maximal value- Returns:
- random number between
minandmax - See Also:
-
probability
public static boolean probability(float p) Returns the value of abooleanpseudorandom variable whose probability fortrueisp.- Parameters:
p- probability fortrue- Returns:
- random value
- See Also:
-
normal
public static float normal(float mu, float sigma) Returns a pseudorandom number which is distributed according to a normal distribution with mean valuemuand standard deviationsigma.- Parameters:
mu- mean valuesigma- standard deviation- Returns:
- normally distributed random number
- See Also:
-
lognormal
public static double lognormal(double mu, double sigma) -
normal
public static double normal(double mu, double sigma) Returns a pseudorandom number which is distributed according to a normal distribution with mean valuemuand standard deviationsigma.- Parameters:
mu- mean valuesigma- standard deviation- Returns:
- normally distributed random number
- See Also:
-
distribution
public static int distribution(float[] probabilities) Returns an integral pseudorandom number according to the discrete distributionprobabilities. The valueihas the probabilityprobabilities[i]for0 invalid input: '<'= i invalid input: '<' probabilities.length, the valueprobabilities.lengthhas the remaining probability, i.e., the difference between the sum ofprobabilitiesand1.- Parameters:
probabilities- array of discrete probabilities- Returns:
- random number according to
probabilities - See Also:
-
setSeed
public static void setSeed(long seed) This method sets the seed for the pseudorandom number generator which is used by the random methods in this class. This is the generator obtained byOperators.getRandomGenerator()within the current thread.- Parameters:
seed- a seed
-
ancestor
Returns the nearest ancestor ofnwhich is an instance oft. Ancestors are those nodes which can be reached by traversingsuccessor- orbranch-edges backwards.- Parameters:
n- a nodet- the type so search for- Returns:
- nearest ancestor of type
t, ornull
-
minDescendants
This generator method yields all descendants ofnwhich are instances oftand which have no other instance oftin their path ton. Descendants are those nodes which can be reached by traversingsuccessor- orbranch-edges forwards.- Parameters:
cb- a consumer instance receiving the nodes (provided by the XL compiler)n- a nodet- the type to seach for- Returns:
null
-
ancestor
Returns the nearest ancestor ofnwhich fulfillscondition. Ancestors are those nodes which can be reached by traversingsuccessor- orbranch-edges backwards.- Parameters:
n- a nodecondition- a condition- Returns:
- nearest ancestor fulfilling
condition, ornull
-
successor
Returns the nearest successor ofnwhich fulfillscondition. Successors are those nodes which can be reached by traversingsuccessor-edges forwards.- Parameters:
n- a nodecondition- a condition- Returns:
- nearest successor fulfilling
condition, ornull
-
descendants
This generator method yields all descendants ofnwhich are instances ofcls. Descendants are those nodes which can be reached by traversingsuccessor- orbranch-edges forwards.- Parameters:
cb- a consumer instance receiving the nodes (provided by the XL compiler)n- a nodecls- the type to seach for- Returns:
null
-
filter
Creates a condition which is fulfilled for an object iff it is an instance of at least one of the specifiedclasses(or iff it is not an instance in caseisTrueisfalse).- Parameters:
classes- list of classesisTrue- condition value iff object is an instance of one ofclasses- Returns:
- a condition
-
transformation
Computes the global coordinate transformation of thenode. The returned matrix must not be modified.- Parameters:
node- a node- Returns:
- the node's global coordinate transformation
-
transformation
Computes the global coordinate transformation of thenode. Ifpostisfalse, the transformation of thenodeitself is returned, otherwise the transformation of its children. These may differ ifnodeinduces a change of coordinates. The returned matrix must not be modified.- Parameters:
node- a nodepost-trueiff the post-transformation (of the node's children) shall be returned- Returns:
- the node's global coordinate transformation
-
location
Computes the location ofnodein global coordinates. The computed value is written tolocation. The location is defined by the point (0, 0, 0) in local coordinates of thenodeifendisfalse, or of thenode's children ifendistrue.- Parameters:
loc- receives the locationnode- a nodeend- use location or end location ofnode
-
direction
Computes the growth direction of the turtle atnodein global coordinates. The computed value is written todirection. The direction is defined by the direction (0, 0, 1) in local coordinates of thenodeifendisfalse, or of thenode's children ifendistrue.- Parameters:
dir- receives the directionnode- a nodeend- use location or end location ofnode
-
location
Computes the location ofnodein global coordinates. The location is defined by the point (0, 0, 0) in local coordinates.- Parameters:
node- a node- Returns:
- the
node's location in global coordinates - See Also:
-
toPoint3d
The same aslocation(Node). This method is designed as an auto-conversion method.- Parameters:
node- a node- Returns:
- the
node's location in global coordinates
-
toTuple3d
-
direction
Computes the growth direction of the turtle atnodein global coordinates. The direction is defined by the direction (0, 0, 1) in local coordinates.- Parameters:
node- a node- Returns:
- the turtle's growth direction at
node - See Also:
-
extremelocation
-
getShapeExtremePoints
-
endlocation
Computes the end location ofnodein global coordinates. The end location is defined by the point (0, 0, 0) in local coordinates ofnode's children.- Parameters:
node- a node- Returns:
- the
node's end location in global coordinates - See Also:
-
enddirection
Computes the growth direction of the turtle at the end ofnodein global coordinates. The direction is defined by the direction (0, 0, 1) in local coordinates ofnode's children.- Parameters:
node- a node- Returns:
- the turtle's growth direction at
node's children - See Also:
-
angle
Computes the rotation angle in degrees of the transformation defined bynode. The computed value will be correct if the transformation is a rotation, possibly combined with a uniform scaling.- Parameters:
node- a node- Returns:
- the rotation angle of the transformation of
node, in degrees
-
inclination
-
angle
-
setRandomTransform
public static void setRandomTransform(Null target, Transform3D center, double sigma, double minX, double minY, double maxX, double maxY) -
distanceSquared
Calculate squared distance between node a an node b.- Parameters:
a- node ab- node b- Returns:
- squared distance between a and b
-
distance
Computes the global distance between two nodes. The distance is measured between the points (0, 0, 0) in the local coordinate systems of the nodes.- Parameters:
a- first nodeb- second node- Returns:
- global distance between nodes
-
cone
Returns a cone whose tip is located atorigin, whose central axis hasdirectionas direction, and whose half opening angle isangle(in degrees). The cone has no base plane, i.e., it extends to infinity.- Parameters:
origin- location of the cone's tipdirection- direction of the cone's axisangle- half opening angle in degrees- Returns:
- instance of
Conecorresponding to the specified geometry
-
cone
Returns a cone whose tip is defined by the location ofnode. Depending onend, the location or end location ofnodeis used (seelocation(Tuple3d, Node, boolean)). The axis of the cone points into the local z-direction of the coordinate system ofnodeornode's children (again depending onend). The cone has no base plane, i.e., it extends to infinity.- Parameters:
node- node which defines the cone's tipend- use location or end location ofnodeangle- half opening angle in degrees- Returns:
- instance of
Conecorresponding to the specified geometry
-
ray
Constructs aLinewhich represents a ray emanating atoriginin the specifieddirection. Thestartparameter of the line is set to 0, theendparameter is set to infinity.- Parameters:
origin- origin of the raydirection- direction of the ray- Returns:
- new ray
-
intersect
Compute all intersections betweenlineand the surface ofvolume. The returned list is valid until the next invocation of this method within the same thread.- Parameters:
line- a linevolume- a volume- Returns:
- list containing all intersections of the line and the volume's surface
-
operator$and
This operator method is an alias forintersect(de.grogra.vecmath.geom.Line, de.grogra.vecmath.geom.Volume).- Parameters:
line- a linevolume- a volume- Returns:
- list containing all intersections of the line and the volume's surface
-
toPoint3d
This autoconversion method returns the first intersection point oflist, ornulliflistis empty. The returned point may be modified.- Parameters:
list- list of previously computed intersections- Returns:
- first intersection point, or
null
-
height
This method returns the height of a volume at a point(x, y)(in global coordinates). This is the maximum z-coordinate of the volume at(x, y). If the volume does not contain a point with matching xy-coordinates, 0 is returned.- Parameters:
volume- a volumex- global x-coordinatey- global y-coordinate- Returns:
- height of
volumeat(x, y), or 0
-
toLine
Returns a line which corresponds to the central line ofnode. The central line starts at thelocation(Node)of the node and extends to theendlocation(Node)of the node.- Parameters:
node- a node- Returns:
- central line of the node
-
volume
Returns a volume which corresponds to the shape ofnode. Ifnodehas no shape, an empty volume is returned.- Parameters:
node- a node- Returns:
- volume corresponding the
node's shape
-
distanceToLine
Returns the distance betweenpointandline.- Parameters:
point- a pointline- a line- Returns:
- distance between
pointandline - See Also:
-
intersectionLength
Determines the fraction of thelinewhich intersects the specifiedcone.- Parameters:
line- line to intersectcone- cone to intersect- Returns:
- fraction of
linewhich intersectscone
-
directionalTropism
Computes the rotation matrix which implements a directional tropism towards adirection. This is done as follows: The matrixmis interpreted as the transformation matrix from local to global coordinates. Thus, the local z-direction (the growth direction) has the valuev = (m.m02, m.m12, m.m22)in global coordinates. Now the cross productd = v0 × direction, wherev0is the unit vector in direction ofv, defines the axis about which a rotation has to be performed in order to achieve the desired tropism. This direction is transformed to the local coordinates ofm, andoutis set to a rotation about this transformed direction, its angle being the length ofdmultiplied bye(in radians).
If the absolute value of the angle is less than1e-10, no rotation matrix is computed and this method returnsfalse. Thenoutdoes not contain a valid rotation matrix and should be ignored. This case happens when the growth direction is (anti-)parallel to the desireddirectionof the tropism.- Parameters:
m- transformation matrix from local to global coordinatesdirection- direction of the tropism in global coordinatese- strength of the tropismout- the computed rotation matrix is placed in here (only valid if the returned value istrue)- Returns:
trueiff a rotation matrix has been computed
-
positionalTropism
Computes the rotation matrix which implements a positional tropism towards atargetlocation. For the details of computation, seedirectionalTropism(de.grogra.vecmath.Matrix34d, javax.vecmath.Tuple3d, float, javax.vecmath.Matrix4d), where thedirectionargument is the normalized direction vector from the origin of the local coordinate system(m.m03, m.m13, m.m23)totarget.
If, for mathematical reasons, no rotation matrix can be computed or if no rotation is needed because the local growth direction already points totarget, this method returnsfalse. In this case,outdoes not contain a valid rotation matrix and should be ignored.- Parameters:
m- transformation matrix from local to global coordinatestarget- target location of the tropism in global coordinatese- strength of the tropismout- the computed rotation matrix is placed in here (only valid if the returned value istrue)- Returns:
trueiff a rotation matrix has been computed
-
orthogonalTropism
Computes the rotation matrix which implements an orthogonal tropism into a plane perpendicular todirection. This is done as follows: The matrixmis interpreted as the transformation matrix from local to global coordinates. Thus, the local z-direction (the growth direction) has the valuev = (m.m02, m.m12, m.m22)in global coordinates. Now the cross productd = v0 × direction, wherev0is the unit vector in direction ofv, defines the axis about which a rotation has to be performed in order to achieve the desired tropism. This direction is transformed to the local coordinates ofm, andoutis set to a rotation about this transformed direction, its angle being the negated value of the scalar productv0 · directionmultiplied bye(in radians).
If the absolute value of the angle is less than1e-10, no rotation matrix is computed and this method returnsfalse. Thenoutdoes not contain a valid rotation matrix and should be ignored. This case happens when the growth direction is (anti-)parallel to the desireddirectionof the tropism.- Parameters:
m- transformation matrix from local to global coordinatesdirection- direction of the tropism in global coordinatese- strength of the tropismout- the computed rotation matrix is placed in here (only valid if the returned value istrue)- Returns:
trueiff a rotation matrix has been computed
-
tropism
Return a new node with a transformation matrix set to the desired tropism.- Parameters:
a- node containing original orientationdirection- target direction towards the tropism should orient toe- strength of the tropism- Returns:
- a node with a transformation set to the requested tropism
- See Also:
-
tropism
Return a new node with a transformation matrix set to the desired tropism.- Parameters:
a- node containing original orientationtarget- target location towards the tropism should orient toe- strength of the tropism- Returns:
- a node with a transformation set to the requested tropism
- See Also:
-
cloneSubgraph
This method clones the subgraph starting atrootand returns the cloned node which corresponds toroot. The subgraph consists of all nodes which can be reached by traversing edges in forward direction. Nodes are cloned deeply, i.e., field values are cloned, too.- Parameters:
root- root node of subgraph- Returns:
- corresponding root node of cloned subgraph
- Throws:
CloneNotSupportedException
-
cloneNode
- Throws:
CloneNotSupportedException
-
booleanValue
Returns thebooleanvalue which is wrapped inwifwis an instance ofBooleanNode. Otherwise this method returns false.- Parameters:
w- a node- Returns:
- wrapped
booleanvalue, or false
-
byteValue
Returns thebytevalue which is wrapped inwifwis an instance ofByteNode. Otherwise this method returns 0.- Parameters:
w- a node- Returns:
- wrapped
bytevalue, or 0
-
shortValue
Returns theshortvalue which is wrapped inwifwis an instance ofShortNode. Otherwise this method returns 0.- Parameters:
w- a node- Returns:
- wrapped
shortvalue, or 0
-
charValue
Returns thecharvalue which is wrapped inwifwis an instance ofCharNode. Otherwise this method returns 0.- Parameters:
w- a node- Returns:
- wrapped
charvalue, or 0
-
intValue
Returns theintvalue which is wrapped inwifwis an instance ofIntNode. Otherwise this method returns 0.- Parameters:
w- a node- Returns:
- wrapped
intvalue, or 0
-
longValue
Returns thelongvalue which is wrapped inwifwis an instance ofLongNode. Otherwise this method returns 0.- Parameters:
w- a node- Returns:
- wrapped
longvalue, or 0
-
floatValue
Returns thefloatvalue which is wrapped inwifwis an instance ofFloatNode. Otherwise this method returns 0.- Parameters:
w- a node- Returns:
- wrapped
floatvalue, or 0
-
doubleValue
Returns thedoublevalue which is wrapped inwifwis an instance ofDoubleNode. Otherwise this method returns 0.- Parameters:
w- a node- Returns:
- wrapped
doublevalue, or 0
-
objectValue
Returns theObjectvalue which is wrapped inwifwis an instance ofObjectNode,NURBSCurve(aNURBSCurvenode wraps its containedBSplineCurve) orNURBSSurface(aNURBSSurfacenode wraps its containedBSplineSurface). Otherwise this method returns null.- Parameters:
w- a node- Returns:
- wrapped
Objectvalue, or null
-
isSelected
Determines ifnhas been selected in the workbench by the user.- Parameters:
n- a node- Returns:
trueiffnis contained in the current selection
-
function
Returns aFunctioninstance which refers to the function namedname. The list of functions in GroIMP is available in the panel "Object Explorers/Math Objects/Functions".- Parameters:
name- name of function within GroIMP- Returns:
FunctionRefreferring to the named function
-
curve
Returns aCurveRefinstance which refers to the curve namedname. The list of curves in GroIMP is available in the panel "Object Explorers/Math Objects/Curves".- Parameters:
name- name of curve within GroIMP- Returns:
CurveRefreferring to the named curve
-
surface
Returns aSurfaceRefinstance which refers to the surface namedname. The list of surfaces in GroIMP is available in the panel "Object Explorers/Math Objects/Surfaces".- Parameters:
name- name of surface within GroIMP- Returns:
SurfaceRefreferring to the named surface
-
dataset
Returns aDatasetRefinstance which refers to the dataset namedname. The list of datasets in GroIMP is available in the panel "Object Explorers/Datasets".- Parameters:
name- name of dataset within GroIMP- Returns:
DatasetRefreferring to the named dataset
-
shader
Returns aShaderRefinstance which refers to the shader namedname. The list of shaders in GroIMP is available in the panel "Object Explorers/3D/Shaders".- Parameters:
name- name of shader within GroIMP- Returns:
ShaderRefreferring to the named shader
-
image
Returns anImageRefinstance which refers to the image namedname. The list of images in GroIMP is available in the panel "Object Explorers/Images".- Parameters:
name- name of image within GroIMP- Returns:
ImageRefreferring to the named image
-
spectrum
Returns aSpectrumRefinstance which refers to the spectrum namedname. The list of spectra in GroIMP is available in the panel "Object Explorers/Light Spectra".- Parameters:
name- name of spectrum within GroIMP- Returns:
ImageRefreferring to the named spectrum
-
light
Returns aLightDistributionRefinstance which refers to the light distribution namedname. The list of light distributionRef in GroIMP is available in the panel "Object Explorers/3D/lights/Light Distribution".- Parameters:
name- name of light distribution within GroIMP- Returns:
LightDistributionRefreferring to the named light distribution.
-
material
Deprecated. -
file
Returns aFileRefinstance which refers to the file namedname. The list of files in GroIMP is available in the panel "File Explorer".
Ifnamedoes not contain the character '/' or the characterIO.SYSTEM_ID_SEPARATOR,nameis prefixed byIO.PROJECT_FSfollowed byIO.SYSTEM_ID_SEPARATOR. Thus, in this casenameis assumed to refer to a file in the virtual file system of the project.- Parameters:
name- name of file within GroIMP- Returns:
FileRefreferring to the named file
-
reference
Returns aReferenceinstance which refers to the object namedname. The list of objects in GroIMP is available in the panel "Object Explorers/Objects".- Parameters:
name- name of object within GroIMP- Returns:
Referencereferring to the named object
-
exportGraphToFile
Writes the current graph to a file.- Parameters:
fileName- name of the output file
-
list
public static void list()Prints the JavaDoc description of all available commands on the XL console window. -
list
Prints a list of all available commands starting with the specified sequence.- Parameters:
prefix- of the commands
-
help
Prints the JavaDoc description of all available commands starting with the specified prefix on the XL console window.- Parameters:
prefix- of the commands for those the description should be printed
-
makeRenderedImageFlux
Creates a Flux rendered image of the actual scene with the default camera position and a fixed image size of 800x600.- Parameters:
fileName- name of the output file
-
makeRenderedImageFlux
Creates a Flux rendered image of the actual scene with the default camera position and a variable image size.- Parameters:
fileName- name of the output filewidth-height-
-
makeRenderedImage
Creates a Twilight rendered image of the actual scene with the default camera position and a fixed image size of 800x600.- Parameters:
fileName- name of the output file
-
makeRenderedImage
Creates a Twilight rendered image of the actual scene with the default camera position and a variable image size.- Parameters:
fileName- name of the output filewidth-height-
-
makeRenderedImageHL
Creates a Twilight rendered image of the actual scene if no View3D instance is available as it is when running headless, using the default camera position and a fixed image size of 800x600.- Parameters:
fileName- name of the output file
-
makeRenderedImageHL
Creates a Twilight rendered image of the actual scene if no View3D instance is available as it is when running headless, using the default camera position and a variable image size.- Parameters:
fileName- name of the output filewidth-height-
-
makeRenderedImage
Creates a Twilight rendered image of the actual scene with the specified camera and a variable image size.- Parameters:
fileName- name of the output filecameraName- name of a specific camerawidth-height-
-
getCameraPosition
public static void getCameraPosition(double[] vec) -
getCameraByName
-
makeRenderedImage
Creates a rendered image of the actual scene with the specified camera and a variable image size.- Parameters:
fileName- name of the output filewidth-height-specific- camera
-
makeSnapshot
Creates a snapshot of the actual scene.- Parameters:
fileName- name of the output file
-
setViewCamera
public static void setViewCamera(double rx, double ry, double rz, double tx, double ty, double tz, double scalefactor) Set the position, direction and scaling of the View3D window. Use the function to manually control the viewing angle, zoom and position. E.g., setViewCamera(-1.0,0,0.7, 0,-0.5,-5, 0.5);- Parameters:
rx- rotation about the x-axes [rad]ry- rotation about the y-axes [rad]rz- rotation about the z-axes [rad]tx- translation along the x-axes [m]ty- translation along the y-axes [m]tz- translation along the z-axes [m]scalefactor- [-]
-
export3DScene
public static void export3DScene(String fileName, String format, Boolean onlyVisibleLayer) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException Exports the current 3D scene to the specified target file and format. Currently supported formats of target files: - dxf - x3d - mtg - stl - ply - obj - tex - webgl- Parameters:
fileName- name of the output fileformat- target file formatvisibleLayer- export only the visibleLayer?- Throws:
InvocationTargetExceptionIllegalAccessExceptionInstantiationExceptionNoSuchMethodException
-
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. Checkexport3DScenefor a subgraph 3d export. Currently supported formats of target files: - dxf - x3d - mtg - stl - ply - obj - tex - webgl- Parameters:
file- output fileformat- target file formatvisibleLayer- export only the visibleLayer?- Throws:
InvocationTargetExceptionIllegalAccessExceptionInstantiationExceptionNoSuchMethodException
-
export3DScene
public static void export3DScene(String fileName, MimeType format, Boolean onlyVisibleLayer) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException Exports the current 3D scene to the specified target file and format.- Parameters:
fileName- name of the output fileformat- target file formatonlyVisibleLayer- export only the visibleLayer?- Throws:
InvocationTargetExceptionIllegalAccessExceptionInstantiationExceptionNoSuchMethodException
-
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:
format- target file formatonlyVisibleLayer- export only the visibleLayer?fileName- name of the output file- Throws:
InvocationTargetExceptionIllegalAccessExceptionInstantiationExceptionNoSuchMethodException
-
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. Checkexport3DScenefor a subgraph 3d export. Currently supported formats of target files: - dxf - x3d - mtg - stl - ply - obj - tex - webgl- Parameters:
fileName- name of the output fileformat- target file formatvisibleLayer- export only the visibleLayer?- Throws:
InvocationTargetExceptionIllegalAccessExceptionInstantiationExceptionNoSuchMethodException
-
export3DScene
public static void export3DScene(File file, String format) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException Exports the current 3D scene to the specified target file and format. Checkexport3DScenefor a subgraph 3d export. Currently supported formats of target files: - dxf - x3d - mtg - stl - ply - obj - tex - webgl- Parameters:
file- output fileformat- target file formatvisibleLayer- export only the visibleLayer?- Throws:
InvocationTargetExceptionIllegalAccessExceptionInstantiationExceptionNoSuchMethodException
-
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 onexport3DSceneCheckexport3DScenefor other 3d export options. Currently supported formats of target files: - dxf - x3d - mtg - stl - ply - obj - tex - webgl- Parameters:
file- output fileformat- target file formatvisibleLayer- export only the visibleLayer?- Throws:
InvocationTargetExceptionIllegalAccessExceptionInstantiationExceptionNoSuchMethodException
-
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. Checkexport3DScenefor other 3d export options. Currently supported formats of target files: - dxf - x3d - mtg - stl - ply - obj - tex - webgl- Parameters:
format- target file formatroot- the root node of the exported graphfile- output file- Throws:
InvocationTargetExceptionIllegalAccessExceptionInstantiationExceptionNoSuchMethodException
-
leaf
Returns a new, rectangular instance ofParallelogramcreated by the constructor invocationParallogram(length, width)and havingRGBAShader.GREENas its shader.- Parameters:
length- length of rectanglewidth- width of rectangle- Returns:
- green rectangle
-
leaf3d
Return aMeshNodein shape of a 3d leaf.- Returns:
- mash of the default 3d leaf
-
leaf3d
Return aMeshNodein shape of it indicated default leaf.- Parameters:
id- of the indicated leaf- Returns:
- mash of the default 3d leaf
-
leaf3d
Return aMeshNodein shape of it indicated list of points. The list of points will be automatically triangulated and returned asMeshNode. pointlist={x1,y1,z1, ..., xn,yn,zn).- Parameters:
pointlist-- Returns:
- mash of the pointlist
-
triangulate
Return aMeshNodein shape of it indicated list of points. The list of points will be automatically triangulated and returned asMeshNode. pointlist={x1,y1,z1, ..., xn,yn,zn). First point p0={x1,y1,z1}, faces between {{p0,p1,p2}, {p0,p2,p3}, {p0,p3,p4}, ...}- Parameters:
pointlist-- Returns:
- mash of the pointlist
-
getAreaOfNonTriangulation
public static double getAreaOfNonTriangulation(float[] pointlist) Calculates the area of the surface generated by the specified list of points. The list of points will be automatically triangulated. pointlist={x1,y1,z1, ..., xn,yn,zn). First point p0={x1,y1,z1}, faces between {{p0,p1,p2}, {p0,p2,p3}, {p0,p3,p4}, ...} Note: Calculation will be wrong, when the described shape is too concave. the resulting area will be too large in this case.- Parameters:
pointlist-- Returns:
- area
-
getAreaOfTriangulation
public static double getAreaOfTriangulation(float[] pointlist) Calculates the area of the surface generated by the specified list of points. It is assumed, that the list of points is triangulated. pointlist={x1,y1,z1, ..., xn,yn,zn). First point p0={x1,y1,z1}, faces between {{p0,p1,p2}, {p3,p4,p5}, {p6,p7,p8}, ...}- Parameters:
pointlist-- Returns:
- area
-
getAreaOfTriangulation
public static double getAreaOfTriangulation(float scaleX, float scaleY, float scaleZ, float[] pointlist) Calculates the area of the surface generated by the specified list of points. It is assumed, that the list of points is triangulated. pointlist={x1,y1,z1, ..., xn,yn,zn). First point p0={x1,y1,z1}, faces between {{p0,p1,p2}, {p3,p4,p5}, {p6,p7,p8}, ...} Before the area calculation takes please a scaling is performed.- Parameters:
pointlist-scaling- factor Xscaling- factor Yscaling- factor Z- Returns:
- area
-
getMesh
Return aMeshNodein shape of it indicated list of points. The list of points has to be triangulated.- Parameters:
vertexData-- Returns:
- mash of the vertexData
-
triangulate
Return aMeshNodein shape of it indicated list of points. The list of points will be automatically triangulated and returned asMeshNode. pointlist={x1,y1,z1, ..., xn,yn,zn). First point p0={x1,y1,z1}, faces between {{p0,p1,p2}, {p0,p2,p3}, {p0,p3,p4}, ...}- Parameters:
pointlist-- Returns:
- mash of the pointlist
-
getAreaOfNonTriangulation
Calculates the area of the surface generated by the specified list of points. The list of points will be automatically triangulated. pointlist={x1,y1,z1, ..., xn,yn,zn). First point p0={x1,y1,z1}, faces between {{p0,p1,p2}, {p0,p2,p3}, {p0,p3,p4}, ...}- Parameters:
pointlist-- Returns:
- area
-
getAreaOfTriangulation
Calculates the area of the surface generated by the specified list of points. It is assumed, that the list of points is triangulated. pointlist={x1,y1,z1, ..., xn,yn,zn). First point p0={x1,y1,z1}, faces between {{p0,p1,p2}, {p3,p4,p5}, {p6,p7,p8}, ...}- Parameters:
pointlist-- Returns:
- area
-
getMesh
Return aMeshNodein shape of it indicated list of points. The list of points has to be triangulated.- Parameters:
vertexData-- Returns:
- mash of the vertexData
-
getMesh
Returns aMeshNodeas visualization of the given convex hull.- Parameters:
hull-- Returns:
- mash of the vertexData
-
getMesh
Return aMeshNodein shape of it indicated list of points. The list of points has to be triangulated.- Parameters:
pointlist-- Returns:
- mash of the vertexData
-
getMesh
Return aMeshNodein shape of it indicated list of points. The list of points has to be triangulated. The values of the input list will be casted to float.- Parameters:
pointlist-- Returns:
- mash of the vertexData
-
getSurfaceArea
Calculates the area of all nodes of the subgraph with the node root as root node Intersection with other object are not considered.The total area will be calculated. Keep in mind, that the getSurfaceArea function is only implemented for basic primitive object. For all other objects it will return zero.- Returns:
- volume
-
getVolume
Calculates the volume of all nodes of the subgraph with the node root as root node. Intersection with other object are not considered.The total volume will be calculated. Keep in mind, that the getVolume function is only implemented for basic primitive object. For all other objects it will return zero.- Returns:
- volume
-
getClosesedObject
Finds the colosed (euclidian distance) object of typeShadedNullto the parametern. If there are several nodes with the same shortesed distance, only the first one will be returned- Parameters:
n- node from for that the closesed neightbour should be searched.- Returns:
- instance of the closesed node
-
getClosesedObject
Finds the colosed (euclidian distance) object of typeclsto the parametern. If there are several nodes with the same shortesed distance, only the first one will be returned- Parameters:
n- node from for that the closesed neightbour should be searched.cls- class/type of the wanted node to be found- Returns:
- instance of the closesed node
-
repaintView3D
public static void repaintView3D()Repaints the View3D panel. When repaint of View3D is deactivated it will be reactivated, repainted and disabled again. Makes use of Dummy nodes (and/or artificial changes of the graph to trigger an repaint) unnecessary. -
disableView3DRepaint
public static void disableView3DRepaint()Disables repaint of View3D panel. -
enableView3DRepaint
public static void enableView3DRepaint()Enables repaint of View3D panel after it was deactivated withdisableView3DRepaint(). -
convexhull
Constructs the convex hull of a set of points.- Parameters:
points- input points
-
convexhull
Constructs the convex hull of a set of coordinates. Assuming 3 values for each point: {x0,y0,z0, x1,y1,z1, ...}- Parameters:
points- input points
-
convexhull
Constructs the convex hull of a set of coordinates. Assuming 3 values for each point: {x0,y0,z0, x1,y1,z1, ...}- Parameters:
debug- flagpoints- input points
-
convexhull
Constructs the convex hull of all points that can be reached starting from the indicated root node (including the root node). Only "visible" nodes (nodes instance of ShadedNull) will be take into account. The location (Library.location(Node)) of each node will be taken as position.- Parameters:
points- input points
-
convexhull
Constructs the convex hull of all points that can be reached starting from the indicated root node. Only "visible" nodes (nodes instance of ShadedNull) will be take into account. The location (Library.location(Node)) of each node will be taken as position.- Parameters:
includeroot- input pointspoints- input points
-
convexhull
-
boundingBox
-
boundingBoxCoordinates
Calculates the coordinates of the bounding box starting from the root Node.- Parameters:
root-includeroot-- Returns:
- {minX, maxX, minY, maxY, minZ, maxZ}
-
getComponentBasedABBHull
-
getComponentBasedConvexhull
public static QuickHull3D getComponentBasedConvexhull(Node complexNode, boolean finestComponentBased) -
markVertices
Marks all vertices with a Sphere of the givenQuickHull3D.- Parameters:
hull-
-
markVertices
Marks all vertices with a Sphere of the specifiedradiusand of the givenQuickHull3D.- Parameters:
hull-radius-
-
markPoints
Marks all points with a Sphere of the givenQuickHull3D.- Parameters:
hull-
-
markPoints
Marks all points with a Sphere of the specifiedradiusand of the givenQuickHull3D.- Parameters:
hull-radius-
-
markPoints
Marks all points of the specified array with a Sphere of the specifiedradiusand shader.- Parameters:
radius-shader-hull-
-
markPoints
Marks all points of the specified array with a Sphere of the specifiedradiusand shader. Additionally a TextLabel with a consecutive number can be applyed.- Parameters:
radius-shader-label-hull-
-
ColorBar
Generates a ColorBar as sequence of 100 Cylinder objects based on the passed ColorGradient instance. hight 1m, radius=0.1m- Parameters:
cg- instance of the ColorGradientlabel- flag to indicate labeling- Returns:
- root node of the sequence
-
MeasuringStick
Creates a measuring stick as sequence of steps Cylinder opjects.- Parameters:
steps- number of stepsstepsize- hight of each Cylinderlabel- flag to indicate labeling- Returns:
- root node of the sequence
-
getXYProjection
Constructs the selected XY-projection of all points that can be reached starting from the indicated root node. Only "visible" nodes (nodes instance of ShadedNull) will be take into account. The location (Library.location(Node)) of each node will be taken as position. Currently implemented methods: CONVEXHULL .. the convex hull BOUNDING_RECTANGLE .. bounding rectangle ALPHA_SHAPE .. alpha shape with alpha ofalpha(Note: In case the alpha shape is not connected, only the first polygon will be returned)- Parameters:
root- nodealpha- value, only used for alpha shapesmethod- of projection
-
getXYProjection
Constructs the selected XY-projection of all points in the list. Currently implemented methods: CONVEXHULL .. the convex hull BOUNDING_RECTANGLE .. bounding rectangle ALPHA_SHAPE .. alpha shape with alpha ofalpha(Note: In case the alpha shape is not connected, only the first polygon will be returned) Returns an array of points: [centroid, p0, p1, p2, ..., pn, p0}; (Repeatation of the first point to close the area (during triangulation))- Parameters:
alpha- value, only used for alpha shapesinput- pointsmethod- of projection
-
getBoundingRectangle
Calculates the bounding rectangle of the given array of points. Returns an array of points: [centroid, (maxX,maxY,0), (minX,maxY,0), (minX,minY,0), (maxX,minY,0), (maxX,maxY,0)}; (Repeatation of the first point to close the area (during triangulation))- Parameters:
points-- Returns:
- array of points
-
getConvexHull2D
Calculates the convex hull of the given array of points. Returns an array of points: [centroid, p0, p1, p2, ..., pn, p0}; (Repeatation of the first point to close the area (during triangulation))- Parameters:
points-- Returns:
- array of points
-
getAlphaShape
Calculates the alhpa shape of the given array of points considerring the choosn alpah value. Returns a List of Vectors of Point3d. Each Vector contains the points of one polygon. In case the resoulting surface is not coherent the List will contain more then one Vector.- Parameters:
points-alpha- value- Returns:
- List of Vectors of Point3d, one Vector for each polegon of the surface
-
getAlphaShape
Calculates the alhpa shape of all (visible) nodes that can be reached from the given root Node considerring the choosn alpah value. Returns a List of Vectors of Point3d. Each Vector contains the points of one polygon. In case the resoulting surface is not coherent the List will contain more then one Vector.- Parameters:
alpha- valuepoints-- Returns:
- List of Vectors of Point3d, one Vector for each polegon of the surface
-
Surface
Deprecated. -
Surface
Deprecated. -
Surface
Deprecated. -
Surface
Deprecated. -
Surface
Deprecated. -
Surface
Deprecated. -
Surface
Deprecated. -
visualizeAsColor
Returns a color shader whose color represents the value ofxwhich 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
Printsvwith the specified colour to the XL console.- Parameters:
v- an objectcolor- selected printing color (black = 0x000000)
-
print
Printsvto the XL console.- Parameters:
v- an object
-
println
Printsvwith the specified colour to the XL console, then terminates the line.- Parameters:
v- an objectcolor- selected printing color (black = 0x000000)
-
println
Printsvto the XL console, then terminates the line.- Parameters:
v- an object
-
clearConsole
public static void clearConsole()Clears the current console. -
getTimeForRepaint
public static double getTimeForRepaint()Determine the time for one repaint of the 3D View window.- Returns:
- time in milliseconds [ms]
-
getTimeForTraversingGraph
public static double getTimeForTraversingGraph()Determine the time for traversing the whole graph (touching each node once).- Returns:
- time in milliseconds [ms]
-
getGraphSize
public static int getGraphSize()Number of nodes in the main graph. same as count((* Node *))- Returns:
- int, size of the graph
-
getSceneGraphSize
public static int getSceneGraphSize()Number of nodes in the scene graph. * same as count((* ShadedNull *))- Returns:
- int, size of the graph
-
operator$shl
This operator method printsvonw.- Parameters:
w- a writerv- value to be printed onw- Returns:
w
-
println
public static void println()Terminate the current line by writing the line separator string. -
print
public static void print(boolean v) Printsvto the XL console.- Parameters:
v- value to be printed
-
println
public static void println(boolean v) Printsvto the XL console, then terminates the line.- Parameters:
v- value to be printed
-
operator$shl
This operator method printsvonw.- Parameters:
w- a writerv- value to be printed onw- Returns:
w
-
print
public static void print(char v) Printsvto the XL console.- Parameters:
v- value to be printed
-
println
public static void println(char v) Printsvto the XL console, then terminates the line.- Parameters:
v- value to be printed
-
operator$shl
This operator method printsvonw.- Parameters:
w- a writerv- value to be printed onw- Returns:
w
-
print
public static void print(int v) Printsvto the XL console.- Parameters:
v- value to be printed
-
println
public static void println(int v) Printsvto the XL console, then terminates the line.- Parameters:
v- value to be printed
-
operator$shl
This operator method printsvonw.- Parameters:
w- a writerv- value to be printed onw- Returns:
w
-
print
public static void print(long v) Printsvto the XL console.- Parameters:
v- value to be printed
-
println
public static void println(long v) Printsvto the XL console, then terminates the line.- Parameters:
v- value to be printed
-
operator$shl
This operator method printsvonw.- Parameters:
w- a writerv- value to be printed onw- Returns:
w
-
print
public static void print(float v) Printsvto the XL console.- Parameters:
v- value to be printed
-
println
public static void println(float v) Printsvto the XL console, then terminates the line.- Parameters:
v- value to be printed
-
operator$shl
This operator method printsvonw.- Parameters:
w- a writerv- value to be printed onw- Returns:
w
-
print
public static void print(double v) Printsvto the XL console.- Parameters:
v- value to be printed
-
println
public static void println(double v) Printsvto the XL console, then terminates the line.- Parameters:
v- value to be printed
-
operator$shl
This operator method printsvonw.- Parameters:
w- a writerv- value to be printed onw- Returns:
w
-
operator$index
This operator method is an alias forfunc.evaluateFloat(x).- Parameters:
func- a functionx- argument to the function- Returns:
- evaluation of
funcatx
-
operator$shl
This operator method addsvalueas last element tolist.- Parameters:
list- a listvalue- value to add as last element- Returns:
list
-
operator$index
-
operator$in
This operator method returnstrueiffsetis notnullandset.contains(value)returnstrue.- Parameters:
value- a valueset- a collection- Returns:
trueiffvalueis inset
-
synthesize
public static <T> boolean synthesize(T root, ObjectToObjectGenerator<? super T, ? extends T> generator, ObjectToBoolean<BooleanSynth<? super T>> synth) This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure. A synthesized attribute is an attribute for a node whose value depends on the node and its descendants.rootdefines the root of the tree-like structure,generatoris used to obtain the children of a node, andsynthto compute the value of the synthesized attribute at the current node, where the values of its children have been computed previously and are passed tosynth.- Type Parameters:
T- the type of nodes- Parameters:
root- root node of structuregenerator- the generator is used to obtain the direct children of the current nodesynth- this function is used to compute the value of the synthesized attribute at a node, given the values of its children- Returns:
- value of synthesized attribute at
root
-
synthesize
public static <T> byte synthesize(T root, ObjectToObjectGenerator<? super T, ? extends T> generator, ObjectToByte<ByteSynth<? super T>> synth) This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure. A synthesized attribute is an attribute for a node whose value depends on the node and its descendants.rootdefines the root of the tree-like structure,generatoris used to obtain the children of a node, andsynthto compute the value of the synthesized attribute at the current node, where the values of its children have been computed previously and are passed tosynth.- Type Parameters:
T- the type of nodes- Parameters:
root- root node of structuregenerator- the generator is used to obtain the direct children of the current nodesynth- this function is used to compute the value of the synthesized attribute at a node, given the values of its children- Returns:
- value of synthesized attribute at
root
-
synthesize
public static <T> short synthesize(T root, ObjectToObjectGenerator<? super T, ? extends T> generator, ObjectToShort<ShortSynth<? super T>> synth) This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure. A synthesized attribute is an attribute for a node whose value depends on the node and its descendants.rootdefines the root of the tree-like structure,generatoris used to obtain the children of a node, andsynthto compute the value of the synthesized attribute at the current node, where the values of its children have been computed previously and are passed tosynth.- Type Parameters:
T- the type of nodes- Parameters:
root- root node of structuregenerator- the generator is used to obtain the direct children of the current nodesynth- this function is used to compute the value of the synthesized attribute at a node, given the values of its children- Returns:
- value of synthesized attribute at
root
-
synthesize
public static <T> char synthesize(T root, ObjectToObjectGenerator<? super T, ? extends T> generator, ObjectToChar<CharSynth<? super T>> synth) This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure. A synthesized attribute is an attribute for a node whose value depends on the node and its descendants.rootdefines the root of the tree-like structure,generatoris used to obtain the children of a node, andsynthto compute the value of the synthesized attribute at the current node, where the values of its children have been computed previously and are passed tosynth.- Type Parameters:
T- the type of nodes- Parameters:
root- root node of structuregenerator- the generator is used to obtain the direct children of the current nodesynth- this function is used to compute the value of the synthesized attribute at a node, given the values of its children- Returns:
- value of synthesized attribute at
root
-
synthesize
public static <T> int synthesize(T root, ObjectToObjectGenerator<? super T, ? extends T> generator, ObjectToInt<IntSynth<? super T>> synth) This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure. A synthesized attribute is an attribute for a node whose value depends on the node and its descendants.rootdefines the root of the tree-like structure,generatoris used to obtain the children of a node, andsynthto compute the value of the synthesized attribute at the current node, where the values of its children have been computed previously and are passed tosynth.- Type Parameters:
T- the type of nodes- Parameters:
root- root node of structuregenerator- the generator is used to obtain the direct children of the current nodesynth- this function is used to compute the value of the synthesized attribute at a node, given the values of its children- Returns:
- value of synthesized attribute at
root
-
synthesize
public static <T> long synthesize(T root, ObjectToObjectGenerator<? super T, ? extends T> generator, ObjectToLong<LongSynth<? super T>> synth) This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure. A synthesized attribute is an attribute for a node whose value depends on the node and its descendants.rootdefines the root of the tree-like structure,generatoris used to obtain the children of a node, andsynthto compute the value of the synthesized attribute at the current node, where the values of its children have been computed previously and are passed tosynth.- Type Parameters:
T- the type of nodes- Parameters:
root- root node of structuregenerator- the generator is used to obtain the direct children of the current nodesynth- this function is used to compute the value of the synthesized attribute at a node, given the values of its children- Returns:
- value of synthesized attribute at
root
-
synthesize
public static <T> float synthesize(T root, ObjectToObjectGenerator<? super T, ? extends T> generator, ObjectToFloat<FloatSynth<? super T>> synth) This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure. A synthesized attribute is an attribute for a node whose value depends on the node and its descendants.rootdefines the root of the tree-like structure,generatoris used to obtain the children of a node, andsynthto compute the value of the synthesized attribute at the current node, where the values of its children have been computed previously and are passed tosynth.- Type Parameters:
T- the type of nodes- Parameters:
root- root node of structuregenerator- the generator is used to obtain the direct children of the current nodesynth- this function is used to compute the value of the synthesized attribute at a node, given the values of its children- Returns:
- value of synthesized attribute at
root
-
synthesize
public static <T> double synthesize(T root, ObjectToObjectGenerator<? super T, ? extends T> generator, ObjectToDouble<DoubleSynth<? super T>> synth) This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure. A synthesized attribute is an attribute for a node whose value depends on the node and its descendants.rootdefines the root of the tree-like structure,generatoris used to obtain the children of a node, andsynthto compute the value of the synthesized attribute at the current node, where the values of its children have been computed previously and are passed tosynth.- Type Parameters:
T- the type of nodes- Parameters:
root- root node of structuregenerator- the generator is used to obtain the direct children of the current nodesynth- this function is used to compute the value of the synthesized attribute at a node, given the values of its children- Returns:
- value of synthesized attribute at
root
-
synthesize
public static <T,V> V synthesize(T root, ObjectToObjectGenerator<? super T, ? extends T> generator, ObjectToObject<ObjectSynth<? super T, ? super V>, ? extends V> synth) This method can be used to compute the values of a synthesized attribute for every node of a tree-like structure. A synthesized attribute is an attribute for a node whose value depends on the node and its descendants.rootdefines the root of the tree-like structure,generatoris used to obtain the children of a node, andsynthto compute the value of the synthesized attribute at the current node, where the values of its children have been computed previously and are passed tosynth.- Type Parameters:
T- the type of nodesV- the type of values of the synthesized attribute- Parameters:
root- root node of structuregenerator- the generator is used to obtain the direct children of the current nodesynth- this function is used to compute the value of the synthesized attribute at a node, given the values of its children- Returns:
- value of synthesized attribute at
root
-
operator$index
This operator method is an alias forlist.get(index).- Parameters:
list- a listindex- an index- Returns:
- element at
indexinlist
-
operator$shl
This operator method addsvalueas last element tolist.- Parameters:
list- a listvalue- value to add as last element- Returns:
list
-
operator$index
-
operator$index
This operator method is an alias forlist.get(index).- Parameters:
list- a listindex- an index- Returns:
- element at
indexinlist
-
operator$shl
This operator method addsvalueas last element tolist.- Parameters:
list- a listvalue- value to add as last element- Returns:
list
-
operator$index
-
operator$index
This operator method is an alias forlist.get(index).- Parameters:
list- a listindex- an index- Returns:
- element at
indexinlist
-
operator$shl
This operator method addsvalueas last element tolist.- Parameters:
list- a listvalue- value to add as last element- Returns:
list
-
operator$index
-
operator$index
This operator method is an alias forlist.get(index).- Parameters:
list- a listindex- an index- Returns:
- element at
indexinlist
-
operator$shl
This operator method addsvalueas last element tolist.- Parameters:
list- a listvalue- value to add as last element- Returns:
list
-
operator$index
-
operator$index
This operator method is an alias forlist.get(index).- Parameters:
list- a listindex- an index- Returns:
- element at
indexinlist
-
operator$shl
This operator method addsvalueas last element tolist.- Parameters:
list- a listvalue- value to add as last element- Returns:
list
-
operator$index
-
operator$index
This operator method is an alias forlist.get(index).- Parameters:
list- a listindex- an index- Returns:
- element at
indexinlist
-
operator$shl
This operator method addsvalueas last element tolist.- Parameters:
list- a listvalue- value to add as last element- Returns:
list
-
operator$index
-
operator$index
This operator method is an alias forlist.get(index).- Parameters:
list- a listindex- an index- Returns:
- element at
indexinlist
-
operator$shl
This operator method addsvalueas last element tolist.- Parameters:
list- a listvalue- value to add as last element- Returns:
list
-
operator$index
-
operator$index
This operator method is an alias forlist.get(index).- Parameters:
list- a listindex- an index- Returns:
- element at
indexinlist
-
operator$shl
This operator method addsvalueas last element tolist.- Parameters:
list- a listvalue- value to add as last element- Returns:
list
-
operator$index
-
operator$index
This operator method is an alias fornode.getChild(index).- Parameters:
node- a nodeindex- an index- Returns:
index-th child ofcode- See Also:
-
operator$lt
This operator method compares two nodes based on their id: It returnstrueiffa.getId () invalid input: '<' b.getId ().- Parameters:
a- a nodeb- another node- Returns:
a.getId () invalid input: '<' b.getId ()- See Also:
-
operator$le
This operator method compares two nodes based on their id: It returnstrueiffa.getId () invalid input: '<'= b.getId ().- Parameters:
a- a nodeb- another node- Returns:
a.getId () invalid input: '<'= b.getId ()- See Also:
-
operator$gt
This operator method compares two nodes based on their id: It returnstrueiffa.getId () > b.getId ().- Parameters:
a- a nodeb- another node- Returns:
a.getId () > b.getId ()- See Also:
-
operator$ge
This operator method compares two nodes based on their id: It returnstrueiffa.getId () >= b.getId ().- Parameters:
a- a nodeb- another node- Returns:
a.getId () >= b.getId ()- See Also:
-
operator$index
This operator method applies the functionfto noden. It is an alias forf.get(n).- Parameters:
n- a nodef- a function of nodes- Returns:
- evaluation of
fatn
-
operator$index
This operator method applies the functionfto noden. It is an alias forf.get(n).- Parameters:
n- a nodef- a function of nodes- Returns:
- evaluation of
fatn
-
operator$index
This operator method applies the functionfto noden. It is an alias forf.get(n).- Parameters:
n- a nodef- a function of nodes- Returns:
- evaluation of
fatn
-
operator$index
This operator method returns the location ofn. It is an alias forlocation(n).- Parameters:
n- a nodel- dummy parameter, its value is ignored- Returns:
- location of
nin global coordinates - See Also:
-
mean
This aggregate method computes the mean of a sequence ofTuple3f's.- Parameters:
a- aggregate instance (provided by the XL compiler)value- a value of the sequence of values
-
mean
This aggregate method computes the mean of a sequence ofTuple3d's.- Parameters:
a- aggregate instance (provided by the XL compiler)value- a value of the sequence of values
-
plot
-
plot
-
toObjectToDouble
-
plot
-
plotPoints
-
range
-
range
-
select
-
apply
This finish iterator (see the XL Language Specification) is used in afor-statement to execute its bodycounttimes. Each execution is surrounded by a transformation boundary (seederive()).- Parameters:
count- number of iterations- Returns:
- a finish iterator
-
applyUntilFinished
This finish iterator (see the XL Language Specification) is used in afor-statement to execute its body as long as the body makes modifications to the graph. Each execution is surrounded by a transformation boundary (seederive()).- Returns:
- a finish iterator
-
passBoundary
Deprecated.replaced byderive() -
apply
Deprecated.replaced byderive() -
derive
public static void derive()This method induces a transformation boundary on the current RGG extent (see the XL Language Specification). This means that all pending graph modifications are applied to the graph. -
newGRSVertices
-
interpretiveRules
-
removeInterpretiveNodes
public static void removeInterpretiveNodes() -
moveToExtent
Sets theextentIndexproperty ofrootand its subgraph spanned byEdgePatternImpl.TREEtoindex. Ifpsisnull, the property is modified as part of the active transaction of the graph. Otherwise, thePropertyQueueofpsis used to enqueue the modifications.Note that under normal operation, nodes at the
Node.LAST_EXTENT_INDEXof the type extent are not returned as part of graph queries.- Parameters:
ps- producer to obtain a modification queue, ornullroot- root node of subgraphindex- new value of theextentTailproperty of the nodes
-
hide
Hides the subgraph starting atrootso 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,
rootis reparented such that it becomes the child of theRGGRootof this graph, the connection being established by an edge of typeGraph.MARK_EDGE. This makes the subgraph invisible. Afterwards,moveToExtent(de.grogra.rgg.model.RGGProducer, de.grogra.graph.impl.Node, int)is invoked in order to move the subgraph to the last list of the type extent. Under normal operation, this excludes the subgraph from being returned as part of graph queries.The modifications are made as part of the active transaction of the graph.
- Parameters:
root- root node of subgraph
-
mergeTransformations
This method replaces chains of transformation nodes with singleNullnodes which perform the aggregated transformation of the chains. This is the same asmergeTransformations(root, null).- Parameters:
root- root node of subgraph where chains should be replacedallowShape- store aggregated transformation in shape node at chain end if possible- See Also:
-
mergeNonTropismTransformations
This method replaces chains of transformation nodes with singleNullnode which perform the aggregated transformation of the chain; however, transformation nodes which are tropisms are not allowed to be part of the chains. This is the same asmergeNonTropismTransformations(root, null).- Parameters:
root- root node of subgraph where chains should be replacedallowShape- store aggregated transformation in shape node at chain end if possible- See Also:
-
mergeNonTropismTransformations
public static void mergeNonTropismTransformations(Node root, ObjectToBoolean<? super Node> filter, boolean allowShape) This method replaces chains of transformation nodes passingfilterwith singleNullnodes which perform the aggregated transformation of the chains; however, transformation nodes which are tropisms are not allowed to be part of the chains. Tropisms are defined by the subclasses ofTropism.- Parameters:
root- root node of subgraph where chains should be replacedfilter- only merge nodes which pass this filter. Ifnullis 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 passingfilterwith singleNullnodes which perform the aggregated transformation of the chains. A node is considered to be a transformation node if it has a, but noinvalid reference
transformation attribute
. If it additionally passesinvalid reference
shape attribute
filterand is part of a chain of such nodes, this chain will be replaced by an equivalent single node of classNull.- Parameters:
root- root node of subgraph where chains should be replacedfilter- only merge nodes which pass this filter. Ifnullis specified, every transformation node is considered for mergingallowShape- if possible, store aggregated transformation in existing shape node at chain end (instead of creating a newNullnode)
-
removeTransformationLeaves
Removes all leaf nodes from the graph which are pure transformation nodes (seeremoveTransformationLeaves(Node, ObjectToBoolean)).- Parameters:
root- root node of subgraph whose leaves shall be removed- See Also:
-
removeTransformationLeaves
Removes all leaf nodes from the graph which are pure transformation nodes and which passfilter, starting atroot(seeremoveLeaves(de.grogra.graph.impl.Node, de.grogra.xl.lang.ObjectToBoolean<? super de.grogra.graph.impl.Node>)). A node is considered to be a pure transformation node if it has a, but noinvalid reference
transformation attribute
.invalid reference
shape attribute
- Parameters:
root- root node of subgraph whose leaves shall be removedfilter- only leaf nodes which pass this filter are removed. Ifnull, all transformation nodes are considered- See Also:
-
removeLeaves
Removes all leaf nodes from the graph which passfilter, starting atroot. A leaf is a node which can be reached from therootby traversingbranchorsuccessoredges in forward direction and which has no outgoing edge. If a node which passesfilteris no leaf initially, but becomes a leaf due to the removal of its children, it is also removed itself. As a result, the graph finally does not contain any leaves which passfilter.- Parameters:
root- root node of subgraph whose leaves shall be removedfilter- only leaf nodes which pass this filter are removed
-
statistics
This aggregate method computes aStatisticsobject for a series of valuesa.- Parameters:
a- aggregate instance (provided by the XL compiler)value- a value of the sequence of values- Returns:
- statistics of the series of values
-
defer
Put runnable into modification queue and execute later when derive() is called.- Parameters:
r-
-
randomDirection
Pick a random point on the surface of a unit sphere and return it as direction vector.- Returns:
- random uniformly distributed direction vector
-
getPathToProjectDirectory
Return the relative path to the current opened workbench. The path leads to the .gs or .gsz opened. If the project has not been saved yet, or that the path is set to null. It returns the path to the Home directory. -
getWD
Short for the method getPathToProjectDirectory(). Return the relative path to the current opened workbench. The path leads to the .gs or .gsz opened. If the project has not been saved yet, or that the path is set to null. It returns the path to the Home directory. -
getPathToHomeDirectory
Return the path to the home directory. Independent from the OS used. -
getPathToProjectFileSystem
-
getFileFromProject
return the object of a file in the Project from its name. The returned object is of type File if the project is saved as a .gs. And of type MemoryFileSystem.File if the project is either not saved or saved as .gsz -
getInputStreamFromProject
Return the input stream of a file from the project. The input stream MUST be closed.- Throws:
IOException
-
getOutputStreamFromProject
public static OutputStream getOutputStreamFromProject(String fileName, boolean add) throws IOException Return the output stream of a file from the project. The output stream MUST be closed.- Throws:
IOException
-
importNodeFromFile
import file (from file path) and add it to the scene -
loadNodeFromFile
load file (from file path) and return the root of the created graph structure -
importNodeFromStream
import file (from inputStream) and add it to the scene -
loadNodeFromStream
load file (from file input stream) and return the root of the created graph structure -
saveProjectAs
Save the current project into a .gs or .gsz file. This do not change the project working directory. -
saveProjectAs
Save the current project into a .gs or .gsz file. This do not change the project working directory.
-
derive()