/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version: 1.3.21
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package edu.umn.gis.mapscript;


public class lineObj {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  protected lineObj(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected void finalize() {
    delete();
  }

  public void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      mapscriptJNI.delete_lineObj(swigCPtr);
    }
    swigCPtr = 0;
  }

  protected static long getCPtr(lineObj obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  public int getNumpoints() {
    return mapscriptJNI.get_lineObj_numpoints(swigCPtr);
  }

  public pointObj getPoint() {
    long cPtr = mapscriptJNI.get_lineObj_point(swigCPtr);
    return (cPtr == 0) ? null : new pointObj(cPtr, false);
  }

  public lineObj() {
    this(mapscriptJNI.new_lineObj(), true);
  }

  public int project(projectionObj projin, projectionObj projout) {
    return mapscriptJNI.lineObj_project(swigCPtr, projectionObj.getCPtr(projin), projectionObj.getCPtr(projout));
  }

  public pointObj get(int i) {
    long cPtr = mapscriptJNI.lineObj_get(swigCPtr, i);
    return (cPtr == 0) ? null : new pointObj(cPtr, false);
  }

  public int add(pointObj p) {
    return mapscriptJNI.lineObj_add(swigCPtr, pointObj.getCPtr(p));
  }

  public int set(int i, pointObj p) {
    return mapscriptJNI.lineObj_set(swigCPtr, i, pointObj.getCPtr(p));
  }

}
