示例#1
0
    def __init__(self,kw):
        """
            Initialize a Arc/Circle.
            kw['TEXT_0'] position point must be a point
            kw['TEXT_1'] text must be a valid text
            kw['TEXT_2'] angle must be a valid radiant float value or None
            kw['TEXT_3'] position of the text refered to the position point must be a valid string value or None
        """
        argDescription={
                        "TEXT_0":Point,
                        "TEXT_1":(float, str, unicode),
                        "TEXT_2":(float, int),
                        "TEXT_3":(str, unicode)
                        }

        if kw['TEXT_2']==None:
            kw['TEXT_2'] = 0
        from kernel.initsetting             import TEXT_POSITION
        if kw['TEXT_3']==None:
            kw['TEXT_3'] = 'sw'
        else:
            if not kw['TEXT_3'] in TEXT_POSITION:
                kw['TEXT_3'] = 'sw'
                #if kw['TEXT_3']=='':
                #    kw['TEXT_3'] = 'sw'
                #else:
                #    raise TypeError, "Argument for TEXT_3 not supported"

        GeometricalEntity.__init__(self,kw, argDescription)
示例#2
0
    def __init__(self,kw):
        """
            Initialize a Arc/Circle.
            kw['TEXT_0'] position point must be a point 
            kw['TEXT_1'] text must be a valid text
            kw['TEXT_2'] angle must be a valid radiant float value or None
            kw['TEXT_3'] position of the text refered to the position point must be a valid string value or None
        """
        argDescription={
                        "TEXT_0":Point,
                        "TEXT_1":(float, str, unicode), 
                        "TEXT_2":(float, int), 
                        "TEXT_3":(str, unicode)
                        }
        
        if kw['TEXT_2']==None:
            kw['TEXT_2'] = 0
        from Kernel.initsetting             import TEXT_POSITION
        if kw['TEXT_3']==None:
            kw['TEXT_3'] = 'sw'
        else:
            if not kw['TEXT_3'] in TEXT_POSITION:
                kw['TEXT_3'] = 'sw'
                #if kw['TEXT_3']=='':
                #    kw['TEXT_3'] = 'sw'
                #else:
                #    raise TypeError, "Argument for TEXT_3 not supported"

        GeometricalEntity.__init__(self,kw, argDescription)
示例#3
0
 def rotate(self, rotationPoint, angle):
     """
         overloading of the rotate base method
     """
     GeometricalEntity.rotate(self, rotationPoint, angle)
     self.angle=self.angle-angle
示例#4
0
 def rotate(self, rotationPoint, angle):
     """
         overloading of the rotate base method 
     """
     GeometricalEntity.rotate(self, rotationPoint, angle)
     self.angle=self.angle-angle