Ejemplo n.º 1
0
 public EulerAngle(double roll, double pitch, double yaw, AngleTypes angleType)
 {
     Roll      = roll;
     Pitch     = pitch;
     Yaw       = yaw;
     AngleType = angleType;
 }
Ejemplo n.º 2
0
        private void getAngleNames()
        {
            HashSet <string> types = new HashSet <string>();

            foreach (Clip clip in Parameter.playlist.clips)
            {
                foreach (Angle angle in clip.angles)
                {
                    types.Add(angle.angleName);
                }
            }

            BindableCollection <AngleType> typeObjects = new BindableCollection <AngleType>();

            foreach (string s in types)
            {
                typeObjects.Add(new AngleType(s, this));
            }

            AngleTypes = typeObjects;
            foreach (Clip clip in Parameter.playlist.clips)
            {
                foreach (Angle angle in clip.angles)
                {
                    angle.angleType = AngleTypes.FirstOrDefault(angleType => angleType.Name.Equals(angle.angleName));
                }
            }

            getAnglePreferences();
        }
Ejemplo n.º 3
0
 public Mirror(AngleTypes angleType, bool leftSideReflective, bool rightSideReflective, int x, int y)
 {
     AngleType           = angleType;
     LeftSideReflective  = leftSideReflective;
     RightSideReflective = rightSideReflective;
     X = x;
     Y = y;
 }
Ejemplo n.º 4
0
        private async void getMoreClips()
        {
            List <Clip> remainingClipsList = await ServiceAccessor.GetAdditionalPlaylistClips(Parameter.playlist.playlistId, 100);

            foreach (Clip clip in remainingClipsList)
            {
                foreach (Angle angle in clip.angles)
                {
                    angle.angleType = AngleTypes.FirstOrDefault(angleType => angleType.Name.Equals(angle.angleName));
                }
            }
            foreach (Clip c in remainingClipsList)
            {
                Clips.Add(c);
                if (!FiltersList.Any())
                {
                    FilteredClips.Add(c);
                }
            }
        }
        public static dynamic GetTSObject(AngleTypes dynEnum)
        {
            var tsType = TSActivator.CreateInstance("Tekla.Structures.Drawing.AngleTypes").GetType();

            switch (dynEnum)
            {
            case AngleTypes.AngleOnSide:
                return(System.Enum.Parse(tsType, "AngleOnSide"));

            case AngleTypes.Triangle:
                return(System.Enum.Parse(tsType, "Triangle"));

            case AngleTypes.AngleAtVertex:
                return(System.Enum.Parse(tsType, "AngleAtVertex"));

            case AngleTypes.TriangleWithDegrees:
                return(System.Enum.Parse(tsType, "TriangleWithDegrees"));

            default:
                throw new DynamicAPIException(dynEnum.ToString() + "- enum value is not implemented");
            }
        }
Ejemplo n.º 6
0
 public Mirror(AngleTypes angleType, bool leftSideReflective, bool rightSideReflective)
 {
     AngleType           = angleType;
     LeftSideReflective  = leftSideReflective;
     RightSideReflective = rightSideReflective;
 }
Ejemplo n.º 7
0
        private List <Mirror> GetMirrors(List <string> lines)
        {
            /*
             *  The mirror placement will be in X,Y coordinates indicating which room the mirror is located.
             * It will be followed by an R or L indicating the direction the mirror is leaning
             * (R for Right and L for Left). That will be followed by an R or L
             * indicating the side of the mirror that is reflective if it’s a 1-way mirror
             * (R for Right Side or L for Left Side) or nothing if both sides are reflective
             * and it’s a 2-way mirror.
             *
             * Example:
             *  1,2RR
             *  3,2L
             */

            List <Mirror> mirrors = new List <Mirror>();

            foreach (var line in lines)
            {
                string mirrorLocation;

                // Figure out the index of where the mirror type starts
                int idx  = 0;
                int idxR = line.IndexOf("R");
                int idxL = line.IndexOf("L");
                if (idxR > 0)
                {
                    if (idxL == -1 || idxR < idxL)
                    {
                        idx = idxR;
                    }
                }
                else if (idxL > 0)
                {
                    idx = idxL;
                }

                AngleTypes angleType = AngleTypes.Other;
                bool       leftSideReflective = true, rightSideReflective = true;
                string     mirrorDirection, mirrorType;
                if (idx > 0)
                {
                    // Parse our line
                    mirrorLocation  = line.Substring(0, idx);
                    mirrorDirection = line.Substring(idx, 1);
                    if (line.Length > idx + 1)
                    {
                        mirrorType = line.Substring(idx + 1, 1);
                        if (mirrorType == "R")
                        {
                            leftSideReflective = false;
                        }
                        if (mirrorType == "L")
                        {
                            rightSideReflective = false;
                        }
                    }

                    int x = Convert.ToInt32(mirrorLocation.Split(',')[0]);
                    int y = Convert.ToInt32(mirrorLocation.Split(',')[1]);
                    if (mirrorDirection == "R")
                    {
                        angleType = AngleTypes.Right;
                    }
                    if (mirrorDirection == "L")
                    {
                        angleType = AngleTypes.Left;
                    }
                    mirrors.Add(new Mirror(angleType, leftSideReflective, rightSideReflective, x, y));
                }
            }
            return(mirrors);
        }