idl/SMESH_Filter.idl

Go to the documentation of this file.
00001 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00002 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
00003 // 
00004 //  This library is free software; you can redistribute it and/or 
00005 //  modify it under the terms of the GNU Lesser General Public 
00006 //  License as published by the Free Software Foundation; either 
00007 //  version 2.1 of the License. 
00008 // 
00009 //  This library is distributed in the hope that it will be useful, 
00010 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
00011 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00012 //  Lesser General Public License for more details. 
00013 // 
00014 //  You should have received a copy of the GNU Lesser General Public 
00015 //  License along with this library; if not, write to the Free Software 
00016 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
00017 // 
00018 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00019 //
00020 //
00021 //
00022 //  File   : SMESH_Filter.idl
00023 //  Author : Alexey Petrov, OCC
00024 
00025 #ifndef _SMESH_FILTER_IDL_
00026 #define _SMESH_FILTER_IDL_
00027 
00028 #include "SALOME_Exception.idl"
00029 #include "SALOME_GenericObj.idl"
00030 #include "GEOM_Gen.idl"
00031 #include "SMESH_Mesh.idl"
00032 
00033 module SMESH
00034 {
00035 
00039   enum FunctorType
00040   {
00041     FT_AspectRatio,
00042     FT_AspectRatio3D,
00043     FT_Warping,   
00044     FT_MinimumAngle,
00045     FT_Taper,       
00046     FT_Skew,         
00047     FT_Area,          
00048     FT_Volume3D,          
00049     FT_FreeBorders,
00050     FT_FreeEdges,
00051     FT_MultiConnection,
00052     FT_MultiConnection2D,
00053     FT_Length,
00054     FT_Length2D,
00055     FT_BelongToGeom,
00056     FT_BelongToPlane,
00057     FT_BelongToCylinder,
00058     FT_LyingOnGeom,
00059     FT_RangeOfIds,
00060     FT_BadOrientedVolume,
00061     FT_LessThan,
00062     FT_MoreThan,
00063     FT_EqualTo,
00064     FT_LogicalNOT,
00065     FT_LogicalAND,
00066     FT_LogicalOR,
00067     FT_Undefined
00068   };
00069 
00073   interface Functor: SALOME::GenericObj
00074   {
00075     void            SetMesh( in SMESH_Mesh theMesh );
00076     FunctorType     GetFunctorType();
00077     ElementType     GetElementType();
00078   };
00079 
00080 
00081 
00085   interface NumericalFunctor: Functor
00086   {
00087     double GetValue( in long theElementId );
00088 
00093     void   SetPrecision( in long thePrecision );
00094     long   GetPrecision();
00095   };
00096   interface MinimumAngle    : NumericalFunctor{};
00097   interface AspectRatio     : NumericalFunctor{};
00098   interface AspectRatio3D   : NumericalFunctor{};
00099   interface Warping         : NumericalFunctor{};
00100   interface Taper           : NumericalFunctor{};
00101   interface Skew            : NumericalFunctor{};
00102   interface Area            : NumericalFunctor{};
00103   interface Volume3D        : NumericalFunctor{};
00104   interface Length          : NumericalFunctor{};
00105   interface Length2D        : NumericalFunctor
00106   {
00107     struct Value
00108     {
00109       double myLength;
00110       long myPnt1, myPnt2;
00111     };
00112     typedef sequence<Value> Values;
00113     Values GetValues();
00114   };
00115   interface MultiConnection   : NumericalFunctor{};
00116   interface MultiConnection2D : NumericalFunctor
00117   {
00118     struct Value
00119     {
00120       long myNbConnects;
00121       long myPnt1, myPnt2;
00122     };
00123     
00124     typedef sequence<Value> Values;
00125     Values GetValues();
00126   };
00127 
00132   interface Predicate: Functor
00133   {
00134     boolean IsSatisfy( in long thEntityId );
00135   };
00136 
00142   interface BadOrientedVolume: Predicate {};
00143 
00148   interface BelongToGeom: Predicate
00149   {
00150     void SetGeom( in GEOM::GEOM_Object theGeom );
00151     void SetElementType( in ElementType theType );
00152 
00153     void   SetShapeName( in string theName );
00154     void   SetShape( in string theID, in string theName );
00155     string GetShapeName();
00156     string GetShapeID();
00157   };
00158 
00163   interface BelongToSurface: Predicate
00164   {
00165     void   SetTolerance( in double theToler );
00166     double GetTolerance();
00167     void   SetShapeName( in string theName, in ElementType theType );
00168     void   SetShape( in string theID, in string theName, in ElementType theType );
00169     string GetShapeName();
00170     string GetShapeID();
00171   };
00172 
00173 
00178   interface BelongToPlane: BelongToSurface
00179   {
00180     void   SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
00181   };
00182 
00187   interface BelongToCylinder: BelongToSurface
00188   {
00189     void   SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
00190   };
00191 
00196   interface LyingOnGeom: Predicate
00197   {
00198     void SetGeom( in GEOM::GEOM_Object theGeom );
00199     void SetElementType( in ElementType theType );
00200 
00201     void   SetShapeName( in string theName );
00202     void   SetShape( in string theID, in string theName );
00203     string GetShapeName();    
00204     string GetShapeID(); 
00205   };
00206  
00211   interface FreeBorders: Predicate{};
00212 
00217   interface FreeEdges: Predicate
00218 
00219   {
00220     struct Border
00221     {
00222       long myElemId;
00223       long myPnt1, myPnt2;
00224     };
00225     typedef sequence<Border> Borders;
00226     Borders GetBorders();
00227   };
00228 
00229 
00234   interface RangeOfIds: Predicate
00235   {
00236     void            SetRange( in long_array theIds );
00237     boolean         SetRangeStr( in string theRange );
00238     string          GetRangeStr();
00239 
00240     void            SetElementType( in ElementType theType );
00241   };
00242 
00247   interface Comparator: Predicate
00248   {
00249     void    SetMargin( in double theValue );
00250     void    SetNumFunctor( in NumericalFunctor theFunct );
00251     double  GetMargin();
00252   };
00253   interface LessThan: Comparator{};
00254   interface MoreThan: Comparator{};
00255   interface EqualTo : Comparator
00256   {
00257     void    SetTolerance( in double theToler );
00258     double  GetTolerance();
00259   };
00260 
00264   interface Logical: Predicate{};
00265 
00266   interface LogicalNOT: Logical
00267   {
00268     void SetPredicate(in Predicate thePredicate);
00269   };
00270 
00271   interface LogicalBinary: Logical
00272 {
00273     void SetPredicate1( in Predicate thePredicate );
00274     void SetPredicate2( in Predicate thePredicate );
00275   };
00276 
00277   interface LogicalAND: LogicalBinary{};
00278   interface LogicalOR : LogicalBinary{};
00279 
00283   interface Filter: SALOME::GenericObj, SMESH_IDSource
00284   {
00303     struct Criterion
00304     {
00305       long        Type;
00306       long        Compare;
00307       double      Threshold;
00308       string      ThresholdStr;
00309       string      ThresholdID;
00310       long        UnaryOp;
00311       long        BinaryOp;
00312       double      Tolerance;
00313       ElementType TypeOfElement;
00314       long        Precision;
00315     };
00316 
00317     typedef sequence<Criterion> Criteria;
00318 
00319     void          SetPredicate( in Predicate thePredicate );
00320     void          SetMesh( in SMESH_Mesh theMesh );
00321 
00322     long_array    GetElementsId( in SMESH_Mesh theMesh );
00323     ElementType   GetElementType();
00324     Predicate     GetPredicate();
00325 
00326     boolean       GetCriteria( out Criteria theCriteria );
00327     boolean       SetCriteria( in Criteria theCriteria );
00328   };
00329 
00330 
00334   interface FilterLibrary : SALOME::GenericObj
00335   {
00339     Filter        Copy( in string theFilterName );
00340 
00344     boolean       Add     ( in string theFilterName, in Filter theFilter );
00345     boolean       AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
00346     boolean       Delete  ( in string theFilterName );
00347     boolean       Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
00348 
00352     boolean       Save();
00353     boolean       SaveAs( in string aFileName );
00354 
00358     boolean       IsPresent( in string aFilterName );
00359     long          NbFilters( in ElementType aType );
00360     string_array  GetNames( in ElementType aType );
00361     string_array  GetAllNames();
00362     void          SetFileName( in string aFilterName );
00363     string        GetFileName();
00364   };
00365 
00366 
00370   interface FilterManager: SALOME::GenericObj
00371   {
00375     MinimumAngle      CreateMinimumAngle();
00376     AspectRatio       CreateAspectRatio();
00377     AspectRatio3D     CreateAspectRatio3D();
00378     Warping           CreateWarping();
00379     Taper             CreateTaper();
00380     Skew              CreateSkew();
00381     Area              CreateArea();
00382     Volume3D          CreateVolume3D();
00383     Length            CreateLength();
00384     Length2D          CreateLength2D();
00385     MultiConnection   CreateMultiConnection();
00386     MultiConnection2D CreateMultiConnection2D();
00387 
00391     BelongToGeom      CreateBelongToGeom();
00392     BelongToPlane     CreateBelongToPlane();
00393     BelongToCylinder  CreateBelongToCylinder();
00394 
00395     LyingOnGeom       CreateLyingOnGeom();
00396 
00397     FreeBorders       CreateFreeBorders();
00398     FreeEdges         CreateFreeEdges();
00399 
00400     RangeOfIds        CreateRangeOfIds();
00401 
00402     BadOrientedVolume CreateBadOrientedVolume();
00403 
00407     LessThan          CreateLessThan();
00408     MoreThan          CreateMoreThan();
00409     EqualTo           CreateEqualTo();
00410 
00414     LogicalNOT        CreateLogicalNOT();
00415     LogicalAND        CreateLogicalAND();
00416     LogicalOR         CreateLogicalOR();
00417 
00421     Filter            CreateFilter();
00422 
00426     FilterLibrary     LoadLibrary( in string aFileName );
00427 
00431     FilterLibrary     CreateLibrary();
00432 
00436     boolean           DeleteLibrary( in string aFileName );
00437   };
00438 };
00439 
00440 
00441 #endif