MOAB: Mesh Oriented datABase  (version 5.4.1)
MeshDecorator.cpp
Go to the documentation of this file.
00001 /* *****************************************************************
00002     MESQUITE -- The Mesh Quality Improvement Toolkit
00003 
00004     Copyright 2006 Lawrence Livermore National Laboratory.  Under
00005     the terms of Contract B545069 with the University of Wisconsin --
00006     Madison, Lawrence Livermore National Laboratory retains certain
00007     rights in this software.
00008 
00009     This library is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU Lesser General Public
00011     License as published by the Free Software Foundation; either
00012     version 2.1 of the License, or (at your option) any later version.
00013 
00014     This library is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017     Lesser General Public License for more details.
00018 
00019     You should have received a copy of the GNU Lesser General Public License
00020     (lgpl.txt) along with this library; if not, write to the Free Software
00021     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 
00023     (2006) [email protected]
00024 
00025   ***************************************************************** */
00026 
00027 /** \file MeshDecorator.cpp
00028  *  \brief Implementation of MBMesquite::MeshDecorator class
00029  *  \author Jason Kraftcheck
00030  */
00031 
00032 #include "Mesquite.hpp"
00033 #include "MeshDecorator.hpp"
00034 
00035 namespace MBMesquite
00036 {
00037 
00038 MeshDecorator::MeshDecorator() : myMesh( 0 ) {}
00039 MeshDecorator::MeshDecorator( Mesh* mesh ) : myMesh( mesh ) {}
00040 
00041 MeshDecorator::~MeshDecorator() {}
00042 
00043 void MeshDecorator::set_mesh( Mesh* mesh )
00044 {
00045     myMesh = mesh;
00046 }
00047 
00048 void MeshDecorator::vertices_get_coordinates( const VertexHandle vert_array[],
00049                                               MsqVertex* coordinates,
00050                                               size_t num_vtx,
00051                                               MsqError& err )
00052 {
00053     return get_mesh()->vertices_get_coordinates( vert_array, coordinates, num_vtx, err );
00054 }
00055 
00056 void MeshDecorator::vertex_set_coordinates( VertexHandle vertex, const Vector3D& coordinates, MsqError& err )
00057 {
00058     return get_mesh()->vertex_set_coordinates( vertex, coordinates, err );
00059 }
00060 
00061 //************ Operations on entire mesh ****************
00062 
00063 int MeshDecorator::get_geometric_dimension( MsqError& err )
00064 {
00065     return get_mesh()->get_geometric_dimension( err );
00066 }
00067 
00068 void MeshDecorator::get_all_elements( std::vector< ElementHandle >& elements, MsqError& err )
00069 {
00070     get_mesh()->get_all_elements( elements, err );
00071 }
00072 
00073 void MeshDecorator::get_all_vertices( std::vector< VertexHandle >& vertices, MsqError& err )
00074 {
00075     get_mesh()->get_all_vertices( vertices, err );
00076 }
00077 
00078 //************ Vertex Properties ********************
00079 
00080 void MeshDecorator::vertices_get_fixed_flag( const VertexHandle vert_array[],
00081                                              std::vector< bool >& fixed_flag_array,
00082                                              size_t num_vtx,
00083                                              MsqError& err )
00084 {
00085     get_mesh()->vertices_get_fixed_flag( vert_array, fixed_flag_array, num_vtx, err );
00086 }
00087 
00088 void MeshDecorator::vertices_get_slaved_flag( const VertexHandle vert_array[],
00089                                               std::vector< bool >& flag_array,
00090                                               size_t num_vtx,
00091                                               MsqError& err )
00092 {
00093     get_mesh()->vertices_get_slaved_flag( vert_array, flag_array, num_vtx, err );
00094 }
00095 
00096 void MeshDecorator::vertex_set_byte( VertexHandle vertex, unsigned char byte, MsqError& err )
00097 {
00098     get_mesh()->vertex_set_byte( vertex, byte, err );
00099 }
00100 
00101 void MeshDecorator::vertices_set_byte( const VertexHandle* vert_array,
00102                                        const unsigned char* byte_array,
00103                                        size_t array_size,
00104                                        MsqError& err )
00105 {
00106     get_mesh()->vertices_set_byte( vert_array, byte_array, array_size, err );
00107 }
00108 
00109 void MeshDecorator::vertex_get_byte( const VertexHandle vertex, unsigned char* byte, MsqError& err )
00110 {
00111     get_mesh()->vertex_get_byte( vertex, byte, err );
00112 }
00113 
00114 void MeshDecorator::vertices_get_byte( const VertexHandle* vertex,
00115                                        unsigned char* byte_array,
00116                                        size_t array_size,
00117                                        MsqError& err )
00118 {
00119     get_mesh()->vertices_get_byte( vertex, byte_array, array_size, err );
00120 }
00121 
00122 //**************** Vertex Topology *****************
00123 
00124 void MeshDecorator::vertices_get_attached_elements( const VertexHandle* vertex_array,
00125                                                     size_t num_vertex,
00126                                                     std::vector< ElementHandle >& elements,
00127                                                     std::vector< size_t >& offsets,
00128                                                     MsqError& err )
00129 {
00130     get_mesh()->vertices_get_attached_elements( vertex_array, num_vertex, elements, offsets, err );
00131 }
00132 
00133 //*************** Element Topology *************
00134 
00135 void MeshDecorator::elements_get_attached_vertices( const ElementHandle* elem_handles,
00136                                                     size_t num_elems,
00137                                                     std::vector< VertexHandle >& vert_handles,
00138                                                     std::vector< size_t >& offsets,
00139                                                     MsqError& err )
00140 {
00141     get_mesh()->elements_get_attached_vertices( elem_handles, num_elems, vert_handles, offsets, err );
00142 }
00143 
00144 void MeshDecorator::elements_get_topologies( const ElementHandle* element_handle_array,
00145                                              EntityTopology* element_topologies,
00146                                              size_t num_elements,
00147                                              MsqError& err )
00148 {
00149     get_mesh()->elements_get_topologies( element_handle_array, element_topologies, num_elements, err );
00150 }
00151 
00152 //***************  Tags  ***********
00153 
00154 TagHandle MeshDecorator::tag_create( const std::string& tag_name,
00155                                      TagType type,
00156                                      unsigned length,
00157                                      const void* default_value,
00158                                      MsqError& err )
00159 {
00160     return get_mesh()->tag_create( tag_name, type, length, default_value, err );
00161 }
00162 
00163 void MeshDecorator::tag_delete( TagHandle handle, MsqError& err )
00164 {
00165     get_mesh()->tag_delete( handle, err );
00166 }
00167 
00168 TagHandle MeshDecorator::tag_get( const std::string& name, MsqError& err )
00169 {
00170     return get_mesh()->tag_get( name, err );
00171 }
00172 
00173 void MeshDecorator::tag_properties( TagHandle handle,
00174                                     std::string& name_out,
00175                                     TagType& type_out,
00176                                     unsigned& length_out,
00177                                     MsqError& err )
00178 {
00179     get_mesh()->tag_properties( handle, name_out, type_out, length_out, err );
00180 }
00181 
00182 void MeshDecorator::tag_set_element_data( TagHandle handle,
00183                                           size_t num_elems,
00184                                           const ElementHandle* elem_array,
00185                                           const void* tag_data,
00186                                           MsqError& err )
00187 {
00188     get_mesh()->tag_set_element_data( handle, num_elems, elem_array, tag_data, err );
00189 }
00190 
00191 void MeshDecorator::tag_set_vertex_data( TagHandle handle,
00192                                          size_t num_elems,
00193                                          const VertexHandle* node_array,
00194                                          const void* tag_data,
00195                                          MsqError& err )
00196 {
00197     get_mesh()->tag_set_vertex_data( handle, num_elems, node_array, tag_data, err );
00198 }
00199 
00200 void MeshDecorator::tag_get_element_data( TagHandle handle,
00201                                           size_t num_elems,
00202                                           const ElementHandle* elem_array,
00203                                           void* tag_data,
00204                                           MsqError& err )
00205 {
00206     get_mesh()->tag_get_element_data( handle, num_elems, elem_array, tag_data, err );
00207 }
00208 
00209 void MeshDecorator::tag_get_vertex_data( TagHandle handle,
00210                                          size_t num_elems,
00211                                          const VertexHandle* node_array,
00212                                          void* tag_data,
00213                                          MsqError& err )
00214 {
00215     get_mesh()->tag_get_vertex_data( handle, num_elems, node_array, tag_data, err );
00216 }
00217 
00218 //**************** Memory Management ****************
00219 
00220 void MeshDecorator::release_entity_handles( const EntityHandle* handle_array, size_t num_handles, MsqError& err )
00221 {
00222     get_mesh()->release_entity_handles( handle_array, num_handles, err );
00223 }
00224 
00225 void MeshDecorator::release()
00226 {
00227     get_mesh()->release();
00228 }
00229 
00230 }  // namespace MBMesquite
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines