X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.jcae.opencascade%2Fsrc-java%2Forg%2Fjcae%2Fopencascade%2Fjni%2FBRepTools.java;h=8ff188ed947599987477de7d3e971af3b49e3560;hb=3c9a6cf62d7a2c70f0f7b1cbfa25ba822291ac8c;hp=3715fdbc5db44e2b11b1aefb4bbc000c9f162179;hpb=471c46e9a685e20de958d77166461aebc7a7b6ee;p=simantics%2F3d.git diff --git a/org.jcae.opencascade/src-java/org/jcae/opencascade/jni/BRepTools.java b/org.jcae.opencascade/src-java/org/jcae/opencascade/jni/BRepTools.java index 3715fdbc..8ff188ed 100644 --- a/org.jcae.opencascade/src-java/org/jcae/opencascade/jni/BRepTools.java +++ b/org.jcae.opencascade/src-java/org/jcae/opencascade/jni/BRepTools.java @@ -1,80 +1,80 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 - * - * 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; - -/** Provides various utilities for BRep. */ -public class BRepTools { - private long swigCPtr; - protected boolean swigCMemOwn; - - public BRepTools(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - public static long getCPtr(BRepTools obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected void finalize() { - delete(); - } - - private synchronized void delete() {} - - /** - * Read a shape from a file. - * This is an helper method. It do not exists in Opencascade. - * @param file the file to read - * @param builder the builder which will be used to create the shape (i.e. new BRep_Builder()). - */ - public static TopoDS_Shape read(String file, BRep_Builder builder) - { - TopoDS_Shape toReturn=new TopoDS_Shape(); - if(read(toReturn, file, builder)) - return TopoDS_Shape.downcast(toReturn); - else - return null; - } - - - /** - * Reads a shape from a file. - * @param shape an empty shape created with new TopoDS_Shape() - * @param builder used to build the shape (i.e. new BRep_Builder()). - * @return false on IO or file format errors. - */ - public static boolean read(TopoDS_Shape shape, String file, BRep_Builder builder) { - return OccJavaJNI.BRepTools_read__SWIG_0(TopoDS_Shape.getCPtr(shape), shape, file, BRep_Builder.getCPtr(builder), builder); -} - - - /** - * Write a shape to a file. - * @param shape the shape to write - * @param file the file where to write the shape - * @return false on IO error. - */ - public static boolean write(TopoDS_Shape shape, String file) { - return OccJavaJNI.BRepTools_write__SWIG_0(TopoDS_Shape.getCPtr(shape), shape, file); -} - - public static void write(TopoDS_Shape Sh, java.nio.channels.WritableByteChannel S) { - OccJavaJNI.BRepTools_write__SWIG_1(TopoDS_Shape.getCPtr(Sh), Sh, S); - } - - public static void clean(TopoDS_Shape S) { - OccJavaJNI.BRepTools_clean(TopoDS_Shape.getCPtr(S), S); - } - - public static boolean read(TopoDS_Shape shape, java.nio.channels.ReadableByteChannel input, BRep_Builder builder) { - return OccJavaJNI.BRepTools_read__SWIG_1(TopoDS_Shape.getCPtr(shape), shape, input, BRep_Builder.getCPtr(builder), builder); -} - -} +/* ---------------------------------------------------------------------------- + * 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; + +/** Provides various utilities for BRep. */ +public class BRepTools { + private transient long swigCPtr; + protected transient boolean swigCMemOwn; + + protected BRepTools(long cPtr, boolean cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = cPtr; + } + + protected static long getCPtr(BRepTools obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + protected void finalize() { + delete(); + } + + private synchronized void delete() {} + + /** + * Read a shape from a file. + * This is an helper method. It do not exists in Opencascade. + * @param file the file to read + * @param builder the builder which will be used to create the shape (i.e. new BRep_Builder()). + */ + public static TopoDS_Shape read(String file, BRep_Builder builder) + { + TopoDS_Shape toReturn=new TopoDS_Shape(); + if(read(toReturn, file, builder)) + return TopoDS_Shape.downcast(toReturn); + else + return null; + } + + + /** + * Reads a shape from a file. + * @param shape an empty shape created with new TopoDS_Shape() + * @param builder used to build the shape (i.e. new BRep_Builder()). + * @return false on IO or file format errors. + */ + public static boolean read(TopoDS_Shape shape, String file, BRep_Builder builder) { + return OccJavaJNI.BRepTools_read__SWIG_0(TopoDS_Shape.getCPtr(shape), shape, file, BRep_Builder.getCPtr(builder), builder); +} + + + /** + * Write a shape to a file. + * @param shape the shape to write + * @param file the file where to write the shape + * @return false on IO error. + */ + public static boolean write(TopoDS_Shape shape, String file) { + return OccJavaJNI.BRepTools_write__SWIG_0(TopoDS_Shape.getCPtr(shape), shape, file); +} + + public static void write(TopoDS_Shape Sh, java.nio.channels.WritableByteChannel S) { + OccJavaJNI.BRepTools_write__SWIG_1(TopoDS_Shape.getCPtr(Sh), Sh, S); + } + + public static void clean(TopoDS_Shape S) { + OccJavaJNI.BRepTools_clean(TopoDS_Shape.getCPtr(S), S); + } + + public static boolean read(TopoDS_Shape shape, java.nio.channels.ReadableByteChannel input, BRep_Builder builder) { + return OccJavaJNI.BRepTools_read__SWIG_1(TopoDS_Shape.getCPtr(shape), shape, input, BRep_Builder.getCPtr(builder), builder); +} + +}