1 // Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
3 // Copyright (C) 2003-2007 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, or (at your option) any later version.
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.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File : SMESH_Pattern.idl
24 // Created : Mon Aug 2 10:48:36 2004
25 // Author : Edward AGAPOV (eap)
28 #ifndef _SMESH_PATTERN_IDL_
29 #define _SMESH_PATTERN_IDL_
31 #include "SMESH_Mesh.idl"
32 #include "SMESH_smIdType.idl"
37 typedef sequence<SMESH::PointStruct> point_array;
40 * SMESH_Pattern: interface of mesh pattern
42 interface SMESH_Pattern {
45 * Load a pattern from the string <theFileContents>
47 boolean LoadFromFile(in string theFileContents);
50 * Create a pattern from the mesh built on <theFace>.
51 * <theProject>==true makes override nodes positions
52 * on <theFace> computed by mesher
54 boolean LoadFromFace(in SMESH_Mesh theMesh,
55 in GEOM::GEOM_Object theFace,
56 in boolean theProject);
59 * Create a pattern from the mesh built on <theBlock>
61 boolean LoadFrom3DBlock(in SMESH_Mesh theMesh,
62 in GEOM::GEOM_Object theBlock);
65 * Compute nodes coordinates applying
66 * the loaded pattern to <theFace>. The first key-point
67 * will be mapped into <theVertexOnKeyPoint1>, which must
68 * be in the outer wire of theFace
70 point_array ApplyToFace(in GEOM::GEOM_Object theFace,
71 in GEOM::GEOM_Object theVertexOnKeyPoint1,
72 in boolean theReverse);
75 * Compute nodes coordinates applying
76 * the loaded pattern to <theBlock>. The (0,0,0) key-point
77 * will be mapped into <theVertex000>. The (0,0,1)
78 * key-point will be mapped into <theVertex001>.
80 point_array ApplyTo3DBlock(in GEOM::GEOM_Object theBlock,
81 in GEOM::GEOM_Object theVertex000,
82 in GEOM::GEOM_Object theVertex001);
85 * Compute nodes coordinates applying
86 * the loaded pattern to mesh faces. The first key-point
87 * will be mapped into <theNodeIndexOnKeyPoint1>-th node of each face
89 point_array ApplyToMeshFaces(in SMESH_Mesh theMesh,
90 in smIdType_array theFacesIDs,
91 in short theNodeIndexOnKeyPoint1,
92 in boolean theReverse);
95 * Compute nodes coordinates applying
96 * the loaded pattern to hexahedrons. The (0,0,0) key-point
97 * will be mapped into <theNode000Index>-th node of each volume.
98 * The (0,0,1) key-point will be mapped into <theNode001Index>-th
99 * node of each volume.
101 point_array ApplyToHexahedrons(in SMESH_Mesh theMesh,
102 in smIdType_array theVolumesIDs,
103 in short theNode000Index,
104 in short theNode001Index);
107 * Create nodes and elements in <theMesh> using nodes
108 * coordinates computed by either of Apply...() methods.
109 * If CreatePolygons is TRUE, replace adjacent faces by polygons
110 * to keep mesh conformity.
111 * If CreatePolyedrs is TRUE, replace adjacent volumes by polyedrs
112 * to keep mesh conformity.
114 boolean MakeMesh (in SMESH_Mesh theMesh,
115 in boolean CreatePolygons,
116 in boolean CreatePolyedrs);
119 * Return the loaded pattern in the string form to be saved in file
124 * error code of the last of one of above operations
129 ERR_READ_NB_POINTS, // couldn't read nb of points
130 ERR_READ_POINT_COORDS, // invalid nb of point coordinates
131 ERR_READ_TOO_FEW_POINTS, // too few points in a pattern
132 ERR_READ_3D_COORD, // coordinate of 3D point out of [0,1] range
133 ERR_READ_NO_KEYPOINT, // no key-points in 2D pattern
134 ERR_READ_BAD_INDEX, // invalid point index
135 ERR_READ_ELEM_POINTS, // invalid nb of points in element
136 ERR_READ_NO_ELEMS, // no elements in a pattern
137 ERR_READ_BAD_KEY_POINT, // a key-point not on a boundary
139 ERR_SAVE_NOT_LOADED, // pattern was not loaded
141 ERR_LOAD_EMPTY_SUBMESH, // no elements to load
143 ERR_LOADF_NARROW_FACE, // too narrow face
144 ERR_LOADF_CLOSED_FACE, // closed face
145 ERR_LOADF_CANT_PROJECT, // impossible to project nodes
147 ERR_LOADV_BAD_SHAPE, // volume is not a brick of 6 faces
148 ERR_LOADV_COMPUTE_PARAMS, // can't compute point parameters
150 ERR_APPL_NOT_LOADED, // pattern was not loaded
151 ERR_APPL_BAD_DIMENTION, // wrong shape dimension
152 ERR_APPL_BAD_NB_VERTICES, // keypoints - vertices mismatch
154 ERR_APPLF_BAD_TOPOLOGY, // bad pattern topology
155 ERR_APPLF_BAD_VERTEX, // first vertex not on an outer face boundary
156 ERR_APPLF_INTERNAL_EEROR, // program error
158 ERR_APPLV_BAD_SHAPE, // volume is not a brick of 6 faces
160 ERR_MAKEM_NOT_COMPUTED // mapping failed
164 * Return error code of the last operation
166 ErrorCode GetErrorCode();
169 * Return true if the loaded pattern is a 2D one
174 * Return coordinates of pattern points
176 point_array GetPoints();
179 * Return indices of key-points within the arrays returned by
182 long_array GetKeyPoints();
185 * Return nodal connectivity of the elements of the pattern
186 * or of all elements to be created
188 array_of_long_array GetElementPoints(in boolean all);