MOAB: Mesh Oriented datABase  (version 5.4.1)
BoundedCylinderDomain.hpp
Go to the documentation of this file.
00001 /* *****************************************************************
00002     MESQUITE -- The Mesh Quality Improvement Toolkit
00003 
00004     Copyright 2005 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     [email protected]
00024 
00025   ***************************************************************** */
00026 
00027 #ifndef MSQ_BOUNDED_CYLINDER_DOMAIN_HPP
00028 #define MSQ_BOUNDED_CYLINDER_DOMAIN_HPP
00029 
00030 #include "CylinderDomain.hpp"
00031 #include "Vector3D.hpp"
00032 
00033 #include <list>
00034 
00035 namespace MBMesquite
00036 {
00037 
00038 class BoundedCylinderDomain : public CylinderDomain
00039 {
00040   public:
00041     /**
00042      *\param radius         - Radius of the cylinder
00043      *\param axis_direction - Vector defining the direction of the axis
00044      *\param axis_point     - A point through which the axis passes.
00045      */
00046     inline BoundedCylinderDomain( double pradius,
00047                                   Vector3D axis_direction = Vector3D( 0, 0, 1 ),
00048                                   Vector3D axis_point     = Vector3D( 0, 0, 0 ) )
00049         : CylinderDomain( pradius, axis_direction, axis_point )
00050     {
00051     }
00052 
00053     virtual void domain_DoF( const Mesh::VertexHandle* handle_array,
00054                              unsigned short* dof_array,
00055                              size_t count,
00056                              MsqError& err ) const;
00057 
00058     /**\brief define a circular curve bounding the cylinder
00059      *\param distance Location on cylinder at which to create
00060      *                  a circular curve, specified as the distance
00061      *                  along the cylinder axis from axis_point
00062      *                  specified to the constructor.
00063      *\param handles  A list of handles which are to be constidered
00064      *                  bound to the curve.
00065      */
00066     void create_curve( double distance, const std::vector< Mesh::VertexHandle >& handles );
00067 
00068     /**\brief define a circular curve bounding the cylinder
00069      *\param distance  Location on cylinder at which to create
00070      *                  a circular curve, specified as the distance
00071      *                  along the cylinder axis from axis_point
00072      *                  specified to the constructor.
00073      *\param mesh      All vertices in this mesh within the specified
00074      *                  tolerance of the curve will be considered bound
00075      *                  to the curve.
00076      *\param tolerance The distance tolerance to use.
00077      */
00078     void create_curve( double distance, Mesh* mesh, double tolerance, MsqError& err );
00079 
00080   protected:
00081     void evaluate( double t, const Vector3D& point, Vector3D& closest, Vector3D& normal ) const;
00082 
00083     virtual void evaluate( Mesh::VertexHandle handle,
00084                            const Vector3D& point,
00085                            Vector3D& closest,
00086                            Vector3D& normal ) const;
00087 
00088     bool find_curve( Mesh::VertexHandle handle, double& t ) const;
00089 
00090   private:
00091     struct Curve
00092     {
00093         double t;
00094         std::vector< Mesh::EntityHandle > handles;
00095     };
00096 
00097     std::list< Curve > curveList;
00098 };
00099 
00100 }  // namespace MBMesquite
00101 
00102 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines