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.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 // File : SMESH_Filter_i.hxx
25 // Author : Alexey Petrov, OCC
28 #ifndef _SMESH_FILTER_I_HXX_
29 #define _SMESH_FILTER_I_HXX_
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(SMESH_Filter)
36 #include <LDOM_Document.hxx>
37 #include <TopoDS_Shape.hxx>
39 #include "SALOME_GenericObj_i.hh"
40 #include "SMESH_ControlsDef.hxx"
52 Description : Predicate for verifying whether entiy belong to
53 specified geometrical support
55 class SMESH_I_EXPORT BelongToGeom: public virtual Predicate
60 virtual void SetMesh( const SMDS_Mesh* theMesh );
61 virtual void SetGeom( const TopoDS_Shape& theShape );
63 virtual bool IsSatisfy( long theElementId );
65 virtual void SetType( SMDSAbs_ElementType theType );
66 virtual SMDSAbs_ElementType GetType() const;
68 TopoDS_Shape GetShape();
69 const SMESHDS_Mesh* GetMeshDS() const;
71 void SetTolerance( double );
72 double GetTolerance();
78 const SMESHDS_Mesh* myMeshDS;
79 SMDSAbs_ElementType myType;
81 double myTolerance; // only if myIsSubshape == false
82 Controls::ElementsOnShapePtr myElementsOnShapePtr; // only if myIsSubshape == false
84 typedef boost::shared_ptr<BelongToGeom> BelongToGeomPtr;
88 Description : Predicate for verifying whether entiy lying or partially lying on
89 specified geometrical support
91 class SMESH_I_EXPORT LyingOnGeom: public virtual Predicate
96 virtual void SetMesh( const SMDS_Mesh* theMesh );
97 virtual void SetGeom( const TopoDS_Shape& theShape );
99 virtual bool IsSatisfy( long theElementId );
101 virtual void SetType( SMDSAbs_ElementType theType );
102 virtual SMDSAbs_ElementType GetType() const;
104 TopoDS_Shape GetShape();
105 const SMESHDS_Mesh* GetMeshDS() const;
107 void SetTolerance( double );
108 double GetTolerance();
110 virtual bool Contains( const SMESHDS_Mesh* theMeshDS,
111 const TopoDS_Shape& theShape,
112 const SMDS_MeshElement* theElem,
113 TopAbs_ShapeEnum theFindShapeEnum,
114 TopAbs_ShapeEnum theAvoidShapeEnum = TopAbs_SHAPE );
118 TopoDS_Shape myShape;
119 const SMESHDS_Mesh* myMeshDS;
120 SMDSAbs_ElementType myType;
122 double myTolerance; // only if myIsSubshape == false
123 Controls::ElementsOnShapePtr myElementsOnShapePtr; // only if myIsSubshape == false
125 typedef boost::shared_ptr<LyingOnGeom> LyingOnGeomPtr;
134 Description : An abstact class for all functors
136 class SMESH_I_EXPORT Functor_i: public virtual POA_SMESH::Functor,
137 public virtual SALOME::GenericObj_i
140 void SetMesh( SMESH_Mesh_ptr theMesh );
141 Controls::FunctorPtr GetFunctor(){ return myFunctorPtr;}
142 ElementType GetElementType();
148 Controls::FunctorPtr myFunctorPtr;
152 Class : NumericalFunctor_i
153 Description : Base class for numerical functors
155 class SMESH_I_EXPORT NumericalFunctor_i: public virtual POA_SMESH::NumericalFunctor,
156 public virtual Functor_i
159 CORBA::Double GetValue( CORBA::Long theElementId );
160 void SetPrecision( CORBA::Long thePrecision );
161 CORBA::Long GetPrecision();
162 Controls::NumericalFunctorPtr GetNumericalFunctor();
165 Controls::NumericalFunctorPtr myNumericalFunctorPtr;
170 Class : SMESH_MinimumAngleFunct
171 Description : Functor for calculation of minimum angle
173 class SMESH_I_EXPORT MinimumAngle_i: public virtual POA_SMESH::MinimumAngle,
174 public virtual NumericalFunctor_i
178 FunctorType GetFunctorType();
183 Class : AspectRatio_i
184 Description : Functor for calculating aspect ratio
186 class SMESH_I_EXPORT AspectRatio_i: public virtual POA_SMESH::AspectRatio,
187 public virtual NumericalFunctor_i
191 FunctorType GetFunctorType();
196 Class : AspectRatio3D_i
197 Description : Functor for calculating aspect ratio for 3D
199 class SMESH_I_EXPORT AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D,
200 public virtual NumericalFunctor_i
204 FunctorType GetFunctorType();
210 Description : Functor for calculating warping
212 class SMESH_I_EXPORT Warping_i: public virtual POA_SMESH::Warping,
213 public virtual NumericalFunctor_i
217 FunctorType GetFunctorType();
223 Description : Functor for calculating taper
225 class SMESH_I_EXPORT Taper_i: public virtual POA_SMESH::Taper,
226 public virtual NumericalFunctor_i
230 FunctorType GetFunctorType();
236 Description : Functor for calculating skew in degrees
238 class SMESH_I_EXPORT Skew_i: public virtual POA_SMESH::Skew,
239 public virtual NumericalFunctor_i
243 FunctorType GetFunctorType();
249 Description : Functor for calculating area
251 class SMESH_I_EXPORT Area_i: public virtual POA_SMESH::Area,
252 public virtual NumericalFunctor_i
256 FunctorType GetFunctorType();
262 Description : Functor for calculating volume of 3D element
264 class SMESH_I_EXPORT Volume3D_i: public virtual POA_SMESH::Volume3D,
265 public virtual NumericalFunctor_i
269 FunctorType GetFunctorType();
275 Description : Functor for calculating length of edge
277 class SMESH_I_EXPORT Length_i: public virtual POA_SMESH::Length,
278 public virtual NumericalFunctor_i
282 FunctorType GetFunctorType();
287 Description : Functor for calculating length of edge
289 class SMESH_I_EXPORT Length2D_i: public virtual POA_SMESH::Length2D,
290 public virtual NumericalFunctor_i
294 SMESH::Length2D::Values* GetValues();
295 FunctorType GetFunctorType();
298 Controls::Length2DPtr myLength2DPtr;
303 Class : MultiConnection_i
304 Description : Functor for calculating number of faces conneted to the edge
306 class SMESH_I_EXPORT MultiConnection_i: public virtual POA_SMESH::MultiConnection,
307 public virtual NumericalFunctor_i
311 FunctorType GetFunctorType();
315 Class : MultiConnection2D_i
316 Description : Functor for calculating number of faces conneted to the edge
318 class SMESH_I_EXPORT MultiConnection2D_i: public virtual POA_SMESH::MultiConnection2D,
319 public virtual NumericalFunctor_i
322 MultiConnection2D_i();
323 SMESH::MultiConnection2D::Values* GetValues();
324 FunctorType GetFunctorType();
327 Controls::MultiConnection2DPtr myMulticonnection2DPtr;
336 Description : Base class for all predicates
338 class SMESH_I_EXPORT Predicate_i: public virtual POA_SMESH::Predicate,
339 public virtual Functor_i
342 CORBA::Boolean IsSatisfy( CORBA::Long theElementId );
343 Controls::PredicatePtr GetPredicate();
346 Controls::PredicatePtr myPredicatePtr;
351 Class : BadOrientedVolume_i
352 Description : Verify whether a mesh volume is incorrectly oriented from
353 the point of view of MED convention
355 class SMESH_I_EXPORT BadOrientedVolume_i: public virtual POA_SMESH::BadOrientedVolume,
356 public virtual Predicate_i
359 BadOrientedVolume_i();
360 FunctorType GetFunctorType();
364 Class : BelongToGeom_i
365 Description : Predicate for selection on geometrical support
367 class SMESH_I_EXPORT BelongToGeom_i: public virtual POA_SMESH::BelongToGeom,
368 public virtual Predicate_i
372 virtual ~BelongToGeom_i();
374 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
375 void SetElementType( ElementType theType );
376 FunctorType GetFunctorType();
378 void SetGeom( const TopoDS_Shape& theShape );
380 void SetShapeName( const char* theName );
381 void SetShape( const char* theID, const char* theName );
382 char* GetShapeName();
385 void SetTolerance( CORBA::Double );
386 CORBA::Double GetTolerance();
389 Controls::BelongToGeomPtr myBelongToGeomPtr;
395 Class : BelongToSurface_i
396 Description : Verify whether mesh element lie in pointed Geom planar object
398 class SMESH_I_EXPORT BelongToSurface_i: public virtual POA_SMESH::BelongToSurface,
399 public virtual Predicate_i
402 BelongToSurface_i( const Handle(Standard_Type)& );
403 virtual ~BelongToSurface_i();
405 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
407 void SetShapeName( const char* theName, ElementType theType );
408 void SetShape( const char* theID, const char* theName, ElementType theType );
409 char* GetShapeName();
412 void SetTolerance( CORBA::Double );
413 CORBA::Double GetTolerance();
415 void SetUseBoundaries( CORBA::Boolean theUseBndRestrictions );
416 CORBA::Boolean GetUseBoundaries();
419 Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr;
422 Handle(Standard_Type) mySurfaceType;
426 Class : BelongToPlane_i
427 Description : Verify whether mesh element lie in pointed Geom planar object
429 class SMESH_I_EXPORT BelongToPlane_i: public virtual POA_SMESH::BelongToPlane,
430 public virtual BelongToSurface_i
434 void SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
435 FunctorType GetFunctorType();
439 Class : BelongToCylinder_i
440 Description : Verify whether mesh element lie in pointed Geom cylindrical object
442 class SMESH_I_EXPORT BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder,
443 public virtual BelongToSurface_i
446 BelongToCylinder_i();
447 void SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
448 FunctorType GetFunctorType();
452 Class : BelongToGenSurface_i
453 Description : Verify whether mesh element lie on pointed Geom surfasic object
455 class BelongToGenSurface_i: public virtual POA_SMESH::BelongToGenSurface,
456 public virtual BelongToSurface_i
459 BelongToGenSurface_i();
460 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
461 FunctorType GetFunctorType();
465 Class : LyingOnGeom_i
466 Description : Predicate for selection on geometrical support(lying or partially lying)
468 class SMESH_I_EXPORT LyingOnGeom_i: public virtual POA_SMESH::LyingOnGeom,
469 public virtual Predicate_i
473 virtual ~LyingOnGeom_i();
475 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
476 void SetElementType( ElementType theType );
477 FunctorType GetFunctorType();
479 void SetGeom( const TopoDS_Shape& theShape );
481 void SetShapeName( const char* theName );
482 void SetShape( const char* theID, const char* theName );
483 char* GetShapeName();
486 void SetTolerance( CORBA::Double );
487 CORBA::Double GetTolerance();
490 Controls::LyingOnGeomPtr myLyingOnGeomPtr;
496 Class : FreeBorders_i
497 Description : Predicate for free borders
499 class SMESH_I_EXPORT FreeBorders_i: public virtual POA_SMESH::FreeBorders,
500 public virtual Predicate_i
504 FunctorType GetFunctorType();
510 Description : Predicate for free edges
512 class SMESH_I_EXPORT FreeEdges_i: public virtual POA_SMESH::FreeEdges,
513 public virtual Predicate_i
517 SMESH::FreeEdges::Borders* GetBorders();
518 FunctorType GetFunctorType();
521 Controls::FreeEdgesPtr myFreeEdgesPtr;
527 Description : Predicate for Range of Ids
529 class SMESH_I_EXPORT RangeOfIds_i: public virtual POA_SMESH::RangeOfIds,
530 public virtual Predicate_i
534 void SetRange( const SMESH::long_array& theIds );
535 CORBA::Boolean SetRangeStr( const char* theRange );
538 void SetElementType( ElementType theType );
539 FunctorType GetFunctorType();
542 Controls::RangeOfIdsPtr myRangeOfIdsPtr;
547 Description : Base class for comparators
549 class SMESH_I_EXPORT Comparator_i: public virtual POA_SMESH::Comparator,
550 public virtual Predicate_i
553 virtual ~Comparator_i();
555 virtual void SetMargin( CORBA::Double );
556 virtual void SetNumFunctor( NumericalFunctor_ptr );
558 Controls::ComparatorPtr GetComparator();
559 NumericalFunctor_i* GetNumFunctor_i();
560 CORBA::Double GetMargin();
565 Controls::ComparatorPtr myComparatorPtr;
566 NumericalFunctor_i* myNumericalFunctor;
572 Description : Comparator "<"
574 class SMESH_I_EXPORT LessThan_i: public virtual POA_SMESH::LessThan,
575 public virtual Comparator_i
579 FunctorType GetFunctorType();
585 Description : Comparator ">"
587 class SMESH_I_EXPORT MoreThan_i: public virtual POA_SMESH::MoreThan,
588 public virtual Comparator_i
592 FunctorType GetFunctorType();
598 Description : Comparator "="
600 class SMESH_I_EXPORT EqualTo_i: public virtual POA_SMESH::EqualTo,
601 public virtual Comparator_i
605 virtual void SetTolerance( CORBA::Double );
606 CORBA::Double GetTolerance();
607 FunctorType GetFunctorType();
610 Controls::EqualToPtr myEqualToPtr;
616 Description : Logical NOT predicate
618 class SMESH_I_EXPORT LogicalNOT_i: public virtual POA_SMESH::LogicalNOT,
619 public virtual Predicate_i
623 virtual ~LogicalNOT_i();
625 virtual void SetPredicate( Predicate_ptr );
626 Predicate_i* GetPredicate_i();
627 FunctorType GetFunctorType();
630 Controls::LogicalNOTPtr myLogicalNOTPtr;
631 Predicate_i* myPredicate;
636 Class : LogicalBinary_i
637 Description : Base class for binary logical predicate
639 class SMESH_I_EXPORT LogicalBinary_i: public virtual POA_SMESH::LogicalBinary,
640 public virtual Predicate_i
643 virtual ~LogicalBinary_i();
644 virtual void SetMesh( SMESH_Mesh_ptr theMesh );
645 virtual void SetPredicate1( Predicate_ptr );
646 virtual void SetPredicate2( Predicate_ptr );
648 Controls::LogicalBinaryPtr GetLogicalBinary();
649 Predicate_i* GetPredicate1_i();
650 Predicate_i* GetPredicate2_i();
655 Controls::LogicalBinaryPtr myLogicalBinaryPtr;
656 Predicate_i* myPredicate1;
657 Predicate_i* myPredicate2;
663 Description : Logical AND
665 class SMESH_I_EXPORT LogicalAND_i: public virtual POA_SMESH::LogicalAND,
666 public virtual LogicalBinary_i
670 FunctorType GetFunctorType();
676 Description : Logical OR
678 class SMESH_I_EXPORT LogicalOR_i: public virtual POA_SMESH::LogicalOR,
679 public virtual LogicalBinary_i
683 FunctorType GetFunctorType();
690 class SMESH_I_EXPORT Filter_i: public virtual POA_SMESH::Filter,
691 public virtual SALOME::GenericObj_i
699 SetPredicate( Predicate_ptr );
703 SetMesh( SMESH_Mesh_ptr );
711 GetElementsId( Predicate_i*,
713 Controls::Filter::TIdSequence& );
716 GetElementsId( Predicate_i*,
718 Controls::Filter::TIdSequence& );
722 GetElementsId( SMESH_Mesh_ptr );
730 GetCriteria( SMESH::Filter::Criteria_out theCriteria );
734 SetCriteria( const SMESH::Filter::Criteria& theCriteria );
740 Predicate_i* GetPredicate_i();
743 Controls::Filter myFilter;
744 Predicate_i* myPredicate;
745 SMESH_Mesh_var myMesh;
752 class SMESH_I_EXPORT FilterLibrary_i: public virtual POA_SMESH::FilterLibrary,
753 public virtual SALOME::GenericObj_i
756 FilterLibrary_i( const char* theFileName );
760 Filter_ptr Copy( const char* theFilterName );
762 CORBA::Boolean Add ( const char* theFilterName, Filter_ptr theFilter );
763 CORBA::Boolean AddEmpty( const char* theFilterName, ElementType theType );
764 CORBA::Boolean Delete ( const char* theFilterName );
765 CORBA::Boolean Replace ( const char* theFilterName,
766 const char* theNewName,
767 Filter_ptr theFilter );
769 CORBA::Boolean Save();
770 CORBA::Boolean SaveAs( const char* aFileName );
772 CORBA::Boolean IsPresent( const char* aFilterName );
773 CORBA::Long NbFilters( ElementType );
774 string_array* GetNames( ElementType );
775 string_array* GetAllNames();
776 void SetFileName( const char* theFileName );
782 FilterManager_var myFilterMgr;
790 class SMESH_I_EXPORT FilterManager_i: public virtual POA_SMESH::FilterManager,
791 public virtual SALOME::GenericObj_i
797 MinimumAngle_ptr CreateMinimumAngle();
798 AspectRatio_ptr CreateAspectRatio();
799 AspectRatio3D_ptr CreateAspectRatio3D();
800 Warping_ptr CreateWarping();
801 Taper_ptr CreateTaper();
802 Skew_ptr CreateSkew();
803 Area_ptr CreateArea();
804 Volume3D_ptr CreateVolume3D();
805 Length_ptr CreateLength();
806 Length2D_ptr CreateLength2D();
807 MultiConnection_ptr CreateMultiConnection();
808 MultiConnection2D_ptr CreateMultiConnection2D();
810 BelongToGeom_ptr CreateBelongToGeom();
811 BelongToPlane_ptr CreateBelongToPlane();
812 BelongToCylinder_ptr CreateBelongToCylinder();
813 BelongToGenSurface_ptr CreateBelongToGenSurface();
815 LyingOnGeom_ptr CreateLyingOnGeom();
817 FreeBorders_ptr CreateFreeBorders();
818 FreeEdges_ptr CreateFreeEdges();
820 RangeOfIds_ptr CreateRangeOfIds();
822 BadOrientedVolume_ptr CreateBadOrientedVolume();
824 LessThan_ptr CreateLessThan();
825 MoreThan_ptr CreateMoreThan();
826 EqualTo_ptr CreateEqualTo();
828 LogicalNOT_ptr CreateLogicalNOT();
829 LogicalAND_ptr CreateLogicalAND();
830 LogicalOR_ptr CreateLogicalOR();
832 Filter_ptr CreateFilter();
834 FilterLibrary_ptr LoadLibrary( const char* aFileName );
835 FilterLibrary_ptr CreateLibrary();
836 CORBA::Boolean DeleteLibrary( const char* aFileName );
841 GetPredicate( SMESH::Predicate_ptr thePredicate );