std::shared_ptr<Carta::Lib::RegionInfo> Region::getInfo() const { std::shared_ptr<Carta::Lib::RegionInfo> info( new Carta::Lib::RegionInfo() ); info->setRegionType( getRegionType() ); int cornerCount = m_state.getArraySize( CORNERS ); std::vector< std::pair<double,double> > corners( cornerCount ); for( int i = 0; i < cornerCount; i++ ){ QString eleLookup = Carta::State::UtilState::getLookup( CORNERS, i ); QString xLookup = Carta::State::UtilState::getLookup( eleLookup, Util::XCOORD ); QString yLookup = Carta::State::UtilState::getLookup( eleLookup, Util::YCOORD ); double xValue = m_state.getValue<double>( xLookup ); double yValue = m_state.getValue<double>( yLookup ); corners[i] = std::pair<double,double>( xValue, yValue ); } info->setCorners( corners ); return info; }
bool UniPAX::RnaRegionReference::update(PersistenceManager& manager) { // check single pointer if object was merged if (manager.isMerged(getRegionType())) { setRegionType(boost::dynamic_pointer_cast<SequenceRegionVocabulary>(manager.getMergedObject(getRegionType()))); } if (manager.isMerged(getOrganism())) { setOrganism(boost::dynamic_pointer_cast<BioSource>(manager.getMergedObject(getOrganism()))); } if (manager.isMerged(getAbsoluteRegion())) { setAbsoluteRegion(boost::dynamic_pointer_cast<SequenceLocation>(manager.getMergedObject(getAbsoluteRegion()))); } if (manager.isMerged(getSubRegion())) { setSubRegion(boost::dynamic_pointer_cast<EntityReference>(manager.getMergedObject(getSubRegion()))); } return UniPAX::EntityReference::update(manager); }