Esempio n. 1
0
        private void SetProfileProperty(ProfileLine profileSessionProfileLine)
        {
            var profileProperty = new ProfileProperties();

            profileProperty.LineId = profileSessionProfileLine.Id;

            var profileSurfacePoints = _profileSession.ProfileSurfaces.FirstOrDefault(surface =>
                                                                                      surface.LineId == profileSessionProfileLine.Id).ProfileSurfacePoints;

            profileProperty.MaxHeight = profileSurfacePoints.Max(point => point.Z);
            profileProperty.MinHeight = profileSurfacePoints.Min(point => point.Z);

            var angles = FindAngles(profileSurfacePoints);

            profileProperty.MaxAngle = angles.Exists(angle => angle > 0) ? Math.Abs(angles.Where(angle => angle > 0).Max()) : 0;
            profileProperty.MinAngle = angles.Exists(angle => angle < 0) ? Math.Abs(angles.Where(angle => angle < 0).Min()) : 0;

            profileProperty.PathLength = FindLength(profileSurfacePoints);

            profileProperty.Azimuth = profileSessionProfileLine.Azimuth;

            profileProperty.ObserverHeight = _defaultObserverHeight;

            _surfaceProfileChart.ProfilesProperties.Add(profileProperty);
        }
        internal void SetProfilesProperties()
        {
            foreach (var profileSessionProfileLine in _profileSession.ProfileLines)
            {
                var profileProperty = new ProfileProperties();
                profileProperty.LineId = profileSessionProfileLine.Id;

                var profileSurfacePoints = _profileSession.ProfileSurfaces.FirstOrDefault(surface =>
                                                                                          surface.LineId == profileSessionProfileLine.Id).ProfileSurfacePoints;

                profileProperty.MaxHeight = profileSurfacePoints.Max(point => point.Z);
                profileProperty.MinHeight = profileSurfacePoints.Min(point => point.Z);

                var angles = FindAngles(profileSurfacePoints);

                profileProperty.MaxAngle = angles.Exists(angle => angle > 0) ? Math.Abs(angles.Where(angle => angle > 0).Max()) : 0;
                profileProperty.MinAngle = angles.Exists(angle => angle < 0) ? Math.Abs(angles.Where(angle => angle < 0).Min()) : 0;

                profileProperty.PathLength = FindLength(profileSurfacePoints);

                profileProperty.Azimuth = profileSessionProfileLine.Azimuth;//  FindAzimuth(RadiansToDegrees(profileSessionProfileLine.Angel));

                _surfaceProfileChart.ProfilesProperties.Add(profileProperty);
            }
        }