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( 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 SMESHDS_Mesh* GetMeshDS();
71 SMESHDS_Mesh* myMeshDS;
72 SMDSAbs_ElementType myType;
74 typedef boost::shared_ptr<BelongToGeom> BelongToGeomPtr;
83 Description : An abstact class for all functors
85 class Functor_i: public virtual POA_SMESH::Functor,
86 public virtual SALOME::GenericObj_i
89 void SetMesh( SMESH_Mesh_ptr theMesh );
90 Controls::FunctorPtr GetFunctor(){ return myFunctorPtr;}
91 ElementType GetElementType();
96 Controls::FunctorPtr myFunctorPtr;
101 Class : NumericalFunctor_i
102 Description : Base class for numerical functors
104 class NumericalFunctor_i: public virtual POA_SMESH::NumericalFunctor,
105 public virtual Functor_i
108 CORBA::Double GetValue( CORBA::Long theElementId );
109 void SetPrecision( CORBA::Long thePrecision );
110 CORBA::Long GetPrecision();
111 Controls::NumericalFunctorPtr GetNumericalFunctor();
114 Controls::NumericalFunctorPtr myNumericalFunctorPtr;
119 Class : SMESH_MinimumAngleFunct
120 Description : Functor for calculation of minimum angle
122 class MinimumAngle_i: public virtual POA_SMESH::MinimumAngle,
123 public virtual NumericalFunctor_i
127 FunctorType GetFunctorType();
132 Class : AspectRatio_i
133 Description : Functor for calculating aspect ratio
135 class AspectRatio_i: public virtual POA_SMESH::AspectRatio,
136 public virtual NumericalFunctor_i
140 FunctorType GetFunctorType();
145 Class : AspectRatio3D_i
146 Description : Functor for calculating aspect ratio for 3D
148 class AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D,
149 public virtual NumericalFunctor_i
153 FunctorType GetFunctorType();
159 Description : Functor for calculating warping
161 class Warping_i: public virtual POA_SMESH::Warping,
162 public virtual NumericalFunctor_i
166 FunctorType GetFunctorType();
172 Description : Functor for calculating taper
174 class Taper_i: public virtual POA_SMESH::Taper,
175 public virtual NumericalFunctor_i
179 FunctorType GetFunctorType();
185 Description : Functor for calculating skew in degrees
187 class Skew_i: public virtual POA_SMESH::Skew,
188 public virtual NumericalFunctor_i
192 FunctorType GetFunctorType();
198 Description : Functor for calculating area
200 class Area_i: public virtual POA_SMESH::Area,
201 public virtual NumericalFunctor_i
205 FunctorType GetFunctorType();
211 Description : Functor for calculating length of edge
213 class Length_i: public virtual POA_SMESH::Length,
214 public virtual NumericalFunctor_i
218 FunctorType GetFunctorType();
223 Description : Functor for calculating length of edge
225 class Length2D_i: public virtual POA_SMESH::Length2D,
226 public virtual NumericalFunctor_i
230 SMESH::Length2D::Values* GetValues();
231 FunctorType GetFunctorType();
234 Controls::Length2DPtr myLength2DPtr;
239 Class : MultiConnection_i
240 Description : Functor for calculating number of faces conneted to the edge
242 class MultiConnection_i: public virtual POA_SMESH::MultiConnection,
243 public virtual NumericalFunctor_i
247 FunctorType GetFunctorType();
256 Description : Base class for all predicates
258 class Predicate_i: public virtual POA_SMESH::Predicate,
259 public virtual Functor_i
262 CORBA::Boolean IsSatisfy( CORBA::Long theElementId );
263 Controls::PredicatePtr GetPredicate();
266 Controls::PredicatePtr myPredicatePtr;
271 Class : BelongToGeom_i
272 Description : Predicate for selection on geometrical support
274 class BelongToGeom_i: public virtual POA_SMESH::BelongToGeom,
275 public virtual Predicate_i
279 virtual ~BelongToGeom_i();
281 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
282 void SetElementType( ElementType theType );
283 FunctorType GetFunctorType();
285 void SetGeom( const TopoDS_Shape& theShape );
287 void SetShapeName( const char* theName );
288 char* GetShapeName();
291 Controls::BelongToGeomPtr myBelongToGeomPtr;
296 Class : BelongToSurface_i
297 Description : Verify whether mesh element lie in pointed Geom planar object
299 class BelongToSurface_i: public virtual POA_SMESH::BelongToSurface,
300 public virtual Predicate_i
303 BelongToSurface_i( const Handle(Standard_Type)& );
304 virtual ~BelongToSurface_i();
306 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
308 void SetShapeName( const char* theName, ElementType theType );
309 char* GetShapeName();
311 void SetTolerance( CORBA::Double );
312 CORBA::Double GetTolerance();
315 Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr;
317 Handle(Standard_Type) mySurfaceType;
321 Class : BelongToPlane_i
322 Description : Verify whether mesh element lie in pointed Geom planar object
324 class BelongToPlane_i: public virtual POA_SMESH::BelongToPlane,
325 public virtual BelongToSurface_i
329 void SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
330 FunctorType GetFunctorType();
334 Class : BelongToCylinder_i
335 Description : Verify whether mesh element lie in pointed Geom cylindrical object
337 class BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder,
338 public virtual BelongToSurface_i
341 BelongToCylinder_i();
342 void SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
343 FunctorType GetFunctorType();
348 Class : FreeBorders_i
349 Description : Predicate for free borders
351 class FreeBorders_i: public virtual POA_SMESH::FreeBorders,
352 public virtual Predicate_i
356 FunctorType GetFunctorType();
362 Description : Predicate for free edges
364 class FreeEdges_i: public virtual POA_SMESH::FreeEdges,
365 public virtual Predicate_i
369 SMESH::FreeEdges::Borders* GetBorders();
370 FunctorType GetFunctorType();
373 Controls::FreeEdgesPtr myFreeEdgesPtr;
379 Description : Predicate for Range of Ids
381 class RangeOfIds_i: public virtual POA_SMESH::RangeOfIds,
382 public virtual Predicate_i
386 void SetRange( const SMESH::long_array& theIds );
387 CORBA::Boolean SetRangeStr( const char* theRange );
390 void SetElementType( ElementType theType );
391 FunctorType GetFunctorType();
394 Controls::RangeOfIdsPtr myRangeOfIdsPtr;
399 Description : Base class for comparators
401 class Comparator_i: public virtual POA_SMESH::Comparator,
402 public virtual Predicate_i
405 virtual ~Comparator_i();
407 virtual void SetMargin( CORBA::Double );
408 virtual void SetNumFunctor( NumericalFunctor_ptr );
410 Controls::ComparatorPtr GetComparator();
411 NumericalFunctor_i* GetNumFunctor_i();
412 CORBA::Double GetMargin();
417 Controls::ComparatorPtr myComparatorPtr;
418 NumericalFunctor_i* myNumericalFunctor;
424 Description : Comparator "<"
426 class LessThan_i: public virtual POA_SMESH::LessThan,
427 public virtual Comparator_i
431 FunctorType GetFunctorType();
437 Description : Comparator ">"
439 class MoreThan_i: public virtual POA_SMESH::MoreThan,
440 public virtual Comparator_i
444 FunctorType GetFunctorType();
450 Description : Comparator "="
452 class EqualTo_i: public virtual POA_SMESH::EqualTo,
453 public virtual Comparator_i
457 virtual void SetTolerance( CORBA::Double );
458 CORBA::Double GetTolerance();
459 FunctorType GetFunctorType();
462 Controls::EqualToPtr myEqualToPtr;
468 Description : Logical NOT predicate
470 class LogicalNOT_i: public virtual POA_SMESH::LogicalNOT,
471 public virtual Predicate_i
475 virtual ~LogicalNOT_i();
477 virtual void SetPredicate( Predicate_ptr );
478 Predicate_i* GetPredicate_i();
479 FunctorType GetFunctorType();
482 Controls::LogicalNOTPtr myLogicalNOTPtr;
483 Predicate_i* myPredicate;
488 Class : LogicalBinary_i
489 Description : Base class for binary logical predicate
491 class LogicalBinary_i: public virtual POA_SMESH::LogicalBinary,
492 public virtual Predicate_i
495 virtual ~LogicalBinary_i();
496 virtual void SetMesh( SMESH_Mesh_ptr theMesh );
497 virtual void SetPredicate1( Predicate_ptr );
498 virtual void SetPredicate2( Predicate_ptr );
500 Controls::LogicalBinaryPtr GetLogicalBinary();
501 Predicate_i* GetPredicate1_i();
502 Predicate_i* GetPredicate2_i();
507 Controls::LogicalBinaryPtr myLogicalBinaryPtr;
508 Predicate_i* myPredicate1;
509 Predicate_i* myPredicate2;
515 Description : Logical AND
517 class LogicalAND_i: public virtual POA_SMESH::LogicalAND,
518 public virtual LogicalBinary_i
522 FunctorType GetFunctorType();
528 Description : Logical OR
530 class LogicalOR_i: public virtual POA_SMESH::LogicalOR,
531 public virtual LogicalBinary_i
535 FunctorType GetFunctorType();
542 class Filter_i: public virtual POA_SMESH::Filter,
543 public virtual SALOME::GenericObj_i
549 void SetPredicate( Predicate_ptr );
550 void SetMesh( SMESH_Mesh_ptr );
552 long_array* GetElementsId( SMESH_Mesh_ptr );
553 ElementType GetElementType();
555 CORBA::Boolean GetCriteria( SMESH::Filter::Criteria_out theCriteria );
556 CORBA::Boolean SetCriteria( const SMESH::Filter::Criteria& theCriteria );
558 Predicate_ptr GetPredicate();
559 Predicate_i* GetPredicate_i();
562 Controls::Filter myFilter;
563 Predicate_i* myPredicate;
570 class FilterLibrary_i: public virtual POA_SMESH::FilterLibrary,
571 public virtual SALOME::GenericObj_i
574 FilterLibrary_i( const char* theFileName );
578 Filter_ptr Copy( const char* theFilterName );
580 CORBA::Boolean Add ( const char* theFilterName, Filter_ptr theFilter );
581 CORBA::Boolean AddEmpty( const char* theFilterName, ElementType theType );
582 CORBA::Boolean Delete ( const char* theFilterName );
583 CORBA::Boolean Replace ( const char* theFilterName,
584 const char* theNewName,
585 Filter_ptr theFilter );
587 CORBA::Boolean Save();
588 CORBA::Boolean SaveAs( const char* aFileName );
590 CORBA::Boolean IsPresent( const char* aFilterName );
591 CORBA::Long NbFilters( ElementType );
592 string_array* GetNames( ElementType );
593 string_array* GetAllNames();
594 void SetFileName( const char* theFileName );
600 FilterManager_var myFilterMgr;
608 class FilterManager_i: public virtual POA_SMESH::FilterManager,
609 public virtual SALOME::GenericObj_i
613 MinimumAngle_ptr CreateMinimumAngle();
614 AspectRatio_ptr CreateAspectRatio();
615 AspectRatio3D_ptr CreateAspectRatio3D();
616 Warping_ptr CreateWarping();
617 Taper_ptr CreateTaper();
618 Skew_ptr CreateSkew();
619 Area_ptr CreateArea();
620 Length_ptr CreateLength();
621 Length2D_ptr CreateLength2D();
622 MultiConnection_ptr CreateMultiConnection();
624 BelongToGeom_ptr CreateBelongToGeom();
625 BelongToPlane_ptr CreateBelongToPlane();
626 BelongToCylinder_ptr CreateBelongToCylinder();
628 FreeBorders_ptr CreateFreeBorders();
629 FreeEdges_ptr CreateFreeEdges();
631 RangeOfIds_ptr CreateRangeOfIds();
633 LessThan_ptr CreateLessThan();
634 MoreThan_ptr CreateMoreThan();
635 EqualTo_ptr CreateEqualTo();
637 LogicalNOT_ptr CreateLogicalNOT();
638 LogicalAND_ptr CreateLogicalAND();
639 LogicalOR_ptr CreateLogicalOR();
641 Filter_ptr CreateFilter();
643 FilterLibrary_ptr LoadLibrary( const char* aFileName );
644 FilterLibrary_ptr CreateLibrary();
645 CORBA::Boolean DeleteLibrary( const char* aFileName );