cgma
Faceter.hpp
Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 // Filename      : Faceter.hpp
00003 //
00004 // Purpose       : Facets a surface.
00005 //
00006 // Special Notes : 
00007 //
00008 // Creator       : David White
00009 //
00010 // Creation Date : 03/01/02
00011 //-------------------------------------------------------------------------
00012 
00013 #ifndef FACETER_HPP
00014 #define FACETER_HPP
00015 
00016 #include "CubitDefines.h"
00017 #include "GeometryDefines.h" //need GEOMETRY_RESABS
00018 #include "DLIList.hpp"
00019 #include "CubitVector.hpp"
00020 
00021 class CubitFacet;
00022 class CubitPoint;
00023 class CubitVector;
00024 class FaceterPointData;
00025 class RefFace;
00026 class RefEdge;
00027 class PointGridSearch;
00028 class GMem;
00029 
00030 
00031 template <class X> class DLIList;
00032 
00033 class Faceter
00034 {
00035 
00036   public:
00037 
00038   Faceter( RefFace *face );
00039   ~Faceter();
00040 
00041   CubitStatus facet_surface( DLIList <CubitFacet*> &results,
00042                              DLIList <CubitPoint*> &point_list);
00043     //- Facets the surface and returns the list of facets that
00044     //- approximate the surface.
00045 
00046   protected:
00047 
00048   private:
00049 
00050   RefFace *thisRefFacePtr;
00051   PointGridSearch *gridSearchPtr;
00052   const double gridCellScale;
00053   CubitBoolean avoidedOverlap;
00054   DLIList <CubitPoint*> *globalPointList;
00055 //  GeomIntersectionTool* iToolPtr;
00056 
00057   CubitStatus facet_loop(DLIList <CubitPoint*> *loop_ptr,
00058                          DLIList <CubitFacet*> &results);
00059     //- Facets' the loop of CubitPoints.
00060 
00061   CubitStatus facet_factory(FaceterPointData* curr_faceter_data,
00062                             CubitFacet *&new_facet, 
00063                             DLIList <FaceterPointData*> &order_list);
00064     //- given the current data, create a new trianglular facet.
00065     //- Also update the data associated with the curr_data (next and prev data).
00066   CubitBoolean avoid_facet(FaceterPointData* curr_faceter_data,
00067                            DLIList<FaceterPointData*> &order_list);
00068     //- Determine if the facet should be avoided.  Also adds curr_faceter_data
00069     //- back to the order_list at the begining of the list (since we
00070     //- pop through the list, this is really the end).  Also modify
00071     //- the angle by angle + 2pi so we don't hit this point for a while and
00072     //- hopefully serendiputiously we avoid having to create this facet...
00073     //- Set the class variable avoidedOverlap to be true if the
00074     //- facet is avoided.  Returns FALSE if nothing is done and the
00075     //- facet is okay to create.
00076                            
00077   
00078   CubitStatus get_boundary_points( DLIList <DLIList<CubitPoint*>*> &boundary_point_loops ) const;
00079     //- Get the loops of boundary facet points.
00080   
00081   CubitStatus get_curve_facets( RefEdge* curve, DLIList<CubitPoint*>& segments ) const;
00082     //- Get the facet points in order from start to end for the curve.
00083 
00084   void max_min_edge_ratio( DLIList <DLIList <CubitPoint*>*> &boundary_point_loops,
00085                            double &ratio,
00086                            double &cell_size);
00087     //- Gets the ratio for the gridcell size for the gridsearch tool.
00088 
00089   CubitStatus interior_angle(DLIList <CubitPoint*> *loop_ptr,
00090                              double &my_angle);
00091     //- Gets the interior angle of the loop_ptr measured at the
00092     //- current point in the list.  The angle is taken between the prev
00093     //- point and next point in the list.
00094 
00095 
00096 };
00097 
00098 
00099 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines