00001 /* @HEADER@ */ 00002 // ************************************************************************ 00003 // 00004 // Sundance 00005 // Copyright (2005) Sandia Corporation 00006 // 00007 // Copyright (year first published) Sandia Corporation. Under the terms 00008 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government 00009 // retains certain rights in this software. 00010 // 00011 // This library is free software; you can redistribute it and/or modify 00012 // it under the terms of the GNU Lesser General Public License as 00013 // published by the Free Software Foundation; either version 2.1 of the 00014 // License, or (at your option) any later version. 00015 // 00016 // This library is distributed in the hope that it will be useful, but 00017 // WITHOUT ANY WARRANTY; without even the implied warranty of 00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 // Lesser General Public License for more details. 00020 // 00021 // You should have received a copy of the GNU Lesser General Public 00022 // License along with this library; if not, write to the Free Software 00023 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00024 // USA 00025 // Questions? Contact Kevin Long (krlong@sandia.gov), 00026 // Sandia National Laboratories, Livermore, California, USA 00027 // 00028 // ************************************************************************ 00029 /* @HEADER@ */ 00030 00031 #ifndef SUNDANCE_MESHFILTER_H 00032 #define SUNDANCE_MESHFILTER_H 00033 00034 #include "SundanceDefs.hpp" 00035 #include "SundanceMeshTransformationBase.hpp" 00036 #include "PlayaHandle.hpp" 00037 00038 namespace Sundance 00039 { 00040 /** 00041 * MeshTransformation is the user-level interface for mesh filters, i.e., 00042 * objects that take an input mesh and produce a new mesh. Examples 00043 * of filter operations are refinement, load balancing, 00044 * and extrusion from 2D to 3D. 00045 * 00046 * <h4> Example: </h4> extrude a 2D mesh into 2D 00047 * \code 00048 * // create a 2D mesh 00049 * MeshType meshType = new BasicSimplicialMeshType(); 00050 * MeshSource mesher = new PartitionedRectangleMesher(0.0, 1.0, 10, 1, 00051 * 0.0, 1.0, 10, 1, 00052 * meshType); 00053 * Mesh mesh2D = mesher.getMesh(); 00054 * // create a filter for extruding 2 levels between z=0.0 and z=0.2 00055 * MeshTransformation extruder = new ExtrusionMeshTransformation(0.0, 0.2, 2); 00056 * // perform the extrusion 00057 * Mesh mesh3D = extruder.apply(mesh2D); 00058 * \endcode 00059 */ 00060 class MeshTransformation : public Playa::Handle<MeshTransformationBase> 00061 { 00062 public: 00063 /** Construct an empty mesh filter object */ 00064 MeshTransformation(); 00065 00066 /** Construct from a raw pointer to a mesh filter subtype */ 00067 MeshTransformation(Playa::Handleable<MeshTransformationBase>* rawPtr); 00068 00069 /** Construct from a smart pointer to a mesh filter subtype */ 00070 MeshTransformation(const RCP<MeshTransformationBase>& smartPtr); 00071 00072 /** apply the filter to create a new mesh */ 00073 Mesh apply(const Mesh& inputMesh) const ; 00074 00075 const bool& serializeLocal() const {return serializeLocal_;} 00076 00077 bool& serializeLocal() {return serializeLocal_;} 00078 private: 00079 bool serializeLocal_; 00080 00081 }; 00082 } 00083 00084 #endif