cgma
CubitPointData.hpp
Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //
00003 //  File: CubitPointData.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 CubitPointData and treat it as if it is a CubitPoint.
00011 //            For example:
00012 //               CubitPoint *cp = (CubitPoint *) new CubitPointData(...);
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 CUBITPOINTDATA_HPP
00021 #define CUBITPOINTDATA_HPP
00022 
00023 // Include for CubitBoolean
00024 #include "CubitDefines.h"
00025 #include "CubitVector.hpp"
00026 #include "DLIList.hpp"
00027 #include "MemoryManager.hpp"
00028 #include "ToolDataUser.hpp"
00029 #include "CubitMatrix.hpp"
00030 #include "CubitPoint.hpp"
00031 class CubitFacet;
00032 
00033 class CubitPointData : public CubitPoint
00034 {
00035 private:
00036 
00037   CubitVector coords;
00038   DLIList<CubitFacet*> *attachedFacets;
00039 
00040   static MemoryManager memoryManager;
00041     //- memory management object
00042 
00043   int entityId;
00044 
00045 public:
00046   
00047   CubitPointData(double x_val, double y_val, double z_val );
00048   CubitPointData(double x_val, double y_val, double z_val,int *);
00049   CubitPointData( const CubitVector &new_point );
00050   ~CubitPointData();
00051 
00052   SetDynamicMemoryAllocation(memoryManager)
00053       //- class specific new and delete operators
00054 
00055   int id(){ return entityId;}
00056   void set_id( int new_id ) { entityId = new_id; }
00057 
00058   double x(){return coords.x();}
00059   double y(){return coords.y();}
00060   double z(){return coords.z();}
00061   void set( const CubitVector &pos ) { coords = pos; }
00062 
00063   void marked(int marked){ markedFlag = marked;}
00064   int marked(){return markedFlag;}
00065     //- generic marker for efficient sorting.
00066       
00067   CubitVector coordinates() const { return coords; }
00068   void coordinates(double point_array[3]);
00069 
00070   void add_facet( CubitFacet *facet);
00071   void remove_facet( CubitFacet *facet );
00072   int num_adj_facets();
00073 
00074   void facets( DLIList<CubitFacet*> &facet_list )
00075     { if (attachedFacets) facet_list += *attachedFacets; }
00076   void tris( DLIList<CubitFacet*> &facet_list ) 
00077         { facets(facet_list); }
00078   void edges( DLIList<CubitFacetEdge*> &edge_list );
00079   void points( DLIList<CubitPoint*> &point_list )
00080     { point_list.append( this ); }
00081 
00082   void compute_avg_normal();
00083   CubitStatus merge_points( CubitPoint *dead_point, CubitBoolean keep_point = CUBIT_FALSE );
00084   CubitStatus collapse_edge( CubitPointData *dead_point );
00085 };
00086 
00087 #endif
00088 
00089 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines