diff --git a/testHasttable/cimexporter.cpp b/testHasttable/cimexporter.cpp index 6f70022..e84ad1f 100644 --- a/testHasttable/cimexporter.cpp +++ b/testHasttable/cimexporter.cpp @@ -136,10 +136,20 @@ void CIMExporter::exportTo(const QString& path,const QString &rootID) writer<r<x<b1<b2<(l.length)==0) + { + writer<<0.01<r<x<b1<b2<& fromTo, ACLineSegment* ac, QObject *par } + void Line::extract() { //用YJV22-3x240 ACLineSegment *ac=this->ac; double length=ac->getLength(); - if((int)length==0) - { - std::cout<<"line length zeros "<getID().toStdString()<getID().toStdString()<r=r0*length; - this->x=x0*length; - this->g1=g0*length; - this->g2=g0*length; - this->b1=b0*length; - this->b2=b0*length; - this->length=length; + this->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; } diff --git a/testHasttable/element/line.h b/testHasttable/element/line.h index b335dcd..f529d6f 100644 --- a/testHasttable/element/line.h +++ b/testHasttable/element/line.h @@ -10,6 +10,7 @@ public: Line(const QPair &fromTo, ACLineSegment* ac,QObject* parent=0); double length; ACLineSegment *ac; + protected: virtual void extract(); private: diff --git a/testHasttable/elementreduction.cpp b/testHasttable/elementreduction.cpp index bb61b08..755fb92 100644 --- a/testHasttable/elementreduction.cpp +++ b/testHasttable/elementreduction.cpp @@ -21,12 +21,14 @@ void ElementReduction::calibration(const QString &id,QHashfromID.swap(idToBranch[id]->toID); } - LineStru *line=static_cast(idToBranch[id]); - if(0==static_cast(line->length)) - { - line->length=10; - line->line->length=10; - } +// LineStru *line=static_cast(idToBranch[id]); +// if(0==static_cast(line->length)) +// { +// std::cout<<"is zeros"<id.toStdString()<length=10; +// line->line->length=10; + +// }