Remove BOARD::Add() from board.i, since it is inherited from board_item_container.i

This commit is contained in:
Dick Hollenbeck 2016-09-21 14:08:04 -05:00 committed by Wayne Stambaugh
parent eeae8c741a
commit 85ef7ee467
3 changed files with 34 additions and 39 deletions

View File

@ -177,16 +177,3 @@ HANDLE_EXCEPTIONS(BOARD::TracksInNetBetweenPoints)
return netclassmap
%}
}
%feature("notabstract") NETINFO_ITEM;
// http://swig.10945.n7.nabble.com/std-containers-and-pointers-td3728.html
%{
namespace swig {
template <> struct traits<NETINFO_ITEM> {
typedef pointer_category category;
static const char* type_name() { return "NETINFO_ITEM"; }
};
}
%}

View File

@ -27,8 +27,6 @@
* @brief Specific BOARD extensions and templates
*/
%import dlist.i
%include class_module.h
@ -40,6 +38,11 @@
%}
// BOARD_ITEM_CONTAINER's interface functions will be implemented by SWIG
// automatically.
/*
%extend MODULE
{
%pythoncode
@ -52,19 +55,9 @@
# add function, clears the thisown to avoid python from deleting
# the object in the garbage collector
#
def Add(self,item):
itemC = item.Cast()
if type(itemC) is D_PAD:
item.thisown=0
self.Pads().PushBack(itemC)
elif type(itemC) in [ TEXTE_PCB, DIMENSION, TEXTE_MODULE, DRAWSEGMENT,EDGE_MODULE]:
item.thisown = 0
self.GraphicalItems().PushBack(item)
%}
}
*/
%pythoncode
@ -101,20 +94,23 @@
plug.FootprintLibIsWritable(lpath)
%}
%{
MODULE *PyModule_to_MODULE(PyObject *obj0)
// called from pcbnew/swig/pcbnew_footprint_wizards.cpp
MODULE* PyModule_to_MODULE(PyObject *obj0)
{
void* argp;
int res1 = SWIG_ConvertPtr(obj0, &argp,SWIGTYPE_p_MODULE, 0 | 0 );
if (!SWIG_IsOK(res1))
{
void *argp;
int res1 = SWIG_ConvertPtr(obj0, &argp,SWIGTYPE_p_MODULE, 0 | 0 );
if (!SWIG_IsOK(res1))
{
SWIG_exception_fail(SWIG_ArgError(res1), "Converting object to MODULE*");
}
return (MODULE*)argp;
fail:
return NULL;
SWIG_exception_fail(SWIG_ArgError(res1), "Converting object to MODULE*");
}
return (MODULE*) argp;
fail:
return NULL;
}
%}

View File

@ -3,3 +3,15 @@
%{
#include <class_netinfo.h>
%}
%feature("notabstract") NETINFO_ITEM;
// http://swig.10945.n7.nabble.com/std-containers-and-pointers-td3728.html
%{
namespace swig {
template <> struct traits<NETINFO_ITEM> {
typedef pointer_category category;
static const char* type_name() { return "NETINFO_ITEM"; }
};
}
%}