Create head geometry for spectator mode.
Always created in case we want to toggle, but only visible during spectator mode.
356457
function () {
    var cameraEl = this.cameraEl;
    var headMesh;
    var leftEyeMesh;
    var rightEyeMesh;
    var leftEyeBallMesh;
    var rightEyeBallMesh;

    if (cameraEl.getObject3D('mesh') || cameraEl.getObject3D('replayerMesh')) { return; }

    // Head.
    headMesh = new THREE.Mesh();
    headMesh.geometry = new THREE.BoxBufferGeometry(0.3, 0.3, 0.2);
    headMesh.material = new THREE.MeshStandardMaterial({color: 'pink'});
    headMesh.visible = this.data.spectatorMode;

    // Left eye.
    leftEyeMesh = new THREE.Mesh();
    leftEyeMesh.geometry = new THREE.SphereBufferGeometry(0.05);
    leftEyeMesh.material = new THREE.MeshBasicMaterial({color: 'white'});
    leftEyeMesh.position.x -= 0.1;
    leftEyeMesh.position.y += 0.1;
    leftEyeMesh.position.z -= 0.1;
    leftEyeBallMesh = new THREE.Mesh();
    leftEyeBallMesh.geometry = new THREE.SphereBufferGeometry(0.025);
    leftEyeBallMesh.material = new THREE.MeshBasicMaterial({color: 'black'});
    leftEyeBallMesh.position.z -= 0.04;
    leftEyeMesh.add(leftEyeBallMesh);
    headMesh.add(leftEyeMesh);

    // Right eye.
    rightEyeMesh = new THREE.Mesh();
    rightEyeMesh.geometry = new THREE.SphereBufferGeometry(0.05);
    rightEyeMesh.material = new THREE.MeshBasicMaterial({color: 'white'});
    rightEyeMesh.position.x += 0.1;
    rightEyeMesh.position.y += 0.1;
    rightEyeMesh.position.z -= 0.1;
    rightEyeBallMesh = new THREE.Mesh();
    rightEyeBallMesh.geometry = new THREE.SphereBufferGeometry(0.025);
    rightEyeBallMesh.material = new THREE.MeshBasicMaterial({color: 'black'});
    rightEyeBallMesh.position.z -= 0.04;
    rightEyeMesh.add(rightEyeBallMesh);
    headMesh.add(rightEyeMesh);

    cameraEl.setObject3D('replayerMesh', headMesh);
  }
910658
public static OGCGeometry createFromEsriCursor(GeometryCursor gc,
			SpatialReference sr) {
		return createFromEsriCursor(gc, sr, false);
	}
710675
function(evt) {
        this.fixedRadius = !!(this.radius);
        var maploc = this.layer.getLonLatFromViewPortPx(evt.xy); 
        this.origin = new OpenLayers.Geometry.Point(maploc.lon, maploc.lat);
        // create the new polygon
        if(!this.fixedRadius || this.irregular) {
            // smallest radius should not be less one pixel in map units
            // VML doesn't behave well with smaller
            this.radius = this.map.getResolution();
        }
        if(this.persist) {
            this.clear();
        }
        this.feature = new OpenLayers.Feature.Vector();
        this.createGeometry();
        this.callback("create", [this.origin, this.feature]);
        this.layer.addFeatures([this.feature], {silent: true});
        this.layer.drawFeature(this.feature, this.style);
    }
1270496
def setViewMode( self, state = True ):
        
        if self._viewMode == state:
            return
            
        self._viewMode = state
        if state:
            self._mainView.setDragMode( self._mainView.ScrollHandDrag )
        else:
            self._mainView.setDragMode( self._mainView.RubberBandDrag )
            
        self.emitViewModeChanged()
399731
def set_geometry(im, width_height):
    
    width, height = width_height
    if not width and not height:
        return im

    im_width, im_height = im.size

    # Geometry match the current size?
    if (width is None) or (im_width == width):
        if (height is None) or (im_height == height):
            return im

    ratio = float(im_width) / im_height

    if width and height:
        new_width = width
        new_height = int(ceil(width / ratio))
        if new_height < height:
            new_height = height
            new_width = int(ceil(height * ratio))
    elif height:
        new_width = int(ceil(height * ratio))
        new_height = height
    else:
        new_width = width
        new_height = int(ceil(width / ratio))

    im.resize(new_width, new_height)
    box = get_box(new_width, new_height, width, height)
    im.crop(*box, reset_coords=True)

    return im
408359
def create_widget(self):
        
        d = self.declaration
        self.widget = SeekBar(self.get_context(), None,
                              d.style or '@attr/seekBarStyle')
717727
function(geometryModel) {
      if(geometryModel.isPoint()) {
        return new cdb.geo.gmaps.PointView(geometryModel);
      }
      return new cdb.geo.gmaps.PathView(geometryModel);
    }
1139449
def _initialize(self, show_bounds, reset_camera, outline):
        """"""
        self.plotter.subplot(*self.loc)
        if outline is None:
            self.plotter.add_mesh(self.input_dataset.outline_corners(),
                    reset_camera=False, color=vtki.rcParams['outline_color'],
                    loc=self.loc)
        elif outline:
            self.plotter.add_mesh(self.input_dataset.outline(),
                    reset_camera=False, color=vtki.rcParams['outline_color'],
                    loc=self.loc)
        # add the axis labels
        if show_bounds:
            self.plotter.show_bounds(reset_camera=False, loc=loc)
        if reset_camera:
            cpos = self.plotter.get_default_cam_pos()
            self.plotter.camera_position = cpos
            self.plotter.reset_camera()
            self.plotter.camera_set = False
962180
def init_gl(self):
        ""
        self.vr_system = openvr.init(openvr.VRApplication_Scene)
        w, h = self.vr_system.getRecommendedRenderTargetSize()
        self.left_fb = OpenVrFramebuffer(w, h, multisample=self.multisample)
        self.right_fb = OpenVrFramebuffer(w, h, multisample=self.multisample)
        self.compositor = openvr.VRCompositor()
        if self.compositor is None:
            raise Exception("Unable to create compositor") 
        self.left_fb.init_gl()
        self.right_fb.init_gl()
        # Compute projection matrix
        zNear = 0.2
        zFar = 500.0
        self.projection_left = numpy.asarray(matrixForOpenVrMatrix(self.vr_system.getProjectionMatrix(
                openvr.Eye_Left, 
                zNear, zFar)))
        self.projection_right = numpy.asarray(matrixForOpenVrMatrix(self.vr_system.getProjectionMatrix(
                openvr.Eye_Right, 
                zNear, zFar)))
        self.view_left = matrixForOpenVrMatrix(
            self.vr_system.getEyeToHeadTransform(openvr.Eye_Left)).I  # head_X_eye in Kane notation
        self.view_right = matrixForOpenVrMatrix(
            self.vr_system.getEyeToHeadTransform(openvr.Eye_Right)).I  # head_X_eye in Kane notation
        for actor in self:
            actor.init_gl()
132561
def _createGeometry(self, session, spatialReferenceID):
        
        # Flush the current session
        session.flush()

        # Create geometry for each fluvial link
        for link in self.getFluvialLinks():

            # Retrieve the nodes for each link
            nodes = link.nodes
            nodeCoordinates = []

            # Create geometry for each node
            for node in nodes:
                # Assemble coordinates in well known text format
                coordinates = '{0} {1} {2}'.format(node.x, node.y, node.elevation)
                nodeCoordinates.append(coordinates)

                # Create well known text string for point with z coordinate
                wktPoint = 'POINT Z ({0})'.format(coordinates)

                # Write SQL statement
                statement = self._getUpdateGeometrySqlString(geometryID=node.id,
                                                             tableName=node.tableName,
                                                             spatialReferenceID=spatialReferenceID,
                                                             wktString=wktPoint)

                session.execute(statement)

            # Assemble line string in well known text format
            wktLineString = 'LINESTRING Z ({0})'.format(', '.join(nodeCoordinates))

            # Write SQL statement
            statement = self._getUpdateGeometrySqlString(geometryID=link.id,
                                                         tableName=link.tableName,
                                                         spatialReferenceID=spatialReferenceID,
                                                         wktString=wktLineString)

            session.execute(statement)
1309346
def set_point_geometry(w, src):
    
    assert "pointSource" in src.tag
    geometry_node = src.nodes[get_taglist(src).index("pointGeometry")]
    point_attrs = parse_point_geometry(geometry_node)
    w.point(point_attrs["point"][0], point_attrs["point"][1])
1057237
def create_widget(self):
        
        d = self.declaration
        self.widget = FrameLayout(self.get_context(), None, d.style)
829394
function() {
        var geometry = this.point && this.point.geometry;
        if(geometry && this.multi) {
            geometry = new OpenLayers.Geometry.MultiPoint([geometry]);
        }
        return geometry;
    }
903298
def create_widget(self):
        
        d = self.declaration
        if d.orientation == 'vertical':
            self.widget = ScrollView(self.get_context(), None, d.style)
        else:
            self.widget = HorizontalScrollView(self.get_context(),
                                               None, d.style)
1197459
def _init_shape(self):
        """"""
        shape = self._par['geometry']['shape'].lower()
        aspect = self._header['aspect']
        if self.rcmb is not None and self.rcmb >= 0:
            # curvilinear
            self._shape['cyl'] = self.twod_xz and (shape == 'cylindrical' or
                                                   aspect[0] >= np.pi)
            self._shape['sph'] = not self._shape['cyl']
        elif self.rcmb is None:
            self._header['rcmb'] = self._par['geometry']['r_cmb']
            if self.rcmb >= 0:
                if self.twod_xz and shape == 'cylindrical':
                    self._shape['cyl'] = True
                elif shape == 'spherical':
                    self._shape['sph'] = True
        self._shape['axi'] = self.cartesian and self.twod_xz and \
            shape == 'axisymmetric'
1115873
def view_isometric(self):
        
        self.camera_position = self.get_default_cam_pos()
        self.camera_set = False
        return self.reset_camera()
974487
def set_geometry(self, geom):
        
        (self.thet0, self.thet, self.phi0, self.phi, self.alpha, 
            self.beta) = geom