BOOL SVGAreaIterator::Step(BOOL forward) { HTML_Element* next_elm = m_current_elm; while (next_elm) { HTML_Element* layouted_elm = SVGUtils::GetElementToLayout(next_elm); OP_STATUS status = TestElement(next_elm, layouted_elm); switch (status) { default: // In case of error case OpSVGStatus::SKIP_ELEMENT: next_elm = forward ? next_elm->Next() : next_elm->Prev(); break; case OpSVGStatus::SKIP_SUBTREE: next_elm = forward ? static_cast<HTML_Element*>(next_elm->NextSibling()) : static_cast<HTML_Element*>(next_elm->PrevSibling()); break; case OpStatus::OK: // Yay! Found one m_current_elm = next_elm; return TRUE; } } // Nothing found m_current_elm = next_elm; return FALSE; }
int main() { double Vertices[] = {1,0,0,1,0,0,1,1}; std::vector<double> Vertices0(Vertices, Vertices+8); Triangle<2>::SetGlobalCoordinatesArray(Vertices0); P12D<2>::Bulk TestElement(1,2,3); NeoHookean NH(1,1); StressWork MyResidue(&TestElement, NH, 0,1); std::vector< std::vector<double> > argval(2); argval[0].resize(3); argval[1].resize(3); argval[0][0] = 0.1; argval[0][1] = 0.; argval[0][2] = -0.1; argval[1][0] = 0.; argval[1][1] = 0.1; argval[1][2] = -0.1; argval[0][0] = 0.; argval[0][1] = 0.; argval[0][2] = -0.; argval[1][0] = 0.; argval[1][1] = 0.; argval[1][2] = -0.; std::vector<unsigned int> DofPerField(2); DofPerField[0] = TestElement.getDof( MyResidue.getFields()[0] ); DofPerField[1] = TestElement.getDof( MyResidue.getFields()[1] ); if(MyResidue.consistencyTest(MyResidue, DofPerField, argval)) std::cout << "DResidue::Consistency test successful\n"; else std::cout << "DResidue::Consistency test not successful\n"; }