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 * Create nodes and elements in <theMesh> using nodes
84 * coordinates computed by either of Apply...() methods
86 boolean MakeMesh(in SMESH_Mesh theMesh);
89 * Return the loaded pattern in the string form to be saved in file
94 * error code of the last of one of above operations
99 ERR_READ_NB_POINTS, // couldn't read nb of points
100 ERR_READ_POINT_COORDS, // invalid nb of point coordinates
101 ERR_READ_TOO_FEW_POINTS, // too few points in a pattern
102 ERR_READ_3D_COORD, // coordinate of 3D point out of [0,1] range
103 ERR_READ_NO_KEYPOINT, // no key-points in 2D pattern
104 ERR_READ_BAD_INDEX, // invalid point index
105 ERR_READ_ELEM_POINTS, // invalid nb of points in element
106 ERR_READ_NO_ELEMS, // no elements in a pattern
107 ERR_READ_BAD_KEY_POINT, // a key-point not on a boundary
109 ERR_SAVE_NOT_LOADED, // pattern was not loaded
111 ERR_LOAD_EMPTY_SUBMESH, // no elements to load
113 ERR_LOADF_NARROW_FACE, // too narrow face
114 ERR_LOADF_CLOSED_FACE, // closed face
116 ERR_LOADV_BAD_SHAPE, // volume is not a brick of 6 faces
117 ERR_LOADV_COMPUTE_PARAMS, // cant compute point parameters
119 ERR_APPL_NOT_LOADED, // pattern was not loaded
120 ERR_APPL_BAD_DIMENTION, // wrong shape dimention
121 ERR_APPL_BAD_NB_VERTICES, // keypoints - vertices mismatch
123 ERR_APPLF_BAD_TOPOLOGY, // bad pattern topology
124 ERR_APPLF_BAD_VERTEX, // first vertex not on an outer face boundary
125 ERR_APPLF_INTERNAL_EEROR, // program error
127 ERR_APPLV_BAD_SHAPE, // volume is not a brick of 6 faces
129 ERR_MAKEM_NOT_COMPUTED // mapping failed
133 * Return error code of the last operation
135 ErrorCode GetErrorCode();
138 * Return true if the loaded pattern is a 2D one
143 * Return coordinates of pattern points
145 point_array GetPoints();
148 * Return indices of key-points within the arrays returned by
151 long_array GetKeyPoints();
154 * Return nodal connectivity of the elements of the pattern
156 array_of_long_array GetElementPoints();