bool SplineLoader::end__spline() { mInSpline = false; loadPositions(); loadOutTangents(); loadInTangents(); loadInterpolations(); // The mesh will be written by the GeometyLoader. Therefore nothing to with the mesh here finish(); return true; }
Map::Map(std::string directory) { boost::filesystem::path base(directory); locationOnDisk = directory; std::ifstream commandFile((base / "speeds.sl").string().c_str()); loadCommands(commandFile); std::ifstream poseFile((base / "positions.pl").string().c_str()); loadPositions(poseFile); std::ifstream anchorPointsFile((base / "anchorPoints.apd").string().c_str()); loadAnchorPoints(anchorPointsFile); }
ChaserTargetInteractWidget::ChaserTargetInteractWidget( kte::chaser_target_data* aPSceneData, QWidget* parent, Qt::WindowFlags flags) : QDockWidget(tr("Interact"), parent, flags), Ui::ChaserTargetInteract(), pSceneData(aPSceneData) { QScrollArea* dock_scroll = new QScrollArea(this); dock_scroll->setWidgetResizable(true); QWidget* dock_wid = new QWidget(this); dock_scroll->setWidget(dock_wid); this->QDockWidget::setWidget(dock_scroll); setupUi(dock_wid); connect(actionJointChange, SIGNAL(triggered()), this, SLOT(onJointChange())); connect(actionTargetChange, SIGNAL(triggered()), this, SLOT(onTargetChange())); connect(load_traj_button, SIGNAL(clicked()), this, SLOT(loadTargetTrajectory())); connect(load_button, SIGNAL(clicked()), this, SLOT(loadPositions())); connect(save_button, SIGNAL(clicked()), this, SLOT(savePositions())); };
ScoutDataClass::ScoutDataClass(Base base, ScoutType type) : mType(type) , mBase(base) { loadPositions(); }
void CCL_MocapJoint::addUUID(string title,const string uuid){ if( title.compare("X") == 0){ string url = "http://api.piecemeta.com/streams/" + uuid+".json?skip=10"; // std::cout << "[Stream URL]"<< url<< std::endl; const JsonTree stream( loadUrl(url) ); int frameCount = stream["frameCount"].getValue<int>(); for (int i = 0 ; i < stream["frames"].getNumChildren() ; i++){ string temp = stream["frames"][i].getValue(); if( temp == "null" || temp.size() == 0){ // cout << "[FrameAt:"<<i<< ","<<temp<<endl; if ( i!=0 ){ std::string prev = stream["frames"][i-1].getValue(); xPositions.push_back(xPositions[i-1]); } else { xPositions.push_back(stof(temp)); } }else{ // cout << "[FrameAt:"<<i<< ","<<temp<<endl; xPositions.push_back(stof(temp)); } } // cout << jointName << "X FrameCount:" << frameCount <<" FramesNum:" << xPositions.size() << " Skip:10" << endl; xUpdated = true; }else if( title.compare("Y") == 0 ){ string url = "http://api.piecemeta.com/streams/" + uuid+".json?skip=10"; // std::cout << "[Stream URL]"<< url<< std::endl; const JsonTree stream( loadUrl(url) ); int frameCount = stream["frameCount"].getValue<int>(); for (int i = 0 ; i < stream["frames"].getNumChildren() ; i++){ string temp = stream["frames"][i].getValue(); if( temp == "null" || temp.size() == 0){ // cout << "[FrameAt:"<<i<< if ( i!=0 ){ std::string prev = stream["frames"][i-1].getValue(); yPositions.push_back(yPositions[i-1]); } else { yPositions.push_back(stof(temp)); } }else{ // cout << "[FrameAt:"<<i<< ","<<temp<<endl; yPositions.push_back(stof(temp)); } } // cout << jointName << "Y FrameCount:" << frameCount <<" FramesNum:" << yPositions.size() << " Skip:10" << endl; yUpdated = true; }else if( title.compare("Z") == 0){ string url = "http://api.piecemeta.com/streams/" + uuid+".json?skip=10"; // std::cout << "[Stream URL]"<< url<< std::endl; const JsonTree stream( loadUrl(url) ); int frameCount = stream["frameCount"].getValue<int>(); for (int i = 0 ; i < stream["frames"].getNumChildren() ; i++){ string temp = stream["frames"][i].getValue(); if( temp == "null" || temp.size() == 0){ // cout << "[FrameAt:"<<i<< ","<<temp<<endl; if ( i!=0 ){ std::string prev = stream["frames"][i-1].getValue(); zPositions.push_back(zPositions[i-1]); } else { zPositions.push_back(stof(temp)); } }else{ // cout << "[FrameAt:"<<i<< ","<<temp<<endl; zPositions.push_back(stof(temp)); } } // cout << jointName << "Z FrameCount:" << frameCount <<" FramesNum:" << zPositions.size() << " Skip:10" << endl; zUpdated = true; } if( xUpdated && yUpdated && zUpdated){ loadPositions(); } };
// Returns hits with _AT_MOST_ numMismatches mistakes. bool positionDB::getUpToNMismatches(uint64 mer, uint32 numMismatches, uint64*& posn, uint64& posnMax, uint64& posnLen) { PREFETCH(_hashedErrors); // Slightly better. posnLen = 0; if (_hashedErrors == 0L) { fprintf(stderr, "ERROR: Nobody initialized getUpToNMismatches() by calling setUpMismatchMatcher().\n"); exit(1); } if (posnMax == 0) { posnMax = 16384; try { posn = new uint64 [posnMax]; } catch (...) { fprintf(stderr, "positionDB::getUpToNMismatches()-- Can't allocate space for initial positions, requested "uint64FMT" uint64's.\n", posnMax); abort(); } } uint64 orig = HASH(mer); // Optimization that didn't work. The idea was to compute all the // hashes with errors, then sort to gain better cache locality in // the lookups. The sort dominated. // // Another: Surprisingly, theq two getDecodedValue calls are faster // than a single getDecodedValues. for (uint32 e=0; e<_hashedErrorsLen; e++) { uint64 hash = orig ^ _hashedErrors[e]; uint64 st, ed; if (_hashTable_BP) { st = getDecodedValue(_hashTable_BP, hash * _hashWidth, _hashWidth); ed = getDecodedValue(_hashTable_BP, hash * _hashWidth + _hashWidth, _hashWidth); } else { st = _hashTable_FW[hash]; ed = _hashTable_FW[hash+1]; } assert((_hashedErrors[e] & ~_hashMask) == 0); assert((hash & ~_hashMask) == 0); // Rebuild the mer from the hash and its check code. // // Compare the rebuilt mer and the original mer -- if there are // exactly N errors, it's a hit! (if there are fewer than N, // we'll find it when we look for N-1 errors). // // Before rebuilding, compute diffs on the chckBits only -- if // things are wildly different (the usual case) we'll get // enough difference here to abort. Remember, the chck bits // are not encoded, they're an exact copy from the unhashed // mer. if (st != ed) { for (uint64 i=ed-st, J=st * _wFin; i--; J += _wFin) { uint64 chck = getDecodedValue(_buckets, J, _chckWidth); uint64 diffs = chck ^ (mer & _mask2); uint64 d1 = diffs & uint64NUMBER(0x5555555555555555); uint64 d2 = diffs & uint64NUMBER(0xaaaaaaaaaaaaaaaa); uint64 err = countNumberOfSetBits64(d1 | (d2 >> 1)); if (err <= numMismatches) { diffs = REBUILD(hash, chck) ^ mer; d1 = diffs & uint64NUMBER(0x5555555555555555); d2 = diffs & uint64NUMBER(0xaaaaaaaaaaaaaaaa); err = countNumberOfSetBits64(d1 | (d2 >> 1)); if (err <= numMismatches) // err is junk, just need a parameter here loadPositions(J, posn, posnMax, posnLen, err); } } } }