1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File : SMESH_Filter.idl
24 // Author : Alexey Petrov, OCC
26 #ifndef _SMESH_FILTER_IDL_
27 #define _SMESH_FILTER_IDL_
29 #include "SALOME_Exception.idl"
30 #include "SALOME_GenericObj.idl"
31 #include "GEOM_Gen.idl"
32 #include "SMESH_Mesh.idl"
38 * Enumeration of functor types
61 FT_BelongToGenSurface,
78 * Base interface for all functors ( i.e. numerical functors and predicates )
80 interface Functor: SALOME::GenericObj
82 void SetMesh( in SMESH_Mesh theMesh );
83 FunctorType GetFunctorType();
84 ElementType GetElementType();
90 * Numerical functors are intended for calculating value by Id of mesh entity
92 interface NumericalFunctor: Functor
94 double GetValue( in long theElementId );
97 * Set precision for calculation. It is a position after point which is
98 * used to functor value after calculation.
100 void SetPrecision( in long thePrecision );
103 interface MinimumAngle : NumericalFunctor{};
104 interface AspectRatio : NumericalFunctor{};
105 interface AspectRatio3D : NumericalFunctor{};
106 interface Warping : NumericalFunctor{};
107 interface Taper : NumericalFunctor{};
108 interface Skew : NumericalFunctor{};
109 interface Area : NumericalFunctor{};
110 interface Volume3D : NumericalFunctor{};
111 interface Length : NumericalFunctor{};
112 interface Length2D : NumericalFunctor
119 typedef sequence<Value> Values;
122 interface MultiConnection : NumericalFunctor{};
123 interface MultiConnection2D : NumericalFunctor
131 typedef sequence<Value> Values;
136 * Predicates are intended for verification of criteria,
137 * must return bool value by mesh id
139 interface Predicate: Functor
141 boolean IsSatisfy( in long thEntityId );
145 * Logical functor (predicate) "Bad Oriented Volume".
146 * Verify whether a mesh volume is incorrectly oriented from
147 * the point of view of MED convention
149 interface BadOrientedVolume: Predicate {};
152 * Logical functor (predicate) "Belong To Geometry".
153 * Verify whether mesh element or node belong to pointed Geom Object
155 interface BelongToGeom: Predicate
157 void SetGeom( in GEOM::GEOM_Object theGeom );
158 void SetElementType( in ElementType theType );
160 /*! The tolerance is used only if there is no submesh on the shape
162 void SetTolerance( in double theToler );
163 double GetTolerance();
165 void SetShapeName( in string theName );
166 void SetShape( in string theID, in string theName );
167 string GetShapeName();
172 * Logical functor (predicate) "Belong To Surface".
173 * Base interface for "belong to plane" and "belong to cylinder"
174 * and "Belong To Generic Surface" interfaces
176 interface BelongToSurface: Predicate
178 void SetTolerance( in double theToler );
179 double GetTolerance();
180 void SetShapeName( in string theName, in ElementType theType );
181 void SetShape( in string theID, in string theName, in ElementType theType );
182 string GetShapeName();
185 * Limit surface extent to bounding box of boundaries (edges)
186 * in surface parametric space. Boundaries are ignored by default
188 void SetUseBoundaries( in boolean theUseBndRestrictions );
189 boolean GetUseBoundaries();
193 * Logical functor (predicate) "Belong To Plane".
194 * Verify whether mesh element lie on pointed Geom planar object
196 interface BelongToPlane: BelongToSurface
198 void SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
202 * Logical functor (predicate) "Belong To Cylinder".
203 * Verify whether mesh element lie on pointed Geom cylindrical object
205 interface BelongToCylinder: BelongToSurface
207 void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
211 * Logical functor (predicate) "Belong To Generic Surface".
212 * Verify whether mesh element lie in pointed Geom cylindrical object
214 interface BelongToGenSurface: BelongToSurface
216 void SetSurface( in GEOM::GEOM_Object theGeom, in ElementType theType );
220 * Logical functor (predicate) "Lying On Geometry".
221 * Verify whether mesh element or node lying or partially lying on the pointed Geom Object
223 interface LyingOnGeom: Predicate
225 void SetGeom( in GEOM::GEOM_Object theGeom );
226 void SetElementType( in ElementType theType );
228 /*! The tolerance is used only if there is no submesh on the shape
230 void SetTolerance( in double theToler );
231 double GetTolerance();
233 void SetShapeName( in string theName );
234 void SetShape( in string theID, in string theName );
235 string GetShapeName();
240 * Logical functor (predicate) "Free borders".
241 * Verify whether 1D mesh element is free ( i.e. connected to one face only )
243 interface FreeBorders: Predicate{};
246 * Logical functor (predicate) "Free edges".
247 * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )
249 interface FreeEdges: Predicate
256 typedef sequence<Border> Borders;
257 Borders GetBorders();
261 * Logical functor (predicate) "Free nodes".
262 * Verify whether mesh has free nodes( i.e. nodes are not connected to any element )
264 interface FreeNodes: Predicate{};
267 * Logical functor (predicate) "Free faces".
268 * Verify whether 2D mesh element is free ( i.e. connected to one volume only )
270 interface FreeFaces: Predicate{};
273 * Abstract logical functor (predicate) "RangeOfIds".
274 * Verify whether an Entity Id belongs to defined sequence of id's
276 interface RangeOfIds: Predicate
278 void SetRange( in long_array theIds );
279 boolean SetRangeStr( in string theRange );
280 string GetRangeStr();
282 void SetElementType( in ElementType theType );
286 * Comparator. Predicate for compare value calculated
287 * by numerical functor with threshold value
289 interface Comparator: Predicate
291 void SetMargin( in double theValue );
292 void SetNumFunctor( in NumericalFunctor theFunct );
295 interface LessThan: Comparator{};
296 interface MoreThan: Comparator{};
297 interface EqualTo : Comparator
299 void SetTolerance( in double theToler );
300 double GetTolerance();
304 * Logical predicates are intended for compose predicates using boolean operations
306 interface Logical: Predicate{};
308 interface LogicalNOT: Logical
310 void SetPredicate(in Predicate thePredicate);
313 interface LogicalBinary: Logical
315 void SetPredicate1( in Predicate thePredicate );
316 void SetPredicate2( in Predicate thePredicate );
319 interface LogicalAND: LogicalBinary{};
320 interface LogicalOR : LogicalBinary{};
323 * Logical functor (predicate) "Is element Linear or Quadratic".
324 * Verify whether a mesh element is linear
326 interface LinearOrQuadratic: Predicate {
327 void SetElementType( in ElementType theType );
331 * Functor "Group Color"
332 * Returns color of group to which mesh element belongs to
334 interface GroupColor : Predicate{
335 void SetElementType( in ElementType theType );
336 void SetColorStr( in string theColor );
337 string GetColorStr();
341 * Functor "Element geometry type"
342 * Returns is element has indicated geometry type
344 interface ElemGeomType : Predicate{
345 void SetElementType ( in ElementType theType );
346 void SetGeometryType( in GeometryType theType );
352 interface Filter: SALOME::GenericObj, SMESH_IDSource
355 * Structure containing information about one criterion
356 * Type - FT_Taper, FT_Skew ...
357 * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo
358 * Threshold - threshold value
359 * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined
360 * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or
361 * (FT_Undefined must be for the last criterion)
362 * ThresholdStr - Threshold value defined as string. Used for:
363 * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
364 * 2. BelongToGeom predicate for storing name of shape
365 * 3. GroupColor predicate for storing group color "0.2;0;0.5"
366 * ThresholdID - One more threshold value defined as string. Used for:
367 * 1. BelongToGeom predicate for storing id of shape
368 * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
369 * "Belong to plane" and "Belong to cylinder" predicates
370 * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
371 * Precision - Precision of numerical functors
383 ElementType TypeOfElement;
387 typedef sequence<Criterion> Criteria;
389 void SetPredicate( in Predicate thePredicate );
390 void SetMesh( in SMESH_Mesh theMesh );
392 long_array GetElementsId( in SMESH_Mesh theMesh );
393 ElementType GetElementType();
394 Predicate GetPredicate();
396 boolean GetCriteria( out Criteria theCriteria );
397 boolean SetCriteria( in Criteria theCriteria );
402 * Interface for working with library of filters
404 interface FilterLibrary : SALOME::GenericObj
407 * Copy filter from library by name (new filter is created)
409 Filter Copy( in string theFilterName );
412 * Methods for editing library
414 boolean Add ( in string theFilterName, in Filter theFilter );
415 boolean AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
416 boolean Delete ( in string theFilterName );
417 boolean Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
420 * Save library on disk
423 boolean SaveAs( in string aFileName );
428 boolean IsPresent( in string aFilterName );
429 long NbFilters( in ElementType aType );
430 string_array GetNames( in ElementType aType );
431 string_array GetAllNames();
432 void SetFileName( in string aFilterName );
433 string GetFileName();
438 * Interface of Filter manager
440 interface FilterManager: SALOME::GenericObj
443 * Create numerical functors
445 MinimumAngle CreateMinimumAngle();
446 AspectRatio CreateAspectRatio();
447 AspectRatio3D CreateAspectRatio3D();
448 Warping CreateWarping();
452 Volume3D CreateVolume3D();
453 Length CreateLength();
454 Length2D CreateLength2D();
455 MultiConnection CreateMultiConnection();
456 MultiConnection2D CreateMultiConnection2D();
459 * Create logical functors ( predicates )
461 BelongToGeom CreateBelongToGeom();
462 BelongToPlane CreateBelongToPlane();
463 BelongToCylinder CreateBelongToCylinder();
464 BelongToGenSurface CreateBelongToGenSurface();
466 LyingOnGeom CreateLyingOnGeom();
468 FreeBorders CreateFreeBorders();
469 FreeEdges CreateFreeEdges();
470 FreeNodes CreateFreeNodes();
471 FreeFaces CreateFreeFaces();
473 RangeOfIds CreateRangeOfIds();
475 BadOrientedVolume CreateBadOrientedVolume();
476 LinearOrQuadratic CreateLinearOrQuadratic();
478 GroupColor CreateGroupColor();
479 ElemGeomType CreateElemGeomType();
482 * Create comparators ( predicates )
484 LessThan CreateLessThan();
485 MoreThan CreateMoreThan();
486 EqualTo CreateEqualTo();
489 * Create boolean operations ( predicates )
491 LogicalNOT CreateLogicalNOT();
492 LogicalAND CreateLogicalAND();
493 LogicalOR CreateLogicalOR();
498 Filter CreateFilter();
501 * Load filter library. If libary does not exist it is created
503 FilterLibrary LoadLibrary( in string aFileName );
508 FilterLibrary CreateLibrary();
513 boolean DeleteLibrary( in string aFileName );