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.salome-platform.org/ or email : webmaster.salome@opencascade.com
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 "GEOM_Gen.idl"
31 #include "SMESH_Mesh.idl"
37 * Enumeration of functor types
58 FT_BelongToGenSurface,
72 * Base interface for all functors ( i.e. numerical functors and predicates )
74 interface Functor: SALOME::GenericObj
76 void SetMesh( in SMESH_Mesh theMesh );
77 FunctorType GetFunctorType();
78 ElementType GetElementType();
84 * Numerical functors are intended for calculating value by Id of mesh entity
86 interface NumericalFunctor: Functor
88 double GetValue( in long theElementId );
91 * Set precision for calculation. It is a position after point which is
92 * used to functor value after calculation.
94 void SetPrecision( in long thePrecision );
97 interface MinimumAngle : NumericalFunctor{};
98 interface AspectRatio : NumericalFunctor{};
99 interface AspectRatio3D : NumericalFunctor{};
100 interface Warping : NumericalFunctor{};
101 interface Taper : NumericalFunctor{};
102 interface Skew : NumericalFunctor{};
103 interface Area : NumericalFunctor{};
104 interface Volume3D : NumericalFunctor{};
105 interface Length : NumericalFunctor{};
106 interface Length2D : NumericalFunctor
113 typedef sequence<Value> Values;
116 interface MultiConnection : NumericalFunctor{};
117 interface MultiConnection2D : NumericalFunctor
125 typedef sequence<Value> Values;
130 * Predicates are intended for verification of criteria,
131 * must return bool value by mesh id
133 interface Predicate: Functor
135 boolean IsSatisfy( in long thEntityId );
139 * Logical functor (predicate) "Bad Oriented Volume".
140 * Verify whether a mesh volume is incorrectly oriented from
141 * the point of view of MED convention
143 interface BadOrientedVolume: Predicate {};
146 * Logical functor (predicate) "Belong To Geometry".
147 * Verify whether mesh element or node belong to pointed Geom Object
149 interface BelongToGeom: Predicate
151 void SetGeom( in GEOM::GEOM_Object theGeom );
152 void SetElementType( in ElementType theType );
154 /*! The tolerance is used only if there is no submesh on the shape
156 void SetTolerance( in double theToler );
157 double GetTolerance();
159 void SetShapeName( in string theName );
160 void SetShape( in string theID, in string theName );
161 string GetShapeName();
166 * Logical functor (predicate) "Belong To Surface".
167 * Base interface for "belong to plane" and "belong to cylinder"
168 * and "Belong To Generic Surface" interfaces
170 interface BelongToSurface: Predicate
172 void SetTolerance( in double theToler );
173 double GetTolerance();
174 void SetShapeName( in string theName, in ElementType theType );
175 void SetShape( in string theID, in string theName, in ElementType theType );
176 string GetShapeName();
179 * Limit surface extent to bounding box of boundaries (edges)
180 * in surface parametric space. Boundaries are ignored by default
182 void SetUseBoundaries( in boolean theUseBndRestrictions );
183 boolean GetUseBoundaries();
187 * Logical functor (predicate) "Belong To Plane".
188 * Verify whether mesh element lie on pointed Geom planar object
190 interface BelongToPlane: BelongToSurface
192 void SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
196 * Logical functor (predicate) "Belong To Cylinder".
197 * Verify whether mesh element lie on pointed Geom cylindrical object
199 interface BelongToCylinder: BelongToSurface
201 void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
205 * Logical functor (predicate) "Belong To Generic Surface".
206 * Verify whether mesh element lie in pointed Geom cylindrical object
208 interface BelongToGenSurface: BelongToSurface
210 void SetSurface( in GEOM::GEOM_Object theGeom, in ElementType theType );
214 * Logical functor (predicate) "Lying On Geometry".
215 * Verify whether mesh element or node lying or partially lying on the pointed Geom Object
217 interface LyingOnGeom: Predicate
219 void SetGeom( in GEOM::GEOM_Object theGeom );
220 void SetElementType( in ElementType theType );
222 /*! The tolerance is used only if there is no submesh on the shape
224 void SetTolerance( in double theToler );
225 double GetTolerance();
227 void SetShapeName( in string theName );
228 void SetShape( in string theID, in string theName );
229 string GetShapeName();
234 * Logical functor (predicate) "Free borders".
235 * Verify whether 1D mesh element is free ( i.e. connected to one face only )
237 interface FreeBorders: Predicate{};
240 * Logical functor (predicate) "Free edges".
241 * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )
243 interface FreeEdges: Predicate
251 typedef sequence<Border> Borders;
252 Borders GetBorders();
257 * Abstract logical functor (predicate) "RangeOfIds".
258 * Verify whether an Entity Id belongs to defined sequence of id's
260 interface RangeOfIds: Predicate
262 void SetRange( in long_array theIds );
263 boolean SetRangeStr( in string theRange );
264 string GetRangeStr();
266 void SetElementType( in ElementType theType );
270 * Comparator. Predicate for compare value calculated
271 * by numerical functor with threshold value
273 interface Comparator: Predicate
275 void SetMargin( in double theValue );
276 void SetNumFunctor( in NumericalFunctor theFunct );
279 interface LessThan: Comparator{};
280 interface MoreThan: Comparator{};
281 interface EqualTo : Comparator
283 void SetTolerance( in double theToler );
284 double GetTolerance();
288 * Logical predicates are intended for compose predicates using boolean operations
290 interface Logical: Predicate{};
292 interface LogicalNOT: Logical
294 void SetPredicate(in Predicate thePredicate);
297 interface LogicalBinary: Logical
299 void SetPredicate1( in Predicate thePredicate );
300 void SetPredicate2( in Predicate thePredicate );
303 interface LogicalAND: LogicalBinary{};
304 interface LogicalOR : LogicalBinary{};
309 interface Filter: SALOME::GenericObj, SMESH_IDSource
312 * Structure containing information about one criterion
313 * Type - FT_Taper, FT_Skew ...
314 * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo
315 * Threshold - threshold value
316 * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined
317 * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or
318 * (FT_Undefined must be for the last criterion)
319 * ThresholdStr - Threshold value defined as string. Used for:
320 * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
321 * 2. BelongToGeom predicate for storing name of shape
322 * ThresholdID - One more threshold value defined as string. Used for:
323 * 1. BelongToGeom predicate for storing id of shape
324 * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
325 * "Belong to plane" and "Belong to cylinder" predicates
326 * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
327 * Precision - Precision of numerical functors
339 ElementType TypeOfElement;
343 typedef sequence<Criterion> Criteria;
345 void SetPredicate( in Predicate thePredicate );
346 void SetMesh( in SMESH_Mesh theMesh );
348 long_array GetElementsId( in SMESH_Mesh theMesh );
349 ElementType GetElementType();
350 Predicate GetPredicate();
352 boolean GetCriteria( out Criteria theCriteria );
353 boolean SetCriteria( in Criteria theCriteria );
358 * Interface for working with library of filters
360 interface FilterLibrary : SALOME::GenericObj
363 * Copy filter from library by name (new filter is created)
365 Filter Copy( in string theFilterName );
368 * Methods for editing library
370 boolean Add ( in string theFilterName, in Filter theFilter );
371 boolean AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
372 boolean Delete ( in string theFilterName );
373 boolean Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
376 * Save library on disk
379 boolean SaveAs( in string aFileName );
384 boolean IsPresent( in string aFilterName );
385 long NbFilters( in ElementType aType );
386 string_array GetNames( in ElementType aType );
387 string_array GetAllNames();
388 void SetFileName( in string aFilterName );
389 string GetFileName();
394 * Interface of Filter manager
396 interface FilterManager: SALOME::GenericObj
399 * Create numerical functors
401 MinimumAngle CreateMinimumAngle();
402 AspectRatio CreateAspectRatio();
403 AspectRatio3D CreateAspectRatio3D();
404 Warping CreateWarping();
408 Volume3D CreateVolume3D();
409 Length CreateLength();
410 Length2D CreateLength2D();
411 MultiConnection CreateMultiConnection();
412 MultiConnection2D CreateMultiConnection2D();
415 * Create logical functors ( predicates )
417 BelongToGeom CreateBelongToGeom();
418 BelongToPlane CreateBelongToPlane();
419 BelongToCylinder CreateBelongToCylinder();
420 BelongToGenSurface CreateBelongToGenSurface();
422 LyingOnGeom CreateLyingOnGeom();
424 FreeBorders CreateFreeBorders();
425 FreeEdges CreateFreeEdges();
427 RangeOfIds CreateRangeOfIds();
429 BadOrientedVolume CreateBadOrientedVolume();
432 * Create comparators ( predicates )
434 LessThan CreateLessThan();
435 MoreThan CreateMoreThan();
436 EqualTo CreateEqualTo();
439 * Create boolean operations ( predicates )
441 LogicalNOT CreateLogicalNOT();
442 LogicalAND CreateLogicalAND();
443 LogicalOR CreateLogicalOR();
448 Filter CreateFilter();
451 * Load filter library. If libary does not exist it is created
453 FilterLibrary LoadLibrary( in string aFileName );
458 FilterLibrary CreateLibrary();
463 boolean DeleteLibrary( in string aFileName );