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:
@@ -55,9 +55,9 @@ PROPERTY_SOURCE(Part::Extrusion, Part::Feature)
|
||||
Extrusion::Extrusion()
|
||||
{
|
||||
ADD_PROPERTY(Base,(0));
|
||||
ADD_PROPERTY(Dir,(Base::Vector3f(0.0f,0.0f,1.0f)));
|
||||
ADD_PROPERTY(Dir,(Base::Vector3d(0.0,0.0,1.0)));
|
||||
ADD_PROPERTY(Solid,(false));
|
||||
ADD_PROPERTY(TaperAngle,(0.0f));
|
||||
ADD_PROPERTY(TaperAngle,(0.0));
|
||||
}
|
||||
|
||||
short Extrusion::mustExecute() const
|
||||
@@ -79,9 +79,9 @@ App::DocumentObjectExecReturn *Extrusion::execute(void)
|
||||
return new App::DocumentObjectExecReturn("Linked object is not a Part object");
|
||||
Part::Feature *base = static_cast<Part::Feature*>(Base.getValue());
|
||||
|
||||
Base::Vector3f v = Dir.getValue();
|
||||
Base::Vector3d v = Dir.getValue();
|
||||
gp_Vec vec(v.x,v.y,v.z);
|
||||
float taperAngle = TaperAngle.getValue();
|
||||
double taperAngle = TaperAngle.getValue();
|
||||
bool makeSolid = Solid.getValue();
|
||||
|
||||
try {
|
||||
|
||||
@@ -42,8 +42,8 @@ PROPERTY_SOURCE(Part::Mirroring, Part::Feature)
|
||||
Mirroring::Mirroring()
|
||||
{
|
||||
ADD_PROPERTY(Source,(0));
|
||||
ADD_PROPERTY_TYPE(Base,(Base::Vector3f()),"Plane",App::Prop_None,"The base point of the plane");
|
||||
ADD_PROPERTY_TYPE(Normal,(Base::Vector3f(0,0,1)),"Plane",App::Prop_None,"The normal of the plane");
|
||||
ADD_PROPERTY_TYPE(Base,(Base::Vector3d()),"Plane",App::Prop_None,"The base point of the plane");
|
||||
ADD_PROPERTY_TYPE(Normal,(Base::Vector3d(0,0,1)),"Plane",App::Prop_None,"The normal of the plane");
|
||||
}
|
||||
|
||||
short Mirroring::mustExecute() const
|
||||
@@ -80,8 +80,8 @@ App::DocumentObjectExecReturn *Mirroring::execute(void)
|
||||
if (!link->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId()))
|
||||
return new App::DocumentObjectExecReturn("Linked object is not a Part object");
|
||||
Part::Feature *source = static_cast<Part::Feature*>(link);
|
||||
Base::Vector3f base = Base.getValue();
|
||||
Base::Vector3f norm = Normal.getValue();
|
||||
Base::Vector3d base = Base.getValue();
|
||||
Base::Vector3d norm = Normal.getValue();
|
||||
|
||||
try {
|
||||
const TopoDS_Shape& shape = source->Shape.getValue();
|
||||
|
||||
@@ -182,8 +182,8 @@ void Box::Restore(Base::XMLReader &reader)
|
||||
}
|
||||
// for 0.8 releases
|
||||
else if (location_axis) {
|
||||
Base::Vector3f d = Axis.getValue();
|
||||
Base::Vector3f p = Location.getValue();
|
||||
Base::Vector3d d = Axis.getValue();
|
||||
Base::Vector3d p = Location.getValue();
|
||||
Base::Rotation rot(Base::Vector3d(0.0,0.0,1.0),
|
||||
Base::Vector3d(d.x,d.y,d.z));
|
||||
plm.setRotation(rot);
|
||||
|
||||
@@ -37,7 +37,7 @@ PROPERTY_SOURCE(Part::Polygon, Part::Feature)
|
||||
|
||||
Part::Polygon::Polygon()
|
||||
{
|
||||
ADD_PROPERTY(Nodes,(Base::Vector3f()));
|
||||
ADD_PROPERTY(Nodes,(Base::Vector3d()));
|
||||
ADD_PROPERTY(Close,(false));
|
||||
}
|
||||
|
||||
@@ -55,9 +55,9 @@ short Part::Polygon::mustExecute() const
|
||||
App::DocumentObjectExecReturn *Part::Polygon::execute(void)
|
||||
{
|
||||
BRepBuilderAPI_MakePolygon poly;
|
||||
const std::vector<Base::Vector3f> nodes = Nodes.getValues();
|
||||
const std::vector<Base::Vector3d> nodes = Nodes.getValues();
|
||||
|
||||
for (std::vector<Base::Vector3f>::const_iterator it = nodes.begin(); it != nodes.end(); ++it) {
|
||||
for (std::vector<Base::Vector3d>::const_iterator it = nodes.begin(); it != nodes.end(); ++it) {
|
||||
gp_Pnt pnt(it->x, it->y, it->z);
|
||||
poly.Add(pnt);
|
||||
}
|
||||
|
||||
@@ -32,16 +32,16 @@
|
||||
|
||||
using namespace Part;
|
||||
|
||||
App::PropertyFloatConstraint::Constraints Revolution::angleRangeU = {-360.0f,360.0f,1.0f};
|
||||
App::PropertyFloatConstraint::Constraints Revolution::angleRangeU = {-360.0,360.0,1.0};
|
||||
|
||||
PROPERTY_SOURCE(Part::Revolution, Part::Feature)
|
||||
|
||||
Revolution::Revolution()
|
||||
{
|
||||
ADD_PROPERTY(Source,(0));
|
||||
ADD_PROPERTY(Base,(Base::Vector3f(0.0f,0.0f,0.0f)));
|
||||
ADD_PROPERTY(Axis,(Base::Vector3f(0.0f,0.0f,1.0f)));
|
||||
ADD_PROPERTY(Angle,(360.0f));
|
||||
ADD_PROPERTY(Base,(Base::Vector3d(0.0,0.0,0.0)));
|
||||
ADD_PROPERTY(Axis,(Base::Vector3d(0.0,0.0,1.0)));
|
||||
ADD_PROPERTY(Angle,(360.0));
|
||||
Angle.setConstraints(&angleRangeU);
|
||||
}
|
||||
|
||||
@@ -64,8 +64,8 @@ App::DocumentObjectExecReturn *Revolution::execute(void)
|
||||
return new App::DocumentObjectExecReturn("Linked object is not a Part object");
|
||||
Part::Feature *base = static_cast<Part::Feature*>(Source.getValue());
|
||||
|
||||
Base::Vector3f b = Base.getValue();
|
||||
Base::Vector3f v = Axis.getValue();
|
||||
Base::Vector3d b = Base.getValue();
|
||||
Base::Vector3d v = Axis.getValue();
|
||||
gp_Pnt pnt(b.x,b.y,b.z);
|
||||
gp_Dir dir(v.x,v.y,v.z);
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ PyObject* ParabolaPy::compute(PyObject *args)
|
||||
}
|
||||
|
||||
Base::Matrix4D m;
|
||||
Base::Vector3f v;
|
||||
Base::Vector3d v;
|
||||
m[0][0] = v1.y * v1.y;
|
||||
m[0][1] = v1.y;
|
||||
m[0][2] = 1;
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -22,32 +22,32 @@
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
# include <BRep_Builder.hxx>
|
||||
# include <BRep_Tool.hxx>
|
||||
# include <BRepCheck_Analyzer.hxx>
|
||||
# include <BRepTools.hxx>
|
||||
# include <BRepBuilderAPI_MakeFace.hxx>
|
||||
# include <ShapeAnalysis.hxx>
|
||||
# include <BRepAdaptor_Surface.hxx>
|
||||
# include <BRepLProp_SLProps.hxx>
|
||||
# include <BRepOffsetAPI_MakeOffset.hxx>
|
||||
#ifndef _PreComp_
|
||||
# include <BRep_Builder.hxx>
|
||||
# include <BRep_Tool.hxx>
|
||||
# include <BRepCheck_Analyzer.hxx>
|
||||
# include <BRepTools.hxx>
|
||||
# include <BRepBuilderAPI_MakeFace.hxx>
|
||||
# include <ShapeAnalysis.hxx>
|
||||
# include <BRepAdaptor_Surface.hxx>
|
||||
# include <BRepLProp_SLProps.hxx>
|
||||
# include <BRepOffsetAPI_MakeOffset.hxx>
|
||||
# include <Geom_BezierSurface.hxx>
|
||||
# include <Geom_BSplineSurface.hxx>
|
||||
# include <Geom_Plane.hxx>
|
||||
# include <Geom_CylindricalSurface.hxx>
|
||||
# include <Geom_ConicalSurface.hxx>
|
||||
# include <Geom_RectangularTrimmedSurface.hxx>
|
||||
# include <Geom_Plane.hxx>
|
||||
# include <Geom_CylindricalSurface.hxx>
|
||||
# include <Geom_ConicalSurface.hxx>
|
||||
# include <Geom_RectangularTrimmedSurface.hxx>
|
||||
# include <Geom_SphericalSurface.hxx>
|
||||
# include <Geom_ToroidalSurface.hxx>
|
||||
# include <Handle_Geom_Surface.hxx>
|
||||
# include <TopoDS.hxx>
|
||||
# include <TopoDS_Face.hxx>
|
||||
# include <TopoDS_Wire.hxx>
|
||||
# include <gp_Pnt2d.hxx>
|
||||
# include <gp_Pln.hxx>
|
||||
# include <gp_Cylinder.hxx>
|
||||
# include <gp_Cone.hxx>
|
||||
# include <TopoDS_Face.hxx>
|
||||
# include <TopoDS_Wire.hxx>
|
||||
# include <gp_Pnt2d.hxx>
|
||||
# include <gp_Pln.hxx>
|
||||
# include <gp_Cylinder.hxx>
|
||||
# include <gp_Cone.hxx>
|
||||
# include <gp_Sphere.hxx>
|
||||
# include <gp_Torus.hxx>
|
||||
# include <Standard_Version.hxx>
|
||||
@@ -55,7 +55,7 @@
|
||||
# include <ShapeFix_Wire.hxx>
|
||||
# include <TopExp_Explorer.hxx>
|
||||
# include <TopTools_IndexedMapOfShape.hxx>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <BRepTopAdaptor_FClass2d.hxx>
|
||||
#include <BRepPrimAPI_MakeHalfSpace.hxx>
|
||||
@@ -106,7 +106,7 @@ PyObject *TopoShapeFacePy::PyMake(struct _typeobject *, PyObject *, PyObject *)
|
||||
int TopoShapeFacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
{
|
||||
PyObject *pW;
|
||||
if (PyArg_ParseTuple(args, "O!", &(Part::TopoShapePy::Type), &pW)) {
|
||||
if (PyArg_ParseTuple(args, "O!", &(Part::TopoShapePy::Type), &pW)) {
|
||||
try {
|
||||
const TopoDS_Shape& sh = static_cast<Part::TopoShapePy*>(pW)->getTopoShapePtr()->_Shape;
|
||||
if (sh.IsNull()) {
|
||||
@@ -122,17 +122,17 @@ int TopoShapeFacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
}
|
||||
getTopoShapePtr()->_Shape = mkFace.Face();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else if (sh.ShapeType() == TopAbs_FACE) {
|
||||
getTopoShapePtr()->_Shape = sh;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
PyErr_SetString(PyExc_Exception, e->GetMessageString());
|
||||
PyErr_SetString(PyExc_Exception, e->GetMessageString());
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
@@ -247,7 +247,7 @@ int TopoShapeFacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
|
||||
PyObject* TopoShapeFacePy::makeOffset(PyObject *args)
|
||||
{
|
||||
float dist;
|
||||
double dist;
|
||||
if (!PyArg_ParseTuple(args, "f",&dist))
|
||||
return 0;
|
||||
const TopoDS_Face& f = TopoDS::Face(getTopoShapePtr()->_Shape);
|
||||
|
||||
@@ -23,10 +23,10 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
# include <gp_Pnt.hxx>
|
||||
# include <gp_Ax1.hxx>
|
||||
# include <BRep_Tool.hxx>
|
||||
#ifndef _PreComp_
|
||||
# include <gp_Pnt.hxx>
|
||||
# include <gp_Ax1.hxx>
|
||||
# include <BRep_Tool.hxx>
|
||||
# include <TopoDS.hxx>
|
||||
# include <TopoDS_Vertex.hxx>
|
||||
# include <BRep_Builder.hxx>
|
||||
@@ -84,9 +84,9 @@ int TopoShapeVertexPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
if (PyArg_ParseTuple(args,"O!",&(PyTuple_Type), &object)) {
|
||||
try {
|
||||
Py::Tuple tuple(object);
|
||||
x = (float)Py::Float(tuple.getItem(0));
|
||||
y = (float)Py::Float(tuple.getItem(1));
|
||||
z = (float)Py::Float(tuple.getItem(2));
|
||||
x = Py::Float(tuple.getItem(0));
|
||||
y = Py::Float(tuple.getItem(1));
|
||||
z = Py::Float(tuple.getItem(2));
|
||||
success = true;
|
||||
}
|
||||
catch (const Py::Exception&) {
|
||||
|
||||
@@ -209,7 +209,7 @@ PyObject* TopoShapeWirePy::fixWire(PyObject *args)
|
||||
|
||||
PyObject* TopoShapeWirePy::makeOffset(PyObject *args)
|
||||
{
|
||||
float dist;
|
||||
double dist;
|
||||
if (!PyArg_ParseTuple(args, "f",&dist))
|
||||
return 0;
|
||||
const TopoDS_Wire& w = TopoDS::Wire(getTopoShapePtr()->_Shape);
|
||||
|
||||
@@ -90,7 +90,7 @@ Part::Offset* OffsetWidget::getObject() const
|
||||
|
||||
void OffsetWidget::on_spinOffset_valueChanged(double val)
|
||||
{
|
||||
d->offset->Value.setValue((float)val);
|
||||
d->offset->Value.setValue(val);
|
||||
if (d->ui.updateView->isChecked())
|
||||
d->offset->getDocument()->recomputeFeature(d->offset);
|
||||
}
|
||||
@@ -104,7 +104,7 @@ void OffsetWidget::on_modeType_activated(int val)
|
||||
|
||||
void OffsetWidget::on_joinType_activated(int val)
|
||||
{
|
||||
d->offset->Join.setValue((float)val);
|
||||
d->offset->Join.setValue((long)val);
|
||||
if (d->ui.updateView->isChecked())
|
||||
d->offset->getDocument()->recomputeFeature(d->offset);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ Part::Thickness* ThicknessWidget::getObject() const
|
||||
|
||||
void ThicknessWidget::on_spinOffset_valueChanged(double val)
|
||||
{
|
||||
d->thickness->Value.setValue((float)val);
|
||||
d->thickness->Value.setValue(val);
|
||||
if (d->ui.updateView->isChecked())
|
||||
d->thickness->getDocument()->recomputeFeature(d->thickness);
|
||||
}
|
||||
@@ -128,7 +128,7 @@ void ThicknessWidget::on_modeType_activated(int val)
|
||||
|
||||
void ThicknessWidget::on_joinType_activated(int val)
|
||||
{
|
||||
d->thickness->Join.setValue((float)val);
|
||||
d->thickness->Join.setValue((long)val);
|
||||
if (d->ui.updateView->isChecked())
|
||||
d->thickness->getDocument()->recomputeFeature(d->thickness);
|
||||
}
|
||||
|
||||
@@ -55,8 +55,8 @@
|
||||
# include <TopTools_IndexedMapOfShape.hxx>
|
||||
# include <Poly_PolygonOnTriangulation.hxx>
|
||||
# include <TColStd_Array1OfInteger.hxx>
|
||||
# include <TopTools_ListOfShape.hxx>
|
||||
# include <Inventor/SoPickedPoint.h>
|
||||
# include <TopTools_ListOfShape.hxx>
|
||||
# include <Inventor/SoPickedPoint.h>
|
||||
# include <Inventor/events/SoMouseButtonEvent.h>
|
||||
# include <Inventor/nodes/SoCoordinate3.h>
|
||||
# include <Inventor/nodes/SoDrawStyle.h>
|
||||
@@ -164,8 +164,8 @@ PROPERTY_SOURCE(PartGui::ViewProviderPartBase, Gui::ViewProviderGeometryObject)
|
||||
//**************************************************************************
|
||||
// Construction/Destruction
|
||||
|
||||
App::PropertyFloatConstraint::Constraints ViewProviderPartBase::floatRange = {1.0f,64.0f,1.0f};
|
||||
const char* ViewProviderPartBase::LightingEnums[]= {"One side","Two side",NULL};
|
||||
App::PropertyFloatConstraint::Constraints ViewProviderPartBase::floatRange = {1.0,64.0,1.0};
|
||||
const char* ViewProviderPartBase::LightingEnums[]= {"One side","Two side",NULL};
|
||||
|
||||
ViewProviderPartBase::ViewProviderPartBase() : pcControlPoints(0)
|
||||
{
|
||||
@@ -185,8 +185,8 @@ ViewProviderPartBase::ViewProviderPartBase() : pcControlPoints(0)
|
||||
PointSize.setConstraints(&floatRange);
|
||||
ADD_PROPERTY(PointSize,(2.0f));
|
||||
ADD_PROPERTY(ControlPoints,(false));
|
||||
ADD_PROPERTY(Lighting,(1));
|
||||
Lighting.setEnums(LightingEnums);
|
||||
ADD_PROPERTY(Lighting,(1));
|
||||
Lighting.setEnums(LightingEnums);
|
||||
|
||||
EdgeRoot = new SoSeparator();
|
||||
EdgeRoot->ref();
|
||||
@@ -211,11 +211,11 @@ ViewProviderPartBase::ViewProviderPartBase() : pcControlPoints(0)
|
||||
pcPointStyle->ref();
|
||||
pcPointStyle->style = SoDrawStyle::POINTS;
|
||||
pcPointStyle->pointSize = PointSize.getValue();
|
||||
|
||||
pShapeHints = new SoShapeHints;
|
||||
pShapeHints->shapeType = SoShapeHints::UNKNOWN_SHAPE_TYPE;
|
||||
pShapeHints->ref();
|
||||
Lighting.touch();
|
||||
|
||||
pShapeHints = new SoShapeHints;
|
||||
pShapeHints->shapeType = SoShapeHints::UNKNOWN_SHAPE_TYPE;
|
||||
pShapeHints->ref();
|
||||
Lighting.touch();
|
||||
|
||||
sPixmap = "Tree_Part";
|
||||
loadParameter();
|
||||
@@ -230,7 +230,7 @@ ViewProviderPartBase::~ViewProviderPartBase()
|
||||
pcPointMaterial->unref();
|
||||
pcLineStyle->unref();
|
||||
pcPointStyle->unref();
|
||||
pShapeHints->unref();
|
||||
pShapeHints->unref();
|
||||
}
|
||||
|
||||
void ViewProviderPartBase::onChanged(const App::Property* prop)
|
||||
@@ -280,12 +280,12 @@ void ViewProviderPartBase::onChanged(const App::Property* prop)
|
||||
App::Property* shape = obj->getPropertyByName("Shape");
|
||||
showControlPoints(ControlPoints.getValue(), shape);
|
||||
}
|
||||
else if (prop == &Lighting) {
|
||||
if (Lighting.getValue() == 0)
|
||||
pShapeHints->vertexOrdering = SoShapeHints::UNKNOWN_ORDERING;
|
||||
else
|
||||
pShapeHints->vertexOrdering = SoShapeHints::COUNTERCLOCKWISE;
|
||||
}
|
||||
else if (prop == &Lighting) {
|
||||
if (Lighting.getValue() == 0)
|
||||
pShapeHints->vertexOrdering = SoShapeHints::UNKNOWN_ORDERING;
|
||||
else
|
||||
pShapeHints->vertexOrdering = SoShapeHints::COUNTERCLOCKWISE;
|
||||
}
|
||||
else {
|
||||
ViewProviderGeometryObject::onChanged(prop);
|
||||
}
|
||||
@@ -361,7 +361,7 @@ std::vector<std::string> ViewProviderPartBase::getDisplayModes(void) const
|
||||
|
||||
return StrList;
|
||||
}
|
||||
|
||||
|
||||
void ViewProviderPartBase::shapeInfoCallback(void * ud, SoEventCallback * n)
|
||||
{
|
||||
const SoMouseButtonEvent * mbe = (SoMouseButtonEvent *)n->getEvent();
|
||||
@@ -916,7 +916,7 @@ void ViewProviderPartBase::showControlPoints(bool show, const App::Property* pro
|
||||
{
|
||||
if (!pcControlPoints && show) {
|
||||
pcControlPoints = new SoSwitch();
|
||||
pcRoot->addChild(pcControlPoints);
|
||||
pcRoot->addChild(pcControlPoints);
|
||||
}
|
||||
|
||||
if (pcControlPoints) {
|
||||
@@ -1167,12 +1167,12 @@ void ViewProviderEllipsoid::updateData(const App::Property* prop)
|
||||
return;
|
||||
App::DocumentObject* object = this->getObject();
|
||||
if (object && object->isDerivedFrom(Part::Ellipsoid::getClassTypeId())) {
|
||||
float angle1 = static_cast<Part::Ellipsoid*>(object)->Angle1.getValue();
|
||||
float angle2 = static_cast<Part::Ellipsoid*>(object)->Angle2.getValue();
|
||||
float angle3 = static_cast<Part::Ellipsoid*>(object)->Angle3.getValue();
|
||||
double angle1 = static_cast<Part::Ellipsoid*>(object)->Angle1.getValue();
|
||||
double angle2 = static_cast<Part::Ellipsoid*>(object)->Angle2.getValue();
|
||||
double angle3 = static_cast<Part::Ellipsoid*>(object)->Angle3.getValue();
|
||||
float radius1 = static_cast<Part::Ellipsoid*>(object)->Radius1.getValue();
|
||||
float radius2 = static_cast<Part::Ellipsoid*>(object)->Radius2.getValue();
|
||||
if (angle1 == -90.0f && angle2 == 90.0f && angle3 == 360.0f) {
|
||||
if (angle1 == -90.0 && angle2 == 90.0 && angle3 == 360.0) {
|
||||
float scale = radius1/radius2;
|
||||
pScaling->scaleFactor.setValue(1,1,scale);
|
||||
pSphere->radius.setValue(radius2);
|
||||
|
||||
@@ -117,8 +117,8 @@ PROPERTY_SOURCE(PartGui::ViewProviderPartExt, Gui::ViewProviderGeometryObject)
|
||||
//**************************************************************************
|
||||
// Construction/Destruction
|
||||
|
||||
App::PropertyFloatConstraint::Constraints ViewProviderPartExt::sizeRange = {1.0f,64.0f,1.0f};
|
||||
App::PropertyFloatConstraint::Constraints ViewProviderPartExt::tessRange = {0.0001f,100.0f,0.01f};
|
||||
App::PropertyFloatConstraint::Constraints ViewProviderPartExt::sizeRange = {1.0,64.0,1.0};
|
||||
App::PropertyFloatConstraint::Constraints ViewProviderPartExt::tessRange = {0.0001,100.0,0.01};
|
||||
const char* ViewProviderPartExt::LightingEnums[]= {"One side","Two side",NULL};
|
||||
const char* ViewProviderPartExt::DrawStyleEnums[]= {"Solid","Dashed","Dotted","Dashdot",NULL};
|
||||
|
||||
|
||||
@@ -86,11 +86,10 @@ bool ViewProviderMirror::setEdit(int ModNum)
|
||||
Part::Mirroring* mf = static_cast<Part::Mirroring*>(getObject());
|
||||
Base::BoundBox3d bbox = mf->Shape.getBoundingBox();
|
||||
float len = (float)bbox.CalcDiagonalLength();
|
||||
Base::Vector3f base = mf->Base.getValue();
|
||||
Base::Vector3f norm = mf->Normal.getValue();
|
||||
Base::Vector3d base = mf->Base.getValue();
|
||||
Base::Vector3d norm = mf->Normal.getValue();
|
||||
Base::Vector3d cent = bbox.CalcCenter();
|
||||
Base::Vector3f cbox((float)cent.x,(float)cent.y,(float)cent.z);
|
||||
base = cbox.ProjToPlane(base, norm);
|
||||
base = cent.ProjToPlane(base, norm);
|
||||
|
||||
// setup the graph for editing the mirror plane
|
||||
SoTransform* trans = new SoTransform;
|
||||
|
||||
Reference in New Issue
Block a user