From f85479998964468d02de3cc5228f281e6c43e7f9 Mon Sep 17 00:00:00 2001 From: "dmy@lab" Date: Mon, 9 Mar 2015 11:19:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E4=BA=8E=E6=B2=A1=E6=9C=89=E9=95=BF?= =?UTF-8?q?=E5=BA=A6=E7=9A=84=E5=A4=B4=E8=8A=82=E7=82=B9=E7=BA=BF=E8=B7=AF?= =?UTF-8?q?=EF=BC=8C=E8=AE=BE=E5=AE=9A=E4=B8=80=E4=B8=AA=E9=98=BB=E6=8A=97?= =?UTF-8?q?=E6=9C=80=E5=B0=8F=E5=80=BC=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dmy@lab --- testHasttable/cimexporter.cpp | 18 ++++++++++++++---- testHasttable/element/line.cpp | 23 ++++++++++++----------- testHasttable/element/line.h | 1 + testHasttable/elementreduction.cpp | 14 ++++++++------ 4 files changed, 35 insertions(+), 21 deletions(-) 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; + +// }