Fem: modernize C++11

* use nullptr
This commit is contained in:
wmayer
2022-03-23 19:17:40 +01:00
parent 51b94abfde
commit 7ae9fc0d67
88 changed files with 301 additions and 301 deletions

View File

@@ -81,7 +81,7 @@ PyMOD_INIT_FUNC(Fem)
}
catch(const Base::Exception& e) {
PyErr_SetString(PyExc_ImportError, e.what());
PyMOD_Return(0);
PyMOD_Return(nullptr);
}
PyObject* femModule = Fem::initModule();
Base::Console().Log("Loading Fem module... done\n");

View File

@@ -152,14 +152,14 @@ private:
Py::Object insert(const Py::Tuple& args)
{
char* Name;
const char* DocName = 0;
const char* DocName = nullptr;
if (!PyArg_ParseTuple(args.ptr(), "et|s","utf-8",&Name,&DocName))
throw Py::Exception();
std::string EncodedName = std::string(Name);
PyMem_Free(Name);
App::Document *pcDoc = 0;
App::Document *pcDoc = nullptr;
if (DocName)
pcDoc = App::GetApplication().getDocument(DocName);
else
@@ -245,8 +245,8 @@ private:
#ifdef FC_USE_VTK
Py::Object readResult(const Py::Tuple& args)
{
char* fileName = NULL;
char* objName = NULL;
char* fileName = nullptr;
char* objName = nullptr;
if (!PyArg_ParseTuple(args.ptr(), "et|et","utf-8", &fileName, "utf-8", &objName))
throw Py::Exception();
@@ -269,8 +269,8 @@ private:
Py::Object writeResult(const Py::Tuple& args)
{
char* fileName = NULL;
PyObject *pcObj = NULL;
char* fileName = nullptr;
PyObject *pcObj = nullptr;
if (!PyArg_ParseTuple(args.ptr(), "et|O!","utf-8", &fileName, &(App::DocumentObjectPy::Type), &pcObj))
throw Py::Exception();

View File

@@ -86,7 +86,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(References,(nullptr,nullptr),"Constraint",(App::PropertyType)(App::Prop_None),"Elements where the constraint is applied");
ADD_PROPERTY_TYPE(NormalDirection,(Base::Vector3d(0,0,1)),"Constraint",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),"Normal direction pointing outside of solid");
ADD_PROPERTY_TYPE(Scale,(1),"Base",App::PropertyType(App::Prop_Output),"Scale used for drawing constraints"); //OvG: Add scale parameter inherited by all derived constraints

View File

@@ -45,7 +45,7 @@ PROPERTY_SOURCE(Fem::ConstraintBearing, Fem::Constraint)
ConstraintBearing::ConstraintBearing()
{
ADD_PROPERTY_TYPE(Location,(0),"ConstraintBearing",(App::PropertyType)(App::Prop_None),
ADD_PROPERTY_TYPE(Location,(nullptr),"ConstraintBearing",(App::PropertyType)(App::Prop_None),
"Element giving axial location of constraint");
ADD_PROPERTY(Dist,(0.0));
ADD_PROPERTY(AxialFree,(0));
@@ -80,7 +80,7 @@ void ConstraintBearing::onChanged(const App::Property* prop)
Height.setValue(height);
// Update base point
base = base + axis * height/2;
if (Location.getValue() != NULL) {
if (Location.getValue() != nullptr) {
base = getBasePoint(base, axis, Location, Dist.getValue());
}
BasePoint.setValue(base);

View File

@@ -47,20 +47,20 @@ PROPERTY_SOURCE(Fem::ConstraintFluidBoundary, Fem::Constraint)
// also defined in TaskFemConstraintFluidBoundary.cpp and FoamCaseBuilder/BasicBuilder.py, update simultaneously
// the second (index 1) item is the default enum, as index 0 causes compiling error
static const char* BoundaryTypes[] = {"inlet","wall","outlet","interface","freestream", NULL};
static const char* WallSubtypes[] = {"unspecific", "fixed", "slip", "partialSlip", "moving", NULL};
static const char* InletSubtypes[] = {"unspecific","totalPressure","uniformVelocity","volumetricFlowRate","massFlowRate", NULL};
static const char* OutletSubtypes[] = {"unspecific","totalPressure","staticPressure","uniformVelocity", "outFlow", NULL};
static const char* InterfaceSubtypes[] = {"unspecific","symmetry","wedge","cyclic","empty", NULL};
static const char* FreestreamSubtypes[] = {"unspecific", "freestream",NULL};
static const char* BoundaryTypes[] = {"inlet","wall","outlet","interface","freestream", nullptr};
static const char* WallSubtypes[] = {"unspecific", "fixed", "slip", "partialSlip", "moving", nullptr};
static const char* InletSubtypes[] = {"unspecific","totalPressure","uniformVelocity","volumetricFlowRate","massFlowRate", nullptr};
static const char* OutletSubtypes[] = {"unspecific","totalPressure","staticPressure","uniformVelocity", "outFlow", nullptr};
static const char* InterfaceSubtypes[] = {"unspecific","symmetry","wedge","cyclic","empty", nullptr};
static const char* FreestreamSubtypes[] = {"unspecific", "freestream",nullptr};
// see Ansys fluet manual: Turbulence Specification method, if not specified, solver will guess a value based e.g. 0.05 for inlet length geometry",
static const char* TurbulenceSpecifications[] = {"intensity&DissipationRate", "intensity&LengthScale","intensity&ViscosityRatio","intensity&HydraulicDiameter",NULL};
static const char* TurbulenceSpecifications[] = {"intensity&DissipationRate", "intensity&LengthScale","intensity&ViscosityRatio","intensity&HydraulicDiameter",nullptr};
/* only used in TaskFemConstraintFluidBoundary.cpp */
// activate the heat transfer and radiation model in Solver object explorer
// also defined in FoamCaseBuilder/HeatTransferBuilder.py, update simultaneously, heatFlux is not a standard OpenFOAM patch type
static const char* ThermalBoundaryTypes[] = {"fixedValue","zeroGradient", "fixedGradient", "mixed", "heatFlux", "HTC","coupled", NULL};
static const char* ThermalBoundaryTypes[] = {"fixedValue","zeroGradient", "fixedGradient", "mixed", "heatFlux", "HTC","coupled", nullptr};
/* only used in TaskFemConstraintFluidBoundary.cpp
static const char* ThermalBoundaryHelpTexts[] = {"fixed Temperature [K]", "no heat transfer ()", "fixed value heat flux [K/m]",
"mixed fixedGradient and fixedValue", "fixed heat flux [W/m2]", "Heat transfer coeff [W/(M2)/K]", "conjugate heat transfer with solid", NULL};
@@ -78,7 +78,7 @@ ConstraintFluidBoundary::ConstraintFluidBoundary()
ADD_PROPERTY_TYPE(BoundaryValue,(0.0),"FluidBoundary",(App::PropertyType)(App::Prop_None),
"Scaler value for the specific value subtype, like pressure, velocity magnitude");
/// Direction should be allowed to edit in property editor, if no edge is available in CAD model
ADD_PROPERTY_TYPE(Direction,(0),"FluidBoundary",(App::PropertyType)(App::Prop_None),
ADD_PROPERTY_TYPE(Direction,(nullptr),"FluidBoundary",(App::PropertyType)(App::Prop_None),
"Vector direction of BoundaryValue");
ADD_PROPERTY_TYPE(Reversed,(0),"FluidBoundary",(App::PropertyType)(App::Prop_ReadOnly|App::Prop_Output),
"To distinguish inlet (flow outward from solid) or outlet boundary condition");
@@ -182,7 +182,7 @@ void ConstraintFluidBoundary::onChanged(const App::Property* prop)
}
} else if (prop == &NormalDirection) {
// Set a default direction if no direction reference has been given
if (Direction.getValue() == NULL) {
if (Direction.getValue() == nullptr) {
Base::Vector3d direction = NormalDirection.getValue();
if (Reversed.getValue())
direction = -direction;

View File

@@ -46,7 +46,7 @@ PROPERTY_SOURCE(Fem::ConstraintForce, Fem::Constraint)
ConstraintForce::ConstraintForce()
{
ADD_PROPERTY(Force,(0.0));
ADD_PROPERTY_TYPE(Direction,(0),"ConstraintForce",(App::PropertyType)(App::Prop_None),
ADD_PROPERTY_TYPE(Direction,(nullptr),"ConstraintForce",(App::PropertyType)(App::Prop_None),
"Element giving direction of constraint");
ADD_PROPERTY(Reversed,(0));
ADD_PROPERTY_TYPE(Points,(Base::Vector3d()),"ConstraintForce",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),
@@ -99,7 +99,7 @@ void ConstraintForce::onChanged(const App::Property* prop)
}
} else if (prop == &NormalDirection) {
// Set a default direction if no direction reference has been given
if (Direction.getValue() == NULL) {
if (Direction.getValue() == nullptr) {
Base::Vector3d direction = NormalDirection.getValue();
if (Reversed.getValue())
direction = -direction;

View File

@@ -48,7 +48,7 @@ ConstraintGear::ConstraintGear()
ADD_PROPERTY(Diameter,(100.0));
ADD_PROPERTY(Force,(1000.0));
ADD_PROPERTY(ForceAngle,(0.0));
ADD_PROPERTY_TYPE(Direction,(0),"ConstraintGear",(App::PropertyType)(App::Prop_None),
ADD_PROPERTY_TYPE(Direction,(nullptr),"ConstraintGear",(App::PropertyType)(App::Prop_None),
"Element giving direction of gear force");
ADD_PROPERTY(Reversed,(0));
ADD_PROPERTY_TYPE(DirectionVector,(Base::Vector3d(1,1,1).Normalize()),"ConstraintGear",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),

View File

@@ -41,7 +41,7 @@ using namespace Fem;
PROPERTY_SOURCE(Fem::ConstraintHeatflux, Fem::Constraint)
static const char* ConstraintTypes[] = {"DFlux","Convection", NULL};
static const char* ConstraintTypes[] = {"DFlux","Convection", nullptr};
ConstraintHeatflux::ConstraintHeatflux()
{

View File

@@ -42,7 +42,7 @@ using namespace Fem;
PROPERTY_SOURCE(Fem::ConstraintTemperature, Fem::Constraint)
static const char* ConstraintTypes[] = {"CFlux","Temperature", NULL};
static const char* ConstraintTypes[] = {"CFlux","Temperature", nullptr};
ConstraintTemperature::ConstraintTemperature()
{

View File

@@ -40,7 +40,7 @@ using namespace Fem;
PROPERTY_SOURCE(Fem::ConstraintTransform, Fem::Constraint)
static const char* TransformTypes[] = {"Cylindrical","Rectangular", NULL};
static const char* TransformTypes[] = {"Cylindrical","Rectangular", nullptr};
ConstraintTransform::ConstraintTransform()
{
@@ -50,8 +50,8 @@ ConstraintTransform::ConstraintTransform()
ADD_PROPERTY_TYPE(TransformType,(1),"ConstraintTransform",(App::PropertyType)(App::Prop_None),
"Type of transform, rectangular or cylindrical");
TransformType.setEnums(TransformTypes);
ADD_PROPERTY_TYPE(RefDispl,(0,0),"ConstraintTransform",(App::PropertyType)(App::Prop_None),"Elements where the constraint is applied");
ADD_PROPERTY_TYPE(NameDispl,(0),"ConstraintTransform",(App::PropertyType)(App::Prop_None),"Elements where the constraint is applied");
ADD_PROPERTY_TYPE(RefDispl,(nullptr,nullptr),"ConstraintTransform",(App::PropertyType)(App::Prop_None),"Elements where the constraint is applied");
ADD_PROPERTY_TYPE(NameDispl,(nullptr),"ConstraintTransform",(App::PropertyType)(App::Prop_None),"Elements where the constraint is applied");
ADD_PROPERTY_TYPE(BasePoint,(Base::Vector3d(0,0,0)),"ConstraintTransform",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),
"Base point of cylindrical surface");
ADD_PROPERTY_TYPE(Axis,(Base::Vector3d(0,1,0)),"ConstraintTransform",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),

View File

@@ -96,7 +96,7 @@ using namespace boost;
static int StatCount = 0;
#endif
SMESH_Gen* FemMesh::_mesh_gen = 0;
SMESH_Gen* FemMesh::_mesh_gen = nullptr;
TYPESYSTEM_SOURCE(Fem::FemMesh , Base::Persistence)
@@ -2526,7 +2526,7 @@ Data::Segment* FemMesh::getSubElement(const char* /*Type*/, unsigned long /*n*/)
//str << Type << n;
//std::string temp = str.str();
//return new ShapeSegment(getSubShape(temp.c_str()));
return 0;
return nullptr;
}
struct Fem::FemMesh::FemMeshInfo FemMesh::getInfo(void) const{

View File

@@ -78,7 +78,7 @@ PyObject *FemMeshPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Py
// constructor method
int FemMeshPy::PyInit(PyObject* args, PyObject* /*kwd*/)
{
PyObject *pcObj=0;
PyObject *pcObj=nullptr;
if (!PyArg_ParseTuple(args, "|O", &pcObj))
return -1;
@@ -116,7 +116,7 @@ PyObject* FemMeshPy::setShape(PyObject *args)
{
PyObject *pcObj;
if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapePy::Type), &pcObj))
return 0;
return nullptr;
try {
TopoDS_Shape shape = static_cast<Part::TopoShapePy*>(pcObj)->getTopoShapePtr()->getShape();
@@ -124,7 +124,7 @@ PyObject* FemMeshPy::setShape(PyObject *args)
}
catch (const std::exception& e) {
PyErr_SetString(Base::PyExc_FC_GeneralError, e.what());
return 0;
return nullptr;
}
Py_Return;
}
@@ -132,14 +132,14 @@ PyObject* FemMeshPy::setShape(PyObject *args)
PyObject* FemMeshPy::addHypothesis(PyObject *args)
{
PyObject* hyp;
PyObject* shp=0;
PyObject* shp=nullptr;
// Since we have not a common base class for the Python binding of the
// hypotheses classes we cannot pass a certain Python type
if (!PyArg_ParseTuple(args, "O|O!",&hyp, &(Part::TopoShapePy::Type), &shp))
return 0;
return nullptr;
TopoDS_Shape shape;
if (shp == 0)
if (shp == nullptr)
shape = getFemMeshPtr()->getSMesh()->GetShapeToMesh();
else
shape = static_cast<Part::TopoShapePy*>(shp)->getTopoShapePtr()->getShape();
@@ -151,11 +151,11 @@ PyObject* FemMeshPy::addHypothesis(PyObject *args)
getFemMeshPtr()->addHypothesis(shape, thesis);
}
catch (const Py::Exception&) {
return 0;
return nullptr;
}
catch (const std::exception& e) {
PyErr_SetString(Base::PyExc_FC_GeneralError, e.what());
return 0;
return nullptr;
}
Py_Return;
}
@@ -163,14 +163,14 @@ PyObject* FemMeshPy::addHypothesis(PyObject *args)
PyObject* FemMeshPy::setStandardHypotheses(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
getFemMeshPtr()->setStandardHypotheses();
}
catch (const std::exception& e) {
PyErr_SetString(Base::PyExc_FC_GeneralError, e.what());
return 0;
return nullptr;
}
Py_Return;
}
@@ -178,14 +178,14 @@ PyObject* FemMeshPy::setStandardHypotheses(PyObject *args)
PyObject* FemMeshPy::compute(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
getFemMeshPtr()->compute();
}
catch (const std::exception& e) {
PyErr_SetString(Base::PyExc_FC_GeneralError, e.what());
return 0;
return nullptr;
}
Py_Return;
}
@@ -205,7 +205,7 @@ PyObject* FemMeshPy::addNode(PyObject *args)
}
catch (const std::exception& e) {
PyErr_SetString(Base::PyExc_FC_GeneralError, e.what());
return 0;
return nullptr;
}
}
PyErr_Clear();
@@ -221,13 +221,13 @@ PyObject* FemMeshPy::addNode(PyObject *args)
}
catch (const std::exception& e) {
PyErr_SetString(Base::PyExc_FC_GeneralError, e.what());
return 0;
return nullptr;
}
}
PyErr_SetString(PyExc_TypeError, "addNode() accepts:\n"
"-- addNode(x,y,z)\n"
"-- addNode(x,y,z,ElemId)\n");
return 0;
return nullptr;
}
PyObject* FemMeshPy::addEdge(PyObject *args)
@@ -249,7 +249,7 @@ PyObject* FemMeshPy::addEdge(PyObject *args)
}
catch (const std::exception& e) {
PyErr_SetString(Base::PyExc_FC_GeneralError, e.what());
return 0;
return nullptr;
}
}
PyErr_Clear();
@@ -268,7 +268,7 @@ PyObject* FemMeshPy::addEdge(PyObject *args)
Nodes.push_back(node);
}
SMDS_MeshEdge* edge=0;
SMDS_MeshEdge* edge=nullptr;
if(ElementId != -1) {
switch(Nodes.size()){
case 2:
@@ -306,7 +306,7 @@ PyObject* FemMeshPy::addEdge(PyObject *args)
PyErr_SetString(PyExc_TypeError, "addEdge accepts:\n"
"-- int,int\n"
"-- [2|3],[int]\n");
return 0;
return nullptr;
}
PyObject* FemMeshPy::addFace(PyObject *args)
@@ -331,7 +331,7 @@ PyObject* FemMeshPy::addFace(PyObject *args)
}
catch (const std::exception& e) {
PyErr_SetString(Base::PyExc_FC_GeneralError, e.what());
return 0;
return nullptr;
}
}
PyErr_Clear();
@@ -350,7 +350,7 @@ PyObject* FemMeshPy::addFace(PyObject *args)
Nodes.push_back(node);
}
SMDS_MeshFace* face=0;
SMDS_MeshFace* face=nullptr;
if(ElementId != -1) {
switch(Nodes.size()){
case 3:
@@ -409,14 +409,14 @@ PyObject* FemMeshPy::addFace(PyObject *args)
PyErr_SetString(PyExc_TypeError, "addFace accepts:\n"
"-- int,int,int\n"
"-- [3|4|6|8 int],[int]\n");
return 0;
return nullptr;
}
PyObject* FemMeshPy::addQuad(PyObject *args)
{
int n1,n2,n3,n4;
if (!PyArg_ParseTuple(args, "iiii",&n1,&n2,&n3,&n4))
return 0;
return nullptr;
try {
SMESH_Mesh* mesh = getFemMeshPtr()->getSMesh();
@@ -434,7 +434,7 @@ PyObject* FemMeshPy::addQuad(PyObject *args)
}
catch (const std::exception& e) {
PyErr_SetString(Base::PyExc_FC_GeneralError, e.what());
return 0;
return nullptr;
}
}
@@ -460,7 +460,7 @@ PyObject* FemMeshPy::addVolume(PyObject *args)
}
catch (const std::exception& e) {
PyErr_SetString(Base::PyExc_FC_GeneralError, e.what());
return 0;
return nullptr;
}
}
PyErr_Clear();
@@ -479,7 +479,7 @@ PyObject* FemMeshPy::addVolume(PyObject *args)
Nodes.push_back(node);
}
SMDS_MeshVolume* vol=0;
SMDS_MeshVolume* vol=nullptr;
if(ElementId != -1) {
switch(Nodes.size()){
case 4:
@@ -576,13 +576,13 @@ PyObject* FemMeshPy::addVolume(PyObject *args)
PyErr_SetString(PyExc_TypeError, "addVolume accepts:\n"
"-- int,int,int,int\n"
"-- [4|5|6|8|10|13|15|20 int],[int]\n");
return 0;
return nullptr;
}
PyObject* FemMeshPy::copy(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
const FemMesh& mesh = *getFemMeshPtr();
return new FemMeshPy(new FemMesh(mesh));
@@ -592,7 +592,7 @@ PyObject* FemMeshPy::read(PyObject *args)
{
char* Name;
if (!PyArg_ParseTuple(args, "et","utf-8",&Name))
return 0;
return nullptr;
std::string EncodedName = std::string(Name);
PyMem_Free(Name);
@@ -601,7 +601,7 @@ PyObject* FemMeshPy::read(PyObject *args)
}
catch (const std::exception& e) {
PyErr_SetString(Base::PyExc_FC_GeneralError, e.what());
return 0;
return nullptr;
}
Py_Return;
}
@@ -610,7 +610,7 @@ PyObject* FemMeshPy::write(PyObject *args)
{
char* Name;
if (!PyArg_ParseTuple(args, "et","utf-8",&Name))
return 0;
return nullptr;
std::string EncodedName = std::string(Name);
PyMem_Free(Name);
@@ -619,7 +619,7 @@ PyObject* FemMeshPy::write(PyObject *args)
}
catch (const std::exception& e) {
PyErr_SetString(Base::PyExc_FC_GeneralError, e.what());
return 0;
return nullptr;
}
Py_Return;
}
@@ -630,7 +630,7 @@ PyObject* FemMeshPy::writeABAQUS(PyObject *args)
int elemParam;
PyObject* groupParam;
if (!PyArg_ParseTuple(args, "etiO!","utf-8",&Name,&elemParam,&PyBool_Type,&groupParam))
return 0;
return nullptr;
std::string EncodedName = std::string(Name);
PyMem_Free(Name);
bool grpParam = PyObject_IsTrue(groupParam) ? true : false;
@@ -640,7 +640,7 @@ PyObject* FemMeshPy::writeABAQUS(PyObject *args)
}
catch (const std::exception& e) {
PyErr_SetString(Base::PyExc_FC_GeneralError, e.what());
return 0;
return nullptr;
}
Py_Return;
}
@@ -649,7 +649,7 @@ PyObject* FemMeshPy::setTransform(PyObject *args)
{
PyObject* ptr;
if (!PyArg_ParseTuple(args, "O!", &(Base::PlacementPy::Type), &ptr))
return 0;
return nullptr;
Base::Placement* placement = static_cast<Base::PlacementPy*>(ptr)->getPlacementPtr();
Base::Matrix4D mat = placement->toMatrix();
@@ -662,13 +662,13 @@ PyObject* FemMeshPy::getFacesByFace(PyObject *args)
{
PyObject *pW;
if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeFacePy::Type), &pW))
return 0;
return nullptr;
try {
const TopoDS_Shape& sh = static_cast<Part::TopoShapeFacePy*>(pW)->getTopoShapePtr()->getShape();
if (sh.IsNull()) {
PyErr_SetString(PyExc_ValueError, "Face is empty");
return 0;
return nullptr;
}
const TopoDS_Face& fc = TopoDS::Face(sh);
@@ -683,7 +683,7 @@ PyObject* FemMeshPy::getFacesByFace(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -692,13 +692,13 @@ PyObject* FemMeshPy::getEdgesByEdge(PyObject *args)
{
PyObject *pW;
if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeEdgePy::Type), &pW))
return 0;
return nullptr;
try {
const TopoDS_Shape& sh = static_cast<Part::TopoShapeEdgePy*>(pW)->getTopoShapePtr()->getShape();
if (sh.IsNull()) {
PyErr_SetString(PyExc_ValueError, "Edge is empty");
return 0;
return nullptr;
}
const TopoDS_Edge& fc = TopoDS::Edge(sh);
@@ -713,7 +713,7 @@ PyObject* FemMeshPy::getEdgesByEdge(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -721,13 +721,13 @@ PyObject* FemMeshPy::getVolumesByFace(PyObject *args)
{
PyObject *pW;
if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeFacePy::Type), &pW))
return 0;
return nullptr;
try {
const TopoDS_Shape& sh = static_cast<Part::TopoShapeFacePy*>(pW)->getTopoShapePtr()->getShape();
if (sh.IsNull()) {
PyErr_SetString(PyExc_ValueError, "Face is empty");
return 0;
return nullptr;
}
const TopoDS_Face& fc = TopoDS::Face(sh);
@@ -745,7 +745,7 @@ PyObject* FemMeshPy::getVolumesByFace(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -753,13 +753,13 @@ PyObject* FemMeshPy::getccxVolumesByFace(PyObject *args)
{
PyObject *pW;
if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeFacePy::Type), &pW))
return 0;
return nullptr;
try {
const TopoDS_Shape& sh = static_cast<Part::TopoShapeFacePy*>(pW)->getTopoShapePtr()->getShape();
if (sh.IsNull()) {
PyErr_SetString(PyExc_ValueError, "Face is empty");
return 0;
return nullptr;
}
const TopoDS_Face& fc = TopoDS::Face(sh);
@@ -777,7 +777,7 @@ PyObject* FemMeshPy::getccxVolumesByFace(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -785,7 +785,7 @@ PyObject* FemMeshPy::getNodeById(PyObject *args)
{
int id;
if (!PyArg_ParseTuple(args, "i", &id))
return 0;
return nullptr;
Base::Matrix4D Mtrx = getFemMeshPtr()->getTransform();
const SMDS_MeshNode* aNode = getFemMeshPtr()->getSMesh()->GetMeshDS()->FindNode(id);
@@ -796,7 +796,7 @@ PyObject* FemMeshPy::getNodeById(PyObject *args)
return new Base::VectorPy( vec );
}else{
PyErr_SetString(PyExc_ValueError, "No valid node ID");
return 0;
return nullptr;
}
}
@@ -804,14 +804,14 @@ PyObject* FemMeshPy::getNodesBySolid(PyObject *args)
{
PyObject *pW;
if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeSolidPy::Type), &pW))
return 0;
return nullptr;
try {
const TopoDS_Shape& sh = static_cast<Part::TopoShapeSolidPy*>(pW)->getTopoShapePtr()->getShape();
const TopoDS_Solid& fc = TopoDS::Solid(sh);
if (sh.IsNull()) {
PyErr_SetString(PyExc_ValueError, "Solid is empty");
return 0;
return nullptr;
}
Py::List ret;
std::set<int> resultSet = getFemMeshPtr()->getNodesBySolid(fc);
@@ -823,7 +823,7 @@ PyObject* FemMeshPy::getNodesBySolid(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -831,14 +831,14 @@ PyObject* FemMeshPy::getNodesByFace(PyObject *args)
{
PyObject *pW;
if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeFacePy::Type), &pW))
return 0;
return nullptr;
try {
const TopoDS_Shape& sh = static_cast<Part::TopoShapeFacePy*>(pW)->getTopoShapePtr()->getShape();
const TopoDS_Face& fc = TopoDS::Face(sh);
if (sh.IsNull()) {
PyErr_SetString(PyExc_ValueError, "Face is empty");
return 0;
return nullptr;
}
Py::List ret;
std::set<int> resultSet = getFemMeshPtr()->getNodesByFace(fc);
@@ -850,7 +850,7 @@ PyObject* FemMeshPy::getNodesByFace(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -858,14 +858,14 @@ PyObject* FemMeshPy::getNodesByEdge(PyObject *args)
{
PyObject *pW;
if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeEdgePy::Type), &pW))
return 0;
return nullptr;
try {
const TopoDS_Shape& sh = static_cast<Part::TopoShapeEdgePy*>(pW)->getTopoShapePtr()->getShape();
const TopoDS_Edge& fc = TopoDS::Edge(sh);
if (sh.IsNull()) {
PyErr_SetString(PyExc_ValueError, "Edge is empty");
return 0;
return nullptr;
}
Py::List ret;
std::set<int> resultSet = getFemMeshPtr()->getNodesByEdge(fc);
@@ -877,7 +877,7 @@ PyObject* FemMeshPy::getNodesByEdge(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -885,14 +885,14 @@ PyObject* FemMeshPy::getNodesByVertex(PyObject *args)
{
PyObject *pW;
if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeVertexPy::Type), &pW))
return 0;
return nullptr;
try {
const TopoDS_Shape& sh = static_cast<Part::TopoShapeVertexPy*>(pW)->getTopoShapePtr()->getShape();
const TopoDS_Vertex& fc = TopoDS::Vertex(sh);
if (sh.IsNull()) {
PyErr_SetString(PyExc_ValueError, "Vertex is empty");
return 0;
return nullptr;
}
Py::List ret;
std::set<int> resultSet = getFemMeshPtr()->getNodesByVertex(fc);
@@ -904,7 +904,7 @@ PyObject* FemMeshPy::getNodesByVertex(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -912,7 +912,7 @@ PyObject* FemMeshPy::getElementNodes(PyObject *args)
{
int id;
if (!PyArg_ParseTuple(args, "i", &id))
return 0;
return nullptr;
try {
std::list<int> resultSet = getFemMeshPtr()->getElementNodes(id);
@@ -925,7 +925,7 @@ PyObject* FemMeshPy::getElementNodes(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -933,12 +933,12 @@ PyObject* FemMeshPy::getGroupName(PyObject *args)
{
int id;
if (!PyArg_ParseTuple(args, "i", &id))
return 0;
return nullptr;
SMESH_Group* group = getFemMeshPtr()->getSMesh()->GetGroup(id);
if (!group) {
PyErr_SetString(PyExc_ValueError, "No group for given id");
return 0;
return nullptr;
}
return PyUnicode_FromString(group->GetName());
}
@@ -947,12 +947,12 @@ PyObject* FemMeshPy::getGroupElementType(PyObject *args)
{
int id;
if (!PyArg_ParseTuple(args, "i", &id))
return 0;
return nullptr;
SMESH_Group* group = getFemMeshPtr()->getSMesh()->GetGroup(id);
if (!group) {
PyErr_SetString(PyExc_ValueError, "No group for given id");
return 0;
return nullptr;
}
SMDSAbs_ElementType aElementType = group->GetGroupDS()->GetType();
const char* typeString = "";
@@ -973,12 +973,12 @@ PyObject* FemMeshPy::getGroupElements(PyObject *args)
{
int id;
if (!PyArg_ParseTuple(args, "i", &id))
return 0;
return nullptr;
SMESH_Group* group = getFemMeshPtr()->getSMesh()->GetGroup(id);
if (!group) {
PyErr_SetString(PyExc_ValueError, "No group for given id");
return 0;
return nullptr;
}
std::set<int> ids;
@@ -1008,7 +1008,7 @@ PyObject* FemMeshPy::addGroup(PyObject *args)
char* typeString;
int theId = -1;
if (!PyArg_ParseTuple(args, "etet|i","utf-8", &Name, "utf-8", &typeString, &theId))
return 0;
return nullptr;
std::string EncodedName = std::string(Name);
PyMem_Free(Name);
@@ -1023,7 +1023,7 @@ PyObject* FemMeshPy::addGroup(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString());
return 0;
return nullptr;
}
std::cout << "Added Group: Name: \'" << EncodedName << "\' Type: \'" << EncodedTypeString << "\' id: " << retId << std::endl;
@@ -1042,7 +1042,7 @@ PyObject* FemMeshPy::addGroupElements(PyObject *args)
if (!PyArg_ParseTuple(args, "iO!", &id, &PyList_Type, &pList))
{
PyErr_SetString(PyExc_TypeError, "AddGroupElements: 2nd Parameter must be a list.");
return 0;
return nullptr;
}
std::set<Py_ssize_t> ids;
@@ -1052,7 +1052,7 @@ PyObject* FemMeshPy::addGroupElements(PyObject *args)
pItem = PyList_GetItem(pList, i);
if(!PyLong_Check(pItem)) {
PyErr_SetString(PyExc_TypeError, "AddGroupElements: List items must be integers.");
return 0;
return nullptr;
}
ids.insert(PyLong_AsSsize_t(pItem));
// Py_ssize_t transparently handles maximum array lengths on 32bit and 64bit machines
@@ -1070,7 +1070,7 @@ PyObject* FemMeshPy::addGroupElements(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString());
return 0;
return nullptr;
}
Py_Return;
@@ -1080,7 +1080,7 @@ PyObject* FemMeshPy::removeGroup(PyObject *args)
{
int theId;
if (!PyArg_ParseTuple(args, "i", &theId))
return 0;
return nullptr;
return PyBool_FromLong((long)(getFemMeshPtr()->removeGroup(theId)));
}
@@ -1089,7 +1089,7 @@ PyObject* FemMeshPy::getElementType(PyObject *args)
{
int id;
if (!PyArg_ParseTuple(args, "i", &id))
return 0;
return nullptr;
// An element ...
SMDSAbs_ElementType aElementType = getFemMeshPtr()->getSMesh()->GetElementType(id, true);
@@ -1107,7 +1107,7 @@ PyObject* FemMeshPy::getElementType(PyObject *args)
case SMDSAbs_Ball : typeString = "Ball"; break;
default: {
PyErr_SetString(PyExc_ValueError, "No node or element for given id");
return 0;
return nullptr;
}
}
@@ -1118,7 +1118,7 @@ PyObject* FemMeshPy::getIdByElementType(PyObject *args)
{
char* str;
if (!PyArg_ParseTuple(args, "s", &str))
return 0;
return nullptr;
SMDSAbs_ElementType aElementType = SMDSAbs_All;
if (strcmp(str, "Node") == 0) {
@@ -1352,7 +1352,7 @@ Py::Object FemMeshPy::getVolume(void) const
PyObject *FemMeshPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int FemMeshPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -53,7 +53,7 @@ using namespace App;
PROPERTY_SOURCE(Fem::FemMeshShapeNetgenObject, Fem::FemMeshShapeObject)
const char* FinenessEnums[]= {"VeryCoarse","Coarse","Moderate","Fine","VeryFine","UserDefined",NULL};
const char* FinenessEnums[]= {"VeryCoarse","Coarse","Moderate","Fine","VeryFine","UserDefined",nullptr};
FemMeshShapeNetgenObject::FemMeshShapeNetgenObject()
{

View File

@@ -78,7 +78,7 @@ PROPERTY_SOURCE(Fem::FemMeshShapeObject, Fem::FemMeshObject)
FemMeshShapeObject::FemMeshShapeObject()
{
ADD_PROPERTY_TYPE(Shape,(0), "FEM Mesh",Prop_None,"Geometry object, the mesh is made from. The geometry object has to have a Shape.");
ADD_PROPERTY_TYPE(Shape,(nullptr), "FEM Mesh",Prop_None,"Geometry object, the mesh is made from. The geometry object has to have a Shape.");
}
FemMeshShapeObject::~FemMeshShapeObject()

View File

@@ -42,7 +42,7 @@ PROPERTY_SOURCE(Fem::FemPostFilter, Fem::FemPostObject)
FemPostFilter::FemPostFilter()
{
ADD_PROPERTY(Input,(0));
ADD_PROPERTY(Input,(nullptr));
}
FemPostFilter::~FemPostFilter()
@@ -105,7 +105,7 @@ vtkDataObject* FemPostFilter::getInputData() {
}
}
return NULL;
return nullptr;
}
@@ -113,7 +113,7 @@ PROPERTY_SOURCE(Fem::FemPostClipFilter, Fem::FemPostFilter)
FemPostClipFilter::FemPostClipFilter(void) : FemPostFilter() {
ADD_PROPERTY_TYPE(Function, (0), "Clip", App::Prop_None, "The function object which defines the clip regions");
ADD_PROPERTY_TYPE(Function, (nullptr), "Clip", App::Prop_None, "The function object which defines the clip regions");
ADD_PROPERTY_TYPE(InsideOut, (false), "Clip", App::Prop_None, "Invert the clip direction");
ADD_PROPERTY_TYPE(CutCells, (false), "Clip", App::Prop_None, "Decides if cells are cuttet and interpolated or if the cells are kept as a whole");
@@ -579,7 +579,7 @@ PROPERTY_SOURCE(Fem::FemPostCutFilter, Fem::FemPostFilter)
FemPostCutFilter::FemPostCutFilter(void) : FemPostFilter() {
ADD_PROPERTY_TYPE(Function, (0), "Cut", App::Prop_None, "The function object which defines the clip cut function");
ADD_PROPERTY_TYPE(Function, (nullptr), "Cut", App::Prop_None, "The function object which defines the clip cut function");
FilterPipeline clip;
m_cutter = vtkSmartPointer<vtkCutter>::New();

View File

@@ -36,7 +36,7 @@ PROPERTY_SOURCE(Fem::FemPostFunctionProvider, App::DocumentObject)
FemPostFunctionProvider::FemPostFunctionProvider(void): DocumentObject() {
ADD_PROPERTY(Functions, (0));
ADD_PROPERTY(Functions, (nullptr));
}
FemPostFunctionProvider::~FemPostFunctionProvider() {

View File

@@ -42,7 +42,7 @@ PROPERTY_SOURCE(Fem::FemPostObject, App::GeoFeature)
FemPostObject::FemPostObject()
{
ADD_PROPERTY(Data,(0));
ADD_PROPERTY(Data,(nullptr));
}
FemPostObject::~FemPostObject()

View File

@@ -54,12 +54,12 @@ using namespace Fem;
using namespace App;
PROPERTY_SOURCE(Fem::FemPostPipeline, Fem::FemPostObject)
const char* FemPostPipeline::ModeEnums[]= {"Serial","Parallel",NULL};
const char* FemPostPipeline::ModeEnums[]= {"Serial","Parallel",nullptr};
FemPostPipeline::FemPostPipeline()
{
ADD_PROPERTY_TYPE(Filter, (0), "Pipeline", App::Prop_None, "The filter used in this pipeline");
ADD_PROPERTY_TYPE(Functions, (0), "Pipeline", App::Prop_Hidden, "The function provider which groups all pipeline functions");
ADD_PROPERTY_TYPE(Filter, (nullptr), "Pipeline", App::Prop_None, "The filter used in this pipeline");
ADD_PROPERTY_TYPE(Functions, (nullptr), "Pipeline", App::Prop_Hidden, "The function provider which groups all pipeline functions");
ADD_PROPERTY_TYPE(Mode,(long(0)), "Pipeline", App::Prop_None, "Selects the pipeline data transition mode. In serial, every filter"
"gets the output of the previous one as input. In parallel, every"
"filter gets the pipeline source as input.");
@@ -200,8 +200,8 @@ void FemPostPipeline::onChanged(const Property* prop)
//if we have no input the filters are responsible of grabbing the pipeline data themself
else {
//the first filter must always grab the data
if(filter->Input.getValue() != NULL)
filter->Input.setValue(NULL);
if(filter->Input.getValue() != nullptr)
filter->Input.setValue(nullptr);
//all the others need to be connected to the previous filter or grab the data, dependent on mode
++it;
@@ -213,8 +213,8 @@ void FemPostPipeline::onChanged(const Property* prop)
nextFilter->Input.setValue(filter);
}
else { //Parallel mode
if( nextFilter->Input.getValue() != NULL)
nextFilter->Input.setValue(NULL);
if( nextFilter->Input.getValue() != nullptr)
nextFilter->Input.setValue(nullptr);
}
filter = nextFilter;

View File

@@ -45,19 +45,19 @@ PyObject* FemPostPipelinePy::read(PyObject *args)
PyMem_Free(Name);
Py_Return;
}
return 0;
return nullptr;
}
PyObject* FemPostPipelinePy::load(PyObject *args)
{
PyObject* py;
if (!PyArg_ParseTuple(args, "O!", &(App::DocumentObjectPy::Type), &py))
return 0;
return nullptr;
App::DocumentObject* obj = static_cast<App::DocumentObjectPy*>(py)->getDocumentObjectPtr();
if (!obj->getTypeId().isDerivedFrom(FemResultObject::getClassTypeId())) {
PyErr_SetString(PyExc_TypeError, "object is not a result object");
return 0;
return nullptr;
}
getFemPostPipelinePtr()->load(static_cast<FemResultObject*>(obj));
@@ -67,7 +67,7 @@ PyObject* FemPostPipelinePy::load(PyObject *args)
PyObject* FemPostPipelinePy::getLastPostObject(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
App::DocumentObject* obj = getFemPostPipelinePtr()->getLastPostObject();
if (obj)
@@ -79,12 +79,12 @@ PyObject* FemPostPipelinePy::holdsPostObject(PyObject *args)
{
PyObject* py;
if (!PyArg_ParseTuple(args, "O!", &(App::DocumentObjectPy::Type), &py))
return 0;
return nullptr;
App::DocumentObject* obj = static_cast<App::DocumentObjectPy*>(py)->getDocumentObjectPtr();
if (!obj->getTypeId().isDerivedFrom(FemPostObject::getClassTypeId())) {
PyErr_SetString(PyExc_TypeError, "object is not a post-processing object");
return 0;
return nullptr;
}
bool ok = getFemPostPipelinePtr()->holdsPostObject(static_cast<FemPostObject*>(obj));
@@ -93,7 +93,7 @@ PyObject* FemPostPipelinePy::holdsPostObject(PyObject *args)
PyObject *FemPostPipelinePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int FemPostPipelinePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -38,7 +38,7 @@ PROPERTY_SOURCE(Fem::FemResultObject, App::DocumentObject)
FemResultObject::FemResultObject()
{
ADD_PROPERTY_TYPE(Mesh,(0), "General",Prop_None,"Link to the corresponding mesh");
ADD_PROPERTY_TYPE(Mesh,(nullptr), "General",Prop_None,"Link to the corresponding mesh");
ADD_PROPERTY_TYPE(NodeNumbers,(0), "NodeData",Prop_None,"Numbers of the result nodes");
ADD_PROPERTY_TYPE(Stats,(0), "Data",Prop_None,"Statistics of the results");
ADD_PROPERTY_TYPE(Time,(0), "Data",Prop_None,"Time of analysis increment");

View File

@@ -38,7 +38,7 @@ PROPERTY_SOURCE(Fem::FemSetObject, App::DocumentObject)
FemSetObject::FemSetObject()
{
ADD_PROPERTY_TYPE(FemMesh,(0), "MeshSet link",Prop_None,"MeshSet the set belongs to");
ADD_PROPERTY_TYPE(FemMesh,(nullptr), "MeshSet link",Prop_None,"MeshSet the set belongs to");
}
FemSetObject::~FemSetObject()

View File

@@ -527,7 +527,7 @@ App::DocumentObject* getObjectByType(const Base::Type type)
return static_cast<App::DocumentObject*>(*it); // return the first of that type
}
}
return NULL;
return nullptr;
}
App::DocumentObject* createObjectByType(const Base::Type type)
@@ -583,7 +583,7 @@ App::DocumentObject* FemVTKTools::readResult(const char* filename, App::Document
App::DocumentObject* obj = pcDoc->getActiveObject();
vtkSmartPointer<vtkDataSet> dataset = ds;
App::DocumentObject* result = NULL;
App::DocumentObject* result = nullptr;
if (res)
{
@@ -595,7 +595,7 @@ App::DocumentObject* FemVTKTools::readResult(const char* filename, App::Document
else
{
Base::Console().Message("the active object is not the correct type, do nothing\n");
return NULL;
return nullptr;
}
}

View File

@@ -63,10 +63,10 @@ namespace Fem
static void writeVTKMesh(const char* Filename, const FemMesh* mesh);
// FemResult (activeObject or created if res= NULL) read from vtkUnstructuredGrid dataset file
static App::DocumentObject* readResult(const char* Filename, App::DocumentObject* res = NULL);
static App::DocumentObject* readResult(const char* Filename, App::DocumentObject* res = nullptr);
// write FemResult (activeObject if res= NULL) to vtkUnstructuredGrid dataset file
static void writeResult(const char* filename, const App::DocumentObject* res = NULL);
static void writeResult(const char* filename, const App::DocumentObject* res = nullptr);
};
}

View File

@@ -221,7 +221,7 @@ PyObject *SMESH_HypothesisPy<T>::PyMake(struct _typeobject * /*type*/, PyObject
int hypId;
PyObject* obj;
if (!PyArg_ParseTuple(args, "iO!",&hypId,&(FemMeshPy::Type),&obj))
return 0;
return nullptr;
FemMesh* mesh = static_cast<FemMeshPy*>(obj)->getFemMeshPtr();
#if SMESH_VERSION_MAJOR >= 9
return new T(hypId, mesh->getGenerator());
@@ -294,7 +294,7 @@ StdMeshers_AutomaticLengthPy::StdMeshers_AutomaticLengthPy(int /*hypId*/, SMESH_
}
#else
StdMeshers_AutomaticLengthPy::StdMeshers_AutomaticLengthPy(int /*hypId*/, int /*studyId*/, SMESH_Gen* /*gen*/)
: SMESH_HypothesisPyBase(0)
: SMESH_HypothesisPyBase(nullptr)
{
}
#endif

View File

@@ -75,7 +75,7 @@ void PropertyPostDataObject::setValue(const vtkSmartPointer<vtkDataObject>& ds)
m_dataObject->DeepCopy(ds);
}
else
m_dataObject = NULL;
m_dataObject = nullptr;
hasSetValue();
}

View File

@@ -31,7 +31,7 @@
using namespace FemGui;
ActiveAnalysisObserver* ActiveAnalysisObserver::inst = 0;
ActiveAnalysisObserver* ActiveAnalysisObserver::inst = nullptr;
ActiveAnalysisObserver* ActiveAnalysisObserver::instance()
{
@@ -41,7 +41,7 @@ ActiveAnalysisObserver* ActiveAnalysisObserver::instance()
}
ActiveAnalysisObserver::ActiveAnalysisObserver()
: activeObject(0), activeView(0), activeDocument(0)
: activeObject(nullptr), activeView(nullptr), activeDocument(nullptr)
{
}
@@ -59,8 +59,8 @@ void ActiveAnalysisObserver::setActiveObject(Fem::FemAnalysis* fem)
attachDocument(doc);
}
else {
activeObject = 0;
activeView = 0;
activeObject = nullptr;
activeView = nullptr;
}
}
@@ -71,7 +71,7 @@ Fem::FemAnalysis* ActiveAnalysisObserver::getActiveObject() const
bool ActiveAnalysisObserver::hasActiveObject() const
{
return activeObject != 0;
return activeObject != nullptr;
}
void ActiveAnalysisObserver::highlightActiveObject(const Gui::HighlightMode& mode, bool on)
@@ -84,9 +84,9 @@ void ActiveAnalysisObserver::slotDeletedDocument(const App::Document& Doc)
{
App::Document* d = getDocument();
if (d == &Doc) {
activeObject = 0;
activeDocument = 0;
activeView = 0;
activeObject = nullptr;
activeDocument = nullptr;
activeView = nullptr;
detachDocument();
}
}
@@ -94,7 +94,7 @@ void ActiveAnalysisObserver::slotDeletedDocument(const App::Document& Doc)
void ActiveAnalysisObserver::slotDeletedObject(const App::DocumentObject& Obj)
{
if (activeObject == &Obj) {
activeObject = 0;
activeView = 0;
activeObject = nullptr;
activeView = nullptr;
}
}

View File

@@ -95,7 +95,7 @@ PyMOD_INIT_FUNC(FemGui)
{
if (!Gui::Application::Instance) {
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
PyMOD_Return(0);
PyMOD_Return(nullptr);
}
PyObject* mod = FemGui::initModule();

View File

@@ -77,10 +77,10 @@ private:
{
if (FemGui::ActiveAnalysisObserver::instance()->hasActiveObject()) {
FemGui::ActiveAnalysisObserver::instance()->highlightActiveObject(Gui::HighlightMode::Blue, false);
FemGui::ActiveAnalysisObserver::instance()->setActiveObject(0);
FemGui::ActiveAnalysisObserver::instance()->setActiveObject(nullptr);
}
PyObject* object = 0;
PyObject* object = nullptr;
if (PyArg_ParseTuple(args.ptr(), "|O!", &(App::DocumentObjectPy::Type), &object) && object) {
App::DocumentObject* obj = static_cast<App::DocumentObjectPy*>(object)->getDocumentObjectPtr();
if (!obj || !obj->getTypeId().isDerivedFrom(Fem::FemAnalysis::getClassTypeId())) {

View File

@@ -1518,7 +1518,7 @@ void CmdFemPostFunctions::activated(int iMsg)
this->updateActive();
//most of the times functions are added inside of a filter, make sure this still works
if(Gui::Application::Instance->activeDocument()->getInEdit() == NULL)
if(Gui::Application::Instance->activeDocument()->getInEdit() == nullptr)
doCommand(Gui,"Gui.activeDocument().setEdit('%s')",FeatName.c_str());
}
else {

View File

@@ -37,7 +37,7 @@ class DlgSettingsFemCcxImp : public Gui::Dialog::PreferencePage
Q_OBJECT
public:
DlgSettingsFemCcxImp( QWidget* parent = 0 );
DlgSettingsFemCcxImp( QWidget* parent = nullptr );
~DlgSettingsFemCcxImp();
protected:

View File

@@ -36,7 +36,7 @@ class DlgSettingsFemElmerImp : public Gui::Dialog::PreferencePage
Q_OBJECT
public:
DlgSettingsFemElmerImp( QWidget* parent = 0 );
DlgSettingsFemElmerImp( QWidget* parent = nullptr );
~DlgSettingsFemElmerImp();
protected:

View File

@@ -36,7 +36,7 @@ class DlgSettingsFemExportAbaqusImp : public Gui::Dialog::PreferencePage
Q_OBJECT
public:
DlgSettingsFemExportAbaqusImp( QWidget* parent = 0 );
DlgSettingsFemExportAbaqusImp( QWidget* parent = nullptr );
~DlgSettingsFemExportAbaqusImp();
protected:

View File

@@ -36,7 +36,7 @@ class DlgSettingsFemGeneralImp : public Gui::Dialog::PreferencePage
Q_OBJECT
public:
DlgSettingsFemGeneralImp( QWidget* parent = 0 );
DlgSettingsFemGeneralImp( QWidget* parent = nullptr );
~DlgSettingsFemGeneralImp();
protected:

View File

@@ -36,7 +36,7 @@ class DlgSettingsFemGmshImp : public Gui::Dialog::PreferencePage
Q_OBJECT
public:
DlgSettingsFemGmshImp( QWidget* parent = 0 );
DlgSettingsFemGmshImp( QWidget* parent = nullptr );
~DlgSettingsFemGmshImp();
protected:

View File

@@ -36,7 +36,7 @@ class DlgSettingsFemInOutVtkImp : public Gui::Dialog::PreferencePage
Q_OBJECT
public:
DlgSettingsFemInOutVtkImp( QWidget* parent = 0 );
DlgSettingsFemInOutVtkImp( QWidget* parent = nullptr );
~DlgSettingsFemInOutVtkImp();
protected:

View File

@@ -37,7 +37,7 @@ class DlgSettingsFemMaterialImp : public Gui::Dialog::PreferencePage
Q_OBJECT
public:
DlgSettingsFemMaterialImp( QWidget* parent = 0 );
DlgSettingsFemMaterialImp( QWidget* parent = nullptr );
~DlgSettingsFemMaterialImp();
protected:

View File

@@ -37,7 +37,7 @@ class DlgSettingsFemMystranImp : public Gui::Dialog::PreferencePage
Q_OBJECT
public:
DlgSettingsFemMystranImp( QWidget* parent = 0 );
DlgSettingsFemMystranImp( QWidget* parent = nullptr );
~DlgSettingsFemMystranImp();
protected:

View File

@@ -37,7 +37,7 @@ class DlgSettingsFemZ88Imp : public Gui::Dialog::PreferencePage
Q_OBJECT
public:
DlgSettingsFemZ88Imp( QWidget* parent = 0 );
DlgSettingsFemZ88Imp( QWidget* parent = nullptr );
~DlgSettingsFemZ88Imp();
protected:

View File

@@ -38,7 +38,7 @@ class FemSelectionGate : public Gui::SelectionFilterGate
};
FemSelectionGate(ElemType type)
: Gui::SelectionFilterGate((Gui::SelectionFilter*)0),Type(type)
: Gui::SelectionFilterGate((Gui::SelectionFilter*)nullptr),Type(type)
{
};

View File

@@ -123,7 +123,7 @@ QWidget* PropertyFemMeshItem::createEditor(QWidget* parent, const QObject* recei
Q_UNUSED(parent);
Q_UNUSED(receiver);
Q_UNUSED(method);
return 0;
return nullptr;
}
void PropertyFemMeshItem::setEditorData(QWidget *editor, const QVariant& data) const

View File

@@ -56,7 +56,7 @@ class TaskAnalysisInfo : public Gui::TaskView::TaskBox
Q_OBJECT
public:
TaskAnalysisInfo(Fem::FemAnalysis *pcObject,QWidget *parent = 0);
TaskAnalysisInfo(Fem::FemAnalysis *pcObject,QWidget *parent = nullptr);
~TaskAnalysisInfo();
private Q_SLOTS:

View File

@@ -52,7 +52,7 @@ class TaskCreateNodeSet : public Gui::TaskView::TaskBox, public Gui::SelectionOb
Q_OBJECT
public:
TaskCreateNodeSet(Fem::FemSetNodesObject *pcObject,QWidget *parent = 0);
TaskCreateNodeSet(Fem::FemSetNodesObject *pcObject,QWidget *parent = nullptr);
~TaskCreateNodeSet();
std::set<long> tempSet;

View File

@@ -52,7 +52,7 @@ using namespace FemGui;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
TaskDlgMeshShapeNetgen::TaskDlgMeshShapeNetgen(FemGui::ViewProviderFemMeshShapeNetgen *obj)
: TaskDialog(), param(0), ViewProviderFemMeshShapeNetgen(obj)
: TaskDialog(), param(nullptr), ViewProviderFemMeshShapeNetgen(obj)
{
FemMeshShapeNetgenObject = dynamic_cast<Fem::FemMeshShapeNetgenObject *>(obj->getObject());
if (FemMeshShapeNetgenObject) {

View File

@@ -54,7 +54,7 @@ class TaskDriver : public Gui::TaskView::TaskBox
Q_OBJECT
public:
TaskDriver(Fem::FemAnalysis *pcObject,QWidget *parent = 0);
TaskDriver(Fem::FemAnalysis *pcObject,QWidget *parent = nullptr);
~TaskDriver();

View File

@@ -81,7 +81,7 @@ TaskFemConstraint::TaskFemConstraint(ViewProviderFemConstraint *ConstraintView,Q
selectionMode = selref;
// Setup the dialog inside the Shaft Wizard dialog
if ((ConstraintView->wizardWidget != NULL) && (ConstraintView->wizardSubLayout != NULL)) {
if ((ConstraintView->wizardWidget != nullptr) && (ConstraintView->wizardSubLayout != nullptr)) {
// Hide the shaft wizard table widget to make more space
ConstraintView->wizardSubLayout->itemAt(0)->widget()->hide();
QGridLayout* buttons = ConstraintView->wizardSubLayout->findChild<QGridLayout*>();
@@ -105,7 +105,7 @@ TaskFemConstraint::TaskFemConstraint(ViewProviderFemConstraint *ConstraintView,Q
void TaskFemConstraint::keyPressEvent(QKeyEvent *ke)
{
if ((ConstraintView->wizardWidget != NULL) && (ConstraintView->wizardSubLayout != NULL))
if ((ConstraintView->wizardWidget != nullptr) && (ConstraintView->wizardSubLayout != nullptr))
// Prevent <Enter> from closing this dialog AND the shaft wizard dialog
// TODO: This should trigger an update in the shaft wizard but its difficult to access a python dialog from here...
if (ke->key() == Qt::Key_Return)
@@ -196,7 +196,7 @@ void TaskFemConstraint::onButtonWizOk()
void TaskFemConstraint::onButtonWizCancel()
{
Fem::Constraint* pcConstraint = static_cast<Fem::Constraint*>(ConstraintView->getObject());
if (pcConstraint != NULL)
if (pcConstraint != nullptr)
pcConstraint->getDocument()->removeObject(pcConstraint->getNameInDocument());
onButtonWizOk();
}

View File

@@ -44,7 +44,7 @@ class TaskFemConstraint : public Gui::TaskView::TaskBox, public Gui::SelectionOb
Q_OBJECT
public:
TaskFemConstraint(ViewProviderFemConstraint *ConstraintView,QWidget *parent = 0,const char* pixmapname = "");
TaskFemConstraint(ViewProviderFemConstraint *ConstraintView,QWidget *parent = nullptr,const char* pixmapname = "");
virtual ~TaskFemConstraint() {}
virtual const std::string getReferences(void) const {return std::string();}

View File

@@ -47,7 +47,7 @@ class TaskFemConstraintBearing : public TaskFemConstraint
Q_OBJECT
public:
TaskFemConstraintBearing(ViewProviderFemConstraint *ConstraintView, QWidget *parent = 0,
TaskFemConstraintBearing(ViewProviderFemConstraint *ConstraintView, QWidget *parent = nullptr,
const char* pixmapname = "FEM_ConstraintBearing");
virtual ~TaskFemConstraintBearing();

View File

@@ -40,7 +40,7 @@ class TaskFemConstraintContact : public TaskFemConstraint
Q_OBJECT
public:
TaskFemConstraintContact(ViewProviderFemConstraintContact *ConstraintView,QWidget *parent = 0);
TaskFemConstraintContact(ViewProviderFemConstraintContact *ConstraintView,QWidget *parent = nullptr);
~TaskFemConstraintContact();
const std::string getReferences() const;
double get_Slope()const;

View File

@@ -49,7 +49,7 @@ class TaskFemConstraintDisplacement : public TaskFemConstraintOnBoundary
Q_OBJECT
public:
TaskFemConstraintDisplacement(ViewProviderFemConstraintDisplacement *ConstraintView, QWidget *parent = 0);
TaskFemConstraintDisplacement(ViewProviderFemConstraintDisplacement *ConstraintView, QWidget *parent = nullptr);
~TaskFemConstraintDisplacement();
const std::string getReferences() const;
double get_spinxDisplacement()const;

View File

@@ -38,7 +38,7 @@ class TaskFemConstraintFixed : public TaskFemConstraintOnBoundary
Q_OBJECT
public:
TaskFemConstraintFixed(ViewProviderFemConstraintFixed *ConstraintView,QWidget *parent = 0);
TaskFemConstraintFixed(ViewProviderFemConstraintFixed *ConstraintView,QWidget *parent = nullptr);
~TaskFemConstraintFixed();
const std::string getReferences() const;

View File

@@ -57,11 +57,11 @@ using namespace Fem;
//also defined in FemConstrainFluidBoundary and foamcasebuilder/basicbuilder.py, please update simultaneously
//the second (index 1) is the default enum, as index 0 causes compiling error
//static const char* BoundaryTypes[] = {"inlet","wall","outlet","freestream", "interface", NULL};
static const char* WallSubtypes[] = { "unspecific", "fixed", "slip", "partialSlip", "moving", "rough", NULL };
static const char* InletSubtypes[] = { "unspecific","totalPressure","uniformVelocity","volumetricFlowRate","massFlowRate",NULL };
static const char* OutletSubtypes[] = { "unspecific","totalPressure","staticPressure","uniformVelocity", "outFlow", NULL };
static const char* InterfaceSubtypes[] = { "unspecific","symmetry","wedge","cyclic","empty", "coupled", NULL };
static const char* FreestreamSubtypes[] = { "unspecific", "freestream",NULL };
static const char* WallSubtypes[] = { "unspecific", "fixed", "slip", "partialSlip", "moving", "rough", nullptr };
static const char* InletSubtypes[] = { "unspecific","totalPressure","uniformVelocity","volumetricFlowRate","massFlowRate",nullptr };
static const char* OutletSubtypes[] = { "unspecific","totalPressure","staticPressure","uniformVelocity", "outFlow", nullptr };
static const char* InterfaceSubtypes[] = { "unspecific","symmetry","wedge","cyclic","empty", "coupled", nullptr };
static const char* FreestreamSubtypes[] = { "unspecific", "freestream",nullptr };
static const char* InterfaceSubtypeHelpTexts[] = {
"invalid,select other valid interface subtype",
@@ -69,7 +69,7 @@ static const char* InterfaceSubtypeHelpTexts[] = {
"axis symmetric front and back surfaces",
"periodic boundary in pair, treated as physical connected",
"front and back for single layer 2D mesh, also axis-sym axis line",
"exchange boundary vale with external program, need extra manual setup like file name", NULL };
"exchange boundary vale with external program, need extra manual setup like file name", nullptr };
// defined in file FemConstraintFluidBoundary:
// see Ansys fluet manual: Turbulence Specification method
@@ -79,11 +79,11 @@ static const char* TurbulenceSpecificationHelpTexts[] = {
"explicitly specific intensity k [SI unit] and dissipation rate epsilon [] / omega []",
"intensity (0.05 ~ 0.15) and characteristic length scale of max eddy [m]",
"intensity (0.05 ~ 0.15) and turbulent viscosity ratio",
"for fully developed internal flow, Turbulence intensity (0-1.0) 0.05 typical", NULL };
"for fully developed internal flow, Turbulence intensity (0-1.0) 0.05 typical", nullptr };
//static const char* ThermalBoundaryTypes[] = {"fixedValue","zeroGradient", "fixedGradient", "mixed", "heatFlux", "HTC","coupled", NULL};
static const char* ThermalBoundaryHelpTexts[] = { "fixed Temperature [K]", "no heat transfer on boundary", "fixed value gradient [K/m]",
"mixed fixedGradient and fixedValue", "fixed heat flux [W/m2]", "Heat transfer coeff [W/(M2)/K]", "conjugate heat transfer with solid", NULL };
"mixed fixedGradient and fixedValue", "fixed heat flux [W/m2]", "Heat transfer coeff [W/(M2)/K]", "conjugate heat transfer with solid", nullptr };
// enable & disable quantityUI once valueType is selected
// internal function not declared in header file
@@ -171,7 +171,7 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo
// Get the feature data
Fem::ConstraintFluidBoundary* pcConstraint = static_cast<Fem::ConstraintFluidBoundary*>(ConstraintView->getObject());
Fem::FemAnalysis* pcAnalysis = NULL;
Fem::FemAnalysis* pcAnalysis = nullptr;
if (FemGui::ActiveAnalysisObserver::instance()->hasActiveObject()) {
pcAnalysis = FemGui::ActiveAnalysisObserver::instance()->getActiveObject();
}
@@ -183,7 +183,7 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo
}
}
Fem::FemMeshObject* pcMesh = NULL;
Fem::FemMeshObject* pcMesh = nullptr;
if (pcAnalysis) {
std::vector<App::DocumentObject*> fem = pcAnalysis->Group.getValues();
for (std::vector<App::DocumentObject*>::iterator it = fem.begin(); it != fem.end(); ++it) {
@@ -195,7 +195,7 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo
Base::Console().Log("FemAnalysis object is not activated or no FemAnalysis in the active document, mesh dimension is unknown\n");
dimension = -1; // unknown dimension of mesh
}
if (pcMesh != NULL) {
if (pcMesh != nullptr) {
App::Property* prop = pcMesh->getPropertyByName("Shape"); // PropertyLink
if (prop && prop->getTypeId().isDerivedFrom(App::PropertyLink::getClassTypeId())) {
App::PropertyLink* pcLink = static_cast<App::PropertyLink*>(prop);
@@ -215,7 +215,7 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo
}
}
pcSolver = NULL; // this is an private object of type Fem::FemSolverObject*
pcSolver = nullptr; // this is an private object of type Fem::FemSolverObject*
if (pcAnalysis) {
std::vector<App::DocumentObject*> fem = pcAnalysis->Group.getValues();
for (std::vector<App::DocumentObject*>::iterator it = fem.begin(); it != fem.end(); ++it) {
@@ -224,9 +224,9 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo
}
}
pHeatTransferring = NULL;
pTurbulenceModel = NULL;
if (pcSolver != NULL) {
pHeatTransferring = nullptr;
pTurbulenceModel = nullptr;
if (pcSolver != nullptr) {
//if only it is CFD solver, otherwise exit by SIGSEGV error, detect getPropertyByName() != NULL
if (pcSolver->getPropertyByName("HeatTransferring")) {
pHeatTransferring = static_cast<App::PropertyBool*>(pcSolver->getPropertyByName("HeatTransferring"));
@@ -925,8 +925,8 @@ bool TaskDlgFemConstraintFluidBoundary::accept()
const Fem::FemSolverObject* pcSolver = boundary->getFemSolver();
if (pcSolver) {
App::PropertyBool* pHeatTransferring = NULL;
App::PropertyEnumeration* pTurbulenceModel = NULL;
App::PropertyBool* pHeatTransferring = nullptr;
App::PropertyEnumeration* pTurbulenceModel = nullptr;
pHeatTransferring = static_cast<App::PropertyBool*>(pcSolver->getPropertyByName("HeatTransferring"));
pTurbulenceModel = static_cast<App::PropertyEnumeration*>(pcSolver->getPropertyByName("TurbulenceModel"));

View File

@@ -49,7 +49,7 @@ class TaskFemConstraintFluidBoundary : public TaskFemConstraintOnBoundary
Q_OBJECT
public:
TaskFemConstraintFluidBoundary(ViewProviderFemConstraintFluidBoundary *ConstraintView,QWidget *parent = 0);
TaskFemConstraintFluidBoundary(ViewProviderFemConstraintFluidBoundary *ConstraintView,QWidget *parent = nullptr);
virtual ~TaskFemConstraintFluidBoundary();
const Fem::FemSolverObject* getFemSolver(void) const;

View File

@@ -48,7 +48,7 @@ class TaskFemConstraintForce : public TaskFemConstraintOnBoundary
Q_OBJECT
public:
TaskFemConstraintForce(ViewProviderFemConstraintForce *ConstraintView,QWidget *parent = 0);
TaskFemConstraintForce(ViewProviderFemConstraintForce *ConstraintView,QWidget *parent = nullptr);
virtual ~TaskFemConstraintForce();
double getForce(void) const;
const std::string getReferences() const;

View File

@@ -271,7 +271,7 @@ TaskDlgFemConstraintGear::TaskDlgFemConstraintGear(ViewProviderFemConstraintGear
{
this->ConstraintView = ConstraintView;
assert(ConstraintView);
this->parameter = new TaskFemConstraintGear(ConstraintView, 0, "FEM_ConstraintGear");
this->parameter = new TaskFemConstraintGear(ConstraintView, nullptr, "FEM_ConstraintGear");
Content.push_back(parameter);
}

View File

@@ -34,7 +34,7 @@ class TaskFemConstraintGear : public TaskFemConstraintBearing
Q_OBJECT
public:
TaskFemConstraintGear(ViewProviderFemConstraint *ConstraintView,QWidget *parent = 0,
TaskFemConstraintGear(ViewProviderFemConstraint *ConstraintView,QWidget *parent = nullptr,
const char* pixmapname = "FEM_ConstraintGear");
double getDiameter(void) const;

View File

@@ -40,7 +40,7 @@ class TaskFemConstraintHeatflux : public TaskFemConstraintOnBoundary
Q_OBJECT
public:
TaskFemConstraintHeatflux(ViewProviderFemConstraintHeatflux *ConstraintView,QWidget *parent = 0);
TaskFemConstraintHeatflux(ViewProviderFemConstraintHeatflux *ConstraintView,QWidget *parent = nullptr);
virtual ~TaskFemConstraintHeatflux();
double getAmbientTemp(void) const;
/*double getFaceTemp(void) const;*/

View File

@@ -40,7 +40,7 @@ class TaskFemConstraintInitialTemperature : public TaskFemConstraint
Q_OBJECT
public:
TaskFemConstraintInitialTemperature(ViewProviderFemConstraintInitialTemperature *ConstraintView,QWidget *parent = 0);
TaskFemConstraintInitialTemperature(ViewProviderFemConstraintInitialTemperature *ConstraintView,QWidget *parent = nullptr);
~TaskFemConstraintInitialTemperature();
double get_temperature()const;

View File

@@ -40,7 +40,7 @@ class TaskFemConstraintPlaneRotation : public TaskFemConstraint
Q_OBJECT
public:
TaskFemConstraintPlaneRotation(ViewProviderFemConstraintPlaneRotation *ConstraintView,QWidget *parent = 0);
TaskFemConstraintPlaneRotation(ViewProviderFemConstraintPlaneRotation *ConstraintView,QWidget *parent = nullptr);
~TaskFemConstraintPlaneRotation();
const std::string getReferences() const;

View File

@@ -40,7 +40,7 @@ class TaskFemConstraintPressure : public TaskFemConstraintOnBoundary
Q_OBJECT
public:
TaskFemConstraintPressure(ViewProviderFemConstraintPressure *ConstraintView,QWidget *parent = 0);
TaskFemConstraintPressure(ViewProviderFemConstraintPressure *ConstraintView,QWidget *parent = nullptr);
~TaskFemConstraintPressure();
const std::string getReferences() const;
double get_Pressure()const;

View File

@@ -34,7 +34,7 @@ class TaskFemConstraintPulley : public TaskFemConstraintGear
Q_OBJECT
public:
TaskFemConstraintPulley(ViewProviderFemConstraintPulley *ConstraintView,QWidget *parent = 0);
TaskFemConstraintPulley(ViewProviderFemConstraintPulley *ConstraintView,QWidget *parent = nullptr);
double getOtherDiameter(void) const;
double getCenterDistance(void) const;

View File

@@ -38,7 +38,7 @@ class TaskFemConstraintSpring : public TaskFemConstraintOnBoundary
Q_OBJECT
public:
TaskFemConstraintSpring(ViewProviderFemConstraintSpring *ConstraintView,QWidget *parent = 0);
TaskFemConstraintSpring(ViewProviderFemConstraintSpring *ConstraintView,QWidget *parent = nullptr);
~TaskFemConstraintSpring();
const std::string getReferences() const;
double get_normalStiffness()const;

View File

@@ -43,7 +43,7 @@ class TaskFemConstraintTemperature : public TaskFemConstraintOnBoundary
Q_OBJECT
public:
TaskFemConstraintTemperature(ViewProviderFemConstraintTemperature *ConstraintView,QWidget *parent = 0);
TaskFemConstraintTemperature(ViewProviderFemConstraintTemperature *ConstraintView,QWidget *parent = nullptr);
~TaskFemConstraintTemperature();
const std::string getReferences() const;
double get_temperature()const;

View File

@@ -41,7 +41,7 @@ class TaskFemConstraintTransform : public TaskFemConstraint
Q_OBJECT
public:
TaskFemConstraintTransform(ViewProviderFemConstraintTransform *ConstraintView,QWidget *parent = 0);
TaskFemConstraintTransform(ViewProviderFemConstraintTransform *ConstraintView,QWidget *parent = nullptr);
~TaskFemConstraintTransform();
const std::string getReferences() const;
double get_X_rot()const;

View File

@@ -48,7 +48,7 @@ class TaskObjectName : public Gui::TaskView::TaskBox
Q_OBJECT
public:
TaskObjectName(App::DocumentObject *pcObject,QWidget *parent = 0);
TaskObjectName(App::DocumentObject *pcObject,QWidget *parent = nullptr);
~TaskObjectName();

View File

@@ -277,7 +277,7 @@ bool TaskDlgPost::accept()
(*it)->applyPythonCode();
}
catch (const Base::Exception& e) {
QMessageBox::warning(NULL, tr("Input error"), QString::fromLatin1(e.what()));
QMessageBox::warning(nullptr, tr("Input error"), QString::fromLatin1(e.what()));
return false;
}
@@ -431,7 +431,7 @@ TaskPostClip::TaskPostClip(ViewProviderDocumentObject* view, App::PropertyLink*
assert(function);
Q_UNUSED(function)
fwidget = NULL;
fwidget = nullptr;
//we load the views widget
proxy = new QWidget(this);
@@ -509,14 +509,14 @@ void TaskPostClip::on_FunctionBox_currentIndexChanged(int idx) {
if(idx>=0)
static_cast<Fem::FemPostClipFilter*>(getObject())->Function.setValue(funcs[idx]);
else
static_cast<Fem::FemPostClipFilter*>(getObject())->Function.setValue(NULL);
static_cast<Fem::FemPostClipFilter*>(getObject())->Function.setValue(nullptr);
}
}
//load the correct view
Fem::FemPostFunction* fobj = static_cast<Fem::FemPostFunction*>(
static_cast<Fem::FemPostClipFilter*>(getObject())->Function.getValue());
Gui::ViewProvider* view = NULL;
Gui::ViewProvider* view = nullptr;
if(fobj)
view = Gui::Application::Instance->activeDocument()->getViewProvider(fobj);
@@ -704,7 +704,7 @@ void TaskPostDataAlongLine::pointCallback(void * ud, SoEventCallback * n)
if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) {
const SoPickedPoint * point = n->getPickedPoint();
if (point == NULL) {
if (point == nullptr) {
Base::Console().Message("No point picked.\n");
return;
}
@@ -880,7 +880,7 @@ void TaskPostDataAtPoint::pointCallback(void * ud, SoEventCallback * n)
if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) {
const SoPickedPoint * point = n->getPickedPoint();
if (point == NULL) {
if (point == nullptr) {
Base::Console().Message("No point picked.\n");
return;
}
@@ -1183,7 +1183,7 @@ TaskPostCut::TaskPostCut(ViewProviderDocumentObject* view, App::PropertyLink* fu
assert(function);
Q_UNUSED(function)
fwidget = NULL;
fwidget = nullptr;
//we load the views widget
proxy = new QWidget(this);
@@ -1257,14 +1257,14 @@ void TaskPostCut::on_FunctionBox_currentIndexChanged(int idx) {
if(idx>=0)
static_cast<Fem::FemPostCutFilter*>(getObject())->Function.setValue(funcs[idx]);
else
static_cast<Fem::FemPostCutFilter*>(getObject())->Function.setValue(NULL);
static_cast<Fem::FemPostCutFilter*>(getObject())->Function.setValue(nullptr);
}
}
//load the correct view
Fem::FemPostFunction* fobj = static_cast<Fem::FemPostFunction*>(
static_cast<Fem::FemPostCutFilter*>(getObject())->Function.getValue());
Gui::ViewProvider* view = NULL;
Gui::ViewProvider* view = nullptr;
if(fobj)
view = Gui::Application::Instance->activeDocument()->getViewProvider(fobj);

View File

@@ -133,7 +133,7 @@ class TaskPostBox : public Gui::TaskView::TaskBox {
Q_OBJECT
public:
TaskPostBox(Gui::ViewProviderDocumentObject* view, const QPixmap &icon, const QString &title, QWidget *parent = 0);
TaskPostBox(Gui::ViewProviderDocumentObject* view, const QPixmap &icon, const QString &title, QWidget *parent = nullptr);
~TaskPostBox();
virtual void applyPythonCode() = 0;
@@ -197,7 +197,7 @@ class TaskPostDisplay : public TaskPostBox
Q_OBJECT
public:
TaskPostDisplay(Gui::ViewProviderDocumentObject* view, QWidget *parent = 0);
TaskPostDisplay(Gui::ViewProviderDocumentObject* view, QWidget *parent = nullptr);
~TaskPostDisplay();
virtual void applyPythonCode();
@@ -219,7 +219,7 @@ class TaskPostFunction : public TaskPostBox {
Q_OBJECT
public:
TaskPostFunction(Gui::ViewProviderDocumentObject* view, QWidget* parent = 0);
TaskPostFunction(Gui::ViewProviderDocumentObject* view, QWidget* parent = nullptr);
virtual ~TaskPostFunction();
virtual void applyPythonCode();
@@ -230,7 +230,7 @@ class TaskPostClip : public TaskPostBox {
Q_OBJECT
public:
TaskPostClip(Gui::ViewProviderDocumentObject* view, App::PropertyLink* function, QWidget* parent = 0);
TaskPostClip(Gui::ViewProviderDocumentObject* view, App::PropertyLink* function, QWidget* parent = nullptr);
virtual ~TaskPostClip();
virtual void applyPythonCode();
@@ -255,7 +255,7 @@ class TaskPostDataAlongLine: public TaskPostBox {
Q_OBJECT
public:
TaskPostDataAlongLine(Gui::ViewProviderDocumentObject* view, QWidget* parent = 0);
TaskPostDataAlongLine(Gui::ViewProviderDocumentObject* view, QWidget* parent = nullptr);
virtual ~TaskPostDataAlongLine();
virtual void applyPythonCode();
@@ -285,7 +285,7 @@ class TaskPostDataAtPoint: public TaskPostBox {
Q_OBJECT
public:
TaskPostDataAtPoint(Gui::ViewProviderDocumentObject* view, QWidget* parent = 0);
TaskPostDataAtPoint(Gui::ViewProviderDocumentObject* view, QWidget* parent = nullptr);
virtual ~TaskPostDataAtPoint();
virtual void applyPythonCode();
@@ -309,7 +309,7 @@ class TaskPostScalarClip : public TaskPostBox {
Q_OBJECT
public:
TaskPostScalarClip(Gui::ViewProviderDocumentObject* view, QWidget* parent = 0);
TaskPostScalarClip(Gui::ViewProviderDocumentObject* view, QWidget* parent = nullptr);
virtual ~TaskPostScalarClip();
virtual void applyPythonCode();
@@ -330,7 +330,7 @@ class TaskPostWarpVector : public TaskPostBox {
Q_OBJECT
public:
TaskPostWarpVector(Gui::ViewProviderDocumentObject* view, QWidget* parent = 0);
TaskPostWarpVector(Gui::ViewProviderDocumentObject* view, QWidget* parent = nullptr);
virtual ~TaskPostWarpVector();
virtual void applyPythonCode();
@@ -354,7 +354,7 @@ class TaskPostCut : public TaskPostBox {
Q_OBJECT
public:
TaskPostCut(Gui::ViewProviderDocumentObject* view, App::PropertyLink* function, QWidget* parent = 0);
TaskPostCut(Gui::ViewProviderDocumentObject* view, App::PropertyLink* function, QWidget* parent = nullptr);
virtual ~TaskPostCut();
virtual void applyPythonCode();

View File

@@ -55,7 +55,7 @@ class TaskTetParameter : public Gui::TaskView::TaskBox
Q_OBJECT
public:
TaskTetParameter(Fem::FemMeshShapeNetgenObject *pcObject,QWidget *parent = 0);
TaskTetParameter(Fem::FemMeshShapeNetgenObject *pcObject,QWidget *parent = nullptr);
~TaskTetParameter();
void setInfo(void);

View File

@@ -90,9 +90,9 @@ ViewProviderFemConstraint::ViewProviderFemConstraint()
FontSize.touch();
FaceColor.touch();
wizardWidget = NULL;
wizardSubLayout = NULL;
constraintDialog = NULL;
wizardWidget = nullptr;
wizardSubLayout = nullptr;
constraintDialog = nullptr;
}
ViewProviderFemConstraint::~ViewProviderFemConstraint()
@@ -197,11 +197,11 @@ void ViewProviderFemConstraint::unsetEdit(int ModNum)
// clear the selection (convenience)
Gui::Selection().clearSelection();
if ((wizardWidget != NULL) && (wizardSubLayout != NULL) && (constraintDialog != NULL)) {
wizardWidget = NULL;
wizardSubLayout = NULL;
if ((wizardWidget != nullptr) && (wizardSubLayout != nullptr) && (constraintDialog != nullptr)) {
wizardWidget = nullptr;
wizardSubLayout = nullptr;
delete constraintDialog;
constraintDialog = NULL;
constraintDialog = nullptr;
// Notify the Shaft Wizard that we have finished editing
// See WizardShaft.py on why we do it this way
@@ -489,34 +489,34 @@ QObject* ViewProviderFemConstraint::findChildByName(const QObject* parent, const
return *o;
if (!(*o)->children().empty()) {
QObject* result = findChildByName(*o, name);
if (result != NULL)
if (result != nullptr)
return result;
}
}
return NULL;
return nullptr;
}
void ViewProviderFemConstraint::checkForWizard()
{
wizardWidget= NULL;
wizardSubLayout = NULL;
wizardWidget= nullptr;
wizardSubLayout = nullptr;
Gui::MainWindow* mw = Gui::getMainWindow();
if (mw == NULL) return;
if (mw == nullptr) return;
QDockWidget* dw = mw->findChild<QDockWidget*>(QString::fromLatin1("Combo View"));
if (dw == NULL) return;
if (dw == nullptr) return;
QWidget* cw = dw->findChild<QWidget*>(QString::fromLatin1("Combo View"));
if (cw == NULL) return;
if (cw == nullptr) return;
QTabWidget* tw = cw->findChild<QTabWidget*>(QString::fromLatin1("combiTab"));
if (tw == NULL) return;
if (tw == nullptr) return;
QStackedWidget* sw = tw->findChild<QStackedWidget*>(QString::fromLatin1("qt_tabwidget_stackedwidget"));
if (sw == NULL) return;
if (sw == nullptr) return;
QScrollArea* sa = sw->findChild<QScrollArea*>();
if (sa== NULL) return;
if (sa== nullptr) return;
QWidget* wd = sa->widget(); // This is the reason why we cannot use findChildByName() right away!!!
if (wd == NULL) return;
if (wd == nullptr) return;
QObject* wiz = findChildByName(wd, QString::fromLatin1("ShaftWizard"));
if (wiz != NULL) {
if (wiz != nullptr) {
wizardWidget = static_cast<QVBoxLayout*>(wiz);
wizardSubLayout = wiz->findChild<QVBoxLayout*>(QString::fromLatin1("ShaftWizardLayout"));
}

View File

@@ -67,11 +67,11 @@ bool ViewProviderFemConstraintBearing::setEdit(int ModNum)
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
TaskDlgFemConstraintBearing *constrDlg = qobject_cast<TaskDlgFemConstraintBearing *>(dlg);
if (constrDlg && constrDlg->getConstraintView() != this)
constrDlg = 0; // another constraint left open its task panel
constrDlg = nullptr; // another constraint left open its task panel
if (dlg && !constrDlg) {
// This case will occur in the ShaftWizard application
checkForWizard();
if ((wizardWidget == NULL) || (wizardSubLayout == NULL)) {
if ((wizardWidget == nullptr) || (wizardSubLayout == nullptr)) {
// No shaft wizard is running
QMessageBox msgBox;
msgBox.setText(QObject::tr("A dialog is already open in the task panel"));
@@ -83,7 +83,7 @@ bool ViewProviderFemConstraintBearing::setEdit(int ModNum)
Gui::Control().reject();
else
return false;
} else if (constraintDialog != NULL) {
} else if (constraintDialog != nullptr) {
// Another FemConstraint* dialog is already open inside the Shaft Wizard
// Ignore the request to open another dialog
return false;

View File

@@ -73,9 +73,9 @@ bool ViewProviderFemConstraintContact::setEdit(int ModNum)
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
TaskDlgFemConstraintContact *constrDlg = qobject_cast<TaskDlgFemConstraintContact *>(dlg);
if (constrDlg && constrDlg->getConstraintView() != this)
constrDlg = 0; // another constraint left open its task panel
constrDlg = nullptr; // another constraint left open its task panel
if (dlg && !constrDlg) {
if (constraintDialog != NULL) {
if (constraintDialog != nullptr) {
// Ignore the request to open another dialog
return false;
} else {

View File

@@ -66,9 +66,9 @@ bool ViewProviderFemConstraintDisplacement::setEdit(int ModNum)
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
TaskDlgFemConstraintDisplacement *constrDlg = qobject_cast<TaskDlgFemConstraintDisplacement *>(dlg);
if (constrDlg && constrDlg->getConstraintView() != this)
constrDlg = 0; // another constraint left open its task panel
constrDlg = nullptr; // another constraint left open its task panel
if (dlg && !constrDlg) {
if (constraintDialog != NULL) {
if (constraintDialog != nullptr) {
// Ignore the request to open another dialog
return false;
} else {

View File

@@ -67,11 +67,11 @@ bool ViewProviderFemConstraintFixed::setEdit(int ModNum)
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
TaskDlgFemConstraintFixed *constrDlg = qobject_cast<TaskDlgFemConstraintFixed *>(dlg);
if (constrDlg && constrDlg->getConstraintView() != this)
constrDlg = 0; // another constraint left open its task panel
constrDlg = nullptr; // another constraint left open its task panel
if (dlg && !constrDlg) {
// This case will occur in the ShaftWizard application
checkForWizard();
if ((wizardWidget == NULL) || (wizardSubLayout == NULL)) {
if ((wizardWidget == nullptr) || (wizardSubLayout == nullptr)) {
// No shaft wizard is running
QMessageBox msgBox;
msgBox.setText(QObject::tr("A dialog is already open in the task panel"));
@@ -83,7 +83,7 @@ bool ViewProviderFemConstraintFixed::setEdit(int ModNum)
Gui::Control().reject();
else
return false;
} else if (constraintDialog != NULL) {
} else if (constraintDialog != nullptr) {
// Another FemConstraint* dialog is already open inside the Shaft Wizard
// Ignore the request to open another dialog
return false;

View File

@@ -65,11 +65,11 @@ bool ViewProviderFemConstraintFluidBoundary::setEdit(int ModNum)
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
TaskDlgFemConstraintFluidBoundary *constrDlg = qobject_cast<TaskDlgFemConstraintFluidBoundary *>(dlg);
if (constrDlg && constrDlg->getConstraintView() != this)
constrDlg = 0; // another constraint left open its task panel
constrDlg = nullptr; // another constraint left open its task panel
if (dlg && !constrDlg) {
// This case will occur in the ShaftWizard application
checkForWizard();
if ((wizardWidget == NULL) || (wizardSubLayout == NULL)) {
if ((wizardWidget == nullptr) || (wizardSubLayout == nullptr)) {
// No shaft wizard is running
QMessageBox msgBox;
msgBox.setText(QObject::tr("A dialog is already open in the task panel"));
@@ -81,7 +81,7 @@ bool ViewProviderFemConstraintFluidBoundary::setEdit(int ModNum)
Gui::Control().reject();
else
return false;
} else if (constraintDialog != NULL) {
} else if (constraintDialog != nullptr) {
// Another FemConstraint* dialog is already open inside the Shaft Wizard
// Ignore the request to open another dialog
return false;

View File

@@ -66,11 +66,11 @@ bool ViewProviderFemConstraintForce::setEdit(int ModNum)
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
TaskDlgFemConstraintForce *constrDlg = qobject_cast<TaskDlgFemConstraintForce *>(dlg);
if (constrDlg && constrDlg->getConstraintView() != this)
constrDlg = 0; // another constraint left open its task panel
constrDlg = nullptr; // another constraint left open its task panel
if (dlg && !constrDlg) {
// This case will occur in the ShaftWizard application
checkForWizard();
if ((wizardWidget == NULL) || (wizardSubLayout == NULL)) {
if ((wizardWidget == nullptr) || (wizardSubLayout == nullptr)) {
// No shaft wizard is running
QMessageBox msgBox;
msgBox.setText(QObject::tr("A dialog is already open in the task panel"));
@@ -82,7 +82,7 @@ bool ViewProviderFemConstraintForce::setEdit(int ModNum)
Gui::Control().reject();
else
return false;
} else if (constraintDialog != NULL) {
} else if (constraintDialog != nullptr) {
// Another FemConstraint* dialog is already open inside the Shaft Wizard
// Ignore the request to open another dialog
return false;

View File

@@ -66,11 +66,11 @@ bool ViewProviderFemConstraintGear::setEdit(int ModNum)
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
TaskDlgFemConstraintGear *constrDlg = qobject_cast<TaskDlgFemConstraintGear *>(dlg);
if (constrDlg && constrDlg->getConstraintView() != this)
constrDlg = 0; // another constraint left open its task panel
constrDlg = nullptr; // another constraint left open its task panel
if (dlg && !constrDlg) {
// This case will occur in the ShaftWizard application
checkForWizard();
if ((wizardWidget == NULL) || (wizardSubLayout == NULL)) {
if ((wizardWidget == nullptr) || (wizardSubLayout == nullptr)) {
// No shaft wizard is running
QMessageBox msgBox;
msgBox.setText(QObject::tr("A dialog is already open in the task panel"));
@@ -82,7 +82,7 @@ bool ViewProviderFemConstraintGear::setEdit(int ModNum)
Gui::Control().reject();
else
return false;
} else if (constraintDialog != NULL) {
} else if (constraintDialog != nullptr) {
// Another FemConstraint* dialog is already open inside the Shaft Wizard
// Ignore the request to open another dialog
return false;

View File

@@ -72,9 +72,9 @@ bool ViewProviderFemConstraintHeatflux::setEdit(int ModNum)
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
TaskDlgFemConstraintHeatflux *constrDlg = qobject_cast<TaskDlgFemConstraintHeatflux *>(dlg);
if (constrDlg && constrDlg->getConstraintView() != this)
constrDlg = 0; // another constraint left open its task panel
constrDlg = nullptr; // another constraint left open its task panel
if (dlg && !constrDlg) {
if (constraintDialog != NULL) {
if (constraintDialog != nullptr) {
// Ignore the request to open another dialog
return false;
} else {

View File

@@ -72,9 +72,9 @@ bool ViewProviderFemConstraintInitialTemperature::setEdit(int ModNum)
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
TaskDlgFemConstraintInitialTemperature *constrDlg = qobject_cast<TaskDlgFemConstraintInitialTemperature *>(dlg);
if (constrDlg && constrDlg->getConstraintView() != this)
constrDlg = 0; // another constraint left open its task panel
constrDlg = nullptr; // another constraint left open its task panel
if (dlg && !constrDlg) {
if (constraintDialog != NULL) {
if (constraintDialog != nullptr) {
// Ignore the request to open another dialog
return false;
} else {

View File

@@ -74,9 +74,9 @@ bool ViewProviderFemConstraintPlaneRotation::setEdit(int ModNum)
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
TaskDlgFemConstraintPlaneRotation *constrDlg = qobject_cast<TaskDlgFemConstraintPlaneRotation *>(dlg);
if (constrDlg && constrDlg->getConstraintView() != this)
constrDlg = 0; // another constraint left open its task panel
constrDlg = nullptr; // another constraint left open its task panel
if (dlg && !constrDlg) {
if (constraintDialog != NULL) {
if (constraintDialog != nullptr) {
// Ignore the request to open another dialog
return false;
} else {

View File

@@ -64,9 +64,9 @@ bool ViewProviderFemConstraintPressure::setEdit(int ModNum)
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
TaskDlgFemConstraintPressure *constrDlg = qobject_cast<TaskDlgFemConstraintPressure *>(dlg);
if (constrDlg && constrDlg->getConstraintView() != this)
constrDlg = 0; // another constraint left open its task panel
constrDlg = nullptr; // another constraint left open its task panel
if (dlg && !constrDlg) {
if (constraintDialog != NULL) {
if (constraintDialog != nullptr) {
// Ignore the request to open another dialog
return false;
} else {

View File

@@ -65,11 +65,11 @@ bool ViewProviderFemConstraintPulley::setEdit(int ModNum)
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
TaskDlgFemConstraintPulley *constrDlg = qobject_cast<TaskDlgFemConstraintPulley *>(dlg);
if (constrDlg && constrDlg->getConstraintView() != this)
constrDlg = 0; // another constraint left open its task panel
constrDlg = nullptr; // another constraint left open its task panel
if (dlg && !constrDlg) {
// This case will occur in the ShaftWizard application
checkForWizard();
if ((wizardWidget == NULL) || (wizardSubLayout == NULL)) {
if ((wizardWidget == nullptr) || (wizardSubLayout == nullptr)) {
// No shaft wizard is running
QMessageBox msgBox;
msgBox.setText(QObject::tr("A dialog is already open in the task panel"));
@@ -81,7 +81,7 @@ bool ViewProviderFemConstraintPulley::setEdit(int ModNum)
Gui::Control().reject();
else
return false;
} else if (constraintDialog != NULL) {
} else if (constraintDialog != nullptr) {
// Another FemConstraint* dialog is already open inside the Shaft Wizard
// Ignore the request to open another dialog
return false;

View File

@@ -64,9 +64,9 @@ bool ViewProviderFemConstraintSpring::setEdit(int ModNum)
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
TaskDlgFemConstraintSpring *constrDlg = qobject_cast<TaskDlgFemConstraintSpring *>(dlg); // check this out too
if (constrDlg && constrDlg->getConstraintView() != this)
constrDlg = 0; // another constraint left open its task panel
constrDlg = nullptr; // another constraint left open its task panel
if (dlg && !constrDlg) {
if (constraintDialog != NULL) {
if (constraintDialog != nullptr) {
// Ignore the request to open another dialog
return false;
} else {

View File

@@ -73,9 +73,9 @@ bool ViewProviderFemConstraintTemperature::setEdit(int ModNum)
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
TaskDlgFemConstraintTemperature *constrDlg = qobject_cast<TaskDlgFemConstraintTemperature *>(dlg);
if (constrDlg && constrDlg->getConstraintView() != this)
constrDlg = 0; // another constraint left open its task panel
constrDlg = nullptr; // another constraint left open its task panel
if (dlg && !constrDlg) {
if (constraintDialog != NULL) {
if (constraintDialog != nullptr) {
// Ignore the request to open another dialog
return false;
} else {

View File

@@ -81,9 +81,9 @@ bool ViewProviderFemConstraintTransform::setEdit(int ModNum)
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
TaskDlgFemConstraintTransform *constrDlg = qobject_cast<TaskDlgFemConstraintTransform *>(dlg);
if (constrDlg && constrDlg->getConstraintView() != this)
constrDlg = 0; // another constraint left open its task panel
constrDlg = nullptr; // another constraint left open its task panel
if (dlg && !constrDlg) {
if (constraintDialog != NULL) {
if (constraintDialog != nullptr) {
// Ignore the request to open another dialog
return false;
} else {

View File

@@ -72,8 +72,8 @@ struct FemFace
}
Base::Vector3d set(short size,const SMDS_MeshElement* element,unsigned short id, short faceNo,
const SMDS_MeshNode* n1,const SMDS_MeshNode* n2,const SMDS_MeshNode* n3,const SMDS_MeshNode* n4=0,
const SMDS_MeshNode* n5=0,const SMDS_MeshNode* n6=0,const SMDS_MeshNode* n7=0,const SMDS_MeshNode* n8=0);
const SMDS_MeshNode* n1,const SMDS_MeshNode* n2,const SMDS_MeshNode* n3,const SMDS_MeshNode* n4=nullptr,
const SMDS_MeshNode* n5=nullptr,const SMDS_MeshNode* n6=nullptr,const SMDS_MeshNode* n7=nullptr,const SMDS_MeshNode* n8=nullptr);
bool isSameFace (FemFace &face);
};
@@ -435,7 +435,7 @@ SoDetail* ViewProviderFemMesh::getDetail(const char* subelement) const
element = element.substr(0,pos);
}
SoDetail* detail = 0;
SoDetail* detail = nullptr;
if (index < 0)
return detail;
if (element == "Elem") {
@@ -668,9 +668,9 @@ void ViewProviderFemMesh::resetColorByElementId(void)
void ViewProviderFEMMeshBuilder::buildNodes(const App::Property* prop, std::vector<SoNode*>& nodes) const
{
SoCoordinate3 *pcPointsCoord=0;
SoIndexedFaceSet *pcFaces=0;
SoIndexedLineSet *pcLines=0;
SoCoordinate3 *pcPointsCoord=nullptr;
SoIndexedFaceSet *pcFaces=nullptr;
SoIndexedLineSet *pcLines=nullptr;
if (nodes.empty()) {
pcPointsCoord = new SoCoordinate3();

View File

@@ -30,7 +30,7 @@ PyObject* ViewProviderFemMeshPy::applyDisplacement(PyObject* args)
{
double factor;
if (!PyArg_ParseTuple(args, "d", &factor))
return 0;
return nullptr;
this->getViewProviderFemMeshPtr()->applyDisplacementToNodes(factor);
@@ -96,7 +96,7 @@ PyObject* ViewProviderFemMeshPy::setNodeColorByScalars(PyObject* args)
}
else {
PyErr_SetString(PyExc_TypeError, "PyArg_ParseTuple failed. Invalid arguments used with setNodeByScalars");
return 0;
return nullptr;
}
Py_Return;
}
@@ -105,7 +105,7 @@ PyObject* ViewProviderFemMeshPy::setNodeColorByScalars(PyObject* args)
PyObject* ViewProviderFemMeshPy::resetNodeColor(PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
this->getViewProviderFemMeshPtr()->resetColorByNodeId();
Py_Return;
}
@@ -135,7 +135,7 @@ PyObject* ViewProviderFemMeshPy::setNodeDisplacementByVectors(PyObject* args)
}
else {
PyErr_SetString(PyExc_TypeError, "PyArg_ParseTuple failed. Invalid arguments used with setNodeDisplacementByVectors");
return 0;
return nullptr;
}
Py_Return;
}
@@ -144,7 +144,7 @@ PyObject* ViewProviderFemMeshPy::setNodeDisplacementByVectors(PyObject* args)
PyObject* ViewProviderFemMeshPy::resetNodeDisplacement(PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
this->getViewProviderFemMeshPtr()->resetDisplacementByNodeId();
Py_Return;
}
@@ -276,7 +276,7 @@ void ViewProviderFemMeshPy::setHighlightedNodes(Py::List arg)
PyObject* ViewProviderFemMeshPy::resetHighlightedNodes(PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
this->getViewProviderFemMeshPtr()->resetHighlightNodes();
Py_Return;
}
@@ -320,7 +320,7 @@ Py::List ViewProviderFemMeshPy::getVisibleElementFaces(void) const
PyObject* ViewProviderFemMeshPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}

View File

@@ -272,7 +272,7 @@ bool ViewProviderFemPostFunction::setEdit(int ModNum) {
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
TaskDlgPost *postDlg = qobject_cast<TaskDlgPost*>(dlg);
if (postDlg && postDlg->getView() != this)
postDlg = 0; // another pad left open its task panel
postDlg = nullptr; // another pad left open its task panel
if (dlg && !postDlg) {
QMessageBox msgBox;
msgBox.setText(QObject::tr("A dialog is already open in the task panel"));

View File

@@ -48,7 +48,7 @@ class FemGuiExport FunctionWidget : public QWidget {
Q_OBJECT
public:
FunctionWidget() : m_block(false), m_view(0), m_object(0) {}
FunctionWidget() : m_block(false), m_view(nullptr), m_object(nullptr) {}
virtual ~FunctionWidget() {}
virtual void applyPythonCode() = 0;
@@ -111,7 +111,7 @@ public:
//creates the widget used in the task dalogs, either for the function itself or for
//the filter using it
virtual FunctionWidget* createControlWidget() {return NULL;}
virtual FunctionWidget* createControlWidget() {return nullptr;}
protected:
virtual bool setEdit(int ModNum);

View File

@@ -317,11 +317,11 @@ void ViewProviderFemPostObject::update3D() {
vtkPointData *pntData;
vtkPoints *points;
vtkDataArray *normals = NULL;
vtkDataArray *tcoords = NULL;
vtkDataArray *normals = nullptr;
vtkDataArray *tcoords = nullptr;
vtkCellArray *cells;
vtkIdType npts = 0;
vtkIdTypePtr indx = 0;
vtkIdTypePtr indx = nullptr;
points = pd->GetPoints();
pntData = pd->GetPointData();
@@ -581,7 +581,7 @@ bool ViewProviderFemPostObject::setEdit(int ModNum) {
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
TaskDlgPost *postDlg = qobject_cast<TaskDlgPost*>(dlg);
if (postDlg && postDlg->getView() != this)
postDlg = 0; // another pad left open its task panel
postDlg = nullptr; // another pad left open its task panel
if (dlg && !postDlg) {
QMessageBox msgBox;
msgBox.setText(QObject::tr("A dialog is already open in the task panel"));