Bridges-Python  3.4.3
Bridges(Python API)
Public Member Functions | Public Attributes | List of all members
bridges.rectangle.Rectangle Class Reference
Inheritance diagram for bridges.rectangle.Rectangle:
bridges.symbol.Symbol

Detailed Description

This class defines a rectangle and is part of the symbol collection.

A rectangle is defined by the location of teh lower left corner (smaller values of x and y) and by height and width

Author
Matthew Mcquaigue
Date
2018, 7/23/19
See also
Shape collection tutorial, https://bridgesuncc.github.io/tutorials/Symbol_Collection.html

Public Member Functions

None __init__ (self, **kwargs)
 Constructor for the rectangle symbol. More...
 
str get_shape_type (self)
 Getter for the name of the shape. More...
 
float width (self)
 Getter for the rectangle width. More...
 
None width (self, w)
 Setter for the width of the rectangles. More...
 
float height (self)
 Getter for the height of the rectangle. More...
 
None height (self, h)
 Setter for the height of the rectangle. More...
 
def set_rectangle (self, locx, locy, w, h)
 Setter function for setting the rectangles size and location from scratch. More...
 
Tuple[float, float] lower_left (self)
 
def lower_left (self, Tuple[float, float] ll)
 
dict get_json_representation (self)
 Getter function for the json representation of the data structure/shape. More...
 
- Public Member Functions inherited from bridges.symbol.Symbol
def __init__ (self)
 Constructor for a Symbol. More...
 
str label (self)
 Getter for symbol label. More...
 
None label (self, str label)
 Setter for symbol label. More...
 
Color fill_color (self)
 Getter for the fill color. More...
 
None fill_color (self, *args, **kwargs)
 Setter for the fill color. More...
 
Color stroke_color (self)
 Getter for the stroke color. More...
 
None stroke_color (self, *args, **kwargs)
 Setter for the stroke color. More...
 
float stroke_width (self)
 Getter for the stroke width. More...
 
None stroke_width (self, float width)
 Setter for the stroke width. More...
 
float opacity (self)
 Getter for opacity. More...
 
def opacity (self, float o)
 Setter for opacity. More...
 
float stroke_dash (self)
 Getter for stroke_dash. More...
 
def stroke_dash (self, float dash)
 Setter for stroke_dash. More...
 
int layer (self)
 
def layer (self, int l)
 
def xform (self)
 
def print_mat (self, list m)
 
list identity (self, list m)
 
list mat_mult (self, list m1, list m2)
 
list vec_mat_mult (self, list m, list v)
 
def translate (self, float tx, float ty)
 
def scale (self, *args)
 scale the symbol from a particular center location More...
 
def rotate (self, *args)
 
def set_transform (self, float a, float b, float c, float d, float e, float f)
 
def add_all_json (self, symbol_json, parent)
 

Public Attributes

 width
 
 height
 

Constructor & Destructor Documentation

◆ __init__()

None bridges.rectangle.Rectangle.__init__ (   self,
**  kwargs 
)

Constructor for the rectangle symbol.

       (float) w: width of the rectangle
       (float) h: height of the rectangle
       (float) locx: x location of the lower left of the rectangle
       (float) locy: y loaction of the lower left of the rectangle
Returns
None
Exceptions
ValueErrorif the width or height is less than 0

Member Function Documentation

◆ get_json_representation()

dict bridges.rectangle.Rectangle.get_json_representation (   self)

Getter function for the json representation of the data structure/shape.

Returns
dict representing the json

Reimplemented from bridges.symbol.Symbol.

◆ get_shape_type()

str bridges.rectangle.Rectangle.get_shape_type (   self)

Getter for the name of the shape.

Returns
str shape name

Reimplemented from bridges.symbol.Symbol.

◆ height() [1/2]

float bridges.rectangle.Rectangle.height (   self)

Getter for the height of the rectangle.

Returns
float the height of the rectangle

◆ height() [2/2]

None bridges.rectangle.Rectangle.height (   self,
  h 
)

Setter for the height of the rectangle.

       (float) h: the height to be applied
Returns
None
Exceptions
ValueErrorif the height is < 0

◆ lower_left() [1/2]

Tuple[float, float] bridges.rectangle.Rectangle.lower_left (   self)

◆ lower_left() [2/2]

def bridges.rectangle.Rectangle.lower_left (   self,
Tuple[float, float]  ll 
)

◆ set_rectangle()

def bridges.rectangle.Rectangle.set_rectangle (   self,
  locx,
  locy,
  w,
  h 
)

Setter function for setting the rectangles size and location from scratch.

       (float) locx: the x location of the lower left of the rectangle
       (float) locy: the y location of the lower left of the rectangle
       (float) w: the width of rectangle
       (float) h: the height of rectangle
Returns
None
Exceptions
ValueErrorif the height or width is < 0

◆ width() [1/2]

float bridges.rectangle.Rectangle.width (   self)

Getter for the rectangle width.

Returns
float the width

◆ width() [2/2]

None bridges.rectangle.Rectangle.width (   self,
  w 
)

Setter for the width of the rectangles.

       (float) w: the width to be applied to rectangle
Returns
None
Exceptions
ValueErrorif the width is < 0

Member Data Documentation

◆ height

bridges.rectangle.Rectangle.height

◆ width

bridges.rectangle.Rectangle.width

The documentation for this class was generated from the following file: