void ScrollViewer::OnInitialized() { __super::OnInitialized(); suic::StylePtr hPtr(FindResource(_T("HScrollBar"))); suic::StylePtr vPtr(FindResource(_T("VScrollBar"))); _hScroll->SetStyle(hPtr); _vScroll->SetStyle(vPtr); _hScroll->BeginInit(); _hScroll->EndInit(); _vScroll->BeginInit(); _vScroll->EndInit(); _hScroll->Scroll.Add(this, &ScrollViewer::OnHorizontalScroll); _vScroll->Scroll.Add(this, &ScrollViewer::OnVerticalScroll); _iCurPos = GetBorderThickness().top; }
//' Return the LinOp element at index i (0-based) //' //' @param lvec the LinOpVector Object XPtr //' @param i the index // [[Rcpp::export(.LinOp_at_index)]] SEXP LinOp_at_index(SEXP lvec, int i) { Rcpp::XPtr<LinOpVector> vPtr(lvec); return Rcpp::XPtr<LinOp>((vPtr->linvec)[i]); }
bool NasFileImporter::doRead(hHybridMesh * mesh) { if(_file.good()) { // GRID mmv_out_stream<< "\n Reading vertices..."; _file.seekg(gridPos_); mesh->vertices_.reserve(_vert_count); Vertex * vPtr(nullptr); std::string s_tmp; while(_vert_readed < _vert_count && _file.good()) { double val(0); //char tmp[12]={0}; _file >> s_tmp; vPtr = mesh->vertices_.newObj<Vertex>(nullptr); _file >> val >> vPtr->coords_[0] >> vPtr->coords_[1] >> vPtr->coords_[2] >> val; ++_vert_readed; } assert(_vert_count == _vert_readed); mmv_out_stream << " Vertices readed: " << _vert_readed << "\n Reading faces... "; // FACES int quad_readed(0); _file.seekg(0/*facePos_*/); mesh->faces_.reserve(_face_count+_quads, sizeof(Face3) * _face_count+sizeof(Face4)*_quads); mesh->edges_.reserve(_elem_count*6+_prisms*9,sizeof(Edge) * (_elem_count*6+_prisms*9)); hObj * fPtr(nullptr); uTind vertices[6]={UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN}; while(_face_readed+quad_readed < (_face_count+_quads) && _file.good()) { double val(0); //char tmp[12]={0}; //_file.getline(tmp,11,' '); //tmp[6]=0; _file >> s_tmp; int face_type(0); if(0 == s_tmp.compare("CTRIAX")) //if(0 == strcmp("CTRIAX",tmp )) { face_type = 3; if(face_type < 2 && face_type > 4) { throw "\nNasFileImporter::GetNextFace: wrong face_type.\n Make sure that file has platform-specyfic file endings (Win/Linux)."; } _file >> val; // number - ignore it int bc; _file >> bc; // element group no. = bc no. _file >> vertices[0];// fPtr->verts(0) = tmp2; // vertices no. !!! (not edges) _file >> vertices[1]; //fPtr->verts(1) = tmp2; _file >> vertices[2]; //fPtr->verts(2) = tmp2; std::sort(vertices, vertices+3); fPtr = mesh->faces_.newObj<Face3>(vertices); fPtr->flags(B_COND)= bc; fPtr->components(0) = mesh->edge(vertices[0],vertices[1]).id_; fPtr->components(1) = mesh->edge(vertices[0],vertices[2]).id_; fPtr->components(2) = mesh->edge(vertices[1],vertices[2]).id_; fPtr->neighs(0) = UNKNOWN; fPtr->neighs(1) = UNKNOWN; ++_face_readed; } else if(0 == s_tmp.compare("CQUADX")) // quads