MOAB: Mesh Oriented datABase  (version 5.4.1)
ExtraData.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) [email protected]
00024 
00025   ***************************************************************** */
00026 
00027 /** \file ExtraData.hpp
00028  *  \brief
00029  *  \author Jason Kraftcheck
00030  */
00031 
00032 #ifndef MSQ_EXTRA_DATA_HPP
00033 #define MSQ_EXTRA_DATA_HPP
00034 
00035 #include "Mesquite.hpp"
00036 #include <cstdlib>
00037 
00038 namespace MBMesquite
00039 {
00040 
00041 class PatchData;
00042 class MsqError;
00043 
00044 /**\brief Object used to attach auxiliary data to PatchData */
00045 class ExtraData
00046 {
00047   public:
00048     ExtraData( PatchData& patch );
00049 
00050     virtual ~ExtraData();
00051 
00052     PatchData* get_patch_data() const
00053     {
00054         return patchPtr;
00055     }
00056 
00057     /**\brief Notify that the owning PatchData is being destroyed.
00058      *
00059      * Notify an ExtraData object that the patch it is attached to
00060      * is being destroyed.  The ExtraData will have been removed
00061      * from the PatchData before being notified.  Therefore
00062      * this->get_patch_data() will return NULL.
00063      *
00064      * ExtraData instances will also be notified via this method
00065      * and removed and removed from the PatchData if the attached
00066      * MBMesquite::Mesh or MBMesquite::MeshDomain instance is changed.
00067      */
00068     virtual void notify_patch_destroyed() = 0;
00069 
00070     /**\brief Notify that the patch (mesh) in the PatchData is changing
00071      *
00072      * Notify attached ExtraData that the PatchData is being changed
00073      * to contain an new patch (set of mesh entities.)
00074      */
00075     virtual void notify_new_patch() = 0;
00076 
00077     /**\brief Nofity that a subpatch is being created from this patch.
00078      *\param sub_patch The new, populated subpatch
00079      *\param vertex_index_map The indices in the original patch for each
00080      *          vertex in the subpatch.
00081      *\param element_index_map The indices in the original patch for each
00082      *          element in the subpatch.
00083      */
00084     virtual void notify_sub_patch( PatchData& sub_patch,
00085                                    const size_t* vertex_index_map,
00086                                    const size_t* element_index_map,
00087                                    MsqError& err ) = 0;
00088 
00089   private:
00090     friend class PatchData;
00091     ExtraData* patchNext;
00092     PatchData* patchPtr;
00093 };
00094 
00095 }  // namespace MBMesquite
00096 
00097 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines