moab
|
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 class SmoothFace; 00021 class GeomTopoTool; 00022 //class SmoothVertex; 00023 00024 //class CMLEdgeMesher; 00025 // evaluator for Camal Edge Mesher 00026 // this is really copying what Cubit is doing 00027 00028 class SmoothCurve 00029 { 00030 public: 00031 //SmoothCurve(RefEdge * edge, SmoothFace * smoothFaceEval, int loopIndex); 00032 SmoothCurve(Interface * mb, EntityHandle curve, GeomTopoTool * gTool); // the new constructor, which will use 00033 // sense entities to establish the control points on feature edges (geo edges, sets of mesh edges) 00034 virtual ~SmoothCurve(); 00035 00036 virtual double arc_length() ; 00037 00041 virtual bool is_parametric() ; 00042 00048 virtual bool is_periodic(double& period) ; 00049 00057 virtual void get_param_range(double& u_start, double& u_end) ; 00058 00072 virtual double u_from_arc_length(double u_root, double arc_length); 00073 00074 00081 // ! \param tg, if not null, return the tangent too at u 00082 virtual bool position_from_u(double u, 00083 double& x, double& y, double& z, 00084 double * tg = NULL) ; 00085 00091 virtual void move_to_curve(double& x, double& y, double& z); 00092 00101 virtual double u_from_position(double x, double y, double z, EntityHandle & v, 00102 int & indexEdge) ; 00103 00109 virtual void start_coordinates(double& x, double& y, double& z) ; 00110 00116 virtual void end_coordinates(double& x, double& y, double& z) ; 00117 00118 // this will recompute the 2 tangents for each edge, considering the geo edge they are into 00119 void compute_tangents_for_each_edge(); 00120 00121 void compute_control_points_on_boundary_edges(double min_dot, 00122 std::map<EntityHandle, SmoothFace*> & mapSurfaces, 00123 Tag controlPointsTag, Tag markTag); 00124 00125 ErrorCode evaluate_smooth_edge(EntityHandle eh, double &tt, 00126 CartVect & outv, CartVect & out_tangent) ; 00127 00128 private: 00129 00130 std::vector<EntityHandle> _entities;// the mesh edges are stored here for fast access 00131 double _leng; 00132 std::vector<double> _fractions;// they are increasing from 0. to 1., do we need these? 00133 // this will be decided apriori, and eventually reset for paver 00134 // fractions will be from 0.0.. to 1.0, they will be decided upon the length of the geo edge 00135 00136 Tag _edgeTag; 00137 00138 Interface * _mb; 00139 EntityHandle _set; 00140 GeomTopoTool * _gtt; 00141 00142 00143 00144 }; 00145 00146 } // namespace moab 00147 #endif /* SMOOTHCURVE_HPP_ */