//public void AddPointingArrow(double scale, Color Colour) //{ // vtkArrowSource ArrowSource = vtkArrowSource.New(); // ArrowActor = vtkActor.New(); // vtkPolyDataMapper ArrowMapper = vtkPolyDataMapper.New(); // ArrowMapper.SetInputConnection(ArrowSource.GetOutputPort()); // ArrowActor.SetMapper(ArrowMapper); // ArrowActor.SetPosition(Position.X - 6, Position.Y - 0, Position.Z - 6); // ArrowActor.RotateY(-45); // ArrowActor.SetScale(scale); // ArrowActor.SetPickable(0); // Color C = Color.MediumPurple; // ArrowActor.GetProperty().SetColor(Colour.R / 255.0, Colour.G / 255.0, Colour.G / 255.0); // // CreateVTK3DObject(); // // CurrentWorld.ren1.AddActor(ArrowActor); //} //public void AddPointingArrow(double scale) //{ // AddPointingArrow(scale, Color.White); //} public void DisplayCentroid(c3DWorld CurrentWorld, double scale) { if (SphereActor == null) { vtkSphereSource SphereSource = vtkSphereSource.New(); vtkPolyDataMapper SphereMapper = vtkPolyDataMapper.New(); SphereActor = vtkActor.New(); SphereMapper = vtkPolyDataMapper.New(); SphereMapper.SetInputConnection(SphereSource.GetOutputPort()); SphereActor.SetMapper(SphereMapper); double[] CenterPos = vtk_Actor.GetCenter(); SphereActor.SetPosition(CenterPos[0], CenterPos[1], CenterPos[2]); SphereActor.SetScale(scale); SphereActor.SetPickable(0); Color C = Color.YellowGreen; SphereActor.GetProperty().SetColor(C.R / 255.0, C.G / 255.0, C.B / 255.0); CurrentWorld.ren1.AddActor(SphereActor); } else { if (SphereActor.GetVisibility() == 0) SphereActor.SetVisibility(1); else SphereActor.SetVisibility(0); } }
public void AddPointingArrow(c3DWorld CurrentWorld, double scale, Color Colour) { vtkArrowSource ArrowSource = vtkArrowSource.New(); ArrowActor = vtkActor.New(); vtkPolyDataMapper ArrowMapper = vtkPolyDataMapper.New(); ArrowMapper.SetInputConnection(ArrowSource.GetOutputPort()); ArrowActor.SetMapper(ArrowMapper); ArrowActor.SetPosition(Position.X - 6, Position.Y - 0, Position.Z - 6); ArrowActor.RotateY(-45); ArrowActor.SetScale(scale); ArrowActor.SetPickable(0); Color C = Color.MediumPurple; ArrowActor.GetProperty().SetColor(Colour.R / 255.0, Colour.G / 255.0, Colour.G / 255.0); // CreateVTK3DObject(); CurrentWorld.ren1.AddActor(ArrowActor); }