idl/SMESH_Pattern.idl

Go to the documentation of this file.
00001 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00002 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
00003 // 
00004 //  This library is free software; you can redistribute it and/or 
00005 //  modify it under the terms of the GNU Lesser General Public 
00006 //  License as published by the Free Software Foundation; either 
00007 //  version 2.1 of the License. 
00008 // 
00009 //  This library is distributed in the hope that it will be useful, 
00010 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
00011 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00012 //  Lesser General Public License for more details. 
00013 // 
00014 //  You should have received a copy of the GNU Lesser General Public 
00015 //  License along with this library; if not, write to the Free Software 
00016 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
00017 // 
00018 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00019 //
00020 //
00021 //
00022 // File    : SMESH_Pattern.idl
00023 // Created : Mon Aug  2 10:48:36 2004
00024 // Author  : Edward AGAPOV (eap)
00025 //  $Header:
00026 
00027 #ifndef _SMESH_PATTERN_IDL_
00028 #define _SMESH_PATTERN_IDL_
00029 
00030 #include "SMESH_Mesh.idl"
00031 
00032 module SMESH
00033 {
00034   
00035   typedef sequence<SMESH::PointStruct> point_array;
00036 
00040   interface SMESH_Pattern {
00041 
00045     boolean LoadFromFile(in string theFileContents);
00046 
00052     boolean LoadFromFace(in SMESH_Mesh        theMesh,
00053                          in GEOM::GEOM_Object theFace,
00054                          in boolean           theProject);
00055 
00059     boolean LoadFrom3DBlock(in SMESH_Mesh        theMesh,
00060                             in GEOM::GEOM_Object theBlock);
00061 
00068     point_array  ApplyToFace(in GEOM::GEOM_Object theFace,
00069                              in GEOM::GEOM_Object theVertexOnKeyPoint1,
00070                              in boolean           theReverse);
00071 
00078     point_array  ApplyTo3DBlock(in GEOM::GEOM_Object theBlock,
00079                                 in GEOM::GEOM_Object theVertex000,
00080                                 in GEOM::GEOM_Object theVertex001);
00081 
00087     point_array  ApplyToMeshFaces(in SMESH_Mesh theMesh,
00088                                   in long_array theFacesIDs,
00089                                   in long       theNodeIndexOnKeyPoint1,
00090                                   in boolean    theReverse);
00091 
00099     point_array  ApplyToHexahedrons(in SMESH_Mesh theMesh,
00100                                     in long_array theVolumesIDs,
00101                                     in long       theNode000Index,
00102                                     in long       theNode001Index);
00103 
00112     boolean MakeMesh (in SMESH_Mesh theMesh,
00113                 in boolean    CreatePolygons,
00114                 in boolean    CreatePolyedrs);
00115 
00119     string GetString();
00120 
00124     enum ErrorCode {
00125       ERR_OK,
00126       // Load(file)
00127       ERR_READ_NB_POINTS, // couldn't read nb of points
00128       ERR_READ_POINT_COORDS, // invalid nb of point coordinates
00129       ERR_READ_TOO_FEW_POINTS,  // too few points in a pattern
00130       ERR_READ_3D_COORD,  // coordinate of 3D point out of [0,1] range
00131       ERR_READ_NO_KEYPOINT, // no key-points in 2D pattern
00132       ERR_READ_BAD_INDEX, // invalid point index
00133       ERR_READ_ELEM_POINTS, // invalid nb of points in element
00134       ERR_READ_NO_ELEMS, // no elements in a pattern
00135       ERR_READ_BAD_KEY_POINT, // a key-point not on a boundary
00136       // Save(file)
00137       ERR_SAVE_NOT_LOADED, // pattern was not loaded
00138       // Load(shape)
00139       ERR_LOAD_EMPTY_SUBMESH, // no elements to load
00140       // Load(face)
00141       ERR_LOADF_NARROW_FACE, // too narrow face
00142       ERR_LOADF_CLOSED_FACE, // closed face
00143       ERR_LOADF_CANT_PROJECT, // impossible to project nodes
00144       // Load(volume)
00145       ERR_LOADV_BAD_SHAPE, // volume is not a brick of 6 faces
00146       ERR_LOADV_COMPUTE_PARAMS, // cant compute point parameters
00147       // Apply(shape)
00148       ERR_APPL_NOT_LOADED, // pattern was not loaded
00149       ERR_APPL_BAD_DIMENTION, // wrong shape dimention
00150       ERR_APPL_BAD_NB_VERTICES, // keypoints - vertices mismatch
00151       // Apply(face)
00152       ERR_APPLF_BAD_TOPOLOGY, // bad pattern topology
00153       ERR_APPLF_BAD_VERTEX, // first vertex not on an outer face boundary
00154       ERR_APPLF_INTERNAL_EEROR, // program error
00155       // Apply(volume)
00156       ERR_APPLV_BAD_SHAPE, // volume is not a brick of 6 faces
00157       // MakeMesh
00158       ERR_MAKEM_NOT_COMPUTED // mapping failed
00159       };
00160 
00164     ErrorCode GetErrorCode();
00165 
00169     boolean Is2D();
00170 
00174     point_array GetPoints();
00175 
00180     long_array GetKeyPoints();
00181 
00186     array_of_long_array GetElementPoints(in boolean all);
00187   };
00188 };
00189 
00190 #endif