fix -Wextra in Fem

This commit is contained in:
wmayer
2016-09-24 02:17:15 +02:00
parent 1d84eac025
commit 480191c8ee
25 changed files with 112 additions and 61 deletions

View File

@@ -152,7 +152,7 @@ void Constraint::onDocumentRestored()
App::DocumentObject::onDocumentRestored();
}
const bool Constraint::getPoints(std::vector<Base::Vector3d> &points, std::vector<Base::Vector3d> &normals, int * scale) const
bool Constraint::getPoints(std::vector<Base::Vector3d> &points, std::vector<Base::Vector3d> &normals, int * scale) const
{
std::vector<App::DocumentObject*> Objects = References.getValues();
std::vector<std::string> SubElements = References.getSubValues();
@@ -292,7 +292,7 @@ const bool Constraint::getPoints(std::vector<Base::Vector3d> &points, std::vecto
return true;
}
const bool Constraint::getCylinder(double &radius, double &height, Base::Vector3d& base, Base::Vector3d& axis) const
bool Constraint::getCylinder(double &radius, double &height, Base::Vector3d& base, Base::Vector3d& axis) const
{
std::vector<App::DocumentObject*> Objects = References.getValues();
std::vector<std::string> SubElements = References.getSubValues();

View File

@@ -67,8 +67,8 @@ protected:
protected:
/// Calculate the points where symbols should be drawn
const bool getPoints(std::vector<Base::Vector3d>& points, std::vector<Base::Vector3d>& normals, int * scale) const; //OvG: added scale parameter
const bool getCylinder(double& radius, double& height, Base::Vector3d& base, Base::Vector3d& axis) const;
bool getPoints(std::vector<Base::Vector3d>& points, std::vector<Base::Vector3d>& normals, int * scale) const; //OvG: added scale parameter
bool getCylinder(double& radius, double& height, Base::Vector3d& base, Base::Vector3d& axis) const;
Base::Vector3d getBasePoint(const Base::Vector3d& base, const Base::Vector3d& axis,
const App::PropertyLinkSub &location, const double& dist);
const Base::Vector3d getDirection(const App::PropertyLinkSub &direction);

View File

@@ -26,7 +26,6 @@
#ifndef _PreComp_
# include <cstdlib>
# include <memory>
# include <strstream>
# include <Bnd_Box.hxx>
# include <BRep_Tool.hxx>
# include <BRepBndLib.hxx>
@@ -380,7 +379,7 @@ void FemMesh::compute()
getGenerator()->Compute(*myMesh, myMesh->GetShapeToMesh());
}
std::set<long> FemMesh::getSurfaceNodes(long ElemId, short FaceId, float Angle) const
std::set<long> FemMesh::getSurfaceNodes(long /*ElemId*/, short /*FaceId*/, float /*Angle*/) const
{
std::set<long> result;
//const SMESHDS_Mesh* data = myMesh->GetMeshDS();
@@ -1353,12 +1352,12 @@ std::vector<const char*> FemMesh::getElementTypes(void) const
return temp;
}
unsigned long FemMesh::countSubElements(const char* Type) const
unsigned long FemMesh::countSubElements(const char* /*Type*/) const
{
return 0;
}
Data::Segment* FemMesh::getSubElement(const char* Type, unsigned long n) const
Data::Segment* FemMesh::getSubElement(const char* /*Type*/, unsigned long /*n*/) const
{
// FIXME implement subelement interface
//std::stringstream str;

View File

@@ -27,8 +27,6 @@
# include <sstream>
#endif
#include <strstream>
#include <Base/Console.h>
#include <Base/Writer.h>
#include <Base/Reader.h>

View File

@@ -135,6 +135,8 @@ Py::Object SMESH_HypothesisPy<T>::setLibName(const Py::Tuple& args)
template<class T>
Py::Object SMESH_HypothesisPy<T>::getLibName(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
return Py::String(hypothesis<SMESH_Hypothesis>()->GetLibName());
}
@@ -149,12 +151,16 @@ Py::Object SMESH_HypothesisPy<T>::setParameters(const Py::Tuple& args)
template<class T>
Py::Object SMESH_HypothesisPy<T>::getParameters(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
return Py::String(hypothesis<SMESH_Hypothesis>()->GetParameters());
}
template<class T>
Py::Object SMESH_HypothesisPy<T>::setLastParameters(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
std::string paramName = (std::string)Py::String(args[0]);
hypothesis<SMESH_Hypothesis>()->SetLastParameters(paramName.c_str());
return Py::None();
@@ -163,12 +169,16 @@ Py::Object SMESH_HypothesisPy<T>::setLastParameters(const Py::Tuple& args)
template<class T>
Py::Object SMESH_HypothesisPy<T>::getLastParameters(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
return Py::String(hypothesis<SMESH_Hypothesis>()->GetLastParameters());
}
template<class T>
Py::Object SMESH_HypothesisPy<T>::clearParameters(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
hypothesis<SMESH_Hypothesis>()->ClearParameters();
return Py::None();
}
@@ -189,11 +199,13 @@ Py::Object SMESH_HypothesisPy<T>::setParametersByMesh(const Py::Tuple& args)
template<class T>
Py::Object SMESH_HypothesisPy<T>::isAuxiliary(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
return Py::Boolean(hypothesis<SMESH_Hypothesis>()->IsAuxiliary());
}
template<class T>
PyObject *SMESH_HypothesisPy<T>::PyMake(struct _typeobject *type, PyObject * args, PyObject * kwds)
PyObject *SMESH_HypothesisPy<T>::PyMake(struct _typeobject * /*type*/, PyObject * args, PyObject * /*kwds*/)
{
int hypId;
PyObject* obj;
@@ -253,7 +265,7 @@ void StdMeshers_AutomaticLengthPy::init_type(PyObject* module)
SMESH_HypothesisPyBase::init_type(module);
}
StdMeshers_AutomaticLengthPy::StdMeshers_AutomaticLengthPy(int hypId, int studyId, SMESH_Gen* gen)
StdMeshers_AutomaticLengthPy::StdMeshers_AutomaticLengthPy(int /*hypId*/, int /*studyId*/, SMESH_Gen* /*gen*/)
: SMESH_HypothesisPyBase(0)
{
}
@@ -271,6 +283,8 @@ Py::Object StdMeshers_AutomaticLengthPy::setFineness(const Py::Tuple& args)
Py::Object StdMeshers_AutomaticLengthPy::getFineness(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
return Py::Float(hypothesis<StdMeshers_AutomaticLength>()->GetFineness());
}
@@ -356,16 +370,22 @@ Py::Object StdMeshers_MaxLengthPy::setLength(const Py::Tuple& args)
Py::Object StdMeshers_MaxLengthPy::getLength(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
return Py::Float(hypothesis<StdMeshers_MaxLength>()->GetLength());
}
Py::Object StdMeshers_MaxLengthPy::havePreestimatedLength(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
return Py::Boolean(hypothesis<StdMeshers_MaxLength>()->HavePreestimatedLength());
}
Py::Object StdMeshers_MaxLengthPy::getPreestimatedLength(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
return Py::Float(hypothesis<StdMeshers_MaxLength>()->GetPreestimatedLength());
}
@@ -383,6 +403,8 @@ Py::Object StdMeshers_MaxLengthPy::setUsePreestimatedLength(const Py::Tuple& arg
Py::Object StdMeshers_MaxLengthPy::getUsePreestimatedLength(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
return Py::Boolean(hypothesis<StdMeshers_MaxLength>()->GetUsePreestimatedLength());
}
@@ -417,6 +439,8 @@ Py::Object StdMeshers_LocalLengthPy::setLength(const Py::Tuple& args)
Py::Object StdMeshers_LocalLengthPy::getLength(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
return Py::Float(hypothesis<StdMeshers_LocalLength>()->GetLength());
}
@@ -428,6 +452,8 @@ Py::Object StdMeshers_LocalLengthPy::setPrecision(const Py::Tuple& args)
Py::Object StdMeshers_LocalLengthPy::getPrecision(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
return Py::Float(hypothesis<StdMeshers_LocalLength>()->GetPrecision());
}
@@ -460,6 +486,8 @@ Py::Object StdMeshers_MaxElementAreaPy::setMaxArea(const Py::Tuple& args)
Py::Object StdMeshers_MaxElementAreaPy::getMaxArea(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
return Py::Float(hypothesis<StdMeshers_MaxElementArea>()->GetMaxArea());
}
@@ -693,6 +721,8 @@ Py::Object StdMeshers_SegmentLengthAroundVertexPy::setLength(const Py::Tuple& ar
Py::Object StdMeshers_SegmentLengthAroundVertexPy::getLength(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
return Py::Float(hypothesis<StdMeshers_SegmentLengthAroundVertex>()->GetLength());
}
@@ -904,6 +934,8 @@ Py::Object StdMeshers_NumberOfSegmentsPy::setNumSegm(const Py::Tuple& args)
Py::Object StdMeshers_NumberOfSegmentsPy::getNumSegm(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
return Py::Int(hypothesis<StdMeshers_NumberOfSegments>()->GetNumberOfSegments());
}
@@ -935,6 +967,8 @@ Py::Object StdMeshers_NumberOfLayersPy::setNumLayers(const Py::Tuple& args)
Py::Object StdMeshers_NumberOfLayersPy::getNumLayers(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
return Py::Int(hypothesis<StdMeshers_NumberOfLayers>()->GetNumberOfLayers());
}
@@ -984,6 +1018,8 @@ Py::Object StdMeshers_MaxElementVolumePy::setMaxVolume(const Py::Tuple& args)
Py::Object StdMeshers_MaxElementVolumePy::getMaxVolume(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
return Py::Float(hypothesis<StdMeshers_MaxElementVolume>()->GetMaxVolume());
}
@@ -1015,6 +1051,8 @@ Py::Object StdMeshers_LengthFromEdgesPy::setMode(const Py::Tuple& args)
Py::Object StdMeshers_LengthFromEdgesPy::getMode(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
return Py::Int(hypothesis<StdMeshers_LengthFromEdges>()->GetMode());
}
@@ -1044,11 +1082,15 @@ StdMeshers_LayerDistributionPy::~StdMeshers_LayerDistributionPy()
Py::Object StdMeshers_LayerDistributionPy::setLayerDistribution(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
return Py::None();
}
Py::Object StdMeshers_LayerDistributionPy::getLayerDistribution(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
//return hypothesis<StdMeshers_LayerDistribution>()->GetLayerDistribution();
return Py::None();
}

View File

@@ -44,8 +44,6 @@
#include <vtkXMLRectilinearGridReader.h>
#include <vtkXMLImageDataReader.h>
#include <strstream>
#ifndef _PreComp_
#endif