Commit Graph

6 Commits (64853d5661970efb54c502b36d551a1bf1086efa)

Author SHA1 Message Date
Alessandro Ranellucci 76a8ec3d9e Replace to_SV_ref() and to_SV_clone_ref() with templated glue functions 2014-05-08 14:52:48 +02:00
Petr Ledvina 115aa6885f Implement type checking for XS objects
Type handling is mainly done using templates.
Template Slic3r::ClassTraits is used to store info about exported types (perl class name). Currently only perl class name and refference name is used.
Template values are initialized by REGISTER_CLASS macro. This macro is used in .cpp file of class ( it needs to be used exactly for each type).

Ref<type> class is used to return value as perl reference. Operator overloading is used to make c++ and XSpp happy, only pointer value should be possible to return.

Clone<type> class is used to return copy of value ( using new and copy constructor). Copy is created on assigment, this should be probably improved (memory leak on multiple assignments).
It is overloaded to be able to return type, type* and type&.

Typechecking in ExtrusionEntityCollection updated to check all passed types.
2014-04-27 19:38:56 +02:00
Alessandro Ranellucci ca4d4211c9 Refactored signatures of many C++ methods for more efficient and safer style. Includes a bugfix for Point::nearest_point() which was returning a pointer to freed memory. #1961 2014-04-24 16:40:10 +02:00
Alessandro Ranellucci 3025c77675 Use Clipper for line clipping 2013-11-21 14:15:38 +01:00
Alessandro Ranellucci e0da81e8bf Introduce a ->count method for all collections to save time 2013-09-17 23:38:23 +02:00
Alessandro Ranellucci 1cfdf7e955 Ported Slic3r::Polyline::Collection 2013-08-30 00:06:10 +02:00