cgma
TDGeomFacet.hpp
Go to the documentation of this file.
00001 //- Class: TDGeomFacet
00002 //- Owner: Steve Owen
00003 //- Description: Data for reading in a mesh and creating a geometry.
00004 //-              This is assumed to be stored on a facet entity.
00005 //- Checked By: 
00006 //- Version:
00007 
00008 #ifndef TD_GEOM_MESH_HPP
00009 
00010 
00011 #define TD_GEOM_MESH_HPP
00012 
00013 #include "CubitDefines.h"
00014 #include "DLIList.hpp"
00015 #include "ToolData.hpp"
00016 #include "CubitPoint.hpp"
00017 class FacetEntity;
00018 class ChollaEntity;
00019 class ChollaVolume;
00020 class ChollaSurface;
00021 class ChollaCurve;
00022 class ChollaPoint;
00023 class CubitFacet;
00024 class CubitFacetEdge;
00025 
00026 
00027 class TDGeomFacet : public ToolData
00028 {
00029 private:
00030 
00031   static MemoryManager memoryManager;
00032     //- memory management object
00033 
00034   int blockId;
00035 
00036   int hitFlag;
00037     //- Used for looping.
00038 
00039   DLIList<ChollaSurface*> ChollaSurfaceList;
00040     //- list of surfaces this element is on.
00041 
00042   DLIList<ChollaCurve*> ChollaCurveList;
00043     //- list of curves this element (edge) is on
00044   
00045   DLIList<ChollaPoint*> ChollaPointList;
00046     //- list chollapoints this element (point) is on 
00047   
00048   DLIList<CubitPoint*> myPoints;
00049     //- list of associated points for this entity (could be one).
00050 
00051   CubitVector normal;
00052     //- normal or tangent vector of a facet or facet edge
00053 
00054   DLIList<CubitFacetEdge *> *partnerEdgeList;
00055     //- other edges that share the same geometry
00056 
00057   DLIList<CubitPoint *> *partnerPointList;
00058     //- other points that share the same geometry
00059 
00060 public:
00061 
00062   TDGeomFacet();
00063     //- constructor
00064 
00065   ~TDGeomFacet();
00066 
00067   static int is_geom_facet(const ToolData* td);
00068   
00069   int get_block_id()
00070     {return blockId;}
00071 
00072   void set_block_id(int new_id)
00073     {blockId = new_id;}
00074 
00075   int get_hit_flag()
00076     {return hitFlag;}
00077 
00078   void set_hit_flag(int flag)
00079     {hitFlag = flag;}
00080   
00081   void add_cholla_owner(ChollaEntity *cholla_entity);
00082 
00083   void add_cholla_surf(ChollaSurface *f_s_m);
00084 
00085   void get_cholla_surfs(DLIList<ChollaSurface*> &surf_list)
00086     {surf_list =  ChollaSurfaceList;}
00087 
00088   void remove_cholla_surfs()
00089     {ChollaSurfaceList.clean_out();}
00090 
00091   void remove_cholla_surf( ChollaSurface *chsurf_ptr )
00092     {ChollaSurfaceList.remove( chsurf_ptr );}
00093 
00094   void add_cholla_curve(ChollaCurve *chcurv_ptr)
00095     {ChollaCurveList.append_unique( chcurv_ptr );}
00096 
00097   void get_cholla_curves(DLIList<ChollaCurve*> &curv_list)
00098     {curv_list =  ChollaCurveList;}
00099 
00100   void remove_cholla_curves()
00101     {ChollaCurveList.clean_out();}
00102 
00103   void remove_cholla_curve( ChollaCurve *chcurv_ptr )
00104     {ChollaCurveList.remove( chcurv_ptr );}
00105   
00106   void add_cholla_point(ChollaPoint *chpt_ptr)
00107     {ChollaPointList.append_unique( chpt_ptr );}
00108 
00109   void get_cholla_points(DLIList<ChollaPoint*> &point_list)
00110     {point_list =  ChollaPointList;}
00111   
00112   void remove_cholla_points()
00113     {ChollaPointList.clean_out();}
00114   
00115   void remove_cholla_point( ChollaPoint *point_ptr )
00116     { ChollaPointList.remove( point_ptr ); }
00117   
00118   void add_point(CubitPoint *point)
00119     {myPoints.append(point);}
00120 
00121   void delete_point(CubitPoint *point)
00122     {myPoints.omit(point);}
00123 
00124   void get_points(DLIList<CubitPoint*> &point_list)
00125     {point_list += myPoints;}
00126 
00127   CubitPoint* get_first_point()
00128     {
00129       myPoints.reset();
00130       if ( myPoints.size() )
00131         return myPoints.get();
00132       else
00133         return (CubitPoint*) NULL;
00134     }
00135 
00136   void add_partner_edge( CubitFacetEdge *partner )
00137     { if (partnerEdgeList == NULL)
00138         partnerEdgeList = new DLIList<CubitFacetEdge *>;
00139       partnerEdgeList->append( partner ); };
00140 
00141   void get_partner_edges( DLIList <CubitFacetEdge *> &partner_list )
00142     { if (partnerEdgeList != NULL) partner_list += *partnerEdgeList; };
00143 
00144   int num_partner_edges( )
00145     { if (partnerEdgeList == NULL)
00146         return 0;
00147       else
00148         return partnerEdgeList->size(); }
00149 
00150   void add_partner_point( CubitPoint *partner )
00151     { if (partnerPointList == NULL)
00152         partnerPointList = new DLIList<CubitPoint *>;
00153       partnerPointList->append( partner ); };
00154 
00155   void get_partner_points( DLIList <CubitPoint *> &partner_list )
00156     { if (partnerPointList != NULL) partner_list += *partnerPointList; };
00157 
00158   int num_partner_points( )
00159     { if (partnerPointList == NULL)
00160         return 0;
00161       else
00162         return partnerPointList->size(); }
00163   
00164   CubitBoolean is_in_volume( ChollaVolume *chvol_ptr );
00165 
00166   SetDynamicMemoryAllocation(memoryManager)
00167     //- class specific new and delete operators
00168     
00169   static void set_memory_allocation_increment(int increment = 0)
00170     {memoryManager.set_memory_allocation_increment(increment);}
00171     //- set block memory size increment
00172   
00173   static void destroy_memory()
00174     {memoryManager.destroy_memory();}
00175     //- destroy all memory allocted to this object
00176 
00177   static CubitStatus add_geom_facet(FacetEntity *facet_entity, int block_id);
00178   static CubitStatus add_geom_facet(CubitFacet *facet_ptr, int block_id);
00179   static CubitStatus add_geom_facet(CubitFacetEdge *edge_ptr, int block_id);
00180   static CubitStatus add_geom_facet(CubitPoint *point_ptr, int block_id);
00181   
00182   static TDGeomFacet* get_geom_facet(FacetEntity *facet_entity);
00183   static TDGeomFacet* get_geom_facet(CubitFacet *facet_ptr);
00184   static TDGeomFacet* get_geom_facet(CubitFacetEdge *edge_ptr);
00185   static TDGeomFacet* get_geom_facet(CubitPoint *point_ptr);
00186   
00187   static int get_block_id(FacetEntity *mesh_entity);
00188   static int get_block_id(CubitFacet *facet_ptr);
00189   static int get_block_id(CubitFacetEdge *edge_ptr);
00190   static int get_block_id(CubitPoint *point_ptr);
00191 
00192   static int get_hit_flag(FacetEntity *mesh_entity);
00193   static void set_hit_flag(FacetEntity *mesh_entity, int new_val);
00194   CubitVector get_normal( ) { return normal; }
00195   void set_normal( CubitVector &norm ) { normal = norm; }
00196 
00197   CubitBoolean is_partner( CubitFacetEdge *edge_ptr );
00198   CubitBoolean is_partner( CubitPoint *point_ptr );
00199 
00200   void reset_TD_as_new();
00201   
00202   int geo_type();
00203   
00204 };
00205     
00206 
00207 #endif // TD_GEOM_MESH_HPP
00208 
00209 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines