]> gerrit.simantics Code Review - simantics/3d.git/blob - org.jcae.opencascade/src/ShapeFix.i
Equipment/Component library customization
[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         // FIXME: 7.3.0
42         //Standard_Transient * p = self->Context();
43         Standard_Transient * p = self->This();
44         return dynamic_cast<ShapeBuild_ReShape *>(p);
45     }
46 }
47
48 class ShapeFix_Wireframe: public ShapeFix_Root
49 {
50
51         public:
52         ShapeFix_Wireframe(const TopoDS_Shape& shape);
53         %rename(fixWireGaps) FixWireGaps;
54         %rename(fixSmallEdges) FixSmallEdges;
55         %rename(setLimitAngle) SetLimitAngle;
56         %rename(getLimitAngle) LimitAngle;
57         %rename(shape) Shape;
58         %javamethodmodifiers FixWireGaps() "
59         /** 
60          * Fixes gaps between ends of curves of adjacent edges (both 3d and pcurves)
61          * in wires. If precision is 0.0, uses Precision::Confusion().
62          */
63         public";
64         Standard_Boolean FixWireGaps();
65
66         %javamethodmodifiers FixSmallEdges() "
67         /**
68          * Fixes small edges in shape by merging adjacent edges.
69          * If precision is 0.0, uses Precision::Confusion().
70          */
71         public";
72         Standard_Boolean FixSmallEdges() ;
73
74         %javamethodmodifiers SetLimitAngle(const Standard_Real theLimitAngle) "
75         /**
76          * If two edges makes an angle greater this angle, these two edges
77          * will be not merged.
78          */
79         public";
80         void SetLimitAngle(const Standard_Real theLimitAngle) ;
81         Standard_Real LimitAngle() const;
82         TopoDS_Shape Shape() ;
83 };
84
85 %extend ShapeFix_Wireframe
86 {
87         void setDropSmallEdges(bool b)
88         {
89                 self->ModeDropSmallEdges()=b;
90         }
91         bool getDropSmallEdges()
92         {
93         return self->ModeDropSmallEdges()!=0;
94         }
95 };