add VectorOfVectorOfPoint3
MODIFY
gen_rust.py
gen_rust.py
@@ -112,6 +112,9 @@ decls_manual_pre = {
("typedef DummyVectorOfPoint3i", "std::vector<Point3i>", [], []),
("typedef DummyVectorOfPoint3f", "std::vector<Point3f>", [], []),
("typedef DummyVectorOfPoint3d", "std::vector<Point3d>", [], []),
+ ("typedef DummyVectorOfVectorOfPoint3i", "std::vector<std::vector<Point3i>>", [], []),
+ ("typedef DummyVectorOfVectorOfPoint3f", "std::vector<std::vector<Point3f>>", [], []),
+ ("typedef DummyVectorOfVectorOfPoint3d", "std::vector<std::vector<Point3d>>", [], []),
],
"dnn": [
("class cv.dnn.LayerParams", "", ["/Ghost"], []),

MODIFY
tests/vector.rs
tests/vector.rs
use matches::assert_matches;
use opencv::{
- core::{self, Point2d, Scalar},
+ core::{self, Point2d, Point3i, Scalar},
Error,
prelude::*,
Result,
- types::{VectorOfbool, VectorOfchar, VectorOfdouble, VectorOfint, VectorOfMat, VectorOfPoint2d, VectorOfString, VectorOfuchar},
+ types::{
+ VectorOfbool,
+ VectorOfchar,
+ VectorOfdouble,
+ VectorOfint,
+ VectorOfMat,
+ VectorOfPoint2d,
+ VectorOfPoint3i,
+ VectorOfString,
+ VectorOfuchar,
+ VectorOfVectorOfPoint3i,
+ },
};
#[test]
@@ -105,6 +116,42 @@ fn simple_struct() -> Result<()> {
Ok(())
}
+#[test]
+fn vector_of_vector_simple_struct() -> Result<()> {
+ #[inline(never)]
+ fn make_vec() -> VectorOfVectorOfPoint3i {
+ let mut outer = VectorOfVectorOfPoint3i::new();
+ outer.push({
+ let mut inner = VectorOfPoint3i::new();
+ inner.push(Point3i::new(1, 1, 1));
+ inner.push(Point3i::new(2, 2, 2));
+ inner.push(Point3i::new(3, 3, 3));
+ inner
+ });
+ outer.push({
+ let mut inner = VectorOfPoint3i::new();
+ inner.push(Point3i::new(4, 4, 4));
+ inner.push(Point3i::new(5, 5, 5));
+ inner.push(Point3i::new(6, 6, 6));
+ inner
+ });
+ outer.push({
+ let mut inner = VectorOfPoint3i::new();
+ inner.push(Point3i::new(7, 7, 7));
+ inner.push(Point3i::new(8, 8, 8));
+ inner.push(Point3i::new(9, 9, 9));
+ inner
+ });
+ outer
+ }
+
+ let mut outer = make_vec();
+ assert_eq!(6, outer.get(1)?.get(2)?.x);
+ outer.remove(1)?;
+ assert_eq!(9, outer.get(1)?.get(2)?.x);
+ Ok(())
+}
+
#[test]
fn capacity() {
{

add VectorOfVectorOfPoint3