CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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__
 
def __repr__
 
def Path
 
def SVG
 
- Public Member Functions inherited from svgfig.Curve
def __init__
 
def __repr__
 
def Path
 
def sample
 end nested class More...
 
def subsample
 
def SVG
 

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
 
 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

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

Definition at line 2195 of file svgfig.py.

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

Member Function Documentation

def svgfig.Rect.__repr__ (   self)

Definition at line 2192 of file svgfig.py.

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

Referenced by data_sources.json_file.__str__().

2193  def __repr__(self):
2194  return "<Rect (%g, %g), (%g, %g) %s>" % (self.x1, self.y1, self.x2, self.y2, self.attr)
def __repr__
Definition: svgfig.py:2192
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(), L1DataEmulDigi.x1(), TrackingTools_PatternTools::dictionary.x1, CTPPSFastTrack.x1(), DDTrap.x1(), DDPseudoTrap.x1(), APD.x1, Exhume::CrossSection.x1, svgfig.VLine.x1, svgfig.YAxis.x1, reco::PdfInfo.x2, L1MonitorDigi.x2(), L1DataEmulDigi.x2(), TrackingTools_PatternTools::dictionary.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.

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

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

Member Data Documentation

svgfig.Rect.attr

Definition at line 2198 of file svgfig.py.

Referenced by svgfig.Ticks.__repr__(), svgfig.Axes.__repr__(), svgfig.HGrid.__repr__(), svgfig.VGrid.__repr__(), svgfig.Grid.__repr__(), svgfig.Axes.SVG(), svgfig.XErrorBars.SVG(), and svgfig.YErrorBars.SVG().

dictionary svgfig.Rect.defaults = {}
static

Definition at line 2190 of file svgfig.py.

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

svgfig.Rect.f

Definition at line 2217 of file svgfig.py.

Referenced by svgfig.Ticks.__repr__(), ztail.Decoder.initial_synchronize(), and svgfig.Ticks.orient_tickmark().

svgfig.Rect.high

Definition at line 2214 of file svgfig.py.

Referenced by svgfig.Ticks.__repr__(), svgfig.HGrid.__repr__(), svgfig.VGrid.__repr__(), svgfig.Ticks.compute_logminiticks(), svgfig.Ticks.compute_logticks(), svgfig.Ticks.compute_miniticks(), svgfig.Ticks.compute_ticks(), svgfig.Ticks.interpret(), svgfig.Ticks.orient_tickmark(), and svgfig.Ticks.regular_miniticks().

svgfig.Rect.loop

Definition at line 2215 of file svgfig.py.

svgfig.Rect.low

Definition at line 2213 of file svgfig.py.

Referenced by svgfig.Ticks.__repr__(), svgfig.HGrid.__repr__(), svgfig.VGrid.__repr__(), svgfig.Ticks.compute_logminiticks(), svgfig.Ticks.compute_logticks(), svgfig.Ticks.compute_miniticks(), svgfig.Ticks.compute_ticks(), svgfig.Ticks.interpret(), svgfig.Ticks.orient_tickmark(), and svgfig.Ticks.regular_miniticks().

svgfig.Rect.y2

Definition at line 2196 of file svgfig.py.

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