Move from float to double
This commit is contained in:
@@ -225,7 +225,7 @@ void ViewProviderAnnotation::updateData(const App::Property* prop)
|
||||
}
|
||||
else if (prop->getTypeId() == App::PropertyVector::getClassTypeId() &&
|
||||
strcmp(prop->getName(),"Position") == 0) {
|
||||
Base::Vector3f v = static_cast<const App::PropertyVector*>(prop)->getValue();
|
||||
Base::Vector3d v = static_cast<const App::PropertyVector*>(prop)->getValue();
|
||||
pTranslation->translation.setValue(v.x,v.y,v.z);
|
||||
}
|
||||
|
||||
@@ -348,12 +348,12 @@ void ViewProviderAnnotationLabel::updateData(const App::Property* prop)
|
||||
}
|
||||
else if (prop->getTypeId() == App::PropertyVector::getClassTypeId() &&
|
||||
strcmp(prop->getName(),"BasePosition") == 0) {
|
||||
Base::Vector3f v = static_cast<const App::PropertyVector*>(prop)->getValue();
|
||||
Base::Vector3d v = static_cast<const App::PropertyVector*>(prop)->getValue();
|
||||
pBaseTranslation->translation.setValue(v.x,v.y,v.z);
|
||||
}
|
||||
else if (prop->getTypeId() == App::PropertyVector::getClassTypeId() &&
|
||||
strcmp(prop->getName(),"TextPosition") == 0) {
|
||||
Base::Vector3f v = static_cast<const App::PropertyVector*>(prop)->getValue();
|
||||
Base::Vector3d v = static_cast<const App::PropertyVector*>(prop)->getValue();
|
||||
pCoords->point.set1Value(1, SbVec3f(v.x,v.y,v.z));
|
||||
pTextTranslation->translation.setValue(v.x,v.y,v.z);
|
||||
}
|
||||
|
||||
@@ -196,11 +196,11 @@ void ViewProviderMeasureDistance::updateData(const App::Property* prop)
|
||||
if (prop->getTypeId() == App::PropertyVector::getClassTypeId() ||
|
||||
prop == &Mirror || prop == &DistFactor) {
|
||||
if (strcmp(prop->getName(),"P1") == 0) {
|
||||
Base::Vector3f v = static_cast<const App::PropertyVector*>(prop)->getValue();
|
||||
Base::Vector3d v = static_cast<const App::PropertyVector*>(prop)->getValue();
|
||||
pCoords->point.set1Value(0, SbVec3f(v.x,v.y,v.z));
|
||||
}
|
||||
else if (strcmp(prop->getName(),"P2") == 0) {
|
||||
Base::Vector3f v = static_cast<const App::PropertyVector*>(prop)->getValue();
|
||||
Base::Vector3d v = static_cast<const App::PropertyVector*>(prop)->getValue();
|
||||
pCoords->point.set1Value(1, SbVec3f(v.x,v.y,v.z));
|
||||
}
|
||||
|
||||
@@ -278,8 +278,8 @@ void PointMarker::customEvent(QEvent* e)
|
||||
App::MeasureDistance* md = static_cast<App::MeasureDistance*>(obj);
|
||||
const SbVec3f& pt1 = vp->pCoords->point[0];
|
||||
const SbVec3f& pt2 = vp->pCoords->point[1];
|
||||
md->P1.setValue(Base::Vector3f(pt1[0],pt1[1],pt1[2]));
|
||||
md->P2.setValue(Base::Vector3f(pt2[0],pt2[1],pt2[2]));
|
||||
md->P1.setValue(Base::Vector3d(pt1[0],pt1[1],pt1[2]));
|
||||
md->P2.setValue(Base::Vector3d(pt2[0],pt2[1],pt2[2]));
|
||||
std::stringstream s;
|
||||
s.precision(3);
|
||||
s.setf(std::ios::fixed | std::ios::showpoint);
|
||||
|
||||
@@ -876,15 +876,15 @@ QVariant PropertyVectorItem::value(const App::Property* prop) const
|
||||
{
|
||||
assert(prop && prop->getTypeId().isDerivedFrom(App::PropertyVector::getClassTypeId()));
|
||||
|
||||
const Base::Vector3f& value = static_cast<const App::PropertyVector*>(prop)->getValue();
|
||||
return QVariant::fromValue<Base::Vector3f>(value);
|
||||
const Base::Vector3d& value = static_cast<const App::PropertyVector*>(prop)->getValue();
|
||||
return QVariant::fromValue<Base::Vector3d>(value);
|
||||
}
|
||||
|
||||
void PropertyVectorItem::setValue(const QVariant& value)
|
||||
{
|
||||
if (!value.canConvert<Base::Vector3f>())
|
||||
return;
|
||||
const Base::Vector3f& val = value.value<Base::Vector3f>();
|
||||
const Base::Vector3d& val = value.value<Base::Vector3d>();
|
||||
QString data = QString::fromAscii("(%1, %2, %3)")
|
||||
.arg(val.x,0,'f',decimals())
|
||||
.arg(val.y,0,'f',decimals())
|
||||
|
||||
Reference in New Issue
Block a user