Salome HOME
Merge from V6_3_BR 06/06/2011
[modules/smesh.git] / idl / SMESH_Group.idl
1 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  File   : SMESH_Group.idl
24 //  Author : Sergey ANIKIN, OCC
25 //  $Header$
26 //
27 #ifndef _SMESH_GROUP_IDL_
28 #define _SMESH_GROUP_IDL_
29
30 #include "SALOME_Exception.idl"
31 #include "SALOME_GenericObj.idl"
32 #include "SALOMEDS_Attributes.idl"
33
34 #include "SMESH_Mesh.idl"
35
36 module SMESH
37 {
38   interface Predicate;
39
40   /*!
41    * SMESH_Group: base interface of group object
42    */
43   interface SMESH_GroupBase : SALOME::GenericObj, SMESH_IDSource
44   {
45     /*!
46      * Sets group name
47      */
48     void SetName( in string name );
49
50     /*!
51      * Returns group name
52      */
53     string GetName();
54
55     /*!
56      * Returns group type (type of elements in the group)
57      */
58     ElementType GetType();
59
60     /*!
61      * Returns the number of elements in the group
62      */
63     long Size();
64
65     /*!
66      * Returns true if the group does not contain any elements
67      */
68     boolean IsEmpty();
69
70     /*!
71      * returns true if the group contains an element with ID == <elem_id> 
72      */
73     boolean Contains( in long elem_id );
74
75     /*!
76      * Returns ID of an element at position <elem_index>
77      */
78     long GetID( in long elem_index );
79
80     /*!
81      * Returns a sequence of all element IDs in the group
82      */
83     long_array GetListOfID();
84
85     /*!
86      * Sets group color
87      */
88     void SetColor(in SALOMEDS::Color theColor);
89
90     /*!
91      * Returns group color
92      */
93     SALOMEDS::Color GetColor();
94
95     /*!
96      * Sets group color number
97      * (corresponds to the "hue" parameter of the color - must be in range [0, 360])
98      */
99     void SetColorNumber( in long color );
100
101     /*!
102      * Returns group color number (obsolete - use GetColor instead)
103      * (corresponds to the "hue" parameter of the color - must be in range [0, 360])
104      */
105     long GetColorNumber();
106   }; 
107
108   /*!
109    * SMESH_Group: interface of group object
110    */
111   interface SMESH_Group : SMESH_GroupBase
112   {
113     /*!
114      * Clears the group's contents
115      */
116     void Clear();
117
118     /*!
119      * Adds elements or nodes with specified identifiers to the group
120      */
121     long Add( in long_array elem_ids );
122     /*!
123      * Adds elements or nodes that match specified predicate to the group
124      */
125     long AddByPredicate( in Predicate thePredicate );
126     /*!
127      * Add all elements or nodes from the specified source to the group
128      */
129     long AddFrom( in SMESH_IDSource theSource );
130
131     /*!
132      * Removes elements or nodes with specified identifiers from the group
133      */
134     long Remove( in long_array elem_ids );
135     /*!
136      * Removes elements or nodes that match specified predicate from the group
137      */
138     long RemoveByPredicate( in Predicate thePredicate );
139
140   };
141   /*!
142    * SMESH_Group: interface of group object linked to geometry
143    */
144   interface SMESH_GroupOnGeom : SMESH_GroupBase
145   {
146     GEOM::GEOM_Object GetShape();
147   };
148
149 };
150
151
152 #endif