moab
|
00001 00006 #ifndef moab_REORDER_TOOL_HPP 00007 #define moab_REORDER_TOOL_HPP 00008 00009 #include "moab/Types.hpp" 00010 #include <vector> 00011 00012 namespace moab { 00013 00014 class Core; 00015 class Range; 00016 00017 class ReorderTool 00018 { 00019 public: 00020 00021 ReorderTool( Core* moab ) : mMB(moab) {} 00022 00023 00048 ErrorCode handle_order_from_int_tag( Tag ordering_tag, 00049 int ordering_tag_skip_value, 00050 Tag& new_handle_tag_out ); 00051 00075 ErrorCode handle_order_from_int_tag( EntityType type, 00076 int vals_per_ent, 00077 Tag ordering_tag, 00078 int ordering_tag_skip_value, 00079 Tag new_handle_tag ); 00080 00081 00101 ErrorCode handle_order_from_sets_and_adj( const Range& sets, 00102 Tag& new_handle_tag_out ); 00103 00122 ErrorCode reorder_entities( Tag new_handle_tag ); 00123 00124 private: 00125 00135 ErrorCode reorder_tag_data( EntityType type, Tag new_handles, Tag reorder_tag ); 00136 00142 ErrorCode update_set_contents( Tag new_handles ); 00143 00149 void get_entities( EntityType t, int vals_per_ent, Range& result ); 00150 00154 ErrorCode get_reordered_handles( Tag tag, 00155 const Range& old_handles, 00156 std::vector<EntityHandle>& new_handles ); 00157 00161 ErrorCode get_reordered_handles( Tag tag, 00162 const std::vector<EntityHandle>& old_handles, 00163 std::vector<EntityHandle>& new_handles ); 00164 00168 ErrorCode get_reordered_handles( Tag tag, 00169 const EntityHandle* old_handles, 00170 EntityHandle* new_handles, 00171 size_t num_handles ); 00172 00176 ErrorCode get_new_handles( Tag tag, 00177 Range& old_handles, 00178 std::vector<EntityHandle>& newhandles ); 00179 00183 ErrorCode int_order_from_sets_and_adj( const Range& sets, 00184 Tag order_tag, 00185 int skip_val, 00186 std::vector<std::vector<EntityHandle>*>& data ); 00187 00188 Core* mMB; 00189 }; 00190 00191 00192 00193 } // namespace moab 00194 00195 #endif // moab_REORDER_TOOL_HPP