public NodeConnection(Node child, Node parent, TreeMaker treeMaker, bool isLoadingConnection = false, bool isSavingConnection = false) { if (child == null && parent == null) { Debug.LogError("No start nor end node was given! Connection not created!"); return; } if (child != null) { childNode = child; childPoint = child.parentConnectionPoint; } if (parent != null) { parentNode = parent; parentPoint = parent.childConnectionPoint; } if (!isLoadingConnection) { treeMaker.SetCurrentConnection(this); } if (!isSavingConnection) { treeMaker.AddNodeConnection(this); } this.treeMaker = treeMaker; }
protected override void OnLoad(EventArgs e) { DojoMemberTypeTemplateManager m; DojoMemberTypeTemplateCollection templates; ComponentArt.Web.UI.TreeViewNode node; base.OnLoad(e); EnsureChildControls(); if (tree.Nodes.Count == 0) { node = new ComponentArt.Web.UI.TreeViewNode(); node.Text = "Member Type Templates"; node.ImageUrl = "./images/tree/root.gif"; node.Expanded = true; tree.Nodes.Add(node); m = new DojoMemberTypeTemplateManager(); templates = m.GetCollection(string.Empty, "Name, CreateDate", null); TreeMaker.Make(templates, TreeMaker.MakeMode.Collapse); foreach (DojoMemberTypeTemplate template in templates) { if (template.parent == null) { addTemplate(node, template); } } } }
public void ParseLoadedInformation(string name, NodeTypes nodeType, float[] size, bool isRoot, TreeMaker treeMaker) { this.name = name; this.nodeType = nodeType; this.size = size; this.isRoot = isRoot; this.treeMaker = treeMaker; }
void OnEnable() { gridSerializedProperty = serializedObject.FindProperty("grid"); tree = (TreeMaker)target; tree2Prefab = AssetDatabase.LoadAssetAtPath <GameObject>("Assets/Prefabs/tree_2.prefab"); tree1Prefab = AssetDatabase.LoadAssetAtPath <GameObject>("Assets/Prefabs/tree_1.prefab"); treeTopPrefab = AssetDatabase.LoadAssetAtPath <GameObject>("Assets/Prefabs/tree_top.prefab"); branchPrefab = AssetDatabase.LoadAssetAtPath <GameObject>("Assets/Prefabs/Branch.prefab"); bushPrefab = AssetDatabase.LoadAssetAtPath <GameObject>("Assets/Prefabs/Bush.prefab"); }
public override void OnInspectorGUI() { TreeMaker treeMaker = (TreeMaker)target; base.OnInspectorGUI(); if (GUILayout.Button("Create Trees")) { treeMaker.CreateTrees(); } if (GUILayout.Button("Remove Trees")) { treeMaker.RemoveTrees(); } }
void Just4tst() { var xsd_path = @"D:\флэшка\SIM\data\settings.xsd";//@"D:\qt46\SIM\data\settings.xsd"; var xml_path = @"D:\флэшка\SIM\data\some.xml"; //@"D:\qt46\SIM\data\some.xml"; var xdoc = XDocument.Load(xml_path); xdoc = new XDocument(xdoc); XmlSchemaSet schemas = new XmlSchemaSet(); schemas.Add(null, xsd_path); var tm = new TreeMaker(xdoc, schemas); tm.AddSpecialIDsToDoc(); tm.BuildTreeView(tv_xml); textBlock_xml.Text = tm.GetDocString(); tm.Tree = tm.ConstructTree(); this.Tm = tm; }
public Dialog_MainTree() { InitializeComponent(); isCreatedTree = false; richInterface = new CRichTextBoxInterface(); richs = new List <CRichTextbox>(); richs.Add(richMainTree); richs.Add(richEnum); richs.Add(richCol); richs.Add(richGubun); richs.Add(richLineNumber); richs.Add(richEnumName); richInterface.SetInterface(richs); SetLineNumbers(); maker = new TreeMaker(this); }
public string Post([FromBody] TreeMaker value) { Person TargetPerson1 = new Person(); Person TargetPerson2 = new Person(); Tree TargetTree = new Tree(); //get from database if (TargetPerson1.TREE_ID != TargetPerson2.TREE_ID && TargetPerson1.TREE_ID != 0 && TargetPerson2.TREE_ID != 0) { return("action unable to be done, both people are present in different family trees"); } else if (value.RELATIONSHIP.ToUpper() != "SON" && value.RELATIONSHIP.ToUpper() != "DAUGHTER" && value.RELATIONSHIP.ToUpper() != "FATHER" && value.RELATIONSHIP.ToUpper() != "MOTHER") { return("action unable to be done, invalid selector"); } switch (value.RELATIONSHIP.ToUpper()) { case "SON": if (TargetPerson1.GENDER != "M") { return("action unable to be done, the son can't be female"); } if (TargetPerson2.GENDER == "M") { TargetPerson1.FATHER_ID = TargetPerson2.PERSON_ID; } else { TargetPerson1.MOTHER_ID = TargetPerson2.PERSON_ID; } break; case "DAUGHTER": if (TargetPerson1.GENDER != "F") { return("action unable to be done, the daughter can't be male"); } if (TargetPerson2.GENDER == "M") { TargetPerson1.FATHER_ID = TargetPerson2.PERSON_ID; } else { TargetPerson1.MOTHER_ID = TargetPerson2.PERSON_ID; } break; case "FATHER": if (TargetPerson1.GENDER != "M") { return("action unable to be done, the father can't be female"); } TargetPerson2.FATHER_ID = TargetPerson1.PERSON_ID; break; case "MOTHER": if (TargetPerson1.GENDER != "F") { return("action unable to be done, the mother can't be male"); } TargetPerson2.MOTHER_ID = TargetPerson1.PERSON_ID; break; default: return("action unable to be done, invalid selector"); } new FamilyFunction().EditPerson(TargetPerson1); new FamilyFunction().EditPerson(TargetPerson2); return(TargetPerson1.PERSON_NAME + " is listed as the " + value.RELATIONSHIP + " of " + TargetPerson2.PERSON_NAME); }
} //Construction for loading nodes in the tree maker public Node(string name, float[] size, Vector2 position, TreeMaker treeMaker) : base(position) { this.name = name; this.size = size; this.treeMaker = treeMaker; } //TreeMaker nodes' constructor
public ChallengeTreeNode ExpectedOutput() { return(TreeMaker.MakeTreeFromString("3, 9, 20, null, null, 15, 7")); }
public NodeAndVal Input() { var root = TreeMaker.MakeTreeFromString("27,17,33,15,26,32,45,7,16,23,null,31,null,40,49,5,14,null,null,21,25,29,null,34,41,48,null,2,6,10,null,20,22,24,null,28,30,null,39,null,42,46,null,1,4,null,null,9,11,18,null,null,null,null,null,null,null,null,null,37,null,null,44,null,47,0,null,3,null,8,null,null,13,null,19,35,38,43,null,null,null,null,null,null,null,null,null,12,null,null,null,null,36"); return(new NodeAndVal(root, 49)); }
public ChallengeTreeNode ExpectedOutput() { var root = TreeMaker.MakeTreeFromString("27,17,33,15,26,32,45,7,16,23,null,31,null,40,48,5,14,null,null,21,25,29,null,34,41,46,null,2,6,10,null,20,22,24,null,28,30,null,39,null,42,null,47,1,4,null,null,9,11,18,null,null,null,null,null,null,null,null,null,37,null,null,44,null,null,0,null,3,null,8,null,null,13,null,19,35,38,43,null,null,null,null,null,null,null,12,null,null,null,null,36"); return(root); }
private static void Main() { TreeMaker.MakeZippedTree(); }