Moved Gui/InputVector,Placement,Transform from float to double
This commit is contained in:
parent
8df84e76c4
commit
50c9ea219d
|
@ -105,10 +105,10 @@ void LocationWidget::retranslateUi()
|
|||
|
||||
dValue->setCurrentIndex(2);
|
||||
|
||||
// Vector3f declared to use with QVariant see Gui/propertyeditor/PropertyItem.h
|
||||
dValue->setItemData(0, QVariant::fromValue<Base::Vector3f>(Base::Vector3f(1,0,0)));
|
||||
dValue->setItemData(1, QVariant::fromValue<Base::Vector3f>(Base::Vector3f(0,1,0)));
|
||||
dValue->setItemData(2, QVariant::fromValue<Base::Vector3f>(Base::Vector3f(0,0,1)));
|
||||
// Vector3d declared to use with QVariant see Gui/propertyeditor/PropertyItem.h
|
||||
dValue->setItemData(0, QVariant::fromValue<Base::Vector3d>(Base::Vector3d(1,0,0)));
|
||||
dValue->setItemData(1, QVariant::fromValue<Base::Vector3d>(Base::Vector3d(0,1,0)));
|
||||
dValue->setItemData(2, QVariant::fromValue<Base::Vector3d>(Base::Vector3d(0,0,1)));
|
||||
}
|
||||
else {
|
||||
dValue->setItemText(0, QApplication::translate("Gui::LocationDialog", "X"));
|
||||
|
@ -119,21 +119,21 @@ void LocationWidget::retranslateUi()
|
|||
}
|
||||
}
|
||||
|
||||
Base::Vector3f LocationWidget::getPosition() const
|
||||
Base::Vector3d LocationWidget::getPosition() const
|
||||
{
|
||||
return Base::Vector3f((float)this->xValue->value(),
|
||||
(float)this->yValue->value(),
|
||||
(float)this->zValue->value());
|
||||
return Base::Vector3d(this->xValue->value(),
|
||||
this->yValue->value(),
|
||||
this->zValue->value());
|
||||
}
|
||||
|
||||
void LocationWidget::setPosition(const Base::Vector3f& v)
|
||||
void LocationWidget::setPosition(const Base::Vector3d& v)
|
||||
{
|
||||
this->xValue->setValue(v.x);
|
||||
this->yValue->setValue(v.y);
|
||||
this->zValue->setValue(v.z);
|
||||
}
|
||||
|
||||
void LocationWidget::setDirection(const Base::Vector3f& dir)
|
||||
void LocationWidget::setDirection(const Base::Vector3d& dir)
|
||||
{
|
||||
if (dir.Length() < FLT_EPSILON) {
|
||||
return;
|
||||
|
@ -142,8 +142,8 @@ void LocationWidget::setDirection(const Base::Vector3f& dir)
|
|||
// check if the user-defined direction is already there
|
||||
for (int i=0; i<dValue->count()-1; i++) {
|
||||
QVariant data = dValue->itemData (i);
|
||||
if (data.canConvert<Base::Vector3f>()) {
|
||||
const Base::Vector3f val = data.value<Base::Vector3f>();
|
||||
if (data.canConvert<Base::Vector3d>()) {
|
||||
const Base::Vector3d val = data.value<Base::Vector3d>();
|
||||
if (val == dir) {
|
||||
dValue->setCurrentIndex(i);
|
||||
return;
|
||||
|
@ -157,31 +157,31 @@ void LocationWidget::setDirection(const Base::Vector3f& dir)
|
|||
.arg(dir.y)
|
||||
.arg(dir.z);
|
||||
dValue->insertItem(dValue->count()-1, display,
|
||||
QVariant::fromValue<Base::Vector3f>(dir));
|
||||
QVariant::fromValue<Base::Vector3d>(dir));
|
||||
dValue->setCurrentIndex(dValue->count()-2);
|
||||
}
|
||||
|
||||
Base::Vector3f LocationWidget::getDirection() const
|
||||
Base::Vector3d LocationWidget::getDirection() const
|
||||
{
|
||||
QVariant data = dValue->itemData (this->dValue->currentIndex());
|
||||
if (data.canConvert<Base::Vector3f>()) {
|
||||
return data.value<Base::Vector3f>();
|
||||
if (data.canConvert<Base::Vector3d>()) {
|
||||
return data.value<Base::Vector3d>();
|
||||
}
|
||||
else {
|
||||
return Base::Vector3f(0,0,1);
|
||||
return Base::Vector3d(0,0,1);
|
||||
}
|
||||
}
|
||||
|
||||
Base::Vector3f LocationWidget::getUserDirection(bool* ok) const
|
||||
Base::Vector3d LocationWidget::getUserDirection(bool* ok) const
|
||||
{
|
||||
Gui::Dialog::Ui_InputVector iv;
|
||||
QDialog dlg(const_cast<LocationWidget*>(this));
|
||||
iv.setupUi(&dlg);
|
||||
Base::Vector3f dir;
|
||||
Base::Vector3d dir;
|
||||
if (dlg.exec()) {
|
||||
dir.x = (float)iv.vectorX->value();
|
||||
dir.y = (float)iv.vectorY->value();
|
||||
dir.z = (float)iv.vectorZ->value();
|
||||
dir.x = iv.vectorX->value();
|
||||
dir.y = iv.vectorY->value();
|
||||
dir.z = iv.vectorZ->value();
|
||||
if (ok) *ok = true;
|
||||
}
|
||||
else {
|
||||
|
@ -196,7 +196,7 @@ void LocationWidget::on_direction_activated(int index)
|
|||
// last item is selected to define direction by user
|
||||
if (index+1 == dValue->count()) {
|
||||
bool ok;
|
||||
Base::Vector3f dir = this->getUserDirection(&ok);
|
||||
Base::Vector3d dir = this->getUserDirection(&ok);
|
||||
if (ok) {
|
||||
if (dir.Length() < FLT_EPSILON) {
|
||||
QMessageBox::critical(this, LocationDialog::tr("Wrong direction"),
|
||||
|
@ -220,16 +220,16 @@ LocationDialog::~LocationDialog()
|
|||
{
|
||||
}
|
||||
|
||||
Base::Vector3f LocationDialog::getUserDirection(bool* ok) const
|
||||
Base::Vector3d LocationDialog::getUserDirection(bool* ok) const
|
||||
{
|
||||
Gui::Dialog::Ui_InputVector iv;
|
||||
QDialog dlg(const_cast<LocationDialog*>(this));
|
||||
iv.setupUi(&dlg);
|
||||
Base::Vector3f dir;
|
||||
Base::Vector3d dir;
|
||||
if (dlg.exec()) {
|
||||
dir.x = (float)iv.vectorX->value();
|
||||
dir.y = (float)iv.vectorY->value();
|
||||
dir.z = (float)iv.vectorZ->value();
|
||||
dir.x = iv.vectorX->value();
|
||||
dir.y = iv.vectorY->value();
|
||||
dir.z = iv.vectorZ->value();
|
||||
if (ok) *ok = true;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include <cfloat>
|
||||
#include <QDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QMessageBox>
|
||||
#include <QApplication>
|
||||
|
||||
#include <Gui/propertyeditor/PropertyItem.h>
|
||||
|
@ -46,11 +46,11 @@ public:
|
|||
virtual ~LocationWidget();
|
||||
QSize sizeHint() const;
|
||||
|
||||
Base::Vector3f getPosition() const;
|
||||
void setPosition(const Base::Vector3f&);
|
||||
void setDirection(const Base::Vector3f& dir);
|
||||
Base::Vector3f getDirection() const;
|
||||
Base::Vector3f getUserDirection(bool* ok=0) const;
|
||||
Base::Vector3d getPosition() const;
|
||||
void setPosition(const Base::Vector3d&);
|
||||
void setDirection(const Base::Vector3d& dir);
|
||||
Base::Vector3d getDirection() const;
|
||||
Base::Vector3d getUserDirection(bool* ok=0) const;
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_direction_activated(int);
|
||||
|
@ -90,8 +90,8 @@ private Q_SLOTS:
|
|||
void on_direction_activated(int);
|
||||
|
||||
public:
|
||||
virtual Base::Vector3f getDirection() const = 0;
|
||||
Base::Vector3f getUserDirection(bool* ok=0) const;
|
||||
virtual Base::Vector3d getDirection() const = 0;
|
||||
Base::Vector3d getUserDirection(bool* ok=0) const;
|
||||
|
||||
private:
|
||||
virtual void directionActivated(int) = 0;
|
||||
|
@ -135,10 +135,10 @@ public:
|
|||
|
||||
this->direction->setCurrentIndex(2);
|
||||
|
||||
// Vector3f declared to use with QVariant see Gui/propertyeditor/PropertyItem.h
|
||||
this->direction->setItemData(0, QVariant::fromValue<Base::Vector3f>(Base::Vector3f(1,0,0)));
|
||||
this->direction->setItemData(1, QVariant::fromValue<Base::Vector3f>(Base::Vector3f(0,1,0)));
|
||||
this->direction->setItemData(2, QVariant::fromValue<Base::Vector3f>(Base::Vector3f(0,0,1)));
|
||||
// Vector3d declared to use with QVariant see Gui/propertyeditor/PropertyItem.h
|
||||
this->direction->setItemData(0, QVariant::fromValue<Base::Vector3d>(Base::Vector3d(1,0,0)));
|
||||
this->direction->setItemData(1, QVariant::fromValue<Base::Vector3d>(Base::Vector3d(0,1,0)));
|
||||
this->direction->setItemData(2, QVariant::fromValue<Base::Vector3d>(Base::Vector3d(0,0,1)));
|
||||
}
|
||||
else {
|
||||
this->direction->setItemText(0, QApplication::translate("Gui::LocationDialog", "X", 0,
|
||||
|
@ -153,21 +153,21 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
Base::Vector3f getPosition() const
|
||||
Base::Vector3d getPosition() const
|
||||
{
|
||||
return Base::Vector3f((float)this->xPos->value(),
|
||||
(float)this->yPos->value(),
|
||||
(float)this->zPos->value());
|
||||
return Base::Vector3d(this->xPos->value(),
|
||||
this->yPos->value(),
|
||||
this->zPos->value());
|
||||
}
|
||||
|
||||
Base::Vector3f getDirection() const
|
||||
Base::Vector3d getDirection() const
|
||||
{
|
||||
QVariant data = this->direction->itemData (this->direction->currentIndex());
|
||||
if (data.canConvert<Base::Vector3f>()) {
|
||||
return data.value<Base::Vector3f>();
|
||||
if (data.canConvert<Base::Vector3d>()) {
|
||||
return data.value<Base::Vector3d>();
|
||||
}
|
||||
else {
|
||||
return Base::Vector3f(0,0,1);
|
||||
return Base::Vector3d(0,0,1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -188,7 +188,7 @@ private:
|
|||
// last item is selected to define direction by user
|
||||
if (index+1 == this->direction->count()) {
|
||||
bool ok;
|
||||
Base::Vector3f dir = this->getUserDirection(&ok);
|
||||
Base::Vector3d dir = this->getUserDirection(&ok);
|
||||
if (ok) {
|
||||
if (dir.Length() < FLT_EPSILON) {
|
||||
QMessageBox::critical(this, LocationDialog::tr("Wrong direction"),
|
||||
|
@ -199,8 +199,8 @@ private:
|
|||
// check if the user-defined direction is already there
|
||||
for (int i=0; i<this->direction->count()-1; i++) {
|
||||
QVariant data = this->direction->itemData (i);
|
||||
if (data.canConvert<Base::Vector3f>()) {
|
||||
const Base::Vector3f val = data.value<Base::Vector3f>();
|
||||
if (data.canConvert<Base::Vector3d>()) {
|
||||
const Base::Vector3d val = data.value<Base::Vector3d>();
|
||||
if (val == dir) {
|
||||
this->direction->setCurrentIndex(i);
|
||||
return;
|
||||
|
@ -214,7 +214,7 @@ private:
|
|||
.arg(dir.y)
|
||||
.arg(dir.z);
|
||||
this->direction->insertItem(this->direction->count()-1, display,
|
||||
QVariant::fromValue<Base::Vector3f>(dir));
|
||||
QVariant::fromValue<Base::Vector3d>(dir));
|
||||
this->direction->setCurrentIndex(this->direction->count()-2);
|
||||
}
|
||||
}
|
||||
|
@ -257,10 +257,10 @@ public:
|
|||
|
||||
this->direction->setCurrentIndex(2);
|
||||
|
||||
// Vector3f declared to use with QVariant see Gui/propertyeditor/PropertyItem.h
|
||||
this->direction->setItemData(0, QVariant::fromValue<Base::Vector3f>(Base::Vector3f(1,0,0)));
|
||||
this->direction->setItemData(1, QVariant::fromValue<Base::Vector3f>(Base::Vector3f(0,1,0)));
|
||||
this->direction->setItemData(2, QVariant::fromValue<Base::Vector3f>(Base::Vector3f(0,0,1)));
|
||||
// Vector3d declared to use with QVariant see Gui/propertyeditor/PropertyItem.h
|
||||
this->direction->setItemData(0, QVariant::fromValue<Base::Vector3d>(Base::Vector3d(1,0,0)));
|
||||
this->direction->setItemData(1, QVariant::fromValue<Base::Vector3d>(Base::Vector3d(0,1,0)));
|
||||
this->direction->setItemData(2, QVariant::fromValue<Base::Vector3d>(Base::Vector3d(0,0,1)));
|
||||
}
|
||||
else {
|
||||
this->direction->setItemText(0, QApplication::translate("Gui::LocationDialog", "X", 0,
|
||||
|
@ -275,33 +275,33 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void setPosition(const Base::Vector3f& v)
|
||||
void setPosition(const Base::Vector3d& v)
|
||||
{
|
||||
this->xPos->setValue(v.x);
|
||||
this->yPos->setValue(v.y);
|
||||
this->zPos->setValue(v.z);
|
||||
}
|
||||
|
||||
Base::Vector3f getPosition() const
|
||||
Base::Vector3d getPosition() const
|
||||
{
|
||||
return Base::Vector3f((float)this->xPos->value(),
|
||||
(float)this->yPos->value(),
|
||||
(float)this->zPos->value());
|
||||
return Base::Vector3d(this->xPos->value(),
|
||||
this->yPos->value(),
|
||||
this->zPos->value());
|
||||
}
|
||||
|
||||
Base::Vector3f getDirection() const
|
||||
Base::Vector3d getDirection() const
|
||||
{
|
||||
QVariant data = this->direction->itemData (this->direction->currentIndex());
|
||||
if (data.canConvert<Base::Vector3f>()) {
|
||||
return data.value<Base::Vector3f>();
|
||||
if (data.canConvert<Base::Vector3d>()) {
|
||||
return data.value<Base::Vector3d>();
|
||||
}
|
||||
else {
|
||||
return Base::Vector3f(0,0,1);
|
||||
return Base::Vector3d(0,0,1);
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
void setDirection(const Base::Vector3f& dir)
|
||||
void setDirection(const Base::Vector3d& dir)
|
||||
{
|
||||
if (dir.Length() < FLT_EPSILON) {
|
||||
return;
|
||||
|
@ -310,8 +310,8 @@ public:
|
|||
// check if the user-defined direction is already there
|
||||
for (int i=0; i<this->direction->count()-1; i++) {
|
||||
QVariant data = this->direction->itemData (i);
|
||||
if (data.canConvert<Base::Vector3f>()) {
|
||||
const Base::Vector3f val = data.value<Base::Vector3f>();
|
||||
if (data.canConvert<Base::Vector3d>()) {
|
||||
const Base::Vector3d val = data.value<Base::Vector3d>();
|
||||
if (val == dir) {
|
||||
this->direction->setCurrentIndex(i);
|
||||
return;
|
||||
|
@ -325,7 +325,7 @@ public:
|
|||
.arg(dir.y)
|
||||
.arg(dir.z);
|
||||
this->direction->insertItem(this->direction->count()-1, display,
|
||||
QVariant::fromValue<Base::Vector3f>(dir));
|
||||
QVariant::fromValue<Base::Vector3d>(dir));
|
||||
this->direction->setCurrentIndex(this->direction->count()-2);
|
||||
}
|
||||
bool directionActivated(LocationDialog* dlg, int index)
|
||||
|
@ -333,7 +333,7 @@ public:
|
|||
// last item is selected to define direction by user
|
||||
if (index+1 == this->direction->count()) {
|
||||
bool ok;
|
||||
Base::Vector3f dir = dlg->getUserDirection(&ok);
|
||||
Base::Vector3d dir = dlg->getUserDirection(&ok);
|
||||
if (ok) {
|
||||
if (dir.Length() < FLT_EPSILON) {
|
||||
QMessageBox::critical(dlg, LocationDialog::tr("Wrong direction"),
|
||||
|
@ -368,7 +368,7 @@ public:
|
|||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
||||
Base::Vector3f getDirection() const
|
||||
Base::Vector3d getDirection() const
|
||||
{
|
||||
return ui.getDirection();
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#include <QSignalMapper>
|
||||
#include <QSignalMapper>
|
||||
#include <QDockWidget>
|
||||
|
||||
#include "Placement.h"
|
||||
|
@ -314,7 +314,7 @@ void Placement::directionActivated(int index)
|
|||
}
|
||||
}
|
||||
|
||||
Base::Vector3f Placement::getDirection() const
|
||||
Base::Vector3d Placement::getDirection() const
|
||||
{
|
||||
return ui->getDirection();
|
||||
}
|
||||
|
@ -343,11 +343,11 @@ void Placement::setPlacementData(const Base::Placement& p)
|
|||
Base::Vector3d axis;
|
||||
p.getRotation().getValue(axis, angle);
|
||||
ui->angle->setValue(angle*180.0/D_PI);
|
||||
Base::Vector3f dir((float)axis.x,(float)axis.y,(float)axis.z);
|
||||
Base::Vector3d dir(axis.x,axis.y,axis.z);
|
||||
for (int i=0; i<ui->direction->count()-1; i++) {
|
||||
QVariant data = ui->direction->itemData (i);
|
||||
if (data.canConvert<Base::Vector3f>()) {
|
||||
const Base::Vector3f val = data.value<Base::Vector3f>();
|
||||
if (data.canConvert<Base::Vector3d>()) {
|
||||
const Base::Vector3d val = data.value<Base::Vector3d>();
|
||||
if (val == dir) {
|
||||
ui->direction->setCurrentIndex(i);
|
||||
newitem = false;
|
||||
|
@ -363,7 +363,7 @@ void Placement::setPlacementData(const Base::Placement& p)
|
|||
.arg(dir.y)
|
||||
.arg(dir.z);
|
||||
ui->direction->insertItem(ui->direction->count()-1, display,
|
||||
QVariant::fromValue<Base::Vector3f>(dir));
|
||||
QVariant::fromValue<Base::Vector3d>(dir));
|
||||
ui->direction->setCurrentIndex(ui->direction->count()-2);
|
||||
}
|
||||
signalMapper->blockSignals(false);
|
||||
|
@ -386,7 +386,7 @@ Base::Placement Placement::getPlacementData() const
|
|||
cnt = Base::Vector3d(ui->xCnt->value(),ui->yCnt->value(),ui->zCnt->value());
|
||||
|
||||
if (index == 0) {
|
||||
Base::Vector3f dir = getDirection();
|
||||
Base::Vector3d dir = getDirection();
|
||||
rot.setValue(Base::Vector3d(dir.x,dir.y,dir.z),ui->angle->value()*D_PI/180.0);
|
||||
}
|
||||
else if (index == 1) {
|
||||
|
@ -416,11 +416,11 @@ void Placement::changeEvent(QEvent *e)
|
|||
|
||||
DockablePlacement::DockablePlacement(QWidget* parent, Qt::WFlags fl) : Placement(parent, fl)
|
||||
{
|
||||
Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance();
|
||||
Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance();
|
||||
QDockWidget* dw = pDockMgr->addDockWindow(QT_TR_NOOP("Placement"),
|
||||
this, Qt::BottomDockWidgetArea);
|
||||
dw->setFeatures(QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable);
|
||||
dw->show();
|
||||
dw->setFeatures(QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable);
|
||||
dw->show();
|
||||
}
|
||||
|
||||
DockablePlacement::~DockablePlacement()
|
||||
|
@ -429,17 +429,17 @@ DockablePlacement::~DockablePlacement()
|
|||
|
||||
void DockablePlacement::accept()
|
||||
{
|
||||
// closes the dock window
|
||||
Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance();
|
||||
pDockMgr->removeDockWindow(this);
|
||||
// closes the dock window
|
||||
Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance();
|
||||
pDockMgr->removeDockWindow(this);
|
||||
Placement::accept();
|
||||
}
|
||||
|
||||
void DockablePlacement::reject()
|
||||
{
|
||||
// closes the dock window
|
||||
Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance();
|
||||
pDockMgr->removeDockWindow(this);
|
||||
// closes the dock window
|
||||
Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance();
|
||||
pDockMgr->removeDockWindow(this);
|
||||
Placement::reject();
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
void accept();
|
||||
void reject();
|
||||
|
||||
Base::Vector3f getDirection() const;
|
||||
Base::Vector3d getDirection() const;
|
||||
void setPlacement(const Base::Placement&);
|
||||
Base::Placement getPlacement() const;
|
||||
void showDefaultButtons(bool);
|
||||
|
|
|
@ -278,7 +278,7 @@ void DefaultTransformStrategy::onSelectionChanged(const Gui::SelectionChanges& m
|
|||
}
|
||||
|
||||
if (!filter.empty()) {
|
||||
std::set<App::DocumentObject*> diff;
|
||||
std::set<App::DocumentObject*> diff;
|
||||
std::insert_iterator< std::set<App::DocumentObject*> > biit(diff, diff.begin());
|
||||
std::set_difference(update_selection.begin(), update_selection.end(),
|
||||
filter.begin(), filter.end(), biit);
|
||||
|
@ -286,7 +286,7 @@ void DefaultTransformStrategy::onSelectionChanged(const Gui::SelectionChanges& m
|
|||
}
|
||||
|
||||
// reset transform for all deselected objects
|
||||
std::vector<App::DocumentObject*> diff;
|
||||
std::vector<App::DocumentObject*> diff;
|
||||
std::back_insert_iterator< std::vector<App::DocumentObject*> > biit(diff);
|
||||
std::set_difference(selection.begin(), selection.end(),
|
||||
update_selection.begin(), update_selection.end(), biit);
|
||||
|
@ -408,7 +408,7 @@ void Transform::directionActivated(int index)
|
|||
}
|
||||
}
|
||||
|
||||
Base::Vector3f Transform::getDirection() const
|
||||
Base::Vector3d Transform::getDirection() const
|
||||
{
|
||||
return ui->getDirection();
|
||||
}
|
||||
|
@ -424,7 +424,7 @@ Base::Placement Transform::getPlacementData() const
|
|||
cnt = Base::Vector3d(ui->xCnt->value(),ui->yCnt->value(),ui->zCnt->value());
|
||||
|
||||
if (index == 0) {
|
||||
Base::Vector3f dir = getDirection();
|
||||
Base::Vector3d dir = getDirection();
|
||||
rot.setValue(Base::Vector3d(dir.x,dir.y,dir.z),ui->angle->value()*D_PI/180.0);
|
||||
}
|
||||
else if (index == 1) {
|
||||
|
|
|
@ -79,7 +79,7 @@ public:
|
|||
void setTransformStrategy(TransformStrategy* ts);
|
||||
|
||||
protected:
|
||||
Base::Vector3f getDirection() const;
|
||||
Base::Vector3d getDirection() const;
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
public Q_SLOTS:
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user