Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: 'CloudCompare/CloudCompare'
ref: 5d00ea5d4040d9485b0b52c769f0b0aae01de296
ref: d977b9460fd2ed13d3c82925c4521cca49e79da8
submodules: recursive

- name: Clone PythonRuntime
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: 'CloudCompare/CloudCompare'
ref: 5d00ea5d4040d9485b0b52c769f0b0aae01de296
ref: d977b9460fd2ed13d3c82925c4521cca49e79da8
submodules: recursive

- name: Clone PythonRuntime
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: 'CloudCompare/CloudCompare'
ref: 5d00ea5d4040d9485b0b52c769f0b0aae01de296
ref: d977b9460fd2ed13d3c82925c4521cca49e79da8
submodules: recursive

- name: Clone PythonRuntime
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CodeQL.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: 'CloudCompare/CloudCompare'
ref: 5d00ea5d4040d9485b0b52c769f0b0aae01de296
ref: d977b9460fd2ed13d3c82925c4521cca49e79da8
submodules: recursive

- name: Clone PythonRuntime
Expand Down
2 changes: 1 addition & 1 deletion src/PythonPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ QList<QAction *> PythonPlugin::getActions()
QStringList loaded_paths =
settings->value(QStringLiteral("RegisterListPath")).value<QStringList>();

for (QString path : loaded_paths)
for (const QString& path : loaded_paths)
{
QFileInfo fi(path);
if (!fi.exists())
Expand Down
4 changes: 2 additions & 2 deletions src/Utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ inline void LogPythonPath()
char *cPythonPath = Py_EncodeLocale(pythonPath, &errPos);
if (cPythonPath)
{
ccLog::Print("[PythonRuntime] PythonPath is set to: %s", cPythonPath);
ccLog::Printf("[PythonRuntime] PythonPath is set to: %s", cPythonPath);
PyMem_Free(cPythonPath);
}
else
Expand All @@ -163,7 +163,7 @@ inline void LogPythonHome()
char *cPythonHome = Py_EncodeLocale(pythonHome, &errPos);
if (cPythonHome)
{
ccLog::Print("[PythonRuntime] PythonHome is set to: %s", cPythonHome);
ccLog::Printf("[PythonRuntime] PythonHome is set to: %s", cPythonHome);
PyMem_Free(cPythonHome);
}
else
Expand Down
2 changes: 1 addition & 1 deletion wrapper/pycc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if(PYCC_IS_MASTER_PROJECT)
GIT_REPOSITORY https://github.com/CloudCompare/CloudCompare
GIT_SUBMODULES "libs/qCC_db/extern/CCCoreLib;libs/CCAppCommon/QDarkStyleSheet;plugins/core/IO/MeshIO;"
GIT_PROGRESS ON
GIT_TAG 5d00ea5d4040d9485b0b52c769f0b0aae01de296
GIT_TAG d977b9460fd2ed13d3c82925c4521cca49e79da8
GIT_SHALLOW OFF
GIT_SUBMODULES
)
Expand Down
4 changes: 2 additions & 2 deletions wrapper/pycc/src/PyPrintLogger.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "PyPrintLogger.h"

void PyPrintLogger::logMessage(const QString &message, int level)
void PyPrintLogger::logMessage(const Message &message)
{
std::lock_guard<std::mutex> guard(m_lock);
const std::string stdMsg = message.toStdString();
const std::string stdMsg = message.text.toStdString();
py::print(stdMsg.c_str());
}
2 changes: 1 addition & 1 deletion wrapper/pycc/src/PyPrintLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class PyPrintLogger : public ccLog

~PyPrintLogger() override = default;

void logMessage(const QString &message, int level) override;
void logMessage(const Message &message) override;

private:
std::mutex m_lock;
Expand Down
4 changes: 2 additions & 2 deletions wrapper/pycc/src/pycc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void define_pycc(py::module &m)
}
catch (std::exception &e)
{
ccLog::Print("Failed to import wrapped plugins: ", e.what());
ccLog::Printf("Failed to import wrapped plugins: %s", e.what());
}

#ifdef DEFINE_PYCC_RUNTIME
Expand All @@ -215,7 +215,7 @@ void define_pycc(py::module &m)
}
catch (std::exception &e)
{
ccLog::Print("Failed to import pycc_runtime content: ", e.what());
ccLog::Printf("Failed to import pycc_runtime content: %s", e.what());
}
#endif
}
Expand Down
1 change: 0 additions & 1 deletion wrapper/pycc/src/qcc_db/ccColorScalesManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ void define_ccColorScalesManager(py::module &m)
.def_static("GetUniqueInstance",
&ccColorScalesManager::GetUniqueInstance,
py::return_value_policy::reference)
.def_static("ReleaseUniqueInstance", &ccColorScalesManager::ReleaseUniqueInstance)
.def_static("GetDefaultScaleUUID", &ccColorScalesManager::GetDefaultScaleUUID, "scale"_a)
.def_static("GetDefaultScale",
&ccColorScalesManager::GetDefaultScale,
Expand Down
6 changes: 3 additions & 3 deletions wrapper/pycc/src/qcc_db/ccGenericMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ void define_ccGenericMesh(py::module &m)
"getTriangleTexCoordinates",
[](ccGenericMesh &self, unsigned triIndex)
{
TexCoords2D *tx1, *tx2, *tx3;
const TexCoords2D *tx1, *tx2, *tx3;
self.getTriangleTexCoordinates(triIndex, tx1, tx2, tx3);
return py::make_tuple(tx1, tx2, tx2);
return py::make_tuple(tx1, tx2, tx3);
},
"triIndex"_a,
py::return_value_policy::reference)
Expand Down Expand Up @@ -75,7 +75,7 @@ void define_ccGenericMesh(py::module &m)
"getTriangleNormals",
[](ccGenericMesh &self, unsigned triangleIndex)
{
CCVector3 Na, Nb, Nc;
const CCVector3 *Na = nullptr, *Nb = nullptr, *Nc = nullptr;
self.getTriangleNormals(triangleIndex, Na, Nb, Nc);
return py::make_tuple(Na, Nb, Nc);
},
Expand Down
5 changes: 4 additions & 1 deletion wrapper/pycc/src/qcc_db/ccLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void define_ccLog(py::module &m)
Use one of the static method to log a message
)pbdoc");
PyccLog.def_static("TheInstance", &ccLog::TheInstance, py::return_value_policy::reference);
PyccLog.def_static("LogMessage", &ccLog::LogMessage, "message"_a, "level"_a, R"pbdoc(
PyccLog.def_static("LogMessage", &ccLog::LogMessage, "message"_a, "level"_a, "time_ns"_a=-1, R"pbdoc(
Logs a message with the given level.

Parameters
Expand All @@ -43,6 +43,9 @@ void define_ccLog(py::module &m)
The message to log
level: pycc.ccLog.MessageLevelFlags
The severity level of the message
time_ns: int
Timestamp in nanoseconds. default to -1, compute the timestamp as the elapsed time since
ccLog::statt().

Example
-------
Expand Down
1 change: 0 additions & 1 deletion wrapper/pycc/src/qcc_db/ccNormalVectors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ void define_ccNormalVectors(py::module &m)
py::class_<ccNormalVectors> pyNormalVectors(m, "ccNormalVectors");

pyNormalVectors.def_static("GetUniqueInstance", &ccNormalVectors::GetUniqueInstance)
.def_static("ReleaseUniqueInstance", &ccNormalVectors::ReleaseUniqueInstance)
.def_static("GetNumberOfVectors", &ccNormalVectors::GetNumberOfVectors)
.def_static("GetNormal", &ccNormalVectors::GetNormal, "normIndex"_a)
.def("getNormal", &ccNormalVectors::getNormal, "normIndex"_a)
Expand Down
Loading