void mitk::LiveWireTool2D::OnFinish(StateMachineAction *, InteractionEvent *interactionEvent) { // finish livewire tool interaction mitk::InteractionPositionEvent *positionEvent = dynamic_cast<mitk::InteractionPositionEvent *>(interactionEvent); if (!positionEvent) return; // Have to do that here so that the m_LastEventSender is set correctly mitk::SegTool2D::AddContourmarker(); // actual timestep int timestep = positionEvent->GetSender()->GetTimeStep(); // remove last control point being added by double click m_Contour->RemoveVertexAt(m_Contour->GetNumberOfVertices(timestep) - 1, timestep); // save contour and corresponding plane geometry to list std::pair<mitk::DataNode::Pointer, mitk::PlaneGeometry::Pointer> cp( m_ContourModelNode, (positionEvent->GetSender()->GetCurrentWorldPlaneGeometry()->Clone().GetPointer())); this->m_WorkingContours.push_back(cp); std::pair<mitk::DataNode::Pointer, mitk::PlaneGeometry::Pointer> ecp( m_EditingContourNode, (positionEvent->GetSender()->GetCurrentWorldPlaneGeometry()->Clone().GetPointer())); this->m_EditingContours.push_back(ecp); m_LiveWireFilter->SetUseDynamicCostMap(false); this->FinishTool(); }
void ECPotentialBuilder::useXmlFormat(xmlNodePtr cur) { cur=cur->children; while(cur != NULL) { string cname((const char*)cur->name); if(cname == "pseudo") { string href("none"); string ionName("none"); string format("xml"); //RealType rc(2.0);//use 2 Bohr OhmmsAttributeSet hAttrib; hAttrib.add(href,"href"); hAttrib.add(ionName,"elementType"); hAttrib.add(ionName,"symbol"); hAttrib.add(format,"format"); //hAttrib.add(rc,"cutoff"); hAttrib.put(cur); int speciesIndex=IonConfig.getSpeciesSet().findSpecies(ionName); if(speciesIndex < IonConfig.getSpeciesSet().getTotalNum()) { app_log() << endl << " Adding pseudopotential for " << ionName << endl; ECPComponentBuilder ecp(ionName); bool success=false; if(format == "xml") { if(href == "none") { success=ecp.put(cur); } else { success=ecp.parse(href,cur); } } else if(format == "casino") { //success=ecp.parseCasino(href,rc); success=ecp.parseCasino(href,cur); } if(success) { #if !defined(HAVE_MPI) ecp.printECPTable(); #endif if(ecp.pp_loc) { localPot[speciesIndex]=ecp.pp_loc; localZeff[speciesIndex]=ecp.Zeff; hasLocalPot=true; } if(ecp.pp_nonloc) { nonLocalPot[speciesIndex]=ecp.pp_nonloc; hasNonLocalPot=true; } } } else { app_error() << " Ion species " << ionName << " is not found." << endl; } } cur=cur->next; } }