Example #1
0
 def AddPoint(self, d):
     if (self.drawing_mode == LineDrawingMode) or (self.drawing_mode
                                                   == ArcDrawingMode):
         # edit the end of the previous item to be the start of the arc
         # this only happens if we are drawing tangents to other objects
         # really need to fill the gap with whatever we are tangent around
         # ellipse,arc,spline or whatever
         if (self.TempObject() != None) and (self.prev_object != None):
             if (self.prev_object != None):
                 spos = self.TempObject().GetStartPoint()
                 epos = self.prev_object.GetEndPoint()
                 tanobject = self.start_pos.GetObject1()
                 if self.start_pos.type == cad.DigitizeType.DIGITIZE_TANGENT_TYPE and (
                         tanobject != None):
                     if tanobject.GetType() == cad.OBJECT_TYPE_SKETCH_LINE:
                         #((HLine*)prev_object)->B = p;
                         pass
                     elif tanobject.GetType() == cad.OBJECT_TYPE_SKETCH_ARC:
                         tanobject.A = geom.Point3D(spos)
                         tanobject.B = geom.Point3D(epos)
                         self.AddToTempObjects(tanobject)
                     elif tanobject.GetType() == cad.OBJECT_TYPE_CIRCLE:
                         arc = cad.NewArc(spos, epos, tanobject.axis,
                                          tanobject.C)
                         arc.A = geom.Point3D(spos)
                         arc.B = geom.Point3D(epos)
                         self.AddToTempObjects(arc)
     Drawing.AddPoint(self, d)