public void OptimizeForData(TraitDataSnapshot data)
 {
     if (data.TryGetTrait(traitName, out int value))
     {
         m_Alignment = (MarsPlaneAlignment)value;
     }
 }
 public void IncludeData(TraitDataSnapshot data)
 {
     if (data.TryGetTrait(traitName, out int value))
     {
         m_Alignment = (MarsPlaneAlignment)(value | (int)m_Alignment);
     }
 }
        public float GetConditionRatingForData(TraitDataSnapshot data)
        {
            if (!data.TryGetTrait(traitName, out int value))
            {
                return(0f);
            }

            return(RateDataMatch(ref value));
        }
        public float GetConditionRatingForData(TraitDataSnapshot data)
        {
            if (m_TraitName != null && data.TryGetTrait(m_TraitName, out bool _))
            {
                return(m_MatchRule == SemanticTagMatchRule.Exclude ? 0f : 1f);
            }

            return(m_MatchRule == SemanticTagMatchRule.Exclude ? 1f : 0f);
        }
        public string FormatDataString(TraitDataSnapshot data)
        {
            if (!data.TryGetTrait(traitName, out int value))
            {
                return("Unknown");
            }

            return(((MarsPlaneAlignment)value).ToString().InsertSpacesBetweenWords());
        }
        public string FormatDataString(TraitDataSnapshot data)
        {
            if (data.TryGetTrait(traitName, out bool value))
            {
                return($"Tagged {(value ? "" : "not ")}{traitName}");
            }

            return($"No {traitName} tag");
        }
Example #7
0
        public string FormatDataString(TraitDataSnapshot data)
        {
            if (!data.TryGetTrait(traitName, out Vector2 value))
            {
                return("Unknown");
            }

            return($"{value.x:0.00}m x {value.y:0.00}m");
        }
Example #8
0
        internal ProxyGroup CreateNewProxyGroup(List <PotentialChild> children)
        {
            m_PotentialGroupMembers = children;
            var group = CreateProxyGroupObject();

            m_PotentialRelations.Clear();
            TraitDataSnapshot.GetPotentialRelations(m_PotentialGroupMembers, m_PotentialRelations, m_CreatedObject);
            SetProxyGroupName(GenerateProxyGroupName());
            return(group);
        }
 public void IncludeData(TraitDataSnapshot data)
 {
     if (m_TraitName != null && data.TryGetTrait(m_TraitName, out bool value))
     {
         m_MatchRule = value ? SemanticTagMatchRule.Match : SemanticTagMatchRule.Exclude;
     }
     else
     {
         m_MatchRule = SemanticTagMatchRule.Exclude;
     }
 }
 public void OptimizeForData(TraitDataSnapshot data)
 {
     if (m_TraitName != null && data.TryGetTrait(m_TraitName, out bool value))
     {
         m_MatchRule = value ? SemanticTagMatchRule.Match : SemanticTagMatchRule.Exclude;
     }
     else
     {
         enabled = false;
     }
 }
        void UpdateComparisonData(Proxy dataSourceProxy, TraitDataSnapshot dataSnapshot)
        {
            var queryResult = dataSourceProxy == null ? null : dataSourceProxy.currentData;

            dataSnapshot.TakeSnapshot(queryResult);

            if (CompareDataChanged != null)
            {
                CompareDataChanged();
            }
        }
Example #12
0
        public void OptimizeForData(TraitDataSnapshot data)
        {
            if (!data.TryGetTrait(traitName, out Vector2 value))
            {
                return;
            }

            var plusMinus = value * k_OptimizePadding;

            m_MaximumSize = value + plusMinus;
            m_MinimumSize = value - plusMinus;
        }
        public override string FormatDataString(TraitDataSnapshot child1Data, TraitDataSnapshot child2Data)
        {
            child1Data.GetTraits(out Dictionary <string, Pose> poses1);
            child2Data.GetTraits(out Dictionary <string, Pose> poses2);
            var child1Pose      = poses1[k_RequiredTraits[0].TraitName];
            var child2Pose      = poses2[k_RequiredTraits[1].TraitName];
            var child1Elevation = child1Pose.position.y;
            var child2Elevation = child2Pose.position.y;
            var elevationDiff   = child1Elevation - child2Elevation;

            return($"{elevationDiff:0.00}m");
        }
        public override void OptimizeForData(TraitDataSnapshot child1Data, TraitDataSnapshot child2Data)
        {
            child1Data.GetTraits(out Dictionary <string, Pose> poses1);
            child2Data.GetTraits(out Dictionary <string, Pose> poses2);
            var child1Pose      = poses1[k_RequiredTraits[0].TraitName];
            var child2Pose      = poses2[k_RequiredTraits[1].TraitName];
            var child1Elevation = child1Pose.position.y;
            var child2Elevation = child2Pose.position.y;
            var elevationDiff   = child1Elevation - child2Elevation;

            m_Maximum = elevationDiff + k_OptimalPadding;
            m_Minimum = elevationDiff - k_OptimalPadding;
        }
        /// <summary>
        /// Change the data proxy that is being compared against the main proxy. The current match data for each proxy will be captured.
        /// Selected data will be used for comparison if there is no data being hovered.
        /// </summary>
        /// <param name="proxies"> A list of all the data proxies that are currently selected</param>
        public void OnDataSelectionChanged(List <Proxy> proxies)
        {
            m_SelectionDataSnapshots.Clear();
            var count = Mathf.Min(k_MaxSnapshots, proxies.Count);

            if (count >= m_SelectionDataSnapshots.Count)
            {
                m_SelectionDataSnapshots.Fill(count - m_SelectionDataSnapshots.Count);
            }

            for (var i = 0; i < count; i++)
            {
                if (m_SelectionDataSnapshots[i] == null)
                {
                    m_SelectionDataSnapshots[i] = new TraitDataSnapshot();
                }

                UpdateComparisonData(proxies[i], m_SelectionDataSnapshots[i]);
            }
        }
Example #16
0
        public void IncludeData(TraitDataSnapshot data)
        {
            if (!data.TryGetTrait(traitName, out Vector2 value))
            {
                return;
            }

            if (m_MaxBounded)
            {
                var newMaxSize = m_MaximumSize;
                if (m_MaximumSize.x < value.x)
                {
                    newMaxSize.x = value.x + k_ConformPadding;
                }

                if (m_MaximumSize.y < value.y)
                {
                    newMaxSize.y = value.y + k_ConformPadding;
                }

                m_MaximumSize = newMaxSize;
            }

            if (m_MinBounded)
            {
                var newMinSize = m_MinimumSize;
                if (m_MinimumSize.x > value.x)
                {
                    newMinSize.x = value.x - k_ConformPadding;
                }

                if (m_MinimumSize.y > value.y)
                {
                    newMinSize.y = value.y - k_ConformPadding;
                }

                m_MinimumSize = newMinSize;
            }
        }
 public void OptimizeForData(TraitDataSnapshot data)
 {
     enabled = data.TryGetTrait(traitName, out bool _);
 }
 public float GetConditionRatingForData(TraitDataSnapshot data)
 {
     return(data.TryGetTrait(traitName, out bool value) ? RateDataMatch(ref value) : 0f);
 }
 public void IncludeData(TraitDataSnapshot data)
 {
     enabled = data.TryGetTrait(traitName, out bool _);
 }