1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
22 // File : SMESH_Pattern.idl
23 // Created : Mon Aug 2 10:48:36 2004
24 // Author : Edward AGAPOV (eap)
27 #ifndef _SMESH_PATTERN_IDL_
28 #define _SMESH_PATTERN_IDL_
30 #include "SMESH_Mesh.idl"
35 typedef sequence<SMESH::PointStruct> point_array;
38 * SMESH_Pattern: interface of mesh pattern
40 interface SMESH_Pattern {
43 * Load a pattern from the string <theFileContents>
45 boolean LoadFromFile(in string theFileContents);
48 * Create a pattern from the mesh built on <theFace>.
49 * <theProject>==true makes override nodes positions
50 * on <theFace> computed by mesher
52 boolean LoadFromFace(in SMESH_Mesh theMesh,
53 in GEOM::GEOM_Object theFace,
54 in boolean theProject);
57 * Create a pattern from the mesh built on <theBlock>
59 boolean LoadFrom3DBlock(in SMESH_Mesh theMesh,
60 in GEOM::GEOM_Object theBlock);
63 * Compute nodes coordinates applying
64 * the loaded pattern to <theFace>. The first key-point
65 * will be mapped into <theVertexOnKeyPoint1>, which must
66 * be in the outer wire of theFace
68 point_array ApplyToFace(in GEOM::GEOM_Object theFace,
69 in GEOM::GEOM_Object theVertexOnKeyPoint1,
70 in boolean theReverse);
73 * Compute nodes coordinates applying
74 * the loaded pattern to <theBlock>. The (0,0,0) key-point
75 * will be mapped into <theVertex000>. The (0,0,1)
76 * key-point will be mapped into <theVertex001>.
78 point_array ApplyTo3DBlock(in GEOM::GEOM_Object theBlock,
79 in GEOM::GEOM_Object theVertex000,
80 in GEOM::GEOM_Object theVertex001);
83 * Compute nodes coordinates applying
84 * the loaded pattern to mesh faces. The first key-point
85 * will be mapped into <theNodeIndexOnKeyPoint1>-th node of each face
87 point_array ApplyToMeshFaces(in SMESH_Mesh theMesh,
88 in long_array theFacesIDs,
89 in long theNodeIndexOnKeyPoint1,
90 in boolean theReverse);
93 * Compute nodes coordinates applying
94 * the loaded pattern to hexahedrons. The (0,0,0) key-point
95 * will be mapped into <theNode000Index>-th node of each volume.
96 * The (0,0,1) key-point will be mapped into <theNode001Index>-th
97 * node of each volume.
99 point_array ApplyToHexahedrons(in SMESH_Mesh theMesh,
100 in long_array theVolumesIDs,
101 in long theNode000Index,
102 in long theNode001Index);
105 * Create nodes and elements in <theMesh> using nodes
106 * coordinates computed by either of Apply...() methods
108 boolean MakeMesh(in SMESH_Mesh theMesh);
111 * Return the loaded pattern in the string form to be saved in file
116 * error code of the last of one of above operations
121 ERR_READ_NB_POINTS, // couldn't read nb of points
122 ERR_READ_POINT_COORDS, // invalid nb of point coordinates
123 ERR_READ_TOO_FEW_POINTS, // too few points in a pattern
124 ERR_READ_3D_COORD, // coordinate of 3D point out of [0,1] range
125 ERR_READ_NO_KEYPOINT, // no key-points in 2D pattern
126 ERR_READ_BAD_INDEX, // invalid point index
127 ERR_READ_ELEM_POINTS, // invalid nb of points in element
128 ERR_READ_NO_ELEMS, // no elements in a pattern
129 ERR_READ_BAD_KEY_POINT, // a key-point not on a boundary
131 ERR_SAVE_NOT_LOADED, // pattern was not loaded
133 ERR_LOAD_EMPTY_SUBMESH, // no elements to load
135 ERR_LOADF_NARROW_FACE, // too narrow face
136 ERR_LOADF_CLOSED_FACE, // closed face
138 ERR_LOADV_BAD_SHAPE, // volume is not a brick of 6 faces
139 ERR_LOADV_COMPUTE_PARAMS, // cant compute point parameters
141 ERR_APPL_NOT_LOADED, // pattern was not loaded
142 ERR_APPL_BAD_DIMENTION, // wrong shape dimention
143 ERR_APPL_BAD_NB_VERTICES, // keypoints - vertices mismatch
145 ERR_APPLF_BAD_TOPOLOGY, // bad pattern topology
146 ERR_APPLF_BAD_VERTEX, // first vertex not on an outer face boundary
147 ERR_APPLF_INTERNAL_EEROR, // program error
149 ERR_APPLV_BAD_SHAPE, // volume is not a brick of 6 faces
151 ERR_MAKEM_NOT_COMPUTED // mapping failed
155 * Return error code of the last operation
157 ErrorCode GetErrorCode();
160 * Return true if the loaded pattern is a 2D one
165 * Return coordinates of pattern points
167 point_array GetPoints();
170 * Return indices of key-points within the arrays returned by
173 long_array GetKeyPoints();
176 * Return nodal connectivity of the elements of the pattern
177 * or of all elements to be crated
179 array_of_long_array GetElementPoints(in boolean all);