2016-09-21 01:07:41 +00:00
|
|
|
|
2020-02-27 23:54:19 +00:00
|
|
|
|
2016-09-21 01:07:41 +00:00
|
|
|
%include pad_shapes.h
|
2020-11-12 20:19:22 +00:00
|
|
|
%include pad.h
|
2016-09-21 01:07:41 +00:00
|
|
|
|
2020-11-13 15:15:52 +00:00
|
|
|
%rename(Get) operator PAD*;
|
2016-09-21 01:07:41 +00:00
|
|
|
%{
|
2020-11-12 20:19:22 +00:00
|
|
|
#include <pad.h>
|
2016-09-21 01:07:41 +00:00
|
|
|
%}
|
|
|
|
|
2020-11-13 15:15:52 +00:00
|
|
|
%extend PAD
|
2017-10-09 07:58:15 +00:00
|
|
|
{
|
|
|
|
%pythoncode
|
|
|
|
%{
|
|
|
|
|
2020-11-13 15:15:52 +00:00
|
|
|
# SetPadName() is the old name for PAD::SetName()
|
2017-10-09 07:58:15 +00:00
|
|
|
# define it for compatibility
|
|
|
|
def SetPadName(self, aName):
|
|
|
|
return self.SetName(aName)
|
|
|
|
|
2020-11-13 15:15:52 +00:00
|
|
|
# GetPadName() is the old name for PAD::GetName()
|
2017-10-09 07:58:15 +00:00
|
|
|
# define it for compatibility
|
|
|
|
def GetPadName(self):
|
|
|
|
return self.GetName()
|
|
|
|
|
2020-02-27 23:54:19 +00:00
|
|
|
# AddPrimitive() is the old name for D_PAD::AddPrimitivePoly(),
|
2020-11-13 15:15:52 +00:00
|
|
|
# PAD::AddPrimitiveSegment(), PAD::AddPrimitiveCircle(),
|
|
|
|
# PAD::AddPrimitiveArc(), PAD::AddPrimitiveCurve()
|
2020-02-27 23:54:19 +00:00
|
|
|
# define it for compatibility
|
|
|
|
def AddPrimitive(self, *args):
|
|
|
|
if len(args) == 2:
|
|
|
|
return self.AddPrimitivePoly(*args)
|
|
|
|
elif len(args) == 3:
|
|
|
|
if type(args[1] in [wxPoint,wxSize]):
|
|
|
|
return self.AddPrimitiveSegment(*args)
|
|
|
|
else:
|
|
|
|
return self.AddPrimitiveCircle(*args)
|
|
|
|
elif len(args) == 4:
|
|
|
|
return self.AddPrimitiveArc(*args)
|
|
|
|
elif len(args) == 5:
|
|
|
|
return self.AddPrimitiveCurve(*args)
|
|
|
|
else:
|
|
|
|
raise TypeError("Arguments not recognized.")
|
2020-07-28 02:59:16 +00:00
|
|
|
|
|
|
|
# GetCustomShapeAsPolygon() is the old accessor to get custom shapes
|
2020-09-04 22:58:29 +00:00
|
|
|
def GetCustomShapeAsPolygon(self, layer=UNDEFINED_LAYER):
|
2020-07-28 02:59:16 +00:00
|
|
|
polygon_set = SHAPE_POLY_SET()
|
2020-09-04 22:58:29 +00:00
|
|
|
self.MergePrimitivesAsPolygon(polygon_set, layer)
|
2020-07-28 02:59:16 +00:00
|
|
|
return polygon_set
|
2017-10-09 07:58:15 +00:00
|
|
|
%}
|
|
|
|
}
|