示例#1
0
        public void ShowClip(bool show)
        {
            if (show == true)
            {
                SliderWidget.SetEnabled(1);
                ClipPlaneActor.VisibilityOn();
                Reverse.SetEnabled(1);
                ClipX.SetEnabled(1);
                ClipY.SetEnabled(1);
                ClipZ.SetEnabled(1);
                Grid.SetEnabled(1);

                // Restore Clip Buttons position
                Grid.GetTextActor().SetPosition(0.88, 0.39);
                Reverse.GetTextActor().SetPosition(0.875, 0.34);
                ClipX.GetTextActor().SetPosition(0.88, 0.29);
                ClipY.GetTextActor().SetPosition(0.88, 0.24);
                ClipZ.GetTextActor().SetPosition(0.88, 0.19);
            }
            else
            {
                SliderWidget.SetEnabled(0);
                ClipPlaneActor.VisibilityOff();
                Reverse.SetEnabled(0);
                ClipX.SetEnabled(0);
                ClipY.SetEnabled(0);
                ClipZ.SetEnabled(0);
                Grid.SetEnabled(0);
            }
        }
示例#2
0
        private vtkTextWidget CreateClipButton(string Text, double[] Position, int FontSize)
        {
            // Create Text Actor and Representation
            vtkTextActor TextActor = vtkTextActor.New();

            TextActor.SetInput(Text);
            TextActor.GetTextProperty().SetBold(0);
            TextActor.GetTextProperty().SetFontFamilyToArial();
            vtkTextRepresentation Rep = vtkTextRepresentation.New();

            Rep.SetPosition(Position[0], Position[1]);
            Rep.SetTextActor(TextActor);
            Rep.SetShowBorderToOff();

            // Set widget
            vtkTextWidget Widget = vtkTextWidget.New();

            Widget.SetRepresentation(Rep);
            Widget.GetTextActor().GetTextProperty().SetFontSize(FontSize);
            Widget.GetTextActor().SetTextScaleModeToViewport();
            Widget.SetInteractor(renderWindow.GetInteractor());
            Widget.SelectableOn();
            Widget.SetEnabled(0);
            Widget.ResizableOff();

            return(Widget);
        }