Exemplo n.º 1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadEncodedInt();

            m_ToothType = (ToothType)reader.ReadEncodedInt();
        }
Exemplo n.º 2
0
 protected override void applyAdaptation(ToothType type, bool adapt)
 {
     if (adapt)
     {
         if (type == ToothType.Bottom && collidingTeeth.Count > 0)
         {
             joint.setLinearLowerLimit(new Vector3(-1.0f, -1.0f, -1.0f));
             joint.setLinearUpperLimit(new Vector3(1.0f, 1.0f, 1.0f));
             joint.setAngularLowerLimit(new Vector3(-3.14f, -3.14f, -3.14f));
             joint.setAngularUpperLimit(new Vector3(3.14f, 3.14f, 3.14f));
         }
     }
     else
     {
         RigidBody other = joint.RigidBodyA;
         Offset   = Quaternion.quatRotate(other.PhysicsRotation.inverse(), actorElement.PhysicsTranslation - other.PhysicsTranslation) - startingLocation;
         Rotation = other.PhysicsRotation.inverse() * actorElement.PhysicsRotation * startingRotation.inverse();
         joint.setLinearLowerLimit(Vector3.Zero);
         joint.setLinearUpperLimit(Vector3.Zero);
         joint.setAngularLowerLimit(Vector3.Zero);
         joint.setAngularUpperLimit(Vector3.Zero);
     }
 }
Exemplo n.º 3
0
        private ToothType GetAllPointsUpper()
        {
            int idx_up = Idx_Templates(UpperToothList);

            if (idx_up > 0)
            {
                SmileDesign_Page currentPage = (System.Windows.Application.Current.MainWindow.Content) as SmileDesign_Page;
                ToothType        uppertooth  = currentPage.ToothControl.UpperTooth[idx_up - 1];
                ToothType        sizechaged  = new ToothType();

                Point minPoint = Numerics.GetMinXY_Tooth(uppertooth);
                Point maxPoint = Numerics.GetMaxXY_Tooth(uppertooth);

                double nosewidth = ((LineGeometry)(currentPage.noseline_R.Data)).StartPoint.X - ((LineGeometry)(currentPage.noseline_L.Data)).StartPoint.X;

                ratiox = nosewidth / (maxPoint.X - minPoint.X);

                foreach (var temp in uppertooth)
                {
                    TeethType changed = new TeethType();

                    foreach (var teethtemp in (TeethType)temp)
                    {
                        PointViewModel pt = teethtemp;
                        pt.X *= ratiox;
                        pt.Y *= ratiox;

                        changed.Add(pt);
                    }
                    sizechaged.Add(changed);
                }

                return(sizechaged);
            }
            //return ((SmileDesign_Page)(Application.Current.MainWindow).Content).ToothControl.UpperTooth[idx_up - 1];
            return(null);
        }
Exemplo n.º 4
0
        public MainWindow()
        {
            InitializeComponent();
            DataContext = new MainViewModel();

            // Set data for UpperTooth.
            UpperTooth = new ToothList();
            UpperGuide = new Point(450, 100);
            for (int k = 0; k < 5; k++)
            {
                ToothType template = new ToothType();
                for (int i = 0; i < 6; i++)
                {
                    TeethType teeth = new TeethType();
                    for (int j = 0; j < 10; j++)
                    {
                        if (i >= 0 && i < 3)
                        {
                            teeth.Add(new PointViewModel(UpperX[k, i, j] + UpperGuide.X, UpperY[k, i, j] + UpperGuide.Y, j));
                        }
                        else
                        {
                            teeth.Add(new PointViewModel(-1 * UpperX[k, i - 3, j] + UpperGuide.X, UpperY[k, i - 3, j] + UpperGuide.Y, j));
                        }
                    }
                    template.Add(teeth);
                }
                UpperTooth.Add(template);
            }

            // Set data for LowerTooth.
            LowerTooth = new ToothList();
            LowerGuide = new Point(450, 300);
            for (int k = 0; k < 5; k++)
            {
                ToothType tooth = new ToothType();
                for (int i = 0; i < 4; i++)
                {
                    TeethType teeth = new TeethType();
                    for (int j = 0; j < 10; j++)
                    {
                        if (i >= 0 && i < 2)
                        {
                            teeth.Add(new PointViewModel(LowerX[k, i, j] + LowerGuide.X, LowerY[k, i, j] + LowerGuide.Y, j));
                        }
                        else
                        {
                            teeth.Add(new PointViewModel(-1 * LowerX[k, i - 2, j] + LowerGuide.X, LowerY[k, i - 2, j] + LowerGuide.Y, j));
                        }
                    }
                    tooth.Add(teeth);
                }
                LowerTooth.Add(tooth);
            }

            // Set global dictionary.
            dic = new Dictionary <string, int>();
            dic.Add("CanineL", 5);
            dic.Add("LateralIncisorL", 4);
            dic.Add("CentralIncisorL", 3);
            dic.Add("CentralIncisorR", 0);
            dic.Add("LateralIncisorR", 1);
            dic.Add("CanineR", 2);
        }
Exemplo n.º 5
0
 public WerewolfTooth(ToothType type) : base(0x3155)
 {
     Weight    = 5.0;
     Hue       = 1194;
     ToothType = type;
 }
Exemplo n.º 6
0
 protected abstract void applyAdaptation(ToothType type, bool adapt);