]> gerrit.simantics Code Review - simantics/3d.git/blob - org.jcae.opencascade/src/ShapeFix.i
de094dc5ad2fe2e97dce13dad3f781f2c86356c8
[simantics/3d.git] / org.jcae.opencascade / src / ShapeFix.i
1 /*
2  * Project Info:  http://jcae.sourceforge.net
3  * 
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)
7  * any later version.
8  *
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
12  * details.
13  *
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.
17  *
18  * (C) Copyright 2007, by EADS France
19  */
20
21 %{ #include <ShapeFix_Wireframe.hxx> %}
22 %{ #include <ShapeFix_Root.hxx> %}
23 %{ #include <ShapeBuild_ReShape.hxx> %}
24
25 class ShapeFix_Root 
26 {
27         ShapeFix_Root()=0;
28         public:
29         %rename(setPrecision) SetPrecision;
30         %rename(getPrecision) Precision;
31         %rename(setContext) SetContext;
32         void SetPrecision(const Standard_Real preci) ;
33         Standard_Real Precision() const;
34         void SetContext(const ShapeBuild_ReShape * context) ;
35 };
36
37 %extend ShapeFix_Root
38 {
39     ShapeBuild_ReShape * getContext()
40     {
41         Standard_Transient * p = self->Context();
42         return dynamic_cast<ShapeBuild_ReShape *>(p);
43     }
44 }
45
46 class ShapeFix_Wireframe: public ShapeFix_Root
47 {
48
49         public:
50         ShapeFix_Wireframe(const TopoDS_Shape& shape);
51         %rename(fixWireGaps) FixWireGaps;
52         %rename(fixSmallEdges) FixSmallEdges;
53         %rename(setLimitAngle) SetLimitAngle;
54         %rename(getLimitAngle) LimitAngle;
55         %rename(shape) Shape;
56         %javamethodmodifiers FixWireGaps() "
57         /** 
58          * Fixes gaps between ends of curves of adjacent edges (both 3d and pcurves)
59          * in wires. If precision is 0.0, uses Precision::Confusion().
60          */
61         public";
62         Standard_Boolean FixWireGaps();
63
64         %javamethodmodifiers FixSmallEdges() "
65         /**
66          * Fixes small edges in shape by merging adjacent edges.
67          * If precision is 0.0, uses Precision::Confusion().
68          */
69         public";
70         Standard_Boolean FixSmallEdges() ;
71
72         %javamethodmodifiers SetLimitAngle(const Standard_Real theLimitAngle) "
73         /**
74          * If two edges makes an angle greater this angle, these two edges
75          * will be not merged.
76          */
77         public";
78         void SetLimitAngle(const Standard_Real theLimitAngle) ;
79         Standard_Real LimitAngle() const;
80         TopoDS_Shape Shape() ;
81 };
82
83 %extend ShapeFix_Wireframe
84 {
85         void setDropSmallEdges(bool b)
86         {
87                 self->ModeDropSmallEdges()=b;
88         }
89         bool getDropSmallEdges()
90         {
91         return self->ModeDropSmallEdges()!=0;
92         }
93 };