MOAB: Mesh Oriented datABase  (version 5.2.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) kraftche@cae.wisc.edu
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[], MsqVertex* coordinates, size_t num_vtx,
00049                                               MsqError& err )
00050 {
00051     return get_mesh()->vertices_get_coordinates( vert_array, coordinates, num_vtx, err );
00052 }
00053 
00054 void MeshDecorator::vertex_set_coordinates( VertexHandle vertex, const Vector3D& coordinates, MsqError& err )
00055 {
00056     return get_mesh()->vertex_set_coordinates( vertex, coordinates, err );
00057 }
00058 
00059 //************ Operations on entire mesh ****************
00060 
00061 int MeshDecorator::get_geometric_dimension( MsqError& err )
00062 {
00063     return get_mesh()->get_geometric_dimension( err );
00064 }
00065 
00066 void MeshDecorator::get_all_elements( std::vector< ElementHandle >& elements, MsqError& err )
00067 {
00068     get_mesh()->get_all_elements( elements, err );
00069 }
00070 
00071 void MeshDecorator::get_all_vertices( std::vector< VertexHandle >& vertices, MsqError& err )
00072 {
00073     get_mesh()->get_all_vertices( vertices, err );
00074 }
00075 
00076 //************ Vertex Properties ********************
00077 
00078 void MeshDecorator::vertices_get_fixed_flag( const VertexHandle vert_array[], std::vector< bool >& fixed_flag_array,
00079                                              size_t num_vtx, MsqError& err )
00080 {
00081     get_mesh()->vertices_get_fixed_flag( vert_array, fixed_flag_array, num_vtx, err );
00082 }
00083 
00084 void MeshDecorator::vertices_get_slaved_flag( const VertexHandle vert_array[], std::vector< bool >& flag_array,
00085                                               size_t num_vtx, MsqError& err )
00086 {
00087     get_mesh()->vertices_get_slaved_flag( vert_array, flag_array, num_vtx, err );
00088 }
00089 
00090 void MeshDecorator::vertex_set_byte( VertexHandle vertex, unsigned char byte, MsqError& err )
00091 {
00092     get_mesh()->vertex_set_byte( vertex, byte, err );
00093 }
00094 
00095 void MeshDecorator::vertices_set_byte( const VertexHandle* vert_array, const unsigned char* byte_array,
00096                                        size_t array_size, MsqError& err )
00097 {
00098     get_mesh()->vertices_set_byte( vert_array, byte_array, array_size, err );
00099 }
00100 
00101 void MeshDecorator::vertex_get_byte( const VertexHandle vertex, unsigned char* byte, MsqError& err )
00102 {
00103     get_mesh()->vertex_get_byte( vertex, byte, err );
00104 }
00105 
00106 void MeshDecorator::vertices_get_byte( const VertexHandle* vertex, unsigned char* byte_array, size_t array_size,
00107                                        MsqError& err )
00108 {
00109     get_mesh()->vertices_get_byte( vertex, byte_array, array_size, err );
00110 }
00111 
00112 //**************** Vertex Topology *****************
00113 
00114 void MeshDecorator::vertices_get_attached_elements( const VertexHandle* vertex_array, size_t num_vertex,
00115                                                     std::vector< ElementHandle >& elements,
00116                                                     std::vector< size_t >& offsets, MsqError& err )
00117 {
00118     get_mesh()->vertices_get_attached_elements( vertex_array, num_vertex, elements, offsets, err );
00119 }
00120 
00121 //*************** Element Topology *************
00122 
00123 void MeshDecorator::elements_get_attached_vertices( const ElementHandle* elem_handles, size_t num_elems,
00124                                                     std::vector< VertexHandle >& vert_handles,
00125                                                     std::vector< size_t >& offsets, MsqError& err )
00126 {
00127     get_mesh()->elements_get_attached_vertices( elem_handles, num_elems, vert_handles, offsets, err );
00128 }
00129 
00130 void MeshDecorator::elements_get_topologies( const ElementHandle* element_handle_array,
00131                                              EntityTopology* element_topologies, size_t num_elements, MsqError& err )
00132 {
00133     get_mesh()->elements_get_topologies( element_handle_array, element_topologies, num_elements, err );
00134 }
00135 
00136 //***************  Tags  ***********
00137 
00138 TagHandle MeshDecorator::tag_create( const std::string& tag_name, TagType type, unsigned length,
00139                                      const void* default_value, MsqError& err )
00140 {
00141     return get_mesh()->tag_create( tag_name, type, length, default_value, err );
00142 }
00143 
00144 void MeshDecorator::tag_delete( TagHandle handle, MsqError& err )
00145 {
00146     get_mesh()->tag_delete( handle, err );
00147 }
00148 
00149 TagHandle MeshDecorator::tag_get( const std::string& name, MsqError& err )
00150 {
00151     return get_mesh()->tag_get( name, err );
00152 }
00153 
00154 void MeshDecorator::tag_properties( TagHandle handle, std::string& name_out, TagType& type_out, unsigned& length_out,
00155                                     MsqError& err )
00156 {
00157     get_mesh()->tag_properties( handle, name_out, type_out, length_out, err );
00158 }
00159 
00160 void MeshDecorator::tag_set_element_data( TagHandle handle, size_t num_elems, const ElementHandle* elem_array,
00161                                           const void* tag_data, MsqError& err )
00162 {
00163     get_mesh()->tag_set_element_data( handle, num_elems, elem_array, tag_data, err );
00164 }
00165 
00166 void MeshDecorator::tag_set_vertex_data( TagHandle handle, size_t num_elems, const VertexHandle* node_array,
00167                                          const void* tag_data, MsqError& err )
00168 {
00169     get_mesh()->tag_set_vertex_data( handle, num_elems, node_array, tag_data, err );
00170 }
00171 
00172 void MeshDecorator::tag_get_element_data( TagHandle handle, size_t num_elems, const ElementHandle* elem_array,
00173                                           void* tag_data, MsqError& err )
00174 {
00175     get_mesh()->tag_get_element_data( handle, num_elems, elem_array, tag_data, err );
00176 }
00177 
00178 void MeshDecorator::tag_get_vertex_data( TagHandle handle, size_t num_elems, const VertexHandle* node_array,
00179                                          void* tag_data, MsqError& err )
00180 {
00181     get_mesh()->tag_get_vertex_data( handle, num_elems, node_array, tag_data, err );
00182 }
00183 
00184 //**************** Memory Management ****************
00185 
00186 void MeshDecorator::release_entity_handles( const EntityHandle* handle_array, size_t num_handles, MsqError& err )
00187 {
00188     get_mesh()->release_entity_handles( handle_array, num_handles, err );
00189 }
00190 
00191 void MeshDecorator::release()
00192 {
00193     get_mesh()->release();
00194 }
00195 
00196 }  // namespace MBMesquite
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines