void DrawDataOwnership(MARSDatabase db) { using (var scope = new EditorGUILayout.ScrollViewScope(m_DataOwnershipScrollPosition)) { EditorGUILayout.Space(); EditorGUIUtils.DrawDictionaryWithHeader(db.DataUsedByQueries, "Used By Proxies", "Query ID", "Data IDs", m_OwnershipKeyColumnWidth, m_OwnershipValueColumnWidth, CollectionExtensions.Stringify); EditorGUILayout.Space(); EditorGUIUtils.DrawBoxSplitter(); EditorGUIUtils.DrawDictionaryWithHeader(db.DataUsedByQueryMatches, "Used By Each Proxy Match", "Query Match ID", "Data ID", m_OwnershipKeyColumnWidth, m_OwnershipValueColumnWidth); EditorGUILayout.Space(); EditorGUIUtils.DrawDictionaryWithHeader(db.SetDataUsedByQueryMatches, "Used By Each ProxyGroup Match", "Query Match ID", "Data IDs", m_OwnershipKeyColumnWidth, m_OwnershipValueColumnWidth, CollectionExtensions.Stringify); EditorGUILayout.Space(); EditorGUIUtils.DrawBoxSplitter(); EditorGUIUtils.DrawDictionaryWithHeader(db.ReservedData, "Reserved Data", "Data ID", "Reserved By Query", m_OwnershipKeyColumnWidth, m_OwnershipValueColumnWidth); EditorGUILayout.Space(); EditorGUIUtils.DrawBoxSplitter(); EditorGUIUtils.DrawDictionaryWithHeader(db.SharedDataUsersCounter, "Shared Data", "Data ID", "# of Users", m_OwnershipKeyColumnWidth, m_OwnershipValueColumnWidth); EditorGUILayout.Space(); EditorGUIUtils.DrawBoxSplitter(); m_DataOwnershipScrollPosition = scope.scrollPosition; } }
/// <summary> /// Save a snapshot that contains all the data currently associated with a query result /// </summary> /// <param name="queryResult">The query result to get the data from.</param> public void TakeSnapshot(QueryResult queryResult) { Clear(); DataID = -1; var db = ModuleLoaderCore.instance.GetModule <MARSDatabase>(); if (db == null || queryResult == null) { return; } DataID = queryResult.DataID; db.GetTraitProvider(out MARSTraitDataProvider <System.Boolean> semanticTagProvider); MARSDatabase.GetAllTraitsForId(queryResult.DataID, semanticTagProvider, m_SemanticTagTraits); db.GetTraitProvider(out MARSTraitDataProvider <System.Int32> intProvider); MARSDatabase.GetAllTraitsForId(queryResult.DataID, intProvider, m_IntTraits); db.GetTraitProvider(out MARSTraitDataProvider <System.Single> floatProvider); MARSDatabase.GetAllTraitsForId(queryResult.DataID, floatProvider, m_FloatTraits); db.GetTraitProvider(out MARSTraitDataProvider <System.String> stringProvider); MARSDatabase.GetAllTraitsForId(queryResult.DataID, stringProvider, m_StringTraits); db.GetTraitProvider(out MARSTraitDataProvider <UnityEngine.Pose> poseProvider); MARSDatabase.GetAllTraitsForId(queryResult.DataID, poseProvider, m_PoseTraits); db.GetTraitProvider(out MARSTraitDataProvider <UnityEngine.Vector2> vector2Provider); MARSDatabase.GetAllTraitsForId(queryResult.DataID, vector2Provider, m_Vector2Traits); }
void ClearTraits(MARSDatabase self) { self.SemanticTagTraitProvider.Clear(); self.IntTraitProvider.Clear(); self.FloatTraitProvider.Clear(); self.StringTraitProvider.Clear(); self.PoseTraitProvider.Clear(); self.Vector2TraitProvider.Clear(); }
void UnloadTraits(MARSDatabase self) { self.SemanticTagTraitProvider.Unload(); self.IntTraitProvider.Unload(); self.FloatTraitProvider.Unload(); self.StringTraitProvider.Unload(); self.PoseTraitProvider.Unload(); self.Vector2TraitProvider.Unload(); }
void StopBufferingInternal(MARSDatabase self) { SemanticTagTraitProvider.StopUpdateBuffering(); IntTraitProvider.StopUpdateBuffering(); FloatTraitProvider.StopUpdateBuffering(); StringTraitProvider.StopUpdateBuffering(); Vector2TraitProvider.StopUpdateBuffering(); }
void AddRequirementUpdateMethods(MARSDatabase self) { TypeToRequirementUpdate[(MarsDataType)typeof(System.Boolean)] = UpdateSemanticTagRequirement; TypeToRequirementFill[(MarsDataType)typeof(System.Boolean)] = FillSemanticTagRequirement; TypeToRequirementUpdate[(MarsDataType)typeof(System.Int32)] = UpdateIntRequirement; TypeToRequirementFill[(MarsDataType)typeof(System.Int32)] = FillIntRequirement; TypeToRequirementUpdate[(MarsDataType)typeof(System.Single)] = UpdateFloatRequirement; TypeToRequirementFill[(MarsDataType)typeof(System.Single)] = FillFloatRequirement; TypeToRequirementUpdate[(MarsDataType)typeof(System.String)] = UpdateStringRequirement; TypeToRequirementFill[(MarsDataType)typeof(System.String)] = FillStringRequirement; TypeToRequirementUpdate[(MarsDataType)typeof(UnityEngine.Vector2)] = UpdateVector2Requirement; TypeToRequirementFill[(MarsDataType)typeof(UnityEngine.Vector2)] = FillVector2Requirement; }