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( const 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 const SMESHDS_Mesh* GetMeshDS() const;
71 const SMESHDS_Mesh* myMeshDS;
72 SMDSAbs_ElementType myType;
74 typedef boost::shared_ptr<BelongToGeom> BelongToGeomPtr;
78 Description : Predicate for verifying whether entiy lying or partially lying on
79 specified geometrical support
81 class LyingOnGeom: public virtual Predicate
86 virtual void SetMesh( const SMDS_Mesh* theMesh );
87 virtual void SetGeom( const TopoDS_Shape& theShape );
89 virtual bool IsSatisfy( long theElementId );
91 virtual void SetType( SMDSAbs_ElementType theType );
92 virtual SMDSAbs_ElementType GetType() const;
94 TopoDS_Shape GetShape();
95 const SMESHDS_Mesh* GetMeshDS() const;
97 virtual bool Contains( const SMESHDS_Mesh* theMeshDS,
98 const TopoDS_Shape& theShape,
99 const SMDS_MeshElement* theElem,
100 TopAbs_ShapeEnum theFindShapeEnum,
101 TopAbs_ShapeEnum theAvoidShapeEnum = TopAbs_SHAPE );
103 TopoDS_Shape myShape;
104 const SMESHDS_Mesh* myMeshDS;
105 SMDSAbs_ElementType myType;
107 typedef boost::shared_ptr<LyingOnGeom> LyingOnGeomPtr;
116 Description : An abstact class for all functors
118 class Functor_i: public virtual POA_SMESH::Functor,
119 public virtual SALOME::GenericObj_i
122 void SetMesh( SMESH_Mesh_ptr theMesh );
123 Controls::FunctorPtr GetFunctor(){ return myFunctorPtr;}
124 ElementType GetElementType();
130 Controls::FunctorPtr myFunctorPtr;
134 Class : NumericalFunctor_i
135 Description : Base class for numerical functors
137 class NumericalFunctor_i: public virtual POA_SMESH::NumericalFunctor,
138 public virtual Functor_i
141 CORBA::Double GetValue( CORBA::Long theElementId );
142 void SetPrecision( CORBA::Long thePrecision );
143 CORBA::Long GetPrecision();
144 Controls::NumericalFunctorPtr GetNumericalFunctor();
147 Controls::NumericalFunctorPtr myNumericalFunctorPtr;
152 Class : SMESH_MinimumAngleFunct
153 Description : Functor for calculation of minimum angle
155 class MinimumAngle_i: public virtual POA_SMESH::MinimumAngle,
156 public virtual NumericalFunctor_i
160 FunctorType GetFunctorType();
165 Class : AspectRatio_i
166 Description : Functor for calculating aspect ratio
168 class AspectRatio_i: public virtual POA_SMESH::AspectRatio,
169 public virtual NumericalFunctor_i
173 FunctorType GetFunctorType();
178 Class : AspectRatio3D_i
179 Description : Functor for calculating aspect ratio for 3D
181 class AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D,
182 public virtual NumericalFunctor_i
186 FunctorType GetFunctorType();
192 Description : Functor for calculating warping
194 class Warping_i: public virtual POA_SMESH::Warping,
195 public virtual NumericalFunctor_i
199 FunctorType GetFunctorType();
205 Description : Functor for calculating taper
207 class Taper_i: public virtual POA_SMESH::Taper,
208 public virtual NumericalFunctor_i
212 FunctorType GetFunctorType();
218 Description : Functor for calculating skew in degrees
220 class Skew_i: public virtual POA_SMESH::Skew,
221 public virtual NumericalFunctor_i
225 FunctorType GetFunctorType();
231 Description : Functor for calculating area
233 class Area_i: public virtual POA_SMESH::Area,
234 public virtual NumericalFunctor_i
238 FunctorType GetFunctorType();
244 Description : Functor for calculating volume of 3D element
246 class Volume3D_i: public virtual POA_SMESH::Volume3D,
247 public virtual NumericalFunctor_i
251 FunctorType GetFunctorType();
257 Description : Functor for calculating length of edge
259 class Length_i: public virtual POA_SMESH::Length,
260 public virtual NumericalFunctor_i
264 FunctorType GetFunctorType();
269 Description : Functor for calculating length of edge
271 class Length2D_i: public virtual POA_SMESH::Length2D,
272 public virtual NumericalFunctor_i
276 SMESH::Length2D::Values* GetValues();
277 FunctorType GetFunctorType();
280 Controls::Length2DPtr myLength2DPtr;
285 Class : MultiConnection_i
286 Description : Functor for calculating number of faces conneted to the edge
288 class MultiConnection_i: public virtual POA_SMESH::MultiConnection,
289 public virtual NumericalFunctor_i
293 FunctorType GetFunctorType();
297 Class : MultiConnection2D_i
298 Description : Functor for calculating number of faces conneted to the edge
300 class MultiConnection2D_i: public virtual POA_SMESH::MultiConnection2D,
301 public virtual NumericalFunctor_i
304 MultiConnection2D_i();
305 SMESH::MultiConnection2D::Values* GetValues();
306 FunctorType GetFunctorType();
309 Controls::MultiConnection2DPtr myMulticonnection2DPtr;
318 Description : Base class for all predicates
320 class Predicate_i: public virtual POA_SMESH::Predicate,
321 public virtual Functor_i
324 CORBA::Boolean IsSatisfy( CORBA::Long theElementId );
325 Controls::PredicatePtr GetPredicate();
328 Controls::PredicatePtr myPredicatePtr;
333 Class : BadOrientedVolume_i
334 Description : Verify whether a mesh volume is incorrectly oriented from
335 the point of view of MED convention
337 class BadOrientedVolume_i: public virtual POA_SMESH::BadOrientedVolume,
338 public virtual Predicate_i
341 BadOrientedVolume_i();
342 FunctorType GetFunctorType();
346 Class : BelongToGeom_i
347 Description : Predicate for selection on geometrical support
349 class BelongToGeom_i: public virtual POA_SMESH::BelongToGeom,
350 public virtual Predicate_i
354 virtual ~BelongToGeom_i();
356 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
357 void SetElementType( ElementType theType );
358 FunctorType GetFunctorType();
360 void SetGeom( const TopoDS_Shape& theShape );
362 void SetShapeName( const char* theName );
363 void SetShape( const char* theID, const char* theName );
364 char* GetShapeName();
368 Controls::BelongToGeomPtr myBelongToGeomPtr;
374 Class : BelongToSurface_i
375 Description : Verify whether mesh element lie in pointed Geom planar object
377 class BelongToSurface_i: public virtual POA_SMESH::BelongToSurface,
378 public virtual Predicate_i
381 BelongToSurface_i( const Handle(Standard_Type)& );
382 virtual ~BelongToSurface_i();
384 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
386 void SetShapeName( const char* theName, ElementType theType );
387 void SetShape( const char* theID, const char* theName, ElementType theType );
388 char* GetShapeName();
391 void SetTolerance( CORBA::Double );
392 CORBA::Double GetTolerance();
395 Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr;
398 Handle(Standard_Type) mySurfaceType;
402 Class : BelongToPlane_i
403 Description : Verify whether mesh element lie in pointed Geom planar object
405 class BelongToPlane_i: public virtual POA_SMESH::BelongToPlane,
406 public virtual BelongToSurface_i
410 void SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
411 FunctorType GetFunctorType();
415 Class : BelongToCylinder_i
416 Description : Verify whether mesh element lie in pointed Geom cylindrical object
418 class BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder,
419 public virtual BelongToSurface_i
422 BelongToCylinder_i();
423 void SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
424 FunctorType GetFunctorType();
428 Class : LyingOnGeom_i
429 Description : Predicate for selection on geometrical support(lying or partially lying)
431 class LyingOnGeom_i: public virtual POA_SMESH::LyingOnGeom,
432 public virtual Predicate_i
436 virtual ~LyingOnGeom_i();
438 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
439 void SetElementType( ElementType theType );
440 FunctorType GetFunctorType();
442 void SetGeom( const TopoDS_Shape& theShape );
444 void SetShapeName( const char* theName );
445 void SetShape( const char* theID, const char* theName );
446 char* GetShapeName();
450 Controls::LyingOnGeomPtr myLyingOnGeomPtr;
456 Class : FreeBorders_i
457 Description : Predicate for free borders
459 class FreeBorders_i: public virtual POA_SMESH::FreeBorders,
460 public virtual Predicate_i
464 FunctorType GetFunctorType();
470 Description : Predicate for free edges
472 class FreeEdges_i: public virtual POA_SMESH::FreeEdges,
473 public virtual Predicate_i
477 SMESH::FreeEdges::Borders* GetBorders();
478 FunctorType GetFunctorType();
481 Controls::FreeEdgesPtr myFreeEdgesPtr;
487 Description : Predicate for Range of Ids
489 class RangeOfIds_i: public virtual POA_SMESH::RangeOfIds,
490 public virtual Predicate_i
494 void SetRange( const SMESH::long_array& theIds );
495 CORBA::Boolean SetRangeStr( const char* theRange );
498 void SetElementType( ElementType theType );
499 FunctorType GetFunctorType();
502 Controls::RangeOfIdsPtr myRangeOfIdsPtr;
507 Description : Base class for comparators
509 class Comparator_i: public virtual POA_SMESH::Comparator,
510 public virtual Predicate_i
513 virtual ~Comparator_i();
515 virtual void SetMargin( CORBA::Double );
516 virtual void SetNumFunctor( NumericalFunctor_ptr );
518 Controls::ComparatorPtr GetComparator();
519 NumericalFunctor_i* GetNumFunctor_i();
520 CORBA::Double GetMargin();
525 Controls::ComparatorPtr myComparatorPtr;
526 NumericalFunctor_i* myNumericalFunctor;
532 Description : Comparator "<"
534 class LessThan_i: public virtual POA_SMESH::LessThan,
535 public virtual Comparator_i
539 FunctorType GetFunctorType();
545 Description : Comparator ">"
547 class MoreThan_i: public virtual POA_SMESH::MoreThan,
548 public virtual Comparator_i
552 FunctorType GetFunctorType();
558 Description : Comparator "="
560 class EqualTo_i: public virtual POA_SMESH::EqualTo,
561 public virtual Comparator_i
565 virtual void SetTolerance( CORBA::Double );
566 CORBA::Double GetTolerance();
567 FunctorType GetFunctorType();
570 Controls::EqualToPtr myEqualToPtr;
576 Description : Logical NOT predicate
578 class LogicalNOT_i: public virtual POA_SMESH::LogicalNOT,
579 public virtual Predicate_i
583 virtual ~LogicalNOT_i();
585 virtual void SetPredicate( Predicate_ptr );
586 Predicate_i* GetPredicate_i();
587 FunctorType GetFunctorType();
590 Controls::LogicalNOTPtr myLogicalNOTPtr;
591 Predicate_i* myPredicate;
596 Class : LogicalBinary_i
597 Description : Base class for binary logical predicate
599 class LogicalBinary_i: public virtual POA_SMESH::LogicalBinary,
600 public virtual Predicate_i
603 virtual ~LogicalBinary_i();
604 virtual void SetMesh( SMESH_Mesh_ptr theMesh );
605 virtual void SetPredicate1( Predicate_ptr );
606 virtual void SetPredicate2( Predicate_ptr );
608 Controls::LogicalBinaryPtr GetLogicalBinary();
609 Predicate_i* GetPredicate1_i();
610 Predicate_i* GetPredicate2_i();
615 Controls::LogicalBinaryPtr myLogicalBinaryPtr;
616 Predicate_i* myPredicate1;
617 Predicate_i* myPredicate2;
623 Description : Logical AND
625 class LogicalAND_i: public virtual POA_SMESH::LogicalAND,
626 public virtual LogicalBinary_i
630 FunctorType GetFunctorType();
636 Description : Logical OR
638 class LogicalOR_i: public virtual POA_SMESH::LogicalOR,
639 public virtual LogicalBinary_i
643 FunctorType GetFunctorType();
650 class Filter_i: public virtual POA_SMESH::Filter,
651 public virtual SALOME::GenericObj_i
659 SetPredicate( Predicate_ptr );
663 SetMesh( SMESH_Mesh_ptr );
671 GetElementsId( Predicate_i*,
673 Controls::Filter::TIdSequence& );
676 GetElementsId( Predicate_i*,
678 Controls::Filter::TIdSequence& );
682 GetElementsId( SMESH_Mesh_ptr );
690 GetCriteria( SMESH::Filter::Criteria_out theCriteria );
694 SetCriteria( const SMESH::Filter::Criteria& theCriteria );
700 Predicate_i* GetPredicate_i();
703 Controls::Filter myFilter;
704 Predicate_i* myPredicate;
705 SMESH_Mesh_var myMesh;
712 class FilterLibrary_i: public virtual POA_SMESH::FilterLibrary,
713 public virtual SALOME::GenericObj_i
716 FilterLibrary_i( const char* theFileName );
720 Filter_ptr Copy( const char* theFilterName );
722 CORBA::Boolean Add ( const char* theFilterName, Filter_ptr theFilter );
723 CORBA::Boolean AddEmpty( const char* theFilterName, ElementType theType );
724 CORBA::Boolean Delete ( const char* theFilterName );
725 CORBA::Boolean Replace ( const char* theFilterName,
726 const char* theNewName,
727 Filter_ptr theFilter );
729 CORBA::Boolean Save();
730 CORBA::Boolean SaveAs( const char* aFileName );
732 CORBA::Boolean IsPresent( const char* aFilterName );
733 CORBA::Long NbFilters( ElementType );
734 string_array* GetNames( ElementType );
735 string_array* GetAllNames();
736 void SetFileName( const char* theFileName );
742 FilterManager_var myFilterMgr;
750 class FilterManager_i: public virtual POA_SMESH::FilterManager,
751 public virtual SALOME::GenericObj_i
757 MinimumAngle_ptr CreateMinimumAngle();
758 AspectRatio_ptr CreateAspectRatio();
759 AspectRatio3D_ptr CreateAspectRatio3D();
760 Warping_ptr CreateWarping();
761 Taper_ptr CreateTaper();
762 Skew_ptr CreateSkew();
763 Area_ptr CreateArea();
764 Volume3D_ptr CreateVolume3D();
765 Length_ptr CreateLength();
766 Length2D_ptr CreateLength2D();
767 MultiConnection_ptr CreateMultiConnection();
768 MultiConnection2D_ptr CreateMultiConnection2D();
770 BelongToGeom_ptr CreateBelongToGeom();
771 BelongToPlane_ptr CreateBelongToPlane();
772 BelongToCylinder_ptr CreateBelongToCylinder();
774 LyingOnGeom_ptr CreateLyingOnGeom();
776 FreeBorders_ptr CreateFreeBorders();
777 FreeEdges_ptr CreateFreeEdges();
779 RangeOfIds_ptr CreateRangeOfIds();
781 BadOrientedVolume_ptr CreateBadOrientedVolume();
783 LessThan_ptr CreateLessThan();
784 MoreThan_ptr CreateMoreThan();
785 EqualTo_ptr CreateEqualTo();
787 LogicalNOT_ptr CreateLogicalNOT();
788 LogicalAND_ptr CreateLogicalAND();
789 LogicalOR_ptr CreateLogicalOR();
791 Filter_ptr CreateFilter();
793 FilterLibrary_ptr LoadLibrary( const char* aFileName );
794 FilterLibrary_ptr CreateLibrary();
795 CORBA::Boolean DeleteLibrary( const char* aFileName );
800 GetPredicate( SMESH::Predicate_ptr thePredicate );