Bridges-Python 3.5.0-dev1
Bridges(Python API)
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Properties | List of all members
bridges.rectangle.Rectangle Class Reference

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

Inheritance diagram for bridges.rectangle.Rectangle:
bridges.symbol.Symbol

Public Member Functions

None __init__ (self, **kwargs)
 Constructor for the rectangle symbol.
 
str get_shape_type (self)
 Getter for the name of the shape.
 
 set_rectangle (self, locx, locy, w, h)
 Setter function for setting the rectangles size and location from scratch.
 
dict get_json_representation (self)
 Getter function for the json representation of the data structure/shape.
 
- Public Member Functions inherited from bridges.symbol.Symbol
 print_mat (self, list m)
 print the current matrix for debugging
 
list identity (self, list m)
 create the identity matrix
 
list mat_mult (self, list m1, list m2)
 
list vec_mat_mult (self, list m, list v)
 
 translate (self, float tx, float ty)
 
 scale (self, *args)
 scale the symbol from a particular center location
 
 rotate (self, *args)
 
 set_transform (self, float a, float b, float c, float d, float e, float f)
 
 add_all_json (self, symbol_json, parent)
 

Protected Attributes

 _width
 
 _height
 
 _locx
 
 _locy
 
- Protected Attributes inherited from bridges.symbol.Symbol
 _label
 
 _fill_color
 
 _stroke_color
 
 _opacity
 
 _stroke_width
 
 _stroke_dash
 
 _layer
 
 _transform
 
 _xform
 
 _xform_flag
 

Properties

 width = property
 Getter for the rectangle width.
 
 height = property
 Getter for the height of the rectangle.
 
 lower_left = property
 
- Properties inherited from bridges.symbol.Symbol
 label = property
 Getter for symbol label.
 
 fill_color = property
 Getter for the fill color.
 
 stroke_color = property
 Getter for the stroke color.
 
 stroke_width = property
 Getter for the stroke width.
 
 opacity = property
 Getter for opacity.
 
 stroke_dash = property
 Getter for stroke_dash.
 
 layer = property
 
 xform = property
 

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

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

Reimplemented from bridges.symbol.Symbol.

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.

◆ set_rectangle()

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

Member Data Documentation

◆ _height

bridges.rectangle.Rectangle._height
protected

◆ _locx

bridges.rectangle.Rectangle._locx
protected

◆ _locy

bridges.rectangle.Rectangle._locy
protected

◆ _width

bridges.rectangle.Rectangle._width
protected

Property Documentation

◆ height

bridges.rectangle.Rectangle.height = property
static

Getter for the height of the rectangle.

Returns
float the height of the rectangle

◆ lower_left

bridges.rectangle.Rectangle.lower_left = property
static

◆ width

bridges.rectangle.Rectangle.width = property
static

Getter for the rectangle width.

Returns
float the width

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