private void TryHidingCloseAxes() { foreach (var originalAxis in new AAxis[] { spanningAxes.A, spanningAxes.B }) { if (shadowAxes.ContainsKey(originalAxis)) { var shadowAxis = shadowAxes[originalAxis]; try { var visible = !AMetaVisSystem.CheckIfNearEnoughToHideAxis(originalAxis, shadowAxis); shadowAxis.SetVisibility(visible); var distProjOnOrigBase = AMetaVisSystem.ProjectedDistanceToAxis(shadowAxis.GetAxisBaseGlobal(), originalAxis); var distProjOnOrigTip = AMetaVisSystem.ProjectedDistanceToAxis(shadowAxis.GetAxisTipGlobal(), originalAxis); // if one axis is parallel it's metavis axis and the other is not, // stick to the parallel one if (distProjOnOrigBase < .01f && distProjOnOrigTip < .01f) { metaVisualization.transform.position = originalAxis.GetAxisBaseGlobal(); } } catch (Exception e) { Debug.LogError("Checking vicinity of original and meta axis failed, because of exception."); Debug.LogException(e); } } } }
private void FindShadowAxes() { // FlexiblePCP does not contain shadow axes try { // for both of the spanning axes, add their shadow-counterparts to the list foreach (var ax in new AAxis[] { spanningAxes.A, spanningAxes.B }) { if (metaVisualization.registeredAxes.ContainsKey(ax.attributeName)) { // If a metavisualization contains more than one matching // shadow axis, add the nearest one. foreach (var a in metaVisualization.registeredAxes[ax.attributeName]) { if (shadowAxes.ContainsKey(ax)) { var alreadyRegisteredShadowAxis = shadowAxes[ax]; if (AMetaVisSystem.MeanDistanceBetween(ax, a) < AMetaVisSystem.MeanDistanceBetween(ax, shadowAxes[ax])) { shadowAxes[ax] = a; } } else { shadowAxes.Add(ax, a); } } } } } catch (Exception e) { Debug.LogException(e); } }
/// <summary> /// Checks whether the conditions of this meta-visualization still apply. /// That is the case, if visualization type hasn't changed and the spanning /// axes are still close enough to each other. /// </summary> private void CheckValidity() { valid = AMetaVisSystem.CheckIfNearEnough(spanningAxes) && Type().Equals(AMetaVisSystem.WhichMetaVis(spanningAxes, dataSetID)); }