1 /* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (http://www.swig.org).
5 * Do not make changes to this file unless you know what you are doing--modify
6 * the SWIG interface file instead.
7 * ----------------------------------------------------------------------------- */
9 package org.jcae.opencascade.jni;
11 public class TopoDS_Shape {
12 private transient long swigCPtr;
13 protected transient boolean swigCMemOwn;
15 protected TopoDS_Shape(long cPtr, boolean cMemoryOwn) {
16 swigCMemOwn = cMemoryOwn;
20 protected static long getCPtr(TopoDS_Shape obj) {
21 return (obj == null) ? 0 : obj.swigCPtr;
24 protected void finalize() {
28 public synchronized void delete() {
32 OccJavaJNI.delete_TopoDS_Shape(swigCPtr);
38 private long myTShape;
39 protected static TopoDS_Shape downcast(TopoDS_Shape in)
41 TopoDS_Shape toReturn = create(getCPtr(in));
46 protected static TopoDS_Shape create(long in)
50 //second argument is not use in swig
51 TopAbs_ShapeEnum type = TopAbs_ShapeEnum.swigToEnum(OccJavaJNI.TopoDS_Shape_shapeType(in, null));
52 return create(in, type);
55 protected static TopoDS_Shape create(long in, TopAbs_ShapeEnum type)
57 TopoDS_Shape toReturn=null;
63 toReturn=new TopoDS_Compound(in, true);
66 toReturn=new TopoDS_CompSolid(in, true);
69 toReturn=new TopoDS_Solid(in, true);
72 toReturn=new TopoDS_Shell(in, true);
75 toReturn=new TopoDS_Face(in, true);
78 toReturn=new TopoDS_Wire(in, true);
81 toReturn=new TopoDS_Edge(in, true);
84 toReturn=new TopoDS_Vertex(in, true);
87 toReturn.myTShape=toReturn.getTShape();
90 public boolean isSame(TopoDS_Shape s)
96 s.myTShape=s.getTShape();
98 if(myTShape==s.myTShape)
100 return nativeIsSame(s);
103 return nativeIsSame(s);
107 * Alias on the isSame method for an easy use of this class in java
110 public boolean equals(Object o)
112 if (o instanceof TopoDS_Shape)
114 return isSame((TopoDS_Shape)o);
119 public int hashCode()
121 return hashCode(Integer.MAX_VALUE);
124 protected static TopoDS_Shape[] cArrayWrap(long[] ptrs)
126 TopoDS_Shape[] toReturn = new TopoDS_Shape[ptrs.length/2];
129 for (int i=0, j=0; i<toReturn.length; i++)
132 type = (int)ptrs[j++];
133 toReturn[i] = create(ptr, TopAbs_ShapeEnum.swigToEnum(type));
138 protected static long[] cArrayUnwrap(TopoDS_Shape[] arrayWrapper)
140 long[] cArray = new long[arrayWrapper.length];
141 for (int i=0; i<arrayWrapper.length; i++)
142 cArray[i] = TopoDS_Shape.getCPtr(arrayWrapper[i]);
146 public TopAbs_ShapeEnum shapeType() {
147 return TopAbs_ShapeEnum.swigToEnum(OccJavaJNI.TopoDS_Shape_shapeType(swigCPtr, this));
150 public boolean nativeIsSame(TopoDS_Shape other) {
151 return OccJavaJNI.TopoDS_Shape_nativeIsSame(swigCPtr, this, TopoDS_Shape.getCPtr(other), other);
154 public TopAbs_Orientation orientation() {
155 return TopAbs_Orientation.swigToEnum(OccJavaJNI.TopoDS_Shape_orientation(swigCPtr, this));
158 public void reverse() {
159 OccJavaJNI.TopoDS_Shape_reverse(swigCPtr, this);
162 public TopoDS_Shape reversed() {
163 long cPtr = OccJavaJNI.TopoDS_Shape_reversed(swigCPtr, this);
164 return (TopoDS_Shape)TopoDS_Shape.create(cPtr);
167 public int hashCode(int Upper) {
168 return OccJavaJNI.TopoDS_Shape_hashCode(swigCPtr, this, Upper);
171 public boolean free() {
172 return OccJavaJNI.TopoDS_Shape_free__SWIG_0(swigCPtr, this);
175 public void free(boolean F) {
176 OccJavaJNI.TopoDS_Shape_free__SWIG_1(swigCPtr, this, F);
179 public long getTShape() {
180 return OccJavaJNI.TopoDS_Shape_getTShape(swigCPtr, this);
183 public TopoDS_Shape() {
184 this(OccJavaJNI.new_TopoDS_Shape(), true);