cgma
ChollaSurface.hpp
Go to the documentation of this file.
00001 //- Class: ChollaSurface
00002 //- Owner: Steven J. Owen
00003 //- Description: Maintains a list of mesh.  This is used to store
00004 //-        the exterior skin while creating a geometry from a mesh.
00005 //- Created: 5/25/00
00006 //- Checked By:
00007 //- Version:
00008 
00009 #ifndef ChollaSurface_HPP
00010 #define ChollaSurface_HPP
00011 
00012 
00013 #include "DLIList.hpp"
00014 #include "ChollaEntity.hpp"
00015 
00016 class ChollaVolume;
00017 class ChollaCurve;
00018 class ChollaPoint;
00019 class FacetEntity;
00020 class CubitFacet;
00021 class CubitPoint;
00022 class CubitFacetEdge;
00023 class FacetEvalTool;
00024 
00025 class ChollaSurface : public ChollaEntity
00026 {
00027 private:   
00028   int id;
00029   int blockId;
00030   CubitBoolean myFlag;
00031 
00032   DLIList<FacetEntity*> surfaceElemList;
00033   DLIList<ChollaCurve*> curveList;
00034   DLIList<ChollaVolume*> volList;
00035   void *mySurface;
00036   FacetEvalTool *myEvalTool;
00037   ChollaSurface *myMergePartner;
00038   void check_faceting();
00039   
00040 public:
00041    
00042   ChollaSurface(int block_id);
00043   ~ChollaSurface();
00044 
00045   void get_facets(DLIList<FacetEntity*> &surface_facets)
00046     {surface_facets += surfaceElemList;}
00047   void get_points( DLIList<CubitPoint *> &point_list );
00048 
00049   void assign_geometric_surface(void *surf)
00050     {mySurface = surf;}
00051   void* get_geometric_surface()
00052     {return mySurface;}
00053   void assign_eval_tool(FacetEvalTool *eval_tool_ptr)
00054     {myEvalTool = eval_tool_ptr;}
00055   FacetEvalTool* get_eval_tool()
00056     {return myEvalTool;}
00057   
00058   ChollaSurface *merge_partner(){ return myMergePartner; }
00059   void set_merge_partner( ChollaSurface *merge_partner )
00060     { myMergePartner = merge_partner;}
00061   
00062   CubitBoolean get_flag(){ return myFlag; }
00063   void set_flag( CubitBoolean stat ){ myFlag = stat; }                       
00064 
00065   void add_facet(FacetEntity *exterior_face)
00066     {surfaceElemList.append(exterior_face);}
00067 
00068   int add_mesh_unique(FacetEntity *exterior_face)
00069     {return surfaceElemList.append_unique(exterior_face);} 
00070   
00071   void remove_facet( FacetEntity *facet )
00072   {surfaceElemList.remove( facet );}
00073   
00074   bool is_contain( FacetEntity *facet );
00075 
00076   DLIList<FacetEntity*> &get_facet_list()
00077     {return surfaceElemList;}
00078   DLIList<FacetEntity*> *get_facet_list_ptr()
00079     {return &surfaceElemList;}
00080   void get_vertices( DLIList<ChollaPoint *> &chpt_list );
00081   void get_curves( DLIList<ChollaCurve*> &bcm_list )
00082     {bcm_list = curveList; }
00083   void add_curve( ChollaCurve *bcm_ptr )
00084     {curveList.append(bcm_ptr);}
00085   void add_curve_unique( ChollaCurve *bcm_ptr )
00086     {curveList.append_unique(bcm_ptr);}
00087   void remove_curve( ChollaCurve *bcm_ptr)
00088     {curveList.remove(bcm_ptr);}
00089   void get_volumes( DLIList<ChollaVolume*> &cholla_vol_list )
00090     {cholla_vol_list = volList; }
00091   void add_volume( ChollaVolume *cholla_vol_ptr )
00092     {volList.append(cholla_vol_ptr);}
00093   void add_volume_unique( ChollaVolume *cholla_vol_ptr )
00094     {volList.append_unique(cholla_vol_ptr);}
00095   void remove_volume( ChollaVolume *cholla_vol_ptr)
00096     {volList.remove(cholla_vol_ptr);}
00097   int num_volumes(){return volList.size();}
00098   CubitBoolean is_in_volume( ChollaVolume *chvol_ptr );
00099   
00100   int get_block_id()
00101     {return blockId;}
00102   void set_block_id(int flag)
00103     { blockId = flag; }
00104 
00105   int get_id(){return id;}
00106 
00107   CubitStatus get_adj_facets( FacetEntity *start_face_ptr, 
00108                              DLIList<FacetEntity*> &face_list,
00109                              int mydebug = 0,
00110                              bool bound_check = false,
00111                              bool feature_edge_check = true);
00112     // recursive function that creates a list of all faces connected
00113     // the passed in face that are part of this surface (or shell)
00114 
00115 
00116   CubitStatus split_surface( DLIList<ChollaSurface*> &block_surface_list );
00117     // split this surface into multiple ChollaSurface where there are
00118     // discontinuous faces.
00119 
00120   CubitStatus feature_angle( double min_dot, 
00121                              DLIList<CubitFacetEdge *> &feature_edge_list);
00122     // mark all edges that exceed the specified feature angle
00123     // min_dot is the minimum dot product between adjacent face normals
00124     
00125     CubitStatus add_preexisting_feature_edges( DLIList<CubitFacetEdge *> &feature_edge_list);
00126       // edges that were marked previously in function ChollaEngine::mark_features
00127       // are added to the feature edge list
00128 
00129   CubitStatus non_manifold_edges( DLIList<CubitFacetEdge *> &feature_edge_list );
00130     // mark all edges that are non-manifold (have more than 2 adj facets
00131 
00132   CubitStatus clean_features( );
00133     // clean up edges that do not form complete loops as a result 
00134     // of feature angle
00135   
00136   void init_hit_flags();
00137     // initialize the hit flags to the block surface id - used for 
00138     // traversing the faces
00139 
00140   CubitStatus update_boundary_tool_data();
00141     //- update the surface IDs on the boundary facet tooldatas
00142 
00143   void reset_facet_flags();
00144     //- reset the marked flags on the facets
00145 
00146   CubitBoolean is_adjacent( ChollaSurface *other_surf );
00147     //- determine if other_surf is adjacent to this surface
00148 
00149   DLIList<DLIList<CubitFacetEdge *>*> *get_loop_edges( );
00150     // return the ordered list of edges on the boundary of this surface 
00151   
00152   void flip_facets();
00153     // invert all the facets on this surface
00154   
00155   void debug_draw();
00156 };
00157 
00158 template <> struct DLIListSorter<ChollaSurface*>
00159 {
00160   bool operator()(ChollaSurface* a, ChollaSurface* b) { return a->get_id() < b->get_id(); }
00161 };
00162 
00163 #endif
00164 
00165 
00166 
00167 
00168 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines