1 /* ----------------------------------------------------------------------------
\r
2 * This file was automatically generated by SWIG (http://www.swig.org).
\r
5 * Do not make changes to this file unless you know what you are doing--modify
\r
6 * the SWIG interface file instead.
\r
7 * ----------------------------------------------------------------------------- */
\r
9 package org.jcae.opencascade.jni;
\r
11 /** Provides various utilities for BRep. */
\r
12 public class BRepTools {
\r
13 private long swigCPtr;
\r
14 protected boolean swigCMemOwn;
\r
16 public BRepTools(long cPtr, boolean cMemoryOwn) {
\r
17 swigCMemOwn = cMemoryOwn;
\r
21 public static long getCPtr(BRepTools obj) {
\r
22 return (obj == null) ? 0 : obj.swigCPtr;
\r
25 protected void finalize() {
\r
29 private synchronized void delete() {}
\r
32 * Read a shape from a file.
\r
33 * This is an helper method. It do not exists in Opencascade.
\r
34 * @param file the file to read
\r
35 * @param builder the builder which will be used to create the shape (i.e. <code>new BRep_Builder()</code>).
\r
37 public static TopoDS_Shape read(String file, BRep_Builder builder)
\r
39 TopoDS_Shape toReturn=new TopoDS_Shape();
\r
40 if(read(toReturn, file, builder))
\r
41 return TopoDS_Shape.downcast(toReturn);
\r
48 * Reads a shape from a file.
\r
49 * @param shape an empty shape created with <code>new TopoDS_Shape()</code>
\r
50 * @param builder used to build the shape (i.e. <code>new BRep_Builder()</code>).
\r
51 * @return false on IO or file format errors.
\r
53 public static boolean read(TopoDS_Shape shape, String file, BRep_Builder builder) {
\r
54 return OccJavaJNI.BRepTools_read__SWIG_0(TopoDS_Shape.getCPtr(shape), shape, file, BRep_Builder.getCPtr(builder), builder);
\r
59 * Write a shape to a file.
\r
60 * @param shape the shape to write
\r
61 * @param file the file where to write the shape
\r
62 * @return false on IO error.
\r
64 public static boolean write(TopoDS_Shape shape, String file) {
\r
65 return OccJavaJNI.BRepTools_write__SWIG_0(TopoDS_Shape.getCPtr(shape), shape, file);
\r
68 public static void write(TopoDS_Shape Sh, java.nio.channels.WritableByteChannel S) {
\r
69 OccJavaJNI.BRepTools_write__SWIG_1(TopoDS_Shape.getCPtr(Sh), Sh, S);
\r
72 public static void clean(TopoDS_Shape S) {
\r
73 OccJavaJNI.BRepTools_clean(TopoDS_Shape.getCPtr(S), S);
\r
76 public static boolean read(TopoDS_Shape shape, java.nio.channels.ReadableByteChannel input, BRep_Builder builder) {
\r
77 return OccJavaJNI.BRepTools_read__SWIG_1(TopoDS_Shape.getCPtr(shape), shape, input, BRep_Builder.getCPtr(builder), builder);
\r