Bridges-Python-3.0.2  3.0.2
Bridges(PythonAPI)
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 has height and width

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

Public Member Functions

def __init__ (self, kwargs)
 Constructor for the rectangle symbol. More...
 
def get_name (self)
 Getter for the name of the shape. More...
 
def width (self)
 Getter for the rectangle width. More...
 
def width (self, w)
 Setter for the width of the rectangles. More...
 
def height (self)
 Getter for the height of the rectangle. More...
 
def height (self, h)
 Setter for the height of the rectangle. More...
 
def get_dimensions (self)
 Getter for the dimensions of the rectangle. More...
 
def set_rectangle (self, locx, locy, w, h)
 Setter function for setting the rectangles size and location from scratch. More...
 
def translate (self, tx, ty)
 
def scale (self, sx, sy)
 
def 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...
 
def label (self)
 Getter for symbol label. More...
 
def label
 Setter for symbol label. More...
 
def identifier (self)
 Getter for the symbols identifier. More...
 
def fill_color (self)
 Getter for the fill color. More...
 
def fill_color (self, args, kwargs)
 Setter for the fill color. More...
 
def stroke_color (self)
 Getter for the stroke color. More...
 
def stroke_color (self, args, kwargs)
 Setter for the stroke color. More...
 
def stroke_width (self)
 Getter for the stroke width. More...
 
def stroke_width
 Setter for the stroke width. More...
 
def opacity (self)
 Getter for opacity. More...
 
def opacity
 Setter for opacity. More...
 
def stroke_dash (self)
 Getter for stroke_dash. More...
 
def stroke_dash
 Setter for stroke_dash. More...
 
def shape_type (self)
 
def shape_type (self, shape)
 
def set_location
 Setter for the location of the center of the symbol. More...
 
def get_location (self)
 Getter for the location of a symbol. More...
 
def get_dimensions (self)
 Getter for the dimensions. More...
 
def translate_point (self, pt, tx, ty)
 
def scale_point (self, pt, sx, sy)
 
def rotate_point (self, pt, angle)
 
def get_json_representation (self)
 Get the json representation of the Symbol class. More...
 

Public Attributes

 shape_type
 
 width
 
 height
 

Constructor & Destructor Documentation

◆ __init__()

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

Constructor for the rectangle symbol.

(float) w: width of the rectangle (float) h: height of the rectangle (float) locx: x location of rectangle (float) locy: y loaction of rectangle

Returns
None
Exceptions
ValueErrorif the width or height is less than 0

Member Function Documentation

◆ get_dimensions()

def bridges.rectangle.Rectangle.get_dimensions (   self,
  list 
)

Getter for the dimensions of the rectangle.

Returns
list the bounding box of the shape (xmin, xmax, ymin, ymax)

◆ get_json_representation()

def bridges.rectangle.Rectangle.get_json_representation (   self,
  dict 
)

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

Returns
dict representing the json

◆ get_name()

def bridges.rectangle.Rectangle.get_name (   self,
  str 
)

Getter for the name of the shape.

Returns
str shape name

◆ height() [1/2]

def bridges.rectangle.Rectangle.height (   self,
  float 
)

Getter for the height of the rectangle.

Returns
float the height of the rectangle

◆ height() [2/2]

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

Setter for the height of the rectangle.

(float) h: the height to be applied

Returns
None
Exceptions
ValueErrorif the height is < 0 or > 300

◆ scale()

def bridges.rectangle.Rectangle.scale (   self,
  sx,
  sy 
)

◆ 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 rectangle (float) locy: the y location of rectangle (float) w: the width of rectangle (float) h: the height of rectangle

Returns
None
Exceptions
ValueErrorif the height or width is < 0 or > 300

◆ translate()

def bridges.rectangle.Rectangle.translate (   self,
  tx,
  ty 
)

◆ width() [1/2]

def bridges.rectangle.Rectangle.width (   self,
  float 
)

Getter for the rectangle width.

Returns
float the width

◆ width() [2/2]

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

Setter for the width of the rectangles.

(float) w: the width to be applied to rectangle

Returns
None
Exceptions
ValueErrorif the width is < 0 or > 300

Member Data Documentation

◆ height

bridges.rectangle.Rectangle.height

◆ shape_type

bridges.rectangle.Rectangle.shape_type

◆ width

bridges.rectangle.Rectangle.width

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