1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
22 // File : SMESH_Filter.idl
23 // Author : Alexey Petrov, OCC
25 #ifndef _SMESH_FILTER_IDL_
26 #define _SMESH_FILTER_IDL_
28 #include "SALOME_Exception.idl"
29 #include "SALOME_GenericObj.idl"
30 #include "SMESH_Mesh.idl"
35 interface GEOM_Object;
43 * Enumeration of functor types
74 * Base interface for all functors ( i.e. numerical functors and predicates )
76 interface Functor: SALOME::GenericObj
78 void SetMesh( in SMESH_Mesh theMesh );
79 FunctorType GetFunctorType();
80 ElementType GetElementType();
86 * Numerical functors are intended for calculating value by Id of mesh entity
88 interface NumericalFunctor: Functor
90 double GetValue( in long theElementId );
93 * Set precision for calculation. It is a position after point which is
94 * used to functor value after calculation.
96 void SetPrecision( in long thePrecision );
99 interface MinimumAngle : NumericalFunctor{};
100 interface AspectRatio : NumericalFunctor{};
101 interface AspectRatio3D : NumericalFunctor{};
102 interface Warping : NumericalFunctor{};
103 interface Taper : NumericalFunctor{};
104 interface Skew : NumericalFunctor{};
105 interface Area : NumericalFunctor{};
106 interface Length : NumericalFunctor{};
107 interface Length2D : NumericalFunctor
114 typedef sequence<Value> Values;
117 interface MultiConnection : NumericalFunctor{};
118 interface MultiConnection2D : NumericalFunctor
126 typedef sequence<Value> Values;
131 * Predicates are intended for verification of criteria,
132 * must return bool value by mesh id
134 interface Predicate: Functor
136 boolean IsSatisfy( in long thEntityId );
140 * Logical functor (predicate) "Belong To Geometry".
141 * Verify whether mesh element or node belong to pointed Geom Object
143 interface BelongToGeom: Predicate
145 void SetGeom( in GEOM::GEOM_Object theGeom );
146 void SetElementType( in ElementType theType );
148 void SetShapeName( in string theName );
149 string GetShapeName();
153 * Logical functor (predicate) "Belong To Surface".
154 * Base interface for "belong to plane" and "belong to cylinder interfaces"
156 interface BelongToSurface: Predicate
158 void SetTolerance( in double theToler );
159 double GetTolerance();
160 void SetShapeName( in string theName, in ElementType theType );
161 string GetShapeName();
166 * Logical functor (predicate) "Belong To Plane".
167 * Verify whether mesh element lie in pointed Geom planar object
169 interface BelongToPlane: BelongToSurface
171 void SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
175 * Logical functor (predicate) "Belong To Culinder".
176 * Verify whether mesh element lie in pointed Geom cylindrical object
178 interface BelongToCylinder: BelongToSurface
180 void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
184 * Logical functor (predicate) "Free borders".
185 * Verify whether 1D mesh element is free ( i.e. connected to one face only )
187 interface FreeBorders: Predicate{};
190 * Logical functor (predicate) "Free edges".
191 * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )
193 interface FreeEdges: Predicate
201 typedef sequence<Border> Borders;
202 Borders GetBorders();
207 * Abstract logical functor (predicate) "RangeOfIds".
208 * Verify whether an Entity Id belongs to defined sequence of id's
210 interface RangeOfIds: Predicate
212 void SetRange( in long_array theIds );
213 boolean SetRangeStr( in string theRange );
214 string GetRangeStr();
216 void SetElementType( in ElementType theType );
220 * Comparator. Predicate for compare value calculated
221 * by numerical functor with threshold value
223 interface Comparator: Predicate
225 void SetMargin( in double theValue );
226 void SetNumFunctor( in NumericalFunctor theFunct );
229 interface LessThan: Comparator{};
230 interface MoreThan: Comparator{};
231 interface EqualTo : Comparator
233 void SetTolerance( in double theToler );
234 double GetTolerance();
238 * Logical predicates are intended for compose predicates using boolean operations
240 interface Logical: Predicate{};
242 interface LogicalNOT: Logical
244 void SetPredicate(in Predicate thePredicate);
247 interface LogicalBinary: Logical
249 void SetPredicate1( in Predicate thePredicate );
250 void SetPredicate2( in Predicate thePredicate );
253 interface LogicalAND: LogicalBinary{};
254 interface LogicalOR : LogicalBinary{};
259 interface Filter: SALOME::GenericObj
262 * Structure containing information about one criterion
263 * Type - FT_Taper, FT_Skew ...
264 * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo
265 * Threshold - threshold value
266 * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined
267 * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or
268 * (FT_Undefined must be for the last criterion)
269 * ThresholdStr - Threshold value defined as string. Used for:
270 * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
271 * 2. BelongToGeom predicate for storing name of shape
272 * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
273 * "Belong to plane" and "Belong to cylinder" predicates
274 * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
275 * Precision - Precision of numerical functors
286 ElementType TypeOfElement;
290 typedef sequence<Criterion> Criteria;
292 void SetPredicate( in Predicate thePredicate );
293 long_array GetElementsId( in SMESH_Mesh theMesh );
294 ElementType GetElementType();
295 Predicate GetPredicate();
297 boolean GetCriteria( out Criteria theCriteria );
298 boolean SetCriteria( in Criteria theCriteria );
303 * Interface for working with library of filters
305 interface FilterLibrary : SALOME::GenericObj
308 * Copy filter from library by name (new filter is created)
310 Filter Copy( in string theFilterName );
313 * Methods for editing library
315 boolean Add ( in string theFilterName, in Filter theFilter );
316 boolean AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
317 boolean Delete ( in string theFilterName );
318 boolean Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
321 * Save library on disk
324 boolean SaveAs( in string aFileName );
329 boolean IsPresent( in string aFilterName );
330 long NbFilters( in ElementType aType );
331 string_array GetNames( in ElementType aType );
332 string_array GetAllNames();
333 void SetFileName( in string aFilterName );
334 string GetFileName();
339 * Interface of Filter manager
341 interface FilterManager: SALOME::GenericObj
344 * Create numerical functors
346 MinimumAngle CreateMinimumAngle();
347 AspectRatio CreateAspectRatio();
348 AspectRatio3D CreateAspectRatio3D();
349 Warping CreateWarping();
353 Length CreateLength();
354 Length2D CreateLength2D();
355 MultiConnection CreateMultiConnection();
356 MultiConnection2D CreateMultiConnection2D();
359 * Create logical functors ( predicates )
361 BelongToGeom CreateBelongToGeom();
362 BelongToPlane CreateBelongToPlane();
363 BelongToCylinder CreateBelongToCylinder();
365 FreeBorders CreateFreeBorders();
366 FreeEdges CreateFreeEdges();
368 RangeOfIds CreateRangeOfIds();
371 * Create comparators ( predicates )
373 LessThan CreateLessThan();
374 MoreThan CreateMoreThan();
375 EqualTo CreateEqualTo();
378 * Create boolean operations ( predicates )
380 LogicalNOT CreateLogicalNOT();
381 LogicalAND CreateLogicalAND();
382 LogicalOR CreateLogicalOR();
387 Filter CreateFilter();
390 * Load filter library. If libary does not exist it is created
392 FilterLibrary LoadLibrary( in string aFileName );
397 FilterLibrary CreateLibrary();
402 boolean DeleteLibrary( in string aFileName );