/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version: 1.3.19
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package SimbodyAPI;


public class Body extends Frame {
  private long swigCPtr;

  protected Body(long cPtr, boolean cMemoryOwn) {
    super(ModelJNI.SWIGBodyToFrame(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  protected void finalize() {
    delete();
  }

  public void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      ModelJNI.delete_Body(swigCPtr);
      swigCMemOwn = false;
      super.delete();
    }
    swigCPtr = 0;
  }

  protected static long getCPtr(Body obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  public RealMeasure getMassMeasure() {
    return new RealMeasure(ModelJNI.Body_getMassMeasure(swigCPtr), false);
  }

  public StationMeasure getCentroidMeasure() {
    return new StationMeasure(ModelJNI.Body_getCentroidMeasure(swigCPtr), false);
  }

  public static boolean isInstanceOf(Feature arg0) {
    return ModelJNI.Body_isInstanceOf(Feature.getCPtr(arg0));
  }

  public Body() {
    this(ModelJNI.new_Body(), true);
  }

}
