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();
77 const SMESHDS_Mesh* myMeshDS;
78 SMDSAbs_ElementType myType;
80 double myTolerance; // only if myIsSubshape == false
81 Controls::ElementsOnShapePtr myElementsOnShapePtr; // only if myIsSubshape == false
83 typedef boost::shared_ptr<BelongToGeom> BelongToGeomPtr;
87 Description : Predicate for verifying whether entiy lying or partially lying on
88 specified geometrical support
90 class SMESH_I_EXPORT LyingOnGeom: public virtual Predicate
95 virtual void SetMesh( const SMDS_Mesh* theMesh );
96 virtual void SetGeom( const TopoDS_Shape& theShape );
98 virtual bool IsSatisfy( long theElementId );
100 virtual void SetType( SMDSAbs_ElementType theType );
101 virtual SMDSAbs_ElementType GetType() const;
103 TopoDS_Shape GetShape();
104 const SMESHDS_Mesh* GetMeshDS() const;
106 void SetTolerance( double );
107 double GetTolerance();
109 virtual bool Contains( const SMESHDS_Mesh* theMeshDS,
110 const TopoDS_Shape& theShape,
111 const SMDS_MeshElement* theElem,
112 TopAbs_ShapeEnum theFindShapeEnum,
113 TopAbs_ShapeEnum theAvoidShapeEnum = TopAbs_SHAPE );
117 TopoDS_Shape myShape;
118 const SMESHDS_Mesh* myMeshDS;
119 SMDSAbs_ElementType myType;
121 double myTolerance; // only if myIsSubshape == false
122 Controls::ElementsOnShapePtr myElementsOnShapePtr; // only if myIsSubshape == false
124 typedef boost::shared_ptr<LyingOnGeom> LyingOnGeomPtr;
133 Description : An abstact class for all functors
135 class SMESH_I_EXPORT Functor_i: public virtual POA_SMESH::Functor,
136 public virtual SALOME::GenericObj_i
139 void SetMesh( SMESH_Mesh_ptr theMesh );
140 Controls::FunctorPtr GetFunctor(){ return myFunctorPtr;}
141 ElementType GetElementType();
147 Controls::FunctorPtr myFunctorPtr;
151 Class : NumericalFunctor_i
152 Description : Base class for numerical functors
154 class SMESH_I_EXPORT NumericalFunctor_i: public virtual POA_SMESH::NumericalFunctor,
155 public virtual Functor_i
158 CORBA::Double GetValue( CORBA::Long theElementId );
159 void SetPrecision( CORBA::Long thePrecision );
160 CORBA::Long GetPrecision();
161 Controls::NumericalFunctorPtr GetNumericalFunctor();
164 Controls::NumericalFunctorPtr myNumericalFunctorPtr;
169 Class : SMESH_MinimumAngleFunct
170 Description : Functor for calculation of minimum angle
172 class SMESH_I_EXPORT MinimumAngle_i: public virtual POA_SMESH::MinimumAngle,
173 public virtual NumericalFunctor_i
177 FunctorType GetFunctorType();
182 Class : AspectRatio_i
183 Description : Functor for calculating aspect ratio
185 class SMESH_I_EXPORT AspectRatio_i: public virtual POA_SMESH::AspectRatio,
186 public virtual NumericalFunctor_i
190 FunctorType GetFunctorType();
195 Class : AspectRatio3D_i
196 Description : Functor for calculating aspect ratio for 3D
198 class SMESH_I_EXPORT AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D,
199 public virtual NumericalFunctor_i
203 FunctorType GetFunctorType();
209 Description : Functor for calculating warping
211 class SMESH_I_EXPORT Warping_i: public virtual POA_SMESH::Warping,
212 public virtual NumericalFunctor_i
216 FunctorType GetFunctorType();
222 Description : Functor for calculating taper
224 class SMESH_I_EXPORT Taper_i: public virtual POA_SMESH::Taper,
225 public virtual NumericalFunctor_i
229 FunctorType GetFunctorType();
235 Description : Functor for calculating skew in degrees
237 class SMESH_I_EXPORT Skew_i: public virtual POA_SMESH::Skew,
238 public virtual NumericalFunctor_i
242 FunctorType GetFunctorType();
248 Description : Functor for calculating area
250 class SMESH_I_EXPORT Area_i: public virtual POA_SMESH::Area,
251 public virtual NumericalFunctor_i
255 FunctorType GetFunctorType();
261 Description : Functor for calculating volume of 3D element
263 class SMESH_I_EXPORT Volume3D_i: public virtual POA_SMESH::Volume3D,
264 public virtual NumericalFunctor_i
268 FunctorType GetFunctorType();
274 Description : Functor for calculating length of edge
276 class SMESH_I_EXPORT Length_i: public virtual POA_SMESH::Length,
277 public virtual NumericalFunctor_i
281 FunctorType GetFunctorType();
286 Description : Functor for calculating length of edge
288 class SMESH_I_EXPORT Length2D_i: public virtual POA_SMESH::Length2D,
289 public virtual NumericalFunctor_i
293 SMESH::Length2D::Values* GetValues();
294 FunctorType GetFunctorType();
297 Controls::Length2DPtr myLength2DPtr;
302 Class : MultiConnection_i
303 Description : Functor for calculating number of faces conneted to the edge
305 class SMESH_I_EXPORT MultiConnection_i: public virtual POA_SMESH::MultiConnection,
306 public virtual NumericalFunctor_i
310 FunctorType GetFunctorType();
314 Class : MultiConnection2D_i
315 Description : Functor for calculating number of faces conneted to the edge
317 class SMESH_I_EXPORT MultiConnection2D_i: public virtual POA_SMESH::MultiConnection2D,
318 public virtual NumericalFunctor_i
321 MultiConnection2D_i();
322 SMESH::MultiConnection2D::Values* GetValues();
323 FunctorType GetFunctorType();
326 Controls::MultiConnection2DPtr myMulticonnection2DPtr;
335 Description : Base class for all predicates
337 class SMESH_I_EXPORT Predicate_i: public virtual POA_SMESH::Predicate,
338 public virtual Functor_i
341 CORBA::Boolean IsSatisfy( CORBA::Long theElementId );
342 Controls::PredicatePtr GetPredicate();
345 Controls::PredicatePtr myPredicatePtr;
350 Class : BadOrientedVolume_i
351 Description : Verify whether a mesh volume is incorrectly oriented from
352 the point of view of MED convention
354 class SMESH_I_EXPORT BadOrientedVolume_i: public virtual POA_SMESH::BadOrientedVolume,
355 public virtual Predicate_i
358 BadOrientedVolume_i();
359 FunctorType GetFunctorType();
363 Class : BelongToGeom_i
364 Description : Predicate for selection on geometrical support
366 class SMESH_I_EXPORT BelongToGeom_i: public virtual POA_SMESH::BelongToGeom,
367 public virtual Predicate_i
371 virtual ~BelongToGeom_i();
373 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
374 void SetElementType( ElementType theType );
375 FunctorType GetFunctorType();
377 void SetGeom( const TopoDS_Shape& theShape );
379 void SetShapeName( const char* theName );
380 void SetShape( const char* theID, const char* theName );
381 char* GetShapeName();
384 void SetTolerance( CORBA::Double );
385 CORBA::Double GetTolerance();
388 Controls::BelongToGeomPtr myBelongToGeomPtr;
394 Class : BelongToSurface_i
395 Description : Verify whether mesh element lie in pointed Geom planar object
397 class SMESH_I_EXPORT BelongToSurface_i: public virtual POA_SMESH::BelongToSurface,
398 public virtual Predicate_i
401 BelongToSurface_i( const Handle(Standard_Type)& );
402 virtual ~BelongToSurface_i();
404 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
406 void SetShapeName( const char* theName, ElementType theType );
407 void SetShape( const char* theID, const char* theName, ElementType theType );
408 char* GetShapeName();
411 void SetTolerance( CORBA::Double );
412 CORBA::Double GetTolerance();
414 void SetUseBoundaries( CORBA::Boolean theUseBndRestrictions );
415 CORBA::Boolean GetUseBoundaries();
418 Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr;
421 Handle(Standard_Type) mySurfaceType;
425 Class : BelongToPlane_i
426 Description : Verify whether mesh element lie in pointed Geom planar object
428 class SMESH_I_EXPORT BelongToPlane_i: public virtual POA_SMESH::BelongToPlane,
429 public virtual BelongToSurface_i
433 void SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
434 FunctorType GetFunctorType();
438 Class : BelongToCylinder_i
439 Description : Verify whether mesh element lie in pointed Geom cylindrical object
441 class SMESH_I_EXPORT BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder,
442 public virtual BelongToSurface_i
445 BelongToCylinder_i();
446 void SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
447 FunctorType GetFunctorType();
451 Class : BelongToGenSurface_i
452 Description : Verify whether mesh element lie on pointed Geom surfasic object
454 class BelongToGenSurface_i: public virtual POA_SMESH::BelongToGenSurface,
455 public virtual BelongToSurface_i
458 BelongToGenSurface_i();
459 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
460 FunctorType GetFunctorType();
464 Class : LyingOnGeom_i
465 Description : Predicate for selection on geometrical support(lying or partially lying)
467 class SMESH_I_EXPORT LyingOnGeom_i: public virtual POA_SMESH::LyingOnGeom,
468 public virtual Predicate_i
472 virtual ~LyingOnGeom_i();
474 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
475 void SetElementType( ElementType theType );
476 FunctorType GetFunctorType();
478 void SetGeom( const TopoDS_Shape& theShape );
480 void SetShapeName( const char* theName );
481 void SetShape( const char* theID, const char* theName );
482 char* GetShapeName();
485 void SetTolerance( CORBA::Double );
486 CORBA::Double GetTolerance();
489 Controls::LyingOnGeomPtr myLyingOnGeomPtr;
495 Class : FreeBorders_i
496 Description : Predicate for free borders
498 class SMESH_I_EXPORT FreeBorders_i: public virtual POA_SMESH::FreeBorders,
499 public virtual Predicate_i
503 FunctorType GetFunctorType();
509 Description : Predicate for free edges
511 class SMESH_I_EXPORT FreeEdges_i: public virtual POA_SMESH::FreeEdges,
512 public virtual Predicate_i
516 SMESH::FreeEdges::Borders* GetBorders();
517 FunctorType GetFunctorType();
520 Controls::FreeEdgesPtr myFreeEdgesPtr;
526 Description : Predicate for Range of Ids
528 class SMESH_I_EXPORT RangeOfIds_i: public virtual POA_SMESH::RangeOfIds,
529 public virtual Predicate_i
533 void SetRange( const SMESH::long_array& theIds );
534 CORBA::Boolean SetRangeStr( const char* theRange );
537 void SetElementType( ElementType theType );
538 FunctorType GetFunctorType();
541 Controls::RangeOfIdsPtr myRangeOfIdsPtr;
546 Description : Base class for comparators
548 class SMESH_I_EXPORT Comparator_i: public virtual POA_SMESH::Comparator,
549 public virtual Predicate_i
552 virtual ~Comparator_i();
554 virtual void SetMargin( CORBA::Double );
555 virtual void SetNumFunctor( NumericalFunctor_ptr );
557 Controls::ComparatorPtr GetComparator();
558 NumericalFunctor_i* GetNumFunctor_i();
559 CORBA::Double GetMargin();
564 Controls::ComparatorPtr myComparatorPtr;
565 NumericalFunctor_i* myNumericalFunctor;
571 Description : Comparator "<"
573 class SMESH_I_EXPORT LessThan_i: public virtual POA_SMESH::LessThan,
574 public virtual Comparator_i
578 FunctorType GetFunctorType();
584 Description : Comparator ">"
586 class SMESH_I_EXPORT MoreThan_i: public virtual POA_SMESH::MoreThan,
587 public virtual Comparator_i
591 FunctorType GetFunctorType();
597 Description : Comparator "="
599 class SMESH_I_EXPORT EqualTo_i: public virtual POA_SMESH::EqualTo,
600 public virtual Comparator_i
604 virtual void SetTolerance( CORBA::Double );
605 CORBA::Double GetTolerance();
606 FunctorType GetFunctorType();
609 Controls::EqualToPtr myEqualToPtr;
615 Description : Logical NOT predicate
617 class SMESH_I_EXPORT LogicalNOT_i: public virtual POA_SMESH::LogicalNOT,
618 public virtual Predicate_i
622 virtual ~LogicalNOT_i();
624 virtual void SetPredicate( Predicate_ptr );
625 Predicate_i* GetPredicate_i();
626 FunctorType GetFunctorType();
629 Controls::LogicalNOTPtr myLogicalNOTPtr;
630 Predicate_i* myPredicate;
635 Class : LogicalBinary_i
636 Description : Base class for binary logical predicate
638 class SMESH_I_EXPORT LogicalBinary_i: public virtual POA_SMESH::LogicalBinary,
639 public virtual Predicate_i
642 virtual ~LogicalBinary_i();
643 virtual void SetMesh( SMESH_Mesh_ptr theMesh );
644 virtual void SetPredicate1( Predicate_ptr );
645 virtual void SetPredicate2( Predicate_ptr );
647 Controls::LogicalBinaryPtr GetLogicalBinary();
648 Predicate_i* GetPredicate1_i();
649 Predicate_i* GetPredicate2_i();
654 Controls::LogicalBinaryPtr myLogicalBinaryPtr;
655 Predicate_i* myPredicate1;
656 Predicate_i* myPredicate2;
662 Description : Logical AND
664 class SMESH_I_EXPORT LogicalAND_i: public virtual POA_SMESH::LogicalAND,
665 public virtual LogicalBinary_i
669 FunctorType GetFunctorType();
675 Description : Logical OR
677 class SMESH_I_EXPORT LogicalOR_i: public virtual POA_SMESH::LogicalOR,
678 public virtual LogicalBinary_i
682 FunctorType GetFunctorType();
689 class SMESH_I_EXPORT Filter_i: public virtual POA_SMESH::Filter,
690 public virtual SALOME::GenericObj_i
698 SetPredicate( Predicate_ptr );
702 SetMesh( SMESH_Mesh_ptr );
710 GetElementsId( Predicate_i*,
712 Controls::Filter::TIdSequence& );
715 GetElementsId( Predicate_i*,
717 Controls::Filter::TIdSequence& );
721 GetElementsId( SMESH_Mesh_ptr );
729 GetCriteria( SMESH::Filter::Criteria_out theCriteria );
733 SetCriteria( const SMESH::Filter::Criteria& theCriteria );
739 Predicate_i* GetPredicate_i();
742 Controls::Filter myFilter;
743 Predicate_i* myPredicate;
744 SMESH_Mesh_var myMesh;
751 class SMESH_I_EXPORT FilterLibrary_i: public virtual POA_SMESH::FilterLibrary,
752 public virtual SALOME::GenericObj_i
755 FilterLibrary_i( const char* theFileName );
759 Filter_ptr Copy( const char* theFilterName );
761 CORBA::Boolean Add ( const char* theFilterName, Filter_ptr theFilter );
762 CORBA::Boolean AddEmpty( const char* theFilterName, ElementType theType );
763 CORBA::Boolean Delete ( const char* theFilterName );
764 CORBA::Boolean Replace ( const char* theFilterName,
765 const char* theNewName,
766 Filter_ptr theFilter );
768 CORBA::Boolean Save();
769 CORBA::Boolean SaveAs( const char* aFileName );
771 CORBA::Boolean IsPresent( const char* aFilterName );
772 CORBA::Long NbFilters( ElementType );
773 string_array* GetNames( ElementType );
774 string_array* GetAllNames();
775 void SetFileName( const char* theFileName );
781 FilterManager_var myFilterMgr;
789 class SMESH_I_EXPORT FilterManager_i: public virtual POA_SMESH::FilterManager,
790 public virtual SALOME::GenericObj_i
796 MinimumAngle_ptr CreateMinimumAngle();
797 AspectRatio_ptr CreateAspectRatio();
798 AspectRatio3D_ptr CreateAspectRatio3D();
799 Warping_ptr CreateWarping();
800 Taper_ptr CreateTaper();
801 Skew_ptr CreateSkew();
802 Area_ptr CreateArea();
803 Volume3D_ptr CreateVolume3D();
804 Length_ptr CreateLength();
805 Length2D_ptr CreateLength2D();
806 MultiConnection_ptr CreateMultiConnection();
807 MultiConnection2D_ptr CreateMultiConnection2D();
809 BelongToGeom_ptr CreateBelongToGeom();
810 BelongToPlane_ptr CreateBelongToPlane();
811 BelongToCylinder_ptr CreateBelongToCylinder();
812 BelongToGenSurface_ptr CreateBelongToGenSurface();
814 LyingOnGeom_ptr CreateLyingOnGeom();
816 FreeBorders_ptr CreateFreeBorders();
817 FreeEdges_ptr CreateFreeEdges();
819 RangeOfIds_ptr CreateRangeOfIds();
821 BadOrientedVolume_ptr CreateBadOrientedVolume();
823 LessThan_ptr CreateLessThan();
824 MoreThan_ptr CreateMoreThan();
825 EqualTo_ptr CreateEqualTo();
827 LogicalNOT_ptr CreateLogicalNOT();
828 LogicalAND_ptr CreateLogicalAND();
829 LogicalOR_ptr CreateLogicalOR();
831 Filter_ptr CreateFilter();
833 FilterLibrary_ptr LoadLibrary( const char* aFileName );
834 FilterLibrary_ptr CreateLibrary();
835 CORBA::Boolean DeleteLibrary( const char* aFileName );
840 GetPredicate( SMESH::Predicate_ptr thePredicate );