Bounds of all actors present in the rendering window
14512
def bounds(self):
        
        the_bounds = [np.inf, -np.inf, np.inf, -np.inf, np.inf, -np.inf]

        def _update_bounds(bounds):
            def update_axis(ax):
                if bounds[ax*2] < the_bounds[ax*2]:
                    the_bounds[ax*2] = bounds[ax*2]
                if bounds[ax*2+1] > the_bounds[ax*2+1]:
                    the_bounds[ax*2+1] = bounds[ax*2+1]
            for ax in range(3):
                update_axis(ax)
            return

        for actor in self._actors.values():
            if isinstance(actor, vtk.vtkCubeAxesActor):
                continue
            if ( hasattr(actor, 'GetBounds') and actor.GetBounds() is not None
                 and id(actor) != id(self.bounding_box_actor)):
                _update_bounds(actor.GetBounds())

        return the_bounds
671366
def MeshArrows(*inputobj, **options):
    
    s = options.pop("s", None)
    scale = options.pop("scale", 1)
    c = options.pop("c", "gray")
    alpha = options.pop("alpha", 1)
    res = options.pop("res", 12)

    mesh, u = _inputsort(inputobj)
    startPoints = mesh.coordinates()
    u_values = np.array([u(p) for p in mesh.coordinates()])
    if not utils.isSequence(u_values[0]):
        printc("~times Error: cannot show Arrows for 1D scalar values!", c=1)
        exit()
    endPoints = mesh.coordinates() + u_values
    if u_values.shape[1] == 2:  # u_values is 2D
        u_values = np.insert(u_values, 2, 0, axis=1)  # make it 3d
        startPoints = np.insert(startPoints, 2, 0, axis=1)  # make it 3d
        endPoints = np.insert(endPoints, 2, 0, axis=1)  # make it 3d

    actor = shapes.Arrows(
        startPoints, endPoints, s=s, scale=scale, c=c, alpha=alpha, res=res
    )
    actor.mesh = mesh
    actor.u = u
    actor.u_values = u_values
    return actor
1093611
def bounds(sceneid):
    
    scene_params = _cbers_parse_scene_id(sceneid)
    cbers_address = "{}/{}".format(CBERS_BUCKET, scene_params["key"])

    with rasterio.open(
        "{}/{}_BAND{}.tif".format(
            cbers_address, sceneid, scene_params["reference_band"]
        )
    ) as src:
        wgs_bounds = transform_bounds(
            *[src.crs, "epsg:4326"] + list(src.bounds), densify_pts=21
        )

    info = {"sceneid": sceneid}
    info["bounds"] = list(wgs_bounds)

    return info
169525
def bounds(self):
        
        # return bounds including ONLY referenced vertices
        in_mesh = self.vertices[self.referenced_vertices]
        # get mesh bounds with min and max
        mesh_bounds = np.array([in_mesh.min(axis=0),
                                in_mesh.max(axis=0)])
        # should not be mutable
        mesh_bounds.flags.writeable = False
        return mesh_bounds
1286293
public void getBounds(Rect bounds) {
        final int r = (int) Math.ceil(mTargetRadius);
        bounds.set(-r, -r, r, r);
    }
332319
private ArrayList<Rect> calculateAllBounds(Paint paint) {
        ArrayList<Rect> list = new ArrayList<Rect>();
        //For each views (If no values then add a fake one)
        final int count = mRecyclerView.getAdapter().getItemCount();
        final int width = getWidth();
        final int halfWidth = width / 2;
        for (int i = 0; i < count; i++) {
            Rect bounds = calcBounds(i, paint);
            int w = bounds.right - bounds.left;
            int h = bounds.bottom - bounds.top;
            bounds.left = (int)(halfWidth - (w / 2f) + ((i - mCurrentPage - mPageOffset) * width));
            bounds.right = bounds.left + w;
            bounds.top = 0;
            bounds.bottom = h;
            list.add(bounds);
        }

        return list;
    }
622499
def calculateBoundingRect(self, nodes):
        
        out = QRectF()
        for node in nodes:
            rect = node.rect()
            pos = node.pos()
            
            bounding = QRectF(pos.x(), pos.y(), rect.width(), rect.height())
            out = out.united(bounding)
        
        return out
587708
def calc_bounds(xy, entity):
    
    left, top = xy
    right, bottom = left + entity.width, top + entity.height
    return [left, top, right, bottom]
55977
function GridBounds(bounds) {
  // [sw, ne]

  this.minX = Math.min(bounds[0].x, bounds[1].x);
  this.maxX = Math.max(bounds[0].x, bounds[1].x);
  this.minY = Math.min(bounds[0].y, bounds[1].y);
  this.maxY = Math.max(bounds[0].y, bounds[1].y);

}
427201
def get_bounds(pts):
    """"""
    pts_t = np.asarray(pts).T
    return np.asarray(([np.min(_pts) for _pts in pts_t],
                       [np.max(_pts) for _pts in pts_t]))
1172184
function getBoundingRect(el) {
    const clientRect = el.getBoundingClientRect();
    const bound = {
      left: clientRect.left,
      top: clientRect.top,
      width: clientRect.width,
      height: clientRect.height
    };

    let frame = el.ownerDocument.defaultView.frameElement;
    while (frame) {
      const frameBound = frame.getBoundingClientRect();
      // This computation doesn't account for more complex CSS transforms on the
      // frame (e.g. scaling or rotations).
      bound.left += frameBound.left;
      bound.top += frameBound.top;

      frame = frame.ownerDocument.frameElement;
    }
    return bound;
  }
1127962
def bounds(sceneid):
    
    scene_params = _sentinel_parse_scene_id(sceneid)
    sentinel_address = "{}/{}".format(SENTINEL_BUCKET, scene_params["key"])

    with rasterio.open("{}/preview.jp2".format(sentinel_address)) as src:
        wgs_bounds = transform_bounds(
            *[src.crs, "epsg:4326"] + list(src.bounds), densify_pts=21
        )

    info = {"sceneid": sceneid}
    info["bounds"] = list(wgs_bounds)

    return info
796978
public void clipAbsoluteBounds(Rectangle clip)
    {
        Rectangle inter = absbounds.intersection(clip);
        if (inter.width == 0 && inter.height == 0)
            displayed = false;
        else
            absbounds = inter;
    }
853350
function (camera, updateSceneBoundingBox) {
        var id = camera.__uid__;
        var renderList = this._renderLists.get(id);
        if (!renderList) {
            renderList = new RenderList();
            this._renderLists.put(id, renderList);
        }
        renderList.startCount();

        if (updateSceneBoundingBox) {
            this.viewBoundingBoxLastFrame.min.set(Infinity, Infinity, Infinity);
            this.viewBoundingBoxLastFrame.max.set(-Infinity, -Infinity, -Infinity);
        }

        var sceneMaterialTransparent = this.material && this.material.transparent || false;
        this._doUpdateRenderList(this, camera, sceneMaterialTransparent, renderList, updateSceneBoundingBox);

        renderList.endCount();

        return renderList;
    }
961655
function() {
        const bounds = this._pixelBounds();
        const pixelSize = (bounds.max.x - bounds.min.x) / this._field.nCols;

        var stride = Math.max(
            1,
            Math.floor(1.2 * this.options.vectorSize / pixelSize)
        );

        const ctx = this._getDrawingContext();
        ctx.strokeStyle = this.options.color;

        var currentBounds = this._map.getBounds();

        for (var y = 0; y < this._field.height; y = y + stride) {
            for (var x = 0; x < this._field.width; x = x + stride) {
                let [lon, lat] = this._field._lonLatAtIndexes(x, y);
                let v = this._field.valueAt(lon, lat);
                let center = L.latLng(lat, lon);
                if (v !== null && currentBounds.contains(center)) {
                    let cell = new Cell(
                        center,
                        v,
                        this.cellXSize,
                        this.cellYSize
                    );
                    this._drawArrow(cell, ctx);
                }
            }
        }
    }
1113907
function updateBounds() {
         var target = this.getScreenCanvas();
         var rect;

         if (typeof target.getBoundingClientRect === "undefined") {
           rect = {
             left: 0,
             top: 0,
             width: 0,
             height: 0
           };
         } else {
           rect = target.getBoundingClientRect();
         }

         this.parentBounds.setShape(rect.left, rect.top, rect.width, rect.height);
       }
1281948
def create_render_window(actors, callbacks, **kwargs):
    
    # Get keyword arguments
    figure_size = kwargs.get('figure_size', (800, 600))
    camera_position = kwargs.get('camera_position', (0, 0, 100))

    # Find camera focal point
    center_points = []
    for actor in actors:
        center_points.append(actor.GetCenter())
    camera_focal_point = linalg.vector_mean(*center_points)

    # Create camera
    camera = vtk.vtkCamera()
    camera.SetPosition(*camera_position)
    camera.SetFocalPoint(*camera_focal_point)

    # Create renderer
    renderer = vtk.vtkRenderer()
    renderer.SetActiveCamera(camera)
    renderer.SetBackground(1.0, 1.0, 1.0)

    # Add actors to the scene
    for actor in actors:
        renderer.AddActor(actor)

    # Render window
    render_window = vtk.vtkRenderWindow()
    render_window.AddRenderer(renderer)
    render_window.SetSize(*figure_size)

    # Render window interactor
    window_interactor = vtk.vtkRenderWindowInteractor()
    window_interactor.SetRenderWindow(render_window)

    # Add event observers
    for cb in callbacks:
        window_interactor.AddObserver(cb, callbacks[cb][0], callbacks[cb][1])  # cb name, cb function ref, cb priority

    # Render actors
    render_window.Render()

    # Set window name after render() is called
    render_window.SetWindowName("geomdl")

    # Use trackball camera
    interactor_style = vtk.vtkInteractorStyleTrackballCamera()
    window_interactor.SetInteractorStyle(interactor_style)

    # Start interactor
    window_interactor.Start()

    # Return window interactor instance
    return window_interactor