Mesh Oriented datABase  (version 5.5.0)
An array-based unstructured mesh library
EntitySequence.cpp
Go to the documentation of this file.
1 #include "EntitySequence.hpp"
2 #include "SequenceData.hpp"
3 
4 namespace moab
5 {
6 
8 {
9  return start_handle() == data()->start_handle() && end_handle() == data()->end_handle();
10 }
11 
13 {
14  return 0;
15 }
16 
18 {
19  EntityHandle new_end = endHandle - count;
20  if( new_end < startHandle ) return MB_FAILURE;
21 
22  endHandle = new_end;
23  return MB_SUCCESS;
24 }
25 
27 {
28  EntityHandle new_start = startHandle + count;
29  if( new_start > endHandle ) return MB_FAILURE;
30 
31  startHandle = new_start;
32  return MB_SUCCESS;
33 }
34 
36 {
37  EntityHandle new_start = startHandle - count;
38  if( new_start < data()->start_handle() ) return MB_FAILURE;
39 
40  startHandle = new_start;
41  return MB_SUCCESS;
42 }
43 
45 {
46  EntityHandle new_end = endHandle + count;
47  if( new_end > data()->end_handle() ) return MB_FAILURE;
48 
49  endHandle = new_end;
50  return MB_SUCCESS;
51 }
52 
54 {
55  if( sequenceData != other.sequenceData ) return MB_FAILURE;
56  if( end_handle() + 1 == other.start_handle() )
57  {
58  endHandle = other.end_handle();
59  other.startHandle = other.end_handle() + 1;
60  }
61  else if( start_handle() == other.end_handle() + 1 )
62  {
63  startHandle = other.start_handle();
64  other.endHandle = other.start_handle() - 1;
65  }
66  else
67  return MB_FAILURE;
68  return MB_SUCCESS;
69 }
70 
72 {
73  return 0;
74 }
75 
76 } // namespace moab