예제 #1
0
 def __init__(self, shape):
     Line.__init__(self, shape)
     StraightShape.__init__(self, shape)
예제 #2
0
파일: edge.py 프로젝트: Andvari/iges
 def __init__(self, p0, p1):
     assert type(p0) is Point, 'Edge __init__(): p0 is not Point'
     assert type(p1) is Point, 'Edge __init__(): p1 is not Point'
     Line.__init__(p0, p1)
예제 #3
0
    def __init__(self, canvas, plot, orientation='horizontal', inside='up', scaling='linear', logBase=10, **kwprops):

        # Need to define the label before init'ing the Line. This is because we
        # override Line.setOrigin to include the label, but setOrigin is called
        # in Line.__init__.
        self._label = Text(canvas)

        kwprops.update(aliased=True)
        Line.__init__(self, canvas, **kwprops)

        # Make this the parent of the label, for when they need to be cleared from the screen
        self.addChild(self._label)

        self._plot = plot

        #######
        # Set default location values
        #######
        self.setOrigin(0.0, 0.0)

        # plotStart, plotEnd are start and end position, in plot coordinates. if horizontal,
        # these are x coordinates, if vertical, y coordinates.
        # plotAnchor is the opposite; if horizontal, it is the y coordinate that the axis is
        # located at.
        # plotLength = plotEnd - plotStart
        self._plotAnchor = 0.0
        self._plotStart = 0.0
        self._plotEnd = 0.0
        self._plotLength = 0.0

        # dataStart, dataEnd are the start and end position, in data coordinates.
        # dataLength = dataEnd - dataStart
        self._dataStart = 0.0
        self._dataEnd = 0.0
        self._dataLength = 0.0

        self._autoscaled = True  # holds whether this Axis is currently being autoscaled to the data

        # Setup the major and minor ticks
        self._majorTicks = Ticks(self.canvas(), self, 'major', labeler=FormatLabeler())
        self._minorTicks = Ticks(self.canvas(), self, 'minor', labeler=NullLabeler())
        self._minorTicks.setLocator(num=3)
        self._minorTicks.setLength(3)
        self._minorTicks._labelProps.update(visible=False)

        # Make this the parent of the ticks, for when they need to be cleared from the screen
        self.addChild(self._majorTicks)
        self.addChild(self._minorTicks)

        self._slavedTo = None  # pointer to this Axis' master
        self._masterOf = []    # list of pointers to this Axis' slaves

        # 'up' or 'down'
        self._inside = None
        self.setInside(inside)

        # 'horizontal' or 'vertical'
        self._orientation = None
        self.setOrientation(orientation)

        # Scaling value. Can be 'linear', 'log', or 'symlog'
        self._scaling = None
        self._logBase = 10
        self.setScaling(scaling, logBase=logBase)