def getModelTee(self): left_sleeve_width = Geometry2D.distance(self.sleeve_top,self.sleeve_node)*2 return Models.Model_Tee_Skel_No_Skew(True, self.spine_bottom.toTuple(), self.spine_top.toTuple(), self.collar.toTuple(), self.shoulder_joint.toTuple(), self.shoulder_top.toTuple(), self.sleeve_node.toTuple(),self.bottom_left.toTuple(),left_sleeve_width )
def snapToPoint(self,x,y): clickPt = Geometry2D.Point(x,y) min_distance = self.getSnapRange() for snapPt in self.snapPoints(): if Geometry2D.distance(clickPt,snapPt) <= min_distance: return (snapPt.x(),snapPt.y()) return (x,y)
def getModelPantsSkel(self): #Parameters: mid_center,top_center,mid_left,left_leg_center,left_leg_left width = Geometry2D.distance(self.left_leg_left,self.left_leg_right) return Models.Model_Pants_Skel_New(True, self.mid_center.toTuple(), self.top_center.toTuple(), self.mid_left.toTuple(), self.left_leg_center.toTuple(),self.top_left.toTuple(),width )
def getModelPantsSkel(self): #Parameters: mid_center,top_center,mid_left,left_leg_center,left_leg_left width = Geometry2D.distance(self.left_leg_left, self.left_leg_right) return Models.Model_Pants_Skel_New(True, self.mid_center.toTuple(), self.top_center.toTuple(), self.mid_left.toTuple(), self.left_leg_center.toTuple(), self.top_left.toTuple(), width)
def getModelSkel(self): left_sleeve_width = Geometry2D.distance(self.sleeve_top,self.sleeve_node)*2 return Models.Model_Shirt_Skel_Less_Restricted(True, self.spine_bottom.toTuple(), self.spine_top.toTuple(), self.collar.toTuple(), self.shoulder_joint.toTuple(), self.shoulder_top.toTuple(),self.sleeve_node.toTuple(),self.bottom_left.toTuple(), left_sleeve_width )
def getModelSkel(self): left_sleeve_width = Geometry2D.distance(self.sleeve_top, self.sleeve_node) * 2 return Models.Model_Shirt_Skel_Less_Restricted( True, self.spine_bottom.toTuple(), self.spine_top.toTuple(), self.collar.toTuple(), self.shoulder_joint.toTuple(), self.shoulder_top.toTuple(), self.sleeve_node.toTuple(), self.bottom_left.toTuple(), left_sleeve_width)
def getModelTee(self): left_sleeve_width = Geometry2D.distance(self.sleeve_top, self.sleeve_node) * 2 return Models.Model_Tee_Skel_No_Skew(True, self.spine_bottom.toTuple(), self.spine_top.toTuple(), self.collar.toTuple(), self.shoulder_joint.toTuple(), self.shoulder_top.toTuple(), self.sleeve_node.toTuple(), self.bottom_left.toTuple(), left_sleeve_width)
def sockSkelDrawer(self, event, x, y, flags, param): if self.mode == 0: new_pt = Geometry2D.Point(x, y) self.ankle_center = new_pt if event == cv.CV_EVENT_LBUTTONUP: self.permanentHighlightPt(self.ankle_center) self.mode += 1 else: self.highlightPt(self.ankle_center) elif self.mode == 1: new_pt = Geometry2D.Point(x, y) self.ankle_joint = new_pt if event == cv.CV_EVENT_LBUTTONUP: self.permanentHighlightPt(self.ankle_joint) self.permanentHighlightSegment( Geometry2D.LineSegment(self.ankle_center, self.ankle_joint)) self.mode += 1 else: self.highlightPt(self.ankle_joint) self.highlightSegment( Geometry2D.LineSegment(self.ankle_center, self.ankle_joint)) elif self.mode == 2: new_pt = Geometry2D.Point(x, y) self.toe_center = new_pt if event == cv.CV_EVENT_LBUTTONUP: self.permanentHighlightPt(self.toe_center) self.permanentHighlightSegment( Geometry2D.LineSegment(self.ankle_joint, self.toe_center)) self.mode += 1 else: self.highlightPt(self.toe_center) self.highlightSegment( Geometry2D.LineSegment(self.ankle_joint, self.toe_center)) elif self.mode == 3: new_pt = Geometry2D.Point(x, y) self.toe_top = new_pt self.sock_width = 2 * Geometry2D.distance(self.toe_top, self.toe_center) if event == cv.CV_EVENT_LBUTTONUP: self.permanentHighlightPt(self.toe_top) self.permanentHighlightSegment( Geometry2D.LineSegment(self.toe_center, self.toe_top)) self.mode += 1 else: self.highlightPt(self.toe_top) self.highlightSegment( Geometry2D.LineSegment(self.toe_center, self.toe_top))
def sockSkelDrawer(self, event, x, y, flags, param): if self.mode == 0: new_pt = Geometry2D.Point(x, y) self.ankle_center = new_pt if event == cv.CV_EVENT_LBUTTONUP: self.permanentHighlightPt(self.ankle_center) self.mode += 1 else: self.highlightPt(self.ankle_center) elif self.mode == 1: new_pt = Geometry2D.Point(x, y) self.ankle_joint = new_pt if event == cv.CV_EVENT_LBUTTONUP: self.permanentHighlightPt(self.ankle_joint) self.permanentHighlightSegment(Geometry2D.LineSegment(self.ankle_center, self.ankle_joint)) self.mode += 1 else: self.highlightPt(self.ankle_joint) self.highlightSegment(Geometry2D.LineSegment(self.ankle_center, self.ankle_joint)) elif self.mode == 2: new_pt = Geometry2D.Point(x, y) self.toe_center = new_pt if event == cv.CV_EVENT_LBUTTONUP: self.permanentHighlightPt(self.toe_center) self.permanentHighlightSegment(Geometry2D.LineSegment(self.ankle_joint, self.toe_center)) self.mode += 1 else: self.highlightPt(self.toe_center) self.highlightSegment(Geometry2D.LineSegment(self.ankle_joint, self.toe_center)) elif self.mode == 3: new_pt = Geometry2D.Point(x, y) self.toe_top = new_pt self.sock_width = 2 * Geometry2D.distance(self.toe_top, self.toe_center) if event == cv.CV_EVENT_LBUTTONUP: self.permanentHighlightPt(self.toe_top) self.permanentHighlightSegment(Geometry2D.LineSegment(self.toe_center, self.toe_top)) self.mode += 1 else: self.highlightPt(self.toe_top) self.highlightSegment(Geometry2D.LineSegment(self.toe_center, self.toe_top))