public void SetCoordinateSystem(CoordinateSystemType type) { EffekseerNativePINVOKE.ViewPointController_SetCoordinateSystem(swigCPtr, (int)type); if (EffekseerNativePINVOKE.SWIGPendingException.Pending) { throw EffekseerNativePINVOKE.SWIGPendingException.Retrieve(); } }
public void SetCoordinateSyatem(CoordinateSystemType coordinateSystem) { EffekseerNativePINVOKE.EffectSetting_SetCoordinateSyatem(swigCPtr, (int)coordinateSystem); if (EffekseerNativePINVOKE.SWIGPendingException.Pending) { throw EffekseerNativePINVOKE.SWIGPendingException.Retrieve(); } }
/// <summary> /// Converts the specified content. /// </summary> /// <param name="content">The content.</param> /// <returns>The converted reference.</returns> protected override CoordinateSystem Convert(String[] content) { CoordinateSystemType type = (CoordinateSystemType)Enum.Parse(typeof(CoordinateSystemType), content[2], true); return(new CoordinateSystem(IdentifiedObject.GetIdentifier(Authority, content[0]), content[1], content[4], this.GetAliases(Int32.Parse(content[0])), type, this.GetAxes(content[0]))); }
public CoordinateSystem( CoordinateSystemType type, Vector3 up, Vector3 right) : this(type, up, right, 1f) { }
public CoordinateSystemType GetCoordinateSystem() { CoordinateSystemType ret = (CoordinateSystemType)EffekseerNativePINVOKE.ViewPointController_GetCoordinateSystem(swigCPtr); if (EffekseerNativePINVOKE.SWIGPendingException.Pending) { throw EffekseerNativePINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
private double centerMeridian = 0; // 中央子午线 /// <summary> /// 构造函数 /// </summary> /// <param name="sourceCoordinateSystem">坐标系统</param> /// <param name="centerMeridian">中央子午线</param> public GeodeticTransform(CoordinateSystemType sourceCoordinateSystem, double centerMeridian) { EllipsoidalParameters parameters = EllipsoidalType.GetEllipsoidalParametersByTpye(sourceCoordinateSystem); a = parameters.SemiMajorAxis; b = parameters.SemiMinorAxis; e = Math.Sqrt(a * a - b * b) / a; ep = Math.Sqrt(a * a - b * b) / b; this.centerMeridian = centerMeridian; }
private double ep2 = 0; // 第二偏心率平方 /// <summary> /// 构造函数 /// </summary> /// <param name="sourceCoordinateSystem">源坐标系统</param> public GaussKrugerTransform(CoordinateSystemType sourceCoordinateSystem) { EllipsoidalParameters parameters = EllipsoidalType.GetEllipsoidalParametersByTpye(sourceCoordinateSystem); a = parameters.SemiMajorAxis; b = parameters.SemiMinorAxis; e = Math.Sqrt(a * a - b * b) / a; ep = Math.Sqrt(a * a - b * b) / b; e2 = Math.Pow(e, 2); ep2 = Math.Pow(ep, 2); }
/// <summary> /// Initializes a new instance of the <see cref="CoordinateSystem" /> class. /// </summary> /// <param name="identifier">The identifier.</param> /// <param name="name">The name.</param> /// <param name="type">The type.</param> /// <param name="axes">The axes of the coordinate system.</param> /// <exception cref="System.ArgumentNullException">The identifier is null.</exception> /// <exception cref="System.ArgumentException">No axis is specified for the coordinate system.</exception> public CoordinateSystem(String identifier, String name, CoordinateSystemType type, params CoordinateSystemAxis[] axes) : base(identifier, name) { if (axes == null || axes.Length == 0) { throw new ArgumentException(ReferenceMessages.NoAxisSpecified, nameof(axes)); } this.axes = axes; this.Type = type; }
public CoordinateSystem( CoordinateSystemType type, Vector3 up, Vector3 right, float meter) { this.type = type; this.up = up; this.right = right; this.meter = meter; UpdateMatrix(); }
/// <summary> /// Initializes a new instance of the <see cref="CoordinateSystem" /> class. /// </summary> /// <param name="identifier">The identifier.</param> /// <param name="name">The name.</param> /// <param name="type">The type.</param> /// <param name="axis">The axis.</param> /// <exception cref="System.ArgumentNullException"> /// The identifier is null. /// or /// No axis is specified for the coordinate system. /// </exception> /// <exception cref="System.ArgumentException">No axis is specified for the coordinate system.</exception> public CoordinateSystem(String identifier, String name, CoordinateSystemType type, params CoordinateSystemAxis[] axis) : base(identifier, name) { if (axis == null) { throw new ArgumentNullException("axis", "No axis is specified for the coordinate system."); } if (axis.Length < 1) { throw new ArgumentException("No axis is specified for the coordinate system.", "axis"); } _type = type; _axis = axis; }
private CoordinateType targetCT; // 目标坐标类型 /// <summary> /// 构造函数 /// </summary> /// <param name="parameters">转换参数</param> public CoordinateTransform(ConversionParameters parameters) { if (parameters == null || parameters.ConversionSevenParams == null) { throw new Exception("转换参数或转换七参数为空"); } this.sevenParams = parameters.ConversionSevenParams; this.sourceCS = parameters.SourceCoordinateSystem; this.targetCS = parameters.TargetCoordinateSystem; this.sourceMeridian = parameters.SourceCenterMeridian; this.targetMeridian = parameters.TargetCenterMeridian; this.sourceCT = parameters.SourceCoordinateType; this.targetCT = parameters.TargetCoordinateType; }
public static dynamic GetTSObject(CoordinateSystemType dynEnum) { var tsType = TSActivator.CreateInstance("Tekla.Structures.Model.BasePoint.CoordinateSystemType").GetType(); switch (dynEnum) { case CoordinateSystemType.GLOBAL: return(System.Enum.Parse(tsType, "GLOBAL")); case CoordinateSystemType.WORKPLANE: return(System.Enum.Parse(tsType, "WORKPLANE")); default: throw new DynamicAPIException(dynEnum.ToString() + "- enum value is not implemented"); } }
/// <summary> /// Initializes a new instance of the <see cref="CoordinateSystem" /> class. /// </summary> /// <param name="identifier">The identifier.</param> /// <param name="type">The type.</param> /// <param name="axis">The axis.</param> /// <exception cref="System.ArgumentNullException"> /// The identifier is null. /// or /// No axis is specified for the coordinate system. /// </exception> /// <exception cref="System.ArgumentException">No axis is specified for the coordinate system.</exception> public CoordinateSystem(String identifier, CoordinateSystemType type, params CoordinateSystemAxis[] axis) : base(identifier, null) { if (axis == null) { throw new ArgumentNullException("axis", "No axis is specified for the coordinate system."); } if (axis.Length < 1) { throw new ArgumentException("No axis is specified for the coordinate system.", "axis"); } _axis = axis; Name = Type.ToString() + " " + _axis.Length + "D CS. Axis: " + _axis.Select(ax => ax.Name).Aggregate((x, y) => x + ", " + y) + ". Orientation: " + _axis.Select(ax => ax.Direction.ToString()).Aggregate((x, y) => x + ", " + y) + ". UoM: " + _axis.Select(ax => ax.Unit.ToString()).Aggregate((x, y) => x + ", " + y) + "."; _type = type; }
public static EllipsoidalParameters GetEllipsoidalParametersByTpye(CoordinateSystemType type) { EllipsoidalParameters parameters = null; switch (type) { case CoordinateSystemType.WGS84: parameters = new EllipsoidalParameters(); parameters.SemiMajorAxis = 6378137; parameters.SemiMinorAxis = 6356752.3142; break; case CoordinateSystemType.BJ54: parameters = new EllipsoidalParameters(); parameters.SemiMajorAxis = 6378245; parameters.SemiMinorAxis = 6356863.019; break; case CoordinateSystemType.XIAN80: parameters = new EllipsoidalParameters(); parameters.SemiMajorAxis = 6378140; parameters.SemiMinorAxis = 6356755.2882; break; case CoordinateSystemType.CGCS2000: parameters = new EllipsoidalParameters(); parameters.SemiMajorAxis = 6378137; parameters.SemiMinorAxis = 6356752.31414; break; default: break; } return(parameters); }
public Series CoordinateSystem(CoordinateSystemType coordinateSystem) { this.coordinateSystem = coordinateSystem; return(this); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { // Creates the input value list and attachs it to the input parameter CreateValueList(); // Expire solution of this component (called after expire solution of the created value list) if (_expire == true) { _expire = false; this.ExpireSolution(true); } // Input variables GH_Controller controllerGoo = null; int coordinateSystem = 0; // Catch input data if (!DA.GetData(0, ref controllerGoo)) { return; } if (!DA.GetData(1, ref coordinateSystem)) { return; } // Output variables List <Plane> planes = new List <Plane>(); // Get the mechanical units of the controller MechanicalUnitCollection mechanicalUnits = controllerGoo.Value.MotionSystem.MechanicalUnits; List <string> mechanicalUnitnames = new List <string>(); // ABB coordinate system type CoordinateSystemType coord = (CoordinateSystemType)coordinateSystem; // Get all the planes for (int i = 0; i < mechanicalUnits.Count; i++) { // Try to get the plane try { // Get the ABB joint target of the mechanical unit RobTarget robTarget = mechanicalUnits[i].GetPosition(coord); int test = mechanicalUnits[i].DriveModule; // Update Quaternion _quat.A = robTarget.Rot.Q1; _quat.B = robTarget.Rot.Q2; _quat.C = robTarget.Rot.Q3; _quat.D = robTarget.Rot.Q4; // Update point _point.X = robTarget.Trans.X; _point.Y = robTarget.Trans.Y; _point.Z = robTarget.Trans.Z; // Convert to plane _quat.GetRotation(out Plane plane); plane = new Plane(_point, plane.XAxis, plane.YAxis); // Add to list planes.Add(plane); } // Set null plane if not catch { // Raise a blank message AddRuntimeMessage(GH_RuntimeMessageLevel.Remark, "Mechanical unit " + mechanicalUnits[i].Name + ": A position plane could not be defined for the selected coordinate system."); // Add null plane planes.Add(Plane.Unset); } // Add mechanical unit name to the list with names mechanicalUnitnames.Add(mechanicalUnits[i].Name); } // Output DA.SetDataList(0, planes); DA.SetDataList(1, mechanicalUnitnames); }
/// <summary> /// Returns a collection with items with the specified type. /// </summary> /// <param name="collection">The coordinate system collection.</param> /// <param name="type">The type of the coordinate system.</param> /// <returns>A collection containing the items that are with the specified type.</returns> /// <exception cref="System.ArgumentNullException">The collection is null.</exception> public static IEnumerable <CoordinateSystem> WithType(this IEnumerable <CoordinateSystem> collection, CoordinateSystemType type) { if (collection == null) { throw new ArgumentNullException(nameof(collection)); } return(collection.Where(item => item.Type == type)); }
void FCsTargetTypeConfig_Changed(IDiffSpread <CoordinateSystemType> spread) { FCsTypeTarget = FCsTargetTypeConfig[0]; ConfigurateModel(); }
void FCsSourceTypeConfig_Changed(IDiffSpread <CoordinateSystemType> spread) { FCsTypeSource = FCsSourceTypeConfig[0]; ConfigurateModel(); }
public CoordinateSystem(CoordinateSystemType type) : this(type, new Vector3(0f, 1f, 0f), new Vector3(1f, 0f, 0f)) { }
public void SetCoordinateSystem(CoordinateSystemType coordinateSystem) { EffekseerNativePINVOKE.Native_SetCoordinateSystem(swigCPtr, (int)coordinateSystem); }