MOAB: Mesh Oriented datABase  (version 5.2.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     kraftche@cae.wisc.edu
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, Vector3D axis_direction = Vector3D( 0, 0, 1 ),
00047                                   Vector3D axis_point = Vector3D( 0, 0, 0 ) )
00048         : CylinderDomain( pradius, axis_direction, axis_point )
00049     {
00050     }
00051 
00052     virtual void domain_DoF( const Mesh::VertexHandle* handle_array, unsigned short* dof_array, size_t count,
00053                              MsqError& err ) const;
00054 
00055     /**\brief define a circular curve bounding the cylinder
00056      *\param distance Location on cylinder at which to create
00057      *                  a circular curve, specified as the distance
00058      *                  along the cylinder axis from axis_point
00059      *                  specified to the constructor.
00060      *\param handles  A list of handles which are to be constidered
00061      *                  bound to the curve.
00062      */
00063     void create_curve( double distance, const std::vector< Mesh::VertexHandle >& handles );
00064 
00065     /**\brief define a circular curve bounding the cylinder
00066      *\param distance  Location on cylinder at which to create
00067      *                  a circular curve, specified as the distance
00068      *                  along the cylinder axis from axis_point
00069      *                  specified to the constructor.
00070      *\param mesh      All vertices in this mesh within the specified
00071      *                  tolerance of the curve will be considered bound
00072      *                  to the curve.
00073      *\param tolerance The distance tolerance to use.
00074      */
00075     void create_curve( double distance, Mesh* mesh, double tolerance, MsqError& err );
00076 
00077   protected:
00078     void evaluate( double t, const Vector3D& point, Vector3D& closest, Vector3D& normal ) const;
00079 
00080     virtual void evaluate( Mesh::VertexHandle handle, const Vector3D& point, Vector3D& closest,
00081                            Vector3D& normal ) const;
00082 
00083     bool find_curve( Mesh::VertexHandle handle, double& t ) const;
00084 
00085   private:
00086     struct Curve
00087     {
00088         double t;
00089         std::vector< Mesh::EntityHandle > handles;
00090     };
00091 
00092     std::list< Curve > curveList;
00093 };
00094 
00095 }  // namespace MBMesquite
00096 
00097 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines