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;
72 const SMESHDS_Mesh* myMeshDS;
73 SMDSAbs_ElementType myType;
75 typedef boost::shared_ptr<BelongToGeom> BelongToGeomPtr;
79 Description : Predicate for verifying whether entiy lying or partially lying on
80 specified geometrical support
82 class SMESH_I_EXPORT LyingOnGeom: public virtual Predicate
87 virtual void SetMesh( const SMDS_Mesh* theMesh );
88 virtual void SetGeom( const TopoDS_Shape& theShape );
90 virtual bool IsSatisfy( long theElementId );
92 virtual void SetType( SMDSAbs_ElementType theType );
93 virtual SMDSAbs_ElementType GetType() const;
95 TopoDS_Shape GetShape();
96 const SMESHDS_Mesh* GetMeshDS() const;
98 virtual bool Contains( const SMESHDS_Mesh* theMeshDS,
99 const TopoDS_Shape& theShape,
100 const SMDS_MeshElement* theElem,
101 TopAbs_ShapeEnum theFindShapeEnum,
102 TopAbs_ShapeEnum theAvoidShapeEnum = TopAbs_SHAPE );
104 TopoDS_Shape myShape;
105 const SMESHDS_Mesh* myMeshDS;
106 SMDSAbs_ElementType myType;
108 typedef boost::shared_ptr<LyingOnGeom> LyingOnGeomPtr;
117 Description : An abstact class for all functors
119 class SMESH_I_EXPORT Functor_i: public virtual POA_SMESH::Functor,
120 public virtual SALOME::GenericObj_i
123 void SetMesh( SMESH_Mesh_ptr theMesh );
124 Controls::FunctorPtr GetFunctor(){ return myFunctorPtr;}
125 ElementType GetElementType();
131 Controls::FunctorPtr myFunctorPtr;
135 Class : NumericalFunctor_i
136 Description : Base class for numerical functors
138 class SMESH_I_EXPORT NumericalFunctor_i: public virtual POA_SMESH::NumericalFunctor,
139 public virtual Functor_i
142 CORBA::Double GetValue( CORBA::Long theElementId );
143 void SetPrecision( CORBA::Long thePrecision );
144 CORBA::Long GetPrecision();
145 Controls::NumericalFunctorPtr GetNumericalFunctor();
148 Controls::NumericalFunctorPtr myNumericalFunctorPtr;
153 Class : SMESH_MinimumAngleFunct
154 Description : Functor for calculation of minimum angle
156 class SMESH_I_EXPORT MinimumAngle_i: public virtual POA_SMESH::MinimumAngle,
157 public virtual NumericalFunctor_i
161 FunctorType GetFunctorType();
166 Class : AspectRatio_i
167 Description : Functor for calculating aspect ratio
169 class SMESH_I_EXPORT AspectRatio_i: public virtual POA_SMESH::AspectRatio,
170 public virtual NumericalFunctor_i
174 FunctorType GetFunctorType();
179 Class : AspectRatio3D_i
180 Description : Functor for calculating aspect ratio for 3D
182 class SMESH_I_EXPORT AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D,
183 public virtual NumericalFunctor_i
187 FunctorType GetFunctorType();
193 Description : Functor for calculating warping
195 class SMESH_I_EXPORT Warping_i: public virtual POA_SMESH::Warping,
196 public virtual NumericalFunctor_i
200 FunctorType GetFunctorType();
206 Description : Functor for calculating taper
208 class SMESH_I_EXPORT Taper_i: public virtual POA_SMESH::Taper,
209 public virtual NumericalFunctor_i
213 FunctorType GetFunctorType();
219 Description : Functor for calculating skew in degrees
221 class SMESH_I_EXPORT Skew_i: public virtual POA_SMESH::Skew,
222 public virtual NumericalFunctor_i
226 FunctorType GetFunctorType();
232 Description : Functor for calculating area
234 class SMESH_I_EXPORT Area_i: public virtual POA_SMESH::Area,
235 public virtual NumericalFunctor_i
239 FunctorType GetFunctorType();
245 Description : Functor for calculating volume of 3D element
247 class SMESH_I_EXPORT Volume3D_i: public virtual POA_SMESH::Volume3D,
248 public virtual NumericalFunctor_i
252 FunctorType GetFunctorType();
258 Description : Functor for calculating length of edge
260 class SMESH_I_EXPORT Length_i: public virtual POA_SMESH::Length,
261 public virtual NumericalFunctor_i
265 FunctorType GetFunctorType();
270 Description : Functor for calculating length of edge
272 class SMESH_I_EXPORT Length2D_i: public virtual POA_SMESH::Length2D,
273 public virtual NumericalFunctor_i
277 SMESH::Length2D::Values* GetValues();
278 FunctorType GetFunctorType();
281 Controls::Length2DPtr myLength2DPtr;
286 Class : MultiConnection_i
287 Description : Functor for calculating number of faces conneted to the edge
289 class SMESH_I_EXPORT MultiConnection_i: public virtual POA_SMESH::MultiConnection,
290 public virtual NumericalFunctor_i
294 FunctorType GetFunctorType();
298 Class : MultiConnection2D_i
299 Description : Functor for calculating number of faces conneted to the edge
301 class SMESH_I_EXPORT MultiConnection2D_i: public virtual POA_SMESH::MultiConnection2D,
302 public virtual NumericalFunctor_i
305 MultiConnection2D_i();
306 SMESH::MultiConnection2D::Values* GetValues();
307 FunctorType GetFunctorType();
310 Controls::MultiConnection2DPtr myMulticonnection2DPtr;
319 Description : Base class for all predicates
321 class SMESH_I_EXPORT Predicate_i: public virtual POA_SMESH::Predicate,
322 public virtual Functor_i
325 CORBA::Boolean IsSatisfy( CORBA::Long theElementId );
326 Controls::PredicatePtr GetPredicate();
329 Controls::PredicatePtr myPredicatePtr;
334 Class : BadOrientedVolume_i
335 Description : Verify whether a mesh volume is incorrectly oriented from
336 the point of view of MED convention
338 class SMESH_I_EXPORT BadOrientedVolume_i: public virtual POA_SMESH::BadOrientedVolume,
339 public virtual Predicate_i
342 BadOrientedVolume_i();
343 FunctorType GetFunctorType();
347 Class : BelongToGeom_i
348 Description : Predicate for selection on geometrical support
350 class SMESH_I_EXPORT BelongToGeom_i: public virtual POA_SMESH::BelongToGeom,
351 public virtual Predicate_i
355 virtual ~BelongToGeom_i();
357 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
358 void SetElementType( ElementType theType );
359 FunctorType GetFunctorType();
361 void SetGeom( const TopoDS_Shape& theShape );
363 void SetShapeName( const char* theName );
364 void SetShape( const char* theID, const char* theName );
365 char* GetShapeName();
369 Controls::BelongToGeomPtr myBelongToGeomPtr;
375 Class : BelongToSurface_i
376 Description : Verify whether mesh element lie in pointed Geom planar object
378 class SMESH_I_EXPORT BelongToSurface_i: public virtual POA_SMESH::BelongToSurface,
379 public virtual Predicate_i
382 BelongToSurface_i( const Handle(Standard_Type)& );
383 virtual ~BelongToSurface_i();
385 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
387 void SetShapeName( const char* theName, ElementType theType );
388 void SetShape( const char* theID, const char* theName, ElementType theType );
389 char* GetShapeName();
392 void SetTolerance( CORBA::Double );
393 CORBA::Double GetTolerance();
395 void SetUseBoundaries( CORBA::Boolean theUseBndRestrictions );
396 CORBA::Boolean GetUseBoundaries();
399 Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr;
402 Handle(Standard_Type) mySurfaceType;
406 Class : BelongToPlane_i
407 Description : Verify whether mesh element lie in pointed Geom planar object
409 class SMESH_I_EXPORT BelongToPlane_i: public virtual POA_SMESH::BelongToPlane,
410 public virtual BelongToSurface_i
414 void SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
415 FunctorType GetFunctorType();
419 Class : BelongToCylinder_i
420 Description : Verify whether mesh element lie in pointed Geom cylindrical object
422 class SMESH_I_EXPORT BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder,
423 public virtual BelongToSurface_i
426 BelongToCylinder_i();
427 void SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
428 FunctorType GetFunctorType();
432 Class : BelongToGenSurface_i
433 Description : Verify whether mesh element lie on pointed Geom surfasic object
435 class BelongToGenSurface_i: public virtual POA_SMESH::BelongToGenSurface,
436 public virtual BelongToSurface_i
439 BelongToGenSurface_i();
440 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
441 FunctorType GetFunctorType();
445 Class : LyingOnGeom_i
446 Description : Predicate for selection on geometrical support(lying or partially lying)
448 class SMESH_I_EXPORT LyingOnGeom_i: public virtual POA_SMESH::LyingOnGeom,
449 public virtual Predicate_i
453 virtual ~LyingOnGeom_i();
455 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
456 void SetElementType( ElementType theType );
457 FunctorType GetFunctorType();
459 void SetGeom( const TopoDS_Shape& theShape );
461 void SetShapeName( const char* theName );
462 void SetShape( const char* theID, const char* theName );
463 char* GetShapeName();
467 Controls::LyingOnGeomPtr myLyingOnGeomPtr;
473 Class : FreeBorders_i
474 Description : Predicate for free borders
476 class SMESH_I_EXPORT FreeBorders_i: public virtual POA_SMESH::FreeBorders,
477 public virtual Predicate_i
481 FunctorType GetFunctorType();
487 Description : Predicate for free edges
489 class SMESH_I_EXPORT FreeEdges_i: public virtual POA_SMESH::FreeEdges,
490 public virtual Predicate_i
494 SMESH::FreeEdges::Borders* GetBorders();
495 FunctorType GetFunctorType();
498 Controls::FreeEdgesPtr myFreeEdgesPtr;
504 Description : Predicate for Range of Ids
506 class SMESH_I_EXPORT RangeOfIds_i: public virtual POA_SMESH::RangeOfIds,
507 public virtual Predicate_i
511 void SetRange( const SMESH::long_array& theIds );
512 CORBA::Boolean SetRangeStr( const char* theRange );
515 void SetElementType( ElementType theType );
516 FunctorType GetFunctorType();
519 Controls::RangeOfIdsPtr myRangeOfIdsPtr;
524 Description : Base class for comparators
526 class SMESH_I_EXPORT Comparator_i: public virtual POA_SMESH::Comparator,
527 public virtual Predicate_i
530 virtual ~Comparator_i();
532 virtual void SetMargin( CORBA::Double );
533 virtual void SetNumFunctor( NumericalFunctor_ptr );
535 Controls::ComparatorPtr GetComparator();
536 NumericalFunctor_i* GetNumFunctor_i();
537 CORBA::Double GetMargin();
542 Controls::ComparatorPtr myComparatorPtr;
543 NumericalFunctor_i* myNumericalFunctor;
549 Description : Comparator "<"
551 class SMESH_I_EXPORT LessThan_i: public virtual POA_SMESH::LessThan,
552 public virtual Comparator_i
556 FunctorType GetFunctorType();
562 Description : Comparator ">"
564 class SMESH_I_EXPORT MoreThan_i: public virtual POA_SMESH::MoreThan,
565 public virtual Comparator_i
569 FunctorType GetFunctorType();
575 Description : Comparator "="
577 class SMESH_I_EXPORT EqualTo_i: public virtual POA_SMESH::EqualTo,
578 public virtual Comparator_i
582 virtual void SetTolerance( CORBA::Double );
583 CORBA::Double GetTolerance();
584 FunctorType GetFunctorType();
587 Controls::EqualToPtr myEqualToPtr;
593 Description : Logical NOT predicate
595 class SMESH_I_EXPORT LogicalNOT_i: public virtual POA_SMESH::LogicalNOT,
596 public virtual Predicate_i
600 virtual ~LogicalNOT_i();
602 virtual void SetPredicate( Predicate_ptr );
603 Predicate_i* GetPredicate_i();
604 FunctorType GetFunctorType();
607 Controls::LogicalNOTPtr myLogicalNOTPtr;
608 Predicate_i* myPredicate;
613 Class : LogicalBinary_i
614 Description : Base class for binary logical predicate
616 class SMESH_I_EXPORT LogicalBinary_i: public virtual POA_SMESH::LogicalBinary,
617 public virtual Predicate_i
620 virtual ~LogicalBinary_i();
621 virtual void SetMesh( SMESH_Mesh_ptr theMesh );
622 virtual void SetPredicate1( Predicate_ptr );
623 virtual void SetPredicate2( Predicate_ptr );
625 Controls::LogicalBinaryPtr GetLogicalBinary();
626 Predicate_i* GetPredicate1_i();
627 Predicate_i* GetPredicate2_i();
632 Controls::LogicalBinaryPtr myLogicalBinaryPtr;
633 Predicate_i* myPredicate1;
634 Predicate_i* myPredicate2;
640 Description : Logical AND
642 class SMESH_I_EXPORT LogicalAND_i: public virtual POA_SMESH::LogicalAND,
643 public virtual LogicalBinary_i
647 FunctorType GetFunctorType();
653 Description : Logical OR
655 class SMESH_I_EXPORT LogicalOR_i: public virtual POA_SMESH::LogicalOR,
656 public virtual LogicalBinary_i
660 FunctorType GetFunctorType();
667 class SMESH_I_EXPORT Filter_i: public virtual POA_SMESH::Filter,
668 public virtual SALOME::GenericObj_i
676 SetPredicate( Predicate_ptr );
680 SetMesh( SMESH_Mesh_ptr );
688 GetElementsId( Predicate_i*,
690 Controls::Filter::TIdSequence& );
693 GetElementsId( Predicate_i*,
695 Controls::Filter::TIdSequence& );
699 GetElementsId( SMESH_Mesh_ptr );
707 GetCriteria( SMESH::Filter::Criteria_out theCriteria );
711 SetCriteria( const SMESH::Filter::Criteria& theCriteria );
717 Predicate_i* GetPredicate_i();
720 Controls::Filter myFilter;
721 Predicate_i* myPredicate;
722 SMESH_Mesh_var myMesh;
729 class SMESH_I_EXPORT FilterLibrary_i: public virtual POA_SMESH::FilterLibrary,
730 public virtual SALOME::GenericObj_i
733 FilterLibrary_i( const char* theFileName );
737 Filter_ptr Copy( const char* theFilterName );
739 CORBA::Boolean Add ( const char* theFilterName, Filter_ptr theFilter );
740 CORBA::Boolean AddEmpty( const char* theFilterName, ElementType theType );
741 CORBA::Boolean Delete ( const char* theFilterName );
742 CORBA::Boolean Replace ( const char* theFilterName,
743 const char* theNewName,
744 Filter_ptr theFilter );
746 CORBA::Boolean Save();
747 CORBA::Boolean SaveAs( const char* aFileName );
749 CORBA::Boolean IsPresent( const char* aFilterName );
750 CORBA::Long NbFilters( ElementType );
751 string_array* GetNames( ElementType );
752 string_array* GetAllNames();
753 void SetFileName( const char* theFileName );
759 FilterManager_var myFilterMgr;
767 class SMESH_I_EXPORT FilterManager_i: public virtual POA_SMESH::FilterManager,
768 public virtual SALOME::GenericObj_i
774 MinimumAngle_ptr CreateMinimumAngle();
775 AspectRatio_ptr CreateAspectRatio();
776 AspectRatio3D_ptr CreateAspectRatio3D();
777 Warping_ptr CreateWarping();
778 Taper_ptr CreateTaper();
779 Skew_ptr CreateSkew();
780 Area_ptr CreateArea();
781 Volume3D_ptr CreateVolume3D();
782 Length_ptr CreateLength();
783 Length2D_ptr CreateLength2D();
784 MultiConnection_ptr CreateMultiConnection();
785 MultiConnection2D_ptr CreateMultiConnection2D();
787 BelongToGeom_ptr CreateBelongToGeom();
788 BelongToPlane_ptr CreateBelongToPlane();
789 BelongToCylinder_ptr CreateBelongToCylinder();
790 BelongToGenSurface_ptr CreateBelongToGenSurface();
792 LyingOnGeom_ptr CreateLyingOnGeom();
794 FreeBorders_ptr CreateFreeBorders();
795 FreeEdges_ptr CreateFreeEdges();
797 RangeOfIds_ptr CreateRangeOfIds();
799 BadOrientedVolume_ptr CreateBadOrientedVolume();
801 LessThan_ptr CreateLessThan();
802 MoreThan_ptr CreateMoreThan();
803 EqualTo_ptr CreateEqualTo();
805 LogicalNOT_ptr CreateLogicalNOT();
806 LogicalAND_ptr CreateLogicalAND();
807 LogicalOR_ptr CreateLogicalOR();
809 Filter_ptr CreateFilter();
811 FilterLibrary_ptr LoadLibrary( const char* aFileName );
812 FilterLibrary_ptr CreateLibrary();
813 CORBA::Boolean DeleteLibrary( const char* aFileName );
818 GetPredicate( SMESH::Predicate_ptr thePredicate );