23 return mIndexFace.size();
28 #if MYGUI_DEBUG_MODE == 1
34 _index = mIndexFace.size();
38 if (_index == mIndexFace.size())
41 index = mIndexFace.size();
43 mIndexFace.push_back(_index);
44 mIndexBack.push_back(_index);
49 index = mIndexFace[_index];
51 size_t count = mIndexFace.size();
52 for (
size_t pos = 0; pos < count; ++pos)
54 if (mIndexFace[pos] >= index)
57 mIndexFace.insert(mIndexFace.begin() + _index, index);
60 mIndexBack.push_back(0);
61 for (
size_t pos = 0; pos < count; ++pos)
63 mIndexBack[mIndexFace[pos]] = pos;
67 #if MYGUI_DEBUG_MODE == 1
76 #if MYGUI_DEBUG_MODE == 1
82 size_t index = mIndexFace[_index];
84 mIndexFace.erase(mIndexFace.begin() + _index);
85 mIndexBack.pop_back();
87 size_t count = mIndexFace.size();
88 for (
size_t pos = 0; pos < count; ++pos)
90 if (mIndexFace[pos] > index)
92 mIndexBack[mIndexFace[pos]] = pos;
95 #if MYGUI_DEBUG_MODE == 1
111 #if MYGUI_DEBUG_MODE == 1
120 #if MYGUI_DEBUG_MODE == 1
129 #if MYGUI_DEBUG_MODE == 1
134 std::swap(mIndexFace[_index1], mIndexFace[_index2]);
135 std::swap(mIndexBack[mIndexFace[_index1]], mIndexBack[mIndexFace[_index2]]);
141 #if MYGUI_DEBUG_MODE == 1
146 std::swap(mIndexBack[_index1], mIndexBack[_index2]);
147 std::swap(mIndexFace[mIndexBack[_index1]], mIndexFace[mIndexBack[_index2]]);
150 #if MYGUI_DEBUG_MODE == 1
152 void BiIndexBase::checkIndexes()
154 assert(mIndexFace.size() == mIndexBack.size());
157 std::vector<bool> vec;
158 size_t count = mIndexFace.size();
161 for (
size_t pos = 0; pos < count; ++pos)
162 vec.push_back(
false);
164 for (
size_t pos = 0; pos < count; ++pos)
167 size_t index = mIndexBack[pos];
169 throw new std::exception();
172 index = mIndexFace[pos];
174 throw new std::exception();
177 throw new std::exception();
181 for (
size_t pos = 0; pos < count; ++pos)
184 throw new std::exception();
188 for (
size_t pos = 0; pos < count; ++pos)
190 size_t index = mIndexFace[pos];
191 if (mIndexBack[index] != pos)
192 throw new std::exception();