cgma
|
00001 //----------------------------------------------------------------------------- 00002 // 00003 // File: ImprintPointData.hpp 00004 // 00005 // Purpose: Child class of CubitPoint. It is the Cubit-specific version of 00006 // of the CubitPoint. 00007 // 00008 // Notes: Note that this class contains data which is accessed 00009 // virtually from CubitPoint. In most cases, you can create 00010 // a ImprintPointData and treat it as if it is a CubitPoint. 00011 // For example: 00012 // CubitPoint *cp = (CubitPoint *) new ImprintPointData(...); 00013 // There should be no reason to reference the CubitFacetPoint 00014 // directly. This is done to allow different data representations 00015 // of a point in addition to that used by Cubit. 00016 // 00017 //----------------------------------------------------------------------------- 00018 00019 00020 #ifndef IMPRINTPOINTDATA_HPP 00021 #define IMPRINTPOINTDATA_HPP 00022 00023 // Include for CubitBoolean 00024 #include "CubitDefines.h" 00025 #include "CubitVector.hpp" 00026 #include "DLIList.hpp" 00027 #include "CubitPoint.hpp" 00028 #include "CastTo.hpp" 00029 #include "RefEntity.hpp" 00030 #include "RefVertex.hpp" 00031 #include "MemoryManager.hpp" 00032 #include "ImprintMatchData.hpp" 00033 #include "ImprintLineSegment.hpp" 00034 00035 enum PointType { UNSET_POINT = -1, 00036 VERTEX_ON_BOUNDARY_1, 00037 VERTEX_ON_BOUNDARY_2, 00038 CREATE_NEW_VERTEX, 00039 VERTEX_ON_BOTH_BOUNDARIES, 00040 ON_BOUNDARY_1, 00041 ON_BOUNDARY_2, 00042 ON_BOTH_BOUNDARIES, 00043 ON_SURFACE_1, 00044 ON_SURFACE_2}; 00045 00046 00047 00048 class ImprintPointData : public CubitPoint 00049 { 00050 private: 00051 00052 CubitVector coords; 00053 DLIList<CubitFacet*> *attachedFacets; 00054 RefEntity *myOwner; 00055 PointType myPointType; 00056 CubitBoolean ownerRefVertex; 00057 ImprintPointData *matchingPoint; 00058 CubitBoolean startPartition; 00059 CubitBoolean endPartition; 00060 DLIList<ImprintMatchData*> *pointMatches; 00061 CubitBoolean isMatched; 00062 ImprintLineSegment *prevSeg; 00063 ImprintLineSegment *nextSeg; 00064 00065 int listLoopPos; 00066 int loopPos; 00067 int loopSize; 00068 00069 int entityId; 00070 void initialize_imprint_data(); 00071 //- Initialize just the data for this class. 00072 00073 static MemoryManager memoryManager; 00074 //- memory management object 00075 00076 public: 00077 00078 ImprintPointData(double x_val, double y_val, double z_val ); 00079 ImprintPointData( const CubitVector &new_point ); 00080 ImprintPointData( ImprintPointData *copy, CubitVector &new_coords ); 00081 00082 ~ImprintPointData(); 00083 00084 SetDynamicMemoryAllocation(memoryManager) 00085 //- class specific new and delete operators 00086 00087 int id(){ return entityId;} 00088 00089 double x(){return coords.x();} 00090 double y(){return coords.y();} 00091 double z(){return coords.z();} 00092 void set( const CubitVector &pos ) { coords = pos; } 00093 00094 void marked(int marked){ markedFlag = marked;} 00095 int marked(){return markedFlag;} 00096 //- generic marker for efficient sorting. 00097 00098 CubitVector coordinates() const { return coords; } 00099 void coordinates(double point_array[3]); 00100 void add_facet( CubitFacet *facet); 00101 void remove_facet( CubitFacet *facet ); 00102 int num_adj_facets(); 00103 00104 void facets( DLIList<CubitFacet*> &facet_list) 00105 { if (attachedFacets) facet_list += *attachedFacets; } 00106 void edges( DLIList<CubitFacetEdge*> &edge_list); 00107 void points( DLIList<CubitPoint*> &point_list) 00108 { point_list.append( this ); } 00109 00110 void compute_avg_normal(); 00111 00112 //-Functions just for imprint point data. 00113 void owner(RefEntity* my_owner) 00114 { 00115 myOwner = my_owner; 00116 } 00117 RefEntity* owner() 00118 {return myOwner;} 00119 CubitBoolean is_owner_vertex() 00120 {if (myPointType == CREATE_NEW_VERTEX || 00121 myPointType == VERTEX_ON_BOUNDARY_1 || 00122 myPointType == VERTEX_ON_BOUNDARY_2 || 00123 myPointType == VERTEX_ON_BOTH_BOUNDARIES ) 00124 return CUBIT_TRUE; 00125 else 00126 return CUBIT_FALSE; 00127 } 00128 void set_point_type(PointType type) 00129 {myPointType = type;} 00130 PointType get_point_type() 00131 {return myPointType;} 00132 CubitStatus set_matching_point(ImprintPointData *other); 00133 ImprintPointData* get_matching_point() 00134 {return matchingPoint;} 00135 void set_start_partition() 00136 {startPartition = CUBIT_TRUE;} 00137 void set_end_partition() 00138 {endPartition = CUBIT_TRUE;} 00139 CubitBoolean get_start_partition() 00140 {return startPartition;} 00141 CubitBoolean get_end_partition() 00142 {return endPartition;} 00143 void set_loop_pos( int ii, int jj, int loop_size ) 00144 { 00145 listLoopPos = ii; 00146 loopPos = jj; 00147 loopSize = loop_size; 00148 } 00149 int get_list_loop_pos() 00150 {return listLoopPos;} 00151 int get_loop_pos() 00152 {return loopPos;} 00153 int get_loop_size() 00154 {return loopSize;} 00155 void add_match_data(ImprintMatchData *match_data); 00156 void get_match_list(DLIList <ImprintMatchData*> &match_data_list); 00157 void set_matched(ImprintMatchData *match_data); 00158 void set_unmatched(); 00159 00160 CubitBoolean is_matched() 00161 {return isMatched;} 00162 ImprintLineSegment* get_prev_seg() 00163 {return prevSeg;} 00164 void set_prev_seg(ImprintLineSegment *prev_seg) 00165 {prevSeg = prev_seg;} 00166 00167 ImprintLineSegment* get_next_seg() 00168 {return nextSeg;} 00169 void set_next_seg(ImprintLineSegment *next_seg) 00170 {nextSeg = next_seg;} 00171 00172 00173 }; 00174 00175 #endif