Skip to content

Commit 578a563

Browse files
Merge branch 'develop'
2 parents 7c7f7a8 + 85409eb commit 578a563

File tree

146 files changed

+6774
-3192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+6774
-3192
lines changed

.cargo/config.toml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,23 @@
1010
# *with* FMA) in floating point calculations. This may cause some
1111
# drift from the same calculation performed in C++.
1212

13+
# NOTE: At the moment we only use SSE4.2, because it is most widely
14+
# supported by CPUs from the last 10-15 years and I was not able to
15+
# measure any conclusive improvement when using newer CPU instruction
16+
# sets.
17+
#
18+
# Other features that may provide improved performance;
19+
# +avx2
20+
# +fma
21+
1322
[target.x86_64-unknown-linux-gnu]
14-
rustflags = ["-C", "target-feature=+sse4.2,+avx2,+fma"]
23+
rustflags = ["-C", "target-feature=+sse4.2"]
1524

1625
[target.x86_64-unknown-linux-musl]
17-
rustflags = ["-C", "target-feature=+sse4.2,+avx2,+fma"]
26+
rustflags = ["-C", "target-feature=+sse4.2"]
1827

1928
[target.x86_64-pc-windows-msvc]
20-
rustflags = ["-C", "target-feature=-crt-static,+sse4.2,+avx2,+fma"]
29+
rustflags = ["-C", "target-feature=-crt-static,+sse4.2"]
2130

2231
[target.x86_64-pc-windows-gnu]
23-
rustflags = ["-C", "target-feature=-crt-static,+sse4.2,+avx2,+fma"]
32+
rustflags = ["-C", "target-feature=-crt-static,+sse4.2"]

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ cmake-build-*
1616
python/mmSolver/constant.py
1717
docs/source/conf.py
1818
compile_commands.json
19+
tools/lensdistortion/tests/test_output/*.exr
1920

2021
test*.pstat
2122
test*.txt

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ endif()
6060
project(mayaMatchMoveSolver)
6161
set(PROJECT_VERSION_MAJOR 0)
6262
set(PROJECT_VERSION_MINOR 5)
63-
set(PROJECT_VERSION_PATCH 6)
63+
set(PROJECT_VERSION_PATCH 7)
6464
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
6565
set(PROJECT_HOMEPAGE_URL "https://github.com/david-cattermole/mayaMatchMoveSolver")
6666
set(PROJECT_DESCRIPTION "Bundle Adjustment solver for MatchMove tasks in Autodesk Maya.")
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
=======================================
2+
mmSolver.tools.setviewportdisplaypreset
3+
=======================================
4+
5+
.. automodule:: mmSolver.tools.setviewportdisplaypreset
6+
:members:
7+
:undoc-members:
8+
9+
Tool
10+
++++
11+
12+
.. automodule:: mmSolver.tools.setviewportdisplaypreset.tool
13+
:members:
14+
:undoc-members:
15+
16+
Library
17+
+++++++
18+
19+
.. automodule:: mmSolver.tools.setviewportdisplaypreset.lib
20+
:members:
21+
:undoc-members:
22+
23+
Constant
24+
++++++++
25+
26+
.. automodule:: mmSolver.tools.setviewportdisplaypreset.constant
27+
:members:
28+
:undoc-members:

lib/cppbind/mmscenegraph/include/mmscenegraph/_cxxbridge.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,8 @@ namespace mmscenegraph {
826826
struct ShimSceneGraph;
827827
struct ShimFlatScene;
828828
struct ShimEvaluationObjects;
829+
enum class ControlPointDistribution : ::std::uint8_t;
830+
enum class Interpolation : ::std::uint8_t;
829831
}
830832

831833
namespace mmscenegraph {
@@ -1185,6 +1187,26 @@ struct ShimEvaluationObjects final : public ::rust::Opaque {
11851187
};
11861188
#endif // CXXBRIDGE1_STRUCT_mmscenegraph$ShimEvaluationObjects
11871189

1190+
#ifndef CXXBRIDGE1_ENUM_mmscenegraph$ControlPointDistribution
1191+
#define CXXBRIDGE1_ENUM_mmscenegraph$ControlPointDistribution
1192+
enum class ControlPointDistribution : ::std::uint8_t {
1193+
kUniform = 1,
1194+
kAutoKeypoints = 2,
1195+
kUnknown = 255,
1196+
};
1197+
#endif // CXXBRIDGE1_ENUM_mmscenegraph$ControlPointDistribution
1198+
1199+
#ifndef CXXBRIDGE1_ENUM_mmscenegraph$Interpolation
1200+
#define CXXBRIDGE1_ENUM_mmscenegraph$Interpolation
1201+
enum class Interpolation : ::std::uint8_t {
1202+
kLinear = 1,
1203+
kQuadraticNUBS = 2,
1204+
kCubicNUBS = 3,
1205+
kCubicSpline = 4,
1206+
kUnknown = 255,
1207+
};
1208+
#endif // CXXBRIDGE1_ENUM_mmscenegraph$Interpolation
1209+
11881210
MMSCENEGRAPH_API_EXPORT ::rust::Box<::mmscenegraph::ShimAttrDataBlock> shim_create_attr_data_block_box() noexcept;
11891211

11901212
MMSCENEGRAPH_API_EXPORT ::rust::Box<::mmscenegraph::ShimSceneGraph> shim_create_scene_graph_box() noexcept;
@@ -1206,4 +1228,6 @@ MMSCENEGRAPH_API_EXPORT bool shim_fit_plane_to_points(::rust::Slice<const double
12061228
MMSCENEGRAPH_API_EXPORT bool shim_detect_curve_pops(::rust::Slice<const double> x_values, ::rust::Slice<const double> y_values, double threshold, ::rust::Vec<double> &out_x_values, ::rust::Vec<double> &out_y_values) noexcept;
12071229

12081230
MMSCENEGRAPH_API_EXPORT bool shim_filter_curve_pops(::rust::Slice<const double> x_values, ::rust::Slice<const double> y_values, double threshold, ::rust::Vec<double> &out_x_values, ::rust::Vec<double> &out_y_values) noexcept;
1231+
1232+
MMSCENEGRAPH_API_EXPORT bool shim_curve_simplify(::rust::Slice<const double> x_values, ::rust::Slice<const double> y_values, ::std::size_t control_point_count, ::mmscenegraph::ControlPointDistribution distribution, ::mmscenegraph::Interpolation interpolation_method, ::rust::Vec<double> &out_x_values, ::rust::Vec<double> &out_y_values) noexcept;
12091233
} // namespace mmscenegraph
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (C) 2025 David Cattermole.
3+
*
4+
* This file is part of mmSolver.
5+
*
6+
* mmSolver is free software: you can redistribute it and/or modify it
7+
* under the terms of the GNU Lesser General Public License as
8+
* published by the Free Software Foundation, either version 3 of the
9+
* License, or (at your option) any later version.
10+
*
11+
* mmSolver is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public License
17+
* along with mmSolver. If not, see <https://www.gnu.org/licenses/>.
18+
* ====================================================================
19+
*
20+
*/
21+
22+
#ifndef MM_SOLVER_MM_SCENE_GRAPH_CURVE_SIMPLIFY_H
23+
#define MM_SOLVER_MM_SCENE_GRAPH_CURVE_SIMPLIFY_H
24+
25+
#include "_cxx.h"
26+
#include "_cxxbridge.h"
27+
#include "_symbol_export.h"
28+
#include "_types.h"
29+
30+
namespace mmscenegraph {
31+
32+
MMSCENEGRAPH_API_EXPORT
33+
bool curve_simplify(rust::Slice<const Real> &values_x,
34+
rust::Slice<const Real> &values_y,
35+
const size_t control_point_count,
36+
const ControlPointDistribution distribution,
37+
const Interpolation interpolation_method,
38+
rust::Vec<Real> &out_values_x,
39+
rust::Vec<Real> &out_values_y) noexcept;
40+
41+
} // namespace mmscenegraph
42+
43+
#endif // MM_SOLVER_MM_SCENE_GRAPH_CURVE_SIMPLIFY_H

lib/cppbind/mmscenegraph/include/mmscenegraph/mmscenegraph.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "_types.h"
2828
#include "attrdatablock.h"
2929
#include "curve_detect_pops.h"
30+
#include "curve_simplify.h"
3031
#include "fit_plane.h"
3132
#include "flatscene.h"
3233
#include "line.h"

lib/cppbind/mmscenegraph/src/_cxxbridge.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,8 @@ namespace mmscenegraph {
854854
struct ShimSceneGraph;
855855
struct ShimFlatScene;
856856
struct ShimEvaluationObjects;
857+
enum class ControlPointDistribution : ::std::uint8_t;
858+
enum class Interpolation : ::std::uint8_t;
857859
}
858860

859861
namespace mmscenegraph {
@@ -1213,6 +1215,26 @@ struct ShimEvaluationObjects final : public ::rust::Opaque {
12131215
};
12141216
#endif // CXXBRIDGE1_STRUCT_mmscenegraph$ShimEvaluationObjects
12151217

1218+
#ifndef CXXBRIDGE1_ENUM_mmscenegraph$ControlPointDistribution
1219+
#define CXXBRIDGE1_ENUM_mmscenegraph$ControlPointDistribution
1220+
enum class ControlPointDistribution : ::std::uint8_t {
1221+
kUniform = 1,
1222+
kAutoKeypoints = 2,
1223+
kUnknown = 255,
1224+
};
1225+
#endif // CXXBRIDGE1_ENUM_mmscenegraph$ControlPointDistribution
1226+
1227+
#ifndef CXXBRIDGE1_ENUM_mmscenegraph$Interpolation
1228+
#define CXXBRIDGE1_ENUM_mmscenegraph$Interpolation
1229+
enum class Interpolation : ::std::uint8_t {
1230+
kLinear = 1,
1231+
kQuadraticNUBS = 2,
1232+
kCubicNUBS = 3,
1233+
kCubicSpline = 4,
1234+
kUnknown = 255,
1235+
};
1236+
#endif // CXXBRIDGE1_ENUM_mmscenegraph$Interpolation
1237+
12161238
extern "C" {
12171239
bool mmscenegraph$cxxbridge1$Point3$operator$eq(const Point3 &, const Point3 &) noexcept;
12181240
bool mmscenegraph$cxxbridge1$Point3$operator$ne(const Point3 &, const Point3 &) noexcept;
@@ -1344,6 +1366,8 @@ bool mmscenegraph$cxxbridge1$shim_fit_plane_to_points(::rust::Slice<const double
13441366
bool mmscenegraph$cxxbridge1$shim_detect_curve_pops(::rust::Slice<const double> x_values, ::rust::Slice<const double> y_values, double threshold, ::rust::Vec<double> &out_x_values, ::rust::Vec<double> &out_y_values) noexcept;
13451367

13461368
bool mmscenegraph$cxxbridge1$shim_filter_curve_pops(::rust::Slice<const double> x_values, ::rust::Slice<const double> y_values, double threshold, ::rust::Vec<double> &out_x_values, ::rust::Vec<double> &out_y_values) noexcept;
1369+
1370+
bool mmscenegraph$cxxbridge1$shim_curve_simplify(::rust::Slice<const double> x_values, ::rust::Slice<const double> y_values, ::std::size_t control_point_count, ::mmscenegraph::ControlPointDistribution distribution, ::mmscenegraph::Interpolation interpolation_method, ::rust::Vec<double> &out_x_values, ::rust::Vec<double> &out_y_values) noexcept;
13471371
} // extern "C"
13481372
} // namespace mmscenegraph
13491373

@@ -1786,6 +1810,10 @@ MMSCENEGRAPH_API_EXPORT bool shim_detect_curve_pops(::rust::Slice<const double>
17861810
MMSCENEGRAPH_API_EXPORT bool shim_filter_curve_pops(::rust::Slice<const double> x_values, ::rust::Slice<const double> y_values, double threshold, ::rust::Vec<double> &out_x_values, ::rust::Vec<double> &out_y_values) noexcept {
17871811
return mmscenegraph$cxxbridge1$shim_filter_curve_pops(x_values, y_values, threshold, out_x_values, out_y_values);
17881812
}
1813+
1814+
MMSCENEGRAPH_API_EXPORT bool shim_curve_simplify(::rust::Slice<const double> x_values, ::rust::Slice<const double> y_values, ::std::size_t control_point_count, ::mmscenegraph::ControlPointDistribution distribution, ::mmscenegraph::Interpolation interpolation_method, ::rust::Vec<double> &out_x_values, ::rust::Vec<double> &out_y_values) noexcept {
1815+
return mmscenegraph$cxxbridge1$shim_curve_simplify(x_values, y_values, control_point_count, distribution, interpolation_method, out_x_values, out_y_values);
1816+
}
17891817
} // namespace mmscenegraph
17901818

17911819
extern "C" {

lib/cppbind/mmscenegraph/src/curve_detect_pops.rs

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
// ====================================================================
1919
//
2020

21+
use crate::shim_utilities::copy_vec_xy_to_x_y;
22+
2123
use mmscenegraph_rust::constant::Real as CoreReal;
2224
use mmscenegraph_rust::curve::detect::pops::detect_curve_pops as core_detect_curve_pops;
2325
use mmscenegraph_rust::curve::detect::pops::filter_curve_pops as core_filter_curve_pops;
@@ -29,25 +31,10 @@ pub fn shim_detect_curve_pops(
2931
out_x_values: &mut Vec<CoreReal>,
3032
out_y_values: &mut Vec<CoreReal>,
3133
) -> bool {
32-
let result = core_detect_curve_pops(&x_values, &y_values, threshold);
34+
let result = core_detect_curve_pops(x_values, y_values, threshold);
3335
match result {
3436
Ok(values) => {
35-
let new_x_capacity =
36-
values.len().saturating_sub(out_x_values.capacity());
37-
let new_y_capacity =
38-
values.len().saturating_sub(out_y_values.capacity());
39-
out_x_values.reserve_exact(new_x_capacity);
40-
out_y_values.reserve_exact(new_y_capacity);
41-
out_x_values.clear();
42-
out_y_values.clear();
43-
44-
for value in values.iter() {
45-
let x = value.0;
46-
let y = value.1;
47-
out_x_values.push(x);
48-
out_y_values.push(y);
49-
}
50-
37+
copy_vec_xy_to_x_y(&values, out_x_values, out_y_values);
5138
true
5239
}
5340
Err(_) => false,
@@ -61,25 +48,10 @@ pub fn shim_filter_curve_pops(
6148
out_x_values: &mut Vec<CoreReal>,
6249
out_y_values: &mut Vec<CoreReal>,
6350
) -> bool {
64-
let result = core_filter_curve_pops(&x_values, &y_values, threshold);
51+
let result = core_filter_curve_pops(x_values, y_values, threshold);
6552
match result {
6653
Ok(values) => {
67-
let new_x_capacity =
68-
values.len().saturating_sub(out_x_values.capacity());
69-
let new_y_capacity =
70-
values.len().saturating_sub(out_y_values.capacity());
71-
out_x_values.reserve_exact(new_x_capacity);
72-
out_y_values.reserve_exact(new_y_capacity);
73-
out_x_values.clear();
74-
out_y_values.clear();
75-
76-
for value in values.iter() {
77-
let x = value.0;
78-
let y = value.1;
79-
out_x_values.push(x);
80-
out_y_values.push(y);
81-
}
82-
54+
copy_vec_xy_to_x_y(&values, out_x_values, out_y_values);
8355
true
8456
}
8557
Err(_) => false,
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (C) 2025 David Cattermole.
3+
*
4+
* This file is part of mmSolver.
5+
*
6+
* mmSolver is free software: you can redistribute it and/or modify it
7+
* under the terms of the GNU Lesser General Public License as
8+
* published by the Free Software Foundation, either version 3 of the
9+
* License, or (at your option) any later version.
10+
*
11+
* mmSolver is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public License
17+
* along with mmSolver. If not, see <https://www.gnu.org/licenses/>.
18+
* ====================================================================
19+
*
20+
*/
21+
22+
#include <mmscenegraph/_cxx.h>
23+
#include <mmscenegraph/_cxxbridge.h>
24+
#include <mmscenegraph/curve_simplify.h>
25+
26+
namespace mmscenegraph {
27+
28+
MMSCENEGRAPH_API_EXPORT
29+
bool curve_simplify(rust::Slice<const Real> &values_x,
30+
rust::Slice<const Real> &values_y,
31+
const size_t control_point_count,
32+
const ControlPointDistribution distribution,
33+
const Interpolation interpolation_method,
34+
rust::Vec<Real> &out_values_x,
35+
rust::Vec<Real> &out_values_y) noexcept {
36+
return shim_curve_simplify(values_x, values_y, control_point_count,
37+
distribution, interpolation_method, out_values_x,
38+
out_values_y);
39+
}
40+
41+
} // namespace mmscenegraph

0 commit comments

Comments
 (0)