2 * Project Info: http://jcae.sourceforge.net
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License as published by the Free
6 * Software Foundation; either version 2.1 of the License, or (at your option)
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
18 * (C) Copyright 2005, by EADS CRC
22 #include <BRepTools.hxx>
23 #include <BRepTools_ShapeSet.hxx>
26 // define another read method that match the one of libOccJava (the one below don't).
27 %typemap(javacode) BRepTools
30 * Read a shape from a file.
31 * This is an helper method. It do not exists in Opencascade.
32 * @param file the file to read
33 * @param builder the builder which will be used to create the shape (i.e. <code>new BRep_Builder()</code>).
35 public static TopoDS_Shape read(String file, BRep_Builder builder)
37 TopoDS_Shape toReturn=new TopoDS_Shape();
38 if(read(toReturn, file, builder))
39 return TopoDS_Shape.downcast(toReturn);
45 %typemap(javaimports) BRepTools "
46 /** Provides various utilities for BRep. */"
48 %typemap(javadestruct, methodname="delete", methodmodifiers="private synchronized") BRepTools {};
52 %javamethodmodifiers Read(TopoDS_Shape& ,const Standard_CString, const BRep_Builder&) "
54 * Reads a shape from a file.
55 * @param shape an empty shape created with <code>new TopoDS_Shape()</code>
56 * @param builder used to build the shape (i.e. <code>new BRep_Builder()</code>).
57 * @return false on IO or file format errors.
61 //Hide the constructor to make this class entirely static.
66 static Standard_Boolean Read(TopoDS_Shape& shape,
67 const Standard_CString file, const BRep_Builder& builder) ;
69 %javamethodmodifiers Write(const TopoDS_Shape&, const Standard_CString)"
71 * Write a shape to a file.
72 * @param shape the shape to write
73 * @param file the file where to write the shape
74 * @return false on IO error.
79 static Standard_Boolean Write(const TopoDS_Shape& shape,
80 const Standard_CString file);
82 static void Write(const TopoDS_Shape& Sh,Standard_OStream& S) ;
84 static void Clean(const TopoDS_Shape& S) ;
89 //in the original version of this method opencascade suppose that the format of the stream is
90 //correct and don't do any verification. It cause segfault when the stream is wrong.
91 static Standard_Boolean read(TopoDS_Shape& shape, Standard_IStream& input, const BRep_Builder& builder)
93 BRepTools_ShapeSet SS(builder);
95 if(!SS.NbShapes()) return Standard_False;
103 * BRepTools_WireExplorer
105 %{#include <BRepTools_WireExplorer.hxx>%}
106 class BRepTools_WireExplorer
111 %rename(current) Current;
112 %rename(orientation) Orientation;
113 %rename(currentVertex) CurrentVertex;
114 %rename(clear) Clear;
116 BRepTools_WireExplorer();
117 BRepTools_WireExplorer(const TopoDS_Wire& W);
118 BRepTools_WireExplorer(const TopoDS_Wire& W,const TopoDS_Face& F);
119 void Init(const TopoDS_Wire& W) ;
120 void Init(const TopoDS_Wire& W,const TopoDS_Face& F) ;
121 Standard_Boolean More() const;
123 const TopoDS_Edge& Current() const;
124 TopAbs_Orientation Orientation() const;
125 const TopoDS_Vertex& CurrentVertex() const;
129 %{#include <BRepTools_Quilt.hxx>%}
130 class BRepTools_Quilt
134 %rename(isCopied) IsCopied;
136 %rename(shells) Shells;
139 void Bind(const TopoDS_Edge& Eold,const TopoDS_Edge& Enew) ;
140 void Bind(const TopoDS_Vertex& Vold,const TopoDS_Vertex& Vnew) ;
141 void Add(const TopoDS_Shape& S) ;
142 Standard_Boolean IsCopied(const TopoDS_Shape& S) const;
143 const TopoDS_Shape& Copy(const TopoDS_Shape& S) const;
144 TopoDS_Shape Shells() const;