MOAB: Mesh Oriented datABase  (version 5.2.1)
AssocPair.hpp
Go to the documentation of this file.
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, iBase_Instance iface0, iRel_RelationType ent_or_set0, iRel_IfaceType type0,
00017                iRel_RelationStatus status0, iBase_Instance iface1, iRel_RelationType ent_or_set1, iRel_IfaceType type1,
00018                iRel_RelationStatus status1 );
00019 
00020     ~AssocPair();
00021 
00022     iBase_Instance iface_instance( int iface_no ) const;
00023     iRel_IfaceType iface_type( int iface_no ) const;
00024     iRel_RelationType relation_type( int iface_no ) const;
00025     iRel_RelationStatus relation_status( int iface_no ) const;
00026 
00027     int change_type( int iface_no, iRel_RelationType type );
00028     int change_status( int iface_no, iRel_RelationStatus status );
00029 
00030     bool equivalent( iBase_Instance iface1, iBase_Instance iface2, bool* order_switched = NULL );
00031     bool equivalent( iRel_IfaceType type1, iRel_IfaceType type2, bool* order_switched = NULL );
00032 
00033     bool contains( iBase_Instance iface );
00034 
00035     int get_all_entities( int iface_no, int dimension, iBase_EntityHandle** entities, int* entities_alloc,
00036                           int* entities_size );
00037 
00038     int get_all_sets( int iface_no, iBase_EntitySetHandle** sets, int* sets_alloc, int* sets_size );
00039 
00040     int get_entities( int iface_no, int dimension, iBase_EntitySetHandle set_handle, iBase_EntityHandle** entities,
00041                       int* entities_alloc, int* entities_size );
00042 
00043     int get_ents_dims( int iface_no, iBase_EntityHandle* entities, int entities_size, int** ent_types,
00044                        int* ent_types_alloc, int* ent_types_size );
00045 
00046     int set_relation( iBase_EntityHandle ent1, iBase_EntityHandle ent2 );
00047     int set_relation( iBase_EntitySetHandle set1, iBase_EntityHandle ent2 );
00048     int set_relation( iBase_EntityHandle ent1, iBase_EntitySetHandle set2 );
00049     int set_relation( iBase_EntitySetHandle set1, iBase_EntitySetHandle set2 );
00050 
00051     int get_relation( int iface_no, iBase_EntityHandle* entities, int num_entities, iBase_EntityHandle* tag_values );
00052     int get_relation( int iface_no, iBase_EntitySetHandle* sets, int num_sets, iBase_EntityHandle* tag_values );
00053     int get_relation( int iface_no, iBase_EntityHandle* entities, int num_entities, iBase_EntitySetHandle* tag_values );
00054     int get_relation( int iface_no, iBase_EntitySetHandle* sets, int num_sets, iBase_EntitySetHandle* tag_values );
00055     int get_relation( int iface_no, iBase_EntityHandle* entities, int num_entities, iBase_EntityIterator* tag_values );
00056     int get_relation( int iface_no, iBase_EntitySetHandle* sets, int num_sets, iBase_EntityIterator* tag_values );
00057 
00058     int rmv_relation( int iface_no, iBase_EntityHandle* entities, int num_entities );
00059     int rmv_relation( int iface_no, iBase_EntitySetHandle* sets, int num_sets );
00060 
00061     int get_gids( int iface_no, iBase_EntityHandle* entities, int num_entities, int* tag_values );
00062     int get_gids( int iface_no, iBase_EntitySetHandle* sets, int num_sets, int* tag_values );
00063 
00064     int get_dims( int iface_no, iBase_EntityHandle* entities, int num_entities, int* tag_values );
00065     int get_dims( int iface_no, iBase_EntitySetHandle* sets, int num_sets, int* tag_values );
00066 
00067   private:
00068     AssocPair();
00069 
00070     int populate_recursive( int iface_no, iBase_EntitySetHandle set, iBase_EntityHandle related_ent );
00071     int populate_recursive( int iface_no, iBase_EntitySetHandle set, iBase_EntitySetHandle related_set );
00072 
00073     int unpopulate_recursive( int iface_no, iBase_EntitySetHandle set );
00074 
00075     iRel_Instance instance;
00076     AssocPairSide* relSides[2];
00077     iRel_RelationType entOrSet[2];
00078     iRel_RelationStatus relStatus[2];
00079     int pairId;
00080 
00081     static int currId;
00082 };
00083 
00084 inline iBase_Instance AssocPair::iface_instance( int iface_no ) const
00085 {
00086     return relSides[iface_no]->instance();
00087 }
00088 
00089 inline iRel_IfaceType AssocPair::iface_type( int iface_no ) const
00090 {
00091     return relSides[iface_no]->type();
00092 }
00093 
00094 inline iRel_RelationType AssocPair::relation_type( int iface_no ) const
00095 {
00096     return entOrSet[iface_no];
00097 }
00098 
00099 inline iRel_RelationStatus AssocPair::relation_status( int iface_no ) const
00100 {
00101     return relStatus[iface_no];
00102 }
00103 
00104 static inline AssocPair* assocpair_handle( iRel_PairHandle pair )
00105 {
00106     return reinterpret_cast< AssocPair* >( pair );
00107 }
00108 #define ASSOCPAIRI assocpair_handle( pair )
00109 
00110 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines