1 // Copyright (C) 2007-2008 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
22 // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
23 // File : SMESH_Filter_i.hxx
24 // Author : Alexey Petrov, OCC
27 #ifndef _SMESH_FILTER_I_HXX_
28 #define _SMESH_FILTER_I_HXX_
32 #include <SALOMEconfig.h>
33 #include CORBA_SERVER_HEADER(SMESH_Filter)
35 #include <LDOM_Document.hxx>
36 #include <TopoDS_Shape.hxx>
38 #include "SALOME_GenericObj_i.hh"
39 #include "SMESH_ControlsDef.hxx"
51 Description : Predicate for verifying whether entiy belong to
52 specified geometrical support
54 class SMESH_I_EXPORT BelongToGeom: public virtual Predicate
59 virtual void SetMesh( const SMDS_Mesh* theMesh );
60 virtual void SetGeom( const TopoDS_Shape& theShape );
62 virtual bool IsSatisfy( long theElementId );
64 virtual void SetType( SMDSAbs_ElementType theType );
65 virtual SMDSAbs_ElementType GetType() const;
67 TopoDS_Shape GetShape();
68 const SMESHDS_Mesh* GetMeshDS() const;
70 void SetTolerance( double );
71 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 );
120 TopoDS_Shape myShape;
121 const SMESHDS_Mesh* myMeshDS;
122 SMDSAbs_ElementType myType;
124 double myTolerance; // only if myIsSubshape == false
125 Controls::ElementsOnShapePtr myElementsOnShapePtr; // only if myIsSubshape == false
127 typedef boost::shared_ptr<LyingOnGeom> LyingOnGeomPtr;
136 Description : An abstact class for all functors
138 class SMESH_I_EXPORT Functor_i: public virtual POA_SMESH::Functor,
139 public virtual SALOME::GenericObj_i
142 void SetMesh( SMESH_Mesh_ptr theMesh );
143 Controls::FunctorPtr GetFunctor(){ return myFunctorPtr;}
144 ElementType GetElementType();
150 Controls::FunctorPtr myFunctorPtr;
154 Class : NumericalFunctor_i
155 Description : Base class for numerical functors
157 class SMESH_I_EXPORT NumericalFunctor_i: public virtual POA_SMESH::NumericalFunctor,
158 public virtual Functor_i
161 CORBA::Double GetValue( CORBA::Long theElementId );
162 void SetPrecision( CORBA::Long thePrecision );
163 CORBA::Long GetPrecision();
164 Controls::NumericalFunctorPtr GetNumericalFunctor();
167 Controls::NumericalFunctorPtr myNumericalFunctorPtr;
172 Class : SMESH_MinimumAngleFunct
173 Description : Functor for calculation of minimum angle
175 class SMESH_I_EXPORT MinimumAngle_i: public virtual POA_SMESH::MinimumAngle,
176 public virtual NumericalFunctor_i
180 FunctorType GetFunctorType();
185 Class : AspectRatio_i
186 Description : Functor for calculating aspect ratio
188 class SMESH_I_EXPORT AspectRatio_i: public virtual POA_SMESH::AspectRatio,
189 public virtual NumericalFunctor_i
193 FunctorType GetFunctorType();
198 Class : AspectRatio3D_i
199 Description : Functor for calculating aspect ratio for 3D
201 class SMESH_I_EXPORT AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D,
202 public virtual NumericalFunctor_i
206 FunctorType GetFunctorType();
212 Description : Functor for calculating warping
214 class SMESH_I_EXPORT Warping_i: public virtual POA_SMESH::Warping,
215 public virtual NumericalFunctor_i
219 FunctorType GetFunctorType();
225 Description : Functor for calculating taper
227 class SMESH_I_EXPORT Taper_i: public virtual POA_SMESH::Taper,
228 public virtual NumericalFunctor_i
232 FunctorType GetFunctorType();
238 Description : Functor for calculating skew in degrees
240 class SMESH_I_EXPORT Skew_i: public virtual POA_SMESH::Skew,
241 public virtual NumericalFunctor_i
245 FunctorType GetFunctorType();
251 Description : Functor for calculating area
253 class SMESH_I_EXPORT Area_i: public virtual POA_SMESH::Area,
254 public virtual NumericalFunctor_i
258 FunctorType GetFunctorType();
264 Description : Functor for calculating volume of 3D element
266 class SMESH_I_EXPORT Volume3D_i: public virtual POA_SMESH::Volume3D,
267 public virtual NumericalFunctor_i
271 FunctorType GetFunctorType();
277 Description : Functor for calculating length of edge
279 class SMESH_I_EXPORT Length_i: public virtual POA_SMESH::Length,
280 public virtual NumericalFunctor_i
284 FunctorType GetFunctorType();
289 Description : Functor for calculating length of edge
291 class SMESH_I_EXPORT Length2D_i: public virtual POA_SMESH::Length2D,
292 public virtual NumericalFunctor_i
296 SMESH::Length2D::Values* GetValues();
297 FunctorType GetFunctorType();
300 Controls::Length2DPtr myLength2DPtr;
305 Class : MultiConnection_i
306 Description : Functor for calculating number of faces conneted to the edge
308 class SMESH_I_EXPORT MultiConnection_i: public virtual POA_SMESH::MultiConnection,
309 public virtual NumericalFunctor_i
313 FunctorType GetFunctorType();
317 Class : MultiConnection2D_i
318 Description : Functor for calculating number of faces conneted to the edge
320 class SMESH_I_EXPORT MultiConnection2D_i: public virtual POA_SMESH::MultiConnection2D,
321 public virtual NumericalFunctor_i
324 MultiConnection2D_i();
325 SMESH::MultiConnection2D::Values* GetValues();
326 FunctorType GetFunctorType();
329 Controls::MultiConnection2DPtr myMulticonnection2DPtr;
338 Description : Base class for all predicates
340 class SMESH_I_EXPORT Predicate_i: public virtual POA_SMESH::Predicate,
341 public virtual Functor_i
344 CORBA::Boolean IsSatisfy( CORBA::Long theElementId );
345 Controls::PredicatePtr GetPredicate();
348 Controls::PredicatePtr myPredicatePtr;
353 Class : BadOrientedVolume_i
354 Description : Verify whether a mesh volume is incorrectly oriented from
355 the point of view of MED convention
357 class SMESH_I_EXPORT BadOrientedVolume_i: public virtual POA_SMESH::BadOrientedVolume,
358 public virtual Predicate_i
361 BadOrientedVolume_i();
362 FunctorType GetFunctorType();
366 Class : BelongToGeom_i
367 Description : Predicate for selection on geometrical support
369 class SMESH_I_EXPORT BelongToGeom_i: public virtual POA_SMESH::BelongToGeom,
370 public virtual Predicate_i
374 virtual ~BelongToGeom_i();
376 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
377 void SetElementType( ElementType theType );
378 FunctorType GetFunctorType();
380 void SetGeom( const TopoDS_Shape& theShape );
382 void SetShapeName( const char* theName );
383 void SetShape( const char* theID, const char* theName );
384 char* GetShapeName();
387 void SetTolerance( CORBA::Double );
388 CORBA::Double GetTolerance();
391 Controls::BelongToGeomPtr myBelongToGeomPtr;
397 Class : BelongToSurface_i
398 Description : Verify whether mesh element lie in pointed Geom planar object
400 class SMESH_I_EXPORT BelongToSurface_i: public virtual POA_SMESH::BelongToSurface,
401 public virtual Predicate_i
404 BelongToSurface_i( const Handle(Standard_Type)& );
405 virtual ~BelongToSurface_i();
407 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
409 void SetShapeName( const char* theName, ElementType theType );
410 void SetShape( const char* theID, const char* theName, ElementType theType );
411 char* GetShapeName();
414 void SetTolerance( CORBA::Double );
415 CORBA::Double GetTolerance();
417 void SetUseBoundaries( CORBA::Boolean theUseBndRestrictions );
418 CORBA::Boolean GetUseBoundaries();
421 Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr;
424 Handle(Standard_Type) mySurfaceType;
428 Class : BelongToPlane_i
429 Description : Verify whether mesh element lie in pointed Geom planar object
431 class SMESH_I_EXPORT BelongToPlane_i: public virtual POA_SMESH::BelongToPlane,
432 public virtual BelongToSurface_i
436 void SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
437 FunctorType GetFunctorType();
441 Class : BelongToCylinder_i
442 Description : Verify whether mesh element lie in pointed Geom cylindrical object
444 class SMESH_I_EXPORT BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder,
445 public virtual BelongToSurface_i
448 BelongToCylinder_i();
449 void SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
450 FunctorType GetFunctorType();
454 Class : BelongToGenSurface_i
455 Description : Verify whether mesh element lie on pointed Geom surfasic object
457 class BelongToGenSurface_i: public virtual POA_SMESH::BelongToGenSurface,
458 public virtual BelongToSurface_i
461 BelongToGenSurface_i();
462 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
463 FunctorType GetFunctorType();
467 Class : LyingOnGeom_i
468 Description : Predicate for selection on geometrical support(lying or partially lying)
470 class SMESH_I_EXPORT LyingOnGeom_i: public virtual POA_SMESH::LyingOnGeom,
471 public virtual Predicate_i
475 virtual ~LyingOnGeom_i();
477 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
478 void SetElementType( ElementType theType );
479 FunctorType GetFunctorType();
481 void SetGeom( const TopoDS_Shape& theShape );
483 void SetShapeName( const char* theName );
484 void SetShape( const char* theID, const char* theName );
485 char* GetShapeName();
488 void SetTolerance( CORBA::Double );
489 CORBA::Double GetTolerance();
492 Controls::LyingOnGeomPtr myLyingOnGeomPtr;
498 Class : FreeBorders_i
499 Description : Predicate for free borders
501 class SMESH_I_EXPORT FreeBorders_i: public virtual POA_SMESH::FreeBorders,
502 public virtual Predicate_i
506 FunctorType GetFunctorType();
512 Description : Predicate for free edges
514 class SMESH_I_EXPORT FreeEdges_i: public virtual POA_SMESH::FreeEdges,
515 public virtual Predicate_i
519 SMESH::FreeEdges::Borders* GetBorders();
520 FunctorType GetFunctorType();
523 Controls::FreeEdgesPtr myFreeEdgesPtr;
529 Description : Predicate for Range of Ids
531 class SMESH_I_EXPORT RangeOfIds_i: public virtual POA_SMESH::RangeOfIds,
532 public virtual Predicate_i
536 void SetRange( const SMESH::long_array& theIds );
537 CORBA::Boolean SetRangeStr( const char* theRange );
540 void SetElementType( ElementType theType );
541 FunctorType GetFunctorType();
544 Controls::RangeOfIdsPtr myRangeOfIdsPtr;
549 Description : Base class for comparators
551 class SMESH_I_EXPORT Comparator_i: public virtual POA_SMESH::Comparator,
552 public virtual Predicate_i
555 virtual ~Comparator_i();
557 virtual void SetMargin( CORBA::Double );
558 virtual void SetNumFunctor( NumericalFunctor_ptr );
560 Controls::ComparatorPtr GetComparator();
561 NumericalFunctor_i* GetNumFunctor_i();
562 CORBA::Double GetMargin();
567 Controls::ComparatorPtr myComparatorPtr;
568 NumericalFunctor_i* myNumericalFunctor;
574 Description : Comparator "<"
576 class SMESH_I_EXPORT LessThan_i: public virtual POA_SMESH::LessThan,
577 public virtual Comparator_i
581 FunctorType GetFunctorType();
587 Description : Comparator ">"
589 class SMESH_I_EXPORT MoreThan_i: public virtual POA_SMESH::MoreThan,
590 public virtual Comparator_i
594 FunctorType GetFunctorType();
600 Description : Comparator "="
602 class SMESH_I_EXPORT EqualTo_i: public virtual POA_SMESH::EqualTo,
603 public virtual Comparator_i
607 virtual void SetTolerance( CORBA::Double );
608 CORBA::Double GetTolerance();
609 FunctorType GetFunctorType();
612 Controls::EqualToPtr myEqualToPtr;
618 Description : Logical NOT predicate
620 class SMESH_I_EXPORT LogicalNOT_i: public virtual POA_SMESH::LogicalNOT,
621 public virtual Predicate_i
625 virtual ~LogicalNOT_i();
627 virtual void SetPredicate( Predicate_ptr );
628 Predicate_i* GetPredicate_i();
629 FunctorType GetFunctorType();
632 Controls::LogicalNOTPtr myLogicalNOTPtr;
633 Predicate_i* myPredicate;
638 Class : LogicalBinary_i
639 Description : Base class for binary logical predicate
641 class SMESH_I_EXPORT LogicalBinary_i: public virtual POA_SMESH::LogicalBinary,
642 public virtual Predicate_i
645 virtual ~LogicalBinary_i();
646 virtual void SetMesh( SMESH_Mesh_ptr theMesh );
647 virtual void SetPredicate1( Predicate_ptr );
648 virtual void SetPredicate2( Predicate_ptr );
650 Controls::LogicalBinaryPtr GetLogicalBinary();
651 Predicate_i* GetPredicate1_i();
652 Predicate_i* GetPredicate2_i();
657 Controls::LogicalBinaryPtr myLogicalBinaryPtr;
658 Predicate_i* myPredicate1;
659 Predicate_i* myPredicate2;
665 Description : Logical AND
667 class SMESH_I_EXPORT LogicalAND_i: public virtual POA_SMESH::LogicalAND,
668 public virtual LogicalBinary_i
672 FunctorType GetFunctorType();
678 Description : Logical OR
680 class SMESH_I_EXPORT LogicalOR_i: public virtual POA_SMESH::LogicalOR,
681 public virtual LogicalBinary_i
685 FunctorType GetFunctorType();
692 class SMESH_I_EXPORT Filter_i: public virtual POA_SMESH::Filter,
693 public virtual SALOME::GenericObj_i
701 SetPredicate( Predicate_ptr );
705 SetMesh( SMESH_Mesh_ptr );
713 GetElementsId( Predicate_i*,
715 Controls::Filter::TIdSequence& );
718 GetElementsId( Predicate_i*,
720 Controls::Filter::TIdSequence& );
724 GetElementsId( SMESH_Mesh_ptr );
732 GetCriteria( SMESH::Filter::Criteria_out theCriteria );
736 SetCriteria( const SMESH::Filter::Criteria& theCriteria );
742 Predicate_i* GetPredicate_i();
745 Controls::Filter myFilter;
746 Predicate_i* myPredicate;
747 SMESH_Mesh_var myMesh;
754 class SMESH_I_EXPORT FilterLibrary_i: public virtual POA_SMESH::FilterLibrary,
755 public virtual SALOME::GenericObj_i
758 FilterLibrary_i( const char* theFileName );
762 Filter_ptr Copy( const char* theFilterName );
764 CORBA::Boolean Add ( const char* theFilterName, Filter_ptr theFilter );
765 CORBA::Boolean AddEmpty( const char* theFilterName, ElementType theType );
766 CORBA::Boolean Delete ( const char* theFilterName );
767 CORBA::Boolean Replace ( const char* theFilterName,
768 const char* theNewName,
769 Filter_ptr theFilter );
771 CORBA::Boolean Save();
772 CORBA::Boolean SaveAs( const char* aFileName );
774 CORBA::Boolean IsPresent( const char* aFilterName );
775 CORBA::Long NbFilters( ElementType );
776 string_array* GetNames( ElementType );
777 string_array* GetAllNames();
778 void SetFileName( const char* theFileName );
784 FilterManager_var myFilterMgr;
792 class SMESH_I_EXPORT FilterManager_i: public virtual POA_SMESH::FilterManager,
793 public virtual SALOME::GenericObj_i
799 MinimumAngle_ptr CreateMinimumAngle();
800 AspectRatio_ptr CreateAspectRatio();
801 AspectRatio3D_ptr CreateAspectRatio3D();
802 Warping_ptr CreateWarping();
803 Taper_ptr CreateTaper();
804 Skew_ptr CreateSkew();
805 Area_ptr CreateArea();
806 Volume3D_ptr CreateVolume3D();
807 Length_ptr CreateLength();
808 Length2D_ptr CreateLength2D();
809 MultiConnection_ptr CreateMultiConnection();
810 MultiConnection2D_ptr CreateMultiConnection2D();
812 BelongToGeom_ptr CreateBelongToGeom();
813 BelongToPlane_ptr CreateBelongToPlane();
814 BelongToCylinder_ptr CreateBelongToCylinder();
815 BelongToGenSurface_ptr CreateBelongToGenSurface();
817 LyingOnGeom_ptr CreateLyingOnGeom();
819 FreeBorders_ptr CreateFreeBorders();
820 FreeEdges_ptr CreateFreeEdges();
822 RangeOfIds_ptr CreateRangeOfIds();
824 BadOrientedVolume_ptr CreateBadOrientedVolume();
826 LessThan_ptr CreateLessThan();
827 MoreThan_ptr CreateMoreThan();
828 EqualTo_ptr CreateEqualTo();
830 LogicalNOT_ptr CreateLogicalNOT();
831 LogicalAND_ptr CreateLogicalAND();
832 LogicalOR_ptr CreateLogicalOR();
834 Filter_ptr CreateFilter();
836 FilterLibrary_ptr LoadLibrary( const char* aFileName );
837 FilterLibrary_ptr CreateLibrary();
838 CORBA::Boolean DeleteLibrary( const char* aFileName );
843 GetPredicate( SMESH::Predicate_ptr thePredicate );