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


C# IGH_DataAccess.DisableGapLogic方法代码示例

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


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

示例1: SolveInstance

 protected override void SolveInstance(IGH_DataAccess DA)
 {
     DA.DisableGapLogic();
     if (DA.Iteration <= 0)
     {
         // Solveinstance is being called as many times as the length
         // of the input data. Why? Dunno. But it messes things up, outputting
         // n*n data. 
         DA.SetDataTree(0, P.VolatileData);
         DA.SetDataTree(1, P.History);
         DA.SetData(2, lStep);
         DA.SetData(3, cStep);
     }
 }
开发者ID:kanukanun,项目名称:Hoopsnake,代码行数:14,代码来源:HSComponent.cs

示例2: SafeSolveInstance

        protected override void SafeSolveInstance(IGH_DataAccess da)
        {
            if (m_py == null)
              {
            da.SetData(0, "No Python engine available. This component needs Rhino v5");
            return;
              }

              if(!HiddenOutOutput)
            da.DisableGapLogic(0);

              m_py_output.Reset();

              var rhdoc = RhinoDoc.ActiveDoc;
              var prevEnabled = (rhdoc != null) && rhdoc.Views.RedrawEnabled;

              try
              {
            // set output variables to "None"
            for (int i = HiddenOutOutput ? 0 : 1; i < Params.Output.Count; i++)
            {
              string varname = Params.Output[i].NickName;
              m_py.SetVariable(varname, null);
            }

            // caching variable to keep things as fast as possible
            bool showing_code_input = !HiddenCodeInput;
            // Set all input variables. Even null variables may be used in the
            // script, so do not attempt to skip these for optimization purposes.
            // Skip "Code" input parameter
            // Please pay attention to the input data structure type
            for (int i = showing_code_input ? 1 : 0; i < Params.Input.Count; i++)
            {
              string varname = Params.Input[i].NickName;
              object o = m_marshal.GetInput(da, i);
              m_py.SetVariable(varname, o);
              m_py.SetIntellisenseVariable(varname, o);
            }

            // the "code" string could be embedded in the component itself
            if (showing_code_input || m_compiled_py == null)
            {
              string script;
              if (!showing_code_input)
            script = Code;
              else
              {
            script = null;
            da.GetData(0, ref script);
              }

              if (string.IsNullOrWhiteSpace(script))
              {
            AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "No script to execute");
            return;
              }

              if (m_compiled_py == null ||
              string.Compare(script, m_previousRunCode, StringComparison.InvariantCulture) != 0)
              {
            if (!(m_inDocStringsMode = DocStringUtils.FindApplyDocString(script, this)))
              ResetAllDescriptions();
            m_compiled_py = m_py.Compile(script);
            m_previousRunCode = script;
              }
            }

            if (m_compiled_py != null)
            {
              string localPath;
              bool added = AddLocalPath(out localPath);

              m_compiled_py.Execute(m_py);

              if (added) RemoveLocalPath(localPath);

              // Python script completed, attempt to set all of the
              // output paramerers
              for (int i = HiddenOutOutput ? 0 : 1; i < Params.Output.Count; i++)
              {
            string varname = Params.Output[i].NickName;
            object o = m_py.GetVariable(varname);
            m_marshal.SetOutput(o, da, i);
              }
            }
            else
            {
              m_py_output.Write("There was a permanent error parsing this script. Please report to [email protected]");
            }
              }
              catch (Exception ex)
              {
            AddErrorNicely(m_py_output, ex);
            SetFormErrorOrClearIt(da, m_py_output);
            throw;
              }
              finally
              {
            if (rhdoc != null && prevEnabled != rhdoc.Views.RedrawEnabled)
              rhdoc.Views.RedrawEnabled = true;
//.........这里部分代码省略.........
开发者ID:spearfish,项目名称:ghpython,代码行数:101,代码来源:ScriptingAncestorComponent.cs

示例3: SafeSolveInstance

        protected override void SafeSolveInstance(IGH_DataAccess DA)
        {
            if (_py == null)
              {
            DA.SetData(0, "No Python engine available. This component needs Rhino v5");
            return;
              }

              DA.DisableGapLogic(0);

              m_py_output.Reset();

              var rhdoc = RhinoDoc.ActiveDoc;
              var prevEnabled = (rhdoc != null) && rhdoc.Views.RedrawEnabled;

              try
              {
            // set output variables to "None"
            for (int i = HideCodeOutput ? 0 : 1; i < Params.Output.Count; i++)
            {
              string varname = Params.Output[i].NickName;
              _py.SetVariable(varname, null);
            }

            // caching variable to keep things as fast as possible
            bool showing_code_input = CodeInputVisible;
            // Set all input variables. Even null variables may be used in the
            // script, so do not attempt to skip these for optimization purposes.
            // Skip "Code" input parameter
            // Please pay attention to the input data structure type
            for (int i = showing_code_input ? 1 : 0; i < Params.Input.Count; i++)
            {
              string varname = Params.Input[i].Name; // ksteinfe: changed from Params.Input[i].Nickname
              object o = _marshal.GetInput(DA, i);
              _py.SetVariable(varname, o);
            //_py.SetIntellisenseVariable(varname, o); // ksteinfe: i think this set the Intellisense thingos for all the input variables.  we are converting, so Intellisense would just be confusing.
            }

            // the "code" string could be embedded in the component itself
            if (showing_code_input || _compiled_py == null)
            {
              string script;
              if (!showing_code_input)
            script = CodeInput;
              else
              {
            script = null;
            DA.GetData(0, ref script);
              }

              if (string.IsNullOrWhiteSpace(script))
              {
            AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "No script to execute");
            return;
              }

            // ksteinfe - i think we put our hack here.
              //_py.ExecuteScript(DcPython.Decodes.DecodesAppendedCode.header);
              //script = script + DcPython.Decodes.DecodesAppendedCode.footer;
              script = DcPython.Decodes.DecodesAppendedCode.header + script + DcPython.Decodes.DecodesAppendedCode.footer;

              if (_compiled_py == null ||
              string.Compare(script, _previousRunCode, StringComparison.InvariantCulture) != 0)
              {
            if (!(_inDocStringsMode = DocStringUtils.FindApplyDocString(script, this)))
              ResetAllDescriptions();
            _compiled_py = _py.Compile(script);
            _previousRunCode = script;
              }
            }

            if (_compiled_py != null)
            {
              _compiled_py.Execute(_py);
              // Python script completed, attempt to set all of the
              // output paramerers
              for (int i = HideCodeOutput ? 0 : 1; i < Params.Output.Count; i++)
              {
            string varname = Params.Output[i].NickName;
            object o = _py.GetVariable(varname); // ksteinfe: this is a tree coming in from gh python out.  can we just scan the tree and grab the attributes to store somewhere, then bake each param?
            _marshal.SetOutput(o, DA, i);
              }
            }
            else
            {
              m_py_output.Write("There was a permanent error parsing this script. Please report to [email protected]");
            }
              }
              catch (Exception ex)
              {
            AddErrorNicely(m_py_output, ex);
            SetFormErrorOrClearIt(DA, m_py_output);
            throw;
              }
              finally
              {
            if (rhdoc != null && prevEnabled != rhdoc.Views.RedrawEnabled)
              rhdoc.Views.RedrawEnabled = true;
              }
              SetFormErrorOrClearIt(DA, m_py_output);
//.........这里部分代码省略.........
开发者ID:jhaazpr,项目名称:decodes,代码行数:101,代码来源:ScriptingAncestorComponent.cs


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