示例#1
0
    def draw_component(self, ctx, page_w, page_h):

        """
        Draws a straight. Mainly calls supporting functions.

        This function is called by the 'component' base class.

        Arguments:
        ctx -- a Pycairo context
        page_w, page_h -- width and height of drawing area
        """

        # Call the parent function...

        Pipe.draw_component(self, ctx, page_w, page_h)

        # ...and then provide straight-specific drawing functionality.

        self.draw_center_line(ctx)
        self.draw_len_dim(ctx)
示例#2
0
    def draw_component(self, ctx, page_w, page_h):

        """
        Draws a bend. Mainly calls supporting functions.

        This function is called by the 'component' base class.

        Arguments:
        ctx -- a Pycairo context
        page_w, page_h -- width and height of drawing area
        """

        # Call the superclass function...

        Pipe.draw_component(self, ctx, page_w, page_h)

        # ...and then provide bend-specific drawing functionality.

        self.draw_ribs(ctx, "li")
        self.draw_center_arc(ctx)
        self.draw_arc_dims(ctx)
        if self.ex_dim_drg:
            self.draw_seg_dims(ctx)