tvaLib
Public Member Functions | Public Attributes | List of all members
lib.scene.Alignment Class Reference
Inheritance diagram for lib.scene.Alignment:

Public Member Functions

def __init__ (self, align_data, a_type=0, id=0, localString='Alignment')
 
def getName (self)
 
def getType (self)
 
def getPrintName (self)
 
def getPrintShortName (self)
 
def getSCoordinates (self)
 
def getXCoordinatesBB (self)
 
def getYCoordinatesBB (self)
 
def hasAlignBB (self)
 
def getUserTypeProbabilities (self)
 

Public Attributes

 name
 
 localString
 
 id
 
 pos_bb
 
 S
 
 type
 

Detailed Description

Definition at line 1298 of file scene.py.

Constructor & Destructor Documentation

◆ __init__()

def lib.scene.Alignment.__init__ (   self,
  align_data,
  a_type = 0,
  id = 0,
  localString = 'Alignment' 
)
Alignment container class

    Input:
    ======
    localString: local name used to label Alignment objects
    id:          global id of alignment at site
    a_type:      0=road, 1=sidewalk, 2=bikepath

Definition at line 1299 of file scene.py.

1299  def __init__(self, align_data, a_type=0, id=0, localString='Alignment'):
1300  ''' Alignment container class
1301 
1302  Input:
1303  ======
1304  localString: local name used to label Alignment objects
1305  id: global id of alignment at site
1306  a_type: 0=road, 1=sidewalk, 2=bikepath
1307  '''
1308  tvaLib.Constructors.SuperPointList.__init__(self, align_data)
1309  self.name = 'align_'+str(id)
1310  self.localString = localString
1311  self.id = id
1312  self.pos_bb = []
1313  self.S = [0.0]
1314  self.type = a_type
1315  for p in range(len(self.pos)):
1316  if(p+1 >= len(self.pos)):
1317  break
1318  self.S.append(self.S[-1]+m.sqrt((self.getXCoordinates()[p+1]-self.getXCoordinates()[p])**2+(self.getYCoordinates()[p+1]-self.getYCoordinates()[p])**2))
1319  return
1320 

Member Function Documentation

◆ getName()

def lib.scene.Alignment.getName (   self)

Definition at line 1321 of file scene.py.

1321  def getName(self): return self.name

◆ getPrintName()

def lib.scene.Alignment.getPrintName (   self)

Definition at line 1323 of file scene.py.

1323  def getPrintName(self): return self.localString+' '+str(self.id+1)

◆ getPrintShortName()

def lib.scene.Alignment.getPrintShortName (   self)

Definition at line 1324 of file scene.py.

1324  def getPrintShortName(self): return self.localString[:5]+' '+str(self.id+1)

◆ getSCoordinates()

def lib.scene.Alignment.getSCoordinates (   self)

Definition at line 1325 of file scene.py.

1325  def getSCoordinates(self): return [point for point in self.S]

◆ getType()

def lib.scene.Alignment.getType (   self)

Definition at line 1322 of file scene.py.

1322  def getType(self): return self.type

◆ getUserTypeProbabilities()

def lib.scene.Alignment.getUserTypeProbabilities (   self)
Define user type probabilities for this alignment type. 

Definition at line 1333 of file scene.py.

1333  def getUserTypeProbabilities(self):
1334  ''' Define user type probabilities for this alignment type. '''
1335  if(self.type==1): return {0:0.0, 1:0.05, 2:0.80, 4:0.15}
1336  elif(self.type==2): return {0:0.0, 1:0.05, 2:0.15, 4:0.80}
1337  else: return {0:0.0, 1:0.40, 2:0.20, 4:0.40}
1338 

◆ getXCoordinatesBB()

def lib.scene.Alignment.getXCoordinatesBB (   self)

Definition at line 1326 of file scene.py.

1326  def getXCoordinatesBB(self): return [point[0] for point in self.pos_bb]

◆ getYCoordinatesBB()

def lib.scene.Alignment.getYCoordinatesBB (   self)

Definition at line 1327 of file scene.py.

1327  def getYCoordinatesBB(self): return [point[1] for point in self.pos_bb]
1328 

◆ hasAlignBB()

def lib.scene.Alignment.hasAlignBB (   self)

Definition at line 1329 of file scene.py.

1329  def hasAlignBB(self):
1330  if(self.pos_bb): return True
1331  else: return False
1332 

Member Data Documentation

◆ id

lib.scene.Alignment.id

Definition at line 1311 of file scene.py.

◆ localString

lib.scene.Alignment.localString

Definition at line 1310 of file scene.py.

◆ name

lib.scene.Alignment.name

Definition at line 1309 of file scene.py.

◆ pos_bb

lib.scene.Alignment.pos_bb

Definition at line 1312 of file scene.py.

◆ S

lib.scene.Alignment.S

Definition at line 1313 of file scene.py.

◆ type

lib.scene.Alignment.type

Definition at line 1314 of file scene.py.


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