example
index
/opt/freeware/src/packages/BUILD/swig-4.0.2/32bit/Examples/python/doxygen/example.py

# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

 
Modules
       
builtins
_example

 
Classes
       
builtins.object
Shape
Circle
RectangleInt
Square

 
class Circle(Shape)
    Circle(r: 'double')
 
A class for representing a circle.
Author: Jack
 
 
Method resolution order:
Circle
Shape
builtins.object

Methods defined here:
__init__(self, r: 'double')
Construct a circle
:type r: float
:param r: radius of the circle
__repr__ = _swig_repr(self)
area(self) -> 'double'
Calculate the area of the circle
:rtype: float
:return: calculated area
perimeter(self) -> 'double'
Calculate the perimeter of the circle
:rtype: float
:return: calculated perimeter of the circle

Static methods defined here:
__swig_destroy__ = delete_Circle(...)

Data descriptors defined here:
thisown
The membership flag

Methods inherited from Shape:
move(self, dx: 'double', dy: 'double') -> 'void'
Move a shape to a new co-ordinate
 :type dx: float
 :param dx: x co-ordinate
 :type dy: float
 :param dy: y co-ordinate

Data descriptors inherited from Shape:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
nshapes
Number of shapes currently in existence
x
x co-ordinate
y
y co-ordinate

 
class RectangleInt(Shape)
    RectangleInt(h: 'int', w: 'int')
 
A class for representing a rectangle, templated on the type for the rectangle dimensions - this instantiation uses type int
 
 
Method resolution order:
RectangleInt
Shape
builtins.object

Methods defined here:
__init__(self, h: 'int', w: 'int')
Construct a rectangle
:type h: int
:param h: height of the rectangle
:type w: int
:param w: width of the rectangle
__repr__ = _swig_repr(self)
area(self) -> 'double'
Calculate the area of the rectangle
:rtype: float
:return: calculated area
perimeter(self) -> 'double'
Calculate the perimeter of the rectangle
:rtype: float
:return: calculated perimeter of the rectangle

Static methods defined here:
__swig_destroy__ = delete_RectangleInt(...)

Data descriptors defined here:
thisown
The membership flag

Methods inherited from Shape:
move(self, dx: 'double', dy: 'double') -> 'void'
Move a shape to a new co-ordinate
 :type dx: float
 :param dx: x co-ordinate
 :type dy: float
 :param dy: y co-ordinate

Data descriptors inherited from Shape:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
nshapes
Number of shapes currently in existence
x
x co-ordinate
y
y co-ordinate

 
class Shape(builtins.object)
    Shape(*args, **kwargs)
 
Base class for all shapes.
Author: Bob
 
  Methods defined here:
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
area(self) -> 'double'
:rtype: float
:return: the area
move(self, dx: 'double', dy: 'double') -> 'void'
Move a shape to a new co-ordinate
 :type dx: float
 :param dx: x co-ordinate
 :type dy: float
 :param dy: y co-ordinate
perimeter(self) -> 'double'
:rtype: float
:return: the perimeter

Static methods defined here:
__swig_destroy__ = delete_Shape(...)
Destructor for destroying a Shape

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
nshapes
Number of shapes currently in existence
thisown
The membership flag
x
x co-ordinate
y
y co-ordinate

 
class Square(Shape)
    Square(w: 'double')
 
A class for representing a square.
 
 
Method resolution order:
Square
Shape
builtins.object

Methods defined here:
__init__(self, w: 'double')
Construct a square
:type w: float
:param w: width of the square
__repr__ = _swig_repr(self)
area(self) -> 'double'
Calculate the area of the square
:rtype: float
:return: calculated area
perimeter(self) -> 'double'
Calculate the perimeter of the square
:rtype: float
:return: calculated perimeter of the square

Static methods defined here:
__swig_destroy__ = delete_Square(...)

Data descriptors defined here:
thisown
The membership flag

Methods inherited from Shape:
move(self, dx: 'double', dy: 'double') -> 'void'
Move a shape to a new co-ordinate
 :type dx: float
 :param dx: x co-ordinate
 :type dy: float
 :param dy: y co-ordinate

Data descriptors inherited from Shape:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
nshapes
Number of shapes currently in existence
x
x co-ordinate
y
y co-ordinate

 
Functions
       
MakeCircle(w: 'double') -> 'Circle'
Factory function for creating a circle
:type w: float
:param w: radius of the circle
:rtype: :py:class:`Circle`
:return: a fully constructed circle
MakeRectangleInt(h: 'int', w: 'int') -> 'Rectangle< int >'
Factory function for creating a rectangle
:type h: int
:param h: height of the rectangle
:type w: int
:param w: width of the rectangle
:rtype: Rectangle< int >
:return: a fully constructed rectangle  - this instantiation uses type int
MakeSquare(r: 'double') -> 'Square'
Factory function for creating a square
:type r: float
:param r: width of the square
:rtype: :py:class:`Square`
:return: a fully constructed square

 
Data
        NumCircles = 0
NumSquares = 0
cvar = <Swig global variables>