private void MainForm_Load(object sender, EventArgs e) { mRenderView.SetSelectCallback((PickedItem item) => { this.listBox1.Items.Clear(); if (item.IsNull()) { return; } var ssn = BrepSceneNode.Cast(item.GetNode()); if (ssn != null) { this.listBox1.Items.Add(ssn.GetType().Name); } else { this.listBox1.Items.Add(item.GetNode().GetType().Name); } this.listBox1.Items.Add(String.Format("NodeId: {0}", item.GetNodeId())); this.listBox1.Items.Add(item.GetPoint().GetPosition().ToString()); this.listBox1.Items.Add(item.GetShapeType().ToString()); this.listBox1.Items.Add(String.Format("SubIndex: {0}", item.GetShapeIndex())); }); mRenderView.SetAnimationCallback((float timer) => { TestCase.RunAnimation(mRenderView, timer); }); }
private void MainForm_Load(object sender, EventArgs e) { // Selection changed mRenderView.SetSelectCallback((PickedResult result) => { mSelectedItm = 0; this.listBox1.Items.Clear(); if (result.IsEmpty()) { return; } var item = result.GetItem(); if (item.GetNode() == null) { return; } TestCase.SelectionChanged(mRenderView, result); this.listBox1.Items.Add(item.GetNode().GetType().Name); mSelectedItm = item.GetNodeId(); this.listBox1.Items.Add(String.Format("NodeId: {0}", item.GetNodeId())); this.listBox1.Items.Add(item.GetPoint().GetPosition().ToString()); this.listBox1.Items.Add(item.GetShapeType().ToString()); this.listBox1.Items.Add(String.Format("SubIndex: {0}", item.GetShapeIndex())); this.listBox1.Items.Add(String.Format("PrimitiveIndex: {0}", item.GetPoint().GetPrimitiveIndex())); }); mRenderView.SetAnimationCallback((float timer) => { if (mEnableAnimation) { TestCase.RunAnimation(mRenderView, timer); } }); //mRenderView.SwitchProjectionType(); }