Ejemplo n.º 1
0
 private void SetDressVisibility(DressTypes aDress, Visibility aVisible)
 {
     if (aDress <= DressTypes.Naked)
     {
         return;
     }
     VideoStreamGrid.Children[VideoStreamGrid.Children.IndexOf(DressGroup1.Dresses[aDress])].Visibility = aVisible;
 }
Ejemplo n.º 2
0
        public DressModel CreateDress(DressTypes aDressType, string XAMLFile, string GeometryID = GeometryIDStr, string MaterialID = MaterialIDStr, string TransformID = TransformIDStr, string SceneID = SceneIDStr)
        {
            DressModel aDress = new DressModel(XAMLFile);

            aDress.DressType = aDressType;
            VFRWindow.Resources.MergedDictionaries.Add(aDress.DressResource);
            aDress.CreateModel(GeometryID, MaterialID, TransformID, SceneID);
            aDress.SetCamera(new Point3D(0, 3.1, 3.5), 25);
            Dresses.Add(aDressType, aDress);
            return(aDress);
        }
Ejemplo n.º 3
0
 private void SelectDress(DressTypes aDressType)
 {
     if (aDressType == CurrentDress || aDressType == DressTypes.None)
     {
         return;
     }
     SetDressVisibility(CurrentDress, Visibility.Hidden);
     CurrentDress = aDressType;
     if (aDressType > DressTypes.Naked)
     {
         SetDressVisibility(CurrentDress, Visibility.Visible);
     }
 }
Ejemplo n.º 4
0
 public DressModel(string XAMLFile)
 {
     DressType            = DressTypes.Floral24;
     DressResource        = new ResourceDictionary();
     DressResource.Source = new Uri(XAMLFile, UriKind.RelativeOrAbsolute);
     DressGeometry        = new GeometryModel3D();
     DressCamera          = new PerspectiveCamera();
     DressTransform       = new Model3DGroup();
     DressViewport        = new Viewport3D();
     DressScene           = new Model3DGroup();
     DressVisual          = new ModelVisual3D();
     this.Width           = 151;
     this.Height          = 270;
     this.DressSizeRatio  = (this.Height / this.Width);
 }
Ejemplo n.º 5
0
        private DressTypes ButtonTypeToDressType(ButtonTypes aButton)
        {
            DressTypes Res = DressTypes.None;

            foreach (DressTypes aDress in Enum.GetValues(typeof(DressTypes)))
            {
                if (aButton.ToString().Equals(aDress.ToString()))
                {
                    Res = aDress;
                    break;
                }
            }
            if (aButton == ButtonTypes.ClearBtn)
            {
                Res = DressTypes.Naked;
            }
            return(Res);
        }
Ejemplo n.º 6
0
        private void LoadProgram()
        {
            CurrentDress = DressTypes.Floral30;

            KinectVFR = new KinectMethods(VideoStreamGrid.ActualWidth - 25, VideoStreamGrid.ActualHeight);
            this.VideoStreamImage.Source      = KinectVFR.ColorImageKinect;
            KinectVFR.VFRWindow               = this;
            KinectVFR.OnKinectJointEvent     += new KinectMethods.KinectEventHandler(KinectVFR_OnKinectJointEvent);
            KinectVFR.OnKinectScaleEvent     += new KinectMethods.KinectTransformHandler(KinectVFR_OnKinectScaleEvent);
            KinectVFR.OnKinectTranslateEvent += new KinectMethods.KinectTranslateHandler(KinectVFR_OnKinectTranslateEvent);
            KinectVFR.OnKinectRotateEvent    += new KinectMethods.KinectTransformHandler(KinectVFR_OnKinectRotateEvent);
            DressGroup1 = new DressCollection(this);
            DressGroup1.CreateDressCollection();
            foreach (KeyValuePair <DressTypes, DressModel> aDress in DressGroup1.Dresses)
            {
                if (aDress.Key <= DressTypes.Naked)
                {
                    continue;
                }
                VideoStreamGrid.Children.Add(aDress.Value);
                SetDressVisibility(aDress.Key, Visibility.Hidden);
            }
            SetDressVisibility(CurrentDress, Visibility.Visible);
        }