Class GridGenerator
java.lang.Object
org.openscience.cdk.tools.GridGenerator
Generates a grid of points in 3D space within given boundaries.
- Author:
- cho
- Created on:
- 2005-09-30
-
Constructor Summary
ConstructorsConstructorDescriptionGridGenerator(double[] minMax, double initialValue, boolean cubicGridFlag) GridGenerator(double min, double max) GridGenerator(double min, double max, double initialValue) -
Method Summary
Modifier and TypeMethodDescriptionvoidMain method creates a grid between given boundaries (dimensions).javax.vecmath.Point3dgetCoordinatesFromGridPoint(int gridPoint) Method calculates coordinates from a given grid array position.javax.vecmath.Point3dgetCoordinatesFromGridPoint(javax.vecmath.Point3d gridPoint) Method calculates coordinates from a given grid point.int[]getDim()doubledouble[][][]getGrid()double[]javax.vecmath.Point3dgetGridPointFrom3dCoordinates(javax.vecmath.Point3d coord) Method calculates the nearest grid point from given coordinates.doubledoublegetMaxx()doublegetMaxy()doublegetMaxz()doublegetMinx()doublegetMiny()doublegetMinz()double[]gridToGridArray(double[][][] grid) Method transforms the grid to an array.voidinitializeGrid(double value) Method initialise the given grid points with a value.double[][][]initializeGrid(double[][][] grid, double value) Method initialise the given grid points with a value.voidsetDim(int[] dim) voidsetDimension(double[] minMax, boolean cubicGridFlag) Method sets the maximal 3d dimensions to given min and max values.voidsetDimension(double min, double max) Method sets the maximal 3d dimensions to given min and max values.voidsetDimension(double minx, double maxx, double miny, double maxy, double minz, double maxz) Method sets the maximal 3d dimensions to given min and max values.voidsetExtendGrid(double extendGrid) voidsetGrid(double[][][] grid) voidsetLatticeConstant(double latticeConstant) toString()voidwriteGridInPmeshFormat(String outPutFileName) Method transforms the grid into pmesh format.voidwriteGridInPmeshFormat(String outPutFileName, double cutOff) Method transforms the grid into pmesh format.
-
Constructor Details
-
GridGenerator
public GridGenerator() -
GridGenerator
public GridGenerator(double min, double max) -
GridGenerator
public GridGenerator(double min, double max, double initialValue) - Parameters:
initialValue- used as initial value for the grid points
-
GridGenerator
public GridGenerator(double[] minMax, double initialValue, boolean cubicGridFlag)
-
-
Method Details
-
setDimension
public void setDimension(double min, double max) Method sets the maximal 3d dimensions to given min and max values. -
setDimension
public void setDimension(double[] minMax, boolean cubicGridFlag) Method sets the maximal 3d dimensions to given min and max values. -
setDimension
public void setDimension(double minx, double maxx, double miny, double maxy, double minz, double maxz) Method sets the maximal 3d dimensions to given min and max values. -
generateGrid
public void generateGrid()Main method creates a grid between given boundaries (dimensions). The grid my be extended over the given boundaries with the variable extendGrid. -
initializeGrid
public void initializeGrid(double value) Method initialise the given grid points with a value. -
initializeGrid
public double[][][] initializeGrid(double[][][] grid, double value) Method initialise the given grid points with a value. -
gridToGridArray
public double[] gridToGridArray(double[][][] grid) Method transforms the grid to an array. -
getCoordinatesFromGridPoint
public javax.vecmath.Point3d getCoordinatesFromGridPoint(javax.vecmath.Point3d gridPoint) Method calculates coordinates from a given grid point. -
getCoordinatesFromGridPoint
public javax.vecmath.Point3d getCoordinatesFromGridPoint(int gridPoint) Method calculates coordinates from a given grid array position. -
getGridPointFrom3dCoordinates
-
writeGridInPmeshFormat
Method transforms the grid into pmesh format.- Throws:
IOException
-
writeGridInPmeshFormat
Method transforms the grid into pmesh format. Only grid points with specific value defined with cutoff are considered.cutoff <0, the values considered must be <=cutoff cutoff >0, the values considered must be >=cutoff- Throws:
IOException
-
toString
-
getDim
public int[] getDim()- Returns:
- Returns the dim.
-
setDim
public void setDim(int[] dim) - Parameters:
dim- The dim to set.
-
getExtendGrid
public double getExtendGrid()- Returns:
- Returns the extendGrid.
-
setExtendGrid
public void setExtendGrid(double extendGrid) - Parameters:
extendGrid- The extendGrid to set.
-
getGrid
public double[][][] getGrid()- Returns:
- Returns the grid.
-
setGrid
public void setGrid(double[][][] grid) - Parameters:
grid- The grid to set.
-
getLatticeConstant
public double getLatticeConstant()- Returns:
- Returns the latticeConstant.
-
setLatticeConstant
public void setLatticeConstant(double latticeConstant) - Parameters:
latticeConstant- The latticeConstant to set.
-
getGridArray
public double[] getGridArray()- Returns:
- Returns the gridArray.
-
getMaxx
public double getMaxx()- Returns:
- Returns the maxx.
-
getMaxy
public double getMaxy()- Returns:
- Returns the maxy.
-
getMaxz
public double getMaxz()- Returns:
- Returns the maxz.
-
getMinx
public double getMinx()- Returns:
- Returns the minx.
-
getMiny
public double getMiny()- Returns:
- Returns the miny.
-
getMinz
public double getMinz()- Returns:
- Returns the minz.
-