Squashed 'wrap/' changes from b37a1fec6..b3faf3fcd
b3faf3fcd Merge pull request #155 from borglab/fix/matlab-properties 292b35440 fix python test 53053173e fix properties block bug in Matlab and add test to capture it git-subtree-dir: wrap git-subtree-split: b3faf3fcd1e805828decf67fc32814f104c3c1c2release/4.3a0
							parent
							
								
									41d0de3e92
								
							
						
					
					
						commit
						e5dac42735
					
				|  | @ -483,8 +483,8 @@ class MatlabWrapper(CheckMixin, FormatMixin): | |||
|         if len(properties) != 0: | ||||
|             comment += '%\n' \ | ||||
|                        '%-------Properties-------\n' | ||||
|             for property in properties: | ||||
|                 comment += '%{}\n'.format(property.name) | ||||
|             for propty in properties: | ||||
|                 comment += '%{}\n'.format(propty.name) | ||||
| 
 | ||||
|         if len(methods) != 0: | ||||
|             comment += '%\n' \ | ||||
|  | @ -733,7 +733,7 @@ class MatlabWrapper(CheckMixin, FormatMixin): | |||
|         class_pointer = "  ptr_{class_name} = 0".format(class_name=class_name) | ||||
| 
 | ||||
|         if len(inst_class.properties) > 0: | ||||
|             properties = '\n' + "".join( | ||||
|             properties = '\n' + "\n".join( | ||||
|                 ["  {}".format(p.name) for p in inst_class.properties]) | ||||
|         else: | ||||
|             properties = '' | ||||
|  | @ -754,35 +754,35 @@ class MatlabWrapper(CheckMixin, FormatMixin): | |||
|             inst_class: The instantiated class whose properties we wish to wrap. | ||||
|         """ | ||||
|         properties = [] | ||||
|         for property in inst_class.properties: | ||||
|         for propty in inst_class.properties: | ||||
|             # These are the setters and getters in the .m file | ||||
|             function_name = namespace_name + inst_class.name + '_get_' + property.name | ||||
|             function_name = namespace_name + inst_class.name + '_get_' + propty.name | ||||
|             getter = """ | ||||
|             function varargout = get.{name}(this) | ||||
|                 {varargout} = {wrapper}({num}, this); | ||||
|                 this.{name} = {varargout}; | ||||
|             end | ||||
|             """.format( | ||||
|                 name=property.name, | ||||
|                 name=propty.name, | ||||
|                 varargout='varargout{1}', | ||||
|                 wrapper=self._wrapper_name(), | ||||
|                 num=self._update_wrapper_id( | ||||
|                     (namespace_name, inst_class, property.name, property), | ||||
|                     (namespace_name, inst_class, propty.name, propty), | ||||
|                     function_name=function_name)) | ||||
|             properties.append(getter) | ||||
| 
 | ||||
|             # Setter doesn't need varargin since it needs just one input. | ||||
|             function_name = namespace_name + inst_class.name + '_set_' + property.name | ||||
|             function_name = namespace_name + inst_class.name + '_set_' + propty.name | ||||
|             setter = """ | ||||
|             function set.{name}(this, value) | ||||
|                 obj.{name} = value; | ||||
|                 {wrapper}({num}, this, value); | ||||
|             end | ||||
|             """.format( | ||||
|                 name=property.name, | ||||
|                 name=propty.name, | ||||
|                 wrapper=self._wrapper_name(), | ||||
|                 num=self._update_wrapper_id( | ||||
|                     (namespace_name, inst_class, property.name, property), | ||||
|                     (namespace_name, inst_class, propty.name, propty), | ||||
|                     function_name=function_name)) | ||||
|             properties.append(setter) | ||||
| 
 | ||||
|  |  | |||
|  | @ -12,11 +12,11 @@ classdef ForwardKinematics < handle | |||
|     function obj = ForwardKinematics(varargin) | ||||
|       if nargin == 2 && isa(varargin{1}, 'uint64') && varargin{1} == uint64(5139824614673773682) | ||||
|         my_ptr = varargin{2}; | ||||
|         class_wrapper(59, my_ptr); | ||||
|         class_wrapper(63, my_ptr); | ||||
|       elseif nargin == 5 && isa(varargin{1},'gtdynamics.Robot') && isa(varargin{2},'char') && isa(varargin{3},'char') && isa(varargin{4},'gtsam.Values') && isa(varargin{5},'gtsam.Pose3') | ||||
|         my_ptr = class_wrapper(60, varargin{1}, varargin{2}, varargin{3}, varargin{4}, varargin{5}); | ||||
|         my_ptr = class_wrapper(64, varargin{1}, varargin{2}, varargin{3}, varargin{4}, varargin{5}); | ||||
|       elseif nargin == 4 && isa(varargin{1},'gtdynamics.Robot') && isa(varargin{2},'char') && isa(varargin{3},'char') && isa(varargin{4},'gtsam.Values') | ||||
|         my_ptr = class_wrapper(61, varargin{1}, varargin{2}, varargin{3}, varargin{4}); | ||||
|         my_ptr = class_wrapper(65, varargin{1}, varargin{2}, varargin{3}, varargin{4}); | ||||
|       else | ||||
|         error('Arguments do not match any overload of ForwardKinematics constructor'); | ||||
|       end | ||||
|  | @ -24,7 +24,7 @@ classdef ForwardKinematics < handle | |||
|     end | ||||
| 
 | ||||
|     function delete(obj) | ||||
|       class_wrapper(62, obj.ptr_ForwardKinematics); | ||||
|       class_wrapper(66, obj.ptr_ForwardKinematics); | ||||
|     end | ||||
| 
 | ||||
|     function display(obj), obj.print(''); end | ||||
|  |  | |||
|  | @ -9,7 +9,7 @@ classdef MultipleTemplatesIntDouble < handle | |||
|     function obj = MultipleTemplatesIntDouble(varargin) | ||||
|       if nargin == 2 && isa(varargin{1}, 'uint64') && varargin{1} == uint64(5139824614673773682) | ||||
|         my_ptr = varargin{2}; | ||||
|         class_wrapper(55, my_ptr); | ||||
|         class_wrapper(59, my_ptr); | ||||
|       else | ||||
|         error('Arguments do not match any overload of MultipleTemplatesIntDouble constructor'); | ||||
|       end | ||||
|  | @ -17,7 +17,7 @@ classdef MultipleTemplatesIntDouble < handle | |||
|     end | ||||
| 
 | ||||
|     function delete(obj) | ||||
|       class_wrapper(56, obj.ptr_MultipleTemplatesIntDouble); | ||||
|       class_wrapper(60, obj.ptr_MultipleTemplatesIntDouble); | ||||
|     end | ||||
| 
 | ||||
|     function display(obj), obj.print(''); end | ||||
|  |  | |||
|  | @ -9,7 +9,7 @@ classdef MultipleTemplatesIntFloat < handle | |||
|     function obj = MultipleTemplatesIntFloat(varargin) | ||||
|       if nargin == 2 && isa(varargin{1}, 'uint64') && varargin{1} == uint64(5139824614673773682) | ||||
|         my_ptr = varargin{2}; | ||||
|         class_wrapper(57, my_ptr); | ||||
|         class_wrapper(61, my_ptr); | ||||
|       else | ||||
|         error('Arguments do not match any overload of MultipleTemplatesIntFloat constructor'); | ||||
|       end | ||||
|  | @ -17,7 +17,7 @@ classdef MultipleTemplatesIntFloat < handle | |||
|     end | ||||
| 
 | ||||
|     function delete(obj) | ||||
|       class_wrapper(58, obj.ptr_MultipleTemplatesIntFloat); | ||||
|       class_wrapper(62, obj.ptr_MultipleTemplatesIntFloat); | ||||
|     end | ||||
| 
 | ||||
|     function display(obj), obj.print(''); end | ||||
|  |  | |||
|  | @ -15,9 +15,9 @@ classdef MyFactorPosePoint2 < handle | |||
|     function obj = MyFactorPosePoint2(varargin) | ||||
|       if nargin == 2 && isa(varargin{1}, 'uint64') && varargin{1} == uint64(5139824614673773682) | ||||
|         my_ptr = varargin{2}; | ||||
|         class_wrapper(69, my_ptr); | ||||
|         class_wrapper(73, my_ptr); | ||||
|       elseif nargin == 4 && isa(varargin{1},'numeric') && isa(varargin{2},'numeric') && isa(varargin{3},'double') && isa(varargin{4},'gtsam.noiseModel.Base') | ||||
|         my_ptr = class_wrapper(70, varargin{1}, varargin{2}, varargin{3}, varargin{4}); | ||||
|         my_ptr = class_wrapper(74, varargin{1}, varargin{2}, varargin{3}, varargin{4}); | ||||
|       else | ||||
|         error('Arguments do not match any overload of MyFactorPosePoint2 constructor'); | ||||
|       end | ||||
|  | @ -25,7 +25,7 @@ classdef MyFactorPosePoint2 < handle | |||
|     end | ||||
| 
 | ||||
|     function delete(obj) | ||||
|       class_wrapper(71, obj.ptr_MyFactorPosePoint2); | ||||
|       class_wrapper(75, obj.ptr_MyFactorPosePoint2); | ||||
|     end | ||||
| 
 | ||||
|     function display(obj), obj.print(''); end | ||||
|  | @ -36,19 +36,19 @@ classdef MyFactorPosePoint2 < handle | |||
|       % PRINT usage: print(string s, KeyFormatter keyFormatter) : returns void | ||||
|       % Doxygen can be found at https://gtsam.org/doxygen/ | ||||
|       if length(varargin) == 2 && isa(varargin{1},'char') && isa(varargin{2},'gtsam.KeyFormatter') | ||||
|         class_wrapper(72, this, varargin{:}); | ||||
|         class_wrapper(76, this, varargin{:}); | ||||
|         return | ||||
|       end | ||||
|       % PRINT usage: print(string s) : returns void | ||||
|       % Doxygen can be found at https://gtsam.org/doxygen/ | ||||
|       if length(varargin) == 1 && isa(varargin{1},'char') | ||||
|         class_wrapper(73, this, varargin{:}); | ||||
|         class_wrapper(77, this, varargin{:}); | ||||
|         return | ||||
|       end | ||||
|       % PRINT usage: print() : returns void | ||||
|       % Doxygen can be found at https://gtsam.org/doxygen/ | ||||
|       if length(varargin) == 0 | ||||
|         class_wrapper(74, this, varargin{:}); | ||||
|         class_wrapper(78, this, varargin{:}); | ||||
|         return | ||||
|       end | ||||
|       error('Arguments do not match any overload of function MyFactorPosePoint2.print'); | ||||
|  |  | |||
|  | @ -12,9 +12,9 @@ classdef MyVector12 < handle | |||
|     function obj = MyVector12(varargin) | ||||
|       if nargin == 2 && isa(varargin{1}, 'uint64') && varargin{1} == uint64(5139824614673773682) | ||||
|         my_ptr = varargin{2}; | ||||
|         class_wrapper(52, my_ptr); | ||||
|         class_wrapper(56, my_ptr); | ||||
|       elseif nargin == 0 | ||||
|         my_ptr = class_wrapper(53); | ||||
|         my_ptr = class_wrapper(57); | ||||
|       else | ||||
|         error('Arguments do not match any overload of MyVector12 constructor'); | ||||
|       end | ||||
|  | @ -22,7 +22,7 @@ classdef MyVector12 < handle | |||
|     end | ||||
| 
 | ||||
|     function delete(obj) | ||||
|       class_wrapper(54, obj.ptr_MyVector12); | ||||
|       class_wrapper(58, obj.ptr_MyVector12); | ||||
|     end | ||||
| 
 | ||||
|     function display(obj), obj.print(''); end | ||||
|  |  | |||
|  | @ -12,9 +12,9 @@ classdef MyVector3 < handle | |||
|     function obj = MyVector3(varargin) | ||||
|       if nargin == 2 && isa(varargin{1}, 'uint64') && varargin{1} == uint64(5139824614673773682) | ||||
|         my_ptr = varargin{2}; | ||||
|         class_wrapper(49, my_ptr); | ||||
|         class_wrapper(53, my_ptr); | ||||
|       elseif nargin == 0 | ||||
|         my_ptr = class_wrapper(50); | ||||
|         my_ptr = class_wrapper(54); | ||||
|       else | ||||
|         error('Arguments do not match any overload of MyVector3 constructor'); | ||||
|       end | ||||
|  | @ -22,7 +22,7 @@ classdef MyVector3 < handle | |||
|     end | ||||
| 
 | ||||
|     function delete(obj) | ||||
|       class_wrapper(51, obj.ptr_MyVector3); | ||||
|       class_wrapper(55, obj.ptr_MyVector3); | ||||
|     end | ||||
| 
 | ||||
|     function display(obj), obj.print(''); end | ||||
|  |  | |||
|  | @ -19,9 +19,9 @@ classdef PrimitiveRefDouble < handle | |||
|     function obj = PrimitiveRefDouble(varargin) | ||||
|       if nargin == 2 && isa(varargin{1}, 'uint64') && varargin{1} == uint64(5139824614673773682) | ||||
|         my_ptr = varargin{2}; | ||||
|         class_wrapper(45, my_ptr); | ||||
|         class_wrapper(49, my_ptr); | ||||
|       elseif nargin == 0 | ||||
|         my_ptr = class_wrapper(46); | ||||
|         my_ptr = class_wrapper(50); | ||||
|       else | ||||
|         error('Arguments do not match any overload of PrimitiveRefDouble constructor'); | ||||
|       end | ||||
|  | @ -29,7 +29,7 @@ classdef PrimitiveRefDouble < handle | |||
|     end | ||||
| 
 | ||||
|     function delete(obj) | ||||
|       class_wrapper(47, obj.ptr_PrimitiveRefDouble); | ||||
|       class_wrapper(51, obj.ptr_PrimitiveRefDouble); | ||||
|     end | ||||
| 
 | ||||
|     function display(obj), obj.print(''); end | ||||
|  | @ -43,7 +43,7 @@ classdef PrimitiveRefDouble < handle | |||
|       % BRUTAL usage: Brutal(double t) : returns PrimitiveRefdouble | ||||
|       % Doxygen can be found at https://gtsam.org/doxygen/ | ||||
|       if length(varargin) == 1 && isa(varargin{1},'double') | ||||
|         varargout{1} = class_wrapper(48, varargin{:}); | ||||
|         varargout{1} = class_wrapper(52, varargin{:}); | ||||
|         return | ||||
|       end | ||||
| 
 | ||||
|  |  | |||
|  | @ -7,6 +7,8 @@ | |||
| % | ||||
| %-------Properties------- | ||||
| %model_ptr | ||||
| %value | ||||
| %name | ||||
| % | ||||
| %-------Methods------- | ||||
| %arg_EigenConstRef(Matrix value) : returns void | ||||
|  | @ -40,6 +42,8 @@ classdef Test < handle | |||
|   properties | ||||
|     ptr_Test = 0 | ||||
|     model_ptr | ||||
|     value | ||||
|     name | ||||
|   end | ||||
|   methods | ||||
|     function obj = Test(varargin) | ||||
|  | @ -328,6 +332,26 @@ classdef Test < handle | |||
|         obj.model_ptr = value; | ||||
|         class_wrapper(44, this, value); | ||||
|     end | ||||
| 
 | ||||
|     function varargout = get.value(this) | ||||
|         varargout{1} = class_wrapper(45, this); | ||||
|         this.value = varargout{1}; | ||||
|     end | ||||
| 
 | ||||
|     function set.value(this, value) | ||||
|         obj.value = value; | ||||
|         class_wrapper(46, this, value); | ||||
|     end | ||||
| 
 | ||||
|     function varargout = get.name(this) | ||||
|         varargout{1} = class_wrapper(47, this); | ||||
|         this.name = varargout{1}; | ||||
|     end | ||||
| 
 | ||||
|     function set.name(this, value) | ||||
|         obj.name = value; | ||||
|         class_wrapper(48, this, value); | ||||
|     end | ||||
|   end | ||||
| 
 | ||||
|   methods(Static = true) | ||||
|  |  | |||
|  | @ -546,7 +546,37 @@ void Test_set_model_ptr_44(int nargout, mxArray *out[], int nargin, const mxArra | |||
|   obj->model_ptr = *model_ptr; | ||||
| } | ||||
| 
 | ||||
| void PrimitiveRefDouble_collectorInsertAndMakeBase_45(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void Test_get_value_45(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("value",nargout,nargin-1,0); | ||||
|   auto obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | ||||
|   out[0] = wrap< double >(obj->value); | ||||
| } | ||||
| 
 | ||||
| void Test_set_value_46(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("value",nargout,nargin-1,1); | ||||
|   auto obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | ||||
|   double value = unwrap< double >(in[1]); | ||||
|   obj->value = value; | ||||
| } | ||||
| 
 | ||||
| void Test_get_name_47(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("name",nargout,nargin-1,0); | ||||
|   auto obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | ||||
|   out[0] = wrap< string >(obj->name); | ||||
| } | ||||
| 
 | ||||
| void Test_set_name_48(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("name",nargout,nargin-1,1); | ||||
|   auto obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | ||||
|   string name = unwrap< string >(in[1]); | ||||
|   obj->name = name; | ||||
| } | ||||
| 
 | ||||
| void PrimitiveRefDouble_collectorInsertAndMakeBase_49(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<PrimitiveRef<double>> Shared; | ||||
|  | @ -555,7 +585,7 @@ void PrimitiveRefDouble_collectorInsertAndMakeBase_45(int nargout, mxArray *out[ | |||
|   collector_PrimitiveRefDouble.insert(self); | ||||
| } | ||||
| 
 | ||||
| void PrimitiveRefDouble_constructor_46(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void PrimitiveRefDouble_constructor_50(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<PrimitiveRef<double>> Shared; | ||||
|  | @ -566,7 +596,7 @@ void PrimitiveRefDouble_constructor_46(int nargout, mxArray *out[], int nargin, | |||
|   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | ||||
| } | ||||
| 
 | ||||
| void PrimitiveRefDouble_deconstructor_47(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void PrimitiveRefDouble_deconstructor_51(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   typedef boost::shared_ptr<PrimitiveRef<double>> Shared; | ||||
|   checkArguments("delete_PrimitiveRefDouble",nargout,nargin,1); | ||||
|  | @ -579,14 +609,14 @@ void PrimitiveRefDouble_deconstructor_47(int nargout, mxArray *out[], int nargin | |||
|   delete self; | ||||
| } | ||||
| 
 | ||||
| void PrimitiveRefDouble_Brutal_48(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void PrimitiveRefDouble_Brutal_52(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("PrimitiveRef<double>.Brutal",nargout,nargin,1); | ||||
|   double t = unwrap< double >(in[0]); | ||||
|   out[0] = wrap_shared_ptr(boost::make_shared<PrimitiveRef<double>>(PrimitiveRef<double>::Brutal(t)),"PrimitiveRefdouble", false); | ||||
| } | ||||
| 
 | ||||
| void MyVector3_collectorInsertAndMakeBase_49(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MyVector3_collectorInsertAndMakeBase_53(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<MyVector<3>> Shared; | ||||
|  | @ -595,7 +625,7 @@ void MyVector3_collectorInsertAndMakeBase_49(int nargout, mxArray *out[], int na | |||
|   collector_MyVector3.insert(self); | ||||
| } | ||||
| 
 | ||||
| void MyVector3_constructor_50(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MyVector3_constructor_54(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<MyVector<3>> Shared; | ||||
|  | @ -606,7 +636,7 @@ void MyVector3_constructor_50(int nargout, mxArray *out[], int nargin, const mxA | |||
|   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | ||||
| } | ||||
| 
 | ||||
| void MyVector3_deconstructor_51(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MyVector3_deconstructor_55(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   typedef boost::shared_ptr<MyVector<3>> Shared; | ||||
|   checkArguments("delete_MyVector3",nargout,nargin,1); | ||||
|  | @ -619,7 +649,7 @@ void MyVector3_deconstructor_51(int nargout, mxArray *out[], int nargin, const m | |||
|   delete self; | ||||
| } | ||||
| 
 | ||||
| void MyVector12_collectorInsertAndMakeBase_52(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MyVector12_collectorInsertAndMakeBase_56(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<MyVector<12>> Shared; | ||||
|  | @ -628,7 +658,7 @@ void MyVector12_collectorInsertAndMakeBase_52(int nargout, mxArray *out[], int n | |||
|   collector_MyVector12.insert(self); | ||||
| } | ||||
| 
 | ||||
| void MyVector12_constructor_53(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MyVector12_constructor_57(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<MyVector<12>> Shared; | ||||
|  | @ -639,7 +669,7 @@ void MyVector12_constructor_53(int nargout, mxArray *out[], int nargin, const mx | |||
|   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | ||||
| } | ||||
| 
 | ||||
| void MyVector12_deconstructor_54(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MyVector12_deconstructor_58(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   typedef boost::shared_ptr<MyVector<12>> Shared; | ||||
|   checkArguments("delete_MyVector12",nargout,nargin,1); | ||||
|  | @ -652,7 +682,7 @@ void MyVector12_deconstructor_54(int nargout, mxArray *out[], int nargin, const | |||
|   delete self; | ||||
| } | ||||
| 
 | ||||
| void MultipleTemplatesIntDouble_collectorInsertAndMakeBase_55(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MultipleTemplatesIntDouble_collectorInsertAndMakeBase_59(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<MultipleTemplates<int, double>> Shared; | ||||
|  | @ -661,7 +691,7 @@ void MultipleTemplatesIntDouble_collectorInsertAndMakeBase_55(int nargout, mxArr | |||
|   collector_MultipleTemplatesIntDouble.insert(self); | ||||
| } | ||||
| 
 | ||||
| void MultipleTemplatesIntDouble_deconstructor_56(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MultipleTemplatesIntDouble_deconstructor_60(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   typedef boost::shared_ptr<MultipleTemplates<int, double>> Shared; | ||||
|   checkArguments("delete_MultipleTemplatesIntDouble",nargout,nargin,1); | ||||
|  | @ -674,7 +704,7 @@ void MultipleTemplatesIntDouble_deconstructor_56(int nargout, mxArray *out[], in | |||
|   delete self; | ||||
| } | ||||
| 
 | ||||
| void MultipleTemplatesIntFloat_collectorInsertAndMakeBase_57(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MultipleTemplatesIntFloat_collectorInsertAndMakeBase_61(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<MultipleTemplates<int, float>> Shared; | ||||
|  | @ -683,7 +713,7 @@ void MultipleTemplatesIntFloat_collectorInsertAndMakeBase_57(int nargout, mxArra | |||
|   collector_MultipleTemplatesIntFloat.insert(self); | ||||
| } | ||||
| 
 | ||||
| void MultipleTemplatesIntFloat_deconstructor_58(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MultipleTemplatesIntFloat_deconstructor_62(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   typedef boost::shared_ptr<MultipleTemplates<int, float>> Shared; | ||||
|   checkArguments("delete_MultipleTemplatesIntFloat",nargout,nargin,1); | ||||
|  | @ -696,7 +726,7 @@ void MultipleTemplatesIntFloat_deconstructor_58(int nargout, mxArray *out[], int | |||
|   delete self; | ||||
| } | ||||
| 
 | ||||
| void ForwardKinematics_collectorInsertAndMakeBase_59(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void ForwardKinematics_collectorInsertAndMakeBase_63(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<ForwardKinematics> Shared; | ||||
|  | @ -705,7 +735,7 @@ void ForwardKinematics_collectorInsertAndMakeBase_59(int nargout, mxArray *out[] | |||
|   collector_ForwardKinematics.insert(self); | ||||
| } | ||||
| 
 | ||||
| void ForwardKinematics_constructor_60(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void ForwardKinematics_constructor_64(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<ForwardKinematics> Shared; | ||||
|  | @ -721,7 +751,7 @@ void ForwardKinematics_constructor_60(int nargout, mxArray *out[], int nargin, c | |||
|   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | ||||
| } | ||||
| 
 | ||||
| void ForwardKinematics_constructor_61(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void ForwardKinematics_constructor_65(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<ForwardKinematics> Shared; | ||||
|  | @ -736,7 +766,7 @@ void ForwardKinematics_constructor_61(int nargout, mxArray *out[], int nargin, c | |||
|   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | ||||
| } | ||||
| 
 | ||||
| void ForwardKinematics_deconstructor_62(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void ForwardKinematics_deconstructor_66(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   typedef boost::shared_ptr<ForwardKinematics> Shared; | ||||
|   checkArguments("delete_ForwardKinematics",nargout,nargin,1); | ||||
|  | @ -749,7 +779,7 @@ void ForwardKinematics_deconstructor_62(int nargout, mxArray *out[], int nargin, | |||
|   delete self; | ||||
| } | ||||
| 
 | ||||
| void TemplatedConstructor_collectorInsertAndMakeBase_63(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void TemplatedConstructor_collectorInsertAndMakeBase_67(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<TemplatedConstructor> Shared; | ||||
|  | @ -758,7 +788,7 @@ void TemplatedConstructor_collectorInsertAndMakeBase_63(int nargout, mxArray *ou | |||
|   collector_TemplatedConstructor.insert(self); | ||||
| } | ||||
| 
 | ||||
| void TemplatedConstructor_constructor_64(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void TemplatedConstructor_constructor_68(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<TemplatedConstructor> Shared; | ||||
|  | @ -769,7 +799,7 @@ void TemplatedConstructor_constructor_64(int nargout, mxArray *out[], int nargin | |||
|   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | ||||
| } | ||||
| 
 | ||||
| void TemplatedConstructor_constructor_65(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void TemplatedConstructor_constructor_69(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<TemplatedConstructor> Shared; | ||||
|  | @ -781,7 +811,7 @@ void TemplatedConstructor_constructor_65(int nargout, mxArray *out[], int nargin | |||
|   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | ||||
| } | ||||
| 
 | ||||
| void TemplatedConstructor_constructor_66(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void TemplatedConstructor_constructor_70(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<TemplatedConstructor> Shared; | ||||
|  | @ -793,7 +823,7 @@ void TemplatedConstructor_constructor_66(int nargout, mxArray *out[], int nargin | |||
|   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | ||||
| } | ||||
| 
 | ||||
| void TemplatedConstructor_constructor_67(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void TemplatedConstructor_constructor_71(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<TemplatedConstructor> Shared; | ||||
|  | @ -805,7 +835,7 @@ void TemplatedConstructor_constructor_67(int nargout, mxArray *out[], int nargin | |||
|   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | ||||
| } | ||||
| 
 | ||||
| void TemplatedConstructor_deconstructor_68(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void TemplatedConstructor_deconstructor_72(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   typedef boost::shared_ptr<TemplatedConstructor> Shared; | ||||
|   checkArguments("delete_TemplatedConstructor",nargout,nargin,1); | ||||
|  | @ -818,7 +848,7 @@ void TemplatedConstructor_deconstructor_68(int nargout, mxArray *out[], int narg | |||
|   delete self; | ||||
| } | ||||
| 
 | ||||
| void MyFactorPosePoint2_collectorInsertAndMakeBase_69(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MyFactorPosePoint2_collectorInsertAndMakeBase_73(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<MyFactor<gtsam::Pose2, gtsam::Matrix>> Shared; | ||||
|  | @ -827,7 +857,7 @@ void MyFactorPosePoint2_collectorInsertAndMakeBase_69(int nargout, mxArray *out[ | |||
|   collector_MyFactorPosePoint2.insert(self); | ||||
| } | ||||
| 
 | ||||
| void MyFactorPosePoint2_constructor_70(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MyFactorPosePoint2_constructor_74(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<MyFactor<gtsam::Pose2, gtsam::Matrix>> Shared; | ||||
|  | @ -842,7 +872,7 @@ void MyFactorPosePoint2_constructor_70(int nargout, mxArray *out[], int nargin, | |||
|   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | ||||
| } | ||||
| 
 | ||||
| void MyFactorPosePoint2_deconstructor_71(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MyFactorPosePoint2_deconstructor_75(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   typedef boost::shared_ptr<MyFactor<gtsam::Pose2, gtsam::Matrix>> Shared; | ||||
|   checkArguments("delete_MyFactorPosePoint2",nargout,nargin,1); | ||||
|  | @ -855,7 +885,7 @@ void MyFactorPosePoint2_deconstructor_71(int nargout, mxArray *out[], int nargin | |||
|   delete self; | ||||
| } | ||||
| 
 | ||||
| void MyFactorPosePoint2_print_72(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MyFactorPosePoint2_print_76(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("print",nargout,nargin-1,2); | ||||
|   auto obj = unwrap_shared_ptr<MyFactor<gtsam::Pose2, gtsam::Matrix>>(in[0], "ptr_MyFactorPosePoint2"); | ||||
|  | @ -864,7 +894,7 @@ void MyFactorPosePoint2_print_72(int nargout, mxArray *out[], int nargin, const | |||
|   obj->print(s,keyFormatter); | ||||
| } | ||||
| 
 | ||||
| void MyFactorPosePoint2_print_73(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MyFactorPosePoint2_print_77(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("print",nargout,nargin-1,1); | ||||
|   auto obj = unwrap_shared_ptr<MyFactor<gtsam::Pose2, gtsam::Matrix>>(in[0], "ptr_MyFactorPosePoint2"); | ||||
|  | @ -872,7 +902,7 @@ void MyFactorPosePoint2_print_73(int nargout, mxArray *out[], int nargin, const | |||
|   obj->print(s,gtsam::DefaultKeyFormatter); | ||||
| } | ||||
| 
 | ||||
| void MyFactorPosePoint2_print_74(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MyFactorPosePoint2_print_78(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("print",nargout,nargin-1,0); | ||||
|   auto obj = unwrap_shared_ptr<MyFactor<gtsam::Pose2, gtsam::Matrix>>(in[0], "ptr_MyFactorPosePoint2"); | ||||
|  | @ -1027,94 +1057,106 @@ void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | |||
|       Test_set_model_ptr_44(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 45: | ||||
|       PrimitiveRefDouble_collectorInsertAndMakeBase_45(nargout, out, nargin-1, in+1); | ||||
|       Test_get_value_45(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 46: | ||||
|       PrimitiveRefDouble_constructor_46(nargout, out, nargin-1, in+1); | ||||
|       Test_set_value_46(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 47: | ||||
|       PrimitiveRefDouble_deconstructor_47(nargout, out, nargin-1, in+1); | ||||
|       Test_get_name_47(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 48: | ||||
|       PrimitiveRefDouble_Brutal_48(nargout, out, nargin-1, in+1); | ||||
|       Test_set_name_48(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 49: | ||||
|       MyVector3_collectorInsertAndMakeBase_49(nargout, out, nargin-1, in+1); | ||||
|       PrimitiveRefDouble_collectorInsertAndMakeBase_49(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 50: | ||||
|       MyVector3_constructor_50(nargout, out, nargin-1, in+1); | ||||
|       PrimitiveRefDouble_constructor_50(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 51: | ||||
|       MyVector3_deconstructor_51(nargout, out, nargin-1, in+1); | ||||
|       PrimitiveRefDouble_deconstructor_51(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 52: | ||||
|       MyVector12_collectorInsertAndMakeBase_52(nargout, out, nargin-1, in+1); | ||||
|       PrimitiveRefDouble_Brutal_52(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 53: | ||||
|       MyVector12_constructor_53(nargout, out, nargin-1, in+1); | ||||
|       MyVector3_collectorInsertAndMakeBase_53(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 54: | ||||
|       MyVector12_deconstructor_54(nargout, out, nargin-1, in+1); | ||||
|       MyVector3_constructor_54(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 55: | ||||
|       MultipleTemplatesIntDouble_collectorInsertAndMakeBase_55(nargout, out, nargin-1, in+1); | ||||
|       MyVector3_deconstructor_55(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 56: | ||||
|       MultipleTemplatesIntDouble_deconstructor_56(nargout, out, nargin-1, in+1); | ||||
|       MyVector12_collectorInsertAndMakeBase_56(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 57: | ||||
|       MultipleTemplatesIntFloat_collectorInsertAndMakeBase_57(nargout, out, nargin-1, in+1); | ||||
|       MyVector12_constructor_57(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 58: | ||||
|       MultipleTemplatesIntFloat_deconstructor_58(nargout, out, nargin-1, in+1); | ||||
|       MyVector12_deconstructor_58(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 59: | ||||
|       ForwardKinematics_collectorInsertAndMakeBase_59(nargout, out, nargin-1, in+1); | ||||
|       MultipleTemplatesIntDouble_collectorInsertAndMakeBase_59(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 60: | ||||
|       ForwardKinematics_constructor_60(nargout, out, nargin-1, in+1); | ||||
|       MultipleTemplatesIntDouble_deconstructor_60(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 61: | ||||
|       ForwardKinematics_constructor_61(nargout, out, nargin-1, in+1); | ||||
|       MultipleTemplatesIntFloat_collectorInsertAndMakeBase_61(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 62: | ||||
|       ForwardKinematics_deconstructor_62(nargout, out, nargin-1, in+1); | ||||
|       MultipleTemplatesIntFloat_deconstructor_62(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 63: | ||||
|       TemplatedConstructor_collectorInsertAndMakeBase_63(nargout, out, nargin-1, in+1); | ||||
|       ForwardKinematics_collectorInsertAndMakeBase_63(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 64: | ||||
|       TemplatedConstructor_constructor_64(nargout, out, nargin-1, in+1); | ||||
|       ForwardKinematics_constructor_64(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 65: | ||||
|       TemplatedConstructor_constructor_65(nargout, out, nargin-1, in+1); | ||||
|       ForwardKinematics_constructor_65(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 66: | ||||
|       TemplatedConstructor_constructor_66(nargout, out, nargin-1, in+1); | ||||
|       ForwardKinematics_deconstructor_66(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 67: | ||||
|       TemplatedConstructor_constructor_67(nargout, out, nargin-1, in+1); | ||||
|       TemplatedConstructor_collectorInsertAndMakeBase_67(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 68: | ||||
|       TemplatedConstructor_deconstructor_68(nargout, out, nargin-1, in+1); | ||||
|       TemplatedConstructor_constructor_68(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 69: | ||||
|       MyFactorPosePoint2_collectorInsertAndMakeBase_69(nargout, out, nargin-1, in+1); | ||||
|       TemplatedConstructor_constructor_69(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 70: | ||||
|       MyFactorPosePoint2_constructor_70(nargout, out, nargin-1, in+1); | ||||
|       TemplatedConstructor_constructor_70(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 71: | ||||
|       MyFactorPosePoint2_deconstructor_71(nargout, out, nargin-1, in+1); | ||||
|       TemplatedConstructor_constructor_71(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 72: | ||||
|       MyFactorPosePoint2_print_72(nargout, out, nargin-1, in+1); | ||||
|       TemplatedConstructor_deconstructor_72(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 73: | ||||
|       MyFactorPosePoint2_print_73(nargout, out, nargin-1, in+1); | ||||
|       MyFactorPosePoint2_collectorInsertAndMakeBase_73(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 74: | ||||
|       MyFactorPosePoint2_print_74(nargout, out, nargin-1, in+1); | ||||
|       MyFactorPosePoint2_constructor_74(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 75: | ||||
|       MyFactorPosePoint2_deconstructor_75(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 76: | ||||
|       MyFactorPosePoint2_print_76(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 77: | ||||
|       MyFactorPosePoint2_print_77(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 78: | ||||
|       MyFactorPosePoint2_print_78(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     } | ||||
|   } catch(const std::exception& e) { | ||||
|  |  | |||
|  | @ -70,7 +70,9 @@ PYBIND11_MODULE(class_py, m_) { | |||
|         .def("set_container",[](Test* self, std::vector<testing::Test&> container){ self->set_container(container);}, py::arg("container")) | ||||
|         .def("get_container",[](Test* self){return self->get_container();}) | ||||
|         .def("_repr_markdown_",[](Test* self, const gtsam::KeyFormatter& keyFormatter){return self->markdown(keyFormatter);}, py::arg("keyFormatter") = gtsam::DefaultKeyFormatter) | ||||
|         .def_readwrite("model_ptr", &Test::model_ptr); | ||||
|         .def_readwrite("model_ptr", &Test::model_ptr) | ||||
|         .def_readwrite("value", &Test::value) | ||||
|         .def_readwrite("name", &Test::name); | ||||
| 
 | ||||
|     py::class_<PrimitiveRef<double>, std::shared_ptr<PrimitiveRef<double>>>(m_, "PrimitiveRefDouble") | ||||
|         .def(py::init<>()) | ||||
|  |  | |||
|  | @ -35,6 +35,10 @@ class Test { | |||
|   // Test a shared ptr property | ||||
|   gtsam::noiseModel::Base* model_ptr; | ||||
| 
 | ||||
|   // Test adding more than 1 property | ||||
|   double value; | ||||
|   string name; | ||||
| 
 | ||||
|   pair<Vector,Matrix> return_pair (Vector v, Matrix A) const; // intentionally the first method | ||||
|   pair<Vector,Matrix> return_pair (Vector v) const; // overload | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue