MOAB: Mesh Oriented datABase  (version 5.4.1)
SmoothCurve.hpp
Go to the documentation of this file.
00001 /*
00002  * SmoothCurve.hpp
00003  *
00004  */
00005 
00006 #ifndef SMOOTHCURVE_HPP_
00007 #define SMOOTHCURVE_HPP_
00008 
00009 #include "moab/Interface.hpp"
00010 #include "moab/Forward.hpp"
00011 #include "moab/CartVect.hpp"
00012 
00013 //#include "RefEdge.hpp"
00014 //#include "SmoothFace.hpp"
00015 
00016 #include <map>
00017 #include <vector>
00018 
00019 namespace moab
00020 {
00021 class SmoothFace;
00022 class GeomTopoTool;
00023 // class SmoothVertex;
00024 
00025 // class CMLEdgeMesher;
00026 // evaluator for Camal Edge Mesher
00027 // this is really copying what Cubit is doing
00028 
00029 class SmoothCurve
00030 {
00031   public:
00032     // SmoothCurve(RefEdge * edge, SmoothFace * smoothFaceEval, int loopIndex);
00033     SmoothCurve( Interface* mb, EntityHandle curve,
00034                  GeomTopoTool* gTool );  // the new constructor, which will use
00035     // sense entities to establish the control points on feature edges (geo edges, sets of mesh
00036     // edges)
00037     virtual ~SmoothCurve();
00038 
00039     virtual double arc_length();
00040 
00041     //! \brief Get the parametric status of the curve.
00042     //!
00043     //! \return \a true if curve is parametric, \a false otherwise.
00044     virtual bool is_parametric();
00045 
00046     //! \brief Get the periodic status of the curve.
00047     //!
00048     //! \param period The period of the curve if periodic.
00049     //!
00050     //! \return \a true if curve is periodic, \a false otherwise.
00051     virtual bool is_periodic( double& period );
00052 
00053     //! \brief Get the parameter range of the curve.
00054     //!
00055     //! \param u_start The beginning curve parameter
00056     //! \param u_end The ending curve parameter
00057     //!
00058     //! \note The numerical value of \a u_start may be greater
00059     //! than the numerical value of \a u_end.
00060     virtual void get_param_range( double& u_start, double& u_end );
00061 
00062     //! Compute the parameter value at a specified distance along the curve.
00063     //!
00064     //! \param u_root The start parameter from which to compute the distance
00065     //! along the curve.
00066     //! \param arc_length The distance to move along the curve.
00067     //!
00068     //! \note For positive values of \a arc_length the distance will be
00069     //! computed in the direction of increasing parameter value along the
00070     //! curve.  For negative values of \a arc_length the distance will be
00071     //! computed in the direction of decreasing parameter value along the
00072     //! curve.
00073     //!
00074     //! \return The parametric coordinate u along the curve
00075     virtual double u_from_arc_length( double u_root, double arc_length );
00076 
00077     //! \brief Evaluate the curve at a specified parameter value.
00078     //!
00079     //! \param u The parameter at which to evaluate the curve
00080     //! \param x The x coordinate of the evaluated point
00081     //! \param y The y coordinate of the evaluated point
00082     //! \param z The z coordinate of the evaluated point
00083     // ! \param tg, if not null, return the tangent too at u
00084     virtual bool position_from_u( double u, double& x, double& y, double& z, double* tg = NULL );
00085 
00086     //! \brief Move a point near the curve to the closest point on the curve.
00087     //!
00088     //! \param x The x coordinate of the point
00089     //! \param y The y coordinate of the point
00090     //! \param z The z coordinate of the point
00091     virtual void move_to_curve( double& x, double& y, double& z );
00092 
00093     //! Get the u parameter value on the curve closest to x,y,z
00094     //! and the point on the curve.
00095     //!
00096     //! \param x The x coordinate of the point
00097     //! \param y The y coordinate of the point
00098     //! \param z The z coordinate of the point
00099     //!
00100     //! \return The parametric coordinate u on the curve
00101     virtual double u_from_position( double x, double y, double z, EntityHandle& v, int& indexEdge );
00102 
00103     //! \brief Get the starting point of the curve.
00104     //!
00105     //! \param x The x coordinate of the start point
00106     //! \param y The y coordinate of the start point
00107     //! \param z The z coordinate of the start point
00108     virtual void start_coordinates( double& x, double& y, double& z );
00109 
00110     //! \brief Get the ending point of the curve.
00111     //!
00112     //! \param x The x coordinate of the start point
00113     //! \param y The y coordinate of the start point
00114     //! \param z The z coordinate of the start point
00115     virtual void end_coordinates( double& x, double& y, double& z );
00116 
00117     // this will recompute the 2 tangents for each edge, considering the geo edge they are into
00118     void compute_tangents_for_each_edge();
00119 
00120     void compute_control_points_on_boundary_edges( double min_dot,
00121                                                    std::map< EntityHandle, SmoothFace* >& mapSurfaces,
00122                                                    Tag controlPointsTag,
00123                                                    Tag markTag );
00124 
00125     ErrorCode evaluate_smooth_edge( EntityHandle eh, double& tt, CartVect& outv, CartVect& out_tangent );
00126 
00127   private:
00128     std::vector< EntityHandle > _entities;  // the mesh edges are stored here for fast access
00129     double _leng;
00130     std::vector< double > _fractions;  // they are increasing from 0. to 1., do we need these?
00131     // this will be decided apriori, and eventually reset for paver
00132     // fractions will be from 0.0.. to 1.0, they will be decided upon the length of the geo edge
00133 
00134     Tag _edgeTag;
00135 
00136     Interface* _mb;
00137     EntityHandle _set;
00138     GeomTopoTool* _gtt;
00139 };
00140 
00141 }  // namespace moab
00142 #endif /* SMOOTHCURVE_HPP_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines