Makes sures that actor will be fully visible in stage. If it's necessary actor position will be changed to fit it
on screen.
344808
public static void keepWithinStage (Stage stage, Actor actor) {
		//taken from scene2d.ui Window
		Camera camera = stage.getCamera();
		if (camera instanceof OrthographicCamera) {
			OrthographicCamera orthographicCamera = (OrthographicCamera) camera;
			float parentWidth = stage.getWidth();
			float parentHeight = stage.getHeight();
			if (actor.getX(Align.right) - camera.position.x > parentWidth / 2 / orthographicCamera.zoom)
				actor.setPosition(camera.position.x + parentWidth / 2 / orthographicCamera.zoom, actor.getY(Align.right), Align.right);
			if (actor.getX(Align.left) - camera.position.x < -parentWidth / 2 / orthographicCamera.zoom)
				actor.setPosition(camera.position.x - parentWidth / 2 / orthographicCamera.zoom, actor.getY(Align.left), Align.left);
			if (actor.getY(Align.top) - camera.position.y > parentHeight / 2 / orthographicCamera.zoom)
				actor.setPosition(actor.getX(Align.top), camera.position.y + parentHeight / 2 / orthographicCamera.zoom, Align.top);
			if (actor.getY(Align.bottom) - camera.position.y < -parentHeight / 2 / orthographicCamera.zoom)
				actor.setPosition(actor.getX(Align.bottom), camera.position.y - parentHeight / 2 / orthographicCamera.zoom, Align.bottom);
		} else if (actor.getParent() == stage.getRoot()) {
			float parentWidth = stage.getWidth();
			float parentHeight = stage.getHeight();
			if (actor.getX() < 0) actor.setX(0);
			if (actor.getRight() > parentWidth) actor.setX(parentWidth - actor.getWidth());
			if (actor.getY() < 0) actor.setY(0);
			if (actor.getTop() > parentHeight) actor.setY(parentHeight - actor.getHeight());
		}
	}
685406
def on_resize(width, height):
	""""""
	glViewport(0, 0, width, height)
	glMatrixMode(GL_PROJECTION)
	glLoadIdentity()
	gluPerspective(30, 1.0*width/height, 0.1, 1000.0)
	glMatrixMode(GL_MODELVIEW)
	glLoadIdentity()
363198
function() {
            Kinetic.Node.prototype.moveToTop.call(this);
            var stage = this.getStage();
            if(stage) {
                stage.content.removeChild(this.getCanvas()._canvas);
                stage.content.appendChild(this.getCanvas()._canvas);
            }
        }
1027825
def actor_options
      {
        actor_system: actor_system,
        mailbox_class: mailbox_class,
        mailbox_size: mailbox_size,
        task_class: task_class,
        exclusive: exclusive_actor
      }
    end
262216
function (args) {
          Model.call(this, args);
          this.modelType = "Actor";

          this.attributes.push(new Attribute('name'));
          this.attributes.push(new Attribute('born', 'Number'));
          this.attributes.push(new Attribute('isMale', 'Boolean'));
        }
65870
def Cone(pos=(0, 0, 0), r=1, height=3, axis=(0, 0, 1), c="dg", alpha=1, res=48):
    
    con = vtk.vtkConeSource()
    con.SetResolution(res)
    con.SetRadius(r)
    con.SetHeight(height)
    con.SetDirection(axis)
    con.Update()
    actor = Actor(con.GetOutput(), c, alpha)
    actor.GetProperty().SetInterpolationToPhong()
    actor.SetPosition(pos)
    v = utils.versor(axis) * height / 2
    actor.base = pos - v
    actor.top = pos + v
    settings.collectable_actors.append(actor)
    return actor
1258771
private void adaptTabLayoutVisibility() {
        if (tabLayout != null) {
            tabLayout.setVisibility(tabLayoutShown ? View.VISIBLE : View.GONE);
        }
    }
1276212
def supervise_actors
      current_actor = Actor.current
      @actor.link current_actor if @actor.respond_to?(:link)
      current_actor.link connection
    end
369408
def surfaceIntersection(actor1, actor2, tol=1e-06, lw=3):
    
    bf = vtk.vtkIntersectionPolyDataFilter()
    poly1 = actor1.GetMapper().GetInput()
    poly2 = actor2.GetMapper().GetInput()
    bf.SetInputData(0, poly1)
    bf.SetInputData(1, poly2)
    bf.Update()
    actor = Actor(bf.GetOutput(), "k", 1)
    actor.GetProperty().SetLineWidth(lw)
    return actor
533700
def on_resize(self, *args):
        """"""
        # pylint: disable=W0613
        #         Unused argument 'args'
        self.screen.style.name_len = min(self.screen.style.name_len,
                                         self.term.width - 15)
        assert self.term.width >= self.screen.hint_width, (
            'Screen to small {}, must be at least {}'.format(
                self.term.width, self.screen.hint_width))
        self._set_lastpage()
        self.dirty = self.STATE_REFRESH
550572
function() {
            // set player position (player is not added to the enitity manager)
            this.entityManager.add(this.player.x, this.player.y, this.player);
            this.player.updateFov();
            this.lighting.update();
            this.renderer.setCenter(this.player.x, this.player.y);
            this.renderer.draw();
        }
929857
public static void addActors(final Stage stage, final Iterable<Actor> actors) {
        if (actors != null) {
            for (final Actor actor : actors) {
                stage.addActor(actor);
            }
        }
    }
496167
def OnToggleFullscreen(self, event):
        """"""

        is_full_screen = self.main_window.IsFullScreen()

        # Make sure that only the grid is shown in fullscreen mode
        if is_full_screen:
            try:
                self.main_window.grid.SetRowLabelSize(self.row_label_size)
                self.main_window.grid.SetColLabelSize(self.col_label_size)
            except AttributeError:
                pass

            # Restore toolbars from before fullscreen mode
            try:
                self.main_window._mgr.LoadPerspective(self.aui_windowed)
            except AttributeError:
                pass

        else:
            # Save the perspective of the AUI manager
            self.aui_windowed = self.main_window._mgr.SavePerspective()

            # Hide toolbars
            for pane in self.main_window._mgr.GetAllPanes():
                if pane.name != "grid":
                    pane.Hide()

            self.main_window._mgr.Update()

            self.row_label_size = self.main_window.grid.GetRowLabelSize()
            self.col_label_size = self.main_window.grid.GetColLabelSize()

            self.main_window.grid.SetRowLabelSize(0)
            self.main_window.grid.SetColLabelSize(0)

        self.main_window.ShowFullScreen(not is_full_screen)
1045528
function storeActors() {
      test.actorsStored = 0;
      for (var i = 0; i < test.actorsInfo.length; i++) {
        test.actor.set('ID', null);
        test.actor.set('name', test.actorsInfo[i][0]);
        test.actor.set('born', test.actorsInfo[i][1]);
        test.actor.set('isMale', test.actorsInfo[i][2]);
        storeBeingTested.putModel(test.actor, actorStored);
      }
    }
840433
function forFade(props) {
  const { layout, position, scene } = props;

  if (!layout.isMeasured) {
    return forInitial(props);
  }
  const interpolate = getSceneIndicesForInterpolationInputRange(props);

  if (!interpolate) return { opacity: 0 };

  const { first, last } = interpolate;
  const index = scene.index;
  const opacity = position.interpolate({
    inputRange: [first, index, last],
    outputRange: [0, 1, 1],
  });

  return {
    opacity,
  };
}
1315502
def addCutterTool(actor):
    
    if isinstance(actor, vtk.vtkVolume):
        return _addVolumeCutterTool(actor)
    elif isinstance(actor, vtk.vtkImageData):
        from vtkplotter import Volume
        return _addVolumeCutterTool(Volume(actor))

    vp = settings.plotter_instance
    if not vp.renderer:
        save_int = vp.interactive
        vp.show(interactive=0)
        vp.interactive = save_int

    vp.clickedActor = actor
    if hasattr(actor, "polydata"):
        apd = actor.polydata()
    else:
        apd = actor.GetMapper().GetInput()

    planes = vtk.vtkPlanes()
    planes.SetBounds(apd.GetBounds())

    clipper = vtk.vtkClipPolyData()
    clipper.GenerateClipScalarsOff()
    clipper.SetInputData(apd)
    clipper.SetClipFunction(planes)
    clipper.InsideOutOn()
    clipper.GenerateClippedOutputOn()

    act0Mapper = vtk.vtkPolyDataMapper()  # the part which stays
    act0Mapper.SetInputConnection(clipper.GetOutputPort())
    act0 = Actor()
    act0.SetMapper(act0Mapper)
    act0.GetProperty().SetColor(actor.GetProperty().GetColor())
    act0.GetProperty().SetOpacity(1)

    act1Mapper = vtk.vtkPolyDataMapper()  # the part which is cut away
    act1Mapper.SetInputConnection(clipper.GetClippedOutputPort())
    act1 = vtk.vtkActor()
    act1.SetMapper(act1Mapper)
    act1.GetProperty().SetOpacity(0.02)
    act1.GetProperty().SetRepresentationToWireframe()
    act1.VisibilityOn()

    vp.renderer.AddActor(act0)
    vp.renderer.AddActor(act1)
    vp.renderer.RemoveActor(actor)

    def SelectPolygons(vobj, event):
        vobj.GetPlanes(planes)

    boxWidget = vtk.vtkBoxWidget()
    boxWidget.OutlineCursorWiresOn()
    boxWidget.GetSelectedOutlineProperty().SetColor(1, 0, 1)
    boxWidget.GetOutlineProperty().SetColor(0.1, 0.1, 0.1)
    boxWidget.GetOutlineProperty().SetOpacity(0.8)
    boxWidget.SetPlaceFactor(1.05)
    boxWidget.SetInteractor(vp.interactor)
    boxWidget.SetInputData(apd)
    boxWidget.PlaceWidget()
    boxWidget.AddObserver("InteractionEvent", SelectPolygons)
    boxWidget.On()

    vp.cutterWidget = boxWidget
    vp.clickedActor = act0
    ia = vp.actors.index(actor)
    vp.actors[ia] = act0

    colors.printc("Mesh Cutter Tool:", c="m", invert=1)
    colors.printc("  Move gray handles to cut away parts of the mesh", c="m")
    colors.printc("  Press X to save file to: clipped.vtk", c="m")

    vp.interactor.Start()
    boxWidget.Off()
    vp.widgets.append(boxWidget)

    vp.interactor.Start()  # allow extra interaction

    return act0
393821
protected void setStageViewport() {
        if (context.isAvailable(Viewport.class)) {
            stage.setViewport(context.get(Viewport.class, stage));
        } else {
            Gdx.app.debug(Lml.LOGGER_TAG, "No provider found for Viewport.class. Using default Stage viewport.");
        }
        final Viewport viewport = stage.getViewport();
        centerCamera = viewport instanceof ScreenViewport || viewport instanceof LetterboxingViewport;
    }