Bridges-Python 3.5.1
Bridges(Python API)
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Properties | List of all members
bridges.symbol.Symbol Class Reference

This is the base class for constructing simple shapes in BRIDGES. More...

Inheritance diagram for bridges.symbol.Symbol:
bridges.circle.Circle bridges.polyline.Polyline bridges.rectangle.Rectangle bridges.symbol_group.SymbolGroup bridges.text.Text bridges.polygon.Polygon

Public Member Functions

 __init__ (self)
 Constructor for a Symbol.
 
 get_shape_type (self)
 
 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)
 
dict get_json_representation (self)
 Get the json representation of the Symbol class.
 
 add_all_json (self, symbol_json, parent)
 

Protected Attributes

 _label
 
 _fill_color
 
 _stroke_color
 
 _opacity
 
 _stroke_width
 
 _stroke_dash
 
 _layer
 
 _transform
 
 _xform
 
 _xform_flag
 

Properties

 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 is the base class for constructing simple shapes in BRIDGES.

This is an abstract class for deriving a number of Symbol shape objects, for use in a SymbolCollection. Symbols correspond to a simplified subset of SVG paths and shapes for custom visual representations in BRIDGES.

Users will typically one of the subclasses of this object for creating shapes

Currently shapes supported are rectangle, circle, polygon, polyline and label; each shape has a name, location (x, y) and appropriate geometric and non-geometric attributes

Author
David Burlinson, Kalpathi Subramanian
Date
12/24/18, 7/12/19

Constructor & Destructor Documentation

◆ __init__()

bridges.symbol.Symbol.__init__ (   self)

Member Function Documentation

◆ add_all_json()

bridges.symbol.Symbol.add_all_json (   self,
  symbol_json,
  parent 
)

◆ get_json_representation()

dict bridges.symbol.Symbol.get_json_representation (   self)

Get the json representation of the Symbol class.

Returns
dict the JSON representation

Reimplemented in bridges.circle.Circle, bridges.polyline.Polyline, bridges.rectangle.Rectangle, and bridges.text.Text.

◆ get_shape_type()

bridges.symbol.Symbol.get_shape_type (   self)

◆ identity()

list bridges.symbol.Symbol.identity (   self,
list  m 
)

create the identity matrix

Parameters
mis a 3x3 input matrix as a 2d list
Returns
a 2d list as a 3x3 identity matrix

◆ mat_mult()

list bridges.symbol.Symbol.mat_mult (   self,
list  m1,
list  m2 
)

◆ print_mat()

bridges.symbol.Symbol.print_mat (   self,
list  m 
)

print the current matrix for debugging

Parameters
m3x3 matrix as 2d list to be printed

◆ rotate()

bridges.symbol.Symbol.rotate (   self,
args 
)

◆ scale()

bridges.symbol.Symbol.scale (   self,
args 
)

scale the symbol from a particular center location

   if args is a single float, then scale both dimensions from the origin (what you want in 99% of cases)

   if args is two floats, scale x based on args[0] and y based on args[1] from the origin

   if args is four float, scale x based on args[0] and y based on args[1] from point args[2],args[3]

◆ set_transform()

bridges.symbol.Symbol.set_transform (   self,
float  a,
float  b,
float  c,
float  d,
float  e,
float  f 
)

◆ translate()

bridges.symbol.Symbol.translate (   self,
float  tx,
float  ty 
)

◆ vec_mat_mult()

list bridges.symbol.Symbol.vec_mat_mult (   self,
list  m,
list  v 
)

Member Data Documentation

◆ _fill_color

bridges.symbol.Symbol._fill_color
protected

◆ _label

bridges.symbol.Symbol._label
protected

◆ _layer

bridges.symbol.Symbol._layer
protected

◆ _opacity

bridges.symbol.Symbol._opacity
protected

◆ _stroke_color

bridges.symbol.Symbol._stroke_color
protected

◆ _stroke_dash

bridges.symbol.Symbol._stroke_dash
protected

◆ _stroke_width

bridges.symbol.Symbol._stroke_width
protected

◆ _transform

bridges.symbol.Symbol._transform
protected

◆ _xform

bridges.symbol.Symbol._xform
protected

◆ _xform_flag

bridges.symbol.Symbol._xform_flag
protected

Property Documentation

◆ fill_color

bridges.symbol.Symbol.fill_color = property
static

Getter for the fill color.

Returns
Color the current fill color of this symbol

◆ label

bridges.symbol.Symbol.label = property
static

Getter for symbol label.

Returns
str the label of this shape

◆ layer

bridges.symbol.Symbol.layer = property
static

◆ opacity

bridges.symbol.Symbol.opacity = property
static

Getter for opacity.

Returns
float opacity of the shape

◆ stroke_color

bridges.symbol.Symbol.stroke_color = property
static

Getter for the stroke color.

Returns
the stroke (boundary) color of the shape

◆ stroke_dash

bridges.symbol.Symbol.stroke_dash = property
static

Getter for stroke_dash.

Returns
float the stroke texture

◆ stroke_width

bridges.symbol.Symbol.stroke_width = property
static

Getter for the stroke width.

Returns
float the stroke width of the shape

◆ xform

bridges.symbol.Symbol.xform = property
static

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