CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Static Public Attributes
svgfig.Rect Class Reference
Inheritance diagram for svgfig.Rect:
svgfig.Curve

Public Member Functions

def __init__ (self, x1, y1, x2, y2, attr)
 
def __repr__ (self)
 
def Path (self, trans=None, local=False)
 
def SVG (self, trans=None)
 
- Public Member Functions inherited from svgfig.Curve
def __init__ (self, f, low, high, loop=False, attr)
 
def __repr__ (self)
 
def Path (self, trans=None, local=False)
 
def sample (self, trans=None)
 end nested class More...
 
def subsample (self, left, right, depth, trans=None)
 
def SVG (self, trans=None)
 

Public Attributes

 attr
 
 f
 
 high
 
 loop
 
 low
 
 y2
 
- Public Attributes inherited from svgfig.Curve
 attr
 
 f
 
 high
 
 last_samples
 
 loop
 
 low
 

Static Public Attributes

dictionary defaults = {}
 
- Static Public Attributes inherited from svgfig.Curve
dictionary defaults = {}
 
int discontinuity_limit = 5.
 
float linearity_limit = 0.05
 
bool random_sampling = True
 
int recursion_limit = 15
 

Detailed Description

Draws a rectangle.

Rect(x1, y1, x2, y2, attribute=value)

x1, y1                  required        the starting point
x2, y2                  required        the ending point
attribute=value pairs   keyword list    SVG attributes

Definition at line 2181 of file svgfig.py.

Constructor & Destructor Documentation

◆ __init__()

def svgfig.Rect.__init__ (   self,
  x1,
  y1,
  x2,
  y2,
  attr 
)

Definition at line 2195 of file svgfig.py.

2195  def __init__(self, x1, y1, x2, y2, **attr):
2196  self.x1, self.y1, self.x2, self.y2 = x1, y1, x2, y2
2197 
2198  self.attr = dict(self.defaults)
2199  self.attr.update(attr)
2200 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)
#define update(a, b)

Member Function Documentation

◆ __repr__()

def svgfig.Rect.__repr__ (   self)

◆ Path()

def svgfig.Rect.Path (   self,
  trans = None,
  local = False 
)
Apply the transformation "trans" and return a Path object in
global coordinates.  If local=True, return a Path in local coordinates
(which must be transformed again).

Definition at line 2205 of file svgfig.py.

References svgfig.SVG.attr, svgfig.Path.attr, svgfig.Curve.attr, reco::PdfInfo.x1, L1MonitorDigi.x1(), trackerTFP::State.x1(), L1DataEmulDigi.x1(), CTPPSFastTrack.x1(), DDTrap.x1(), DDPseudoTrap.x1(), APD.x1, Exhume::CrossSection.x1, svgfig.VLine.x1, svgfig.YAxis.x1, reco::PdfInfo.x2, L1MonitorDigi.x2(), trackerTFP::State.x2(), L1DataEmulDigi.x2(), CTPPSFastTrack.x2(), DDTrap.x2(), DDPseudoTrap.x2(), APD.x2, Exhume::CrossSection.x2, trklet::IMATH_TrackletCalculatorDisk.x2, trklet::IMATH_TrackletCalculatorOverlap.x2, trklet::IMATH_TrackletCalculator.x2, svgfig.VLine.x2, svgfig.YAxis.x2, CTPPSFastTrack.y1(), DDTrap.y1(), DDPseudoTrap.y1(), svgfig.HLine.y1, svgfig.XAxis.y1, svgfig.Line.y2, svgfig.LineGlobal.y2, svgfig.HLine.y2, and svgfig.Rect.y2.

2205  def Path(self, trans=None, local=False):
2206  """Apply the transformation "trans" and return a Path object in
2207  global coordinates. If local=True, return a Path in local coordinates
2208  (which must be transformed again)."""
2209  if trans == None:
2210  return Path([("M", self.x1, self.y1, not local), ("L", self.x2, self.y1, not local), ("L", self.x2, self.y2, not local), ("L", self.x1, self.y2, not local), ("Z",)], **self.attr)
2211 
2212  else:
2213  self.low = 0.
2214  self.high = 1.
2215  self.loop = False
2216 
2217  self.f = lambda t: (self.x1 + t*(self.x2 - self.x1), self.y1)
2218  d1 = Curve.Path(self, trans, local).d
2219 
2220  self.f = lambda t: (self.x2, self.y1 + t*(self.y2 - self.y1))
2221  d2 = Curve.Path(self, trans, local).d
2222  del d2[0]
2223 
2224  self.f = lambda t: (self.x2 + t*(self.x1 - self.x2), self.y2)
2225  d3 = Curve.Path(self, trans, local).d
2226  del d3[0]
2227 
2228  self.f = lambda t: (self.x1, self.y2 + t*(self.y1 - self.y2))
2229  d4 = Curve.Path(self, trans, local).d
2230  del d4[0]
2231 
2232  return Path(d=(d1 + d2 + d3 + d4 + [("Z",)]), **self.attr)
2233 

◆ SVG()

def svgfig.Rect.SVG (   self,
  trans = None 
)
Apply the transformation "trans" and return an SVG object.

Definition at line 2201 of file svgfig.py.

References SiStripHistoPlotter::PlotParameter.Path, jsoncollector::Json::PathArgument.Path, and svgfig.Curve.Path().

2201  def SVG(self, trans=None):
2202  """Apply the transformation "trans" and return an SVG object."""
2203  return self.Path(trans).SVG()
2204 

Member Data Documentation

◆ attr

svgfig.Rect.attr

◆ defaults

dictionary svgfig.Rect.defaults = {}
static

Definition at line 2190 of file svgfig.py.

Referenced by tree.Tree.reset(), and tree.Tree.var().

◆ f

svgfig.Rect.f

◆ high

svgfig.Rect.high

◆ loop

svgfig.Rect.loop

Definition at line 2215 of file svgfig.py.

◆ low

svgfig.Rect.low

◆ y2

svgfig.Rect.y2

Definition at line 2196 of file svgfig.py.

Referenced by svgfig.Rect.__repr__(), and svgfig.Rect.Path().