CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 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.

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

Member Function Documentation

def svgfig.Rect.__repr__ (   self)

Definition at line 2191 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, 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(), 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, 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__().

2192  def __repr__(self):
2193  return "<Rect (%g, %g), (%g, %g) %s>" % (self.x1, self.y1, self.x2, self.y2, self.attr)
def __repr__
Definition: svgfig.py:2191
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(), 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(), 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, 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
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)
def Path
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().

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

Member Data Documentation

svgfig.Rect.attr

Definition at line 2197 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 2189 of file svgfig.py.

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

svgfig.Rect.f

Definition at line 2216 of file svgfig.py.

Referenced by svgfig.Ticks.__repr__(), Vispa.Views.RootCanvasView.RootCanvasView.createGraph(), Vispa.Views.RootCanvasView.RootCanvasView.createLegoPlot(), ztail.Decoder.initial_synchronize(), and svgfig.Ticks.orient_tickmark().

svgfig.Rect.high

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

Definition at line 2214 of file svgfig.py.

svgfig.Rect.low

Definition at line 2212 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 2195 of file svgfig.py.

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