Mesh: modernize C++11

* remove redundant void-arg
* use nullptr
* replace deprecated headers
This commit is contained in:
wmayer
2022-01-26 18:05:02 +01:00
parent 213311524e
commit 59e605e6b8
88 changed files with 651 additions and 651 deletions

View File

@@ -92,10 +92,10 @@ class MeshExport MeshInput
{
public:
MeshInput (MeshKernel &rclM)
: _rclMesh(rclM), _material(0){}
: _rclMesh(rclM), _material(nullptr){}
MeshInput (MeshKernel &rclM, Material* m)
: _rclMesh(rclM), _material(m){}
virtual ~MeshInput (void) { }
virtual ~MeshInput () { }
const std::vector<std::string>& GetGroupNames() const {
return _groupNames;
}
@@ -150,10 +150,10 @@ class MeshExport MeshOutput
{
public:
MeshOutput (const MeshKernel &rclM)
: _rclMesh(rclM), _material(0), apply_transform(false){}
: _rclMesh(rclM), _material(nullptr), apply_transform(false){}
MeshOutput (const MeshKernel &rclM, const Material* m)
: _rclMesh(rclM), _material(m), apply_transform(false){}
virtual ~MeshOutput (void) { }
virtual ~MeshOutput () { }
void SetObjectName(const std::string& n)
{ objectName = n; }
void SetGroups(const std::vector<Group>& g) {

View File

@@ -25,6 +25,7 @@
#define VISITOR_H
#include "Definitions.h"
#include <Mod/Mesh/MeshGlobal.h>
namespace MeshCore {
@@ -42,9 +43,9 @@ class MeshExport MeshFacetVisitor
{
public:
/// Construction
MeshFacetVisitor(void) { }
MeshFacetVisitor() { }
/// Denstruction
virtual ~MeshFacetVisitor(void) { }
virtual ~MeshFacetVisitor() { }
/** Needs to be implemented in sub-classes.
* \a rclFacet is the currently visited facet with the index \a ulFInd, \a rclFrom
* is the last visited facet and \a ulLevel indicates the ring number around the start facet.
@@ -173,9 +174,9 @@ class MeshExport MeshPointVisitor
{
public:
/// Construction
MeshPointVisitor(void) { }
MeshPointVisitor() { }
/// Denstruction
virtual ~MeshPointVisitor(void) { }
virtual ~MeshPointVisitor() { }
/** Needs to be implemented in sub-classes.
* \a rclPoint is the currently visited point with the index \a ulPInd, \a rclFrom
* is the last visited point and \a ulLevel indicates the ring number around the start point.

View File

@@ -43,9 +43,9 @@ using namespace Mesh;
PROPERTY_SOURCE(Mesh::Curvature, App::DocumentObject)
Curvature::Curvature(void)
Curvature::Curvature()
{
ADD_PROPERTY(Source,(0));
ADD_PROPERTY(Source,(nullptr));
ADD_PROPERTY(CurvInfo, (CurvatureInfo()));
}
@@ -58,7 +58,7 @@ short Curvature::mustExecute() const
return 0;
}
App::DocumentObjectExecReturn *Curvature::execute(void)
App::DocumentObjectExecReturn *Curvature::execute()
{
Mesh::Feature *pcFeat = dynamic_cast<Mesh::Feature*>(Source.getValue());
if(!pcFeat || pcFeat->isError()) {

View File

@@ -51,10 +51,10 @@ public:
/** @name methods override Feature */
//@{
/// recalculate the Feature
App::DocumentObjectExecReturn *execute(void);
App::DocumentObjectExecReturn *execute();
short mustExecute() const;
/// returns the type name of the ViewProvider
const char* getViewProviderName(void) const {
const char* getViewProviderName() const {
return "MeshGui::ViewProviderMeshCurvature";
}
//@}

View File

@@ -44,7 +44,7 @@ PROPERTY_SOURCE(Mesh::FixDefects, Mesh::Feature)
FixDefects::FixDefects()
{
ADD_PROPERTY(Source ,(0));
ADD_PROPERTY(Source ,(nullptr));
ADD_PROPERTY(Epsilon ,(0));
}
@@ -59,7 +59,7 @@ short FixDefects::mustExecute() const
return 0;
}
App::DocumentObjectExecReturn *FixDefects::execute(void)
App::DocumentObjectExecReturn *FixDefects::execute()
{
return App::DocumentObject::StdReturn;
}
@@ -76,7 +76,7 @@ HarmonizeNormals::~HarmonizeNormals()
{
}
App::DocumentObjectExecReturn *HarmonizeNormals::execute(void)
App::DocumentObjectExecReturn *HarmonizeNormals::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
@@ -104,7 +104,7 @@ FlipNormals::~FlipNormals()
{
}
App::DocumentObjectExecReturn *FlipNormals::execute(void)
App::DocumentObjectExecReturn *FlipNormals::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
@@ -132,7 +132,7 @@ FixNonManifolds::~FixNonManifolds()
{
}
App::DocumentObjectExecReturn *FixNonManifolds::execute(void)
App::DocumentObjectExecReturn *FixNonManifolds::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
@@ -160,7 +160,7 @@ FixDuplicatedFaces::~FixDuplicatedFaces()
{
}
App::DocumentObjectExecReturn *FixDuplicatedFaces::execute(void)
App::DocumentObjectExecReturn *FixDuplicatedFaces::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
@@ -188,7 +188,7 @@ FixDuplicatedPoints::~FixDuplicatedPoints()
{
}
App::DocumentObjectExecReturn *FixDuplicatedPoints::execute(void)
App::DocumentObjectExecReturn *FixDuplicatedPoints::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
@@ -216,7 +216,7 @@ FixDegenerations::~FixDegenerations()
{
}
App::DocumentObjectExecReturn *FixDegenerations::execute(void)
App::DocumentObjectExecReturn *FixDegenerations::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
@@ -245,7 +245,7 @@ FixDeformations::~FixDeformations()
{
}
App::DocumentObjectExecReturn *FixDeformations::execute(void)
App::DocumentObjectExecReturn *FixDeformations::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
@@ -275,7 +275,7 @@ FixIndices::~FixIndices()
{
}
App::DocumentObjectExecReturn *FixIndices::execute(void)
App::DocumentObjectExecReturn *FixIndices::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
@@ -305,7 +305,7 @@ FillHoles::~FillHoles()
{
}
App::DocumentObjectExecReturn *FillHoles::execute(void)
App::DocumentObjectExecReturn *FillHoles::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
@@ -336,7 +336,7 @@ RemoveComponents::~RemoveComponents()
{
}
App::DocumentObjectExecReturn *RemoveComponents::execute(void)
App::DocumentObjectExecReturn *RemoveComponents::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");

View File

@@ -41,7 +41,7 @@ class MeshExport FixDefects : public Mesh::Feature
public:
/// Constructor
FixDefects(void);
FixDefects();
virtual ~FixDefects();
/** @name Properties */
@@ -53,7 +53,7 @@ public:
/** @name methods override Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
virtual App::DocumentObjectExecReturn *execute();
short mustExecute() const;
//@}
@@ -71,13 +71,13 @@ class MeshExport HarmonizeNormals : public Mesh::FixDefects
public:
/// Constructor
HarmonizeNormals(void);
HarmonizeNormals();
virtual ~HarmonizeNormals();
/** @name methods override Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
virtual App::DocumentObjectExecReturn *execute();
//@}
};
@@ -91,13 +91,13 @@ class MeshExport FlipNormals : public Mesh::FixDefects
public:
/// Constructor
FlipNormals(void);
FlipNormals();
virtual ~FlipNormals();
/** @name methods override Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
virtual App::DocumentObjectExecReturn *execute();
//@}
};
@@ -111,13 +111,13 @@ class MeshExport FixNonManifolds : public Mesh::FixDefects
public:
/// Constructor
FixNonManifolds(void);
FixNonManifolds();
virtual ~FixNonManifolds();
/** @name methods override Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
virtual App::DocumentObjectExecReturn *execute();
//@}
};
@@ -131,13 +131,13 @@ class MeshExport FixDuplicatedFaces : public Mesh::FixDefects
public:
/// Constructor
FixDuplicatedFaces(void);
FixDuplicatedFaces();
virtual ~FixDuplicatedFaces();
/** @name methods override Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
virtual App::DocumentObjectExecReturn *execute();
//@}
};
@@ -151,13 +151,13 @@ class MeshExport FixDuplicatedPoints : public Mesh::FixDefects
public:
/// Constructor
FixDuplicatedPoints(void);
FixDuplicatedPoints();
virtual ~FixDuplicatedPoints();
/** @name methods override Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
virtual App::DocumentObjectExecReturn *execute();
//@}
};
@@ -171,13 +171,13 @@ class MeshExport FixDegenerations : public Mesh::FixDefects
public:
/// Constructor
FixDegenerations(void);
FixDegenerations();
virtual ~FixDegenerations();
/** @name methods override Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
virtual App::DocumentObjectExecReturn *execute();
//@}
};
@@ -191,7 +191,7 @@ class MeshExport FixDeformations : public Mesh::FixDefects
public:
/// Constructor
FixDeformations(void);
FixDeformations();
virtual ~FixDeformations();
/** @name Properties */
@@ -201,7 +201,7 @@ public:
/** @name methods override Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
virtual App::DocumentObjectExecReturn *execute();
//@}
};
@@ -215,13 +215,13 @@ class MeshExport FixIndices : public Mesh::FixDefects
public:
/// Constructor
FixIndices(void);
FixIndices();
virtual ~FixIndices();
/** @name methods override Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
virtual App::DocumentObjectExecReturn *execute();
//@}
};
@@ -235,7 +235,7 @@ class MeshExport FillHoles : public Mesh::FixDefects
public:
/// Constructor
FillHoles(void);
FillHoles();
virtual ~FillHoles();
App::PropertyInteger FillupHolesOfLength;
App::PropertyFloat MaxArea;
@@ -243,7 +243,7 @@ public:
/** @name methods override Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
virtual App::DocumentObjectExecReturn *execute();
//@}
};
@@ -257,14 +257,14 @@ class MeshExport RemoveComponents : public Mesh::FixDefects
public:
/// Constructor
RemoveComponents(void);
RemoveComponents();
virtual ~RemoveComponents();
App::PropertyInteger RemoveCompOfSize;
/** @name methods override Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
virtual App::DocumentObjectExecReturn *execute();
//@}
};

View File

@@ -39,9 +39,9 @@ using namespace MeshCore;
PROPERTY_SOURCE(Mesh::Export, App::DocumentObject)
Export::Export(void)
Export::Export()
{
ADD_PROPERTY(Source ,(0));
ADD_PROPERTY(Source ,(nullptr));
ADD_PROPERTY(FileName,(""));
ADD_PROPERTY(Format ,(""));
}
@@ -59,7 +59,7 @@ short Export::mustExecute() const
return 0;
}
App::DocumentObjectExecReturn *Export::execute(void)
App::DocumentObjectExecReturn *Export::execute()
{
Mesh::Feature *pcFeat = dynamic_cast<Mesh::Feature*>(Source.getValue());
if(!pcFeat || pcFeat->isError()) {

View File

@@ -48,14 +48,14 @@ public:
App::PropertyLink Source;
App::PropertyString FileName;
App::PropertyString Format;
const char* getViewProviderName(void) const {
const char* getViewProviderName() const {
return "MeshGui::ViewProviderExport";
}
/** @name methods override feature */
//@{
/// recalculate the Feature
App::DocumentObjectExecReturn *execute(void);
App::DocumentObjectExecReturn *execute();
short mustExecute() const;
//@}
};

View File

@@ -39,19 +39,19 @@ using namespace MeshCore;
PROPERTY_SOURCE(Mesh::Import, Mesh::Feature)
Mesh::Import::Import(void)
Mesh::Import::Import()
{
ADD_PROPERTY(FileName,(""));
}
short Mesh::Import::mustExecute(void) const
short Mesh::Import::mustExecute() const
{
if (FileName.isTouched())
return 1;
return 0;
}
App::DocumentObjectExecReturn *Mesh::Import::execute(void)
App::DocumentObjectExecReturn *Mesh::Import::execute()
{
std::unique_ptr<MeshObject> apcKernel(new MeshObject());
apcKernel->load(FileName.getValue());

View File

@@ -49,8 +49,8 @@ public:
/** @name methods override Feature */
//@{
/// recalculate the Feature
App::DocumentObjectExecReturn *execute(void);
short mustExecute(void) const;
App::DocumentObjectExecReturn *execute();
short mustExecute() const;
//@}
};

View File

@@ -46,10 +46,10 @@ using namespace std;
PROPERTY_SOURCE(Mesh::SetOperations, Mesh::Feature)
SetOperations::SetOperations(void)
SetOperations::SetOperations()
{
ADD_PROPERTY(Source1 ,(0));
ADD_PROPERTY(Source2 ,(0));
ADD_PROPERTY(Source1 ,(nullptr));
ADD_PROPERTY(Source2 ,(nullptr));
ADD_PROPERTY(OperationType, ("union"));
}
@@ -67,12 +67,12 @@ short SetOperations::mustExecute() const
return 0;
}
App::DocumentObjectExecReturn *SetOperations::execute(void)
App::DocumentObjectExecReturn *SetOperations::execute()
{
Mesh::Feature *mesh1 = dynamic_cast<Mesh::Feature*>(Source1.getValue());
Mesh::Feature *mesh2 = dynamic_cast<Mesh::Feature*>(Source2.getValue());
if ((mesh1 != NULL) && (mesh2 != NULL)) {
if ((mesh1 != nullptr) && (mesh2 != nullptr)) {
const MeshObject& meshKernel1 = mesh1->Mesh.getValue();
const MeshObject& meshKernel2 = mesh2->Mesh.getValue();

View File

@@ -54,7 +54,7 @@ public:
/** @name methods override Feature */
//@{
/// recalculate the Feature
App::DocumentObjectExecReturn *execute(void);
App::DocumentObjectExecReturn *execute();
short mustExecute() const;
//@}
};

View File

@@ -44,7 +44,7 @@ using namespace MeshCore;
PROPERTY_SOURCE(Mesh::Sphere, Mesh::Feature)
Sphere::Sphere(void)
Sphere::Sphere()
{
ADD_PROPERTY(Radius ,(5.0));
ADD_PROPERTY(Sampling ,(50));
@@ -59,7 +59,7 @@ short Sphere::mustExecute() const
return Feature::mustExecute();
}
App::DocumentObjectExecReturn *Sphere::execute(void)
App::DocumentObjectExecReturn *Sphere::execute()
{
std::unique_ptr<MeshObject> mesh(MeshObject::createSphere((float)Radius.getValue(),Sampling.getValue()));
if (mesh.get()) {
@@ -88,7 +88,7 @@ void Sphere::handleChangedPropertyType(Base::XMLReader &reader, const char *Type
PROPERTY_SOURCE(Mesh::Ellipsoid, Mesh::Feature)
Ellipsoid::Ellipsoid(void)
Ellipsoid::Ellipsoid()
{
ADD_PROPERTY(Radius1 ,(2.0));
ADD_PROPERTY(Radius2 ,(4.0));
@@ -107,7 +107,7 @@ short Ellipsoid::mustExecute() const
return Feature::mustExecute();
}
App::DocumentObjectExecReturn *Ellipsoid::execute(void)
App::DocumentObjectExecReturn *Ellipsoid::execute()
{
std::unique_ptr<MeshObject> mesh(MeshObject::createEllipsoid((float)Radius1.getValue(),(float)Radius2.getValue(),Sampling.getValue()));
if (mesh.get()) {
@@ -137,7 +137,7 @@ void Ellipsoid::handleChangedPropertyType(Base::XMLReader &reader, const char *T
PROPERTY_SOURCE(Mesh::Cylinder, Mesh::Feature)
Cylinder::Cylinder(void)
Cylinder::Cylinder()
{
ADD_PROPERTY(Radius ,(2.0));
ADD_PROPERTY(Length ,(10.0));
@@ -161,7 +161,7 @@ short Cylinder::mustExecute() const
return Feature::mustExecute();
}
App::DocumentObjectExecReturn *Cylinder::execute(void)
App::DocumentObjectExecReturn *Cylinder::execute()
{
std::unique_ptr<MeshObject> mesh(MeshObject::createCylinder((float)Radius.getValue(),(float)Length.getValue(),
Closed.getValue(),(float)EdgeLength.getValue(),Sampling.getValue()));
@@ -192,7 +192,7 @@ void Cylinder::handleChangedPropertyType(Base::XMLReader &reader, const char *Ty
PROPERTY_SOURCE(Mesh::Cone, Mesh::Feature)
Cone::Cone(void)
Cone::Cone()
{
ADD_PROPERTY(Radius1 ,(2.0));
ADD_PROPERTY(Radius2 ,(4.0));
@@ -219,7 +219,7 @@ short Cone::mustExecute() const
return Feature::mustExecute();
}
App::DocumentObjectExecReturn *Cone::execute(void)
App::DocumentObjectExecReturn *Cone::execute()
{
std::unique_ptr<MeshObject> mesh(MeshObject::createCone((float)Radius1.getValue(),(float)Radius2.getValue(),(float)Length.getValue(),
Closed.getValue(),(float)EdgeLength.getValue(),Sampling.getValue()));
@@ -250,7 +250,7 @@ void Cone::handleChangedPropertyType(Base::XMLReader &reader, const char *TypeNa
PROPERTY_SOURCE(Mesh::Torus, Mesh::Feature)
Torus::Torus(void)
Torus::Torus()
{
ADD_PROPERTY(Radius1 ,(10.0));
ADD_PROPERTY(Radius2 ,(2.0));
@@ -269,7 +269,7 @@ short Torus::mustExecute() const
return Feature::mustExecute();
}
App::DocumentObjectExecReturn *Torus::execute(void)
App::DocumentObjectExecReturn *Torus::execute()
{
std::unique_ptr<MeshObject> mesh(MeshObject::createTorus((float)Radius1.getValue(),(float)Radius2.getValue(),Sampling.getValue()));
if (mesh.get()) {
@@ -299,7 +299,7 @@ void Torus::handleChangedPropertyType(Base::XMLReader &reader, const char *TypeN
PROPERTY_SOURCE(Mesh::Cube, Mesh::Feature)
Cube::Cube(void)
Cube::Cube()
{
ADD_PROPERTY_TYPE(Length,(10.0f),"Cube",App::Prop_None,"The length of the cube");
ADD_PROPERTY_TYPE(Width ,(10.0f),"Cube",App::Prop_None,"The width of the cube");
@@ -318,7 +318,7 @@ short Cube::mustExecute() const
return Feature::mustExecute();
}
App::DocumentObjectExecReturn *Cube::execute(void)
App::DocumentObjectExecReturn *Cube::execute()
{
std::unique_ptr<MeshObject> mesh(MeshObject::createCube((float)Length.getValue(),(float)Width.getValue(),(float)Height.getValue()));
if (mesh.get()) {

View File

@@ -48,7 +48,7 @@ public:
/** @name methods override Feature */
//@{
/// recalculate the Feature
App::DocumentObjectExecReturn *execute(void);
App::DocumentObjectExecReturn *execute();
short mustExecute() const;
void handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, App::Property * prop);
//@}
@@ -70,7 +70,7 @@ public:
/** @name methods override Feature */
//@{
/// recalculate the Feature
App::DocumentObjectExecReturn *execute(void);
App::DocumentObjectExecReturn *execute();
short mustExecute() const;
void handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, App::Property * prop);
//@}
@@ -94,7 +94,7 @@ public:
/** @name methods override Feature */
//@{
/// recalculate the Feature
App::DocumentObjectExecReturn *execute(void);
App::DocumentObjectExecReturn *execute();
short mustExecute() const;
void handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, App::Property * prop);
//@}
@@ -119,7 +119,7 @@ public:
/** @name methods override Feature */
//@{
/// recalculate the Feature
App::DocumentObjectExecReturn *execute(void);
App::DocumentObjectExecReturn *execute();
short mustExecute() const;
void handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, App::Property * prop);
//@}
@@ -141,7 +141,7 @@ public:
/** @name methods override Feature */
//@{
/// recalculate the Feature
App::DocumentObjectExecReturn *execute(void);
App::DocumentObjectExecReturn *execute();
short mustExecute() const;
void handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, App::Property * prop);
//@}
@@ -163,7 +163,7 @@ public:
/** @name methods override Feature */
//@{
/// recalculate the Feature
App::DocumentObjectExecReturn *execute(void);
App::DocumentObjectExecReturn *execute();
short mustExecute() const;
void handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, App::Property * prop);
//@}

View File

@@ -41,13 +41,13 @@ using namespace MeshCore;
PROPERTY_SOURCE(Mesh::Transform, Mesh::Feature)
Transform::Transform(void)
Transform::Transform()
{
ADD_PROPERTY(Source ,(0));
ADD_PROPERTY(Source ,(nullptr));
ADD_PROPERTY(Position,(Matrix4D()));
}
App::DocumentObjectExecReturn *Transform::execute(void)
App::DocumentObjectExecReturn *Transform::execute()
{
/*
Feature *pcFirst = dynamic_cast<Feature*>(Source.getValue());

View File

@@ -52,9 +52,9 @@ public:
/** @name methods override Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
virtual App::DocumentObjectExecReturn *execute();
/// returns the type name of the ViewProvider
virtual const char* getViewProviderName(void) const {
virtual const char* getViewProviderName() const {
return "MeshGui::ViewProviderMeshTransform";
}
//@}

View File

@@ -42,14 +42,14 @@ using namespace MeshCore;
PROPERTY_SOURCE(Mesh::TransformDemolding, Mesh::Transform)
TransformDemolding::TransformDemolding(void)
TransformDemolding::TransformDemolding()
{
ADD_PROPERTY(Source,(0));
ADD_PROPERTY(Source,(nullptr));
ADD_PROPERTY(Rotation,(0.0));
ADD_PROPERTY(Axis,(0.0,0.0,1.0));
}
App::DocumentObjectExecReturn *TransformDemolding::execute(void)
App::DocumentObjectExecReturn *TransformDemolding::execute()
{/*
Feature *pcFirst = dynamic_cast<Feature*>(Source.getValue());
if(!pcFirst || pcFirst->isError())

View File

@@ -51,9 +51,9 @@ public:
/** @name methods override Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
virtual App::DocumentObjectExecReturn *execute();
/// returns the type name of the ViewProvider
virtual const char* getViewProviderName(void) const {
virtual const char* getViewProviderName() const {
return "MeshGui::ViewProviderMeshTransformDemolding";
}
//@}

View File

@@ -31,7 +31,7 @@
#include <Base/Exception.h>
#include <Base/Reader.h>
#include <Base/Writer.h>
#include <App/FeaturePythonPyImp.h>
#include <App/FeaturePythonPyImp.h>
#include "Core/MeshIO.h"
@@ -56,13 +56,13 @@ Feature::~Feature()
{
}
App::DocumentObjectExecReturn *Feature::execute(void)
App::DocumentObjectExecReturn *Feature::execute()
{
this->Mesh.touch();
return App::DocumentObject::StdReturn;
}
PyObject *Feature::getPyObject(void)
PyObject *Feature::getPyObject()
{
if(PythonObject.is(Py::_None())){
// ref counter is set to 1
@@ -111,10 +111,10 @@ template class MeshExport FeatureCustomT<Mesh::Feature>;
namespace App {
/// @cond DOXERR
PROPERTY_SOURCE_TEMPLATE(Mesh::FeaturePython, Mesh::Feature)
template<> const char* Mesh::FeaturePython::getViewProviderName(void) const {
template<> const char* Mesh::FeaturePython::getViewProviderName() const {
return "MeshGui::ViewProviderPython";
}
template<> PyObject* Mesh::FeaturePython::getPyObject(void) {
template<> PyObject* Mesh::FeaturePython::getPyObject() {
if (PythonObject.is(Py::_None())) {
// ref counter is set to 1
PythonObject = Py::Object(new FeaturePythonPyT<Mesh::MeshFeaturePy>(this),true);

View File

@@ -57,7 +57,7 @@ class MeshExport Feature : public App::GeoFeature
public:
/// Constructor
Feature(void);
Feature();
virtual ~Feature();
/** @name Properties */
@@ -69,12 +69,12 @@ public:
/** @name methods override Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
virtual App::DocumentObjectExecReturn *execute();
virtual void onChanged(const App::Property* prop);
//@}
/// returns the type name of the ViewProvider
virtual const char* getViewProviderName(void) const {
virtual const char* getViewProviderName() const {
return "MeshGui::ViewProviderMeshFaceSet";
}
virtual const App::PropertyComplexGeoData* getPropertyOfGeometry() const {
@@ -82,7 +82,7 @@ public:
}
/// handles the MeshPy object
virtual PyObject* getPyObject(void);
virtual PyObject* getPyObject();
};
typedef App::FeatureCustomT<Feature> FeatureCustom;

View File

@@ -37,7 +37,7 @@ using namespace Mesh;
// returns a string which represent the object e.g. when printed in python
std::string MeshFeaturePy::representation(void) const
std::string MeshFeaturePy::representation() const
{
std::stringstream str;
str << getFeaturePtr()->getTypeId().getName() << " object at " << getFeaturePtr();
@@ -58,7 +58,7 @@ PyObject* MeshFeaturePy::countFacets(PyObject * /*args*/)
PyObject* MeshFeaturePy::harmonizeNormals(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
PY_TRY {
Mesh::MeshObject *mesh = getFeaturePtr()->Mesh.startEditing();
@@ -74,7 +74,7 @@ PyObject* MeshFeaturePy::smooth(PyObject *args)
int iter=1;
float d_max=FLOAT_MAX;
if (!PyArg_ParseTuple(args, "|if", &iter,&d_max))
return NULL;
return nullptr;
PY_TRY {
Mesh::Feature* obj = getFeaturePtr();
@@ -89,7 +89,7 @@ PyObject* MeshFeaturePy::smooth(PyObject *args)
PyObject* MeshFeaturePy::removeNonManifolds(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
Mesh::Feature* obj = getFeaturePtr();
MeshObject* kernel = obj->Mesh.startEditing();
kernel->removeNonManifolds();
@@ -100,7 +100,7 @@ PyObject* MeshFeaturePy::removeNonManifolds(PyObject *args)
PyObject* MeshFeaturePy::removeNonManifoldPoints(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
Mesh::Feature* obj = getFeaturePtr();
MeshObject* kernel = obj->Mesh.startEditing();
kernel->removeNonManifoldPoints();
@@ -111,7 +111,7 @@ PyObject* MeshFeaturePy::removeNonManifoldPoints(PyObject *args)
PyObject* MeshFeaturePy::fixIndices(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
PY_TRY {
Mesh::Feature* obj = getFeaturePtr();
@@ -127,7 +127,7 @@ PyObject* MeshFeaturePy::fixDegenerations(PyObject *args)
{
float fEpsilon = MeshCore::MeshDefinitions::_fMinPointDistanceP2;
if (!PyArg_ParseTuple(args, "|f", &fEpsilon))
return NULL;
return nullptr;
PY_TRY {
Mesh::Feature* obj = getFeaturePtr();
@@ -142,7 +142,7 @@ PyObject* MeshFeaturePy::fixDegenerations(PyObject *args)
PyObject* MeshFeaturePy::removeDuplicatedFacets(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
PY_TRY {
Mesh::Feature* obj = getFeaturePtr();
@@ -157,7 +157,7 @@ PyObject* MeshFeaturePy::removeDuplicatedFacets(PyObject *args)
PyObject* MeshFeaturePy::removeDuplicatedPoints(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
PY_TRY {
Mesh::Feature* obj = getFeaturePtr();
@@ -172,7 +172,7 @@ PyObject* MeshFeaturePy::removeDuplicatedPoints(PyObject *args)
PyObject* MeshFeaturePy::fixSelfIntersections(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
try {
Mesh::Feature* obj = getFeaturePtr();
MeshObject* kernel = obj->Mesh.startEditing();
@@ -181,7 +181,7 @@ PyObject* MeshFeaturePy::fixSelfIntersections(PyObject *args)
}
catch (const Base::Exception& e) {
PyErr_SetString(Base::BaseExceptionFreeCADError, e.what());
return NULL;
return nullptr;
}
Py_Return;
}
@@ -189,7 +189,7 @@ PyObject* MeshFeaturePy::fixSelfIntersections(PyObject *args)
PyObject* MeshFeaturePy::removeFoldsOnSurface(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
try {
Mesh::Feature* obj = getFeaturePtr();
MeshObject* kernel = obj->Mesh.startEditing();
@@ -198,7 +198,7 @@ PyObject* MeshFeaturePy::removeFoldsOnSurface(PyObject *args)
}
catch (const Base::Exception& e) {
PyErr_SetString(Base::BaseExceptionFreeCADError, e.what());
return NULL;
return nullptr;
}
Py_Return;
}
@@ -206,7 +206,7 @@ PyObject* MeshFeaturePy::removeFoldsOnSurface(PyObject *args)
PyObject* MeshFeaturePy::removeInvalidPoints(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
try {
Mesh::Feature* obj = getFeaturePtr();
MeshObject* kernel = obj->Mesh.startEditing();
@@ -215,14 +215,14 @@ PyObject* MeshFeaturePy::removeInvalidPoints(PyObject *args)
}
catch (const Base::Exception& e) {
PyErr_SetString(Base::BaseExceptionFreeCADError, e.what());
return NULL;
return nullptr;
}
Py_Return;
}
PyObject *MeshFeaturePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int MeshFeaturePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -49,11 +49,11 @@ class MeshExport MeshPoint : public Vector3d
public:
/// simple constructor
MeshPoint(const Vector3d& vec = Vector3d(),MeshObject* obj = 0, unsigned int index = UINT_MAX)
MeshPoint(const Vector3d& vec = Vector3d(),MeshObject* obj = nullptr, unsigned int index = UINT_MAX)
:Vector3d(vec),Index(index),Mesh(obj)
{}
bool isBound(void) const {return Index != UINT_MAX;}
bool isBound() const {return Index != UINT_MAX;}
unsigned int Index;
Base::Reference<MeshObject> Mesh;

View File

@@ -36,7 +36,7 @@
using namespace Mesh;
// returns a string which represents the object e.g. when printed in python
std::string MeshPointPy::representation(void) const
std::string MeshPointPy::representation() const
{
MeshPointPy::PointerType ptr = getMeshPointPtr();
Base::Vector3d vec = *ptr;
@@ -80,9 +80,9 @@ int MeshPointPy::PyInit(PyObject* args, PyObject* /*kwds*/)
PyObject* MeshPointPy::unbound(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
getMeshPointPtr()->Index = UINT_MAX;
getMeshPointPtr()->Mesh = 0;
getMeshPointPtr()->Mesh = nullptr;
Py_Return;
}
@@ -90,11 +90,11 @@ PyObject* MeshPointPy::move(PyObject *args)
{
if (!getMeshPointPtr()->isBound()) {
PyErr_SetString(PyExc_RuntimeError, "This object is not bounded to a mesh, so no topological operation is possible!");
return 0;
return nullptr;
}
if (getMeshPointPtr()->Mesh->countPoints() <= getMeshPointPtr()->Index) {
PyErr_SetString(PyExc_IndexError, "Index out of range");
return 0;
return nullptr;
}
double x=0.0,y=0.0,z=0.0;
@@ -114,7 +114,7 @@ PyObject* MeshPointPy::move(PyObject *args)
}
PyErr_SetString(PyExc_TypeError, "Tuple of three floats or Vector expected");
return 0;
return nullptr;
}
while (false);
@@ -122,17 +122,17 @@ PyObject* MeshPointPy::move(PyObject *args)
Py_Return;
}
Py::Long MeshPointPy::getIndex(void) const
Py::Long MeshPointPy::getIndex() const
{
return Py::Long((long) getMeshPointPtr()->Index);
}
Py::Boolean MeshPointPy::getBound(void) const
Py::Boolean MeshPointPy::getBound() const
{
return Py::Boolean(getMeshPointPtr()->Index != UINT_MAX);
}
Py::Object MeshPointPy::getNormal(void) const
Py::Object MeshPointPy::getNormal() const
{
if (!getMeshPointPtr()->isBound())
throw Py::RuntimeError("This object is not bound to a mesh, so no topological operation is possible!");
@@ -145,7 +145,7 @@ Py::Object MeshPointPy::getNormal(void) const
return Py::Object(normal,true);
}
Py::Object MeshPointPy::getVector(void) const
Py::Object MeshPointPy::getVector() const
{
MeshPointPy::PointerType ptr = static_cast<MeshPointPy::PointerType>(_pcTwinPointer);
@@ -154,7 +154,7 @@ Py::Object MeshPointPy::getVector(void) const
return Py::Object(vec,true);
}
Py::Float MeshPointPy::getx(void) const
Py::Float MeshPointPy::getx() const
{
MeshPointPy::PointerType ptr = static_cast<MeshPointPy::PointerType>(_pcTwinPointer);
double x = ptr->x;
@@ -178,7 +178,7 @@ void MeshPointPy::setx(Py::Float arg)
}
}
Py::Float MeshPointPy::gety(void) const
Py::Float MeshPointPy::gety() const
{
MeshPointPy::PointerType ptr = static_cast<MeshPointPy::PointerType>(_pcTwinPointer);
double y = ptr->y;
@@ -202,7 +202,7 @@ void MeshPointPy::sety(Py::Float arg)
}
}
Py::Float MeshPointPy::getz(void) const
Py::Float MeshPointPy::getz() const
{
MeshPointPy::PointerType ptr = static_cast<MeshPointPy::PointerType>(_pcTwinPointer);
double z = ptr->z;
@@ -228,7 +228,7 @@ void MeshPointPy::setz(Py::Float arg)
PyObject *MeshPointPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int MeshPointPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -63,7 +63,7 @@ void PropertyNormalList::setSize(int newSize)
_lValueList.resize(newSize);
}
int PropertyNormalList::getSize(void) const
int PropertyNormalList::getSize() const
{
return static_cast<int>(_lValueList.size());
}
@@ -91,7 +91,7 @@ void PropertyNormalList::setValues(const std::vector<Base::Vector3f>& values)
hasSetValue();
}
PyObject *PropertyNormalList::getPyObject(void)
PyObject *PropertyNormalList::getPyObject()
{
PyObject* list = PyList_New(getSize());
@@ -174,7 +174,7 @@ void PropertyNormalList::RestoreDocFile(Base::Reader &reader)
setValues(values);
}
App::Property *PropertyNormalList::Copy(void) const
App::Property *PropertyNormalList::Copy() const
{
PropertyNormalList *p= new PropertyNormalList();
p->_lValueList = _lValueList;
@@ -188,7 +188,7 @@ void PropertyNormalList::Paste(const App::Property &from)
hasSetValue();
}
unsigned int PropertyNormalList::getMemSize (void) const
unsigned int PropertyNormalList::getMemSize () const
{
return static_cast<unsigned int>(_lValueList.size() * sizeof(Base::Vector3f));
}
@@ -382,7 +382,7 @@ void PropertyCurvatureList::RestoreDocFile(Base::Reader &reader)
setValues(values);
}
PyObject* PropertyCurvatureList::getPyObject(void)
PyObject* PropertyCurvatureList::getPyObject()
{
Py::List list;
for (std::vector<CurvatureInfo>::const_iterator it = _lValueList.begin(); it != _lValueList.end(); ++it) {
@@ -410,7 +410,7 @@ void PropertyCurvatureList::setPyObject(PyObject* /*value*/)
throw Base::AttributeError(std::string("This attribute is read-only"));
}
App::Property *PropertyCurvatureList::Copy(void) const
App::Property *PropertyCurvatureList::Copy() const
{
PropertyCurvatureList *p= new PropertyCurvatureList();
p->_lValueList = _lValueList;
@@ -427,7 +427,7 @@ void PropertyCurvatureList::Paste(const App::Property &from)
// ----------------------------------------------------------------------------
PropertyMeshKernel::PropertyMeshKernel()
: _meshObject(new MeshObject()), meshPyObject(0)
: _meshObject(new MeshObject()), meshPyObject(nullptr)
{
// Note: Normally this property is a member of a document object, i.e. the setValue()
// method gets called in the constructor of a sublcass of DocumentObject, e.g. Mesh::Feature.
@@ -440,7 +440,7 @@ PropertyMeshKernel::~PropertyMeshKernel()
if (meshPyObject) {
// Note: Do not call setInvalid() of the Python binding
// because the mesh should still be accessible afterwards.
meshPyObject->parentProperty = 0;
meshPyObject->parentProperty = nullptr;
Py_DECREF(meshPyObject);
}
}
@@ -483,12 +483,12 @@ void PropertyMeshKernel::swapMesh(MeshCore::MeshKernel& mesh)
hasSetValue();
}
const MeshObject& PropertyMeshKernel::getValue(void)const
const MeshObject& PropertyMeshKernel::getValue()const
{
return *_meshObject;
}
const MeshObject* PropertyMeshKernel::getValuePtr(void)const
const MeshObject* PropertyMeshKernel::getValuePtr()const
{
return (MeshObject*)_meshObject;
}
@@ -503,7 +503,7 @@ Base::BoundBox3d PropertyMeshKernel::getBoundingBox() const
return _meshObject->getBoundBox();
}
unsigned int PropertyMeshKernel::getMemSize (void) const
unsigned int PropertyMeshKernel::getMemSize () const
{
unsigned int size = 0;
size += _meshObject->getMemSize();
@@ -538,7 +538,7 @@ void PropertyMeshKernel::setPointIndices(const std::vector<std::pair<PointIndex,
hasSetValue();
}
PyObject *PropertyMeshKernel::getPyObject(void)
PyObject *PropertyMeshKernel::getPyObject()
{
if (!meshPyObject) {
meshPyObject = new MeshPy(&*_meshObject); // Lgtm[cpp/resource-not-released-in-destructor] ** Not destroyed in this class because it is reference-counted and destroyed elsewhere
@@ -624,7 +624,7 @@ void PropertyMeshKernel::RestoreDocFile(Base::Reader &reader)
hasSetValue();
}
App::Property *PropertyMeshKernel::Copy(void) const
App::Property *PropertyMeshKernel::Copy() const
{
// Note: Copy the content, do NOT reference the same mesh object
PropertyMeshKernel *prop = new PropertyMeshKernel();

View File

@@ -59,7 +59,7 @@ public:
~PropertyNormalList();
virtual void setSize(int newSize);
virtual int getSize(void) const;
virtual int getSize() const;
void setValue(const Base::Vector3f&);
void setValue(float x, float y, float z);
@@ -74,11 +74,11 @@ public:
void setValues (const std::vector<Base::Vector3f>& values);
const std::vector<Base::Vector3f> &getValues(void) const {
const std::vector<Base::Vector3f> &getValues() const {
return _lValueList;
}
virtual PyObject *getPyObject(void);
virtual PyObject *getPyObject();
virtual void setPyObject(PyObject *);
virtual void Save (Base::Writer &writer) const;
@@ -87,10 +87,10 @@ public:
virtual void SaveDocFile (Base::Writer &writer) const;
virtual void RestoreDocFile(Base::Reader &reader);
virtual App::Property *Copy(void) const;
virtual App::Property *Copy() const;
virtual void Paste(const App::Property &from);
virtual unsigned int getMemSize (void) const;
virtual unsigned int getMemSize () const;
void transformGeometry(const Base::Matrix4D &rclMat);
@@ -125,8 +125,8 @@ public:
PropertyCurvatureList();
~PropertyCurvatureList();
void setSize(int newSize){_lValueList.resize(newSize);}
int getSize(void) const {return _lValueList.size();}
void setSize(int newSize){_lValueList.resize(newSize);}
int getSize() const {return _lValueList.size();}
std::vector<float> getCurvature( int tMode) const;
void setValue(const CurvatureInfo&);
void setValues(const std::vector<CurvatureInfo>&);
@@ -138,7 +138,7 @@ public:
void set1Value (const int idx, const CurvatureInfo& value) {
_lValueList[idx] = value;
}
const std::vector<CurvatureInfo> &getValues(void) const {
const std::vector<CurvatureInfo> &getValues() const {
return _lValueList;
}
void transformGeometry(const Base::Matrix4D &rclMat);
@@ -151,14 +151,14 @@ public:
/** @name Python interface */
//@{
PyObject* getPyObject(void);
PyObject* getPyObject();
void setPyObject(PyObject *value);
//@}
App::Property *Copy(void) const;
App::Property *Copy() const;
void Paste(const App::Property &from);
virtual unsigned int getMemSize (void) const{return _lValueList.size() * sizeof(CurvatureInfo);}
virtual unsigned int getMemSize () const{return _lValueList.size() * sizeof(CurvatureInfo);}
private:
std::vector<CurvatureInfo> _lValueList;
@@ -197,9 +197,9 @@ public:
/** Returns a the attached mesh object by reference. It cannot be modified
* from outside.
*/
const MeshObject &getValue(void) const;
const MeshObject *getValuePtr(void) const;
virtual unsigned int getMemSize (void) const;
const MeshObject &getValue() const;
const MeshObject *getValuePtr() const;
virtual unsigned int getMemSize () const;
//@}
/** @name Getting basic geometric entities */
@@ -224,7 +224,7 @@ public:
* create a copy. However, the Python wrapper is marked as \a immutable so
* that the mesh object cannot be modified from outside.
*/
PyObject* getPyObject(void);
PyObject* getPyObject();
/** This method copies the content, hence creates an new mesh object
* to copy the data. The passed argument can be an instance of the Python
* wrapper for the mesh object or simply a list of triangles, i.e. a list
@@ -233,7 +233,7 @@ public:
void setPyObject(PyObject *value);
//@}
const char* getEditorName(void) const {
const char* getEditorName() const {
return "MeshGui::PropertyMeshKernelItem";
}
@@ -245,7 +245,7 @@ public:
void SaveDocFile (Base::Writer &writer) const;
void RestoreDocFile(Base::Reader &reader);
App::Property *Copy(void) const;
App::Property *Copy() const;
void Paste(const App::Property &from);
//@}

View File

@@ -523,7 +523,7 @@ an empty dictionary if there is no intersection.
<UserDocu>getPlanarSegments(dev,[min faces=0]) -> list
Get all planes of the mesh as segment.
In the worst case each triangle can be regarded as single
plane if none of its neighbors are coplanar.</UserDocu>
plane if none of its neighours is coplanar.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getSegmentsOfType" Const="true">

File diff suppressed because it is too large Load Diff

View File

@@ -33,9 +33,9 @@ BandedMatrix<Real>::BandedMatrix (int iSize, int iLBands, int iUBands)
template <class Real>
BandedMatrix<Real>::BandedMatrix (const BandedMatrix& rkM)
{
m_afDBand = 0;
m_aafLBand = 0;
m_aafUBand = 0;
m_afDBand = nullptr;
m_aafLBand = nullptr;
m_aafUBand = nullptr;
*this = rkM;
}
//----------------------------------------------------------------------------
@@ -276,7 +276,7 @@ void BandedMatrix<Real>::Allocate ()
}
else
{
m_aafLBand = 0;
m_aafLBand = nullptr;
}
if (m_iUBands > 0)
@@ -285,7 +285,7 @@ void BandedMatrix<Real>::Allocate ()
}
else
{
m_aafUBand = 0;
m_aafUBand = nullptr;
}
int i;
@@ -317,7 +317,7 @@ void BandedMatrix<Real>::Deallocate ()
}
WM4_DELETE[] m_aafLBand;
m_aafLBand = 0;
m_aafLBand = nullptr;
}
if (m_aafUBand)
@@ -328,7 +328,7 @@ void BandedMatrix<Real>::Deallocate ()
}
WM4_DELETE[] m_aafUBand;
m_aafUBand = 0;
m_aafUBand = nullptr;
}
}
//----------------------------------------------------------------------------

View File

@@ -105,7 +105,7 @@ Box2<Real> ContMinBox (int iQuantity, const Vector2<Real>* akPoint,
Box2<Real> kBox;
// get the convex hull of the points
Vector2<Real>* akHPoint = 0;
Vector2<Real>* akHPoint = nullptr;
if (bIsConvexPolygon)
{
akHPoint = (Vector2<Real>*)akPoint;

View File

@@ -22,7 +22,7 @@ ConvexHull<Real>::ConvexHull (int iVertexQuantity, Real fEpsilon, bool bOwner,
m_iVertexQuantity = iVertexQuantity;
m_iDimension = 0;
m_iSimplexQuantity = 0;
m_aiIndex = 0;
m_aiIndex = nullptr;
m_fEpsilon = fEpsilon;
m_bOwner = bOwner;
}
@@ -100,7 +100,7 @@ bool ConvexHull<Real>::Load (FILE* pkIFile)
return true;
}
m_aiIndex = 0;
m_aiIndex = nullptr;
return m_iDimension == 0;
}
//----------------------------------------------------------------------------

View File

@@ -61,7 +61,7 @@ ConvexHull1<Real>::ConvexHull1 (const char* acFilename)
:
ConvexHull<Real>(0,(Real)0.0,false,Query::QT_REAL)
{
m_afVertex = 0;
m_afVertex = nullptr;
bool bLoaded = Load(acFilename);
assert(bLoaded);
(void)bLoaded; // avoid warning in Release build

View File

@@ -28,8 +28,8 @@ ConvexHull2<Real>::ConvexHull2 (int iVertexQuantity, Vector2<Real>* akVertex,
{
assert(akVertex);
m_akVertex = akVertex;
m_akSVertex = 0;
m_pkQuery = 0;
m_akSVertex = nullptr;
m_pkQuery = nullptr;
Mapper2<Real> kMapper(m_iVertexQuantity,m_akVertex,m_fEpsilon);
if (kMapper.GetDimension() == 0)
@@ -180,7 +180,7 @@ ConvexHull1<Real>* ConvexHull2<Real>::GetConvexHull1 () const
assert(m_iDimension == 1);
if (m_iDimension != 1)
{
return 0;
return nullptr;
}
Real* afProjection = WM4_NEW Real[m_iVertexQuantity];
@@ -198,7 +198,7 @@ template <class Real>
bool ConvexHull2<Real>::Update (Edge*& rpkHull, int i)
{
// Locate an edge visible to the input point (if possible).
Edge* pkVisible = 0;
Edge* pkVisible = nullptr;
Edge* pkCurrent = rpkHull;
do
{
@@ -277,9 +277,9 @@ ConvexHull2<Real>::ConvexHull2 (const char* acFilename)
:
ConvexHull<Real>(0,(Real)0.0,false,Query::QT_REAL)
{
m_akVertex = 0;
m_akSVertex = 0;
m_pkQuery = 0;
m_akVertex = nullptr;
m_akSVertex = nullptr;
m_pkQuery = nullptr;
bool bLoaded = Load(acFilename);
assert(bLoaded);
(void)bLoaded; // avoid warning in Release build
@@ -392,8 +392,8 @@ ConvexHull2<Real>::Edge::Edge (int iV0, int iV1)
{
V[0] = iV0;
V[1] = iV1;
A[0] = 0;
A[1] = 0;
A[0] = nullptr;
A[1] = nullptr;
Sign = 0;
Time = -1;
}
@@ -424,12 +424,12 @@ void ConvexHull2<Real>::Edge::DeleteSelf ()
{
if (A[0])
{
A[0]->A[1] = 0;
A[0]->A[1] = nullptr;
}
if (A[1])
{
A[1]->A[0] = 0;
A[1]->A[0] = nullptr;
}
WM4_DELETE this;

View File

@@ -31,8 +31,8 @@ ConvexHull3<Real>::ConvexHull3 (int iVertexQuantity, Vector3<Real>* akVertex,
m_akVertex = akVertex;
m_akPlaneDirection[0] = Vector3<Real>::ZERO;
m_akPlaneDirection[1] = Vector3<Real>::ZERO;
m_akSVertex = 0;
m_pkQuery = 0;
m_akSVertex = nullptr;
m_pkQuery = nullptr;
Mapper3<Real> kMapper(m_iVertexQuantity,m_akVertex,m_fEpsilon);
if (kMapper.GetDimension() == 0)
@@ -219,7 +219,7 @@ ConvexHull1<Real>* ConvexHull3<Real>::GetConvexHull1 () const
assert(m_iDimension == 1);
if (m_iDimension != 1)
{
return 0;
return nullptr;
}
Real* afProjection = WM4_NEW Real[m_iVertexQuantity];
@@ -239,7 +239,7 @@ ConvexHull2<Real>* ConvexHull3<Real>::GetConvexHull2 () const
assert(m_iDimension == 2);
if (m_iDimension != 2)
{
return 0;
return nullptr;
}
Vector2<Real>* akProjection = WM4_NEW Vector2<Real>[m_iVertexQuantity];
@@ -258,7 +258,7 @@ template <class Real>
bool ConvexHull3<Real>::Update (int i)
{
// Locate a triangle visible to the input point (if possible).
Triangle* pkVisible = 0;
Triangle* pkVisible = nullptr;
Triangle* pkTri;
typename std::set<Triangle*>::iterator pkIter;
for (pkIter = m_kHull.begin(); pkIter != m_kHull.end(); pkIter++)
@@ -404,9 +404,9 @@ ConvexHull3<Real>::ConvexHull3 (const char* acFilename)
:
ConvexHull<Real>(0,(Real)0.0,false,Query::QT_REAL)
{
m_akVertex = 0;
m_akSVertex = 0;
m_pkQuery = 0;
m_akVertex = nullptr;
m_akSVertex = nullptr;
m_pkQuery = nullptr;
bool bLoaded = Load(acFilename);
assert(bLoaded);
(void)bLoaded; // avoid warning in Release build
@@ -532,9 +532,9 @@ ConvexHull3<Real>::Triangle::Triangle (int iV0, int iV1, int iV2)
V[0] = iV0;
V[1] = iV1;
V[2] = iV2;
A[0] = 0;
A[1] = 0;
A[2] = 0;
A[0] = nullptr;
A[1] = nullptr;
A[2] = nullptr;
Sign = 0;
Time = -1;
OnStack = false;
@@ -566,12 +566,12 @@ template <class Real>
int ConvexHull3<Real>::Triangle::DetachFrom (int iAdj, Triangle* pkAdj)
{
assert(0 <= iAdj && iAdj < 3 && A[iAdj] == pkAdj);
A[iAdj] = 0;
A[iAdj] = nullptr;
for (int i = 0; i < 3; i++)
{
if (pkAdj->A[i] == this)
{
pkAdj->A[i] = 0;
pkAdj->A[i] = nullptr;
return i;
}
}

View File

@@ -104,7 +104,7 @@ private:
{
public:
TerminatorData (int iV0 = -1, int iV1 = -1, int iNullIndex = -1,
Triangle* pkTri = 0)
Triangle* pkTri = nullptr)
{
V[0] = iV0;
V[1] = iV1;

View File

@@ -33,7 +33,7 @@ DelPolygonEdge<Real>::DelPolygonEdge (int iV0, int iV1, int iNullIndex,
template <class Real>
VEManifoldMesh::EPtr DelPolygonEdge<Real>::ECreator (int iV0, int iV1)
{
return WM4_NEW DelPolygonEdge<Real>(iV0,iV1,0,0);
return WM4_NEW DelPolygonEdge<Real>(iV0,iV1,0,nullptr);
}
//----------------------------------------------------------------------------

View File

@@ -34,7 +34,7 @@ template <class Real>
ETManifoldMesh::TPtr DelPolyhedronFace<Real>::TCreator (int iV0, int iV1,
int iV2)
{
return WM4_NEW DelPolyhedronFace<Real>(iV0,iV1,iV2,0,0);
return WM4_NEW DelPolyhedronFace<Real>(iV0,iV1,iV2,0,nullptr);
}
//----------------------------------------------------------------------------

View File

@@ -27,10 +27,10 @@ DelTetrahedron<Real>::DelTetrahedron (int iV0, int iV1, int iV2, int iV3)
V[1] = iV1;
V[2] = iV2;
V[3] = iV3;
A[0] = 0;
A[1] = 0;
A[2] = 0;
A[3] = 0;
A[0] = nullptr;
A[1] = nullptr;
A[2] = nullptr;
A[3] = nullptr;
Time = -1;
IsComponent = false;
OnStack = false;
@@ -102,12 +102,12 @@ template <class Real>
int DelTetrahedron<Real>::DetachFrom (int iAdj, DelTetrahedron* pkAdj)
{
assert(0 <= iAdj && iAdj < 4 && A[iAdj] == pkAdj);
A[iAdj] = 0;
A[iAdj] = nullptr;
for (int i = 0; i < 4; i++)
{
if (pkAdj->A[i] == this)
{
pkAdj->A[i] = 0;
pkAdj->A[i] = nullptr;
return i;
}
}

View File

@@ -26,9 +26,9 @@ DelTriangle<Real>::DelTriangle (int iV0, int iV1, int iV2)
V[0] = iV0;
V[1] = iV1;
V[2] = iV2;
A[0] = 0;
A[1] = 0;
A[2] = 0;
A[0] = nullptr;
A[1] = nullptr;
A[2] = nullptr;
Time = -1;
IsComponent = false;
OnStack = false;
@@ -84,7 +84,7 @@ bool DelTriangle<Real>::IsInsertionComponent (int i, DelTriangle* pkAdj,
{
for (j = 0; j < 3; j++)
{
if (A[j] != 0 && A[j] != pkAdj)
if (A[j] != nullptr && A[j] != pkAdj)
{
break;
}
@@ -105,12 +105,12 @@ template <class Real>
int DelTriangle<Real>::DetachFrom (int iAdj, DelTriangle* pkAdj)
{
assert(0 <= iAdj && iAdj < 3 && A[iAdj] == pkAdj);
A[iAdj] = 0;
A[iAdj] = nullptr;
for (int i = 0; i < 3; i++)
{
if (pkAdj->A[i] == this)
{
pkAdj->A[i] = 0;
pkAdj->A[i] = nullptr;
return i;
}
}

View File

@@ -30,8 +30,8 @@ Delaunay<Real>::Delaunay (int iVertexQuantity, Real fEpsilon, bool bOwner,
m_iVertexQuantity = iVertexQuantity;
m_iDimension = 0;
m_iSimplexQuantity = 0;
m_aiIndex = 0;
m_aiAdjacent = 0;
m_aiIndex = nullptr;
m_aiAdjacent = nullptr;
m_fEpsilon = fEpsilon;
m_bOwner = bOwner;
}
@@ -119,8 +119,8 @@ bool Delaunay<Real>::Load (FILE* pkIFile)
return true;
}
m_aiIndex = 0;
m_aiAdjacent = 0;
m_aiIndex = nullptr;
m_aiAdjacent = nullptr;
return m_iDimension == 0;
}
//----------------------------------------------------------------------------

View File

@@ -210,7 +210,7 @@ Delaunay1<Real>::Delaunay1 (const char* acFilename)
:
Delaunay<Real>(0,(Real)0.0,false,Query::QT_REAL)
{
m_afVertex = 0;
m_afVertex = nullptr;
bool bLoaded = Load(acFilename);
assert(bLoaded);
(void)bLoaded; // avoid warning in Release build

View File

@@ -38,10 +38,10 @@ Delaunay2<Real>::Delaunay2 (int iVertexQuantity, Vector2<Real>* akVertex,
assert(akVertex);
m_akVertex = akVertex;
m_iUniqueVertexQuantity = 0;
m_akSVertex = 0;
m_pkQuery = 0;
m_akSVertex = nullptr;
m_pkQuery = nullptr;
m_iPathLast = -1;
m_aiPath = 0;
m_aiPath = nullptr;
m_iLastEdgeV0 = -1;
m_iLastEdgeV1 = -1;
m_iLastEdgeOpposite = -1;
@@ -184,7 +184,7 @@ Delaunay2<Real>::Delaunay2 (int iVertexQuantity, Vector2<Real>* akVertex,
pkTri = *pkTIter;
kPermute[pkTri] = i++;
}
kPermute[0] = -1;
kPermute[nullptr] = -1;
// Put Delaunay triangles into an array (vertices and adjacency info).
m_iSimplexQuantity = (int)m_kTriangle.size();
@@ -263,7 +263,7 @@ Delaunay1<Real>* Delaunay2<Real>::GetDelaunay1 () const
assert(m_iDimension == 1);
if (m_iDimension != 1)
{
return 0;
return nullptr;
}
Real* afProjection = WM4_NEW Real[m_iVertexQuantity];
@@ -287,7 +287,7 @@ bool Delaunay2<Real>::GetHull (int& riEQuantity, int*& raiIndex)
}
riEQuantity = 0;
raiIndex = 0;
raiIndex = nullptr;
// Count the number of edges that are not shared by two triangles.
int i, iAdjQuantity = 3*m_iSimplexQuantity;
@@ -510,7 +510,7 @@ void Delaunay2<Real>::Update (int i)
// Locate and remove the triangles forming the insertion polygon.
std::stack<DelTriangle<Real>*> kStack;
VEManifoldMesh kPolygon(0,DelPolygonEdge<Real>::ECreator);
VEManifoldMesh kPolygon(nullptr,DelPolygonEdge<Real>::ECreator);
kStack.push(pkTri);
pkTri->OnStack = true;
int j, iV0, iV1;
@@ -567,7 +567,7 @@ void Delaunay2<Real>::Update (int i)
pkEdge = (DelPolygonEdge<Real>*)kPolygon.InsertEdge(
iV0,iV1);
pkEdge->NullIndex = -1;
pkEdge->Tri = 0;
pkEdge->Tri = nullptr;
}
}
}
@@ -661,7 +661,7 @@ DelTriangle<Real>* Delaunay2<Real>::GetContainingTriangle (int i) const
}
assert(false);
return 0;
return nullptr;
}
//----------------------------------------------------------------------------
template <class Real>
@@ -700,7 +700,7 @@ void Delaunay2<Real>::RemoveTriangles ()
{
if (pkAdj->A[k] == pkTri)
{
pkAdj->A[k] = 0;
pkAdj->A[k] = nullptr;
break;
}
}
@@ -729,10 +729,10 @@ Delaunay2<Real>::Delaunay2 (const char* acFilename)
:
Delaunay<Real>(0,(Real)0.0,false,Query::QT_REAL)
{
m_akVertex = 0;
m_akSVertex = 0;
m_pkQuery = 0;
m_aiPath = 0;
m_akVertex = nullptr;
m_akSVertex = nullptr;
m_pkQuery = nullptr;
m_aiPath = nullptr;
bool bLoaded = Load(acFilename);
assert(bLoaded);
(void)bLoaded; // avoid warning in Release build

View File

@@ -49,10 +49,10 @@ Delaunay3<Real>::Delaunay3 (int iVertexQuantity, Vector3<Real>* akVertex,
m_iUniqueVertexQuantity = 0;
m_akPlaneDirection[0] = Vector3<Real>::ZERO;
m_akPlaneDirection[1] = Vector3<Real>::ZERO;
m_akSVertex = 0;
m_pkQuery = 0;
m_akSVertex = nullptr;
m_pkQuery = nullptr;
m_iPathLast = -1;
m_aiPath = 0;
m_aiPath = nullptr;
m_iLastFaceV0 = -1;
m_iLastFaceV1 = -1;
m_iLastFaceV2 = -1;
@@ -215,7 +215,7 @@ Delaunay3<Real>::Delaunay3 (int iVertexQuantity, Vector3<Real>* akVertex,
pkTetra = *pkTIter;
kPermute[pkTetra] = i++;
}
kPermute[0] = -1;
kPermute[nullptr] = -1;
// Put Delaunay tetrahedra into an array (vertices and adjacency info).
m_iSimplexQuantity = (int)m_kTetrahedron.size();
@@ -296,7 +296,7 @@ Delaunay1<Real>* Delaunay3<Real>::GetDelaunay1 () const
assert(m_iDimension == 1);
if (m_iDimension != 1)
{
return 0;
return nullptr;
}
Real* afProjection = WM4_NEW Real[m_iVertexQuantity];
@@ -329,7 +329,7 @@ Delaunay2<Real>* Delaunay3<Real>::GetDelaunay2 () const
assert(m_iDimension == 2);
if (m_iDimension != 2)
{
return 0;
return nullptr;
}
Vector2<Real>* akProjection = WM4_NEW Vector2<Real>[m_iVertexQuantity];
@@ -354,7 +354,7 @@ bool Delaunay3<Real>::GetHull (int& riTQuantity, int*& raiIndex) const
}
riTQuantity = 0;
raiIndex = 0;
raiIndex = nullptr;
// Count the number of triangles that are not shared by two tetrahedra.
int i, iAdjQuantity = 4*m_iSimplexQuantity;
@@ -618,7 +618,7 @@ void Delaunay3<Real>::Update (int i)
// Locate and remove the tetrahedra forming the insertion polyhedron.
std::stack<DelTetrahedron<Real>*> kStack;
ETManifoldMesh kPolyhedron(0,DelPolyhedronFace<Real>::TCreator);
ETManifoldMesh kPolyhedron(nullptr,DelPolyhedronFace<Real>::TCreator);
kStack.push(pkTetra);
pkTetra->OnStack = true;
int j, iV0, iV1, iV2;
@@ -681,7 +681,7 @@ void Delaunay3<Real>::Update (int i)
pkFace = (DelPolyhedronFace<Real>*)
kPolyhedron.InsertTriangle(iV0,iV1,iV2);
pkFace->NullIndex = -1;
pkFace->Tetra = 0;
pkFace->Tetra = nullptr;
}
}
}
@@ -799,7 +799,7 @@ DelTetrahedron<Real>* Delaunay3<Real>::GetContainingTetrahedron (int i) const
}
assert(false);
return 0;
return nullptr;
}
//----------------------------------------------------------------------------
template <class Real>
@@ -838,7 +838,7 @@ void Delaunay3<Real>::RemoveTetrahedra ()
{
if (pkAdj->A[k] == pkTetra)
{
pkAdj->A[k] = 0;
pkAdj->A[k] = nullptr;
break;
}
}
@@ -949,10 +949,10 @@ Delaunay3<Real>::Delaunay3 (const char* acFilename)
:
Delaunay<Real>(0,(Real)0.0,false,Query::QT_REAL)
{
m_akVertex = 0;
m_akSVertex = 0;
m_pkQuery = 0;
m_aiPath = 0;
m_akVertex = nullptr;
m_akSVertex = nullptr;
m_pkQuery = nullptr;
m_aiPath = nullptr;
bool bLoaded = Load(acFilename);
assert(bLoaded);
(void)bLoaded; // avoid warning in Release build

View File

@@ -59,7 +59,7 @@ ETManifoldMesh::TPtr ETManifoldMesh::InsertTriangle (int iV0, int iV1,
if (pkTIter != m_kTMap.end())
{
// triangle already exists
return 0;
return nullptr;
}
// add new triangle
@@ -92,7 +92,7 @@ ETManifoldMesh::TPtr ETManifoldMesh::InsertTriangle (int iV0, int iV1,
if (pkEdge->T[1])
{
assert(false); // mesh must be manifold
return 0;
return nullptr;
}
pkEdge->T[1] = pkTriangle;
@@ -137,11 +137,11 @@ bool ETManifoldMesh::RemoveTriangle (int iV0, int iV1, int iV2)
{
// one-triangle edges always have pointer in slot zero
pkEdge->T[0] = pkEdge->T[1];
pkEdge->T[1] = 0;
pkEdge->T[1] = nullptr;
}
else if (pkEdge->T[1] == pkTriangle)
{
pkEdge->T[1] = 0;
pkEdge->T[1] = nullptr;
}
else
{
@@ -165,7 +165,7 @@ bool ETManifoldMesh::RemoveTriangle (int iV0, int iV1, int iV2)
{
if (pkAdjacent->T[j] == pkTriangle)
{
pkAdjacent->T[j] = 0;
pkAdjacent->T[j] = nullptr;
break;
}
}
@@ -201,7 +201,7 @@ void ETManifoldMesh::Print (const char* acFilename)
// assign unique indices to the edges
std::map<EPtr,int> kEIndex;
kEIndex[0] = 0;
kEIndex[nullptr] = 0;
int i = 1;
EMapIterator pkEIter;
for (pkEIter = m_kEMap.begin(); pkEIter != m_kEMap.end(); pkEIter++)
@@ -214,7 +214,7 @@ void ETManifoldMesh::Print (const char* acFilename)
// assign unique indices to the triangles
std::map<TPtr,int> kTIndex;
kTIndex[0] = 0;
kTIndex[nullptr] = 0;
i = 1;
TMapIterator pkTIter;
for (pkTIter = m_kTMap.begin(); pkTIter != m_kTMap.end(); pkTIter++)
@@ -328,8 +328,8 @@ ETManifoldMesh::Edge::Edge (int iV0, int iV1)
{
V[0] = iV0;
V[1] = iV1;
T[0] = 0;
T[1] = 0;
T[0] = nullptr;
T[1] = nullptr;
}
//----------------------------------------------------------------------------
ETManifoldMesh::Edge::~Edge ()
@@ -348,8 +348,8 @@ ETManifoldMesh::Triangle::Triangle (int iV0, int iV1, int iV2)
for (int i = 0; i < 3; i++)
{
E[i] = 0;
T[i] = 0;
E[i] = nullptr;
T[i] = nullptr;
}
}
//----------------------------------------------------------------------------

View File

@@ -81,7 +81,7 @@ public:
// construction and destruction
ETManifoldMesh (ECreator oECreator = 0, TCreator oTCreator = 0);
ETManifoldMesh (ECreator oECreator = nullptr, TCreator oTCreator = nullptr);
virtual ~ETManifoldMesh ();
// member access

View File

@@ -20,16 +20,16 @@ namespace Wm4
template <class Real>
GMatrix<Real>::GMatrix (int iRows, int iCols)
{
m_afData = 0;
m_aafEntry = 0;
m_afData = nullptr;
m_aafEntry = nullptr;
SetSize(iRows,iCols);
}
//----------------------------------------------------------------------------
template <class Real>
GMatrix<Real>::GMatrix (int iRows, int iCols, const Real* afEntry)
{
m_afData = 0;
m_aafEntry = 0;
m_afData = nullptr;
m_aafEntry = nullptr;
SetMatrix(iRows,iCols,afEntry);
}
//----------------------------------------------------------------------------
@@ -47,8 +47,8 @@ GMatrix<Real>::GMatrix (const GMatrix& rkM)
m_iRows = 0;
m_iCols = 0;
m_iQuantity = 0;
m_afData = 0;
m_aafEntry = 0;
m_afData = nullptr;
m_aafEntry = nullptr;
*this = rkM;
}
//----------------------------------------------------------------------------
@@ -99,8 +99,8 @@ void GMatrix<Real>::SetSize (int iRows, int iCols)
m_iRows = 0;
m_iCols = 0;
m_iQuantity = 0;
m_afData = 0;
m_aafEntry = 0;
m_afData = nullptr;
m_aafEntry = nullptr;
}
}
//----------------------------------------------------------------------------
@@ -239,8 +239,8 @@ void GMatrix<Real>::SetMatrix (int iRows, int iCols, const Real* afData)
m_iRows = 0;
m_iCols = 0;
m_iQuantity = 0;
m_afData = 0;
m_aafEntry = 0;
m_afData = nullptr;
m_aafEntry = nullptr;
}
}
//----------------------------------------------------------------------------
@@ -311,8 +311,8 @@ GMatrix<Real>& GMatrix<Real>::operator= (const GMatrix& rkM)
m_iRows = 0;
m_iCols = 0;
m_iQuantity = 0;
m_afData = 0;
m_aafEntry = 0;
m_afData = nullptr;
m_aafEntry = nullptr;
}
return *this;
}

View File

@@ -29,7 +29,7 @@ GVector<Real>::GVector (int iSize)
else
{
m_iSize = 0;
m_afTuple = 0;
m_afTuple = nullptr;
}
}
//----------------------------------------------------------------------------
@@ -62,7 +62,7 @@ GVector<Real>::GVector (const GVector& rkV)
}
else
{
m_afTuple = 0;
m_afTuple = nullptr;
}
}
//----------------------------------------------------------------------------

View File

@@ -24,23 +24,23 @@ template <class Real>
MeshSmoother<Real>::MeshSmoother ()
{
m_iVQuantity = 0;
m_akVertex = 0;
m_akVertex = nullptr;
m_iTQuantity = 0;
m_aiIndex = 0;
m_akNormal = 0;
m_akMean = 0;
m_aiNeighborCount = 0;
m_aiIndex = nullptr;
m_akNormal = nullptr;
m_akMean = nullptr;
m_aiNeighborCount = nullptr;
}
//----------------------------------------------------------------------------
template <class Real>
MeshSmoother<Real>::MeshSmoother (int iVQuantity, Vector3<Real>* akVertex,
int iTQuantity, const int* aiIndex)
{
m_akVertex = 0;
m_akNormal = 0;
m_aiIndex = 0;
m_akMean = 0;
m_aiNeighborCount = 0;
m_akVertex = nullptr;
m_akNormal = nullptr;
m_aiIndex = nullptr;
m_akMean = nullptr;
m_aiNeighborCount = nullptr;
Create(iVQuantity,akVertex,iTQuantity,aiIndex);
}

View File

@@ -124,7 +124,7 @@ typedef int64_t Integer64;
//----------------------------------------------------------------------------
#else
#include <stdint.h>
#include <cstdint>
typedef int64_t Integer64;
#endif

View File

@@ -29,7 +29,7 @@ Polynomial1<Real>::Polynomial1 (int iDegree)
{
// default creation
m_iDegree = -1;
m_afCoeff = 0;
m_afCoeff = nullptr;
}
}
//----------------------------------------------------------------------------
@@ -62,7 +62,7 @@ void Polynomial1<Real>::SetDegree (int iDegree)
}
else
{
m_afCoeff = 0;
m_afCoeff = nullptr;
}
}
//----------------------------------------------------------------------------

View File

@@ -40,7 +40,7 @@ static bool gs_bInitializedTime = false;
char System::ms_acPath[SYSTEM_MAX_PATH];
char System::ms_acEnvVar[SYSTEM_MAX_ENVVAR];
std::vector<std::string>* System::ms_pkDirectories = 0;
std::vector<std::string>* System::ms_pkDirectories = nullptr;
char System::WM4_PATH[SYSTEM_MAX_ENVVAR];
//----------------------------------------------------------------------------
@@ -107,11 +107,11 @@ double System::GetTime ()
if (!gs_bInitializedTime)
{
gs_bInitializedTime = true;
gettimeofday(&gs_kInitial, 0);
gettimeofday(&gs_kInitial, nullptr);
}
struct timeval kCurrent;
gettimeofday(&kCurrent,0);
gettimeofday(&kCurrent,nullptr);
struct timeval kDelta;
timersub(&kCurrent,&gs_kInitial,&kDelta);
@@ -149,7 +149,7 @@ bool System::Load (const char* acFilename, char*& racBuffer, int& riSize)
if (stat(acFilename,&kStat) != 0)
{
// file does not exist
racBuffer = 0;
racBuffer = nullptr;
riSize = 0;
return false;
}
@@ -158,7 +158,7 @@ bool System::Load (const char* acFilename, char*& racBuffer, int& riSize)
assert(pkFile);
if (!pkFile)
{
racBuffer = 0;
racBuffer = nullptr;
riSize = 0;
return false;
}
@@ -170,7 +170,7 @@ bool System::Load (const char* acFilename, char*& racBuffer, int& riSize)
{
assert(false);
WM4_DELETE[] racBuffer;
racBuffer = 0;
racBuffer = nullptr;
riSize = 0;
return false;
}
@@ -627,12 +627,12 @@ const char* System::GetPath (const char* acDirectory, const char* acFilename)
System::Strcat(ms_acPath,SYSTEM_MAX_PATH,acFilename);
return ms_acPath;
}
return 0;
return nullptr;
}
//----------------------------------------------------------------------------
void System::Initialize ()
{
assert(ms_pkDirectories == 0);
assert(ms_pkDirectories == nullptr);
ms_pkDirectories = WM4_NEW std::vector<std::string>;
const char* acWm4Path = GetEnv("WM4_PATH");
@@ -649,7 +649,7 @@ void System::Initialize ()
void System::Terminate ()
{
WM4_DELETE ms_pkDirectories;
ms_pkDirectories = 0;
ms_pkDirectories = nullptr;
}
//----------------------------------------------------------------------------
int System::GetDirectoryQuantity ()
@@ -673,7 +673,7 @@ const char* System::GetDirectory (int i)
{
return (*ms_pkDirectories)[i].c_str();
}
return 0;
return nullptr;
}
//----------------------------------------------------------------------------
bool System::InsertDirectory (const char* acDirectory)
@@ -738,7 +738,7 @@ const char* System::GetPath (const char* acFilename, int eMode)
(*ms_pkDirectories)[i].c_str(),acFilename);
if (!acDecorated)
{
return 0;
return nullptr;
}
FILE* pkFile;
@@ -761,7 +761,7 @@ const char* System::GetPath (const char* acFilename, int eMode)
return acDecorated;
}
}
return 0;
return nullptr;
}
//----------------------------------------------------------------------------
unsigned int System::MakeRGB (unsigned char ucR, unsigned char ucG,
@@ -839,9 +839,9 @@ const char* System::GetEnv (const char* acEnvVarName)
getenv_s(&uiRequiredSize,ms_acEnvVar,SYSTEM_MAX_ENVVAR,acEnvVarName);
#else
char* acEnvVar = getenv(acEnvVarName);
if (acEnvVar == 0)
if (acEnvVar == nullptr)
{
return 0;
return nullptr;
}
System::Strcpy(ms_acEnvVar,SYSTEM_MAX_ENVVAR,getenv(acEnvVarName));
#endif
@@ -865,7 +865,7 @@ void* System::Memcpy (void* pvDst, size_t uiDstSize, const void* pvSrc,
if (!pvDst || uiDstSize == 0 || !pvSrc || uiSrcSize == 0)
{
// Be consistent with the behavior of memcpy_s.
return 0;
return nullptr;
}
if (uiSrcSize > uiDstSize)
@@ -873,7 +873,7 @@ void* System::Memcpy (void* pvDst, size_t uiDstSize, const void* pvSrc,
// The source memory is too large to copy to the destination. To
// be consistent with memcpy_s, return null as an indication that the
// copy failed.
return 0;
return nullptr;
}
memcpy(pvDst,pvSrc,uiSrcSize);
return pvDst;
@@ -916,7 +916,7 @@ char* System::Strcpy (char* acDst, size_t uiDstSize, const char* acSrc)
if (!acDst || uiDstSize == 0 || !acSrc)
{
// Be consistent with the behavior of strcpy_s.
return 0;
return nullptr;
}
size_t uiSrcLen = strlen(acSrc);
@@ -925,7 +925,7 @@ char* System::Strcpy (char* acDst, size_t uiDstSize, const char* acSrc)
// The source string is too large to copy to the destination. To
// be consistent with strcpy_s, return null as an indication that the
// copy failed.
return 0;
return nullptr;
}
strncpy(acDst,acSrc,uiSrcLen);
acDst[uiSrcLen] = 0;
@@ -949,7 +949,7 @@ char* System::Strcat (char* acDst, size_t uiDstSize, const char* acSrc)
if (!acDst || uiDstSize == 0 || !acSrc)
{
// Be consistent with the behavior of strcat_s.
return 0;
return nullptr;
}
size_t uiSrcLen = strlen(acSrc);
@@ -960,7 +960,7 @@ char* System::Strcat (char* acDst, size_t uiDstSize, const char* acSrc)
// The source string is too large to append to the destination. To
// be consistent with strcat_s, return null as an indication that
// the concatenation failed.
return 0;
return nullptr;
}
strncat(acDst,acSrc,uiSrcLen);
acDst[uiSumLen] = 0;
@@ -985,7 +985,7 @@ char* System::Strncpy (char* acDst, size_t uiDstSize, const char* acSrc,
if (!acDst || uiDstSize == 0 || !acSrc || uiSrcSize == 0)
{
// Be consistent with the behavior of strncpy_s.
return 0;
return nullptr;
}
if (uiSrcSize + 1 > uiDstSize)
@@ -993,7 +993,7 @@ char* System::Strncpy (char* acDst, size_t uiDstSize, const char* acSrc,
// The source string is too large to copy to the destination. To
// be consistent with strncpy_s, return null as an indication that
// the copy failed.
return 0;
return nullptr;
}
strncpy(acDst,acSrc,uiSrcSize);
return acDst;

View File

@@ -36,7 +36,7 @@ void Deallocate (T**& raatArray)
{
WM4_DELETE[] raatArray[0];
WM4_DELETE[] raatArray;
raatArray = 0;
raatArray = nullptr;
}
}
//----------------------------------------------------------------------------

View File

@@ -33,7 +33,7 @@ TriangulateEC<Real>::TriangulateEC (const Positions& rkPositions,
// Triangulate the unindexed polygon.
int iVQuantity = (int)rkPositions.size();
const int* aiIndex = 0;
const int* aiIndex = nullptr;
InitializeVertices(iVQuantity,aiIndex,rkTriangles);
DoEarClipping(iVQuantity,aiIndex,rkTriangles);
}
@@ -984,7 +984,7 @@ void TriangulateEC<Real>::Delete (Tree*& rpkRoot)
WM4_DELETE pkTree;
}
rpkRoot = 0;
rpkRoot = nullptr;
}
}
//----------------------------------------------------------------------------

View File

@@ -57,7 +57,7 @@ VEManifoldMesh::EPtr VEManifoldMesh::InsertEdge (int iV0, int iV1)
if (pkEIter != m_kEMap.end())
{
// edge already exists
return 0;
return nullptr;
}
// add new edge
@@ -89,7 +89,7 @@ VEManifoldMesh::EPtr VEManifoldMesh::InsertEdge (int iV0, int iV1)
if (pkVertex->E[1])
{
assert(false); // mesh must be manifold
return 0;
return nullptr;
}
pkVertex->E[1] = pkEdge;
@@ -135,11 +135,11 @@ bool VEManifoldMesh::RemoveEdge (int iV0, int iV1)
{
// one-edge vertices always have pointer in slot zero
pkVertex->E[0] = pkVertex->E[1];
pkVertex->E[1] = 0;
pkVertex->E[1] = nullptr;
}
else if (pkVertex->E[1] == pkEdge)
{
pkVertex->E[1] = 0;
pkVertex->E[1] = nullptr;
}
else
{
@@ -162,7 +162,7 @@ bool VEManifoldMesh::RemoveEdge (int iV0, int iV1)
{
if (pkAdjacent->E[j] == pkEdge)
{
pkAdjacent->E[j] = 0;
pkAdjacent->E[j] = nullptr;
break;
}
}
@@ -198,7 +198,7 @@ void VEManifoldMesh::Print (const char* acFilename)
// assign unique indices to the edges
std::map<EPtr,int> kEIndex;
kEIndex[0] = 0;
kEIndex[nullptr] = 0;
int i = 1;
EMapIterator pkEIter;
for (pkEIter = m_kEMap.begin(); pkEIter != m_kEMap.end(); pkEIter++)
@@ -272,8 +272,8 @@ void VEManifoldMesh::Print (const char* acFilename)
VEManifoldMesh::Vertex::Vertex (int iV)
{
V = iV;
E[0] = 0;
E[1] = 0;
E[0] = nullptr;
E[1] = nullptr;
}
//----------------------------------------------------------------------------
VEManifoldMesh::Vertex::~Vertex ()
@@ -288,8 +288,8 @@ VEManifoldMesh::Edge::Edge (int iV0, int iV1)
{
V[0] = iV0;
V[1] = iV1;
E[0] = 0;
E[1] = 0;
E[0] = nullptr;
E[1] = nullptr;
}
//----------------------------------------------------------------------------
VEManifoldMesh::Edge::~Edge ()

View File

@@ -73,7 +73,7 @@ public:
// construction and destruction
VEManifoldMesh (VCreator oVCreator = 0, ECreator oECreator = 0);
VEManifoldMesh (VCreator oVCreator = nullptr, ECreator oECreator = nullptr);
virtual ~VEManifoldMesh ();
// member access

View File

@@ -61,7 +61,7 @@
// use a different name to CreateCommand()
void CreateMeshCommands(void);
void CreateMeshCommands();
void loadMeshResource()
{
@@ -127,7 +127,7 @@ PyMOD_INIT_FUNC(MeshGui)
{
if (!Gui::Application::Instance) {
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
PyMOD_Return(0);
PyMOD_Return(nullptr);
}
// load dependent module
@@ -136,7 +136,7 @@ PyMOD_INIT_FUNC(MeshGui)
}
catch(const Base::Exception& e) {
PyErr_SetString(PyExc_ImportError, e.what());
PyMOD_Return(0);
PyMOD_Return(nullptr);
}
PyObject* mod = MeshGui::initModule();
Base::Console().Log("Loading GUI of Mesh module... done\n");

View File

@@ -282,7 +282,7 @@ void CmdMeshUnion::activated(int)
}
}
bool CmdMeshUnion::isActive(void)
bool CmdMeshUnion::isActive()
{
return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 2;
}
@@ -353,7 +353,7 @@ void CmdMeshDifference::activated(int)
}
}
bool CmdMeshDifference::isActive(void)
bool CmdMeshDifference::isActive()
{
return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 2;
}
@@ -424,7 +424,7 @@ void CmdMeshIntersection::activated(int)
}
}
bool CmdMeshIntersection::isActive(void)
bool CmdMeshIntersection::isActive()
{
return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 2;
}
@@ -475,7 +475,7 @@ void CmdMeshImport::activated(int)
}
}
bool CmdMeshImport::isActive(void)
bool CmdMeshImport::isActive()
{
return (getActiveGuiDocument() ? true : false);
}
@@ -550,7 +550,7 @@ void CmdMeshExport::activated(int)
}
}
bool CmdMeshExport::isActive(void)
bool CmdMeshExport::isActive()
{
return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 1;
}
@@ -605,7 +605,7 @@ void CmdMeshFromGeometry::activated(int)
}
}
bool CmdMeshFromGeometry::isActive(void)
bool CmdMeshFromGeometry::isActive()
{
App::Document* doc = App::GetApplication().getActiveDocument();
if (!doc) return false;
@@ -634,7 +634,7 @@ void CmdMeshFromPartShape::activated(int)
doCommand(Doc,"import MeshPartGui, FreeCADGui\nFreeCADGui.runCommand('MeshPart_Mesher')\n");
}
bool CmdMeshFromPartShape::isActive(void)
bool CmdMeshFromPartShape::isActive()
{
return (hasActiveDocument() && !Gui::Control().activeDialog());
}
@@ -676,7 +676,7 @@ void CmdMeshVertexCurvature::activated(int)
updateActive();
}
bool CmdMeshVertexCurvature::isActive(void)
bool CmdMeshVertexCurvature::isActive()
{
// Check for the selected mesh feature (all Mesh types)
return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) > 0;
@@ -713,7 +713,7 @@ void CmdMeshVertexCurvatureInfo::activated(int)
}
}
bool CmdMeshVertexCurvatureInfo::isActive(void)
bool CmdMeshVertexCurvatureInfo::isActive()
{
App::Document* doc = App::GetApplication().getActiveDocument();
if (!doc || doc->countObjectsOfType(Mesh::Curvature::getClassTypeId()) == 0)
@@ -769,7 +769,7 @@ void CmdMeshPolySegm::activated(int)
}
}
bool CmdMeshPolySegm::isActive(void)
bool CmdMeshPolySegm::isActive()
{
// Check for the selected mesh feature (all Mesh types)
if (getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 0)
@@ -869,7 +869,7 @@ void CmdMeshAddFacet::activated(int)
}
}
bool CmdMeshAddFacet::isActive(void)
bool CmdMeshAddFacet::isActive()
{
// Check for the selected mesh feature (all Mesh types)
if (getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) != 1)
@@ -930,7 +930,7 @@ void CmdMeshPolyCut::activated(int)
}
}
bool CmdMeshPolyCut::isActive(void)
bool CmdMeshPolyCut::isActive()
{
// Check for the selected mesh feature (all Mesh types)
if (getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 0)
@@ -991,7 +991,7 @@ void CmdMeshPolyTrim::activated(int)
}
}
bool CmdMeshPolyTrim::isActive(void)
bool CmdMeshPolyTrim::isActive()
{
// Check for the selected mesh feature (all Mesh types)
if (getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 0)
@@ -1055,7 +1055,7 @@ void CmdMeshSectionByPlane::activated(int)
doCommand(Doc,"import MeshPartGui, FreeCADGui\nFreeCADGui.runCommand('MeshPart_SectionByPlane')\n");
}
bool CmdMeshSectionByPlane::isActive(void)
bool CmdMeshSectionByPlane::isActive()
{
// Check for the selected mesh feature (all Mesh types)
if (getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) != 1)
@@ -1129,7 +1129,7 @@ void CmdMeshPolySplit::activated(int)
}
}
bool CmdMeshPolySplit::isActive(void)
bool CmdMeshPolySplit::isActive()
{
// Check for the selected mesh feature (all Mesh types)
if (getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 0)
@@ -1179,7 +1179,7 @@ void CmdMeshEvaluation::activated(int)
dlg->show();
}
bool CmdMeshEvaluation::isActive(void)
bool CmdMeshEvaluation::isActive()
{
App::Document* doc = App::GetApplication().getActiveDocument();
if (!doc || doc->countObjectsOfType(Mesh::Feature::getClassTypeId()) == 0)
@@ -1215,7 +1215,7 @@ void CmdMeshEvaluateFacet::activated(int)
}
}
bool CmdMeshEvaluateFacet::isActive(void)
bool CmdMeshEvaluateFacet::isActive()
{
App::Document* doc = App::GetApplication().getActiveDocument();
if (!doc || doc->countObjectsOfType(Mesh::Feature::getClassTypeId()) == 0)
@@ -1256,7 +1256,7 @@ void CmdMeshRemoveComponents::activated(int)
Gui::Control().showDialog(dlg);
}
bool CmdMeshRemoveComponents::isActive(void)
bool CmdMeshRemoveComponents::isActive()
{
// Check for the selected mesh feature (all Mesh types)
App::Document* doc = getDocument();
@@ -1303,7 +1303,7 @@ void CmdMeshRemeshGmsh::activated(int)
Gui::Control().showDialog(dlg);
}
bool CmdMeshRemeshGmsh::isActive(void)
bool CmdMeshRemeshGmsh::isActive()
{
return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 1;
}
@@ -1337,7 +1337,7 @@ void CmdMeshRemoveCompByHand::activated(int)
}
}
bool CmdMeshRemoveCompByHand::isActive(void)
bool CmdMeshRemoveCompByHand::isActive()
{
App::Document* doc = App::GetApplication().getActiveDocument();
if (!doc || doc->countObjectsOfType(Mesh::Feature::getClassTypeId()) == 0)
@@ -1384,7 +1384,7 @@ void CmdMeshEvaluateSolid::activated(int)
}
}
bool CmdMeshEvaluateSolid::isActive(void)
bool CmdMeshEvaluateSolid::isActive()
{
// Check for the selected mesh feature (all Mesh types)
return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 1;
@@ -1443,7 +1443,7 @@ void CmdMeshSmoothing::activated(int)
#endif
}
bool CmdMeshSmoothing::isActive(void)
bool CmdMeshSmoothing::isActive()
{
#if 1
if (Gui::Control().activeDialog())
@@ -1474,7 +1474,7 @@ void CmdMeshDecimating::activated(int)
Gui::Control().showDialog(new MeshGui::TaskDecimating());
}
bool CmdMeshDecimating::isActive(void)
bool CmdMeshDecimating::isActive()
{
#if 1
if (Gui::Control().activeDialog())
@@ -1512,7 +1512,7 @@ void CmdMeshHarmonizeNormals::activated(int)
updateActive();
}
bool CmdMeshHarmonizeNormals::isActive(void)
bool CmdMeshHarmonizeNormals::isActive()
{
// Check for the selected mesh feature (all Mesh types)
return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) > 0;
@@ -1546,7 +1546,7 @@ void CmdMeshFlipNormals::activated(int)
updateActive();
}
bool CmdMeshFlipNormals::isActive(void)
bool CmdMeshFlipNormals::isActive()
{
// Check for the selected mesh feature (all Mesh types)
return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) > 0;
@@ -1588,7 +1588,7 @@ void CmdMeshBoundingBox::activated(int)
}
}
bool CmdMeshBoundingBox::isActive(void)
bool CmdMeshBoundingBox::isActive()
{
// Check for the selected mesh feature (all Mesh types)
return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 1;
@@ -1612,14 +1612,14 @@ CmdMeshBuildRegularSolid::CmdMeshBuildRegularSolid()
void CmdMeshBuildRegularSolid::activated(int)
{
static QPointer<QDialog> dlg = 0;
static QPointer<QDialog> dlg = nullptr;
if (!dlg)
dlg = new MeshGui::DlgRegularSolidImp(Gui::getMainWindow());
dlg->setAttribute(Qt::WA_DeleteOnClose);
dlg->show();
}
bool CmdMeshBuildRegularSolid::isActive(void)
bool CmdMeshBuildRegularSolid::isActive()
{
// Check for the selected mesh feature (all Mesh types)
return hasActiveDocument();
@@ -1657,7 +1657,7 @@ void CmdMeshFillupHoles::activated(int)
updateActive();
}
bool CmdMeshFillupHoles::isActive(void)
bool CmdMeshFillupHoles::isActive()
{
// Check for the selected mesh feature (all Mesh types)
return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) > 0;
@@ -1692,7 +1692,7 @@ void CmdMeshFillInteractiveHole::activated(int)
}
}
bool CmdMeshFillInteractiveHole::isActive(void)
bool CmdMeshFillInteractiveHole::isActive()
{
App::Document* doc = App::GetApplication().getActiveDocument();
if (!doc || doc->countObjectsOfType(Mesh::Feature::getClassTypeId()) == 0)
@@ -1733,7 +1733,7 @@ void CmdMeshSegmentation::activated(int)
Gui::Control().showDialog(dlg);
}
bool CmdMeshSegmentation::isActive(void)
bool CmdMeshSegmentation::isActive()
{
if (Gui::Control().activeDialog())
return false;
@@ -1769,7 +1769,7 @@ void CmdMeshSegmentationBestFit::activated(int)
Gui::Control().showDialog(dlg);
}
bool CmdMeshSegmentationBestFit::isActive(void)
bool CmdMeshSegmentationBestFit::isActive()
{
if (Gui::Control().activeDialog())
return false;
@@ -1815,7 +1815,7 @@ void CmdMeshMerge::activated(int)
commitCommand();
}
bool CmdMeshMerge::isActive(void)
bool CmdMeshMerge::isActive()
{
return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) >= 2;
}
@@ -1861,7 +1861,7 @@ void CmdMeshSplitComponents::activated(int)
commitCommand();
}
bool CmdMeshSplitComponents::isActive(void)
bool CmdMeshSplitComponents::isActive()
{
return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 1;
}
@@ -1909,13 +1909,13 @@ void CmdMeshScale::activated(int)
commitCommand();
}
bool CmdMeshScale::isActive(void)
bool CmdMeshScale::isActive()
{
return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) > 0;
}
void CreateMeshCommands(void)
void CreateMeshCommands()
{
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
//rcCmdMgr.addCommand(new CmdMeshDemolding());

View File

@@ -73,8 +73,8 @@ class DlgEvaluateMeshImp::Private
{
public:
Private()
: meshFeature(0)
, view(0)
: meshFeature(nullptr)
, view(nullptr)
, enableFoldsCheck(false)
, checkNonManfoldPoints(false)
, strictlyDegenerated(true)
@@ -213,7 +213,7 @@ void DlgEvaluateMeshImp::slotDeletedObject(const App::DocumentObject& Obj)
// is it the current mesh object then clear everything
if (&Obj == d->meshFeature) {
removeViewProviders();
d->meshFeature = 0;
d->meshFeature = nullptr;
d->ui.meshNameButton->setCurrentIndex(0);
cleanInformation();
d->self_intersections.clear();
@@ -253,7 +253,7 @@ void DlgEvaluateMeshImp::slotDeletedDocument(const App::Document& Doc)
// try to attach to the active document
this->detachDocument();
d->view = 0;
d->view = nullptr;
on_refreshButton_clicked();
}
}
@@ -316,7 +316,7 @@ void DlgEvaluateMeshImp::on_meshNameButton_activated(int i)
{
QString item = d->ui.meshNameButton->itemData(i).toString();
d->meshFeature = 0;
d->meshFeature = nullptr;
std::vector<App::DocumentObject*> objs = getDocument()->getObjectsOfType(Mesh::Feature::getClassTypeId());
for (std::vector<App::DocumentObject*>::iterator it = objs.begin(); it != objs.end(); ++it) {
if (item == QLatin1String((*it)->getNameInDocument())) {
@@ -1240,7 +1240,7 @@ void DlgEvaluateMeshImp::on_buttonBox_clicked(QAbstractButton* button)
qApp->translate("QDockWidget", "Evaluate & Repair Mesh");
#endif
DockEvaluateMeshImp* DockEvaluateMeshImp::_instance=0;
DockEvaluateMeshImp* DockEvaluateMeshImp::_instance=nullptr;
DockEvaluateMeshImp* DockEvaluateMeshImp::instance()
{
@@ -1255,16 +1255,16 @@ DockEvaluateMeshImp* DockEvaluateMeshImp::instance()
void DockEvaluateMeshImp::destruct ()
{
if (_instance != 0) {
if (_instance != nullptr) {
DockEvaluateMeshImp *pTmp = _instance;
_instance = 0;
_instance = nullptr;
delete pTmp;
}
}
bool DockEvaluateMeshImp::hasInstance()
{
return _instance != 0;
return _instance != nullptr;
}
/**
@@ -1296,7 +1296,7 @@ DockEvaluateMeshImp::DockEvaluateMeshImp( QWidget* parent, Qt::WindowFlags fl )
*/
DockEvaluateMeshImp::~DockEvaluateMeshImp()
{
_instance = 0;
_instance = nullptr;
}
/**

View File

@@ -70,7 +70,7 @@ class DlgEvaluateMeshImp : public QDialog, public App::DocumentObserver
Q_OBJECT
public:
DlgEvaluateMeshImp(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
DlgEvaluateMeshImp(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
~DlgEvaluateMeshImp();
void setMesh(Mesh::Feature*);
@@ -148,7 +148,7 @@ class DockEvaluateMeshImp : public DlgEvaluateMeshImp
Q_OBJECT
protected:
DockEvaluateMeshImp( QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags() );
DockEvaluateMeshImp( QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags() );
~DockEvaluateMeshImp();
void closeEvent(QCloseEvent* e);

View File

@@ -38,7 +38,7 @@ class DlgEvaluateSettings : public QDialog
Q_OBJECT
public:
DlgEvaluateSettings(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
DlgEvaluateSettings(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
~DlgEvaluateSettings();
void setNonmanifoldPointsChecked(bool);

View File

@@ -24,7 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <float.h>
# include <cfloat>
# include <qcheckbox.h>
# include <qcombobox.h>
# include <qmessagebox.h>

View File

@@ -34,7 +34,7 @@ class DlgRegularSolidImp : public QDialog
Q_OBJECT
public:
DlgRegularSolidImp(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
DlgRegularSolidImp(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
~DlgRegularSolidImp();
public Q_SLOTS:

View File

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

View File

@@ -143,12 +143,12 @@ TaskSmoothing::TaskSmoothing()
{
widget = new DlgSmoothing();
Gui::TaskView::TaskBox* taskbox = new Gui::TaskView::TaskBox(
QPixmap(), widget->windowTitle(), false, 0);
QPixmap(), widget->windowTitle(), false, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
selection = new Selection();
selection->setObjects(Gui::Selection().getSelectionEx(0, Mesh::Feature::getClassTypeId()));
selection->setObjects(Gui::Selection().getSelectionEx(nullptr, Mesh::Feature::getClassTypeId()));
Gui::Selection().clearSelection();
#if !defined (QSINT_ACTIONPANEL)
Gui::TaskView::TaskGroup* tasksel = new Gui::TaskView::TaskGroup();

View File

@@ -48,7 +48,7 @@ public:
Laplace
};
DlgSmoothing(QWidget* parent = 0);
DlgSmoothing(QWidget* parent = nullptr);
~DlgSmoothing();
int iterations() const;
double lambdaStep() const;
@@ -76,7 +76,7 @@ class MeshGuiExport SmoothingDialog : public QDialog
Q_OBJECT
public:
SmoothingDialog(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
SmoothingDialog(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
~SmoothingDialog();
int iterations() const
@@ -110,7 +110,7 @@ public:
virtual QDialogButtonBox::StandardButtons getStandardButtons() const
{ return QDialogButtonBox::Ok | QDialogButtonBox::Cancel; }
virtual bool isAllowedAlterDocument(void) const
virtual bool isAllowedAlterDocument() const
{ return true; }
private:

View File

@@ -81,9 +81,9 @@ MeshSelection::MeshSelection()
, addToSelection(false)
, addComponent(false)
, removeComponent(false)
, activeCB(0)
, selectionCB(0)
, ivViewer(0)
, activeCB(nullptr)
, selectionCB(nullptr)
, ivViewer(nullptr)
{
setCallback(selectGLCallback);
}
@@ -163,14 +163,14 @@ Gui::View3DInventorViewer* MeshSelection::getViewer() const
return ivViewer;
Gui::Document* doc = Gui::Application::Instance->activeDocument();
if (!doc) return 0;
if (!doc) return nullptr;
Gui::MDIView* view = doc->getActiveView();
if (view && view->getTypeId().isDerivedFrom(Gui::View3DInventor::getClassTypeId())) {
Gui::View3DInventorViewer* viewer = static_cast<Gui::View3DInventor*>(view)->getViewer();
return viewer;
}
return 0;
return nullptr;
}
void MeshSelection::startInteractiveCallback(Gui::View3DInventorViewer* viewer,SoEventCallbackCB *cb)
@@ -188,7 +188,7 @@ void MeshSelection::stopInteractiveCallback(Gui::View3DInventorViewer* viewer)
return;
viewer->setEditing(false);
viewer->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), this->activeCB, this);
this->activeCB = 0;
this->activeCB = nullptr;
}
void MeshSelection::prepareFreehandSelection(bool add,SoEventCallbackCB *cb)
@@ -540,7 +540,7 @@ void MeshSelection::pickFaceCallback(void * ud, SoEventCallback * n)
n->getAction()->setHandled();
if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) {
const SoPickedPoint * point = n->getPickedPoint();
if (point == NULL) {
if (point == nullptr) {
Base::Console().Message("No facet picked.\n");
return;
}

View File

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

View File

@@ -392,7 +392,7 @@ TaskRemeshGmsh::TaskRemeshGmsh(Mesh::Feature* mesh)
{
widget = new RemeshGmsh(mesh);
taskbox = new Gui::TaskView::TaskBox(
QPixmap(), widget->windowTitle(), false, 0);
QPixmap(), widget->windowTitle(), false, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
}

View File

@@ -52,7 +52,7 @@ class MeshGuiExport GmshWidget : public QWidget
Q_OBJECT
public:
GmshWidget(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
GmshWidget(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
~GmshWidget();
void accept();
void reject();
@@ -90,7 +90,7 @@ class MeshGuiExport RemeshGmsh : public GmshWidget
Q_OBJECT
public:
RemeshGmsh(Mesh::Feature* mesh, QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
RemeshGmsh(Mesh::Feature* mesh, QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
~RemeshGmsh();
protected:
@@ -118,7 +118,7 @@ public:
virtual QDialogButtonBox::StandardButtons getStandardButtons() const
{ return QDialogButtonBox::Apply | QDialogButtonBox::Close; }
virtual bool isAllowedAlterDocument(void) const
virtual bool isAllowedAlterDocument() const
{ return true; }
private:

View File

@@ -215,7 +215,7 @@ TaskRemoveComponents::TaskRemoveComponents()
{
widget = new RemoveComponents();
taskbox = new Gui::TaskView::TaskBox(
QPixmap(), widget->windowTitle(), false, 0);
QPixmap(), widget->windowTitle(), false, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
}

View File

@@ -42,7 +42,7 @@ class MeshGuiExport RemoveComponents : public QWidget
Q_OBJECT
public:
RemoveComponents(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
RemoveComponents(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
~RemoveComponents();
void reject();
void deleteSelection();
@@ -65,7 +65,7 @@ public Q_SLOTS:
protected:
void changeEvent(QEvent *e);
private:
private:
Ui_RemoveComponents* ui;
MeshSelection meshSel;
};
@@ -78,7 +78,7 @@ class MeshGuiExport RemoveComponentsDialog : public QDialog
Q_OBJECT
public:
RemoveComponentsDialog(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
RemoveComponentsDialog(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
~RemoveComponentsDialog();
void reject();
@@ -106,7 +106,7 @@ public:
virtual QDialogButtonBox::StandardButtons getStandardButtons() const
{ return QDialogButtonBox::Ok | QDialogButtonBox::Close; }
virtual bool isAllowedAlterDocument(void) const
virtual bool isAllowedAlterDocument() const
{ return true; }
virtual void modifyStandardButtons(QDialogButtonBox*);

View File

@@ -148,7 +148,7 @@ TaskSegmentation::TaskSegmentation(Mesh::Feature* mesh)
{
widget = new Segmentation(mesh);
taskbox = new Gui::TaskView::TaskBox(
QPixmap(), widget->windowTitle(), false, 0);
QPixmap(), widget->windowTitle(), false, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
}

View File

@@ -40,7 +40,7 @@ class Ui_Segmentation;
class MeshGuiExport Segmentation : public QWidget
{
public:
Segmentation(Mesh::Feature* mesh, QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
Segmentation(Mesh::Feature* mesh, QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
~Segmentation();
void accept();

View File

@@ -207,7 +207,7 @@ ParametersDialog::ParametersDialog(std::vector<float>& val, FitParameter* fitPar
int index = 0;
QGridLayout *layout;
layout = new QGridLayout(groupBox);
for (auto it : parameter) {
for (const auto& it : parameter) {
QLabel* label = new QLabel(groupBox);
label->setText(it.first);
layout->addWidget(label, index, 0, 1, 1);
@@ -346,7 +346,7 @@ void SegmentationBestFit::on_planeParameters_clicked()
list.push_back(std::make_pair(axis + y, p[4]));
list.push_back(std::make_pair(axis + z, p[5]));
static QPointer<QDialog> dialog = 0;
static QPointer<QDialog> dialog = nullptr;
if (!dialog)
dialog = new ParametersDialog(planeParameter,
new PlaneFitParameter,
@@ -374,7 +374,7 @@ void SegmentationBestFit::on_cylinderParameters_clicked()
list.push_back(std::make_pair(axis + z, p[5]));
list.push_back(std::make_pair(radius, p[6]));
static QPointer<QDialog> dialog = 0;
static QPointer<QDialog> dialog = nullptr;
if (!dialog)
dialog = new ParametersDialog(cylinderParameter,
new CylinderFitParameter,
@@ -398,7 +398,7 @@ void SegmentationBestFit::on_sphereParameters_clicked()
list.push_back(std::make_pair(base + z, p[2]));
list.push_back(std::make_pair(radius, p[3]));
static QPointer<QDialog> dialog = 0;
static QPointer<QDialog> dialog = nullptr;
if (!dialog)
dialog = new ParametersDialog(sphereParameter,
new SphereFitParameter,
@@ -504,7 +504,7 @@ TaskSegmentationBestFit::TaskSegmentationBestFit(Mesh::Feature* mesh)
{
widget = new SegmentationBestFit(mesh);
taskbox = new Gui::TaskView::TaskBox(
QPixmap(), widget->windowTitle(), false, 0);
QPixmap(), widget->windowTitle(), false, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
}

View File

@@ -24,7 +24,7 @@
#ifndef MESHGUI_SEGMENTATIONBESTFIT_H
#define MESHGUI_SEGMENTATIONBESTFIT_H
#include <QWidget>
#include <QDialog>
#include <list>
#include <Gui/TaskView/TaskDialog.h>
#include <Gui/TaskView/TaskView.h>
@@ -57,7 +57,7 @@ class ParametersDialog : public QDialog
public:
ParametersDialog(std::vector<float>&, FitParameter*,
ParameterList, Mesh::Feature* mesh,
QWidget* parent=0);
QWidget* parent=nullptr);
~ParametersDialog();
void accept();
void reject();
@@ -82,7 +82,7 @@ class MeshGuiExport SegmentationBestFit : public QWidget
Q_OBJECT
public:
SegmentationBestFit(Mesh::Feature* mesh, QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
SegmentationBestFit(Mesh::Feature* mesh, QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
~SegmentationBestFit();
void accept();

View File

@@ -40,7 +40,7 @@ class Selection : public QWidget
Q_OBJECT
public:
Selection(QWidget* parent = 0);
Selection(QWidget* parent = nullptr);
~Selection();
void setObjects(const std::vector<Gui::SelectionObject>&);
std::vector<App::DocumentObject*> getObjects() const;

View File

@@ -96,7 +96,7 @@ private:
MeshRenderer::Private::Private()
: vertices(GL_ARRAY_BUFFER)
, indices(GL_ELEMENT_ARRAY_BUFFER)
, pcolors(0)
, pcolors(nullptr)
, matbinding(SoMaterialBindingElement::OVERALL)
, initialized(false)
{
@@ -168,12 +168,12 @@ void MeshRenderer::Private::renderGLArray(SoGLRenderAction *action, GLenum mode)
indices.bind();
if (matbinding != SoMaterialBindingElement::OVERALL)
glInterleavedArrays(GL_C4F_N3F_V3F, 0, 0);
glInterleavedArrays(GL_C4F_N3F_V3F, 0, nullptr);
else
glInterleavedArrays(GL_N3F_V3F, 0, 0);
glInterleavedArrays(GL_N3F_V3F, 0, nullptr);
glDrawElements(mode, indices.size() / sizeof(uint32_t),
GL_UNSIGNED_INT, NULL);
GL_UNSIGNED_INT, nullptr);
vertices.release();
indices.release();
@@ -429,7 +429,7 @@ bool MeshRenderer::matchMaterial(SoState* state) const
// the buffer doesn't contain color information
if (matbind == SoMaterialBindingElement::OVERALL)
return true;
const SbColor * pcolors = 0;
const SbColor * pcolors = nullptr;
SoGLLazyElement* gl = SoGLLazyElement::getInstance(state);
if (gl) {
pcolors = gl->getDiffusePointer();
@@ -489,7 +489,7 @@ void SoFCIndexedFaceSet::initClass()
SoFCIndexedFaceSet::SoFCIndexedFaceSet()
: renderTriangleLimit(UINT_MAX)
, selectBuf(0)
, selectBuf(nullptr)
{
SO_NODE_CONSTRUCTOR(SoFCIndexedFaceSet);
SO_NODE_ADD_FIELD(updateGLArray, (false));
@@ -639,7 +639,7 @@ void SoFCIndexedFaceSet::drawCoords(const SoGLCoordinateElement * const vertexli
const SoTextureCoordinateBundle * const /*texcoords*/,
const int32_t * /*texindices*/)
{
const SbVec3f * coords3d = 0;
const SbVec3f * coords3d = nullptr;
coords3d = vertexlist->getArrayPtr3();
int mod = numindices/(4*this->renderTriangleLimit)+1;
@@ -716,8 +716,8 @@ void SoFCIndexedFaceSet::generateGLArrays(SoGLRenderAction * action)
const SoCoordinateElement * coords;
const SbVec3f * normals;
const int32_t * cindices;
const SbColor * pcolors = 0;
const float * transp = 0;
const SbColor * pcolors = nullptr;
const float * transp = nullptr;
int numindices, numcolors = 0, numtransp = 0;
const int32_t * nindices;
const int32_t * tindices;
@@ -1013,7 +1013,7 @@ void SoFCIndexedFaceSet::stopSelection(SoAction * action)
}
delete [] selectBuf;
selectBuf = 0;
selectBuf = nullptr;
std::sort(hit.begin(),hit.end());
Gui::SoGLSelectAction *doaction = static_cast<Gui::SoGLSelectAction*>(action);

View File

@@ -89,7 +89,7 @@ private:
class SoOutputStream : public std::ostream
{
public:
SoOutputStream(SoOutput* o) : std::ostream(0), buf(o)
SoOutputStream(SoOutput* o) : std::ostream(nullptr), buf(o)
{
this->rdbuf(&buf);
}
@@ -153,7 +153,7 @@ private:
class SoInputStream : public std::istream
{
public:
SoInputStream(SoInput* o) : std::istream(0), buf(o)
SoInputStream(SoInput* o) : std::istream(nullptr), buf(o)
{
this->rdbuf(&buf);
}
@@ -296,7 +296,7 @@ void SoFCMeshObjectElement::initClass()
void SoFCMeshObjectElement::init(SoState * state)
{
inherited::init(state);
this->mesh = 0;
this->mesh = nullptr;
}
SoFCMeshObjectElement::~SoFCMeshObjectElement()
@@ -334,11 +334,11 @@ SO_NODE_SOURCE(SoFCMeshPickNode)
/*!
Constructor.
*/
SoFCMeshPickNode::SoFCMeshPickNode(void) : meshGrid(0)
SoFCMeshPickNode::SoFCMeshPickNode() : meshGrid(nullptr)
{
SO_NODE_CONSTRUCTOR(SoFCMeshPickNode);
SO_NODE_ADD_FIELD(mesh, (0));
SO_NODE_ADD_FIELD(mesh, (nullptr));
}
/*!
@@ -350,7 +350,7 @@ SoFCMeshPickNode::~SoFCMeshPickNode()
}
// Doc from superclass.
void SoFCMeshPickNode::initClass(void)
void SoFCMeshPickNode::initClass()
{
SO_NODE_INIT_CLASS(SoFCMeshPickNode, SoNode, "Node");
}
@@ -406,7 +406,7 @@ SO_NODE_SOURCE(SoFCMeshGridNode)
/*!
Constructor.
*/
SoFCMeshGridNode::SoFCMeshGridNode(void)
SoFCMeshGridNode::SoFCMeshGridNode()
{
SO_NODE_CONSTRUCTOR(SoFCMeshGridNode);
@@ -423,7 +423,7 @@ SoFCMeshGridNode::~SoFCMeshGridNode()
}
// Doc from superclass.
void SoFCMeshGridNode::initClass(void)
void SoFCMeshGridNode::initClass()
{
SO_NODE_INIT_CLASS(SoFCMeshGridNode, SoNode, "Node");
}
@@ -493,11 +493,11 @@ SO_NODE_SOURCE(SoFCMeshObjectNode)
/*!
Constructor.
*/
SoFCMeshObjectNode::SoFCMeshObjectNode(void)
SoFCMeshObjectNode::SoFCMeshObjectNode()
{
SO_NODE_CONSTRUCTOR(SoFCMeshObjectNode);
SO_NODE_ADD_FIELD(mesh, (0));
SO_NODE_ADD_FIELD(mesh, (nullptr));
}
/*!
@@ -508,7 +508,7 @@ SoFCMeshObjectNode::~SoFCMeshObjectNode()
}
// Doc from superclass.
void SoFCMeshObjectNode::initClass(void)
void SoFCMeshObjectNode::initClass()
{
SO_NODE_INIT_CLASS(SoFCMeshObjectNode, SoNode, "Node");
@@ -592,7 +592,7 @@ void SoFCMeshObjectShape::initClass()
SoFCMeshObjectShape::SoFCMeshObjectShape()
: renderTriangleLimit(UINT_MAX)
, selectBuf(0)
, selectBuf(nullptr)
, updateGLArray(false)
{
SO_NODE_CONSTRUCTOR(SoFCMeshObjectShape);
@@ -1051,7 +1051,7 @@ void SoFCMeshObjectShape::stopSelection(SoAction * action, const Mesh::MeshObjec
}
delete [] selectBuf;
selectBuf = 0;
selectBuf = nullptr;
std::sort(hit.begin(),hit.end());
Gui::SoGLSelectAction *doaction = static_cast<Gui::SoGLSelectAction*>(action);
@@ -1295,7 +1295,7 @@ void SoFCMeshSegmentShape::GLRender(SoGLRenderAction *action)
if (mbind != OVERALL)
drawFaces(mesh, &mb, mbind, needNormals, ccw);
else
drawFaces(mesh, 0, mbind, needNormals, ccw);
drawFaces(mesh, nullptr, mbind, needNormals, ccw);
}
else {
drawPoints(mesh, needNormals, ccw);

View File

@@ -48,7 +48,7 @@ class MeshGuiExport SoSFMeshObject : public SoSField {
SO_SFIELD_HEADER(SoSFMeshObject, Base::Reference<const Mesh::MeshObject>, Base::Reference<const Mesh::MeshObject>);
public:
static void initClass(void);
static void initClass();
private:
SoSFMeshObject(const SoSFMeshObject&);
@@ -62,7 +62,7 @@ class MeshGuiExport SoFCMeshObjectElement : public SoReplacedElement {
SO_ELEMENT_HEADER(SoFCMeshObjectElement);
public:
static void initClass(void);
static void initClass();
virtual void init(SoState * state);
static void set(SoState * const state, SoNode * const node, const Mesh::MeshObject * const mesh);
@@ -83,8 +83,8 @@ class MeshGuiExport SoFCMeshPickNode : public SoNode {
SO_NODE_HEADER(SoFCMeshPickNode);
public:
static void initClass(void);
SoFCMeshPickNode(void);
static void initClass();
SoFCMeshPickNode();
void notify(SoNotList *);
SoSFMeshObject mesh;
@@ -107,8 +107,8 @@ class MeshGuiExport SoFCMeshGridNode : public SoNode {
SO_NODE_HEADER(SoFCMeshGridNode);
public:
static void initClass(void);
SoFCMeshGridNode(void);
static void initClass();
SoFCMeshGridNode();
void GLRender(SoGLRenderAction * action);
SoSFVec3f minGrid;
@@ -127,8 +127,8 @@ class MeshGuiExport SoFCMeshObjectNode : public SoNode {
SO_NODE_HEADER(SoFCMeshObjectNode);
public:
static void initClass(void);
SoFCMeshObjectNode(void);
static void initClass();
SoFCMeshObjectNode();
SoSFMeshObject mesh;

View File

@@ -32,7 +32,7 @@
# else
# include <GL/gl.h>
# endif
# include <float.h>
# include <cfloat>
# include <algorithm>
# include <Inventor/actions/SoCallbackAction.h>
# include <Inventor/actions/SoGetBoundingBoxAction.h>
@@ -48,7 +48,7 @@
#endif
# include <Inventor/elements/SoCoordinateElement.h>
# include <float.h>
# include <cfloat>
#include "SoPolygon.h"

View File

@@ -24,7 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <stdlib.h>
# include <cstdlib>
# include <QAction>
# include <QMenu>
# include <QTimer>
@@ -118,8 +118,8 @@ using MeshCore::MeshFacet;
void ViewProviderMeshBuilder::buildNodes(const App::Property* prop, std::vector<SoNode*>& nodes) const
{
SoCoordinate3 *pcPointsCoord=0;
SoIndexedFaceSet *pcFaces=0;
SoCoordinate3 *pcPointsCoord=nullptr;
SoIndexedFaceSet *pcFaces=nullptr;
if (nodes.empty()) {
pcPointsCoord = new SoCoordinate3();
@@ -177,7 +177,7 @@ ViewProviderExport::~ViewProviderExport()
{
}
std::vector<std::string> ViewProviderExport::getDisplayModes(void) const
std::vector<std::string> ViewProviderExport::getDisplayModes() const
{
std::vector<std::string> mode;
mode.push_back("");
@@ -230,11 +230,11 @@ QIcon ViewProviderExport::getIcon() const
App::PropertyFloatConstraint::Constraints ViewProviderMesh::floatRange = {1.0f,64.0f,1.0f};
App::PropertyFloatConstraint::Constraints ViewProviderMesh::angleRange = {0.0f,180.0f,1.0f};
App::PropertyIntegerConstraint::Constraints ViewProviderMesh::intPercent = {0,100,1};
const char* ViewProviderMesh::LightingEnums[]= {"One side","Two side",NULL};
const char* ViewProviderMesh::LightingEnums[]= {"One side","Two side",nullptr};
PROPERTY_SOURCE(MeshGui::ViewProviderMesh, Gui::ViewProviderGeometryObject)
ViewProviderMesh::ViewProviderMesh() : pcOpenEdge(0)
ViewProviderMesh::ViewProviderMesh() : pcOpenEdge(nullptr)
{
static const char *osgroup = "Object Style";
@@ -405,12 +405,12 @@ void ViewProviderMesh::setOpenEdgeColorFrom(const App::Color& c)
SoShape* ViewProviderMesh::getShapeNode() const
{
return 0;
return nullptr;
}
SoNode* ViewProviderMesh::getCoordNode() const
{
return 0;
return nullptr;
}
/**
@@ -547,7 +547,7 @@ App::PropertyColorList* ViewProviderMesh::getColorProperty() const
}
}
return 0; // no such property found
return nullptr; // no such property found
}
void ViewProviderMesh::tryColorPerVertexOrFace(bool on)
@@ -625,7 +625,7 @@ void ViewProviderMesh::setDisplayMode(const char* ModeName)
ViewProviderGeometryObject::setDisplayMode(ModeName);
}
std::vector<std::string> ViewProviderMesh::getDisplayModes(void) const
std::vector<std::string> ViewProviderMesh::getDisplayModes() const
{
std::vector<std::string> StrList;
@@ -1259,7 +1259,7 @@ std::vector<Mesh::FacetIndex> ViewProviderMesh::getFacetsOfRegion(const SbViewpo
void ViewProviderMesh::panCamera(SoCamera * cam, float aspectratio, const SbPlane & panplane,
const SbVec2f & currpos, const SbVec2f & prevpos)
{
if (cam == NULL) return; // can happen for empty scenegraph
if (cam == nullptr) return; // can happen for empty scenegraph
if (currpos == prevpos) return; // useless invocation
@@ -1593,7 +1593,7 @@ void ViewProviderMesh::faceInfoCallback(void * ud, SoEventCallback * n)
}
else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) {
const SoPickedPoint * point = n->getPickedPoint();
if (point == NULL) {
if (point == nullptr) {
Base::Console().Message("No facet picked.\n");
return;
}
@@ -1619,7 +1619,7 @@ void ViewProviderMesh::faceInfoCallback(void * ud, SoEventCallback * n)
const SoFaceDetail* faceDetail = static_cast<const SoFaceDetail*>(detail);
Mesh::FacetIndex uFacet = faceDetail->getFaceIndex();
that->faceInfo(uFacet);
Gui::GLFlagWindow* flags = 0;
Gui::GLFlagWindow* flags = nullptr;
std::list<Gui::GLGraphicsItem*> glItems = view->getGraphicsItemsOfType(Gui::GLFlagWindow::getClassTypeId());
if (glItems.empty()) {
flags = new Gui::GLFlagWindow(view);
@@ -1667,7 +1667,7 @@ void ViewProviderMesh::fillHoleCallback(void * ud, SoEventCallback * n)
}
else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) {
const SoPickedPoint * point = n->getPickedPoint();
if (point == NULL) {
if (point == nullptr) {
Base::Console().Message("No facet picked.\n");
return;
}
@@ -1734,7 +1734,7 @@ void ViewProviderMesh::markPartCallback(void * ud, SoEventCallback * n)
}
else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) {
const SoPickedPoint * point = n->getPickedPoint();
if (point == NULL) {
if (point == nullptr) {
Base::Console().Message("No facet picked.\n");
return;
}
@@ -2250,8 +2250,8 @@ PROPERTY_SOURCE(MeshGui::ViewProviderIndexedFaceSet, MeshGui::ViewProviderMesh)
ViewProviderIndexedFaceSet::ViewProviderIndexedFaceSet()
{
pcMeshCoord = 0;
pcMeshFaces = 0;
pcMeshCoord = nullptr;
pcMeshFaces = nullptr;
}
ViewProviderIndexedFaceSet::~ViewProviderIndexedFaceSet()
@@ -2294,7 +2294,7 @@ void ViewProviderIndexedFaceSet::showOpenEdges(bool show)
if (pcOpenEdge) {
// remove the node and destroy the data
pcRoot->removeChild(pcOpenEdge);
pcOpenEdge = 0;
pcOpenEdge = nullptr;
}
if (show) {
@@ -2341,8 +2341,8 @@ PROPERTY_SOURCE(MeshGui::ViewProviderMeshObject, MeshGui::ViewProviderMesh)
ViewProviderMeshObject::ViewProviderMeshObject()
{
pcMeshNode = 0;
pcMeshShape = 0;
pcMeshNode = nullptr;
pcMeshShape = nullptr;
}
ViewProviderMeshObject::~ViewProviderMeshObject()
@@ -2381,7 +2381,7 @@ void ViewProviderMeshObject::showOpenEdges(bool show)
if (pcOpenEdge) {
// remove the node and destroy the data
pcRoot->removeChild(pcOpenEdge);
pcOpenEdge = 0;
pcOpenEdge = nullptr;
}
if (show) {

View File

@@ -97,8 +97,8 @@ public:
virtual ~ViewProviderExport();
virtual QIcon getIcon() const;
SoSeparator* getRoot(void) const {return nullptr;}
std::vector<std::string> getDisplayModes(void) const;
SoSeparator* getRoot() const {return nullptr;}
std::vector<std::string> getDisplayModes() const;
const char* getDefaultDisplayMode() const;
};
@@ -127,22 +127,22 @@ public:
virtual void attach(App::DocumentObject *);
virtual void updateData(const App::Property*);
virtual bool useNewSelectionModel(void) const {return false;}
virtual bool useNewSelectionModel() const {return false;}
Gui::SoFCSelection* getHighlightNode() const { return pcHighlight; }
virtual QIcon getIcon() const;
/// Sets the correct display mode
virtual void setDisplayMode(const char* ModeName);
/// returns a list of all possible modes
virtual std::vector<std::string> getDisplayModes(void) const;
virtual std::vector<std::string> getDisplayModes() const;
bool exportToVrml(const char* filename, const MeshCore::Material&, bool binary=false) const;
void exportMesh(const char* filename, const char* fmt=0) const;
void exportMesh(const char* filename, const char* fmt=nullptr) const;
void setupContextMenu(QMenu*, QObject*, const char*);
/// Get the python wrapper for that ViewProvider
PyObject* getPyObject();
/** @name Editing */
//@{
bool doubleClicked(void){ return false; }
bool doubleClicked(){ return false; }
bool isFacetSelected(Mesh::FacetIndex facet);
void selectComponent(Mesh::FacetIndex facet);
void deselectComponent(Mesh::FacetIndex facet);

View File

@@ -155,13 +155,13 @@ void ViewProviderMeshCurvature::onChanged(const App::Property* prop)
ViewProviderDocumentObject::onChanged(prop);
}
void ViewProviderMeshCurvature::hide(void)
void ViewProviderMeshCurvature::hide()
{
inherited::hide();
pcColorStyle->style = SoDrawStyle::INVISIBLE;
}
void ViewProviderMeshCurvature::show(void)
void ViewProviderMeshCurvature::show()
{
inherited::show();
pcColorStyle->style = SoDrawStyle::FILLED;
@@ -317,14 +317,14 @@ void ViewProviderMeshCurvature::updateData(const App::Property* prop)
}
}
SoSeparator* ViewProviderMeshCurvature::getFrontRoot(void) const
SoSeparator* ViewProviderMeshCurvature::getFrontRoot() const
{
return pcColorRoot;
}
void ViewProviderMeshCurvature::setVertexCurvatureMode(int mode)
{
Mesh::PropertyCurvatureList* pCurvInfo=0;
Mesh::PropertyCurvatureList* pCurvInfo=nullptr;
std::map<std::string,App::Property*> Map;
pcObject->getPropertyMap(Map);
for( std::map<std::string,App::Property*>::iterator it = Map.begin(); it != Map.end(); ++it ) {
@@ -389,7 +389,7 @@ const char* ViewProviderMeshCurvature::getDefaultDisplayMode() const
return "Absolute curvature";
}
std::vector<std::string> ViewProviderMeshCurvature::getDisplayModes(void) const
std::vector<std::string> ViewProviderMeshCurvature::getDisplayModes() const
{
std::vector<std::string> StrList = inherited::getDisplayModes();
@@ -436,7 +436,7 @@ public:
std::vector<App::DocumentObject*> groups = doc->getObjectsOfType
(App::DocumentObjectGroup::getClassTypeId());
App::DocumentObjectGroup* group = 0;
App::DocumentObjectGroup* group = nullptr;
std::string internalname = "CurvatureGroup";
for (std::vector<App::DocumentObject*>::iterator it = groups.begin(); it != groups.end(); ++it) {
if (internalname == (*it)->getNameInDocument()) {
@@ -503,7 +503,7 @@ void ViewProviderMeshCurvature::curvatureInfoCallback(void * ud, SoEventCallback
}
else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::UP) {
const SoPickedPoint * point = n->getPickedPoint();
if (point == NULL) {
if (point == nullptr) {
Base::Console().Message("No facet picked.\n");
return;
}
@@ -541,7 +541,7 @@ void ViewProviderMeshCurvature::curvatureInfoCallback(void * ud, SoEventCallback
}
else if (ev->getTypeId().isDerivedFrom(SoLocation2Event::getClassTypeId())) {
const SoPickedPoint * point = n->getPickedPoint();
if (point == NULL)
if (point == nullptr)
return;
n->setHandled();

View File

@@ -70,13 +70,13 @@ public:
/// Extracts the mesh data from the feature \a pcFeature and creates an Inventor node \a SoNode with these data.
void attach(App::DocumentObject* pcFeature);
virtual bool useNewSelectionModel(void) const {return false;}
virtual bool useNewSelectionModel() const {return false;}
/// Sets the viewing mode
void setDisplayMode(const char* ModeName);
/// get the default display mode
virtual const char* getDefaultDisplayMode() const;
/// Returns a list of all possible modes
std::vector<std::string> getDisplayModes(void) const;
std::vector<std::string> getDisplayModes() const;
/// Updates the mesh feature representation
void updateData(const App::Property*);
/// Returns a pixmap for the associated feature type
@@ -84,11 +84,11 @@ public:
/// Once the color bar settinhs has been changed this method gets called to update the feature's representation
void OnChange(Base::Subject<int> &rCaller,int rcReason);
/// Returns a color bar
SoSeparator* getFrontRoot(void) const;
SoSeparator* getFrontRoot() const;
/// Hide the object in the view
virtual void hide(void);
virtual void hide();
/// Show the object in the view
virtual void show(void);
virtual void show();
public:
static void curvatureInfoCallback(void * ud, SoEventCallback * n);

View File

@@ -36,7 +36,7 @@
using namespace MeshGui;
// returns a string which represents the object e.g. when printed in python
std::string ViewProviderMeshPy::representation(void) const
std::string ViewProviderMeshPy::representation() const
{
std::stringstream str;
str << "<View provider object at " << getViewProviderDocumentObjectPtr() << ">";
@@ -48,7 +48,7 @@ PyObject* ViewProviderMeshPy::setSelection(PyObject *args)
{
PyObject* obj;
if (!PyArg_ParseTuple(args, "O", &obj))
return 0;
return nullptr;
Py::Sequence list(obj);
std::vector<Mesh::FacetIndex> selection;
@@ -68,7 +68,7 @@ PyObject* ViewProviderMeshPy::addSelection(PyObject *args)
{
PyObject* obj;
if (!PyArg_ParseTuple(args, "O", &obj))
return 0;
return nullptr;
Py::Sequence list(obj);
std::vector<Mesh::FacetIndex> selection;
@@ -88,7 +88,7 @@ PyObject* ViewProviderMeshPy::removeSelection(PyObject *args)
{
PyObject* obj;
if (!PyArg_ParseTuple(args, "O", &obj))
return 0;
return nullptr;
Py::Sequence list(obj);
std::vector<Mesh::FacetIndex> selection;
@@ -107,7 +107,7 @@ PyObject* ViewProviderMeshPy::removeSelection(PyObject *args)
PyObject* ViewProviderMeshPy::invertSelection(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
ViewProviderMesh* vp = getViewProviderMeshPtr();
vp->invertSelection();
@@ -117,7 +117,7 @@ PyObject* ViewProviderMeshPy::invertSelection(PyObject *args)
PyObject* ViewProviderMeshPy::clearSelection(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
ViewProviderMesh* vp = getViewProviderMeshPtr();
vp->clearSelection();
@@ -128,7 +128,7 @@ PyObject* ViewProviderMeshPy::highlightSegments(PyObject *args)
{
PyObject* list;
if (!PyArg_ParseTuple(args, "O", &list))
return 0;
return nullptr;
App::PropertyColorList colors;
colors.setPyObject(list);
@@ -140,7 +140,7 @@ PyObject* ViewProviderMeshPy::highlightSegments(PyObject *args)
PyObject *ViewProviderMeshPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int ViewProviderMeshPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -106,7 +106,7 @@ const char* ViewProviderMeshTransform::getDefaultDisplayMode() const
return "Transform";
}
std::vector<std::string> ViewProviderMeshTransform::getDisplayModes(void) const
std::vector<std::string> ViewProviderMeshTransform::getDisplayModes() const
{
std::vector<std::string> StrList = ViewProviderMesh::getDisplayModes();
StrList.push_back("Transform");

View File

@@ -65,7 +65,7 @@ public:
/// get the default display mode
virtual const char* getDefaultDisplayMode() const;
/// returns a list of all possible modes
virtual std::vector<std::string> getDisplayModes(void) const;
virtual std::vector<std::string> getDisplayModes() const;
/// Update the Mesh representation
virtual void updateData(const App::Property*);

View File

@@ -65,8 +65,8 @@ ViewProviderMeshTransformDemolding::ViewProviderMeshTransformDemolding()
{
pcTrackballDragger = new SoTrackballDragger;
pcTrackballDragger->ref();
pcTransformDrag = 0;
pcColorMat = 0;
pcTransformDrag = nullptr;
pcColorMat = nullptr;
}
ViewProviderMeshTransformDemolding::~ViewProviderMeshTransformDemolding()
@@ -131,7 +131,7 @@ void ViewProviderMeshTransformDemolding::attach(App::DocumentObject *pcFeat)
//SbVector3f Center = boxAction->getCenter();
}
void ViewProviderMeshTransformDemolding::calcNormalVector(void)
void ViewProviderMeshTransformDemolding::calcNormalVector()
{
const MeshKernel& cMesh = static_cast<Feature*>(pcObject)->Mesh.getValue().getKernel();
@@ -165,7 +165,6 @@ void ViewProviderMeshTransformDemolding::calcMaterialIndex(const SbRotation &rot
else {
// pcMeshFaces->materialIndex .set1Value(i, 0 );
}
}
}
@@ -179,7 +178,7 @@ void ViewProviderMeshTransformDemolding::sDragEndCallback(void *This, SoDragger
static_cast<ViewProviderMeshTransformDemolding*>(This)->DragEndCallback();
}
void ViewProviderMeshTransformDemolding::DragEndCallback(void)
void ViewProviderMeshTransformDemolding::DragEndCallback()
{
SbRotation rot = pcTrackballDragger->rotation.getValue();
calcMaterialIndex(rot);
@@ -188,7 +187,7 @@ void ViewProviderMeshTransformDemolding::DragEndCallback(void)
}
void ViewProviderMeshTransformDemolding::valueChangedCallback(void)
void ViewProviderMeshTransformDemolding::valueChangedCallback()
{
//Base::Console().Log("Value change Callback\n");
//setTransformation(pcTrackballDragger->getMotionMatrix());
@@ -218,7 +217,7 @@ const char* ViewProviderMeshTransformDemolding::getDefaultDisplayMode() const
return "Demold";
}
std::vector<std::string> ViewProviderMeshTransformDemolding::getDisplayModes(void) const
std::vector<std::string> ViewProviderMeshTransformDemolding::getDisplayModes() const
{
std::vector<std::string> StrList = ViewProviderMesh::getDisplayModes();
StrList.push_back("Demold");

View File

@@ -70,17 +70,17 @@ public:
/// get the default display mode
virtual const char* getDefaultDisplayMode() const;
/// returns a list of all possible modes
virtual std::vector<std::string> getDisplayModes(void) const;
virtual std::vector<std::string> getDisplayModes() const;
protected:
void calcMaterialIndex(const SbRotation &rot);
void calcNormalVector(void);
void calcNormalVector();
static void sValueChangedCallback(void *, SoDragger *);
void valueChangedCallback(void);
void valueChangedCallback();
static void sDragEndCallback(void *, SoDragger *);
void DragEndCallback(void);
void DragEndCallback();
SoTrackballDragger *pcTrackballDragger;
SoTransform *pcTransformDrag;