/* ---------------------------------------------------------------------------- * 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); } }