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 2180 of file svgfig.py.

Constructor & Destructor Documentation

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

Definition at line 2194 of file svgfig.py.

2194  def __init__(self, x1, y1, x2, y2, **attr):
2195  self.x1, self.y1, self.x2, self.y2 = x1, y1, x2, y2
2196 
2197  self.attr = dict(self.defaults)
2198  self.attr.update(attr)
2199 
def __init__(self, x1, y1, x2, y2, attr)
Definition: svgfig.py:2194
dictionary defaults
Definition: svgfig.py:1509

Member Function Documentation

def svgfig.Rect.__repr__ (   self)
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 2204 of file svgfig.py.

References svgfig.SVG.attr, svgfig.Path.attr, svgfig.Curve.attr, reco::PdfInfo.x1, L1MonitorDigi.x1(), L1DataEmulDigi.x1(), CTPPSFastTrack.x1(), TrackingTools_PatternTools::dictionary.x1, DDTrap.x1(), DataFormats_TrackReco::dictionary.x1, DDPseudoTrap.x1(), DataFormats_METReco::dictionary.x1, Exhume::CrossSection.x1, svgfig.VLine.x1, svgfig.YAxis.x1, reco::PdfInfo.x2, L1MonitorDigi.x2(), L1DataEmulDigi.x2(), CTPPSFastTrack.x2(), TrackingTools_PatternTools::dictionary.x2, DDTrap.x2(), DataFormats_TrackReco::dictionary.x2, DDPseudoTrap.x2(), DataFormats_METReco::dictionary.x2, Exhume::CrossSection.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.

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

Definition at line 2200 of file svgfig.py.

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

2200  def SVG(self, trans=None):
2201  """Apply the transformation "trans" and return an SVG object."""
2202  return self.Path(trans).SVG()
2203 
def Path(self, trans=None, local=False)
Definition: svgfig.py:1653
def SVG(self, trans=None)
Definition: svgfig.py:2200

Member Data Documentation

svgfig.Rect.attr
dictionary svgfig.Rect.defaults = {}
static

Definition at line 2189 of file svgfig.py.

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

svgfig.Rect.f
svgfig.Rect.high
svgfig.Rect.loop

Definition at line 2214 of file svgfig.py.

svgfig.Rect.low
svgfig.Rect.y2

Definition at line 2195 of file svgfig.py.

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