1 // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
3 // Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SMESH_Filter_i.hxx
25 // Author : Alexey Petrov, OCC
28 #ifndef _SMESH_FILTER_I_HXX_
29 #define _SMESH_FILTER_I_HXX_
31 #include <SALOMEconfig.h>
32 #include CORBA_SERVER_HEADER(SMESH_Filter)
34 #include <LDOM_Document.hxx>
35 #include <TopoDS_Shape.hxx>
37 #include "SALOME_GenericObj_i.hh"
38 #include "SMESH_ControlsDef.hxx"
50 Description : Predicate for verifying whether entiy belong to
51 specified geometrical support
53 class BelongToGeom: public virtual Predicate
58 virtual void SetMesh( SMDS_Mesh* theMesh );
59 virtual void SetGeom( const TopoDS_Shape& theShape );
61 virtual bool IsSatisfy( long theElementId );
63 virtual void SetType( SMDSAbs_ElementType theType );
64 virtual SMDSAbs_ElementType GetType() const;
66 TopoDS_Shape GetShape();
67 SMESHDS_Mesh* GetMeshDS();
71 SMESHDS_Mesh* myMeshDS;
72 SMDSAbs_ElementType myType;
74 typedef boost::shared_ptr<BelongToGeom> BelongToGeomPtr;
83 Description : An abstact class for all functors
85 class Functor_i: public virtual POA_SMESH::Functor,
86 public virtual SALOME::GenericObj_i
89 void SetMesh( SMESH_Mesh_ptr theMesh );
90 Controls::FunctorPtr GetFunctor(){ return myFunctorPtr;}
91 ElementType GetElementType();
96 Controls::FunctorPtr myFunctorPtr;
101 Class : NumericalFunctor_i
102 Description : Base class for numerical functors
104 class NumericalFunctor_i: public virtual POA_SMESH::NumericalFunctor,
105 public virtual Functor_i
108 CORBA::Double GetValue( CORBA::Long theElementId );
109 void SetPrecision( CORBA::Long thePrecision );
110 CORBA::Long GetPrecision();
111 Controls::NumericalFunctorPtr GetNumericalFunctor();
114 Controls::NumericalFunctorPtr myNumericalFunctorPtr;
119 Class : SMESH_MinimumAngleFunct
120 Description : Functor for calculation of minimum angle
122 class MinimumAngle_i: public virtual POA_SMESH::MinimumAngle,
123 public virtual NumericalFunctor_i
127 FunctorType GetFunctorType();
132 Class : AspectRatio_i
133 Description : Functor for calculating aspect ratio
135 class AspectRatio_i: public virtual POA_SMESH::AspectRatio,
136 public virtual NumericalFunctor_i
140 FunctorType GetFunctorType();
145 Class : AspectRatio3D_i
146 Description : Functor for calculating aspect ratio for 3D
148 class AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D,
149 public virtual NumericalFunctor_i
153 FunctorType GetFunctorType();
159 Description : Functor for calculating warping
161 class Warping_i: public virtual POA_SMESH::Warping,
162 public virtual NumericalFunctor_i
166 FunctorType GetFunctorType();
172 Description : Functor for calculating taper
174 class Taper_i: public virtual POA_SMESH::Taper,
175 public virtual NumericalFunctor_i
179 FunctorType GetFunctorType();
185 Description : Functor for calculating skew in degrees
187 class Skew_i: public virtual POA_SMESH::Skew,
188 public virtual NumericalFunctor_i
192 FunctorType GetFunctorType();
198 Description : Functor for calculating area
200 class Area_i: public virtual POA_SMESH::Area,
201 public virtual NumericalFunctor_i
205 FunctorType GetFunctorType();
211 Description : Functor for calculating length of edge
213 class Length_i: public virtual POA_SMESH::Length,
214 public virtual NumericalFunctor_i
218 FunctorType GetFunctorType();
223 Description : Functor for calculating length of edge
225 class Length2D_i: public virtual POA_SMESH::Length2D,
226 public virtual NumericalFunctor_i
230 SMESH::Length2D::Values* GetValues();
231 FunctorType GetFunctorType();
234 Controls::Length2DPtr myLength2DPtr;
239 Class : MultiConnection_i
240 Description : Functor for calculating number of faces conneted to the edge
242 class MultiConnection_i: public virtual POA_SMESH::MultiConnection,
243 public virtual NumericalFunctor_i
247 FunctorType GetFunctorType();
251 Class : MultiConnection2D_i
252 Description : Functor for calculating number of faces conneted to the edge
254 class MultiConnection2D_i: public virtual POA_SMESH::MultiConnection2D,
255 public virtual NumericalFunctor_i
258 MultiConnection2D_i();
259 SMESH::MultiConnection2D::Values* GetValues();
260 FunctorType GetFunctorType();
263 Controls::MultiConnection2DPtr myMulticonnection2DPtr;
272 Description : Base class for all predicates
274 class Predicate_i: public virtual POA_SMESH::Predicate,
275 public virtual Functor_i
278 CORBA::Boolean IsSatisfy( CORBA::Long theElementId );
279 Controls::PredicatePtr GetPredicate();
282 Controls::PredicatePtr myPredicatePtr;
287 Class : BelongToGeom_i
288 Description : Predicate for selection on geometrical support
290 class BelongToGeom_i: public virtual POA_SMESH::BelongToGeom,
291 public virtual Predicate_i
295 virtual ~BelongToGeom_i();
297 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
298 void SetElementType( ElementType theType );
299 FunctorType GetFunctorType();
301 void SetGeom( const TopoDS_Shape& theShape );
303 void SetShapeName( const char* theName );
304 char* GetShapeName();
307 Controls::BelongToGeomPtr myBelongToGeomPtr;
312 Class : BelongToSurface_i
313 Description : Verify whether mesh element lie in pointed Geom planar object
315 class BelongToSurface_i: public virtual POA_SMESH::BelongToSurface,
316 public virtual Predicate_i
319 BelongToSurface_i( const Handle(Standard_Type)& );
320 virtual ~BelongToSurface_i();
322 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
324 void SetShapeName( const char* theName, ElementType theType );
325 char* GetShapeName();
327 void SetTolerance( CORBA::Double );
328 CORBA::Double GetTolerance();
331 Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr;
333 Handle(Standard_Type) mySurfaceType;
337 Class : BelongToPlane_i
338 Description : Verify whether mesh element lie in pointed Geom planar object
340 class BelongToPlane_i: public virtual POA_SMESH::BelongToPlane,
341 public virtual BelongToSurface_i
345 void SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
346 FunctorType GetFunctorType();
350 Class : BelongToCylinder_i
351 Description : Verify whether mesh element lie in pointed Geom cylindrical object
353 class BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder,
354 public virtual BelongToSurface_i
357 BelongToCylinder_i();
358 void SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
359 FunctorType GetFunctorType();
364 Class : FreeBorders_i
365 Description : Predicate for free borders
367 class FreeBorders_i: public virtual POA_SMESH::FreeBorders,
368 public virtual Predicate_i
372 FunctorType GetFunctorType();
378 Description : Predicate for free edges
380 class FreeEdges_i: public virtual POA_SMESH::FreeEdges,
381 public virtual Predicate_i
385 SMESH::FreeEdges::Borders* GetBorders();
386 FunctorType GetFunctorType();
389 Controls::FreeEdgesPtr myFreeEdgesPtr;
395 Description : Predicate for Range of Ids
397 class RangeOfIds_i: public virtual POA_SMESH::RangeOfIds,
398 public virtual Predicate_i
402 void SetRange( const SMESH::long_array& theIds );
403 CORBA::Boolean SetRangeStr( const char* theRange );
406 void SetElementType( ElementType theType );
407 FunctorType GetFunctorType();
410 Controls::RangeOfIdsPtr myRangeOfIdsPtr;
415 Description : Base class for comparators
417 class Comparator_i: public virtual POA_SMESH::Comparator,
418 public virtual Predicate_i
421 virtual ~Comparator_i();
423 virtual void SetMargin( CORBA::Double );
424 virtual void SetNumFunctor( NumericalFunctor_ptr );
426 Controls::ComparatorPtr GetComparator();
427 NumericalFunctor_i* GetNumFunctor_i();
428 CORBA::Double GetMargin();
433 Controls::ComparatorPtr myComparatorPtr;
434 NumericalFunctor_i* myNumericalFunctor;
440 Description : Comparator "<"
442 class LessThan_i: public virtual POA_SMESH::LessThan,
443 public virtual Comparator_i
447 FunctorType GetFunctorType();
453 Description : Comparator ">"
455 class MoreThan_i: public virtual POA_SMESH::MoreThan,
456 public virtual Comparator_i
460 FunctorType GetFunctorType();
466 Description : Comparator "="
468 class EqualTo_i: public virtual POA_SMESH::EqualTo,
469 public virtual Comparator_i
473 virtual void SetTolerance( CORBA::Double );
474 CORBA::Double GetTolerance();
475 FunctorType GetFunctorType();
478 Controls::EqualToPtr myEqualToPtr;
484 Description : Logical NOT predicate
486 class LogicalNOT_i: public virtual POA_SMESH::LogicalNOT,
487 public virtual Predicate_i
491 virtual ~LogicalNOT_i();
493 virtual void SetPredicate( Predicate_ptr );
494 Predicate_i* GetPredicate_i();
495 FunctorType GetFunctorType();
498 Controls::LogicalNOTPtr myLogicalNOTPtr;
499 Predicate_i* myPredicate;
504 Class : LogicalBinary_i
505 Description : Base class for binary logical predicate
507 class LogicalBinary_i: public virtual POA_SMESH::LogicalBinary,
508 public virtual Predicate_i
511 virtual ~LogicalBinary_i();
512 virtual void SetMesh( SMESH_Mesh_ptr theMesh );
513 virtual void SetPredicate1( Predicate_ptr );
514 virtual void SetPredicate2( Predicate_ptr );
516 Controls::LogicalBinaryPtr GetLogicalBinary();
517 Predicate_i* GetPredicate1_i();
518 Predicate_i* GetPredicate2_i();
523 Controls::LogicalBinaryPtr myLogicalBinaryPtr;
524 Predicate_i* myPredicate1;
525 Predicate_i* myPredicate2;
531 Description : Logical AND
533 class LogicalAND_i: public virtual POA_SMESH::LogicalAND,
534 public virtual LogicalBinary_i
538 FunctorType GetFunctorType();
544 Description : Logical OR
546 class LogicalOR_i: public virtual POA_SMESH::LogicalOR,
547 public virtual LogicalBinary_i
551 FunctorType GetFunctorType();
558 class Filter_i: public virtual POA_SMESH::Filter,
559 public virtual SALOME::GenericObj_i
565 void SetPredicate( Predicate_ptr );
566 void SetMesh( SMESH_Mesh_ptr );
568 long_array* GetElementsId( SMESH_Mesh_ptr );
569 ElementType GetElementType();
571 CORBA::Boolean GetCriteria( SMESH::Filter::Criteria_out theCriteria );
572 CORBA::Boolean SetCriteria( const SMESH::Filter::Criteria& theCriteria );
574 Predicate_ptr GetPredicate();
575 Predicate_i* GetPredicate_i();
578 Controls::Filter myFilter;
579 Predicate_i* myPredicate;
586 class FilterLibrary_i: public virtual POA_SMESH::FilterLibrary,
587 public virtual SALOME::GenericObj_i
590 FilterLibrary_i( const char* theFileName );
594 Filter_ptr Copy( const char* theFilterName );
596 CORBA::Boolean Add ( const char* theFilterName, Filter_ptr theFilter );
597 CORBA::Boolean AddEmpty( const char* theFilterName, ElementType theType );
598 CORBA::Boolean Delete ( const char* theFilterName );
599 CORBA::Boolean Replace ( const char* theFilterName,
600 const char* theNewName,
601 Filter_ptr theFilter );
603 CORBA::Boolean Save();
604 CORBA::Boolean SaveAs( const char* aFileName );
606 CORBA::Boolean IsPresent( const char* aFilterName );
607 CORBA::Long NbFilters( ElementType );
608 string_array* GetNames( ElementType );
609 string_array* GetAllNames();
610 void SetFileName( const char* theFileName );
616 FilterManager_var myFilterMgr;
624 class FilterManager_i: public virtual POA_SMESH::FilterManager,
625 public virtual SALOME::GenericObj_i
629 MinimumAngle_ptr CreateMinimumAngle();
630 AspectRatio_ptr CreateAspectRatio();
631 AspectRatio3D_ptr CreateAspectRatio3D();
632 Warping_ptr CreateWarping();
633 Taper_ptr CreateTaper();
634 Skew_ptr CreateSkew();
635 Area_ptr CreateArea();
636 Length_ptr CreateLength();
637 Length2D_ptr CreateLength2D();
638 MultiConnection_ptr CreateMultiConnection();
639 MultiConnection2D_ptr CreateMultiConnection2D();
641 BelongToGeom_ptr CreateBelongToGeom();
642 BelongToPlane_ptr CreateBelongToPlane();
643 BelongToCylinder_ptr CreateBelongToCylinder();
645 FreeBorders_ptr CreateFreeBorders();
646 FreeEdges_ptr CreateFreeEdges();
648 RangeOfIds_ptr CreateRangeOfIds();
650 LessThan_ptr CreateLessThan();
651 MoreThan_ptr CreateMoreThan();
652 EqualTo_ptr CreateEqualTo();
654 LogicalNOT_ptr CreateLogicalNOT();
655 LogicalAND_ptr CreateLogicalAND();
656 LogicalOR_ptr CreateLogicalOR();
658 Filter_ptr CreateFilter();
660 FilterLibrary_ptr LoadLibrary( const char* aFileName );
661 FilterLibrary_ptr CreateLibrary();
662 CORBA::Boolean DeleteLibrary( const char* aFileName );