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

package rhcad.touchvg.core;

public class MgShapes extends MgObject {
  private long swigCPtr;

  protected MgShapes(long cPtr, boolean cMemoryOwn) {
    super(touchvgJNI.MgShapes_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

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

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        throw new UnsupportedOperationException("C++ destructor does not have public access");
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public static int Type() {
    return touchvgJNI.MgShapes_Type();
  }

  public MgShapes cloneShapes() {
    long cPtr = touchvgJNI.MgShapes_cloneShapes(swigCPtr, this);
    return (cPtr == 0) ? null : new MgShapes(cPtr, false);
  }

  public MgShapes shallowCopy() {
    long cPtr = touchvgJNI.MgShapes_shallowCopy(swigCPtr, this);
    return (cPtr == 0) ? null : new MgShapes(cPtr, false);
  }

  public static MgShapes create(MgObject owner, int index) {
    long cPtr = touchvgJNI.MgShapes_create__SWIG_0(MgObject.getCPtr(owner), owner, index);
    return (cPtr == 0) ? null : new MgShapes(cPtr, false);
  }

  public static MgShapes create(MgObject owner) {
    long cPtr = touchvgJNI.MgShapes_create__SWIG_1(MgObject.getCPtr(owner), owner);
    return (cPtr == 0) ? null : new MgShapes(cPtr, false);
  }

  public static MgShapes create() {
    long cPtr = touchvgJNI.MgShapes_create__SWIG_2();
    return (cPtr == 0) ? null : new MgShapes(cPtr, false);
  }

  public int getShapeCount() {
    return touchvgJNI.MgShapes_getShapeCount(swigCPtr, this);
  }

  public int getShapeCountByTypeOrTag(int type, int tag) {
    return touchvgJNI.MgShapes_getShapeCountByTypeOrTag(swigCPtr, this, type, tag);
  }

  public int getShapeIndex(int sid) {
    return touchvgJNI.MgShapes_getShapeIndex(swigCPtr, this, sid);
  }

  public MgShape getShapeAtIndex(int index) {
    long cPtr = touchvgJNI.MgShapes_getShapeAtIndex(swigCPtr, this, index);
    return (cPtr == 0) ? null : new MgShape(cPtr, false);
  }

  public MgShape getHeadShape() {
    long cPtr = touchvgJNI.MgShapes_getHeadShape(swigCPtr, this);
    return (cPtr == 0) ? null : new MgShape(cPtr, false);
  }

  public MgShape getLastShape() {
    long cPtr = touchvgJNI.MgShapes_getLastShape(swigCPtr, this);
    return (cPtr == 0) ? null : new MgShape(cPtr, false);
  }

  public MgShape findShape(int sid) {
    long cPtr = touchvgJNI.MgShapes_findShape(swigCPtr, this, sid);
    return (cPtr == 0) ? null : new MgShape(cPtr, false);
  }

  public MgShape findShapeByTag(int tag) {
    long cPtr = touchvgJNI.MgShapes_findShapeByTag(swigCPtr, this, tag);
    return (cPtr == 0) ? null : new MgShape(cPtr, false);
  }

  public MgShape findShapeByType(int type) {
    long cPtr = touchvgJNI.MgShapes_findShapeByType(swigCPtr, this, type);
    return (cPtr == 0) ? null : new MgShape(cPtr, false);
  }

  public MgShape findShapeByTypeAndTag(int type, int tag) {
    long cPtr = touchvgJNI.MgShapes_findShapeByTypeAndTag(swigCPtr, this, type, tag);
    return (cPtr == 0) ? null : new MgShape(cPtr, false);
  }

  public Box2d getExtent() {
    return new Box2d(touchvgJNI.MgShapes_getExtent(swigCPtr, this), true);
  }

  public MgShape hitTest(Box2d limits, MgHitResult res) {
    long cPtr = touchvgJNI.MgShapes_hitTest(swigCPtr, this, Box2d.getCPtr(limits), limits, MgHitResult.getCPtr(res), res);
    return (cPtr == 0) ? null : new MgShape(cPtr, false);
  }

  public int draw(GiGraphics gs, GiContext ctx) {
    return touchvgJNI.MgShapes_draw__SWIG_0(swigCPtr, this, GiGraphics.getCPtr(gs), gs, GiContext.getCPtr(ctx), ctx);
  }

  public int draw(GiGraphics gs) {
    return touchvgJNI.MgShapes_draw__SWIG_1(swigCPtr, this, GiGraphics.getCPtr(gs), gs);
  }

  public boolean save(MgStorage s, int startIndex) {
    return touchvgJNI.MgShapes_save__SWIG_0(swigCPtr, this, MgStorage.getCPtr(s), s, startIndex);
  }

  public boolean save(MgStorage s) {
    return touchvgJNI.MgShapes_save__SWIG_1(swigCPtr, this, MgStorage.getCPtr(s), s);
  }

  public boolean saveShape(MgStorage s, MgShape shape, int index) {
    return touchvgJNI.MgShapes_saveShape(swigCPtr, this, MgStorage.getCPtr(s), s, MgShape.getCPtr(shape), shape, index);
  }

  public int load(MgShapeFactory factory, MgStorage s, boolean addOnly) {
    return touchvgJNI.MgShapes_load__SWIG_0(swigCPtr, this, MgShapeFactory.getCPtr(factory), factory, MgStorage.getCPtr(s), s, addOnly);
  }

  public int load(MgShapeFactory factory, MgStorage s) {
    return touchvgJNI.MgShapes_load__SWIG_1(swigCPtr, this, MgShapeFactory.getCPtr(factory), factory, MgStorage.getCPtr(s), s);
  }

  public void setNewShapeID(int sid) {
    touchvgJNI.MgShapes_setNewShapeID(swigCPtr, this, sid);
  }

  public void clear() {
    touchvgJNI.MgShapes_clear(swigCPtr, this);
  }

  public void clearCachedData() {
    touchvgJNI.MgShapes_clearCachedData(swigCPtr, this);
  }

  public int copyShapes(MgShapes src, boolean deeply, boolean needClear) {
    return touchvgJNI.MgShapes_copyShapes__SWIG_0(swigCPtr, this, MgShapes.getCPtr(src), src, deeply, needClear);
  }

  public int copyShapes(MgShapes src, boolean deeply) {
    return touchvgJNI.MgShapes_copyShapes__SWIG_1(swigCPtr, this, MgShapes.getCPtr(src), src, deeply);
  }

  public int copyShapes(MgShapes src) {
    return touchvgJNI.MgShapes_copyShapes__SWIG_2(swigCPtr, this, MgShapes.getCPtr(src), src);
  }

  public MgShape addShape(MgShape src) {
    long cPtr = touchvgJNI.MgShapes_addShape(swigCPtr, this, MgShape.getCPtr(src), src);
    return (cPtr == 0) ? null : new MgShape(cPtr, false);
  }

  public boolean addShapeDirect(MgShape shape, boolean force) {
    return touchvgJNI.MgShapes_addShapeDirect__SWIG_0(swigCPtr, this, MgShape.getCPtr(shape), shape, force);
  }

  public boolean addShapeDirect(MgShape shape) {
    return touchvgJNI.MgShapes_addShapeDirect__SWIG_1(swigCPtr, this, MgShape.getCPtr(shape), shape);
  }

  public boolean updateShape(MgShape shape, boolean force) {
    return touchvgJNI.MgShapes_updateShape__SWIG_0(swigCPtr, this, MgShape.getCPtr(shape), shape, force);
  }

  public boolean updateShape(MgShape shape) {
    return touchvgJNI.MgShapes_updateShape__SWIG_1(swigCPtr, this, MgShape.getCPtr(shape), shape);
  }

  public MgShape cloneShape(int sid) {
    long cPtr = touchvgJNI.MgShapes_cloneShape(swigCPtr, this, sid);
    return (cPtr == 0) ? null : new MgShape(cPtr, false);
  }

  public void transform(Matrix2d mat) {
    touchvgJNI.MgShapes_transform(swigCPtr, this, Matrix2d.getCPtr(mat), mat);
  }

  public boolean removeShape(int sid) {
    return touchvgJNI.MgShapes_removeShape(swigCPtr, this, sid);
  }

  public boolean moveShapeTo(int sid, MgShapes dest) {
    return touchvgJNI.MgShapes_moveShapeTo(swigCPtr, this, sid, MgShapes.getCPtr(dest), dest);
  }

  public void copyShapesTo(MgShapes dest) {
    touchvgJNI.MgShapes_copyShapesTo(swigCPtr, this, MgShapes.getCPtr(dest), dest);
  }

  public boolean bringToFront(int sid) {
    return touchvgJNI.MgShapes_bringToFront(swigCPtr, this, sid);
  }

  public boolean bringToBack(int sid) {
    return touchvgJNI.MgShapes_bringToBack(swigCPtr, this, sid);
  }

  public boolean bringToIndex(int sid, int index) {
    return touchvgJNI.MgShapes_bringToIndex(swigCPtr, this, sid, index);
  }

  public static MgShape getParentShape(MgShape shape) {
    long cPtr = touchvgJNI.MgShapes_getParentShape(MgShape.getCPtr(shape), shape);
    return (cPtr == 0) ? null : new MgShape(cPtr, false);
  }

  public MgObject getOwner() {
    long cPtr = touchvgJNI.MgShapes_getOwner(swigCPtr, this);
    return (cPtr == 0) ? null : new MgObject(cPtr, false);
  }

  public int getIndex() {
    return touchvgJNI.MgShapes_getIndex(swigCPtr, this);
  }

  public static MgShapes fromHandle(int h) {
    long cPtr = touchvgJNI.MgShapes_fromHandle(h);
    return (cPtr == 0) ? null : new MgShapes(cPtr, false);
  }

  public int toHandle() {
    return touchvgJNI.MgShapes_toHandle(swigCPtr, this);
  }

  public MgObject clone() {
    long cPtr = touchvgJNI.MgShapes_clone(swigCPtr, this);
    return (cPtr == 0) ? null : new MgObject(cPtr, false);
  }

  public void copy(MgObject src) {
    touchvgJNI.MgShapes_copy(swigCPtr, this, MgObject.getCPtr(src), src);
  }

  public void release() {
    touchvgJNI.MgShapes_release(swigCPtr, this);
  }

  public void addRef() {
    touchvgJNI.MgShapes_addRef(swigCPtr, this);
  }

  public boolean equals(MgObject src) {
    return touchvgJNI.MgShapes_equals(swigCPtr, this, MgObject.getCPtr(src), src);
  }

  public int getType() {
    return touchvgJNI.MgShapes_getType(swigCPtr, this);
  }

  public boolean isKindOf(int type) {
    return touchvgJNI.MgShapes_isKindOf(swigCPtr, this, type);
  }

}
