From efc29e44222920c3f8cad2206a0044c83022c86b Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 23 Mar 2013 15:12:04 +0100 Subject: [PATCH] Move from float to double --- src/App/Annotation.cpp | 6 +- src/App/MeasureDistance.cpp | 6 +- src/App/PropertyGeo.cpp | 82 +++++++++---------- src/App/PropertyGeo.h | 24 +++--- src/App/PropertyStandard.cpp | 32 ++++---- src/App/PropertyStandard.h | 22 ++--- src/Gui/ViewProviderAnnotation.cpp | 6 +- src/Gui/ViewProviderMeasureDistance.cpp | 8 +- src/Gui/propertyeditor/PropertyItem.cpp | 6 +- src/Mod/Drawing/App/AppDrawingPy.cpp | 8 +- src/Mod/Drawing/App/FeatureProjection.cpp | 4 +- src/Mod/Drawing/App/FeatureViewPart.cpp | 2 +- src/Mod/Drawing/App/ProjectionAlgos.cpp | 2 +- src/Mod/Drawing/App/ProjectionAlgos.h | 4 +- src/Mod/Drawing/Gui/AppDrawingGuiPy.cpp | 2 +- src/Mod/Fem/App/FemConstraint.cpp | 38 ++++----- src/Mod/Fem/App/FemConstraint.h | 8 +- src/Mod/Fem/App/FemConstraintBearing.cpp | 8 +- src/Mod/Fem/App/FemConstraintFixed.cpp | 12 +-- src/Mod/Fem/App/FemConstraintForce.cpp | 14 ++-- src/Mod/Fem/App/FemConstraintForce.h | 2 +- src/Mod/Fem/App/FemConstraintGear.cpp | 6 +- src/Mod/Fem/App/FemConstraintGear.h | 2 +- .../Gui/ViewProviderFemConstraintBearing.cpp | 12 +-- .../Gui/ViewProviderFemConstraintFixed.cpp | 8 +- .../Gui/ViewProviderFemConstraintForce.cpp | 16 ++-- .../Fem/Gui/ViewProviderFemConstraintGear.cpp | 20 ++--- .../Gui/ViewProviderFemConstraintPulley.cpp | 4 +- src/Mod/Inspection/App/InspectionFeature.cpp | 4 +- .../Inspection/Gui/ViewProviderInspection.cpp | 4 +- src/Mod/Mesh/App/FeatureMeshSegmentByMesh.cpp | 4 +- src/Mod/Part/App/FeatureExtrusion.cpp | 6 +- src/Mod/Part/App/FeatureMirroring.cpp | 8 +- src/Mod/Part/App/FeaturePartBox.cpp | 4 +- src/Mod/Part/App/FeaturePartPolygon.cpp | 6 +- src/Mod/Part/App/FeatureRevolution.cpp | 10 +-- src/Mod/Part/Gui/ViewProviderMirror.cpp | 7 +- src/Mod/PartDesign/App/FeatureGroove.cpp | 22 +++-- src/Mod/PartDesign/App/FeatureRevolution.cpp | 20 ++--- src/Mod/Points/App/Properties.cpp | 8 +- src/Mod/Points/Gui/ViewProvider.cpp | 8 +- 41 files changed, 236 insertions(+), 239 deletions(-) diff --git a/src/App/Annotation.cpp b/src/App/Annotation.cpp index 368bc7420..37a780068 100644 --- a/src/App/Annotation.cpp +++ b/src/App/Annotation.cpp @@ -36,7 +36,7 @@ PROPERTY_SOURCE(App::Annotation, App::DocumentObject) Annotation::Annotation() { ADD_PROPERTY(LabelText ,("")); - ADD_PROPERTY(Position,(Base::Vector3f())); + ADD_PROPERTY(Position,(Base::Vector3d())); } Annotation::~Annotation() @@ -51,8 +51,8 @@ PROPERTY_SOURCE(App::AnnotationLabel, App::DocumentObject) AnnotationLabel::AnnotationLabel() { ADD_PROPERTY_TYPE(LabelText,(""),"Label",Prop_Output,"Text label of the annotation"); - ADD_PROPERTY_TYPE(BasePosition,(Base::Vector3f()),"Label",Prop_Output,"Base position"); - ADD_PROPERTY_TYPE(TextPosition,(Base::Vector3f()),"Label",Prop_Output,"Text position"); + ADD_PROPERTY_TYPE(BasePosition,(Base::Vector3d()),"Label",Prop_Output,"Base position"); + ADD_PROPERTY_TYPE(TextPosition,(Base::Vector3d()),"Label",Prop_Output,"Text position"); } AnnotationLabel::~AnnotationLabel() diff --git a/src/App/MeasureDistance.cpp b/src/App/MeasureDistance.cpp index 13d36bcd7..8314df865 100644 --- a/src/App/MeasureDistance.cpp +++ b/src/App/MeasureDistance.cpp @@ -35,9 +35,9 @@ PROPERTY_SOURCE(App::MeasureDistance, App::DocumentObject) MeasureDistance::MeasureDistance() { - ADD_PROPERTY_TYPE(P1,(Base::Vector3f()),"Measurement",Prop_None,"First point of measurement"); - ADD_PROPERTY_TYPE(P2,(Base::Vector3f()),"Measurement",Prop_None,"Second point of measurement"); - ADD_PROPERTY_TYPE(Distance,(0.0f) ,"Measurement",App::PropertyType(Prop_ReadOnly|Prop_Output), + ADD_PROPERTY_TYPE(P1,(Base::Vector3d()),"Measurement",Prop_None,"First point of measurement"); + ADD_PROPERTY_TYPE(P2,(Base::Vector3d()),"Measurement",Prop_None,"Second point of measurement"); + ADD_PROPERTY_TYPE(Distance,(0.0) ,"Measurement",App::PropertyType(Prop_ReadOnly|Prop_Output), "Distance between the points"); } diff --git a/src/App/PropertyGeo.cpp b/src/App/PropertyGeo.cpp index 5a1adb114..9dfc4dd70 100644 --- a/src/App/PropertyGeo.cpp +++ b/src/App/PropertyGeo.cpp @@ -75,21 +75,21 @@ PropertyVector::~PropertyVector() // Base class implementer -void PropertyVector::setValue(const Base::Vector3f &vec) +void PropertyVector::setValue(const Base::Vector3d &vec) { aboutToSetValue(); _cVec=vec; hasSetValue(); } -void PropertyVector::setValue(float x, float y, float z) +void PropertyVector::setValue(double x, double y, double z) { aboutToSetValue(); - _cVec=Vector3f(x,y,z); + _cVec.Set(x,y,z); hasSetValue(); } -const Base::Vector3f & PropertyVector::getValue(void)const +const Base::Vector3d & PropertyVector::getValue(void)const { return _cVec; } @@ -104,34 +104,33 @@ void PropertyVector::setPyObject(PyObject *value) if (PyObject_TypeCheck(value, &(Base::VectorPy::Type))) { Base::VectorPy *pcObject = static_cast(value); Base::Vector3d* val = pcObject->getVectorPtr(); - Base::Vector3f vec((float)val->x,(float)val->y,(float)val->z); - setValue(vec); + setValue(*val); } else if (PyTuple_Check(value)&&PyTuple_Size(value)==3) { PyObject* item; - Base::Vector3f cVec; + Base::Vector3d cVec; // x item = PyTuple_GetItem(value,0); if (PyFloat_Check(item)) - cVec.x = (float)PyFloat_AsDouble(item); + cVec.x = PyFloat_AsDouble(item); else if (PyInt_Check(item)) - cVec.x = (float)PyInt_AsLong(item); + cVec.x = (double)PyInt_AsLong(item); else throw Base::Exception("Not allowed type used in tuple (float expected)..."); // y item = PyTuple_GetItem(value,1); if (PyFloat_Check(item)) - cVec.y = (float)PyFloat_AsDouble(item); + cVec.y = PyFloat_AsDouble(item); else if (PyInt_Check(item)) - cVec.y = (float)PyInt_AsLong(item); + cVec.y = (double)PyInt_AsLong(item); else throw Base::Exception("Not allowed type used in tuple (float expected)..."); // z item = PyTuple_GetItem(value,2); if (PyFloat_Check(item)) - cVec.z = (float)PyFloat_AsDouble(item); + cVec.z = PyFloat_AsDouble(item); else if (PyInt_Check(item)) - cVec.z = (float)PyInt_AsLong(item); + cVec.z = (double)PyInt_AsLong(item); else throw Base::Exception("Not allowed type used in tuple (float expected)..."); setValue( cVec ); @@ -154,9 +153,9 @@ void PropertyVector::Restore(Base::XMLReader &reader) reader.readElement("PropertyVector"); // get the value of my Attribute aboutToSetValue(); - _cVec.x = (float)reader.getAttributeAsFloat("valueX"); - _cVec.y = (float)reader.getAttributeAsFloat("valueY"); - _cVec.z = (float)reader.getAttributeAsFloat("valueZ"); + _cVec.x = reader.getAttributeAsFloat("valueX"); + _cVec.y = reader.getAttributeAsFloat("valueY"); + _cVec.z = reader.getAttributeAsFloat("valueZ"); hasSetValue(); } @@ -208,7 +207,7 @@ int PropertyVectorList::getSize(void) const return static_cast(_lValueList.size()); } -void PropertyVectorList::setValue(const Base::Vector3f& lValue) +void PropertyVectorList::setValue(const Base::Vector3d& lValue) { aboutToSetValue(); _lValueList.resize(1); @@ -216,7 +215,7 @@ void PropertyVectorList::setValue(const Base::Vector3f& lValue) hasSetValue(); } -void PropertyVectorList::setValue(float x, float y, float z) +void PropertyVectorList::setValue(double x, double y, double z) { aboutToSetValue(); _lValueList.resize(1); @@ -224,7 +223,7 @@ void PropertyVectorList::setValue(float x, float y, float z) hasSetValue(); } -void PropertyVectorList::setValues(const std::vector& values) +void PropertyVectorList::setValues(const std::vector& values) { aboutToSetValue(); _lValueList = values; @@ -245,7 +244,7 @@ void PropertyVectorList::setPyObject(PyObject *value) { if (PyList_Check(value)) { Py_ssize_t nSize = PyList_Size(value); - std::vector values; + std::vector values; values.resize(nSize); for (Py_ssize_t i=0; i(value); Base::Vector3d* val = pcObject->getVectorPtr(); - Base::Vector3f vec((float)val->x,(float)val->y,(float)val->z); - setValue(vec); + setValue(*val); } else if (PyTuple_Check(value) && PyTuple_Size(value) == 3) { PropertyVector val; @@ -298,7 +296,7 @@ void PropertyVectorList::SaveDocFile (Base::Writer &writer) const Base::OutputStream str(writer.Stream()); uint32_t uCt = (uint32_t)getSize(); str << uCt; - for (std::vector::const_iterator it = _lValueList.begin(); it != _lValueList.end(); ++it) { + for (std::vector::const_iterator it = _lValueList.begin(); it != _lValueList.end(); ++it) { str << it->x << it->y << it->z; } } @@ -308,8 +306,8 @@ void PropertyVectorList::RestoreDocFile(Base::Reader &reader) Base::InputStream str(reader); uint32_t uCt=0; str >> uCt; - std::vector values(uCt); - for (std::vector::iterator it = values.begin(); it != values.end(); ++it) { + std::vector values(uCt); + for (std::vector::iterator it = values.begin(); it != values.end(); ++it) { str >> it->x >> it->y >> it->z; } setValues(values); @@ -331,7 +329,7 @@ void PropertyVectorList::Paste(const Property &from) unsigned int PropertyVectorList::getMemSize (void) const { - return static_cast(_lValueList.size() * sizeof(Base::Vector3f)); + return static_cast(_lValueList.size() * sizeof(Base::Vector3d)); } //************************************************************************** @@ -425,25 +423,25 @@ void PropertyMatrix::Restore(Base::XMLReader &reader) reader.readElement("PropertyMatrix"); // get the value of my Attribute aboutToSetValue(); - _cMat[0][0] = (float)reader.getAttributeAsFloat("a11"); - _cMat[0][1] = (float)reader.getAttributeAsFloat("a12"); - _cMat[0][2] = (float)reader.getAttributeAsFloat("a13"); - _cMat[0][3] = (float)reader.getAttributeAsFloat("a14"); + _cMat[0][0] = reader.getAttributeAsFloat("a11"); + _cMat[0][1] = reader.getAttributeAsFloat("a12"); + _cMat[0][2] = reader.getAttributeAsFloat("a13"); + _cMat[0][3] = reader.getAttributeAsFloat("a14"); - _cMat[1][0] = (float)reader.getAttributeAsFloat("a21"); - _cMat[1][1] = (float)reader.getAttributeAsFloat("a22"); - _cMat[1][2] = (float)reader.getAttributeAsFloat("a23"); - _cMat[1][3] = (float)reader.getAttributeAsFloat("a24"); + _cMat[1][0] = reader.getAttributeAsFloat("a21"); + _cMat[1][1] = reader.getAttributeAsFloat("a22"); + _cMat[1][2] = reader.getAttributeAsFloat("a23"); + _cMat[1][3] = reader.getAttributeAsFloat("a24"); - _cMat[2][0] = (float)reader.getAttributeAsFloat("a31"); - _cMat[2][1] = (float)reader.getAttributeAsFloat("a32"); - _cMat[2][2] = (float)reader.getAttributeAsFloat("a33"); - _cMat[2][3] = (float)reader.getAttributeAsFloat("a34"); + _cMat[2][0] = reader.getAttributeAsFloat("a31"); + _cMat[2][1] = reader.getAttributeAsFloat("a32"); + _cMat[2][2] = reader.getAttributeAsFloat("a33"); + _cMat[2][3] = reader.getAttributeAsFloat("a34"); - _cMat[3][0] = (float)reader.getAttributeAsFloat("a41"); - _cMat[3][1] = (float)reader.getAttributeAsFloat("a42"); - _cMat[3][2] = (float)reader.getAttributeAsFloat("a43"); - _cMat[3][3] = (float)reader.getAttributeAsFloat("a44"); + _cMat[3][0] = reader.getAttributeAsFloat("a41"); + _cMat[3][1] = reader.getAttributeAsFloat("a42"); + _cMat[3][2] = reader.getAttributeAsFloat("a43"); + _cMat[3][3] = reader.getAttributeAsFloat("a44"); hasSetValue(); } diff --git a/src/App/PropertyGeo.h b/src/App/PropertyGeo.h index f8f839b47..9aa9ac178 100644 --- a/src/App/PropertyGeo.h +++ b/src/App/PropertyGeo.h @@ -72,12 +72,12 @@ public: /** Sets the property */ - void setValue(const Base::Vector3f &vec); - void setValue(float x, float y, float z); + void setValue(const Base::Vector3d &vec); + void setValue(double x, double y, double z); /** This method returns a string representation of the property */ - const Base::Vector3f &getValue(void) const; + const Base::Vector3d &getValue(void) const; const char* getEditorName(void) const { return "Gui::PropertyEditor::PropertyVectorItem"; } @@ -92,11 +92,11 @@ public: virtual void Paste(const Property &from); virtual unsigned int getMemSize (void) const { - return sizeof(Base::Vector3f); + return sizeof(Base::Vector3d); } private: - Base::Vector3f _cVec; + Base::Vector3d _cVec; }; @@ -122,21 +122,21 @@ public: /** Sets the property */ - void setValue(const Base::Vector3f&); - void setValue(float x, float y, float z); + void setValue(const Base::Vector3d&); + void setValue(double x, double y, double z); /// index operator - const Base::Vector3f& operator[] (const int idx) const { + const Base::Vector3d& operator[] (const int idx) const { return _lValueList.operator[] (idx); } - void set1Value (const int idx, const Base::Vector3f& value) { + void set1Value (const int idx, const Base::Vector3d& value) { _lValueList.operator[] (idx) = value; } - void setValues (const std::vector& values); + void setValues (const std::vector& values); - const std::vector &getValues(void) const { + const std::vector &getValues(void) const { return _lValueList; } @@ -155,7 +155,7 @@ public: virtual unsigned int getMemSize (void) const; private: - std::vector _lValueList; + std::vector _lValueList; }; /** Vector properties diff --git a/src/App/PropertyStandard.cpp b/src/App/PropertyStandard.cpp index f777c8d2b..724788c01 100644 --- a/src/App/PropertyStandard.cpp +++ b/src/App/PropertyStandard.cpp @@ -873,14 +873,14 @@ PropertyFloat::~PropertyFloat() //************************************************************************** // Base class implementer -void PropertyFloat::setValue(float lValue) +void PropertyFloat::setValue(double lValue) { aboutToSetValue(); _dValue=lValue; hasSetValue(); } -float PropertyFloat::getValue(void) const +double PropertyFloat::getValue(void) const { return _dValue; } @@ -894,12 +894,12 @@ void PropertyFloat::setPyObject(PyObject *value) { if (PyFloat_Check(value)) { aboutToSetValue(); - _dValue = (float) PyFloat_AsDouble(value); + _dValue = PyFloat_AsDouble(value); hasSetValue(); } else if(PyInt_Check(value)) { aboutToSetValue(); - _dValue = (float) PyInt_AsLong(value); + _dValue = PyInt_AsLong(value); hasSetValue(); } else { @@ -919,7 +919,7 @@ void PropertyFloat::Restore(Base::XMLReader &reader) // read my Element reader.readElement("Float"); // get the value of my Attribute - setValue((float)reader.getAttributeAsFloat("value")); + setValue(reader.getAttributeAsFloat("value")); } Property *PropertyFloat::Copy(void) const @@ -971,7 +971,7 @@ const PropertyFloatConstraint::Constraints* PropertyFloatConstraint::getConstra void PropertyFloatConstraint::setPyObject(PyObject *value) { if (PyFloat_Check(value)) { - float temp = (float)PyFloat_AsDouble(value); + double temp = PyFloat_AsDouble(value); if (_ConstStruct) { if (temp > _ConstStruct->UpperBound) temp = _ConstStruct->UpperBound; @@ -984,7 +984,7 @@ void PropertyFloatConstraint::setPyObject(PyObject *value) hasSetValue(); } else if (PyInt_Check(value)) { - float temp = (float)PyInt_AsLong(value); + double temp = (double)PyInt_AsLong(value); if (_ConstStruct) { if (temp > _ConstStruct->UpperBound) temp = _ConstStruct->UpperBound; @@ -1037,7 +1037,7 @@ int PropertyFloatList::getSize(void) const return static_cast(_lValueList.size()); } -void PropertyFloatList::setValue(float lValue) +void PropertyFloatList::setValue(double lValue) { aboutToSetValue(); _lValueList.resize(1); @@ -1045,7 +1045,7 @@ void PropertyFloatList::setValue(float lValue) hasSetValue(); } -void PropertyFloatList::setValues(const std::vector& values) +void PropertyFloatList::setValues(const std::vector& values) { aboutToSetValue(); _lValueList = values; @@ -1064,7 +1064,7 @@ void PropertyFloatList::setPyObject(PyObject *value) { if (PyList_Check(value)) { Py_ssize_t nSize = PyList_Size(value); - std::vector values; + std::vector values; values.resize(nSize); for (Py_ssize_t i=0; i::const_iterator it = _lValueList.begin(); it != _lValueList.end(); ++it) { + for (std::vector::const_iterator it = _lValueList.begin(); it != _lValueList.end(); ++it) { str << *it; } } @@ -1132,8 +1132,8 @@ void PropertyFloatList::RestoreDocFile(Base::Reader &reader) Base::InputStream str(reader); uint32_t uCt=0; str >> uCt; - std::vector values(uCt); - for (std::vector::iterator it = values.begin(); it != values.end(); ++it) { + std::vector values(uCt); + for (std::vector::iterator it = values.begin(); it != values.end(); ++it) { str >> *it; } setValues(values); @@ -1155,7 +1155,7 @@ void PropertyFloatList::Paste(const Property &from) unsigned int PropertyFloatList::getMemSize (void) const { - return static_cast(_lValueList.size() * sizeof(float)); + return static_cast(_lValueList.size() * sizeof(double)); } //************************************************************************** diff --git a/src/App/PropertyStandard.h b/src/App/PropertyStandard.h index e611dd070..c26688258 100644 --- a/src/App/PropertyStandard.h +++ b/src/App/PropertyStandard.h @@ -424,8 +424,8 @@ public: virtual ~PropertyFloat(); - void setValue(float lValue); - float getValue(void) const; + void setValue(double lValue); + double getValue(void) const; virtual const char* getEditorName(void) const { return "Gui::PropertyEditor::PropertyFloatItem"; } @@ -438,10 +438,10 @@ public: virtual Property *Copy(void) const; virtual void Paste(const Property &from); - virtual unsigned int getMemSize (void) const{return sizeof(float);} + virtual unsigned int getMemSize (void) const{return sizeof(double);} protected: - float _dValue; + double _dValue; }; /** Constraint float properties @@ -472,7 +472,7 @@ public: //@{ /// the boundary struct struct Constraints { - float LowerBound, UpperBound, StepSize; + double LowerBound, UpperBound, StepSize; }; /** setting the boundaries * This sets the constraint struct. It can be dynamcly @@ -519,16 +519,16 @@ public: /** Sets the property */ - void setValue(float); + void setValue(double); /// index operator - float operator[] (const int idx) const {return _lValueList.operator[] (idx);} + double operator[] (const int idx) const {return _lValueList.operator[] (idx);} - void set1Value (const int idx, float value){_lValueList.operator[] (idx) = value;} - void setValues (const std::vector& values); + void set1Value (const int idx, double value){_lValueList.operator[] (idx) = value;} + void setValues (const std::vector& values); - const std::vector &getValues(void) const{return _lValueList;} + const std::vector &getValues(void) const{return _lValueList;} virtual PyObject *getPyObject(void); virtual void setPyObject(PyObject *); @@ -544,7 +544,7 @@ public: virtual unsigned int getMemSize (void) const; private: - std::vector _lValueList; + std::vector _lValueList; }; diff --git a/src/Gui/ViewProviderAnnotation.cpp b/src/Gui/ViewProviderAnnotation.cpp index 5224277d2..e0d98f3da 100644 --- a/src/Gui/ViewProviderAnnotation.cpp +++ b/src/Gui/ViewProviderAnnotation.cpp @@ -225,7 +225,7 @@ void ViewProviderAnnotation::updateData(const App::Property* prop) } else if (prop->getTypeId() == App::PropertyVector::getClassTypeId() && strcmp(prop->getName(),"Position") == 0) { - Base::Vector3f v = static_cast(prop)->getValue(); + Base::Vector3d v = static_cast(prop)->getValue(); pTranslation->translation.setValue(v.x,v.y,v.z); } @@ -348,12 +348,12 @@ void ViewProviderAnnotationLabel::updateData(const App::Property* prop) } else if (prop->getTypeId() == App::PropertyVector::getClassTypeId() && strcmp(prop->getName(),"BasePosition") == 0) { - Base::Vector3f v = static_cast(prop)->getValue(); + Base::Vector3d v = static_cast(prop)->getValue(); pBaseTranslation->translation.setValue(v.x,v.y,v.z); } else if (prop->getTypeId() == App::PropertyVector::getClassTypeId() && strcmp(prop->getName(),"TextPosition") == 0) { - Base::Vector3f v = static_cast(prop)->getValue(); + Base::Vector3d v = static_cast(prop)->getValue(); pCoords->point.set1Value(1, SbVec3f(v.x,v.y,v.z)); pTextTranslation->translation.setValue(v.x,v.y,v.z); } diff --git a/src/Gui/ViewProviderMeasureDistance.cpp b/src/Gui/ViewProviderMeasureDistance.cpp index 490cbb864..f1217989a 100644 --- a/src/Gui/ViewProviderMeasureDistance.cpp +++ b/src/Gui/ViewProviderMeasureDistance.cpp @@ -196,11 +196,11 @@ void ViewProviderMeasureDistance::updateData(const App::Property* prop) if (prop->getTypeId() == App::PropertyVector::getClassTypeId() || prop == &Mirror || prop == &DistFactor) { if (strcmp(prop->getName(),"P1") == 0) { - Base::Vector3f v = static_cast(prop)->getValue(); + Base::Vector3d v = static_cast(prop)->getValue(); pCoords->point.set1Value(0, SbVec3f(v.x,v.y,v.z)); } else if (strcmp(prop->getName(),"P2") == 0) { - Base::Vector3f v = static_cast(prop)->getValue(); + Base::Vector3d v = static_cast(prop)->getValue(); pCoords->point.set1Value(1, SbVec3f(v.x,v.y,v.z)); } @@ -278,8 +278,8 @@ void PointMarker::customEvent(QEvent* e) App::MeasureDistance* md = static_cast(obj); const SbVec3f& pt1 = vp->pCoords->point[0]; const SbVec3f& pt2 = vp->pCoords->point[1]; - md->P1.setValue(Base::Vector3f(pt1[0],pt1[1],pt1[2])); - md->P2.setValue(Base::Vector3f(pt2[0],pt2[1],pt2[2])); + md->P1.setValue(Base::Vector3d(pt1[0],pt1[1],pt1[2])); + md->P2.setValue(Base::Vector3d(pt2[0],pt2[1],pt2[2])); std::stringstream s; s.precision(3); s.setf(std::ios::fixed | std::ios::showpoint); diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index 65b22e03c..b57e8e6a9 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -876,15 +876,15 @@ QVariant PropertyVectorItem::value(const App::Property* prop) const { assert(prop && prop->getTypeId().isDerivedFrom(App::PropertyVector::getClassTypeId())); - const Base::Vector3f& value = static_cast(prop)->getValue(); - return QVariant::fromValue(value); + const Base::Vector3d& value = static_cast(prop)->getValue(); + return QVariant::fromValue(value); } void PropertyVectorItem::setValue(const QVariant& value) { if (!value.canConvert()) return; - const Base::Vector3f& val = value.value(); + const Base::Vector3d& val = value.value(); QString data = QString::fromAscii("(%1, %2, %3)") .arg(val.x,0,'f',decimals()) .arg(val.y,0,'f',decimals()) diff --git a/src/Mod/Drawing/App/AppDrawingPy.cpp b/src/Mod/Drawing/App/AppDrawingPy.cpp index 892504a72..77a1a5fdb 100644 --- a/src/Mod/Drawing/App/AppDrawingPy.cpp +++ b/src/Mod/Drawing/App/AppDrawingPy.cpp @@ -50,7 +50,7 @@ project(PyObject *self, PyObject *args) if (pcObjDir) Vector = *static_cast(pcObjDir)->getVectorPtr(); - ProjectionAlgos Alg(pShape->getTopoShapePtr()->_Shape,Base::Vector3f((float)Vector.x,(float)Vector.y,(float)Vector.z)); + ProjectionAlgos Alg(pShape->getTopoShapePtr()->_Shape,Vector); Py::List list; list.append(Py::Object(new TopoShapePy(new TopoShape(Alg.V)) , true)); @@ -79,7 +79,7 @@ projectEx(PyObject *self, PyObject *args) if (pcObjDir) Vector = *static_cast(pcObjDir)->getVectorPtr(); - ProjectionAlgos Alg(pShape->getTopoShapePtr()->_Shape,Base::Vector3f((float)Vector.x,(float)Vector.y,(float)Vector.z)); + ProjectionAlgos Alg(pShape->getTopoShapePtr()->_Shape,Vector); Py::List list; list.append(Py::Object(new TopoShapePy(new TopoShape(Alg.V)) , true)); @@ -116,7 +116,7 @@ projectToSVG(PyObject *self, PyObject *args) Base::Vector3d Vector(0,0,1); if (pcObjDir) Vector = static_cast(pcObjDir)->value(); - ProjectionAlgos Alg(pShape->getTopoShapePtr()->_Shape,Base::Vector3f((float)Vector.x,(float)Vector.y,(float)Vector.z)); + ProjectionAlgos Alg(pShape->getTopoShapePtr()->_Shape,Vector); bool hidden = false; if (type && std::string(type) == "ShowHiddenLines") @@ -146,7 +146,7 @@ projectToDXF(PyObject *self, PyObject *args) Base::Vector3d Vector(0,0,1); if (pcObjDir) Vector = static_cast(pcObjDir)->value(); - ProjectionAlgos Alg(pShape->getTopoShapePtr()->_Shape,Base::Vector3f((float)Vector.x,(float)Vector.y,(float)Vector.z)); + ProjectionAlgos Alg(pShape->getTopoShapePtr()->_Shape,Vector); bool hidden = false; if (type && std::string(type) == "ShowHiddenLines") diff --git a/src/Mod/Drawing/App/FeatureProjection.cpp b/src/Mod/Drawing/App/FeatureProjection.cpp index 50a8e088b..40c4a027d 100644 --- a/src/Mod/Drawing/App/FeatureProjection.cpp +++ b/src/Mod/Drawing/App/FeatureProjection.cpp @@ -50,7 +50,7 @@ FeatureProjection::FeatureProjection() { static const char *group = "Projection"; ADD_PROPERTY_TYPE(Source ,(0),group,App::Prop_None,"Shape to project"); - ADD_PROPERTY_TYPE(Direction ,(Base::Vector3f(0,0,1)),group,App::Prop_None,"Projection direction"); + ADD_PROPERTY_TYPE(Direction ,(Base::Vector3d(0,0,1)),group,App::Prop_None,"Projection direction"); ADD_PROPERTY_TYPE(VCompound ,(true),group,App::Prop_None,"Projection parameter"); ADD_PROPERTY_TYPE(Rg1LineVCompound ,(true),group,App::Prop_None,"Projection parameter"); ADD_PROPERTY_TYPE(RgNLineVCompound ,(true),group,App::Prop_None,"Projection parameter"); @@ -79,7 +79,7 @@ App::DocumentObjectExecReturn *FeatureProjection::execute(void) return new App::DocumentObjectExecReturn("Linked shape object is empty"); try { - const Base::Vector3f& dir = Direction.getValue(); + const Base::Vector3d& dir = Direction.getValue(); Drawing::ProjectionAlgos alg(shape, dir); TopoDS_Compound comp; diff --git a/src/Mod/Drawing/App/FeatureViewPart.cpp b/src/Mod/Drawing/App/FeatureViewPart.cpp index db96dc852..9a5eea4d0 100644 --- a/src/Mod/Drawing/App/FeatureViewPart.cpp +++ b/src/Mod/Drawing/App/FeatureViewPart.cpp @@ -188,7 +188,7 @@ App::DocumentObjectExecReturn *FeatureViewPart::execute(void) TopoDS_Shape shape = static_cast(link)->Shape.getShape()._Shape; if (shape.IsNull()) return new App::DocumentObjectExecReturn("Linked shape object is empty"); - Base::Vector3f Dir = Direction.getValue(); + Base::Vector3d Dir = Direction.getValue(); bool hidden = ShowHiddenLines.getValue(); bool smooth = ShowSmoothLines.getValue(); diff --git a/src/Mod/Drawing/App/ProjectionAlgos.cpp b/src/Mod/Drawing/App/ProjectionAlgos.cpp index 38ca1f48d..66027e911 100644 --- a/src/Mod/Drawing/App/ProjectionAlgos.cpp +++ b/src/Mod/Drawing/App/ProjectionAlgos.cpp @@ -90,7 +90,7 @@ using namespace std; -ProjectionAlgos::ProjectionAlgos(const TopoDS_Shape &Input, const Base::Vector3f &Dir) +ProjectionAlgos::ProjectionAlgos(const TopoDS_Shape &Input, const Base::Vector3d &Dir) : Input(Input), Direction(Dir) { execute(); diff --git a/src/Mod/Drawing/App/ProjectionAlgos.h b/src/Mod/Drawing/App/ProjectionAlgos.h index f95d0fa1f..2bf19f30c 100644 --- a/src/Mod/Drawing/App/ProjectionAlgos.h +++ b/src/Mod/Drawing/App/ProjectionAlgos.h @@ -39,7 +39,7 @@ class DrawingExport ProjectionAlgos { public: /// Constructor - ProjectionAlgos(const TopoDS_Shape &Input,const Base::Vector3f &Dir); + ProjectionAlgos(const TopoDS_Shape &Input,const Base::Vector3d &Dir); virtual ~ProjectionAlgos(); void execute(void); @@ -56,7 +56,7 @@ public: const TopoDS_Shape &Input; - const Base::Vector3f &Direction; + const Base::Vector3d &Direction; TopoDS_Shape V ;// hard edge visibly TopoDS_Shape V1;// Smoth edges visibly diff --git a/src/Mod/Drawing/Gui/AppDrawingGuiPy.cpp b/src/Mod/Drawing/Gui/AppDrawingGuiPy.cpp index 87addd915..1ff6170e6 100644 --- a/src/Mod/Drawing/Gui/AppDrawingGuiPy.cpp +++ b/src/Mod/Drawing/Gui/AppDrawingGuiPy.cpp @@ -159,7 +159,7 @@ exporter(PyObject *self, PyObject *args) } TopoDS_Shape shape = static_cast(link)->Shape.getShape()._Shape; if (!shape.IsNull()) { - Base::Vector3f dir = view->Direction.getValue(); + Base::Vector3d dir = view->Direction.getValue(); bool hidden = view->ShowHiddenLines.getValue(); bool smooth = view->ShowSmoothLines.getValue(); Drawing::ProjectionAlgos::ExtractionType type = Drawing::ProjectionAlgos::Plain; diff --git a/src/Mod/Fem/App/FemConstraint.cpp b/src/Mod/Fem/App/FemConstraint.cpp index a8f4d955b..86f2288a5 100644 --- a/src/Mod/Fem/App/FemConstraint.cpp +++ b/src/Mod/Fem/App/FemConstraint.cpp @@ -68,7 +68,7 @@ PROPERTY_SOURCE(Fem::Constraint, App::DocumentObject); Constraint::Constraint() { ADD_PROPERTY_TYPE(References,(0,0),"Constraint",(App::PropertyType)(App::Prop_None),"Elements where the constraint is applied"); - ADD_PROPERTY_TYPE(NormalDirection,(Base::Vector3f(0,0,1)),"Constraint",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),"Normal direction pointing outside of solid"); + ADD_PROPERTY_TYPE(NormalDirection,(Base::Vector3d(0,0,1)),"Constraint",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),"Normal direction pointing outside of solid"); } Constraint::~Constraint() @@ -129,7 +129,7 @@ void Constraint::onDocumentRestored() App::DocumentObject::onDocumentRestored(); } -const bool Constraint::getPoints(std::vector &points, std::vector &normals) const +const bool Constraint::getPoints(std::vector &points, std::vector &normals) const { std::vector Objects = References.getValues(); std::vector SubElements = References.getSubValues(); @@ -148,7 +148,7 @@ const bool Constraint::getPoints(std::vector &points, std::vecto if (sh.ShapeType() == TopAbs_VERTEX) { const TopoDS_Vertex& vertex = TopoDS::Vertex(sh); gp_Pnt p = BRep_Tool::Pnt(vertex); - points.push_back(Base::Vector3f(p.X(), p.Y(), p.Z())); + points.push_back(Base::Vector3d(p.X(), p.Y(), p.Z())); normals.push_back(NormalDirection.getValue()); } else if (sh.ShapeType() == TopAbs_EDGE) { BRepAdaptor_Curve curve(TopoDS::Edge(sh)); @@ -166,7 +166,7 @@ const bool Constraint::getPoints(std::vector &points, std::vecto double step = (lp - fp) / steps; for (int i = 0; i < steps + 1; i++) { gp_Pnt p = curve.Value(i * step); - points.push_back(Base::Vector3f(p.X(), p.Y(), p.Z())); + points.push_back(Base::Vector3d(p.X(), p.Y(), p.Z())); normals.push_back(NormalDirection.getValue()); } } else if (sh.ShapeType() == TopAbs_FACE) { @@ -212,10 +212,10 @@ const bool Constraint::getPoints(std::vector &points, std::vecto gp_Pnt p = surface.Value(u, v); BRepClass_FaceClassifier classifier(face, p, Precision::Confusion()); if (classifier.State() != TopAbs_OUT) { - points.push_back(Base::Vector3f(p.X(), p.Y(), p.Z())); + points.push_back(Base::Vector3d(p.X(), p.Y(), p.Z())); props.Normal(u, v,center,normal); normal.Normalize(); - normals.push_back(Base::Vector3f(normal.X(), normal.Y(), normal.Z())); + normals.push_back(Base::Vector3d(normal.X(), normal.Y(), normal.Z())); } } } @@ -225,7 +225,7 @@ const bool Constraint::getPoints(std::vector &points, std::vecto return true; } -const bool Constraint::getCylinder(float& radius, float& height, Base::Vector3f& base, Base::Vector3f& axis) const +const bool Constraint::getCylinder(float& radius, float& height, Base::Vector3d& base, Base::Vector3d& axis) const { std::vector Objects = References.getValues(); std::vector SubElements = References.getSubValues(); @@ -247,21 +247,21 @@ const bool Constraint::getCylinder(float& radius, float& height, Base::Vector3f& radius = cyl.Radius(); gp_Pnt b = cyl.Location(); - base = Base::Vector3f(b.X(), b.Y(), b.Z()); + base = Base::Vector3d(b.X(), b.Y(), b.Z()); gp_Dir dir = cyl.Axis().Direction(); - axis = Base::Vector3f(dir.X(), dir.Y(), dir.Z()); + axis = Base::Vector3d(dir.X(), dir.Y(), dir.Z()); return true; } -Base::Vector3f Constraint::getBasePoint(const Base::Vector3f& base, const Base::Vector3f& axis, +Base::Vector3d Constraint::getBasePoint(const Base::Vector3d& base, const Base::Vector3d& axis, const App::PropertyLinkSub& location, const float& dist) { // Get the point specified by Location and Distance App::DocumentObject* objLoc = location.getValue(); std::vector names = location.getSubValues(); if (names.size() == 0) - return Base::Vector3f(0,0,0); + return Base::Vector3d(0,0,0); std::string subName = names.front(); Part::Feature* featLoc = static_cast(objLoc); TopoDS_Shape shloc = featLoc->Shape.getShape().getSubShape(subName.c_str()); @@ -285,7 +285,7 @@ Base::Vector3f Constraint::getBasePoint(const Base::Vector3f& base, const Base:: gp_Pnt cylbase(base.x, base.y, base.z); GeomAPI_ProjectPointOnSurf proj(cylbase, pln); if (!proj.IsDone()) - return Base::Vector3f(0,0,0); + return Base::Vector3d(0,0,0); gp_Pnt projPnt = proj.NearestPoint(); if ((fabs(dist) > Precision::Confusion()) && (projPnt.IsEqual(cylbase, Precision::Confusion()) == Standard_False)) @@ -296,17 +296,17 @@ Base::Vector3f Constraint::getBasePoint(const Base::Vector3f& base, const Base:: Handle_Geom_Curve crv = new Geom_Line(cylbase, cylaxis); GeomAPI_IntCS intersector(crv, plnt); if (!intersector.IsDone()) - return Base::Vector3f(0,0,0); + return Base::Vector3d(0,0,0); gp_Pnt inter = intersector.Point(1); - return Base::Vector3f(inter.X(), inter.Y(), inter.Z()); + return Base::Vector3d(inter.X(), inter.Y(), inter.Z()); } -const Base::Vector3f Constraint::getDirection(const App::PropertyLinkSub &direction) +const Base::Vector3d Constraint::getDirection(const App::PropertyLinkSub &direction) { App::DocumentObject* obj = direction.getValue(); std::vector names = direction.getSubValues(); if (names.size() == 0) - return Base::Vector3f(0,0,0); + return Base::Vector3d(0,0,0); std::string subName = names.front(); Part::Feature* feat = static_cast(obj); TopoDS_Shape sh = feat->Shape.getShape().getSubShape(subName.c_str()); @@ -317,18 +317,18 @@ const Base::Vector3f Constraint::getDirection(const App::PropertyLinkSub &direct if (surface.GetType() == GeomAbs_Plane) { dir = surface.Plane().Axis().Direction(); } else { - return Base::Vector3f(0,0,0); // "Direction must be a planar face or linear edge" + return Base::Vector3d(0,0,0); // "Direction must be a planar face or linear edge" } } else if (sh.ShapeType() == TopAbs_EDGE) { BRepAdaptor_Curve line(TopoDS::Edge(sh)); if (line.GetType() == GeomAbs_Line) { dir = line.Line().Direction(); } else { - return Base::Vector3f(0,0,0); // "Direction must be a planar face or linear edge" + return Base::Vector3d(0,0,0); // "Direction must be a planar face or linear edge" } } - Base::Vector3f the_direction(dir.X(), dir.Y(), dir.Z()); + Base::Vector3d the_direction(dir.X(), dir.Y(), dir.Z()); the_direction.Normalize(); return the_direction; } diff --git a/src/Mod/Fem/App/FemConstraint.h b/src/Mod/Fem/App/FemConstraint.h index 157d76285..693b5be96 100644 --- a/src/Mod/Fem/App/FemConstraint.h +++ b/src/Mod/Fem/App/FemConstraint.h @@ -59,11 +59,11 @@ protected: protected: /// Calculate the points where symbols should be drawn - const bool getPoints(std::vector& points, std::vector& normals) const; - const bool getCylinder(float& radius, float& height, Base::Vector3f& base, Base::Vector3f& axis) const; - Base::Vector3f getBasePoint(const Base::Vector3f& base, const Base::Vector3f& axis, + const bool getPoints(std::vector& points, std::vector& normals) const; + const bool getCylinder(float& radius, float& height, Base::Vector3d& base, Base::Vector3d& axis) const; + Base::Vector3d getBasePoint(const Base::Vector3d& base, const Base::Vector3d& axis, const App::PropertyLinkSub &location, const float& dist); - const Base::Vector3f getDirection(const App::PropertyLinkSub &direction); + const Base::Vector3d getDirection(const App::PropertyLinkSub &direction); }; diff --git a/src/Mod/Fem/App/FemConstraintBearing.cpp b/src/Mod/Fem/App/FemConstraintBearing.cpp index ed399bd02..6e3b4e63a 100644 --- a/src/Mod/Fem/App/FemConstraintBearing.cpp +++ b/src/Mod/Fem/App/FemConstraintBearing.cpp @@ -50,9 +50,9 @@ ConstraintBearing::ConstraintBearing() ADD_PROPERTY(AxialFree,(0)); ADD_PROPERTY(Radius,(0.0)); ADD_PROPERTY(Height,(0.0)); - ADD_PROPERTY_TYPE(BasePoint,(Base::Vector3f(0,0,0)),"ConstraintBearing",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), + ADD_PROPERTY_TYPE(BasePoint,(Base::Vector3d(0,0,0)),"ConstraintBearing",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), "Base point of cylindrical bearing seat"); - ADD_PROPERTY_TYPE(Axis,(Base::Vector3f(0,1,0)),"ConstraintBearing",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), + ADD_PROPERTY_TYPE(Axis,(Base::Vector3d(0,1,0)),"ConstraintBearing",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), "Axis of bearing seat"); } @@ -71,7 +71,7 @@ void ConstraintBearing::onChanged(const App::Property* prop) if (prop == &References) { // Find data of cylinder float radius, height; - Base::Vector3f base, axis; + Base::Vector3d base, axis; if (!getCylinder(radius, height, base, axis)) return; Radius.setValue(radius); @@ -107,7 +107,7 @@ void ConstraintBearing::onChanged(const App::Property* prop) } float radius, height; - Base::Vector3f base, axis; + Base::Vector3d base, axis; if (!getCylinder(radius, height, base, axis)) return; base = getBasePoint(base + axis * height/2, axis, Location, Dist.getValue()); diff --git a/src/Mod/Fem/App/FemConstraintFixed.cpp b/src/Mod/Fem/App/FemConstraintFixed.cpp index 762b63d89..dcd5ab33b 100644 --- a/src/Mod/Fem/App/FemConstraintFixed.cpp +++ b/src/Mod/Fem/App/FemConstraintFixed.cpp @@ -53,12 +53,12 @@ PROPERTY_SOURCE(Fem::ConstraintFixed, Fem::Constraint); ConstraintFixed::ConstraintFixed() { - ADD_PROPERTY_TYPE(Points,(Base::Vector3f()),"ConstraintFixed",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), + ADD_PROPERTY_TYPE(Points,(Base::Vector3d()),"ConstraintFixed",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), "Points where symbols are drawn"); - ADD_PROPERTY_TYPE(Normals,(Base::Vector3f()),"ConstraintFixed",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), + ADD_PROPERTY_TYPE(Normals,(Base::Vector3d()),"ConstraintFixed",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), "Normals where symbols are drawn"); - Points.setValues(std::vector()); - Normals.setValues(std::vector()); + Points.setValues(std::vector()); + Normals.setValues(std::vector()); } App::DocumentObjectExecReturn *ConstraintFixed::execute(void) @@ -73,8 +73,8 @@ void ConstraintFixed::onChanged(const App::Property* prop) Constraint::onChanged(prop); if (prop == &References) { - std::vector points; - std::vector normals; + std::vector points; + std::vector normals; if (getPoints(points, normals)) { Points.setValues(points); Normals.setValues(normals); diff --git a/src/Mod/Fem/App/FemConstraintForce.cpp b/src/Mod/Fem/App/FemConstraintForce.cpp index 771929d23..2f55c9c77 100644 --- a/src/Mod/Fem/App/FemConstraintForce.cpp +++ b/src/Mod/Fem/App/FemConstraintForce.cpp @@ -48,12 +48,12 @@ ConstraintForce::ConstraintForce() ADD_PROPERTY_TYPE(Direction,(0),"ConstraintForce",(App::PropertyType)(App::Prop_None), "Element giving direction of constraint"); ADD_PROPERTY(Reversed,(0)); - ADD_PROPERTY_TYPE(Points,(Base::Vector3f()),"ConstraintForce",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), + ADD_PROPERTY_TYPE(Points,(Base::Vector3d()),"ConstraintForce",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), "Points where arrows are drawn"); - ADD_PROPERTY_TYPE(DirectionVector,(Base::Vector3f(0,0,1)),"ConstraintForce",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), + ADD_PROPERTY_TYPE(DirectionVector,(Base::Vector3d(0,0,1)),"ConstraintForce",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), "Direction of arrows"); - naturalDirectionVector = Base::Vector3f(0,0,1); - Points.setValues(std::vector()); + naturalDirectionVector = Base::Vector3d(0,0,1); + Points.setValues(std::vector()); } App::DocumentObjectExecReturn *ConstraintForce::execute(void) @@ -68,14 +68,14 @@ void ConstraintForce::onChanged(const App::Property* prop) Constraint::onChanged(prop); if (prop == &References) { - std::vector points; - std::vector normals; + std::vector points; + std::vector normals; if (getPoints(points, normals)) { Points.setValues(points); // We don't use the normals because all arrows should have the same direction Points.touch(); // This triggers ViewProvider::updateData() } } else if (prop == &Direction) { - Base::Vector3f direction = getDirection(Direction); + Base::Vector3d direction = getDirection(Direction); if (direction.Length() < Precision::Confusion()) return; naturalDirectionVector = direction; diff --git a/src/Mod/Fem/App/FemConstraintForce.h b/src/Mod/Fem/App/FemConstraintForce.h index 1386e7d7d..9d7f2b08e 100644 --- a/src/Mod/Fem/App/FemConstraintForce.h +++ b/src/Mod/Fem/App/FemConstraintForce.h @@ -60,7 +60,7 @@ protected: virtual void onChanged(const App::Property* prop); private: - Base::Vector3f naturalDirectionVector; + Base::Vector3d naturalDirectionVector; }; } //namespace Fem diff --git a/src/Mod/Fem/App/FemConstraintGear.cpp b/src/Mod/Fem/App/FemConstraintGear.cpp index ec62a294c..f9a430652 100644 --- a/src/Mod/Fem/App/FemConstraintGear.cpp +++ b/src/Mod/Fem/App/FemConstraintGear.cpp @@ -50,9 +50,9 @@ ConstraintGear::ConstraintGear() ADD_PROPERTY_TYPE(Direction,(0),"ConstraintGear",(App::PropertyType)(App::Prop_None), "Element giving direction of gear force"); ADD_PROPERTY(Reversed,(0)); - ADD_PROPERTY_TYPE(DirectionVector,(Base::Vector3f(1,1,1).Normalize()),"ConstraintGear",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), + ADD_PROPERTY_TYPE(DirectionVector,(Base::Vector3d(1,1,1).Normalize()),"ConstraintGear",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), "Direction of gear force"); - naturalDirectionVector = Base::Vector3f(1,1,1).Normalize(); + naturalDirectionVector = Base::Vector3d(1,1,1).Normalize(); } App::DocumentObjectExecReturn *ConstraintGear::execute(void) @@ -65,7 +65,7 @@ void ConstraintGear::onChanged(const App::Property* prop) ConstraintBearing::onChanged(prop); if (prop == &Direction) { - Base::Vector3f direction = getDirection(Direction); + Base::Vector3d direction = getDirection(Direction); if (direction.Length() < Precision::Confusion()) return; naturalDirectionVector = direction; diff --git a/src/Mod/Fem/App/FemConstraintGear.h b/src/Mod/Fem/App/FemConstraintGear.h index 11926f350..1e6384659 100644 --- a/src/Mod/Fem/App/FemConstraintGear.h +++ b/src/Mod/Fem/App/FemConstraintGear.h @@ -61,7 +61,7 @@ protected: virtual void onChanged(const App::Property* prop); private: - Base::Vector3f naturalDirectionVector; + Base::Vector3d naturalDirectionVector; }; } //namespace Fem diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintBearing.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintBearing.cpp index a2186df8f..c63c633be 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintBearing.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintBearing.cpp @@ -120,9 +120,9 @@ void ViewProviderFemConstraintBearing::updateData(const App::Property* prop) pShapeSep->removeAllChildren(); // This should always point outside of the cylinder - Base::Vector3f normal = pcConstraint->NormalDirection.getValue(); - Base::Vector3f base = pcConstraint->BasePoint.getValue(); - float radius = pcConstraint->Radius.getValue(); + Base::Vector3d normal = pcConstraint->NormalDirection.getValue(); + Base::Vector3d base = pcConstraint->BasePoint.getValue(); + double radius = pcConstraint->Radius.getValue(); base = base + radius * normal; SbVec3f b(base.x, base.y, base.z); @@ -134,9 +134,9 @@ void ViewProviderFemConstraintBearing::updateData(const App::Property* prop) } else if (strcmp(prop->getName(),"AxialFree") == 0) { if (pShapeSep->getNumChildren() > 0) { // Change the symbol - Base::Vector3f normal = pcConstraint->NormalDirection.getValue(); - Base::Vector3f base = pcConstraint->BasePoint.getValue(); - float radius = pcConstraint->Radius.getValue(); + Base::Vector3d normal = pcConstraint->NormalDirection.getValue(); + Base::Vector3d base = pcConstraint->BasePoint.getValue(); + double radius = pcConstraint->Radius.getValue(); base = base + radius * normal; SbVec3f b(base.x, base.y, base.z); diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintFixed.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintFixed.cpp index d82603353..47b848e23 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintFixed.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintFixed.cpp @@ -131,16 +131,16 @@ void ViewProviderFemConstraintFixed::updateData(const App::Property* prop) // Note: Points and Normals are always updated together pShapeSep->removeAllChildren(); - const std::vector& points = pcConstraint->Points.getValues(); - const std::vector& normals = pcConstraint->Normals.getValues(); - std::vector::const_iterator n = normals.begin(); + const std::vector& points = pcConstraint->Points.getValues(); + const std::vector& normals = pcConstraint->Normals.getValues(); + std::vector::const_iterator n = normals.begin(); /* SoMultipleCopy* cp = static_cast(pShapeSep->getChild(0)); cp->matrix.setNum(points.size()); int idx = 0; */ - for (std::vector::const_iterator p = points.begin(); p != points.end(); p++) { + for (std::vector::const_iterator p = points.begin(); p != points.end(); p++) { SbVec3f base(p->x, p->y, p->z); SbVec3f dir(n->x, n->y, n->z); SbRotation rot(SbVec3f(0,-1,0), dir); diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintForce.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintForce.cpp index 56b49b0bd..71cdbbf6c 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintForce.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintForce.cpp @@ -132,24 +132,24 @@ void ViewProviderFemConstraintForce::updateData(const App::Property* prop) pShapeSep->removeAllChildren(); // This should always point outside of the solid - Base::Vector3f normal = pcConstraint->NormalDirection.getValue(); + Base::Vector3d normal = pcConstraint->NormalDirection.getValue(); // Get default direction (on first call to method) - Base::Vector3f forceDirection = pcConstraint->DirectionVector.getValue(); + Base::Vector3d forceDirection = pcConstraint->DirectionVector.getValue(); if (forceDirection.Length() < Precision::Confusion()) forceDirection = normal; SbVec3f dir(forceDirection.x, forceDirection.y, forceDirection.z); SbRotation rot(SbVec3f(0,1,0), dir); - const std::vector& points = pcConstraint->Points.getValues(); + const std::vector& points = pcConstraint->Points.getValues(); /* SoMultipleCopy* cp = static_cast(pShapeSep->getChild(0)); cp->matrix.setNum(points.size()); int idx = 0;*/ - for (std::vector::const_iterator p = points.begin(); p != points.end(); p++) { + for (std::vector::const_iterator p = points.begin(); p != points.end(); p++) { SbVec3f base(p->x, p->y, p->z); if (forceDirection.GetAngle(normal) < M_PI_2) // Move arrow so it doesn't disappear inside the solid base = base + dir * ARROWLENGTH; @@ -166,15 +166,15 @@ void ViewProviderFemConstraintForce::updateData(const App::Property* prop) } } else if (strcmp(prop->getName(),"DirectionVector") == 0) { // Note: "Reversed" also triggers "DirectionVector" // Re-orient all arrows - Base::Vector3f normal = pcConstraint->NormalDirection.getValue(); - Base::Vector3f forceDirection = pcConstraint->DirectionVector.getValue(); + Base::Vector3d normal = pcConstraint->NormalDirection.getValue(); + Base::Vector3d forceDirection = pcConstraint->DirectionVector.getValue(); if (forceDirection.Length() < Precision::Confusion()) forceDirection = normal; SbVec3f dir(forceDirection.x, forceDirection.y, forceDirection.z); SbRotation rot(SbVec3f(0,1,0), dir); - const std::vector& points = pcConstraint->Points.getValues(); + const std::vector& points = pcConstraint->Points.getValues(); /* SoMultipleCopy* cp = static_cast(pShapeSep->getChild(0)); @@ -182,7 +182,7 @@ void ViewProviderFemConstraintForce::updateData(const App::Property* prop) */ int idx = 0; - for (std::vector::const_iterator p = points.begin(); p != points.end(); p++) { + for (std::vector::const_iterator p = points.begin(); p != points.end(); p++) { SbVec3f base(p->x, p->y, p->z); if (forceDirection.GetAngle(normal) < M_PI_2) base = base + dir * ARROWLENGTH; diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintGear.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintGear.cpp index f5df20359..fc246a006 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintGear.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintGear.cpp @@ -114,11 +114,11 @@ void ViewProviderFemConstraintGear::updateData(const App::Property* prop) // Remove and recreate the symbol pShapeSep->removeAllChildren(); - Base::Vector3f base = pcConstraint->BasePoint.getValue(); - Base::Vector3f axis = pcConstraint->Axis.getValue(); - Base::Vector3f direction = pcConstraint->DirectionVector.getValue(); + Base::Vector3d base = pcConstraint->BasePoint.getValue(); + Base::Vector3d axis = pcConstraint->Axis.getValue(); + Base::Vector3d direction = pcConstraint->DirectionVector.getValue(); if (direction.Length() < Precision::Confusion()) - direction = Base::Vector3f(0,1,0); + direction = Base::Vector3d(0,1,0); float radius = pcConstraint->Radius.getValue(); float dia = pcConstraint->Diameter.getValue(); if (dia < 2 * radius) @@ -138,10 +138,10 @@ void ViewProviderFemConstraintGear::updateData(const App::Property* prop) } else if (strcmp(prop->getName(),"Diameter") == 0) { if (pShapeSep->getNumChildren() > 0) { // Change the symbol - Base::Vector3f axis = pcConstraint->Axis.getValue(); - Base::Vector3f direction = pcConstraint->DirectionVector.getValue(); + Base::Vector3d axis = pcConstraint->Axis.getValue(); + Base::Vector3d direction = pcConstraint->DirectionVector.getValue(); if (direction.Length() < Precision::Confusion()) - direction = Base::Vector3f(0,1,0); + direction = Base::Vector3d(0,1,0); float dia = pcConstraint->Diameter.getValue(); float radius = pcConstraint->Radius.getValue(); if (dia < 2 * radius) @@ -161,10 +161,10 @@ void ViewProviderFemConstraintGear::updateData(const App::Property* prop) // Note: "Reversed" also triggers "DirectionVector" if (pShapeSep->getNumChildren() > 0) { // Re-orient the symbol - Base::Vector3f axis = pcConstraint->Axis.getValue(); - Base::Vector3f direction = pcConstraint->DirectionVector.getValue(); + Base::Vector3d axis = pcConstraint->Axis.getValue(); + Base::Vector3d direction = pcConstraint->DirectionVector.getValue(); if (direction.Length() < Precision::Confusion()) - direction = Base::Vector3f(0,1,0); + direction = Base::Vector3d(0,1,0); float dia = pcConstraint->Diameter.getValue(); float angle = pcConstraint->ForceAngle.getValue() / 180 * M_PI; diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintPulley.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintPulley.cpp index ed10aa524..100ef72d6 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintPulley.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintPulley.cpp @@ -114,8 +114,8 @@ void ViewProviderFemConstraintPulley::updateData(const App::Property* prop) pShapeSep->removeAllChildren(); // This should always point outside of the cylinder - Base::Vector3f base = pcConstraint->BasePoint.getValue(); - Base::Vector3f axis = pcConstraint->Axis.getValue(); + Base::Vector3d base = pcConstraint->BasePoint.getValue(); + Base::Vector3d axis = pcConstraint->Axis.getValue(); float radius = pcConstraint->Radius.getValue(); float dia = pcConstraint->Diameter.getValue(); if (dia < 2 * radius) diff --git a/src/Mod/Inspection/App/InspectionFeature.cpp b/src/Mod/Inspection/App/InspectionFeature.cpp index ae8c46b7b..9ff0f6e6e 100644 --- a/src/Mod/Inspection/App/InspectionFeature.cpp +++ b/src/Mod/Inspection/App/InspectionFeature.cpp @@ -575,7 +575,7 @@ App::DocumentObjectExecReturn* Feature::execute(void) str << "Inspecting " << this->Label.getValue() << "..."; Base::SequencerLauncher seq(str.str().c_str(), count); - std::vector vals(count); + std::vector vals(count); for (unsigned long index = 0; index < count; index++) { Base::Vector3f pnt = actual->getPoint(index); @@ -599,7 +599,7 @@ App::DocumentObjectExecReturn* Feature::execute(void) float fRMS = 0; int countRMS = 0; - for (std::vector::iterator it = vals.begin(); it != vals.end(); ++it) { + for (std::vector::iterator it = vals.begin(); it != vals.end(); ++it) { if (fabs(*it) < FLT_MAX) { fRMS += (*it) * (*it); countRMS++; diff --git a/src/Mod/Inspection/Gui/ViewProviderInspection.cpp b/src/Mod/Inspection/Gui/ViewProviderInspection.cpp index dc6f246ed..871a2bfb6 100644 --- a/src/Mod/Inspection/Gui/ViewProviderInspection.cpp +++ b/src/Mod/Inspection/Gui/ViewProviderInspection.cpp @@ -293,7 +293,7 @@ void ViewProviderInspection::setDistances() } // distance values - const std::vector& fValues = ((App::PropertyFloatList*)pDistances)->getValues(); + const std::vector& fValues = ((App::PropertyFloatList*)pDistances)->getValues(); if ((int)fValues.size() != this->pcCoords->point.getNum()) { pcMatBinding->value = SoMaterialBinding::OVERALL; return; @@ -308,7 +308,7 @@ void ViewProviderInspection::setDistances() float * tran = pcColorMat->transparency.startEditing(); unsigned long j=0; - for (std::vector::const_iterator jt = fValues.begin(); jt != fValues.end(); ++jt, j++) { + for (std::vector::const_iterator jt = fValues.begin(); jt != fValues.end(); ++jt, j++) { App::Color col = pcColorBar->getColor(*jt); cols[j] = SbColor(col.r, col.g, col.b); if (pcColorBar->isVisible(*jt)) diff --git a/src/Mod/Mesh/App/FeatureMeshSegmentByMesh.cpp b/src/Mod/Mesh/App/FeatureMeshSegmentByMesh.cpp index a95b44bca..8e6912c29 100644 --- a/src/Mod/Mesh/App/FeatureMeshSegmentByMesh.cpp +++ b/src/Mod/Mesh/App/FeatureMeshSegmentByMesh.cpp @@ -93,8 +93,8 @@ App::DocumentObjectExecReturn *SegmentByMesh::execute(void) // the clipping plane Base::Vector3f cBase, cNormal; - cBase = Base.getValue(); - cNormal = Normal.getValue(); + cBase = Base::convertTo(Base.getValue()); + cNormal = Base::convertTo(Normal.getValue()); const MeshKernel& rMeshKernel = kernel->getValue().getKernel(); diff --git a/src/Mod/Part/App/FeatureExtrusion.cpp b/src/Mod/Part/App/FeatureExtrusion.cpp index 6ccf14328..8f3a205c8 100644 --- a/src/Mod/Part/App/FeatureExtrusion.cpp +++ b/src/Mod/Part/App/FeatureExtrusion.cpp @@ -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.0f,0.0f,1.0f))); ADD_PROPERTY(Solid,(false)); - ADD_PROPERTY(TaperAngle,(0.0f)); + ADD_PROPERTY(TaperAngle,(0.0)); } short Extrusion::mustExecute() const @@ -79,7 +79,7 @@ App::DocumentObjectExecReturn *Extrusion::execute(void) return new App::DocumentObjectExecReturn("Linked object is not a Part object"); Part::Feature *base = static_cast(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(); bool makeSolid = Solid.getValue(); diff --git a/src/Mod/Part/App/FeatureMirroring.cpp b/src/Mod/Part/App/FeatureMirroring.cpp index 004479b61..364df4fab 100644 --- a/src/Mod/Part/App/FeatureMirroring.cpp +++ b/src/Mod/Part/App/FeatureMirroring.cpp @@ -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(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(); diff --git a/src/Mod/Part/App/FeaturePartBox.cpp b/src/Mod/Part/App/FeaturePartBox.cpp index 7e8ffcea2..12c9bf208 100644 --- a/src/Mod/Part/App/FeaturePartBox.cpp +++ b/src/Mod/Part/App/FeaturePartBox.cpp @@ -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); diff --git a/src/Mod/Part/App/FeaturePartPolygon.cpp b/src/Mod/Part/App/FeaturePartPolygon.cpp index 6cd1945b0..e85f2d4a5 100644 --- a/src/Mod/Part/App/FeaturePartPolygon.cpp +++ b/src/Mod/Part/App/FeaturePartPolygon.cpp @@ -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 nodes = Nodes.getValues(); + const std::vector nodes = Nodes.getValues(); - for (std::vector::const_iterator it = nodes.begin(); it != nodes.end(); ++it) { + for (std::vector::const_iterator it = nodes.begin(); it != nodes.end(); ++it) { gp_Pnt pnt(it->x, it->y, it->z); poly.Add(pnt); } diff --git a/src/Mod/Part/App/FeatureRevolution.cpp b/src/Mod/Part/App/FeatureRevolution.cpp index e16379bba..846d7badd 100644 --- a/src/Mod/Part/App/FeatureRevolution.cpp +++ b/src/Mod/Part/App/FeatureRevolution.cpp @@ -39,9 +39,9 @@ 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.0f,0.0f,0.0f))); + ADD_PROPERTY(Axis,(Base::Vector3d(0.0f,0.0f,1.0f))); + 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(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); diff --git a/src/Mod/Part/Gui/ViewProviderMirror.cpp b/src/Mod/Part/Gui/ViewProviderMirror.cpp index 5296fa8a3..32e6dff97 100644 --- a/src/Mod/Part/Gui/ViewProviderMirror.cpp +++ b/src/Mod/Part/Gui/ViewProviderMirror.cpp @@ -82,11 +82,10 @@ bool ViewProviderMirror::setEdit(int ModNum) Part::Mirroring* mf = static_cast(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; diff --git a/src/Mod/PartDesign/App/FeatureGroove.cpp b/src/Mod/PartDesign/App/FeatureGroove.cpp index e3344e70a..7f6a64f83 100644 --- a/src/Mod/PartDesign/App/FeatureGroove.cpp +++ b/src/Mod/PartDesign/App/FeatureGroove.cpp @@ -55,8 +55,8 @@ PROPERTY_SOURCE(PartDesign::Groove, PartDesign::Subtractive) Groove::Groove() { - ADD_PROPERTY_TYPE(Base,(Base::Vector3f(0.0f,0.0f,0.0f)),"Groove", App::Prop_ReadOnly, "Base"); - ADD_PROPERTY_TYPE(Axis,(Base::Vector3f(0.0f,1.0f,0.0f)),"Groove", App::Prop_ReadOnly, "Axis"); + ADD_PROPERTY_TYPE(Base,(Base::Vector3d(0.0f,0.0f,0.0f)),"Groove", App::Prop_ReadOnly, "Base"); + ADD_PROPERTY_TYPE(Axis,(Base::Vector3d(0.0f,1.0f,0.0f)),"Groove", App::Prop_ReadOnly, "Axis"); ADD_PROPERTY_TYPE(Angle,(360.0),"Groove", App::Prop_None, "Angle"); ADD_PROPERTY_TYPE(ReferenceAxis,(0),"Groove",(App::PropertyType)(App::Prop_None),"Reference axis of Groove"); } @@ -99,9 +99,9 @@ App::DocumentObjectExecReturn *Groove::execute(void) updateAxis(); // get revolve axis - Base::Vector3f b = Base.getValue(); + Base::Vector3d b = Base.getValue(); gp_Pnt pnt(b.x,b.y,b.z); - Base::Vector3f v = Axis.getValue(); + Base::Vector3d v = Axis.getValue(); gp_Dir dir(v.x,v.y,v.z); try { @@ -176,28 +176,26 @@ bool Groove::suggestReversed(void) std::vector wires = getSketchWires(); TopoDS_Shape sketchshape = makeFace(wires); - Base::Vector3f b = Base.getValue(); - Base::Vector3f v = Axis.getValue(); + Base::Vector3d b = Base.getValue(); + Base::Vector3d v = Axis.getValue(); // get centre of gravity of the sketch face GProp_GProps props; BRepGProp::SurfaceProperties(sketchshape, props); gp_Pnt cog = props.CentreOfMass(); - Base::Vector3f p_cog(cog.X(), cog.Y(), cog.Z()); + Base::Vector3d p_cog(cog.X(), cog.Y(), cog.Z()); // get direction to cog from its projection on the revolve axis - Base::Vector3f perp_dir = p_cog - p_cog.Perpendicular(b, v); + Base::Vector3d perp_dir = p_cog - p_cog.Perpendicular(b, v); // get cross product of projection direction with revolve axis direction - Base::Vector3f cross = v % perp_dir; + Base::Vector3d cross = v % perp_dir; // get sketch vector pointing away from support material Base::Placement SketchPos = sketch->Placement.getValue(); Base::Rotation SketchOrientation = SketchPos.getRotation(); Base::Vector3d SketchNormal(0,0,1); SketchOrientation.multVec(SketchNormal,SketchNormal); - // simply convert double to float - Base::Vector3f norm(SketchNormal.x, SketchNormal.y, SketchNormal.z); // return true if the angle between norm and cross is acute - return norm * cross > 0.f; + return SketchNormal * cross > 0.f; } catch (...) { return Reversed.getValue(); diff --git a/src/Mod/PartDesign/App/FeatureRevolution.cpp b/src/Mod/PartDesign/App/FeatureRevolution.cpp index afb3667f7..72bbfa8e3 100644 --- a/src/Mod/PartDesign/App/FeatureRevolution.cpp +++ b/src/Mod/PartDesign/App/FeatureRevolution.cpp @@ -55,8 +55,8 @@ PROPERTY_SOURCE(PartDesign::Revolution, PartDesign::Additive) Revolution::Revolution() { - ADD_PROPERTY_TYPE(Base,(Base::Vector3f(0.0f,0.0f,0.0f)),"Revolution", App::Prop_ReadOnly, "Base"); - ADD_PROPERTY_TYPE(Axis,(Base::Vector3f(0.0f,1.0f,0.0f)),"Revolution", App::Prop_ReadOnly, "Axis"); + 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(Angle,(360.0),"Revolution", App::Prop_None, "Angle"); ADD_PROPERTY_TYPE(ReferenceAxis,(0),"Revolution",(App::Prop_None),"Reference axis of revolution"); } @@ -105,9 +105,9 @@ App::DocumentObjectExecReturn *Revolution::execute(void) updateAxis(); // get revolve axis - Base::Vector3f b = Base.getValue(); + Base::Vector3d b = Base.getValue(); gp_Pnt pnt(b.x,b.y,b.z); - Base::Vector3f v = Axis.getValue(); + Base::Vector3d v = Axis.getValue(); gp_Dir dir(v.x,v.y,v.z); try { @@ -181,25 +181,25 @@ bool Revolution::suggestReversed(void) std::vector wires = getSketchWires(); TopoDS_Shape sketchshape = makeFace(wires); - Base::Vector3f b = Base.getValue(); - Base::Vector3f v = Axis.getValue(); + Base::Vector3d b = Base.getValue(); + Base::Vector3d v = Axis.getValue(); // get centre of gravity of the sketch face GProp_GProps props; BRepGProp::SurfaceProperties(sketchshape, props); gp_Pnt cog = props.CentreOfMass(); - Base::Vector3f p_cog(cog.X(), cog.Y(), cog.Z()); + Base::Vector3d p_cog(cog.X(), cog.Y(), cog.Z()); // get direction to cog from its projection on the revolve axis - Base::Vector3f perp_dir = p_cog - p_cog.Perpendicular(b, v); + Base::Vector3d perp_dir = p_cog - p_cog.Perpendicular(b, v); // get cross product of projection direction with revolve axis direction - Base::Vector3f cross = v % perp_dir; + Base::Vector3d cross = v % perp_dir; // get sketch vector pointing away from support material Base::Placement SketchPos = sketch->Placement.getValue(); Base::Rotation SketchOrientation = SketchPos.getRotation(); Base::Vector3d SketchNormal(0,0,1); SketchOrientation.multVec(SketchNormal,SketchNormal); // simply convert double to float - Base::Vector3f norm(SketchNormal.x, SketchNormal.y, SketchNormal.z); + Base::Vector3d norm(SketchNormal.x, SketchNormal.y, SketchNormal.z); // return true if the angle between norm and cross is obtuse return norm * cross < 0.f; diff --git a/src/Mod/Points/App/Properties.cpp b/src/Mod/Points/App/Properties.cpp index df70d1045..855633fa9 100644 --- a/src/Mod/Points/App/Properties.cpp +++ b/src/Mod/Points/App/Properties.cpp @@ -48,6 +48,7 @@ TYPESYSTEM_SOURCE(Points::PropertyCurvatureList , App::PropertyLists); void PropertyGreyValueList::removeIndices( const std::vector& uIndices ) { +#if 0 // We need a sorted array std::vector uSortedInds = uIndices; std::sort(uSortedInds.begin(), uSortedInds.end()); @@ -73,6 +74,7 @@ void PropertyGreyValueList::removeIndices( const std::vector& uIn } setValues(remainValue); +#endif } void PropertyNormalList::transform(const Base::Matrix4D &mat) @@ -109,17 +111,17 @@ void PropertyNormalList::removeIndices( const std::vector& uIndic std::vector uSortedInds = uIndices; std::sort(uSortedInds.begin(), uSortedInds.end()); - const std::vector& rValueList = getValues(); + const std::vector& rValueList = getValues(); assert( uSortedInds.size() <= rValueList.size() ); if ( uSortedInds.size() > rValueList.size() ) return; - std::vector remainValue; + std::vector remainValue; remainValue.reserve(rValueList.size() - uSortedInds.size()); std::vector::iterator pos = uSortedInds.begin(); - for ( std::vector::const_iterator it = rValueList.begin(); it != rValueList.end(); ++it ) { + for ( std::vector::const_iterator it = rValueList.begin(); it != rValueList.end(); ++it ) { unsigned long index = it - rValueList.begin(); if (pos == uSortedInds.end()) remainValue.push_back( *it ); diff --git a/src/Mod/Points/Gui/ViewProvider.cpp b/src/Mod/Points/Gui/ViewProvider.cpp index 5a43c5304..4fe161b71 100644 --- a/src/Mod/Points/Gui/ViewProvider.cpp +++ b/src/Mod/Points/Gui/ViewProvider.cpp @@ -125,14 +125,14 @@ void ViewProviderPoints::setVertexColorMode(App::PropertyColorList* pcProperty) void ViewProviderPoints::setVertexGreyvalueMode(Points::PropertyGreyValueList* pcProperty) { - const std::vector& val = pcProperty->getValues(); + const std::vector& val = pcProperty->getValues(); unsigned long i=0; pcColorMat->enableNotify(false); pcColorMat->diffuseColor.deleteValues(0); pcColorMat->diffuseColor.setNum(val.size()); - for ( std::vector::const_iterator it = val.begin(); it != val.end(); ++it ) { + for ( std::vector::const_iterator it = val.begin(); it != val.end(); ++it ) { pcColorMat->diffuseColor.set1Value(i++, SbColor(*it, *it, *it)); } @@ -142,14 +142,14 @@ void ViewProviderPoints::setVertexGreyvalueMode(Points::PropertyGreyValueList* p void ViewProviderPoints::setVertexNormalMode(Points::PropertyNormalList* pcProperty) { - const std::vector& val = pcProperty->getValues(); + const std::vector& val = pcProperty->getValues(); unsigned long i=0; pcPointsNormal->enableNotify(false); pcPointsNormal->vector.deleteValues(0); pcPointsNormal->vector.setNum(val.size()); - for ( std::vector::const_iterator it = val.begin(); it != val.end(); ++it ) { + for ( std::vector::const_iterator it = val.begin(); it != val.end(); ++it ) { pcPointsNormal->vector.set1Value(i++, it->x, it->y, it->z); }