/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.12 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package org.jcae.opencascade.jni; public class TopoDS_Shape { private transient long swigCPtr; protected transient boolean swigCMemOwn; protected TopoDS_Shape(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } protected static long getCPtr(TopoDS_Shape obj) { return (obj == null) ? 0 : obj.swigCPtr; } protected void finalize() { delete(); } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; OccJavaJNI.delete_TopoDS_Shape(swigCPtr); } swigCPtr = 0; } } private long myTShape; protected static TopoDS_Shape downcast(TopoDS_Shape in) { TopoDS_Shape toReturn = create(getCPtr(in)); in.swigCMemOwn=false; return toReturn; } protected static TopoDS_Shape create(long in) { if(in==0) return null; //second argument is not use in swig TopAbs_ShapeEnum type = TopAbs_ShapeEnum.swigToEnum(OccJavaJNI.TopoDS_Shape_shapeType(in, null)); return create(in, type); } protected static TopoDS_Shape create(long in, TopAbs_ShapeEnum type) { TopoDS_Shape toReturn=null; if(in==0) return null; switch(type) { case COMPOUND: toReturn=new TopoDS_Compound(in, true); break; case COMPSOLID: toReturn=new TopoDS_CompSolid(in, true); break; case SOLID: toReturn=new TopoDS_Solid(in, true); break; case SHELL: toReturn=new TopoDS_Shell(in, true); break; case FACE: toReturn=new TopoDS_Face(in, true); break; case WIRE: toReturn=new TopoDS_Wire(in, true); break; case EDGE: toReturn=new TopoDS_Edge(in, true); break; case VERTEX: toReturn=new TopoDS_Vertex(in, true); break; } toReturn.myTShape=toReturn.getTShape(); return toReturn; } public boolean isSame(TopoDS_Shape s) { /*if(myTShape==0) myTShape=getTShape(); if(s.myTShape==0) s.myTShape=s.getTShape(); if(myTShape==s.myTShape) { return nativeIsSame(s); } else return false;*/ return nativeIsSame(s); } /** * Alias on the isSame method for an easy use of this class in java * collections */ public boolean equals(Object o) { if (o instanceof TopoDS_Shape) { return isSame((TopoDS_Shape)o); } else return false; } public int hashCode() { return hashCode(Integer.MAX_VALUE); } protected static TopoDS_Shape[] cArrayWrap(long[] ptrs) { TopoDS_Shape[] toReturn = new TopoDS_Shape[ptrs.length/2]; long ptr; int type; for (int i=0, j=0; i