Example #1
0
 public Composition(string refSkeletonPath)
 {
     transform   = new Matrix();
     editingUnit = new ComposedUnit();
     an          = SkeletonAnnotation.Load(refSkeletonPath, null);
     if (an == null)
     {
         an = new SkeletonAnnotation(null);
     }
 }
Example #2
0
        public Operation AssignComposedUnit(string key, ComposedUnit unit)
        {
            if (unit == null)
            {
                return(null);
            }

            if (unitDict.ContainsKey(key))
            {
                unitDict[key].Dispose();
            }
            unitDict[key] = unit;
            return(null);
        }
Example #3
0
        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);
                }
            }
        }
Example #4
0
 public Composition()
 {
     transform   = new Matrix();
     editingUnit = new ComposedUnit();
     an          = new SkeletonAnnotation(null);
 }
Example #5
0
 public Operation SetEditingUnit(ComposedUnit unit)
 {
     editingUnit = unit;
     return(null);
 }
Example #6
0
 public Operation CreateEditingUnit()
 {
     editingUnit = new ComposedUnit();
     return(null);
 }