Example #1
0
 def draw(self):
     drawDirectionArrow(self.color,
                        self.tailPoint,
                        self.arrowBasePoint,
                        self.tailRadius,
                        self.scale,
                        tailRadiusLimits=self.tailRadiusLimits,
                        numberOfSides=6,
                        glpane=self.glpane,
                        scale_to_glpane=self.scale_to_glpane)
Example #2
0
 def draw(self):        
     drawDirectionArrow(
         self.color, 
         self.tailPoint, 
         self.arrowBasePoint,
         self.tailRadius,
         self.scale,
         tailRadiusLimits = self.tailRadiusLimits,
         numberOfSides = 6,
         glpane = self.glpane,
         scale_to_glpane = self.scale_to_glpane
     )          
Example #3
0
    def _draw(self, flipDirection = False, highlighted = False):
        """ Main drawing code. 
        @param flipDirection: This flag decides the direction in which the 
               arrow is drawn. This value is set in the leftClick method. 
               The default value is 'False'
        @type   flipDirection: bool
        @param highlighted: Decids the color of the arrow based on whether 
               it is highlighted. The default value is 'False'
        @type  highlighted: bool

        """

        if highlighted:
            color = orange
        else:
            color = gray

        if flipDirection:
            #@NOTE: Remember we are drawing the arrow inside of the _draw_geometry 
            #so its drawing it in the translated coordinate system (translated
            #at the center of the Plane. So we should do the following. 
            #(i.e. use V(0,0,1)). This will change if we decide to draw the 
            #direction arrow outside of the parent object 
            #requesting this drawing.--ninad 20070612
            #Using headPoint = self.tailPoint + V(0,0,1) * 2.0 etc along with 
            #the transformation matrix in self.draw_in_abs_coordinate()
            #fixes bug 2702 and 2703 -- Ninad 2008-06-11
            headPoint = self.tailPoint + V(0,0,1) * 2.0
            ##headPoint = self.tailPoint + 2.0 * norm(self.parent.getaxis())
        else:            
            headPoint = self.tailPoint - V(0,0,1) * 2.0
            ##headPoint = self.tailPoint - 2.0 * self.parent.getaxis()



        vec = vlen(headPoint - self.tailPoint)
        vec = self.glpane.scale*0.07*vec
        tailRadius = vlen(vec)*0.16

        drawDirectionArrow(color, 
                           self.tailPoint, 
                           headPoint,
                           tailRadius,
                           self.glpane.scale,
                           flipDirection = flipDirection)
Example #4
0
    def _draw(self, flipDirection = False, highlighted = False):
        """ Main drawing code. 
        @param flipDirection: This flag decides the direction in which the 
               arrow is drawn. This value is set in the leftClick method. 
               The default value is 'False'
        @type   flipDirection: bool
        @param highlighted: Decids the color of the arrow based on whether 
               it is highlighted. The default value is 'False'
        @type  highlighted: bool

        """

        if highlighted:
            color = orange
        else:
            color = gray

        if flipDirection:
            #@NOTE: Remember we are drawing the arrow inside of the _draw_geometry 
            #so its drawing it in the translated coordinate system (translated
            #at the center of the Plane. So we should do the following. 
            #(i.e. use V(0,0,1)). This will change if we decide to draw the 
            #direction arrow outside of the parent object 
            #requesting this drawing.--ninad 20070612
            #Using headPoint = self.tailPoint + V(0,0,1) * 2.0 etc along with 
            #the transformation matrix in self.draw_in_abs_coordinate()
            #fixes bug 2702 and 2703 -- Ninad 2008-06-11
            headPoint = self.tailPoint + V(0,0,1) * 2.0
            ##headPoint = self.tailPoint + 2.0 * norm(self.parent.getaxis())
        else:            
            headPoint = self.tailPoint - V(0,0,1) * 2.0
            ##headPoint = self.tailPoint - 2.0 * self.parent.getaxis()



        vec = vlen(headPoint - self.tailPoint)
        vec = self.glpane.scale*0.07*vec
        tailRadius = vlen(vec)*0.16

        drawDirectionArrow(color, 
                           self.tailPoint, 
                           headPoint,
                           tailRadius,
                           self.glpane.scale,
                           flipDirection = flipDirection)