MOAB: Mesh Oriented datABase  (version 5.2.1)
MeshDecorator.hpp
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.hpp
00028  *  \brief Definition of MBMesquite::MeshDecorator class
00029  *  \author Jason Kraftcheck
00030  */
00031 
00032 #ifndef MSQ_MESH_DECORATOR_HPP
00033 #define MSQ_MESH_DECORATOR_HPP
00034 
00035 #include "Mesquite.hpp"
00036 #include "MeshInterface.hpp"
00037 
00038 namespace MBMesquite
00039 {
00040 
00041 /**\brief Utility class for implementing decorators for the MBMesquite::Mesh interface
00042  *
00043  * This is a utility class that to assist with implementing decorators
00044  * for the MBMesquite::Mesh interface.  This class implements a "dumb"
00045  * decorator that passes all operations to its underlying (decorated)
00046  * Mesh instance unchanged.  The intention is that useful decorators
00047  * subclass this class, overriding only those functions for which they
00048  * modify the behavioir.
00049  */
00050 class MESQUITE_EXPORT MeshDecorator : public Mesh
00051 {
00052   private:
00053     Mesh* myMesh;  //< The actual Mesh this instance decorates
00054 
00055   protected:
00056     void set_mesh( Mesh* mesh );
00057 
00058   public:
00059     MeshDecorator();
00060     MeshDecorator( Mesh* real_mesh );
00061 
00062     virtual ~MeshDecorator();
00063 
00064     /**\brief Get the real Mesh instance */
00065     Mesh* get_mesh() const
00066     {
00067         return myMesh;
00068     }
00069 
00070     //************ Operations on entire mesh ****************
00071 
00072     virtual int get_geometric_dimension( MsqError& err );
00073 
00074     virtual void get_all_elements( std::vector< ElementHandle >& elements, MsqError& err );
00075 
00076     virtual void get_all_vertices( std::vector< VertexHandle >& vertices, MsqError& err );
00077 
00078     //************ Vertex Properties ********************
00079 
00080     virtual void vertices_get_fixed_flag( const VertexHandle vert_array[], std::vector< bool >& fixed_flag_array,
00081                                           size_t num_vtx, MsqError& err );
00082 
00083     virtual void vertices_get_slaved_flag( const VertexHandle vert_array[], std::vector< bool >& slaved_flag_array,
00084                                            size_t num_vtx, MsqError& err );
00085 
00086     virtual void vertices_get_coordinates( const VertexHandle vert_array[], MsqVertex* coordinates, size_t num_vtx,
00087                                            MsqError& err );
00088 
00089     virtual void vertex_set_coordinates( VertexHandle vertex, const Vector3D& coordinates, MsqError& err );
00090 
00091     virtual void vertex_set_byte( VertexHandle vertex, unsigned char byte, MsqError& err );
00092 
00093     virtual void vertices_set_byte( const VertexHandle* vert_array, const unsigned char* byte_array, size_t array_size,
00094                                     MsqError& err );
00095 
00096     virtual void vertex_get_byte( const VertexHandle vertex, unsigned char* byte, MsqError& err );
00097 
00098     virtual void vertices_get_byte( const VertexHandle* vertex, unsigned char* byte_array, size_t array_size,
00099                                     MsqError& err );
00100 
00101     //**************** Vertex Topology *****************
00102 
00103     virtual void vertices_get_attached_elements( const VertexHandle* vertex_array, size_t num_vertex,
00104                                                  std::vector< ElementHandle >& elements, std::vector< size_t >& offsets,
00105                                                  MsqError& err );
00106 
00107     //*************** Element Topology *************
00108 
00109     virtual void elements_get_attached_vertices( const ElementHandle* elem_handles, size_t num_elems,
00110                                                  std::vector< VertexHandle >& vert_handles,
00111                                                  std::vector< size_t >& offsets, MsqError& err );
00112 
00113     virtual void elements_get_topologies( const ElementHandle* element_handle_array, EntityTopology* element_topologies,
00114                                           size_t num_elements, MsqError& err );
00115 
00116     //***************  Tags  ***********
00117 
00118     virtual TagHandle tag_create( const std::string& tag_name, TagType type, unsigned length, const void* default_value,
00119                                   MsqError& err );
00120 
00121     virtual void tag_delete( TagHandle handle, MsqError& err );
00122 
00123     virtual TagHandle tag_get( const std::string& name, MsqError& err );
00124 
00125     virtual void tag_properties( TagHandle handle, std::string& name_out, TagType& type_out, unsigned& length_out,
00126                                  MsqError& err );
00127 
00128     virtual void tag_set_element_data( TagHandle handle, size_t num_elems, const ElementHandle* elem_array,
00129                                        const void* tag_data, MsqError& err );
00130 
00131     virtual void tag_set_vertex_data( TagHandle handle, size_t num_elems, const VertexHandle* node_array,
00132                                       const void* tag_data, MsqError& err );
00133 
00134     virtual void tag_get_element_data( TagHandle handle, size_t num_elems, const ElementHandle* elem_array,
00135                                        void* tag_data, MsqError& err );
00136 
00137     virtual void tag_get_vertex_data( TagHandle handle, size_t num_elems, const VertexHandle* node_array,
00138                                       void* tag_data, MsqError& err );
00139 
00140     //**************** Memory Management ****************
00141 
00142     virtual void release_entity_handles( const EntityHandle* handle_array, size_t num_handles, MsqError& err );
00143 
00144     virtual void release();
00145 };
00146 
00147 }  // namespace MBMesquite
00148 
00149 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines