public Composition(string refSkeletonPath) { transform = new Matrix(); editingUnit = new ComposedUnit(); an = SkeletonAnnotation.Load(refSkeletonPath, null); if (an == null) { an = new SkeletonAnnotation(null); } }
public Operation AssignComposedUnit(string key, ComposedUnit unit) { if (unit == null) { return(null); } if (unitDict.ContainsKey(key)) { unitDict[key].Dispose(); } unitDict[key] = unit; return(null); }
private void DrawCompositedUnit(ComposedUnit composedUnit, Composition composition) { if (composedUnit == null) { return; } if (composition == null) { return; } if (composedUnit.segments == null) { return; } for (int i = 0; i < composedUnit.segments.Count; i++) { Segment seg = composedUnit.segments[i]; if (seg == null) { continue; } if (!composedUnit.transformDict.ContainsKey(seg.name)) { continue; } SegmentMeshInfo transform = composedUnit.transformDict[seg.name]; DrawSegmentMeshes(seg, transform, XNAColor.White, true); if (seg == composition.editingSegment) { DrawSegmentMeshes(seg, transform, new XNAColor(0.2f, 0.2f, 0.2f, 0.1f), false); DrawSegmentMeshLines(transform, XNAColor.Blue); DrawSkeleton(transform.an, new Dictionary <JointAnnotation, XNAColor>(), XNAColor.Gray); Dictionary <PointF, XNAColor> ptColorDict = new Dictionary <PointF, XNAColor>(); if (composition.editingControlPoint != null) { ptColorDict[composition.editingControlPoint.Value] = XNAColor.Red; } if (composition.nearestControlPoint != null) { ptColorDict[composition.nearestControlPoint.Value] = XNAColor.Yellow; } DrawSegmentControlPoints(transform, ptColorDict, XNAColor.Black); } } }
public Composition() { transform = new Matrix(); editingUnit = new ComposedUnit(); an = new SkeletonAnnotation(null); }
public Operation SetEditingUnit(ComposedUnit unit) { editingUnit = unit; return(null); }
public Operation CreateEditingUnit() { editingUnit = new ComposedUnit(); return(null); }