diff --git a/src/plugins/streamers/lstream/db_plugin/lstrCompressed.cc b/src/plugins/streamers/lstream/db_plugin/lstrCompressed.cc index 09cb75aba..c2eaa30b5 100644 --- a/src/plugins/streamers/lstream/db_plugin/lstrCompressed.cc +++ b/src/plugins/streamers/lstream/db_plugin/lstrCompressed.cc @@ -69,12 +69,11 @@ Compressed::make_rep_id (const RegularArray &array, const std::vector void -Compressed::write_shape (const db::Shape &shape, const db::Vector &disp, RegularArray ®ular, std::vector &irregular_array) +Compressed::write_shape (const db::Shape &shape, RegularArray ®ular, std::vector &irregular_array) { Obj sh; shape.instantiate (sh); if (! object_is_empty (sh)) { - sh.move (disp); if (shape.prop_id () != 0) { write (db::object_with_properties (sh, shape.prop_id ()), regular, irregular_array); } else { @@ -115,27 +114,26 @@ Compressed::compress_shapes (const db::Shapes &shapes, unsigned int level, bool std::vector irregular_array; bool transfer_array = (shape.in_array () && level > 0); - db::Vector disp; if (transfer_array) { - disp = create_repetition (shape.array (), array, irregular_array); + create_repetition (shape.array (), array, irregular_array); } if (shape->is_simple_polygon ()) { - write_shape (*shape, disp, array, irregular_array); + write_shape (*shape, array, irregular_array); } else if (shape->is_polygon ()) { - write_shape (*shape, disp, array, irregular_array); + write_shape (*shape, array, irregular_array); } else if (shape->is_path ()) { - write_shape (*shape, disp, array, irregular_array); + write_shape (*shape, array, irregular_array); } else if (shape->is_text ()) { - write_shape (*shape, disp, array, irregular_array); + write_shape (*shape, array, irregular_array); } else if (shape->is_edge ()) { - write_shape (*shape, disp, array, irregular_array); + write_shape (*shape, array, irregular_array); } else if (shape->is_edge_pair ()) { - write_shape (*shape, disp, array, irregular_array); + write_shape (*shape, array, irregular_array); } else if (shape->is_box ()) { - write_shape (*shape, disp, array, irregular_array); + write_shape (*shape, array, irregular_array); } else if (shape->is_point ()) { - write_shape (*shape, disp, array, irregular_array); + write_shape (*shape, array, irregular_array); } else if (shape->is_user_object ()) { // ignore } else { @@ -486,9 +484,9 @@ Compressed::compress_instances (const db::Cell::const_iterator &begin_instances, db::CellInstArray single_inst; if (! inst_array.is_complex ()) { - single_inst = db::CellInstArray (inst_array.object (), db::Trans (-disp) * inst_array.front ()); + single_inst = db::CellInstArray (inst_array.object (), db::Trans (disp) * inst_array.front ()); } else { - single_inst = db::CellInstArray (inst_array.object (), inst_array.complex_trans (db::Trans (-disp) * inst_array.front ())); + single_inst = db::CellInstArray (inst_array.object (), inst_array.complex_trans (db::Trans (disp) * inst_array.front ())); } // no compression -> just keep as is diff --git a/src/plugins/streamers/lstream/db_plugin/lstrCompressed.h b/src/plugins/streamers/lstream/db_plugin/lstrCompressed.h index 3671314c9..2dfae472d 100644 --- a/src/plugins/streamers/lstream/db_plugin/lstrCompressed.h +++ b/src/plugins/streamers/lstream/db_plugin/lstrCompressed.h @@ -275,8 +275,6 @@ private: db::Vector create_repetition (const db::Shape &array, RegularArray ®ular, std::vector &irregular_array); template void write_shape(const db::Shape &shape, RegularArray ®ular, std::vector &irregular_array); - template - void write_shape(const db::Shape &shape, const db::Vector &disp, RegularArray ®ular, std::vector &irregular_array); }; template <> inline Compressed::compressed_container &Compressed::get_container () { return m_points; } diff --git a/src/plugins/streamers/lstream/unit_tests/dbLStreamWriterTests.cc b/src/plugins/streamers/lstream/unit_tests/dbLStreamWriterTests.cc index b0f7b65a3..1113413c6 100644 --- a/src/plugins/streamers/lstream/unit_tests/dbLStreamWriterTests.cc +++ b/src/plugins/streamers/lstream/unit_tests/dbLStreamWriterTests.cc @@ -151,3 +151,13 @@ TEST(variants) run_test (_this, tl::testdata (), "variants.lstr", "variants_au.oas"); } +TEST(sample1) +{ + run_test (_this, tl::testdata (), "sample1.lstr", "sample1_au.oas"); +} + +TEST(sample2) +{ + run_test (_this, tl::testdata (), "sample2.lstr", "sample2_au.oas"); +} + diff --git a/testdata/lstream/sample1.lstr b/testdata/lstream/sample1.lstr new file mode 100644 index 000000000..8f8f4bb31 Binary files /dev/null and b/testdata/lstream/sample1.lstr differ diff --git a/testdata/lstream/sample1_au.oas b/testdata/lstream/sample1_au.oas new file mode 100644 index 000000000..1f597ad39 Binary files /dev/null and b/testdata/lstream/sample1_au.oas differ diff --git a/testdata/lstream/sample2.lstr b/testdata/lstream/sample2.lstr new file mode 100644 index 000000000..3033760e8 Binary files /dev/null and b/testdata/lstream/sample2.lstr differ diff --git a/testdata/lstream/sample2_au.oas b/testdata/lstream/sample2_au.oas new file mode 100644 index 000000000..4a4a34171 Binary files /dev/null and b/testdata/lstream/sample2_au.oas differ