示例#1
0
 public void AddByCoordinate(Coordinate3DCylindrical coordinate,
                             ref string name,
                             string userName         = "",
                             string coordinateSystem = CoordinateSystems.Global,
                             bool mergeOff           = false,
                             int mergeNumber         = 0)
 {
 }
        /// <summary>
        /// Sets the joint coordinates.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="table">The table.</param>
        private static void setJOINT_COORDINATES(Model model, List <Dictionary <string, string> > table)
        {
            foreach (Dictionary <string, string> tableRow in table)
            {
                eCoordinateType coordinateType = Enums.EnumLibrary.ConvertStringToEnumByDescription <eCoordinateType>(tableRow["CoordType"]);
                string          jointName      = tableRow["Joint"];

                switch (coordinateType)
                {
                case eCoordinateType.Cartesian:
                    Coordinate3DCartesian coordinateCartesian = new Coordinate3DCartesian
                    {
                        X = Adaptor.toDouble(tableRow["XorR"]),
                        Y = Adaptor.toDouble(tableRow["Y"]),
                        Z = Adaptor.toDouble(tableRow["Z"])
                    };
                    model.Structure.Points.Add(coordinateCartesian, jointName);
                    break;

                case eCoordinateType.Cylindrical:
                    // TODO: COnfirm output for cylindrical coord systems
                    Coordinate3DCylindrical coordinateCylindrical = new Coordinate3DCylindrical
                    {
                        Radius = Adaptor.toDouble(tableRow["XorR"]),
                        Theta  = Adaptor.toDouble(tableRow["Y"]),
                        Z      = Adaptor.toDouble(tableRow["Z"])
                    };
                    //model.Structure.Points.Add(coordinateCylindrical, jointName);
                    break;

                case eCoordinateType.Spherical:
                    // TODO: COnfirm output for spherical coord systems
                    Coordinate3DSpherical coordinateSpherical = new Coordinate3DSpherical
                    {
                        Radius = Adaptor.toDouble(tableRow["XorR"]),
                        Theta  = Adaptor.toDouble(tableRow["Y"]),
                        Phi    = Adaptor.toDouble(tableRow["Z"])
                    };
                    //model.Structure.Points.Add(coordinateSpherical, jointName);
                    break;

                default:
                    break;
                }

                Point point = model.Structure.Points[jointName];
                point.IsSpecialPoint   = Adaptor.fromYesNo(tableRow["SpecialJt"]);
                point.CoordinateSystem = tableRow["CoordSys"];
                point.CoordinateType   = coordinateType;
            }
        }
示例#3
0
        /// <summary>
        /// Returns the r, Theta and z coordinates of the specified point element/object in the Present Units.
        /// The coordinates are reported in the coordinate system specified by <paramref name="coordinateSystem" />.
        /// </summary>
        /// <param name="name">The name of an existing point element/object.</param>
        /// <param name="coordinate">The cylindrical r-, theta-, z-coordinate of the specified point element/object in the specified coordinate system.</param>
        /// <param name="coordinateSystem">The name of the coordinate system in which the joint coordinates are returned.</param>
        /// <exception cref="CSiException"></exception>
        public void GetCoordinate(string name,
                                  ref Coordinate3DCylindrical coordinate,
                                  string coordinateSystem = CoordinateSystems.Global)
        {
            double radius = 0;
            double theta  = 0;
            double z      = 0;

            _callCode = _sapModel.PointElm.GetCoordCylindrical(name, ref radius, ref theta, ref z, coordinateSystem);
            if (throwCurrentApiException(_callCode))
            {
                throw new CSiException();
            }

            coordinate.Radius = radius;
            coordinate.Theta  = theta;
            coordinate.Z      = z;
        }
示例#4
0
        /// <summary>
        /// Returns the cylindrical r-, theta-, z-coordinates of the specified point element/object in the Present Units.
        /// The coordinates are reported in the coordinate system specified by <paramref name="coordinateSystem" />.
        /// </summary>
        /// <param name="name">The name of an existing point element/object.</param>
        /// <param name="coordinateSystem">The name of the coordinate system in which the joint coordinates are returned.</param>
        /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception>
        public Coordinate3DCylindrical GetCoordinateCylindrical(string name,
                                                                string coordinateSystem = CoordinateSystems.Global)
        {
            double radius = 0;
            double theta  = 0;
            double z      = 0;

            _callCode = _sapModel.PointElm.GetCoordCylindrical(name, ref radius, ref theta, ref z, coordinateSystem);
            if (throwCurrentApiException(_callCode))
            {
                throw new CSiException(API_DEFAULT_ERROR_CODE);
            }

            Coordinate3DCylindrical coordinate = new Coordinate3DCylindrical();

            coordinate.Radius = radius;
            coordinate.Theta  = theta;
            coordinate.Z      = z;
            return(coordinate);
        }
示例#5
0
 public void GetCoordinate(string name,
                           ref Coordinate3DCylindrical coordinate,
                           string coordinateSystem = CoordinateSystems.Global)
 {
 }