#include "line.h" #include Line::Line(const QPair& fromTo, ACLineSegment* ac, QObject *parent):Branch(fromTo.first,fromTo.second,parent) { this->ratio=1; this->ac=ac; this->extract(); } void Line::extract() { //用YJV22-3x240 ACLineSegment *ac=this->ac; double length=ac->getLength(); // if((int)length==0) // { // std::cout<<"line length zeros "<getID().toStdString()<r=r0*length/1000;//length的单位是米 this->x=x0*length/1000; this->g1=g0*length/1000; this->g2=g0*length/1000; this->b1=b0*length/1000; this->b2=b0*length/1000; this->length=length/1000; }