GRASS
Class linepnts

java.lang.Object
  |
  +--GRASS.linepnts

public class linepnts
extends java.lang.Object

Wraps GRASS library struct line_pnts. line_pnts is not documented in the GRASS 4.2 Programmer's Manual, but see Section 13.5 Data Structures (Vector Library) to learn about routines that deal with struct line_pnts.


Field Summary
static int AREA
          linepnts type AREA.
static int DOT
          linepnts type DOT.
static int LINE
          linepnts type LINE.
 
Constructor Summary
linepnts()
          Constructs an empty object and allocates memory for GRASS struct line_pnts
 
Method Summary
 int getType()
          Inquires for the type of this object (LINE, AREA or DOT).
 int n_points()
          Inquires for the nukber of coordinate pairs in this object.
 void setType(int type)
          Sets type of this object (LINE, AREA or DOT).
 java.lang.String toString()
          Returns a string representation of the object.
 void Vect_copy_pnts_to_xy(double[] x, double[] y)
          Copies coordinate pairs associated with linepnts object into two arrays.
 void Vect_copy_xy_to_pnts(double[] x, double[] y)
          Copies coordinate pairs from the arrays of x and y coordinates into linepnts object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LINE

public static final int LINE
linepnts type LINE.

AREA

public static final int AREA
linepnts type AREA.

DOT

public static final int DOT
linepnts type DOT.
Constructor Detail

linepnts

public linepnts()
Constructs an empty object and allocates memory for GRASS struct line_pnts
Method Detail

getType

public int getType()
Inquires for the type of this object (LINE, AREA or DOT).
Returns:
type (LINE, AREA or DOT)

setType

public void setType(int type)
Sets type of this object (LINE, AREA or DOT).
Parameters:
type - type (LINE, AREA or DOT)

n_points

public int n_points()
Inquires for the nukber of coordinate pairs in this object.
Returns:
number of coordinate pairs in this object

Vect_copy_xy_to_pnts

public void Vect_copy_xy_to_pnts(double[] x,
                                 double[] y)
                          throws GRASSException
Copies coordinate pairs from the arrays of x and y coordinates into linepnts object. Arrays nust be of an equal size. Wraps GRASS library routine:
 Vect_copy_xy_to_pnts (Points, x, y, n)
    struct line_pnts *Points;
    double *x, *y; int n;
 
See the GRASS 4.2 Programmer's Manual, Section 13.6. Data Conversion
Parameters:
x - array of X coordinates to copy values from
y - array of Y coordinates to copy values fro
Throws:
GRASSException - is thrown if arrays are of unequal size.

Vect_copy_pnts_to_xy

public void Vect_copy_pnts_to_xy(double[] x,
                                 double[] y)
                          throws GRASSException
Copies coordinate pairs associated with linepnts object into two arrays. Arrays' sizes must be equal or bigger then number of points in this object. If array size is bigger its reminder is left intact so be carefull not to use it. Arrays can be allocated beforehand with the command
 linepnts lp = ....;

 double x = new double[ lp.n_points() ];
 double y = new double[ lp.n_points() ];
 
Wraps GRASS library routine:
 Vect_copy_pnts_to_xy (Points, x, y, n)
    struct line_pnts *Points;
    double *x, *y; int *n;
 
See the GRASS 4.2 Programmer's Manual, Section 13.6. Data Conversion
Parameters:
x - array of X coordinates to copy values to
y - array of Y coordinates to copy values to
Throws:
GRASSException - is thrown if size of one of the arrays is smaller than number of coordinate pairs in this object..

toString

public java.lang.String toString()
Returns a string representation of the object.
Returns:
String that represents this object (memory address, type and number of coordinate pairs).
Overrides:
toString in class java.lang.Object


GRASS-JNI Home Page