]> gerrit.simantics Code Review - simantics/3d.git/blob - org.jcae.opencascade/src-java/org/jcae/opencascade/jni/BRepTools.java
Updated OpenCASCADE to 7.3.0
[simantics/3d.git] / org.jcae.opencascade / src-java / org / jcae / opencascade / jni / BRepTools.java
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 3.0.12
4  *
5  * Do not make changes to this file unless you know what you are doing--modify
6  * the SWIG interface file instead.
7  * ----------------------------------------------------------------------------- */
8
9 package org.jcae.opencascade.jni;
10
11 /** Provides various utilities for BRep. */
12 public class BRepTools {
13   private transient long swigCPtr;
14   protected transient boolean swigCMemOwn;
15
16   protected BRepTools(long cPtr, boolean cMemoryOwn) {
17     swigCMemOwn = cMemoryOwn;
18     swigCPtr = cPtr;
19   }
20
21   protected static long getCPtr(BRepTools obj) {
22     return (obj == null) ? 0 : obj.swigCPtr;
23   }
24
25   protected void finalize() {
26     delete();
27   }
28
29   private synchronized void delete() {}
30
31         /**
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>).
36          */
37         public static TopoDS_Shape read(String file, BRep_Builder builder)
38         {
39                 TopoDS_Shape toReturn=new TopoDS_Shape();
40                 if(read(toReturn, file, builder))
41                         return TopoDS_Shape.downcast(toReturn);
42                 else
43                         return null;
44         }
45
46   
47         /**
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.
52          */
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);
55 }
56
57   
58         /**
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.
63          */
64         public static boolean write(TopoDS_Shape shape, String file) {
65         return OccJavaJNI.BRepTools_write__SWIG_0(TopoDS_Shape.getCPtr(shape), shape, file);
66 }
67
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);
70   }
71
72   public static void clean(TopoDS_Shape S) {
73     OccJavaJNI.BRepTools_clean(TopoDS_Shape.getCPtr(S), S);
74   }
75
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);
78 }
79
80 }