cgma
TDOctreeRefFace.hpp
Go to the documentation of this file.
00001 //- Class:       TDOctreeRefFace
00002 //- Description: Tool data for storing additional information related to surface faceting
00003 //- Owner:       W. R. Quadors
00004 //- Checked by:
00005 //- Version:
00006 
00007 #ifndef TD_SKELETON_ref_FACE
00008 
00009 #define TD_SKELETON_ref_FACE
00010 
00011 #include "CubitDefines.h"
00012 #include "ToolData.hpp"
00013 #include "MemoryManager.hpp"
00014 #include "DLIList.hpp"
00015 #include "CubitVector.hpp"
00016 #include "CastTo.hpp"
00017 
00018 class RefFace;
00019 class CubitPoint;
00020 class CubitFacet;
00021 class CubitFacetEdge;
00022 class CubitTransformMatrix;
00023 
00024   
00025 class TDOctreeRefFace : public ToolData
00026 {
00027 private:
00028 
00029     //static MemoryManager memoryManager;
00030     //- memory management object
00031 
00032   DLIList<CubitPoint *> *ptrCubitPointList;
00033 
00034   DLIList<CubitFacetEdge *> *ptrCubitFacetEdgeList;
00035 
00036   DLIList<CubitFacet *> *ptrCubitFacetList;
00037 
00038   RefFace *refFace;
00039 
00040   DLIList<int> loopIndex;
00041 
00042   int lastCurveID;
00043     
00044   CubitBoolean visit;
00045     // This stores the starting curve id of every loop in a ref_face
00046     // Using this adjacency relation between the curves can be found
00047     // loopIndexLastCurveID stores the last curve id of all loops
00048 
00049     // If bad surface facetting is detected, don't create 2dmat
00050   CubitBoolean create_2dmat;
00051   
00052 public:
00053 
00054   TDOctreeRefFace();
00055     //- constructor
00056 
00057   ~TDOctreeRefFace();
00058     //- destructor
00059  
00060   inline CubitBoolean get_visit( void )const{ return visit; }
00061   inline void set_visit( CubitBoolean type ){ visit = type; }
00062 
00063   void set_create_2dmat(const CubitBoolean new_val) {create_2dmat = new_val;}
00064   CubitBoolean get_create_2dmat() {return create_2dmat;}
00065 
00066   void set_ref_face( RefFace *ptr_ref_face ){ refFace = ptr_ref_face; } 
00067  
00068   void append_list_item( int loop_id ){ loopIndex.append(loop_id); }
00069 
00070   static int is_td_octree_ref_face(const ToolData* td)
00071       {return (CAST_TO(const_cast<ToolData*>(td), TDOctreeRefFace) != NULL);}
00072         
00073   void set_last_curve_id( int id ){ lastCurveID = id; }
00074     //- this is used along with loopIndex to determine non-adj curves
00075 
00076   DLIList<CubitPoint *> *get_ptr_cubit_point_list(){ return ptrCubitPointList; }
00077   void set_ptr_cubit_point_list( DLIList<CubitPoint *> *ptr_cubit_point_list ){ ptrCubitPointList = ptr_cubit_point_list; } 
00078  
00079   DLIList<CubitFacetEdge *> *get_ptr_cubit_facet_edge_list(){ return ptrCubitFacetEdgeList; }
00080   void set_ptr_cubit_facet_edge_list( DLIList<CubitFacetEdge *> *ptr_cubit_facet_edge_list ){ ptrCubitFacetEdgeList = ptr_cubit_facet_edge_list; } 
00081  
00082   DLIList<CubitFacet *> *get_ptr_cubit_facet_list(){ return ptrCubitFacetList; }
00083   void set_ptr_cubit_facet_list( DLIList<CubitFacet *> *ptr_cubit_facet_list ){ ptrCubitFacetList = ptr_cubit_facet_list; } 
00084  
00085     //- get and set pointers to DLIList of CubitPoint, CubitFacetEdge, CubitFacet 
00086         
00087   
00088   CubitBoolean is_adj_curves( int id1, int id2 );
00089     //- returns true if the two curves are adjacent
00090 
00091     //SetDynamicMemoryAllocation(memoryManager)
00092     //- class specific new and delete operators
00093     
00094     // static void set_memory_allocation_increment(int increment = 0){memoryManager.set_memory_allocation_increment(increment);}
00095     //- set block memory size increment
00096   
00097     // static void destroy_memory(){memoryManager.destroy_memory();}
00098     //- destroy all memory allocted to this object
00099 
00100   CubitFacet* split_facet_into_two_facets( CubitFacet *target_facet, CubitPoint* edge1_pt,
00101                                            CubitPoint* edge2_pt, 
00102                                            CubitFacetEdge *boundary_edge,
00103                                            CubitPoint* new_pt,
00104                                            DLIList<CubitFacet*> &facet_list,
00105                                            DLIList<CubitFacetEdge*> &facet_edge_list,
00106                                            DLIList<CubitPoint*> &point_list);
00107 
00108   CubitBoolean split_facet_locally_along_edge( CubitFacet *target_facet, CubitPoint* edge1_pt,
00109                                                CubitPoint* edge2_pt, 
00110                                                CubitFacetEdge *boundary_edge,
00111                                                int num_of_segments,
00112                                                DLIList<CubitFacet*> &facet_list,
00113                                                DLIList<CubitFacetEdge*> &facet_edge_list,
00114                                                DLIList<CubitPoint*> &point_list); 
00115   
00116   CubitBoolean split_facet_type_00( CubitFacet *target_facet, DLIList<CubitFacet*> &facet_list, DLIList<CubitFacetEdge*> &facet_edge_list, DLIList<CubitPoint*> &point_list );
00117   CubitBoolean split_facet_type_01( CubitFacet *target_facet, DLIList<CubitFacet*> &facet_list, DLIList<CubitFacetEdge*> &facet_edge_list, DLIList<CubitPoint*> &point_list );
00118   CubitBoolean split_facet_type_02( CubitFacet *target_facet, DLIList<CubitFacet*> &facet_list, DLIList<CubitFacetEdge*> &facet_edge_list, DLIList<CubitPoint*> &point_list );
00119   CubitBoolean split_facet_type_03( CubitFacet *target_facet, DLIList<CubitFacet*> &facet_list, DLIList<CubitFacetEdge*> &facet_edge_list, DLIList<CubitPoint*> &point_list );
00120   CubitBoolean split_facet_type_12( CubitFacet *target_facet, DLIList<CubitFacet*> &facet_list, DLIList<CubitFacetEdge*> &facet_edge_list, DLIList<CubitPoint*> &point_list );
00121   CubitBoolean split_facet_type_13( CubitFacet *target_facet, DLIList<CubitFacet*> &facet_list, DLIList<CubitFacetEdge*> &facet_edge_list, DLIList<CubitPoint*> &point_list );
00122   CubitBoolean split_facet_type_23( CubitFacet *target_facet, DLIList<CubitFacet*> &facet_list, DLIList<CubitFacetEdge*> &facet_edge_list, DLIList<CubitPoint*> &point_list );
00123   CubitBoolean split_facet_type_33( CubitFacet *target_facet, DLIList<CubitFacet*> &facet_list, DLIList<CubitFacetEdge*> &facet_edge_list, DLIList<CubitPoint*> &point_list );
00124       
00125 
00126   static CubitStatus add_td( RefFace *ref_face );
00127   static TDOctreeRefFace* get_td( RefFace *ref_face );
00128 
00129   CubitBoolean check_valid_facets(CubitBoolean disable_if_bad);
00130 
00131 };
00132     
00133 
00134 #endif // TD_SKELETON_ref_FACE
00135 
00136 
00137 //EOF
00138 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines