Integrate Werners & Jans double branch

Move from float to double
Further suggestions for float -> double move
Moved Tools2D from float to double
More suggestions for float->double move from Gui subdirectory
Changes to FEM constraint visuals for float->double move
Suggested changes for float -> double move
Suggestions for Part module moving float -> double
This commit is contained in:
jriegel
2013-09-22 21:55:11 +02:00
parent 78ba09a490
commit 00ea24e07e
64 changed files with 719 additions and 589 deletions

View File

@@ -70,11 +70,11 @@
namespace Part {
const App::PropertyFloatConstraint::Constraints floatRange = {0.0f,FLT_MAX,0.1f};
const App::PropertyFloatConstraint::Constraints apexRange = {0.0f,90.0f,0.1f};
const App::PropertyFloatConstraint::Constraints angleRangeU = {0.0f,360.0f,1.0f};
const App::PropertyFloatConstraint::Constraints angleRangeV = {-90.0f,90.0f,1.0f};
const App::PropertyFloatConstraint::Constraints torusRangeV = {-180.0f,180.0f,1.0f};
const App::PropertyFloatConstraint::Constraints floatRange = {0.0,FLT_MAX,0.1};
const App::PropertyFloatConstraint::Constraints apexRange = {0.0,90.0,0.1};
const App::PropertyFloatConstraint::Constraints angleRangeU = {0.0,360.0,1.0};
const App::PropertyFloatConstraint::Constraints angleRangeV = {-90.0,90.0,1.0};
const App::PropertyFloatConstraint::Constraints torusRangeV = {-180.0,180.0,1.0};
}
using namespace Part;
@@ -166,69 +166,69 @@ void Vertex::onChanged(const App::Property* prop)
Part::Feature::onChanged(prop);
}
PROPERTY_SOURCE(Part::Line, Part::Primitive)
Line::Line()
{
ADD_PROPERTY_TYPE(X1,(0.0f),"Vertex 1 - Start",App::Prop_None,"X value of the start vertex");
ADD_PROPERTY_TYPE(Y1,(0.0f),"Vertex 1 - Start",App::Prop_None,"Y value of the Start vertex");
ADD_PROPERTY_TYPE(Z1,(0.0f),"Vertex 1 - Start",App::Prop_None,"Z value of the Start vertex");
ADD_PROPERTY_TYPE(X2,(0.0f),"Vertex 2 - Finish",App::Prop_None,"X value of the finish vertex");
ADD_PROPERTY_TYPE(Y2,(0.0f),"Vertex 2 - Finish",App::Prop_None,"Y value of the finish vertex");
ADD_PROPERTY_TYPE(Z2,(1.0f),"Vertex 2 - Finish",App::Prop_None,"Z value of the finish vertex");
}
Line::~Line()
{
}
short Line::mustExecute() const
{
if (X1.isTouched() ||
Y1.isTouched() ||
Z1.isTouched() ||
X2.isTouched() ||
Y2.isTouched() ||
Z2.isTouched())
return 1;
return Part::Feature::mustExecute();
}
App::DocumentObjectExecReturn *Line::execute(void)
{
gp_Pnt point1;
point1.SetX(this->X1.getValue());
point1.SetY(this->Y1.getValue());
point1.SetZ(this->Z1.getValue());
gp_Pnt point2;
point2.SetX(this->X2.getValue());
point2.SetY(this->Y2.getValue());
point2.SetZ(this->Z2.getValue());
BRepBuilderAPI_MakeEdge mkEdge(point1, point2);
if (!mkEdge.IsDone())
return new App::DocumentObjectExecReturn("Failed to create edge");
const TopoDS_Edge& edge = mkEdge.Edge();
this->Shape.setValue(edge);
return App::DocumentObject::StdReturn;
}
void Line::onChanged(const App::Property* prop)
{
if (!isRestoring()) {
if (prop == &X1 || prop == &Y1 || prop == &Z1 || prop == &X2 || prop == &Y2 || prop == &Z2){
try {
App::DocumentObjectExecReturn *ret = recompute();
delete ret;
}
catch (...) {
}
}
}
Part::Feature::onChanged(prop);
}
PROPERTY_SOURCE(Part::Line, Part::Primitive)
Line::Line()
{
ADD_PROPERTY_TYPE(X1,(0.0f),"Vertex 1 - Start",App::Prop_None,"X value of the start vertex");
ADD_PROPERTY_TYPE(Y1,(0.0f),"Vertex 1 - Start",App::Prop_None,"Y value of the Start vertex");
ADD_PROPERTY_TYPE(Z1,(0.0f),"Vertex 1 - Start",App::Prop_None,"Z value of the Start vertex");
ADD_PROPERTY_TYPE(X2,(0.0f),"Vertex 2 - Finish",App::Prop_None,"X value of the finish vertex");
ADD_PROPERTY_TYPE(Y2,(0.0f),"Vertex 2 - Finish",App::Prop_None,"Y value of the finish vertex");
ADD_PROPERTY_TYPE(Z2,(1.0f),"Vertex 2 - Finish",App::Prop_None,"Z value of the finish vertex");
}
Line::~Line()
{
}
short Line::mustExecute() const
{
if (X1.isTouched() ||
Y1.isTouched() ||
Z1.isTouched() ||
X2.isTouched() ||
Y2.isTouched() ||
Z2.isTouched())
return 1;
return Part::Feature::mustExecute();
}
App::DocumentObjectExecReturn *Line::execute(void)
{
gp_Pnt point1;
point1.SetX(this->X1.getValue());
point1.SetY(this->Y1.getValue());
point1.SetZ(this->Z1.getValue());
gp_Pnt point2;
point2.SetX(this->X2.getValue());
point2.SetY(this->Y2.getValue());
point2.SetZ(this->Z2.getValue());
BRepBuilderAPI_MakeEdge mkEdge(point1, point2);
if (!mkEdge.IsDone())
return new App::DocumentObjectExecReturn("Failed to create edge");
const TopoDS_Edge& edge = mkEdge.Edge();
this->Shape.setValue(edge);
return App::DocumentObject::StdReturn;
}
void Line::onChanged(const App::Property* prop)
{
if (!isRestoring()) {
if (prop == &X1 || prop == &Y1 || prop == &Z1 || prop == &X2 || prop == &Y2 || prop == &Z2){
try {
App::DocumentObjectExecReturn *ret = recompute();
delete ret;
}
catch (...) {
}
}
}
Part::Feature::onChanged(prop);
}
PROPERTY_SOURCE(Part::Plane, Part::Primitive)