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 /** Provides various utilities for BRep. */
12 public class BRepTools {
13 private transient long swigCPtr;
14 protected transient boolean swigCMemOwn;
16 protected BRepTools(long cPtr, boolean cMemoryOwn) {
17 swigCMemOwn = cMemoryOwn;
21 protected static long getCPtr(BRepTools obj) {
22 return (obj == null) ? 0 : obj.swigCPtr;
25 protected void finalize() {
29 private synchronized void delete() {}
32 * Read a shape from a file.
33 * This is an helper method. It do not exists in Opencascade.
34 * @param file the file to read
35 * @param builder the builder which will be used to create the shape (i.e. <code>new BRep_Builder()</code>).
37 public static TopoDS_Shape read(String file, BRep_Builder builder)
39 TopoDS_Shape toReturn=new TopoDS_Shape();
40 if(read(toReturn, file, builder))
41 return TopoDS_Shape.downcast(toReturn);
48 * Reads a shape from a file.
49 * @param shape an empty shape created with <code>new TopoDS_Shape()</code>
50 * @param builder used to build the shape (i.e. <code>new BRep_Builder()</code>).
51 * @return false on IO or file format errors.
53 public static boolean read(TopoDS_Shape shape, String file, BRep_Builder builder) {
54 return OccJavaJNI.BRepTools_read__SWIG_0(TopoDS_Shape.getCPtr(shape), shape, file, BRep_Builder.getCPtr(builder), builder);
59 * Write a shape to a file.
60 * @param shape the shape to write
61 * @param file the file where to write the shape
62 * @return false on IO error.
64 public static boolean write(TopoDS_Shape shape, String file) {
65 return OccJavaJNI.BRepTools_write__SWIG_0(TopoDS_Shape.getCPtr(shape), shape, file);
68 public static void write(TopoDS_Shape Sh, java.nio.channels.WritableByteChannel S) {
69 OccJavaJNI.BRepTools_write__SWIG_1(TopoDS_Shape.getCPtr(Sh), Sh, S);
72 public static void clean(TopoDS_Shape S) {
73 OccJavaJNI.BRepTools_clean(TopoDS_Shape.getCPtr(S), S);
76 public static boolean read(TopoDS_Shape shape, java.nio.channels.ReadableByteChannel input, BRep_Builder builder) {
77 return OccJavaJNI.BRepTools_read__SWIG_1(TopoDS_Shape.getCPtr(shape), shape, input, BRep_Builder.getCPtr(builder), builder);