public void AddText(String Text, c3DWorld CurrentWorld, double scale) { if (TextActor == null) { TextActor = vtkFollower.New(); TextMapper = vtkPolyDataMapper.New(); TextVTK = vtkVectorText.New(); TextVTK.SetText(Text); TextMapper.SetInputConnection(TextVTK.GetOutputPort()); TextActor.SetMapper(TextMapper); //TextActor.SetPosition(this.GetActor().GetCenter()[0]-1, this.GetActor().GetCenter()[1]-1, this.GetActor().GetCenter()[2]-2); TextActor.SetPosition(Position.X , Position.Y , Position.Z - 1); TextActor.SetPickable(0); CurrentWorld.ren1.AddActor(TextActor); TextActor.SetCamera(CurrentWorld.ren1.GetActiveCamera()); } else { TextVTK.SetText(Text); } TextActor.SetScale(scale); }
public void AddText(String Text, vtkRenderer ren1, double scale) { TextActor = vtkFollower.New(); TextMapper = vtkPolyDataMapper.New(); TextVTK = vtkVectorText.New(); TextVTK.SetText(Text); TextMapper.SetInputConnection(TextVTK.GetOutputPort()); TextActor.SetMapper(TextMapper); TextActor.SetPosition(Position.X - 1, Position.Y - 1, Position.Z - 1); TextActor.SetScale(scale); TextActor.SetPickable(0); ren1.AddActor(TextActor); TextActor.SetCamera(ren1.GetActiveCamera()); }