当前位置: 首页>>代码示例>>C#>>正文


C# EngineController.GetMirror方法代码示例

本文整理汇总了C#中Dynamo.DSEngine.EngineController.GetMirror方法的典型用法代码示例。如果您正苦于以下问题:C# EngineController.GetMirror方法的具体用法?C# EngineController.GetMirror怎么用?C# EngineController.GetMirror使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Dynamo.DSEngine.EngineController的用法示例。


在下文中一共展示了EngineController.GetMirror方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GeneratedGraphicItems

        public static List<IGraphicItem> GeneratedGraphicItems(this NodeModel node, EngineController engineController)
        {
            var ids = node.GetAllOutportAstIdentifiers();

            var results = new List<IGraphicItem>();

            foreach (var id in ids)
            {
                var mirror = engineController.GetMirror(id);
                if (mirror == null) continue;

                var mirrorData = mirror.GetData();
                if (mirrorData == null) continue;

                GetGraphicItemsFromMirrorData(mirrorData, results);
            }

            return results;
        }
开发者ID:rafatahmed,项目名称:Dynamo,代码行数:19,代码来源:NodeModelExtensions.cs

示例2: GetValue

 /// <summary>
 ///     Gets the most recent value of this node stored in an EngineController that has evaluated it.
 /// </summary>
 /// <param name="outPortIndex"></param>
 /// <param name="engine"></param>
 /// <returns></returns>
 public MirrorData GetValue(int outPortIndex, EngineController engine)
 {
     return engine.GetMirror(GetAstIdentifierForOutputIndex(outPortIndex).Value).GetData();
 }
开发者ID:w-fish,项目名称:Dynamo,代码行数:10,代码来源:NodeModel.cs

示例3: GetCachedValueFromEngine

        /// <summary>
        /// WARNING: This method is meant for unit test only. It directly accesses
        /// the EngineController for the mirror data without waiting for any 
        /// possible execution to complete (which, in single-threaded nature of 
        /// unit test, is an okay thing to do). The right way to get the cached 
        /// value for a NodeModel is by going through its RequestValueUpdateAsync
        /// method).
        /// </summary>
        /// <param name="engine">Instance of EngineController from which the node
        /// value is to be retrieved.</param>
        /// <returns>Returns the MirrorData if the node's value is computed, or 
        /// null otherwise.</returns>
        /// 
        internal MirrorData GetCachedValueFromEngine(EngineController engine)
        {
            if (cachedMirrorData != null)
                return cachedMirrorData;

            // Do not have an identifier for preview right now. For an example,
            // this can be happening at the beginning of a code block node creation.
            if (AstIdentifierForPreview.Value == null)
                return null;

            cachedMirrorData = null;

            var runtimeMirror = engine.GetMirror(AstIdentifierForPreview.Value);

            if (runtimeMirror != null)
                cachedMirrorData = runtimeMirror.GetData();

            return cachedMirrorData;
        }
开发者ID:w-fish,项目名称:Dynamo,代码行数:32,代码来源:NodeModel.cs

示例4: ComputeColorRange

        public ColorRange1D ComputeColorRange(EngineController engine)
        {
            List<Color> colors;
            List<double> parameters;

            // If there are colors supplied
            if (InPorts[0].Connectors.Any())
            {
                var colorsNode = InPorts[0].Connectors[0].Start.Owner;
                var colorsIndex = InPorts[0].Connectors[0].Start.Index;
                var startId = colorsNode.GetAstIdentifierForOutputIndex(colorsIndex).Name;
                var colorsMirror = engine.GetMirror(startId);
                colors = GetColorsFromMirrorData(colorsMirror);
            }
            else
            {
                colors = DefaultColorRanges.Analysis;
            }

            // If there are indices supplied
            if (InPorts[1].Connectors.Any())
            {
                var valuesNode = InPorts[1].Connectors[0].Start.Owner;
                var valuesIndex = InPorts[1].Connectors[0].Start.Index;
                var endId = valuesNode.GetAstIdentifierForOutputIndex(valuesIndex).Name;
                var valuesMirror = engine.GetMirror(endId);
                parameters = GetValuesFromMirrorData(valuesMirror);
            }
            else
            {
                parameters = CreateParametersForColors(colors);
            }

            return ColorRange1D.ByColorsAndParameters(colors, parameters);
        }
开发者ID:rafatahmed,项目名称:Dynamo,代码行数:35,代码来源:ColorRange.cs


注:本文中的Dynamo.DSEngine.EngineController.GetMirror方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。