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 * Parameters of a reclangle of histogram
80 struct HistogramRectangle
86 typedef sequence<HistogramRectangle> Histogram;
89 * Base interface for all functors ( i.e. numerical functors and predicates )
91 interface Functor: SALOME::GenericObj
93 void SetMesh( in SMESH_Mesh theMesh );
94 FunctorType GetFunctorType();
95 ElementType GetElementType();
101 * Numerical functors are intended for calculating value by Id of mesh entity
103 interface NumericalFunctor: Functor
105 double GetValue( in long theElementId );
107 Histogram GetHistogram( in short nbIntervals );
110 * Set precision for calculation. It is a position after point which is
111 * used to functor value after calculation.
113 void SetPrecision( in long thePrecision );
116 interface MinimumAngle : NumericalFunctor{};
117 interface AspectRatio : NumericalFunctor{};
118 interface AspectRatio3D : NumericalFunctor{};
119 interface Warping : NumericalFunctor{};
120 interface Taper : NumericalFunctor{};
121 interface Skew : NumericalFunctor{};
122 interface Area : NumericalFunctor{};
123 interface Volume3D : NumericalFunctor{};
124 interface Length : NumericalFunctor{};
125 interface Length2D : NumericalFunctor
132 typedef sequence<Value> Values;
135 interface MultiConnection : NumericalFunctor{};
136 interface MultiConnection2D : NumericalFunctor
144 typedef sequence<Value> Values;
149 * Predicates are intended for verification of criteria,
150 * must return bool value by mesh id
152 interface Predicate: Functor
154 boolean IsSatisfy( in long thEntityId );
158 * Logical functor (predicate) "Bad Oriented Volume".
159 * Verify whether a mesh volume is incorrectly oriented from
160 * the point of view of MED convention
162 interface BadOrientedVolume: Predicate {};
165 * Logical functor (predicate) "Belong To Geometry".
166 * Verify whether mesh element or node belong to pointed Geom Object
168 interface BelongToGeom: Predicate
170 void SetGeom( in GEOM::GEOM_Object theGeom );
171 void SetElementType( in ElementType theType );
173 /*! The tolerance is used only if there is no submesh on the shape
175 void SetTolerance( in double theToler );
176 double GetTolerance();
178 void SetShapeName( in string theName );
179 void SetShape( in string theID, in string theName );
180 string GetShapeName();
185 * Logical functor (predicate) "Belong To Surface".
186 * Base interface for "belong to plane" and "belong to cylinder"
187 * and "Belong To Generic Surface" interfaces
189 interface BelongToSurface: Predicate
191 void SetTolerance( in double theToler );
192 double GetTolerance();
193 void SetShapeName( in string theName, in ElementType theType );
194 void SetShape( in string theID, in string theName, in ElementType theType );
195 string GetShapeName();
198 * Limit surface extent to bounding box of boundaries (edges)
199 * in surface parametric space. Boundaries are ignored by default
201 void SetUseBoundaries( in boolean theUseBndRestrictions );
202 boolean GetUseBoundaries();
206 * Logical functor (predicate) "Belong To Plane".
207 * Verify whether mesh element lie on pointed Geom planar object
209 interface BelongToPlane: BelongToSurface
211 void SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
215 * Logical functor (predicate) "Belong To Cylinder".
216 * Verify whether mesh element lie on pointed Geom cylindrical object
218 interface BelongToCylinder: BelongToSurface
220 void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
224 * Logical functor (predicate) "Belong To Generic Surface".
225 * Verify whether mesh element lie in pointed Geom cylindrical object
227 interface BelongToGenSurface: BelongToSurface
229 void SetSurface( in GEOM::GEOM_Object theGeom, in ElementType theType );
233 * Logical functor (predicate) "Lying On Geometry".
234 * Verify whether mesh element or node lying or partially lying on the pointed Geom Object
236 interface LyingOnGeom: Predicate
238 void SetGeom( in GEOM::GEOM_Object theGeom );
239 void SetElementType( in ElementType theType );
241 /*! The tolerance is used only if there is no submesh on the shape
243 void SetTolerance( in double theToler );
244 double GetTolerance();
246 void SetShapeName( in string theName );
247 void SetShape( in string theID, in string theName );
248 string GetShapeName();
253 * Logical functor (predicate) "Free borders".
254 * Verify whether 1D mesh element is free ( i.e. connected to one face only )
256 interface FreeBorders: Predicate{};
259 * Logical functor (predicate) "Free edges".
260 * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )
262 interface FreeEdges: Predicate
269 typedef sequence<Border> Borders;
270 Borders GetBorders();
274 * Logical functor (predicate) "Free nodes".
275 * Verify whether mesh has free nodes( i.e. nodes are not connected to any element )
277 interface FreeNodes: Predicate{};
280 * Logical functor (predicate) "Free faces".
281 * Verify whether 2D mesh element is free ( i.e. connected to one volume only )
283 interface FreeFaces: Predicate{};
286 * Abstract logical functor (predicate) "RangeOfIds".
287 * Verify whether an Entity Id belongs to defined sequence of id's
289 interface RangeOfIds: Predicate
291 void SetRange( in long_array theIds );
292 boolean SetRangeStr( in string theRange );
293 string GetRangeStr();
295 void SetElementType( in ElementType theType );
299 * Comparator. Predicate for compare value calculated
300 * by numerical functor with threshold value
302 interface Comparator: Predicate
304 void SetMargin( in double theValue );
305 void SetNumFunctor( in NumericalFunctor theFunct );
308 interface LessThan: Comparator{};
309 interface MoreThan: Comparator{};
310 interface EqualTo : Comparator
312 void SetTolerance( in double theToler );
313 double GetTolerance();
317 * Logical predicates are intended for compose predicates using boolean operations
319 interface Logical: Predicate{};
321 interface LogicalNOT: Logical
323 void SetPredicate(in Predicate thePredicate);
326 interface LogicalBinary: Logical
328 void SetPredicate1( in Predicate thePredicate );
329 void SetPredicate2( in Predicate thePredicate );
332 interface LogicalAND: LogicalBinary{};
333 interface LogicalOR : LogicalBinary{};
336 * Logical functor (predicate) "Is element Linear or Quadratic".
337 * Verify whether a mesh element is linear
339 interface LinearOrQuadratic: Predicate {
340 void SetElementType( in ElementType theType );
344 * Functor "Group Color"
345 * Returns color of group to which mesh element belongs to
347 interface GroupColor : Predicate{
348 void SetElementType( in ElementType theType );
349 void SetColorStr( in string theColor );
350 string GetColorStr();
354 * Functor "Element geometry type"
355 * Returns is element has indicated geometry type
357 interface ElemGeomType : Predicate{
358 void SetElementType ( in ElementType theType );
359 void SetGeometryType( in GeometryType theType );
365 interface Filter: SALOME::GenericObj, SMESH_IDSource
368 * Structure containing information about one criterion
369 * Type - FT_Taper, FT_Skew ...
370 * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo
371 * Threshold - threshold value
372 * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined
373 * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or
374 * (FT_Undefined must be for the last criterion)
375 * ThresholdStr - Threshold value defined as string. Used for:
376 * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
377 * 2. BelongToGeom predicate for storing name of shape
378 * 3. GroupColor predicate for storing group color "0.2;0;0.5"
379 * ThresholdID - One more threshold value defined as string. Used for:
380 * 1. BelongToGeom predicate for storing id of shape
381 * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
382 * "Belong to plane" and "Belong to cylinder" predicates
383 * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
384 * Precision - Precision of numerical functors
396 ElementType TypeOfElement;
400 typedef sequence<Criterion> Criteria;
402 void SetPredicate( in Predicate thePredicate );
403 void SetMesh( in SMESH_Mesh theMesh );
405 long_array GetElementsId( in SMESH_Mesh theMesh );
406 ElementType GetElementType();
407 Predicate GetPredicate();
409 boolean GetCriteria( out Criteria theCriteria );
410 boolean SetCriteria( in Criteria theCriteria );
415 * Interface for working with library of filters
417 interface FilterLibrary : SALOME::GenericObj
420 * Copy filter from library by name (new filter is created)
422 Filter Copy( in string theFilterName );
425 * Methods for editing library
427 boolean Add ( in string theFilterName, in Filter theFilter );
428 boolean AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
429 boolean Delete ( in string theFilterName );
430 boolean Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
433 * Save library on disk
436 boolean SaveAs( in string aFileName );
441 boolean IsPresent( in string aFilterName );
442 long NbFilters( in ElementType aType );
443 string_array GetNames( in ElementType aType );
444 string_array GetAllNames();
445 void SetFileName( in string aFilterName );
446 string GetFileName();
451 * Interface of Filter manager
453 interface FilterManager: SALOME::GenericObj
456 * Create numerical functors
458 MinimumAngle CreateMinimumAngle();
459 AspectRatio CreateAspectRatio();
460 AspectRatio3D CreateAspectRatio3D();
461 Warping CreateWarping();
465 Volume3D CreateVolume3D();
466 Length CreateLength();
467 Length2D CreateLength2D();
468 MultiConnection CreateMultiConnection();
469 MultiConnection2D CreateMultiConnection2D();
472 * Create logical functors ( predicates )
474 BelongToGeom CreateBelongToGeom();
475 BelongToPlane CreateBelongToPlane();
476 BelongToCylinder CreateBelongToCylinder();
477 BelongToGenSurface CreateBelongToGenSurface();
479 LyingOnGeom CreateLyingOnGeom();
481 FreeBorders CreateFreeBorders();
482 FreeEdges CreateFreeEdges();
483 FreeNodes CreateFreeNodes();
484 FreeFaces CreateFreeFaces();
486 RangeOfIds CreateRangeOfIds();
488 BadOrientedVolume CreateBadOrientedVolume();
489 LinearOrQuadratic CreateLinearOrQuadratic();
491 GroupColor CreateGroupColor();
492 ElemGeomType CreateElemGeomType();
495 * Create comparators ( predicates )
497 LessThan CreateLessThan();
498 MoreThan CreateMoreThan();
499 EqualTo CreateEqualTo();
502 * Create boolean operations ( predicates )
504 LogicalNOT CreateLogicalNOT();
505 LogicalAND CreateLogicalAND();
506 LogicalOR CreateLogicalOR();
511 Filter CreateFilter();
514 * Load filter library. If libary does not exist it is created
516 FilterLibrary LoadLibrary( in string aFileName );
521 FilterLibrary CreateLibrary();
526 boolean DeleteLibrary( in string aFileName );