public SpherePackage(vtkRenderer aRender) { _aRender = aRender; _sphereSource = vtkSphereSource.New(); _sphereSource.SetRadius(3); _sphereSource.SetRadius(0.5); _sphereSource.SetThetaResolution(26); _sphereSource.SetPhiResolution(26); _sphereSource.ModifiedEvt += _sphereSource_ModifiedEvt; SphereMapper = vtkPolyDataMapper.New(); SphereMapper.SetInputConnection(_sphereSource.GetOutputPort()); _sphereActor = vtkActor.New(); _sphereActor.SetMapper(SphereMapper); aRender.AddActor(_sphereActor); _aText = vtkVectorText.New(); _aText.SetText(""); vtkPolyDataMapper textMapper = vtkPolyDataMapper.New(); textMapper.SetInputConnection(_aText.GetOutputPort()); _textActor = vtkFollower.New(); //textActor.GetProperty().SetColor(point.Color.X, point.Color.Y, point.Color.Z); _textActor.SetMapper(textMapper); //textActor.SetScale(0.2, 0.2, 0.2); //textActor.SetScale(4); _textActor.SetCamera(aRender.GetActiveCamera()); aRender.AddActor(_textActor); //SetOpacity(0.5f); //VisOff(); RandColor(); }
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()); }