void PackageManager::add(const std::string & thePaths) { AC_TRACE << "adding '" << thePaths << "'"; std::vector<std::string> myPathVector; splitPaths(thePaths, myPathVector); AC_DEBUG << "adding " << myPathVector.size() << " packages"; for (int i = myPathVector.size() - 1; i >= 0; i--) { std::string normalizedPath = normalizeDirectory(myPathVector[i], true); if (!fileExists(normalizedPath)) { AC_WARNING << "PackageManager: Package '" << normalizedPath << "' does not exist"; continue; } if (isDirectory(normalizedPath)) { AC_DEBUG << "adding Directory '" << normalizedPath << "'"; add(IPackagePtr(new DirectoryPackage(normalizedPath))); continue; } else { ConstMappedBlock myBlock(normalizedPath); // check zip file signature if (myBlock[0] == 0x50 && myBlock[1] == 0x4b && myBlock[2] == 0x03 && myBlock[3] == 0x04) { AC_DEBUG << "adding Zip '" << normalizedPath << "'"; add(IPackagePtr(new ZipPackage(normalizedPath))); } else { AC_WARNING << "PackageManager: can not open package '" << normalizedPath << "'" << ", not a directory and file type unknown."; AC_WARNING << "Sig is " << myBlock[0] << myBlock[1] << myBlock[2] << myBlock[3]; } } } }
PinocchioOutput autorig(const Skeleton &given, const Mesh &m) { int i; PinocchioOutput out; Mesh newMesh = prepareMesh(m); if(newMesh.vertices.size() == 0) return out; TreeType *distanceField = constructDistanceField(newMesh); //discretization vector<Sphere> medialSurface = sampleMedialSurface(distanceField); vector<Sphere> spheres = packSpheres(medialSurface); PtGraph graph = connectSamples(distanceField, spheres); //discrete embedding vector<vector<int> > possibilities = computePossibilities(graph, spheres, given); //constraints can be set by respecifying possibilities for skeleton joints: //to constrain joint i to sphere j, use: possiblities[i] = vector<int>(1, j); vector<int> embeddingIndices = discreteEmbed(graph, spheres, given, possibilities); if(embeddingIndices.size() == 0) { //failure delete distanceField; return out; } vector<Vector3> discreteEmbedding = splitPaths(embeddingIndices, graph, given); //continuous refinement vector<Vector3> medialCenters(medialSurface.size()); for(i = 0; i < (int)medialSurface.size(); ++i) medialCenters[i] = medialSurface[i].center; out.embedding = refineEmbedding(distanceField, medialCenters, discreteEmbedding, given); //attachment VisTester<TreeType> *tester = new VisTester<TreeType>(distanceField); out.attachment = new Attachment(newMesh, given, out.embedding, tester); //cleanup delete tester; delete distanceField; return out; }
LibrariesInfo::LibrariesInfo() : elfClass(Unknown) { splitPaths(getBasePaths(), basePaths32, basePaths64); splitPaths(getSystemEnvPaths(), envPaths32, envPaths64); }