PartDesign module moving float -> double

This commit is contained in:
jrheinlaender 2013-03-25 17:42:29 +04:30
parent 4c0781a555
commit 8df84e76c4
13 changed files with 35 additions and 35 deletions

View File

@ -41,12 +41,12 @@ using namespace PartDesign;
PROPERTY_SOURCE(PartDesign::Chamfer, PartDesign::DressUp)
const App::PropertyFloatConstraint::Constraints floatSize = {0.0f,FLT_MAX,0.1f};
const App::PropertyFloatConstraint::Constraints floatSize = {0.0,FLT_MAX,0.1};
Chamfer::Chamfer()
{
ADD_PROPERTY(Size,(1.0f));
ADD_PROPERTY(Size,(1.0));
Size.setConstraints(&floatSize);
}
@ -73,7 +73,7 @@ App::DocumentObjectExecReturn *Chamfer::execute(void)
if (SubVals.size() == 0)
return new App::DocumentObjectExecReturn("No edges specified");
float size = Size.getValue();
double size = Size.getValue();
this->positionByBase();
// create an untransformed copy of the base shape

View File

@ -61,11 +61,11 @@ using namespace PartDesign;
PROPERTY_SOURCE(PartDesign::Draft, PartDesign::DressUp)
const App::PropertyFloatConstraint::Constraints floatAngle = {0.0f,89.99f,0.1f};
const App::PropertyFloatConstraint::Constraints floatAngle = {0.0,89.9,0.1};
Draft::Draft()
{
ADD_PROPERTY(Angle,(1.5f));
ADD_PROPERTY(Angle,(1.5));
Angle.setConstraints(&floatAngle);
ADD_PROPERTY_TYPE(NeutralPlane,(0),"Draft",(App::PropertyType)(App::Prop_None),"NeutralPlane");
ADD_PROPERTY_TYPE(PullDirection,(0),"Draft",(App::PropertyType)(App::Prop_None),"PullDirection");
@ -104,7 +104,7 @@ App::DocumentObjectExecReturn *Draft::execute(void)
return new App::DocumentObjectExecReturn("No faces specified");
// Draft angle
float angle = Angle.getValue() / 180.0 * M_PI;
double angle = Angle.getValue() / 180.0 * M_PI;
// Pull direction
gp_Dir pullDirection;

View File

@ -39,11 +39,11 @@ using namespace PartDesign;
PROPERTY_SOURCE(PartDesign::Fillet, PartDesign::DressUp)
const App::PropertyFloatConstraint::Constraints floatRadius = {0.0f,FLT_MAX,0.1f};
const App::PropertyFloatConstraint::Constraints floatRadius = {0.0,FLT_MAX,0.1};
Fillet::Fillet()
{
ADD_PROPERTY(Radius,(1.0f));
ADD_PROPERTY(Radius,(1.0));
Radius.setConstraints(&floatRadius);
}
@ -70,8 +70,8 @@ App::DocumentObjectExecReturn *Fillet::execute(void)
if (SubVals.size() == 0)
return new App::DocumentObjectExecReturn("No edges specified");
float radius = Radius.getValue();
double radius = Radius.getValue();
this->positionByBase();
// create an untransformed copy of the base shape
Part::TopoShape baseShape(TopShape);

View File

@ -66,7 +66,7 @@ short LinearPattern::mustExecute() const
const std::list<gp_Trsf> LinearPattern::getTransformations(const std::vector<App::DocumentObject*>)
{
float distance = Length.getValue();
double distance = Length.getValue();
if (distance < Precision::Confusion())
throw Base::Exception("Pattern length too small");
int occurrences = Occurrences.getValue();

View File

@ -65,7 +65,7 @@ short PolarPattern::mustExecute() const
const std::list<gp_Trsf> PolarPattern::getTransformations(const std::vector<App::DocumentObject*>)
{
float angle = Angle.getValue();
double angle = Angle.getValue();
if (angle < Precision::Confusion())
throw Base::Exception("Pattern angle too small");
int occurrences = Occurrences.getValue();
@ -105,7 +105,7 @@ const std::list<gp_Trsf> PolarPattern::getTransformations(const std::vector<App:
axis = refSketch->getAxis(AxId);
}
axis *= refSketch->Placement.getValue();
axbase = gp_Pnt(axis.getBase().x, axis.getBase().y, axis.getBase().z);
axbase = gp_Pnt(axis.getBase().x, axis.getBase().y, axis.getBase().z);
axdir = gp_Dir(axis.getDirection().x, axis.getDirection().y, axis.getDirection().z);
} else {
Part::Feature* refFeature = static_cast<Part::Feature*>(refObject);

View File

@ -55,8 +55,8 @@ PROPERTY_SOURCE(PartDesign::Revolution, PartDesign::Additive)
Revolution::Revolution()
{
ADD_PROPERTY_TYPE(Base,(Base::Vector3d(0.0f,0.0f,0.0f)),"Revolution", App::Prop_ReadOnly, "Base");
ADD_PROPERTY_TYPE(Axis,(Base::Vector3d(0.0f,1.0f,0.0f)),"Revolution", App::Prop_ReadOnly, "Axis");
ADD_PROPERTY_TYPE(Base,(Base::Vector3d(0.0,0.0,0.0)),"Revolution", App::Prop_ReadOnly, "Base");
ADD_PROPERTY_TYPE(Axis,(Base::Vector3d(0.0,1.0,0.0)),"Revolution", App::Prop_ReadOnly, "Axis");
ADD_PROPERTY_TYPE(Angle,(360.0),"Revolution", App::Prop_None, "Angle");
ADD_PROPERTY_TYPE(ReferenceAxis,(0),"Revolution",(App::Prop_None),"Reference axis of revolution");
}
@ -171,7 +171,7 @@ App::DocumentObjectExecReturn *Revolution::execute(void)
return new App::DocumentObjectExecReturn(e.what());
}
}
bool Revolution::suggestReversed(void)
{
try {

View File

@ -73,7 +73,7 @@ TaskChamferParameters::TaskChamferParameters(ViewProviderChamfer *ChamferView,QW
void TaskChamferParameters::onLengthChanged(double len)
{
PartDesign::Chamfer* pcChamfer = static_cast<PartDesign::Chamfer*>(ChamferView->getObject());
pcChamfer->Size.setValue((float)len);
pcChamfer->Size.setValue(len);
pcChamfer->getDocument()->recomputeFeature(pcChamfer);
}

View File

@ -287,7 +287,7 @@ void TaskDraftParameters::showObject()
void TaskDraftParameters::onAngleChanged(double angle)
{
PartDesign::Draft* pcDraft = static_cast<PartDesign::Draft*>(DraftView->getObject());
pcDraft->Angle.setValue((float)angle);
pcDraft->Angle.setValue(angle);
pcDraft->getDocument()->recomputeFeature(pcDraft);
}

View File

@ -73,7 +73,7 @@ TaskFilletParameters::TaskFilletParameters(ViewProviderFillet *FilletView,QWidge
void TaskFilletParameters::onLengthChanged(double len)
{
PartDesign::Fillet* pcFillet = static_cast<PartDesign::Fillet*>(FilletView->getObject());
pcFillet->Radius.setValue((float)len);
pcFillet->Radius.setValue(len);
pcFillet->getDocument()->recomputeFeature(pcFillet);
}

View File

@ -124,7 +124,7 @@ TaskGrooveParameters::TaskGrooveParameters(ViewProviderGroove *GrooveView,QWidge
void TaskGrooveParameters::onAngleChanged(double len)
{
PartDesign::Groove* pcGroove = static_cast<PartDesign::Groove*>(GrooveView->getObject());
pcGroove->Angle.setValue((float)len);
pcGroove->Angle.setValue(len);
if (updateView())
pcGroove->getDocument()->recomputeFeature(pcGroove);
}
@ -187,7 +187,7 @@ void TaskGrooveParameters::onUpdateView(bool on)
{
if (on) {
PartDesign::Groove* pcGroove = static_cast<PartDesign::Groove*>(GrooveView->getObject());
pcGroove->getDocument()->recomputeFeature(pcGroove);
pcGroove->getDocument()->recomputeFeature(pcGroove);
}
}

View File

@ -235,7 +235,7 @@ void TaskPadParameters::onSelectionChanged(const Gui::SelectionChanges& msg)
void TaskPadParameters::onLengthChanged(double len)
{
PartDesign::Pad* pcPad = static_cast<PartDesign::Pad*>(PadView->getObject());
pcPad->Length.setValue((float)len);
pcPad->Length.setValue(len);
if (updateView())
pcPad->getDocument()->recomputeFeature(pcPad);
}
@ -260,7 +260,7 @@ void TaskPadParameters::onReversed(bool on)
void TaskPadParameters::onLength2Changed(double len)
{
PartDesign::Pad* pcPad = static_cast<PartDesign::Pad*>(PadView->getObject());
pcPad->Length2.setValue((float)len);
pcPad->Length2.setValue(len);
if (updateView())
pcPad->getDocument()->recomputeFeature(pcPad);
}
@ -412,15 +412,15 @@ void TaskPadParameters::changeEvent(QEvent *e)
ui->changeMode->addItem(tr("Up to face"));
ui->changeMode->addItem(tr("Two dimensions"));
ui->changeMode->setCurrentIndex(index);
QByteArray upToFace = this->getFaceName();
QByteArray upToFace = this->getFaceName();
int faceId = -1;
bool ok = false;
if (upToFace.indexOf("Face") == 0) {
faceId = upToFace.remove(0,4).toInt(&ok);
}
ui->lineFaceName->setText(ok ?
tr("Face") + QString::number(faceId) :
ui->lineFaceName->setText(ok ?
tr("Face") + QString::number(faceId) :
tr("No face selected"));
ui->doubleSpinBox->blockSignals(false);
ui->doubleSpinBox2->blockSignals(false);

View File

@ -215,7 +215,7 @@ void TaskPocketParameters::onSelectionChanged(const Gui::SelectionChanges& msg)
void TaskPocketParameters::onLengthChanged(double len)
{
PartDesign::Pocket* pcPocket = static_cast<PartDesign::Pocket*>(PocketView->getObject());
pcPocket->Length.setValue((float)len);
pcPocket->Length.setValue(len);
if (updateView())
pcPocket->getDocument()->recomputeFeature(pcPocket);
}
@ -374,15 +374,15 @@ void TaskPocketParameters::changeEvent(QEvent *e)
ui->changeMode->addItem(tr("To first"));
ui->changeMode->addItem(tr("Up to face"));
ui->changeMode->setCurrentIndex(index);
QByteArray upToFace = this->getFaceName();
QByteArray upToFace = this->getFaceName();
int faceId = -1;
bool ok = false;
if (upToFace.indexOf("Face") == 0) {
faceId = upToFace.remove(0,4).toInt(&ok);
}
ui->lineFaceName->setText(ok ?
tr("Face") + QString::number(faceId) :
ui->lineFaceName->setText(ok ?
tr("Face") + QString::number(faceId) :
tr("No face selected"));
ui->doubleSpinBox->blockSignals(false);
ui->lineFaceName->blockSignals(false);

View File

@ -124,7 +124,7 @@ TaskRevolutionParameters::TaskRevolutionParameters(ViewProviderRevolution *Revol
void TaskRevolutionParameters::onAngleChanged(double len)
{
PartDesign::Revolution* pcRevolution = static_cast<PartDesign::Revolution*>(RevolutionView->getObject());
pcRevolution->Angle.setValue((float)len);
pcRevolution->Angle.setValue(len);
if (updateView())
pcRevolution->getDocument()->recomputeFeature(pcRevolution);
}
@ -187,7 +187,7 @@ void TaskRevolutionParameters::onUpdateView(bool on)
{
if (on) {
PartDesign::Revolution* pcRevolution = static_cast<PartDesign::Revolution*>(RevolutionView->getObject());
pcRevolution->getDocument()->recomputeFeature(pcRevolution);
pcRevolution->getDocument()->recomputeFeature(pcRevolution);
}
}