Class RandomGeom


  • public class RandomGeom
    extends Object
    • Constructor Detail

      • RandomGeom

        public RandomGeom()
      • RandomGeom

        public RandomGeom​(long seed)
    • Method Detail

      • isAlpha

        public boolean isAlpha()
      • setAlpha

        public void setAlpha​(boolean alpha)
      • coord

        public Coord3d coord​(float xrange,
                             float yrange,
                             float zrange)
      • color

        public Color color()
      • color

        public Color color​(Coord3d coord,
                           float xrange,
                           float yrange,
                           float zrange)
      • color

        public Color color​(Coord3d coord)
        Build a color based on the input coord values.
      • aFloat

        public float aFloat()
        Generate a float between 0 and 1
      • aFloat

        public float aFloat​(float range)
        Generate a float between 0 and range
      • spinningCubes

        public List<Composite> spinningCubes​(int cubes,
                                             float spin)
      • spinningCubes

        public List<Composite> spinningCubes​(int cubes,
                                             float spin,
                                             float randomize)
        Generate a stack of cubes, where the top face is spinned w.r.t. the bottom face. The left, right, near and far faces are consequently not planar which is usefull to validate some algorithms. Each cube is a Composite which in returned in a list of Drawables.
        Parameters:
        cubes - number of cubes in the stack
        spin - the rotation angle in degree between the bottom and top face
        randomize - is the factor applied to a random number generator before adding a "shaking" offset to each coordinate
      • cube

        public Composite cube​(int x,
                              int y,
                              int z,
                              int w,
                              int h,
                              int d)
        Parameters:
        x - starting point X
        y - starting point Y
        z - starting point Z
        w - width (allows building ending point X)
        h - height (allows building ending point Y)
        d - depth (allows building ending point Z)
      • cube

        public Composite cube​(int x,
                              int y,
                              int z)
      • poly

        public Polygon poly​(int x,
                            int y,
                            int z)
      • poly

        public Polygon poly​(int x,
                            int y,
                            int z,
                            boolean leftRightOrNearFar,
                            Color color)
      • poly

        public Polygon poly​(int x,
                            int y,
                            int z,
                            int w,
                            int h,
                            boolean leftRightOrNearFar,
                            Color color)
        Return a polygon at specified position, width and height. Width is either applied to X or Z according to the boolean parameter.
        Parameters:
        x -
        y -
        z -
        w - width
        h - height
        leftRightOrNearFar - if true, width is applied along X, otherwise along Z dimension.
        color -
        Returns:
      • poly

        public Polygon poly​(int x,
                            int y,
                            int z,
                            int w,
                            int h)