Exemple #1
0
eString::eString(const string& src)
{
	source = src;
	size_t pos, lastPos = 0;
	
	while((pos = source.find('\r')) != string::npos)
		source.erase(source.begin()+pos, source.begin()+pos+1);
	
	while((pos = source.find('\n', lastPos)) < source.length())
	{
		string nextLine = source.substr(lastPos, pos - lastPos);
		lines.push_back(eLine(nextLine));
		lastPos = pos + 1;
	}
	if(lastPos < source.length())
		lines.push_back(source.substr(lastPos, source.length() - lastPos));
}
void 
GraphicsViewPolylineInput_non_templated_base::rubberbands(const QPointF& p)
{
  if(polygon.empty()){
    return;
  }
  if(!b && closed_ ){
    b = new QGraphicsLineItem();
    b->setPen(QPen(::Qt::red, 0, ::Qt::SolidLine, ::Qt::RoundCap, ::Qt::RoundJoin));
    scene_->addItem(b);
  }
  if( !e){
    e = new QGraphicsLineItem();    
    e->setPen(QPen(::Qt::red, 0, ::Qt::SolidLine, ::Qt::RoundCap, ::Qt::RoundJoin));
    scene_->addItem(e);
  }
  if(closed_){
    QLineF bLine(polygon.front(), p);
    b->setLine(bLine);
  }
  QLineF eLine(polygon.back(), p);
  e->setLine(eLine); 
}
Exemple #3
0
//! Compute the error between two visual features from a subset of the possible features.
vpColVector vpBasicFeature::error(const vpBasicFeature &s_star,
	    const unsigned int select)
{
	vpColVector e(0),eLine(1);
	if (dim_s <= 31)
	{
		for(unsigned int i=0;i<dim_s;++i){
			if(FEATURE_LINE[i] & select)
			{
				eLine[0] = s[i] - s_star[i];
				e.stackMatrices(eLine);
				//std::cout << "dim_s <= 31"<<std::endl;
			}
		}
	}
	else
	{
		e.resize(dim_s);
		vpColVector sd = s_star.get_s();
		e = s - sd;
	}

   return e ;
}