本文整理汇总了C++中PathVector::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ PathVector::push_back方法的具体用法?C++ PathVector::push_back怎么用?C++ PathVector::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathVector
的用法示例。
在下文中一共展示了PathVector::push_back方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: split_vec
static void split_vec(PathVector &full_vec, PathVector &new_vec,
const Path &split_path){
PathVector old_full;
old_full.insert(old_full.begin(),full_vec.begin(),full_vec.end());
full_vec.erase(full_vec.begin(),full_vec.end());
for( PathVector::const_iterator path=old_full.begin() ; path!=old_full.end()
; path++ ){
if(starts_with(*path,split_path))
new_vec.push_back(*path);
else
full_vec.push_back(*path);
}
}
示例2: draw
virtual void draw(cairo_t *cr, std::ostringstream *notify, int width, int height, bool save, std::ostringstream *timer_stream) {
cairo_set_source_rgba (cr, 0., 0., 0, 1);
cairo_set_line_width (cr, 1);
PathVector paths;
for (int i = 0; i < nb_paths; i++){
paths_handles[i].pts.back()=paths_handles[i].pts.front();
paths.push_back(Path(paths_handles[i].pts[0]));
for (unsigned j = 0; j+degree < paths_handles[i].size(); j+=degree){
D2<SBasis> c = handles_to_sbasis(paths_handles[i].pts.begin()+j, degree);
paths[i].append(c);
}
paths[i].close();
}
//cairo_path(cr, paths);
cairo_set_source_rgba (cr, 0., 0., 0, 1);
cairo_set_line_width (cr, 1);
cairo_stroke(cr);
double tol = exp_rescale(sliders[3].value());
Rect tolbytol( Point(50,110), Point(50,110) );
tolbytol.expandBy( tol );
cairo_rectangle(cr, tolbytol);
cairo_stroke(cr);
sweeper = Sweeper(paths,X, tol);
unsigned idx = (unsigned)(sliders[0].value()*(sweeper.tiles_data.size()-1));
drawTiles(cr);
enlightTile(cr, idx);
Toy::draw(cr, notify, width, height, save, timer_stream);
}
示例3: dirs
PathVector Path::dirs() const
{
PathVector ret;
bfs::directory_iterator dit(_p->path);
for (; dit != bfs::directory_iterator(); ++dit) {
if (bfs::is_directory(*dit))
ret.push_back(Path(new PrivatePath(*dit)));
}
return ret;
}
示例4: recursiveFiles
PathVector Path::recursiveFiles() const
{
PathVector ret;
bfs::recursive_directory_iterator dit(_p->path);
for (; dit != bfs::recursive_directory_iterator(); ++dit) {
if (bfs::is_regular_file(*dit))
ret.push_back(Path(new PrivatePath(*dit)));
}
return ret;
}
示例5: path
void
LPECopyRotate::addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector<Geom::PathVector> &hp_vec)
{
using namespace Geom;
Path path(start_pos);
path.appendNew<LineSegment>((Geom::Point) origin);
path.appendNew<LineSegment>(rot_pos);
PathVector pathv;
pathv.push_back(path);
hp_vec.push_back(pathv);
}
示例6: parseNode
Entity Serializer::parseNode(QDomElement const & domElement)
{
QString name = domElement.attribute(nodeNameKey, "");
PathVector components;
QString path = domElement.attribute(pathKey, "");
if (!path.isEmpty())
{
components = Parser::stringToPath(path);
}
else
{
QDomNodeList geometricElements = domElement.elementsByTagName(lineKey);
for (int i = 0; i < geometricElements.size(); i++)
{
QDomElement geometricElement = geometricElements.at(i).toElement();
Line line(geometricElement);
components.push_back(line.getCurve());
}
geometricElements = domElement.elementsByTagName(ellipseKey);
for (int i = 0; i < geometricElements.size(); i++)
{
QDomElement geometricElement = geometricElements.at(i).toElement();
Ellipse ellipse(geometricElement);
components.push_back(ellipse.getCurve());
}
geometricElements = domElement.elementsByTagName(rectangleKey);
for (int i = 0; i < geometricElements.size(); i++)
{
QDomElement geometricElement = geometricElements.at(i).toElement();
Rectangle rectangle(geometricElement);
components.push_back(rectangle.getCurve());
}
}
Entity entity;
entity.first = name;
entity.second = components;
return entity;
}
示例7: getLinearComponents
//
// Get all the paths corresponding to the linear components of the graph
// Precondition: all vertices have in/out degree at most 1 (no branching)
//
PathVector Bigraph::getLinearComponents()
{
PathVector outPaths;
setColors(GC_WHITE);
VertexPtrMapIter iter = m_vertices.begin();
for(; iter != m_vertices.end(); ++iter)
{
// Output the linear path containing this vertex if it hasnt been visited already
if(iter->second->getColor() != GC_BLACK)
{
outPaths.push_back(constructLinearPath(iter->second->getID()));
}
}
assert(checkColors(GC_BLACK));
return outPaths;
}
示例8: BuildFilesList
void BuildFilesList( fs::path Dir, PathVector& Elems )
{
if( !fs::exists( Dir ) || !fs::is_directory( Dir ) )
{
return;
}
for( fs::recursive_directory_iterator dir_iter( Dir ), end_iter; dir_iter != end_iter; ++dir_iter )
{
if( !fs::is_regular_file( dir_iter->status() ) )
{
continue;
}
const fs::path& p = *dir_iter;
Elems.push_back( p );
}
}
示例9: merge
QList<QPoint> ValidPathCreator::createPath(PathVector const & components)
{
if (components.size() == 0) {
return QList<QPoint>();
}
PathVector paths;
foreach (PointVector component, components)
{
int j = 0;
while (j < paths.size())
{
if (getDistance(paths[j], component) == 0) {
component = merge(paths[j], component, 0);
paths.erase(paths.begin() + j);
} else {
j++;
}
}
paths.push_back(component);
}
示例10: parseRunsElement
bool Triggers::parseRunsElement(const XMLElement* runs) {
Range<unsigned> runRange(runs->UnsignedAttribute("from"), runs->UnsignedAttribute("to"));
PathVector runPaths;
const XMLElement* paths = runs->FirstChildElement("path");
for (; paths; paths = paths->NextSiblingElement("path")) {
const std::string name = paths->FirstChildElement("name")->GetText();
const XMLElement* pt = paths->FirstChildElement("pt");
Range<float> ptRange(pt->FloatAttribute("from"), pt->FloatAttribute("to"));
const XMLElement* weightElement = paths->FirstChildElement("weight");
float weight = weightElement->FloatAttribute("value");
Trigger t { ptRange, weight };
runPaths.push_back(std::make_pair(boost::regex(name, boost::regex_constants::icase), t));
}
mTriggers[runRange] = runPaths;
return true;
}
示例11: convert
void ContextGen::convert(PathVector& target, const std::string& ref)
{
target.push_back(ref);
}