public void PreconditionCode(AttachedNodeData data, List <string> lines, AttributeInterpreterBase interpreter)
        {
            var builder     = new NodeBuilder(interpreter.Parent);
            var builderName = "builder" + builder.Node.Index;

            data.Data[AttachedDataNames.BuilderName] = builderName;
            lines.Add(builderName + "= NodeBuilder(Document, FunctionNames." + builder.FunctionName + ")");
            lines.Add(builderName + ".ShapeName =  \"" + builder.ShapeName + "\"");
        }
        protected static string BuilderStr(AttachedNodeData data)
        {
            object builderNameObj;

            if (!data.Parent.Data.TryGetValue(AttachedDataNames.BuilderName, out builderNameObj))
            {
                return(string.Empty);
            }
            var builderName = (string)builderNameObj;

            return(builderName + "[" + (data.Node.Index - 1) + "].");
        }
        public void PostconditionCode(AttachedNodeData data, List <string> lines)
        {
            object builderNameObj;

            if (!data.Data.TryGetValue(AttachedDataNames.BuilderName, out builderNameObj))
            {
                return;
            }
            var builderName = (string)builderNameObj;

            lines.Add(builderName + ".ExecuteFunction()");
        }
        public override void PreconditionCode(AttachedNodeData data, List <string> lines,
                                              AttributeInterpreterBase interpreter)
        {
            var builderStr = BuilderStr(data);

            if (string.IsNullOrEmpty(builderStr))
            {
                return;
            }
            var realInterpreter = (RealInterpreter)interpreter;

            lines.Add(builderStr + "Real =" + _(realInterpreter.Value));
        }
        public override void PreconditionCode(AttachedNodeData data, List <string> lines,
                                              AttributeInterpreterBase interpreter)
        {
            base.PreconditionCode(data, lines, interpreter);
            var builderStr = BuilderStr(data);

            if (string.IsNullOrEmpty(builderStr))
            {
                return;
            }
            var referenceInterpreter = (ReferenceInterpreter)interpreter;

            DefineSse(lines, referenceInterpreter.Data);
            lines.Add(builderStr + "ReferenceData = sse");
        }
Exemplo n.º 6
0
        public override void PreconditionCode(AttachedNodeData data, List <string> lines,
                                              AttributeInterpreterBase interpreter)
        {
            var buildStr = BuilderStr(data);

            if (string.IsNullOrEmpty(buildStr))
            {
                return;
            }
            var nodeBuilder = new NodeBuilder(data.Parent.Node);

            var point = nodeBuilder[data.Node.Index - 1].TransformedPoint3D;

            lines.Add(buildStr + "Point3D = Point3D(" + _(point.X) + ", " + _(point.Y) + ", " + _(point.Z) + ")");
        }
        public override void PreconditionCode(AttachedNodeData data, List <string> lines,
                                              AttributeInterpreterBase interpreter)
        {
            var builderStr = BuilderStr(data);

            if (string.IsNullOrEmpty(builderStr))
            {
                return;
            }
            var axis = new Axis(new NodeBuilder(data.Parent.Node)[data.Node.Index - 1].TransformedAxis3D);

            lines.Add(builderStr + "Axis3D = Axis (" +
                      "Point3D(" + _(axis.Location.X) + ", " + _(axis.Location.Y) + ", " + _(axis.Location.Z) + ")," +
                      "Point3D(" + _(axis.Direction.X) + ", " + _(axis.Direction.Y) + ", " + _(axis.Direction.Z) + "))"
                      );
        }
Exemplo n.º 8
0
        private void SaveToFile()
        {
            var lines = new List <string>();
            var node  = Document.Root;
            var data  = new AttachedNodeData(node);

            VisitChildren(data, lines);
            var builder = new StringBuilder();

            foreach (var line in lines)
            {
                builder.AppendLine(line);
            }

            Inputs[InputNames.UiElementsItem].Send(NotificationNames.SetBooEditorText, builder.ToString());
        }
        public override void PreconditionCode(AttachedNodeData data, List <string> lines,
                                              AttributeInterpreterBase interpreter)
        {
            base.PreconditionCode(data, lines, interpreter);
            var builderStr = BuilderStr(data);

            if (string.IsNullOrEmpty(builderStr))
            {
                return;
            }
            var referenceListInterpreter = (ReferenceListInterpreter)interpreter;

            lines.Add("refList = List[of SceneSelectedEntity]()");
            foreach (var sceneSelectedEntity in referenceListInterpreter.Nodes)
            {
                DefineSse(lines, sceneSelectedEntity);
                lines.Add("refList.Add(sse)");
            }
            lines.Add(builderStr + "ReferenceList = refList");
        }
Exemplo n.º 10
0
        private static void VisitChildren(AttachedNodeData data, List <string> lines)
        {
            var node = data.Node;

            foreach (var interpreter in node.Interpreters.Values)
            {
                BooExportInterpreterFactory.Instance.PreHandle(interpreter, data, lines);
            }
            foreach (var childNode in node.Children.Values)
            {
                var childData = new AttachedNodeData(childNode)
                {
                    Parent = data
                };
                VisitChildren(childData, lines);
            }
            foreach (var interpreter in node.Interpreters.Values)
            {
                BooExportInterpreterFactory.Instance.PostHandle(interpreter, data, lines);
            }
        }
 public abstract void PostconditionCode(AttachedNodeData data, List <string> lines);
 public abstract void PreconditionCode(AttachedNodeData data, List <string> lines,
                                       AttributeInterpreterBase interpreter);
Exemplo n.º 13
0
 public override void PostconditionCode(AttachedNodeData data, List <string> lines)
 {
 }
Exemplo n.º 14
0
 public override void PreconditionCode(AttachedNodeData data, List <string> lines,
                                       AttributeInterpreterBase interpreter)
 {
     _data = data;
 }