1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
\r
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
\r
4 // This library is free software; you can redistribute it and/or
\r
5 // modify it under the terms of the GNU Lesser General Public
\r
6 // License as published by the Free Software Foundation; either
\r
7 // version 2.1 of the License.
\r
9 // This library is distributed in the hope that it will be useful,
\r
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
\r
12 // Lesser General Public License for more details.
\r
14 // You should have received a copy of the GNU Lesser General Public
\r
15 // License along with this library; if not, write to the Free Software
\r
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
18 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
\r
22 // File : SMESH_Filter.idl
\r
23 // Author : Alexey Petrov, OCC
\r
25 #ifndef _SMESH_FILTER_IDL_
\r
26 #define _SMESH_FILTER_IDL_
\r
28 #include "SALOME_Exception.idl"
\r
29 #include "SALOME_GenericObj.idl"
\r
30 #include "SMESH_Mesh.idl"
\r
35 interface GEOM_Object;
\r
43 * Enumeration of functor types
\r
59 FT_BelongToCylinder,
\r
71 * Base interface for all functors ( i.e. numerical functors and predicates )
\r
73 interface Functor: SALOME::GenericObj
\r
75 void SetMesh( in SMESH_Mesh theMesh );
\r
76 FunctorType GetFunctorType();
\r
77 ElementType GetElementType();
\r
83 * Numerical functors are intended for calculating value by Id of mesh entity
\r
85 interface NumericalFunctor: Functor
\r
87 double GetValue( in long theElementId );
\r
90 * Set precision for calculation. It is a position after point which is
\r
91 * used to functor value after calculation.
\r
93 void SetPrecision( in long thePrecision );
\r
94 long GetPrecision();
\r
96 interface MinimumAngle : NumericalFunctor{};
\r
97 interface AspectRatio : NumericalFunctor{};
\r
98 interface Warping : NumericalFunctor{};
\r
99 interface Taper : NumericalFunctor{};
\r
100 interface Skew : NumericalFunctor{};
\r
101 interface Area : NumericalFunctor{};
\r
102 interface Length : NumericalFunctor{};
\r
103 interface MultiConnection : NumericalFunctor{};
\r
106 * Predicates are intended for verification of criteria,
\r
107 * must return bool value by mesh id
\r
109 interface Predicate: Functor
\r
111 boolean IsSatisfy( in long thEntityId );
\r
115 * Logical functor (predicate) "Belong To Geometry".
\r
116 * Verify whether mesh element or node belong to pointed Geom Object
\r
118 interface BelongToGeom: Predicate
\r
120 void SetGeom( in GEOM::GEOM_Object theGeom );
\r
121 void SetElementType( in ElementType theType );
\r
123 void SetShapeName( in string theName );
\r
124 string GetShapeName();
\r
128 * Logical functor (predicate) "Belong To Surface".
\r
129 * Base interface for "belong to plane" and "belong to cylinder interfaces"
\r
131 interface BelongToSurface: Predicate
\r
133 void SetTolerance( in double theToler );
\r
134 double GetTolerance();
\r
135 void SetShapeName( in string theName, in ElementType theType );
\r
136 string GetShapeName();
\r
141 * Logical functor (predicate) "Belong To Plane".
\r
142 * Verify whether mesh element lie in pointed Geom planar object
\r
144 interface BelongToPlane: BelongToSurface
\r
146 void SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
\r
150 * Logical functor (predicate) "Belong To Culinder".
\r
151 * Verify whether mesh element lie in pointed Geom cylindrical object
\r
153 interface BelongToCylinder: BelongToSurface
\r
155 void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
\r
159 * Logical functor (predicate) "Free borders".
\r
160 * Verify whether 1D mesh element is free ( i.e. connected to one face only )
\r
162 interface FreeBorders: Predicate{};
\r
165 * Logical functor (predicate) "Free edges".
\r
166 * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )
\r
168 interface FreeEdges: Predicate
\r
174 long myPnt1, myPnt2;
\r
176 typedef sequence<Border> Borders;
\r
177 Borders GetBorders();
\r
182 * Abstract logical functor (predicate) "RangeOfIds".
\r
183 * Verify whether an Entity Id belongs to defined sequence of id's
\r
185 interface RangeOfIds: Predicate
\r
187 void SetRange( in long_array theIds );
\r
188 boolean SetRangeStr( in string theRange );
\r
189 string GetRangeStr();
\r
191 void SetElementType( in ElementType theType );
\r
195 * Comparator. Predicate for compare value calculated
\r
196 * by numerical functor with threshold value
\r
198 interface Comparator: Predicate
\r
200 void SetMargin( in double theValue );
\r
201 void SetNumFunctor( in NumericalFunctor theFunct );
\r
202 double GetMargin();
\r
204 interface LessThan: Comparator{};
\r
205 interface MoreThan: Comparator{};
\r
206 interface EqualTo : Comparator
\r
208 void SetTolerance( in double theToler );
\r
209 double GetTolerance();
\r
213 * Logical predicates are intended for compose predicates using boolean operations
\r
215 interface Logical: Predicate{};
\r
217 interface LogicalNOT: Logical
\r
219 void SetPredicate(in Predicate thePredicate);
\r
222 interface LogicalBinary: Logical
\r
224 void SetPredicate1( in Predicate thePredicate );
\r
225 void SetPredicate2( in Predicate thePredicate );
\r
228 interface LogicalAND: LogicalBinary{};
\r
229 interface LogicalOR : LogicalBinary{};
\r
234 interface Filter: SALOME::GenericObj
\r
237 * Structure containing information about one criterion
\r
238 * Type - FT_Taper, FT_Skew ...
\r
239 * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo
\r
240 * Threshold - threshold value
\r
241 * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined
\r
242 * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or
\r
243 * (FT_Undefined must be for the last criterion)
\r
244 * ThresholdStr - Threshold value defined as string. Used for:
\r
245 * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
\r
246 * 2. BelongToGeom predicate for storing name of shape
\r
247 * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
\r
248 * "Belong to plane" and "Belong to cylinder" predicates
\r
249 * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
\r
250 * Precision - Precision of numerical functors
\r
257 string ThresholdStr;
\r
261 ElementType TypeOfElement;
\r
265 typedef sequence<Criterion> Criteria;
\r
267 void SetPredicate( in Predicate thePredicate );
\r
268 long_array GetElementsId( in SMESH_Mesh theMesh );
\r
269 ElementType GetElementType();
\r
270 Predicate GetPredicate();
\r
272 boolean GetCriteria( out Criteria theCriteria );
\r
273 boolean SetCriteria( in Criteria theCriteria );
\r
278 * Interface for working with library of filters
\r
280 interface FilterLibrary : SALOME::GenericObj
\r
283 * Copy filter from library by name (new filter is created)
\r
285 Filter Copy( in string theFilterName );
\r
288 * Methods for editing library
\r
290 boolean Add ( in string theFilterName, in Filter theFilter );
\r
291 boolean AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
\r
292 boolean Delete ( in string theFilterName );
\r
293 boolean Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
\r
296 * Save library on disk
\r
299 boolean SaveAs( in string aFileName );
\r
304 boolean IsPresent( in string aFilterName );
\r
305 long NbFilters( in ElementType aType );
\r
306 string_array GetNames( in ElementType aType );
\r
307 string_array GetAllNames();
\r
308 void SetFileName( in string aFilterName );
\r
309 string GetFileName();
\r
314 * Interface of Filter manager
\r
316 interface FilterManager: SALOME::GenericObj
\r
319 * Create numerical functors
\r
321 MinimumAngle CreateMinimumAngle();
\r
322 AspectRatio CreateAspectRatio();
\r
323 Warping CreateWarping();
\r
324 Taper CreateTaper();
\r
327 Length CreateLength();
\r
328 MultiConnection CreateMultiConnection();
\r
331 * Create logical functors ( predicates )
\r
333 BelongToGeom CreateBelongToGeom();
\r
334 BelongToPlane CreateBelongToPlane();
\r
335 BelongToCylinder CreateBelongToCylinder();
\r
337 FreeBorders CreateFreeBorders();
\r
338 FreeEdges CreateFreeEdges();
\r
340 RangeOfIds CreateRangeOfIds();
\r
343 * Create comparators ( predicates )
\r
345 LessThan CreateLessThan();
\r
346 MoreThan CreateMoreThan();
\r
347 EqualTo CreateEqualTo();
\r
350 * Create boolean operations ( predicates )
\r
352 LogicalNOT CreateLogicalNOT();
\r
353 LogicalAND CreateLogicalAND();
\r
354 LogicalOR CreateLogicalOR();
\r
359 Filter CreateFilter();
\r
362 * Load filter library. If libary does not exist it is created
\r
364 FilterLibrary LoadLibrary( in string aFileName );
\r
367 * Create new library
\r
369 FilterLibrary CreateLibrary();
\r
374 boolean DeleteLibrary( in string aFileName );
\r