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_Controls.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();
146 Description : Functor for calculating warping
148 class Warping_i: public virtual POA_SMESH::Warping,
149 public virtual NumericalFunctor_i
153 FunctorType GetFunctorType();
159 Description : Functor for calculating taper
161 class Taper_i: public virtual POA_SMESH::Taper,
162 public virtual NumericalFunctor_i
166 FunctorType GetFunctorType();
172 Description : Functor for calculating skew in degrees
174 class Skew_i: public virtual POA_SMESH::Skew,
175 public virtual NumericalFunctor_i
179 FunctorType GetFunctorType();
185 Description : Functor for calculating area
187 class Area_i: public virtual POA_SMESH::Area,
188 public virtual NumericalFunctor_i
192 FunctorType GetFunctorType();
198 Description : Functor for calculating length of edge
200 class Length_i: public virtual POA_SMESH::Length,
201 public virtual NumericalFunctor_i
205 FunctorType GetFunctorType();
210 Class : MultiConnection_i
211 Description : Functor for calculating number of faces conneted to the edge
213 class MultiConnection_i: public virtual POA_SMESH::MultiConnection,
214 public virtual NumericalFunctor_i
218 FunctorType GetFunctorType();
227 Description : Base class for all predicates
229 class Predicate_i: public virtual POA_SMESH::Predicate,
230 public virtual Functor_i
233 CORBA::Boolean IsSatisfy( CORBA::Long theElementId );
234 Controls::PredicatePtr GetPredicate();
237 Controls::PredicatePtr myPredicatePtr;
242 Class : BelongToGeom_i
243 Description : Predicate for selection on geometrical support
245 class BelongToGeom_i: public virtual POA_SMESH::BelongToGeom,
246 public virtual Predicate_i
250 virtual ~BelongToGeom_i();
252 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
253 void SetElementType( ElementType theType );
254 FunctorType GetFunctorType();
256 void SetGeom( const TopoDS_Shape& theShape );
258 void SetShapeName( const char* theName );
259 char* GetShapeName();
262 Controls::BelongToGeomPtr myBelongToGeomPtr;
267 Class : BelongToSurface_i
268 Description : Verify whether mesh element lie in pointed Geom planar object
270 class BelongToSurface_i: public virtual POA_SMESH::BelongToSurface,
271 public virtual Predicate_i
274 BelongToSurface_i( const Handle(Standard_Type)& );
275 virtual ~BelongToSurface_i();
277 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
279 void SetShapeName( const char* theName, ElementType theType );
280 char* GetShapeName();
282 void SetTolerance( CORBA::Double );
283 CORBA::Double GetTolerance();
286 Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr;
288 Handle(Standard_Type) mySurfaceType;
292 Class : BelongToPlane_i
293 Description : Verify whether mesh element lie in pointed Geom planar object
295 class BelongToPlane_i: public virtual POA_SMESH::BelongToPlane,
296 public virtual BelongToSurface_i
300 void SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
301 FunctorType GetFunctorType();
305 Class : BelongToCylinder_i
306 Description : Verify whether mesh element lie in pointed Geom cylindrical object
308 class BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder,
309 public virtual BelongToSurface_i
312 BelongToCylinder_i();
313 void SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
314 FunctorType GetFunctorType();
319 Class : FreeBorders_i
320 Description : Predicate for free borders
322 class FreeBorders_i: public virtual POA_SMESH::FreeBorders,
323 public virtual Predicate_i
327 FunctorType GetFunctorType();
333 Description : Predicate for free edges
335 class FreeEdges_i: public virtual POA_SMESH::FreeEdges,
336 public virtual Predicate_i
340 SMESH::FreeEdges::Borders* GetBorders();
341 FunctorType GetFunctorType();
344 Controls::FreeEdgesPtr myFreeEdgesPtr;
350 Description : Predicate for Range of Ids
352 class RangeOfIds_i: public virtual POA_SMESH::RangeOfIds,
353 public virtual Predicate_i
357 void SetRange( const SMESH::long_array& theIds );
358 CORBA::Boolean SetRangeStr( const char* theRange );
361 void SetElementType( ElementType theType );
362 FunctorType GetFunctorType();
365 Controls::RangeOfIdsPtr myRangeOfIdsPtr;
370 Description : Base class for comparators
372 class Comparator_i: public virtual POA_SMESH::Comparator,
373 public virtual Predicate_i
376 virtual ~Comparator_i();
378 virtual void SetMargin( CORBA::Double );
379 virtual void SetNumFunctor( NumericalFunctor_ptr );
381 Controls::ComparatorPtr GetComparator();
382 NumericalFunctor_i* GetNumFunctor_i();
383 CORBA::Double GetMargin();
388 Controls::ComparatorPtr myComparatorPtr;
389 NumericalFunctor_i* myNumericalFunctor;
395 Description : Comparator "<"
397 class LessThan_i: public virtual POA_SMESH::LessThan,
398 public virtual Comparator_i
402 FunctorType GetFunctorType();
408 Description : Comparator ">"
410 class MoreThan_i: public virtual POA_SMESH::MoreThan,
411 public virtual Comparator_i
415 FunctorType GetFunctorType();
421 Description : Comparator "="
423 class EqualTo_i: public virtual POA_SMESH::EqualTo,
424 public virtual Comparator_i
428 virtual void SetTolerance( CORBA::Double );
429 CORBA::Double GetTolerance();
430 FunctorType GetFunctorType();
433 Controls::EqualToPtr myEqualToPtr;
439 Description : Logical NOT predicate
441 class LogicalNOT_i: public virtual POA_SMESH::LogicalNOT,
442 public virtual Predicate_i
446 virtual ~LogicalNOT_i();
448 virtual void SetPredicate( Predicate_ptr );
449 Predicate_i* GetPredicate_i();
450 FunctorType GetFunctorType();
453 Controls::LogicalNOTPtr myLogicalNOTPtr;
454 Predicate_i* myPredicate;
459 Class : LogicalBinary_i
460 Description : Base class for binary logical predicate
462 class LogicalBinary_i: public virtual POA_SMESH::LogicalBinary,
463 public virtual Predicate_i
466 virtual ~LogicalBinary_i();
467 virtual void SetMesh( SMESH_Mesh_ptr theMesh );
468 virtual void SetPredicate1( Predicate_ptr );
469 virtual void SetPredicate2( Predicate_ptr );
471 Controls::LogicalBinaryPtr GetLogicalBinary();
472 Predicate_i* GetPredicate1_i();
473 Predicate_i* GetPredicate2_i();
478 Controls::LogicalBinaryPtr myLogicalBinaryPtr;
479 Predicate_i* myPredicate1;
480 Predicate_i* myPredicate2;
486 Description : Logical AND
488 class LogicalAND_i: public virtual POA_SMESH::LogicalAND,
489 public virtual LogicalBinary_i
493 FunctorType GetFunctorType();
499 Description : Logical OR
501 class LogicalOR_i: public virtual POA_SMESH::LogicalOR,
502 public virtual LogicalBinary_i
506 FunctorType GetFunctorType();
513 class Filter_i: public virtual POA_SMESH::Filter,
514 public virtual SALOME::GenericObj_i
520 void SetPredicate( Predicate_ptr );
521 void SetMesh( SMESH_Mesh_ptr );
523 long_array* GetElementsId( SMESH_Mesh_ptr );
524 ElementType GetElementType();
526 CORBA::Boolean GetCriteria( SMESH::Filter::Criteria_out theCriteria );
527 CORBA::Boolean SetCriteria( const SMESH::Filter::Criteria& theCriteria );
529 Predicate_ptr GetPredicate();
530 Predicate_i* GetPredicate_i();
533 Controls::Filter myFilter;
534 Predicate_i* myPredicate;
541 class FilterLibrary_i: public virtual POA_SMESH::FilterLibrary,
542 public virtual SALOME::GenericObj_i
545 FilterLibrary_i( const char* theFileName );
549 Filter_ptr Copy( const char* theFilterName );
551 CORBA::Boolean Add ( const char* theFilterName, Filter_ptr theFilter );
552 CORBA::Boolean AddEmpty( const char* theFilterName, ElementType theType );
553 CORBA::Boolean Delete ( const char* theFilterName );
554 CORBA::Boolean Replace ( const char* theFilterName,
555 const char* theNewName,
556 Filter_ptr theFilter );
558 CORBA::Boolean Save();
559 CORBA::Boolean SaveAs( const char* aFileName );
561 CORBA::Boolean IsPresent( const char* aFilterName );
562 CORBA::Long NbFilters( ElementType );
563 string_array* GetNames( ElementType );
564 string_array* GetAllNames();
565 void SetFileName( const char* theFileName );
571 FilterManager_var myFilterMgr;
579 class FilterManager_i: public virtual POA_SMESH::FilterManager,
580 public virtual SALOME::GenericObj_i
584 MinimumAngle_ptr CreateMinimumAngle();
585 AspectRatio_ptr CreateAspectRatio();
586 Warping_ptr CreateWarping();
587 Taper_ptr CreateTaper();
588 Skew_ptr CreateSkew();
589 Area_ptr CreateArea();
590 Length_ptr CreateLength();
591 MultiConnection_ptr CreateMultiConnection();
593 BelongToGeom_ptr CreateBelongToGeom();
594 BelongToPlane_ptr CreateBelongToPlane();
595 BelongToCylinder_ptr CreateBelongToCylinder();
597 FreeBorders_ptr CreateFreeBorders();
598 FreeEdges_ptr CreateFreeEdges();
600 RangeOfIds_ptr CreateRangeOfIds();
602 LessThan_ptr CreateLessThan();
603 MoreThan_ptr CreateMoreThan();
604 EqualTo_ptr CreateEqualTo();
606 LogicalNOT_ptr CreateLogicalNOT();
607 LogicalAND_ptr CreateLogicalAND();
608 LogicalOR_ptr CreateLogicalOR();
610 Filter_ptr CreateFilter();
612 FilterLibrary_ptr LoadLibrary( const char* aFileName );
613 FilterLibrary_ptr CreateLibrary();
614 CORBA::Boolean DeleteLibrary( const char* aFileName );