cgma
|
00001 00009 #ifndef TD_FACET_BOUNDARY_POINT_HPP 00010 00011 00012 #define TD_FACET_BOUNDARY_POINT_HPP 00013 00014 #include "CubitDefines.h" 00015 #include "ToolData.hpp" 00016 #include "MemoryManager.hpp" 00017 #include "DLIList.hpp" 00018 #include "CubitVector.hpp" 00019 #include "CastTo.hpp" 00020 class CubitPoint; 00021 class CubitFacet; 00022 class CubitQuadFacet; 00023 class CubitFacetEdge; 00024 class CubitTransformMatrix; 00028 typedef struct BoundaryPointData 00029 { 00030 DLIList<CubitFacet *> surfFacetList; 00031 CubitVector normal; 00032 double uVal, vVal, sizeVal; 00033 int surfID; 00034 } BoundaryPointData; 00035 00036 class TDFacetBoundaryPoint : public ToolData 00037 { 00038 private: 00039 00040 static MemoryManager memoryManager; 00041 //- memory management object 00042 00043 CubitPoint *pointPtr; 00044 DLIList <BoundaryPointData *> pointDataList; 00045 00046 void init_normal( BoundaryPointData *bpd_ptr ); 00047 // initialize normals at point 00048 BoundaryPointData *get_bpd( CubitFacet *facet ); 00049 // return a boundary point data 00050 00051 public: 00052 00053 TDFacetBoundaryPoint(); 00054 //- constructor 00055 00056 ~TDFacetBoundaryPoint(); 00057 00058 static int is_facet_boundary_point(const ToolData* td) 00059 {return (CAST_TO(const_cast<ToolData*>(td), TDFacetBoundaryPoint) != NULL);} 00060 00061 void add_surf(int new_id); 00062 00063 CubitPoint *get_point() 00064 { return pointPtr; } 00065 00066 void set_point( CubitPoint *point_ptr ) 00067 { pointPtr = point_ptr; } 00068 00069 SetDynamicMemoryAllocation(memoryManager) 00070 //- class specific new and delete operators 00071 00072 static void set_memory_allocation_increment(int increment = 0) 00073 {memoryManager.set_memory_allocation_increment(increment);} 00074 //- set block memory size increment 00075 00076 static void destroy_memory() 00077 {memoryManager.destroy_memory();} 00078 //- destroy all memory allocted to this object 00079 00080 static CubitStatus add_facet_boundary_point(CubitPoint *point_ptr); 00081 // basic initializer 00082 00083 static CubitStatus add_facet_boundary_point( CubitPoint *point_ptr, 00084 CubitFacet *facet_ptr, 00085 CubitVector &normal ); 00086 static CubitStatus add_facet_boundary_point( CubitPoint *point_ptr, 00087 CubitQuadFacet *qfacet_ptr, 00088 CubitVector &normal ); 00089 // initializes with a single facet and normal 00090 00091 static TDFacetBoundaryPoint* get_facet_boundary_point(CubitPoint *point_ptr); 00092 // get the fbp from the point 00093 00094 CubitStatus get_normal( int surf_id, CubitVector &normal ); 00095 CubitStatus get_normal( CubitFacet *adj_facet, CubitVector &normal ); 00096 CubitStatus get_normal( CubitFacetEdge *edge_ptr, CubitVector &normal ); 00097 CubitStatus set_normal( int surf_id, CubitVector &normal ); 00098 //recalculate normals. Call this if an attached facet changes in some way. 00099 CubitStatus reset_normals(); 00100 //- get and set normals at a specific surface or facet 00101 00102 CubitStatus set_uv( CubitFacet *adj_facet, double u, double v ); 00103 CubitStatus set_uvs( CubitFacet *adj_facet, double u, double v, double s ); 00104 double u( CubitFacet *adj_facet ); 00105 double v( CubitFacet *adj_facet ); 00106 double s( CubitFacet *adj_facet ); 00107 CubitStatus get_uv( CubitFacet *adj_facet, double &u, double &v ); 00108 //- get and set the u-v values for this surface 00109 CubitStatus get_uvs( CubitFacet *adj_facet, double &u, double &v, double &s ); 00110 //- get and set the u-v values and size for this surface 00111 00112 00113 void add_surf_facets( DLIList<CubitFacet *> adj_facet_list ); 00114 //- add a group of facets that are adjacent to this point 00115 //- that are on the same surface 00116 void set_surf_id( CubitFacet *facet_ptr, int surf_id ); 00117 //- set id of surface associated with facet 00118 00119 CubitStatus merge_normals( CubitFacet *facet0, CubitFacet *facet1); 00120 //- merge the normals from facets 00121 00122 CubitStatus rotate_normal( CubitTransformMatrix &rotmat ); 00123 //- rotate the normals at the point 00124 00125 CubitStatus get_boundary_point_data_size( int &size_int_data, 00126 int &size_double_data ); 00127 CubitStatus get_boundary_point_data(int *int_data, double *double_data, 00128 int &iidx, int &didx ); 00129 //- retreive info for dumping to a CUB file 00130 00131 static CubitStatus new_facet_boundary_point(CubitPoint **points, 00132 CubitFacet **facets,int &iidx,int &didx, 00133 int *int_data,double *double_data); 00134 void initialize(CubitFacet **facets, 00135 int &iidx, int &didx, int *int_data,double *double_data); 00136 //- restore data from a CUB file 00137 }; 00138 00139 00140 #endif // TD_FACET_BOUNDARY_EDGE_HPP 00141 00142