Skip to content

Commit c1e9d49

Browse files
committed
Added Standard_Type class
1 parent 6564f03 commit c1e9d49

File tree

2 files changed

+128
-7
lines changed

2 files changed

+128
-7
lines changed

src/SWIG_files/wrapper/Standard.i

Lines changed: 115 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Standard_HandlerProcessed = Standard_HandlerStatus.Standard_HandlerProcessed
7676
%wrap_handle(Standard_Transient)
7777
%wrap_handle(Standard_OutOfMemory)
7878
%wrap_handle(Standard_Persistent)
79+
%wrap_handle(Standard_Type)
7980
/* end handles declaration */
8081

8182
/* templates */
@@ -1535,6 +1536,120 @@ None
15351536
/**********************
15361537
* class Standard_Type *
15371538
**********************/
1539+
%nodefaultctor Standard_Type;
1540+
class Standard_Type : public Standard_Transient {
1541+
public:
1542+
/****************** Name ******************/
1543+
/**** md5 signature: dbebb34a777ed2cce75639b98f8c3cbf ****/
1544+
%feature("compactdefaultargs") Name;
1545+
%feature("autodoc", "Returns the given name of the class type (get_type_name).
1546+
1547+
Returns
1548+
-------
1549+
char *
1550+
") Name;
1551+
const char * Name();
1552+
1553+
/****************** Parent ******************/
1554+
/**** md5 signature: 4c52a6847edce109e140e2343296b76f ****/
1555+
%feature("compactdefaultargs") Parent;
1556+
%feature("autodoc", "Returns descriptor of the base class in the hierarchy.
1557+
1558+
Returns
1559+
-------
1560+
opencascade::handle<Standard_Type>
1561+
") Parent;
1562+
const opencascade::handle<Standard_Type> & Parent();
1563+
1564+
1565+
%feature("autodoc", "1");
1566+
%extend{
1567+
std::string PrintToString() {
1568+
std::stringstream s;
1569+
self->Print(s);
1570+
return s.str();}
1571+
};
1572+
/****************** Register ******************/
1573+
/**** md5 signature: 8e6b8df94dcb0fc4b1d9d92877cf9314 ****/
1574+
%feature("compactdefaultargs") Register;
1575+
%feature("autodoc", "Register a type; returns either new or existing descriptor. //! @param thesystemname name of the class as returned by typeid(class).name() @param thename name of the class to be stored in name field @param thesize size of the class instance @param theparent base class in the transient hierarchy //! note that this function is intended for use by opencascade::type_instance only. .
1576+
1577+
Parameters
1578+
----------
1579+
theSystemName: char *
1580+
theName: char *
1581+
theSize: Standard_Size
1582+
theParent: Standard_Type
1583+
1584+
Returns
1585+
-------
1586+
Standard_Type *
1587+
") Register;
1588+
static Standard_Type * Register(const char * theSystemName, const char * theName, Standard_Size theSize, const opencascade::handle<Standard_Type> & theParent);
1589+
1590+
/****************** Size ******************/
1591+
/**** md5 signature: 84043604cd4d694d29fbe523f032e5d8 ****/
1592+
%feature("compactdefaultargs") Size;
1593+
%feature("autodoc", "Returns the size of the class instance in bytes.
1594+
1595+
Returns
1596+
-------
1597+
Standard_Size
1598+
") Size;
1599+
Standard_Size Size();
1600+
1601+
/****************** SubType ******************/
1602+
/**** md5 signature: c3ab17d05fad515519faa56550ba2910 ****/
1603+
%feature("compactdefaultargs") SubType;
1604+
%feature("autodoc", "Returns true if this type is the same as theother, or inherits from theother. note that multiple inheritance is not supported.
1605+
1606+
Parameters
1607+
----------
1608+
theOther: Standard_Type
1609+
1610+
Returns
1611+
-------
1612+
bool
1613+
") SubType;
1614+
Standard_Boolean SubType(const opencascade::handle<Standard_Type> & theOther);
1615+
1616+
/****************** SubType ******************/
1617+
/**** md5 signature: e4908284e5a25023425f29a02b92ebdc ****/
1618+
%feature("compactdefaultargs") SubType;
1619+
%feature("autodoc", "Returns true if this type is the same as theother, or inherits from theother. note that multiple inheritance is not supported.
1620+
1621+
Parameters
1622+
----------
1623+
theOther: char *
1624+
1625+
Returns
1626+
-------
1627+
bool
1628+
") SubType;
1629+
Standard_Boolean SubType(const char * theOther);
1630+
1631+
/****************** SystemName ******************/
1632+
/**** md5 signature: 3db3c1797a8dec854871c6caaa05c939 ****/
1633+
%feature("compactdefaultargs") SystemName;
1634+
%feature("autodoc", "Returns the system type name of the class (typeinfo.name).
1635+
1636+
Returns
1637+
-------
1638+
char *
1639+
") SystemName;
1640+
const char * SystemName();
1641+
1642+
};
1643+
1644+
1645+
%make_alias(Standard_Type)
1646+
1647+
%extend Standard_Type {
1648+
%pythoncode {
1649+
__repr__ = _dumps_object
1650+
}
1651+
};
1652+
15381653
/* python proxy for excluded classes */
15391654
%pythoncode {
15401655
@classnotwrapped
@@ -1549,10 +1664,6 @@ class Standard_Static_Assert:
15491664
class Standard_CLocaleSentry:
15501665
pass
15511666

1552-
@classnotwrapped
1553-
class Standard_Type:
1554-
pass
1555-
15561667
@classnotwrapped
15571668
class Standard_Failure:
15581669
pass

src/SWIG_files/wrapper/Standard.pyi

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,18 @@ class Standard_Persistent(Standard_Transient):
182182
def GetTypeNum(self) -> int: ...
183183
def SetTypeNum(self, value: int) -> None: ...
184184

185+
class Standard_Type(Standard_Transient):
186+
def Name(self) -> str: ...
187+
def Parent(self) -> Standard_Type: ...
188+
@staticmethod
189+
def Register(theSystemName: str, theName: str, theSize: int, theParent: Standard_Type) -> Standard_Type: ...
190+
def Size(self) -> int: ...
191+
@overload
192+
def SubType(self, theOther: Standard_Type) -> bool: ...
193+
@overload
194+
def SubType(self, theOther: str) -> bool: ...
195+
def SystemName(self) -> str: ...
196+
185197
#classnotwrapped
186198
class Standard_AncestorIterator: ...
187199

@@ -191,9 +203,6 @@ class Standard_Static_Assert: ...
191203
#classnotwrapped
192204
class Standard_CLocaleSentry: ...
193205

194-
#classnotwrapped
195-
class Standard_Type: ...
196-
197206
#classnotwrapped
198207
class Standard_Failure: ...
199208

@@ -227,3 +236,4 @@ Standard_Transient_get_type_name = Standard_Transient.get_type_name
227236
Standard_OutOfMemory_NewInstance = Standard_OutOfMemory.NewInstance
228237
Standard_OutOfMemory_Raise = Standard_OutOfMemory.Raise
229238
Standard_OutOfMemory_Raise = Standard_OutOfMemory.Raise
239+
Standard_Type_Register = Standard_Type.Register

0 commit comments

Comments
 (0)