Moved Gui/InputVector,Placement,Transform from float to double
This commit is contained in:
@@ -25,8 +25,8 @@
|
||||
#ifndef _PreComp_
|
||||
# include <QDir>
|
||||
# include <QFileInfo>
|
||||
# include <QLineEdit>
|
||||
# include <QInputDialog>
|
||||
# include <QLineEdit>
|
||||
# include <QInputDialog>
|
||||
# include <Standard_math.hxx>
|
||||
#endif
|
||||
|
||||
@@ -66,7 +66,7 @@ void CmdPartSimpleCylinder::activated(int iMsg)
|
||||
{
|
||||
PartGui::DlgPartCylinderImp dlg(Gui::getMainWindow());
|
||||
if (dlg.exec()== QDialog::Accepted) {
|
||||
Base::Vector3f dir = dlg.getDirection();
|
||||
Base::Vector3d dir = dlg.getDirection();
|
||||
openCommand("Create Part Cylinder");
|
||||
doCommand(Doc,"from FreeCAD import Base");
|
||||
doCommand(Doc,"import Part");
|
||||
|
||||
@@ -641,8 +641,8 @@ void Location::pickCallback(void * ud, SoEventCallback * n)
|
||||
SbVec3f pnt = point->getPoint();
|
||||
SbVec3f nor = point->getNormal();
|
||||
Location* dlg = reinterpret_cast<Location*>(ud);
|
||||
dlg->ui.loc->setPosition(Base::Vector3f(pnt[0],pnt[1],pnt[2]));
|
||||
dlg->ui.loc->setDirection(Base::Vector3f(nor[0],nor[1],nor[2]));
|
||||
dlg->ui.loc->setPosition(Base::Vector3d(pnt[0],pnt[1],pnt[2]));
|
||||
dlg->ui.loc->setDirection(Base::Vector3d(nor[0],nor[1],nor[2]));
|
||||
n->setHandled();
|
||||
}
|
||||
}
|
||||
@@ -664,7 +664,7 @@ void Location::pickCallback(void * ud, SoEventCallback * n)
|
||||
|
||||
QString Location::toPlacement() const
|
||||
{
|
||||
Base::Vector3f d = ui.loc->getDirection();
|
||||
Base::Vector3d d = ui.loc->getDirection();
|
||||
gp_Dir dir = gp_Dir(d.x,d.y,d.z);
|
||||
gp_Pnt pnt = gp_Pnt(0.0,0.0,0.0);
|
||||
gp_Ax3 ax3;
|
||||
@@ -707,7 +707,7 @@ QString Location::toPlacement() const
|
||||
Trf.GetRotation(theAxis,theAngle);
|
||||
|
||||
Base::Rotation rot(Base::convertTo<Base::Vector3d>(theAxis), theAngle);
|
||||
Base::Vector3f loc = ui.loc->getPosition();
|
||||
Base::Vector3d loc = ui.loc->getPosition();
|
||||
|
||||
return QString::fromAscii("Base.Placement(Base.Vector(%1,%2,%3),Base.Rotation(%4,%5,%6,%7))")
|
||||
.arg(loc.x,0,'f',2)
|
||||
|
||||
@@ -121,7 +121,7 @@ void DlgRevolution::directionActivated(int index)
|
||||
ui->directionActivated(this, index);
|
||||
}
|
||||
|
||||
Base::Vector3f DlgRevolution::getDirection() const
|
||||
Base::Vector3d DlgRevolution::getDirection() const
|
||||
{
|
||||
return ui->getDirection();
|
||||
}
|
||||
@@ -180,7 +180,7 @@ void DlgRevolution::accept()
|
||||
shape = (*it)->data(0, Qt::UserRole).toString();
|
||||
type = QString::fromAscii("Part::Revolution");
|
||||
name = QString::fromAscii(activeDoc->getUniqueObjectName("Revolve").c_str());
|
||||
Base::Vector3f axis = this->getDirection();
|
||||
Base::Vector3d axis = this->getDirection();
|
||||
|
||||
QString code = QString::fromAscii(
|
||||
"FreeCAD.ActiveDocument.addObject(\"%1\",\"%2\")\n"
|
||||
@@ -222,8 +222,8 @@ void DlgRevolution::onSelectionChanged(const Gui::SelectionChanges& msg)
|
||||
{
|
||||
if (msg.Type == Gui::SelectionChanges::AddSelection) {
|
||||
if (filter && filter->canSelect) {
|
||||
ui->setPosition (Base::convertTo<Base::Vector3f>(filter->loc));
|
||||
ui->setDirection(Base::convertTo<Base::Vector3f>(filter->dir));
|
||||
ui->setPosition (Base::convertTo<Base::Vector3d>(filter->loc));
|
||||
ui->setDirection(Base::convertTo<Base::Vector3d>(filter->dir));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
~DlgRevolution();
|
||||
void accept();
|
||||
|
||||
Base::Vector3f getDirection() const;
|
||||
Base::Vector3d getDirection() const;
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
Reference in New Issue
Block a user