[Points] minor style fixes by MSVC

This commit is contained in:
Uwe
2021-12-17 02:39:47 +01:00
parent 86ee738dff
commit 5de15267f5

View File

@@ -52,13 +52,13 @@ class Module : public Py::ExtensionModule<Module>
public:
Module() : Py::ExtensionModule<Module>("Points")
{
add_varargs_method("open",&Module::open
add_varargs_method("open", &Module::open
);
add_varargs_method("insert",&Module::importer
add_varargs_method("insert", &Module::importer
);
add_varargs_method("export",&Module::exporter
add_varargs_method("export", &Module::exporter
);
add_varargs_method("show",&Module::show,
add_varargs_method("show", &Module::show,
"show(points,[string]) -- Add the points to the active document or create one if no document exists."
);
initialize("This module is the Points module."); // register with Python
@@ -70,8 +70,8 @@ private:
std::tuple<bool, bool, float> readE57Settings() const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Points/E57");
bool useColor = hGrp->GetBool("UseColor", true);
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Points/E57");
bool useColor = hGrp->GetBool("UseColor", true);
bool checkState = hGrp->GetBool("CheckInvalidState", true);
float minDistance = hGrp->GetFloat("MinDistance", -1.);
@@ -80,13 +80,13 @@ private:
Py::Object open(const Py::Tuple& args)
{
char* Name;
if (!PyArg_ParseTuple(args.ptr(), "et","utf-8",&Name))
if (!PyArg_ParseTuple(args.ptr(), "et", "utf-8", &Name))
throw Py::Exception();
std::string EncodedName = std::string(Name);
PyMem_Free(Name);
try {
Base::Console().Log("Open in Points with %s",EncodedName.c_str());
Base::Console().Log("Open in Points with %s", EncodedName.c_str());
Base::FileInfo file(EncodedName.c_str());
// extract ending
@@ -113,9 +113,9 @@ private:
reader->read(EncodedName);
App::Document *pcDoc = App::GetApplication().newDocument("Unnamed");
App::Document* pcDoc = App::GetApplication().newDocument("Unnamed");
Points::Feature *pcFeature = 0;
Points::Feature* pcFeature = 0;
if (reader->hasProperties()) {
// Scattered or structured points?
if (reader->isStructured()) {
@@ -196,13 +196,13 @@ private:
{
char* Name;
const char* DocName;
if (!PyArg_ParseTuple(args.ptr(), "ets","utf-8",&Name,&DocName))
if (!PyArg_ParseTuple(args.ptr(), "ets", "utf-8", &Name, &DocName))
throw Py::Exception();
std::string EncodedName = std::string(Name);
PyMem_Free(Name);
try {
Base::Console().Log("Import in Points with %s",EncodedName.c_str());
Base::Console().Log("Import in Points with %s", EncodedName.c_str());
Base::FileInfo file(EncodedName.c_str());
// extract ending
@@ -229,12 +229,12 @@ private:
reader->read(EncodedName);
App::Document *pcDoc = App::GetApplication().getDocument(DocName);
App::Document* pcDoc = App::GetApplication().getDocument(DocName);
if (!pcDoc) {
pcDoc = App::GetApplication().newDocument(DocName);
}
Points::Feature *pcFeature = 0;
Points::Feature* pcFeature = 0;
if (reader->hasProperties()) {
// Scattered or structured points?
if (reader->isStructured()) {
@@ -287,7 +287,7 @@ private:
pcFeature->purgeTouched();
}
else {
Points::Feature *pcFeature = static_cast<Points::Feature*>
Points::Feature* pcFeature = static_cast<Points::Feature*>
(pcDoc->addObject("Points::Feature", file.fileNamePure().c_str()));
pcFeature->Points.setValue(reader->getPoints());
pcDoc->recomputeFeature(pcFeature);
@@ -303,8 +303,8 @@ private:
Py::Object exporter(const Py::Tuple& args)
{
PyObject *object;
char *Name;
PyObject* object;
char* Name;
if (!PyArg_ParseTuple(args.ptr(), "Oet", &object, "utf-8", &Name))
throw Py::Exception();
@@ -390,17 +390,17 @@ private:
Py::Object show(const Py::Tuple& args)
{
PyObject *pcObj;
char *name = "Points";
PyObject* pcObj;
char* name = "Points";
if (!PyArg_ParseTuple(args.ptr(), "O!|s", &(PointsPy::Type), &pcObj, &name))
throw Py::Exception();
try {
App::Document *pcDoc = App::GetApplication().getActiveDocument();
App::Document* pcDoc = App::GetApplication().getActiveDocument();
if (!pcDoc)
pcDoc = App::GetApplication().newDocument();
PointsPy* pPoints = static_cast<PointsPy*>(pcObj);
Points::Feature *pcFeature = static_cast<Points::Feature*>(pcDoc->addObject("Points::Feature", name));
Points::Feature* pcFeature = static_cast<Points::Feature*>(pcDoc->addObject("Points::Feature", name));
// copy the data
pcFeature->Points.setValue(*(pPoints->getPointKernelPtr()));
}