MOAB: Mesh Oriented datABase
(version 5.4.1)
|
00001 #ifndef ASSOCPAIR_HPP 00002 #define ASSOCPAIR_HPP 00003 00004 #include "iRel_Lasso.hpp" 00005 #include "AssocPairSide.hpp" 00006 00007 #include <sstream> 00008 00009 class Lasso; 00010 00011 class AssocPair 00012 { 00013 public: 00014 friend class Lasso; 00015 00016 AssocPair( iRel_Instance instance, 00017 iBase_Instance iface0, 00018 iRel_RelationType ent_or_set0, 00019 iRel_IfaceType type0, 00020 iRel_RelationStatus status0, 00021 iBase_Instance iface1, 00022 iRel_RelationType ent_or_set1, 00023 iRel_IfaceType type1, 00024 iRel_RelationStatus status1 ); 00025 00026 ~AssocPair(); 00027 00028 iBase_Instance iface_instance( int iface_no ) const; 00029 iRel_IfaceType iface_type( int iface_no ) const; 00030 iRel_RelationType relation_type( int iface_no ) const; 00031 iRel_RelationStatus relation_status( int iface_no ) const; 00032 00033 int change_type( int iface_no, iRel_RelationType type ); 00034 int change_status( int iface_no, iRel_RelationStatus status ); 00035 00036 bool equivalent( iBase_Instance iface1, iBase_Instance iface2, bool* order_switched = NULL ); 00037 bool equivalent( iRel_IfaceType type1, iRel_IfaceType type2, bool* order_switched = NULL ); 00038 00039 bool contains( iBase_Instance iface ); 00040 00041 int get_all_entities( int iface_no, 00042 int dimension, 00043 iBase_EntityHandle** entities, 00044 int* entities_alloc, 00045 int* entities_size ); 00046 00047 int get_all_sets( int iface_no, iBase_EntitySetHandle** sets, int* sets_alloc, int* sets_size ); 00048 00049 int get_entities( int iface_no, 00050 int dimension, 00051 iBase_EntitySetHandle set_handle, 00052 iBase_EntityHandle** entities, 00053 int* entities_alloc, 00054 int* entities_size ); 00055 00056 int get_ents_dims( int iface_no, 00057 iBase_EntityHandle* entities, 00058 int entities_size, 00059 int** ent_types, 00060 int* ent_types_alloc, 00061 int* ent_types_size ); 00062 00063 int set_relation( iBase_EntityHandle ent1, iBase_EntityHandle ent2 ); 00064 int set_relation( iBase_EntitySetHandle set1, iBase_EntityHandle ent2 ); 00065 int set_relation( iBase_EntityHandle ent1, iBase_EntitySetHandle set2 ); 00066 int set_relation( iBase_EntitySetHandle set1, iBase_EntitySetHandle set2 ); 00067 00068 int get_relation( int iface_no, iBase_EntityHandle* entities, int num_entities, iBase_EntityHandle* tag_values ); 00069 int get_relation( int iface_no, iBase_EntitySetHandle* sets, int num_sets, iBase_EntityHandle* tag_values ); 00070 int get_relation( int iface_no, iBase_EntityHandle* entities, int num_entities, iBase_EntitySetHandle* tag_values ); 00071 int get_relation( int iface_no, iBase_EntitySetHandle* sets, int num_sets, iBase_EntitySetHandle* tag_values ); 00072 int get_relation( int iface_no, iBase_EntityHandle* entities, int num_entities, iBase_EntityIterator* tag_values ); 00073 int get_relation( int iface_no, iBase_EntitySetHandle* sets, int num_sets, iBase_EntityIterator* tag_values ); 00074 00075 int rmv_relation( int iface_no, iBase_EntityHandle* entities, int num_entities ); 00076 int rmv_relation( int iface_no, iBase_EntitySetHandle* sets, int num_sets ); 00077 00078 int get_gids( int iface_no, iBase_EntityHandle* entities, int num_entities, int* tag_values ); 00079 int get_gids( int iface_no, iBase_EntitySetHandle* sets, int num_sets, int* tag_values ); 00080 00081 int get_dims( int iface_no, iBase_EntityHandle* entities, int num_entities, int* tag_values ); 00082 int get_dims( int iface_no, iBase_EntitySetHandle* sets, int num_sets, int* tag_values ); 00083 00084 private: 00085 AssocPair(); 00086 00087 int populate_recursive( int iface_no, iBase_EntitySetHandle set, iBase_EntityHandle related_ent ); 00088 int populate_recursive( int iface_no, iBase_EntitySetHandle set, iBase_EntitySetHandle related_set ); 00089 00090 int unpopulate_recursive( int iface_no, iBase_EntitySetHandle set ); 00091 00092 iRel_Instance instance; 00093 AssocPairSide* relSides[2]; 00094 iRel_RelationType entOrSet[2]; 00095 iRel_RelationStatus relStatus[2]; 00096 int pairId; 00097 00098 static int currId; 00099 }; 00100 00101 inline iBase_Instance AssocPair::iface_instance( int iface_no ) const 00102 { 00103 return relSides[iface_no]->instance(); 00104 } 00105 00106 inline iRel_IfaceType AssocPair::iface_type( int iface_no ) const 00107 { 00108 return relSides[iface_no]->type(); 00109 } 00110 00111 inline iRel_RelationType AssocPair::relation_type( int iface_no ) const 00112 { 00113 return entOrSet[iface_no]; 00114 } 00115 00116 inline iRel_RelationStatus AssocPair::relation_status( int iface_no ) const 00117 { 00118 return relStatus[iface_no]; 00119 } 00120 00121 static inline AssocPair* assocpair_handle( iRel_PairHandle pair ) 00122 { 00123 return reinterpret_cast< AssocPair* >( pair ); 00124 } 00125 #define ASSOCPAIRI assocpair_handle( pair ) 00126 00127 #endif