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
71 * Base interface for all functors ( i.e. numerical functors and predicates )
73 interface Functor: SALOME::GenericObj
75 void SetMesh( in SMESH_Mesh theMesh );
76 FunctorType GetFunctorType();
77 ElementType GetElementType();
83 * Numerical functors are intended for calculating value by Id of mesh entity
85 interface NumericalFunctor: Functor
87 double GetValue( in long theElementId );
90 * Set precision for calculation. It is a position after point which is
91 * used to functor value after calculation.
93 void SetPrecision( in long thePrecision );
96 interface MinimumAngle : NumericalFunctor{};
97 interface AspectRatio : NumericalFunctor{};
98 interface AspectRatio3D : NumericalFunctor{};
99 interface Warping : NumericalFunctor{};
100 interface Taper : NumericalFunctor{};
101 interface Skew : NumericalFunctor{};
102 interface Area : NumericalFunctor{};
103 interface Volume3D : NumericalFunctor{};
104 interface Length : NumericalFunctor{};
105 interface Length2D : NumericalFunctor
112 typedef sequence<Value> Values;
115 interface MultiConnection : NumericalFunctor{};
116 interface MultiConnection2D : NumericalFunctor
124 typedef sequence<Value> Values;
129 * Predicates are intended for verification of criteria,
130 * must return bool value by mesh id
132 interface Predicate: Functor
134 boolean IsSatisfy( in long thEntityId );
138 * Logical functor (predicate) "Bad Oriented Volume".
139 * Verify whether a mesh volume is incorrectly oriented from
140 * the point of view of MED convention
142 interface BadOrientedVolume: Predicate {};
145 * Logical functor (predicate) "Belong To Geometry".
146 * Verify whether mesh element or node belong to pointed Geom Object
148 interface BelongToGeom: Predicate
150 void SetGeom( in GEOM::GEOM_Object theGeom );
151 void SetElementType( in ElementType theType );
153 void SetShapeName( in string theName );
154 void SetShape( in string theID, in string theName );
155 string GetShapeName();
160 * Logical functor (predicate) "Belong To Surface".
161 * Base interface for "belong to plane" and "belong to cylinder interfaces"
163 interface BelongToSurface: Predicate
165 void SetTolerance( in double theToler );
166 double GetTolerance();
167 void SetShapeName( in string theName, in ElementType theType );
168 void SetShape( in string theID, in string theName, in ElementType theType );
169 string GetShapeName();
175 * Logical functor (predicate) "Belong To Plane".
176 * Verify whether mesh element lie in pointed Geom planar object
178 interface BelongToPlane: BelongToSurface
180 void SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
184 * Logical functor (predicate) "Belong To Culinder".
185 * Verify whether mesh element lie in pointed Geom cylindrical object
187 interface BelongToCylinder: BelongToSurface
189 void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
193 * Logical functor (predicate) "Lying On Geometry".
194 * Verify whether mesh element or node lying or partially lying on the pointed Geom Object
196 interface LyingOnGeom: Predicate
198 void SetGeom( in GEOM::GEOM_Object theGeom );
199 void SetElementType( in ElementType theType );
201 void SetShapeName( in string theName );
202 void SetShape( in string theID, in string theName );
203 string GetShapeName();
208 * Logical functor (predicate) "Free borders".
209 * Verify whether 1D mesh element is free ( i.e. connected to one face only )
211 interface FreeBorders: Predicate{};
214 * Logical functor (predicate) "Free edges".
215 * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )
217 interface FreeEdges: Predicate
225 typedef sequence<Border> Borders;
226 Borders GetBorders();
231 * Abstract logical functor (predicate) "RangeOfIds".
232 * Verify whether an Entity Id belongs to defined sequence of id's
234 interface RangeOfIds: Predicate
236 void SetRange( in long_array theIds );
237 boolean SetRangeStr( in string theRange );
238 string GetRangeStr();
240 void SetElementType( in ElementType theType );
244 * Comparator. Predicate for compare value calculated
245 * by numerical functor with threshold value
247 interface Comparator: Predicate
249 void SetMargin( in double theValue );
250 void SetNumFunctor( in NumericalFunctor theFunct );
253 interface LessThan: Comparator{};
254 interface MoreThan: Comparator{};
255 interface EqualTo : Comparator
257 void SetTolerance( in double theToler );
258 double GetTolerance();
262 * Logical predicates are intended for compose predicates using boolean operations
264 interface Logical: Predicate{};
266 interface LogicalNOT: Logical
268 void SetPredicate(in Predicate thePredicate);
271 interface LogicalBinary: Logical
273 void SetPredicate1( in Predicate thePredicate );
274 void SetPredicate2( in Predicate thePredicate );
277 interface LogicalAND: LogicalBinary{};
278 interface LogicalOR : LogicalBinary{};
283 interface Filter: SALOME::GenericObj, SMESH_IDSource
286 * Structure containing information about one criterion
287 * Type - FT_Taper, FT_Skew ...
288 * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo
289 * Threshold - threshold value
290 * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined
291 * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or
292 * (FT_Undefined must be for the last criterion)
293 * ThresholdStr - Threshold value defined as string. Used for:
294 * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
295 * 2. BelongToGeom predicate for storing name of shape
296 * ThresholdID - One more threshold value defined as string. Used for:
297 * 1. BelongToGeom predicate for storing id of shape
298 * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
299 * "Belong to plane" and "Belong to cylinder" predicates
300 * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
301 * Precision - Precision of numerical functors
313 ElementType TypeOfElement;
317 typedef sequence<Criterion> Criteria;
319 void SetPredicate( in Predicate thePredicate );
320 void SetMesh( in SMESH_Mesh theMesh );
322 long_array GetElementsId( in SMESH_Mesh theMesh );
323 ElementType GetElementType();
324 Predicate GetPredicate();
326 boolean GetCriteria( out Criteria theCriteria );
327 boolean SetCriteria( in Criteria theCriteria );
332 * Interface for working with library of filters
334 interface FilterLibrary : SALOME::GenericObj
337 * Copy filter from library by name (new filter is created)
339 Filter Copy( in string theFilterName );
342 * Methods for editing library
344 boolean Add ( in string theFilterName, in Filter theFilter );
345 boolean AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
346 boolean Delete ( in string theFilterName );
347 boolean Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
350 * Save library on disk
353 boolean SaveAs( in string aFileName );
358 boolean IsPresent( in string aFilterName );
359 long NbFilters( in ElementType aType );
360 string_array GetNames( in ElementType aType );
361 string_array GetAllNames();
362 void SetFileName( in string aFilterName );
363 string GetFileName();
368 * Interface of Filter manager
370 interface FilterManager: SALOME::GenericObj
373 * Create numerical functors
375 MinimumAngle CreateMinimumAngle();
376 AspectRatio CreateAspectRatio();
377 AspectRatio3D CreateAspectRatio3D();
378 Warping CreateWarping();
382 Volume3D CreateVolume3D();
383 Length CreateLength();
384 Length2D CreateLength2D();
385 MultiConnection CreateMultiConnection();
386 MultiConnection2D CreateMultiConnection2D();
389 * Create logical functors ( predicates )
391 BelongToGeom CreateBelongToGeom();
392 BelongToPlane CreateBelongToPlane();
393 BelongToCylinder CreateBelongToCylinder();
395 LyingOnGeom CreateLyingOnGeom();
397 FreeBorders CreateFreeBorders();
398 FreeEdges CreateFreeEdges();
400 RangeOfIds CreateRangeOfIds();
402 BadOrientedVolume CreateBadOrientedVolume();
405 * Create comparators ( predicates )
407 LessThan CreateLessThan();
408 MoreThan CreateMoreThan();
409 EqualTo CreateEqualTo();
412 * Create boolean operations ( predicates )
414 LogicalNOT CreateLogicalNOT();
415 LogicalAND CreateLogicalAND();
416 LogicalOR CreateLogicalOR();
421 Filter CreateFilter();
424 * Load filter library. If libary does not exist it is created
426 FilterLibrary LoadLibrary( in string aFileName );
431 FilterLibrary CreateLibrary();
436 boolean DeleteLibrary( in string aFileName );