Points: modernize C++11
* remove redundant void-arg * use nullptr
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
#include <Mod/Points/App/PropertyPointKernel.h>
|
||||
|
||||
// use a different name to CreateCommand()
|
||||
void CreatePointsCommands(void);
|
||||
void CreatePointsCommands();
|
||||
|
||||
void loadPointsResource()
|
||||
{
|
||||
@@ -74,7 +74,7 @@ PyMOD_INIT_FUNC(PointsGui)
|
||||
{
|
||||
if (!Gui::Application::Instance) {
|
||||
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
|
||||
PyMOD_Return(0);
|
||||
PyMOD_Return(nullptr);
|
||||
}
|
||||
|
||||
// load dependent module
|
||||
@@ -83,7 +83,7 @@ PyMOD_INIT_FUNC(PointsGui)
|
||||
}
|
||||
catch(const Base::Exception& e) {
|
||||
PyErr_SetString(PyExc_ImportError, e.what());
|
||||
PyMOD_Return(0);
|
||||
PyMOD_Return(nullptr);
|
||||
}
|
||||
|
||||
Base::Console().Log("Loading GUI of Points module... done\n");
|
||||
|
||||
@@ -96,7 +96,7 @@ void CmdPointsImport::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
bool CmdPointsImport::isActive(void)
|
||||
bool CmdPointsImport::isActive()
|
||||
{
|
||||
if (getActiveGuiDocument())
|
||||
return true;
|
||||
@@ -139,7 +139,7 @@ void CmdPointsExport::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
bool CmdPointsExport::isActive(void)
|
||||
bool CmdPointsExport::isActive()
|
||||
{
|
||||
return getSelection().countObjectsOfType(Points::Feature::getClassTypeId()) > 0;
|
||||
}
|
||||
@@ -176,7 +176,7 @@ void CmdPointsTransform::activated(int iMsg)
|
||||
commitCommand();
|
||||
}
|
||||
|
||||
bool CmdPointsTransform::isActive(void)
|
||||
bool CmdPointsTransform::isActive()
|
||||
{
|
||||
return getSelection().countObjectsOfType(Points::Feature::getClassTypeId()) > 0;
|
||||
}
|
||||
@@ -227,7 +227,7 @@ void CmdPointsConvert::activated(int iMsg)
|
||||
std::vector<Base::Vector3d> normals;
|
||||
data->getPoints(vertexes, normals, static_cast<float>(tol));
|
||||
if (!vertexes.empty()) {
|
||||
Points::Feature* fea = 0;
|
||||
Points::Feature* fea = nullptr;
|
||||
if (vertexes.size() == normals.size()) {
|
||||
fea = static_cast<Points::Feature*>(Base::Type::fromName("Points::FeatureCustom").createInstance());
|
||||
if (!fea) {
|
||||
@@ -268,7 +268,7 @@ void CmdPointsConvert::activated(int iMsg)
|
||||
abortCommand();
|
||||
}
|
||||
|
||||
bool CmdPointsConvert::isActive(void)
|
||||
bool CmdPointsConvert::isActive()
|
||||
{
|
||||
return getSelection().countObjectsOfType(Base::Type::fromName("App::GeoFeature")) > 0;
|
||||
}
|
||||
@@ -312,7 +312,7 @@ void CmdPointsPolyCut::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
bool CmdPointsPolyCut::isActive(void)
|
||||
bool CmdPointsPolyCut::isActive()
|
||||
{
|
||||
// Check for the selected mesh feature (all Mesh types)
|
||||
return getSelection().countObjectsOfType(Points::Feature::getClassTypeId()) > 0;
|
||||
@@ -356,7 +356,7 @@ void CmdPointsMerge::activated(int iMsg)
|
||||
updateActive();
|
||||
}
|
||||
|
||||
bool CmdPointsMerge::isActive(void)
|
||||
bool CmdPointsMerge::isActive()
|
||||
{
|
||||
return getSelection().countObjectsOfType(Points::Feature::getClassTypeId()) > 1;
|
||||
}
|
||||
@@ -464,12 +464,12 @@ void CmdPointsStructure::activated(int iMsg)
|
||||
updateActive();
|
||||
}
|
||||
|
||||
bool CmdPointsStructure::isActive(void)
|
||||
bool CmdPointsStructure::isActive()
|
||||
{
|
||||
return getSelection().countObjectsOfType(Points::Feature::getClassTypeId()) == 1;
|
||||
}
|
||||
|
||||
void CreatePointsCommands(void)
|
||||
void CreatePointsCommands()
|
||||
{
|
||||
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
|
||||
rcCmdMgr.addCommand(new CmdPointsImport());
|
||||
|
||||
@@ -247,7 +247,7 @@ void ViewProviderPoints::setDisplayMode(const char* ModeName)
|
||||
ViewProviderGeometryObject::setDisplayMode(ModeName);
|
||||
}
|
||||
|
||||
std::vector<std::string> ViewProviderPoints::getDisplayModes(void) const
|
||||
std::vector<std::string> ViewProviderPoints::getDisplayModes() const
|
||||
{
|
||||
std::vector<std::string> StrList;
|
||||
StrList.push_back("Points");
|
||||
@@ -650,8 +650,8 @@ template class PointsGuiExport ViewProviderPythonFeatureT<PointsGui::ViewProvide
|
||||
|
||||
void ViewProviderPointsBuilder::buildNodes(const App::Property* prop, std::vector<SoNode*>& nodes) const
|
||||
{
|
||||
SoCoordinate3 *pcPointsCoord=0;
|
||||
SoPointSet *pcPoints=0;
|
||||
SoCoordinate3 *pcPointsCoord=nullptr;
|
||||
SoPointSet *pcPoints=nullptr;
|
||||
|
||||
if (nodes.empty()) {
|
||||
pcPointsCoord = new SoCoordinate3();
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
/// set the viewing 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;
|
||||
virtual QIcon getIcon() const;
|
||||
|
||||
/// Sets the edit mnode
|
||||
|
||||
Reference in New Issue
Block a user