Since some multi-table Vis widgets do not extend standard Scene2D widgets, table extractors from multi-table
actors need to be changed.
482313
protected void overrideTableExtractors() {
        StandardTableTarget.MAIN.setTableExtractor(new TableExtractor() {
            @Override
            public Table extract(final Table table) {
                if (table instanceof Dialog) {
                    return ((Dialog) table).getContentTable();
                } else if (table instanceof VisDialog) {
                    return ((VisDialog) table).getContentTable();
                }
                return table;
            }
        });
        StandardTableTarget.BUTTON.setTableExtractor(new TableExtractor() {
            @Override
            public Table extract(final Table table) {
                if (table instanceof Dialog) {
                    return ((Dialog) table).getButtonTable();
                } else if (table instanceof VisDialog) {
                    return ((VisDialog) table).getButtonsTable();
                }
                return table;
            }
        });
    }
878308
protected void dirtyIndicator (SceneObjectIndicator indic)
    {
        if (indic != null) {
            Rectangle r = indic.getBounds();
            if (r != null) {
                _remgr.invalidateRegion(r);
            }
        }
    }
718620
def adapt_table_row!(parsed_table_row)
      # Saving off the original data
      parsed_table_row['cuke_modeler_parsing_data'] = Marshal::load(Marshal.dump(parsed_table_row))

      # Removing parsed data for child elements in order to avoid duplicating data which the child elements will themselves include
      parsed_table_row['cuke_modeler_parsing_data'][:cells] = nil


      parsed_table_row['line'] = parsed_table_row.delete(:location)[:line]

      parsed_table_row['cells'] = []
      parsed_table_row[:cells].each do |row|
        adapt_table_cell!(row)
      end
      parsed_table_row['cells'].concat(parsed_table_row.delete(:cells))
    end
492733
private void updateRender() {
		if (inherit.isSelected())
		{
			emitter.usePoints = Particle.INHERIT_POINTS;
			oriented.setEnabled( true );
		}
		if (quads.isSelected())
		{
			emitter.usePoints = Particle.USE_QUADS;
			oriented.setEnabled( true );
		}
		if (points.isSelected())
		{
			emitter.usePoints = Particle.USE_POINTS;
			oriented.setEnabled( false );
			oriented.setSelected( false );
		}
		
		// oriented
		if( oriented.isSelected())
			emitter.useOriented= true;
		else
			emitter.useOriented= false;
		
		// additive blending
		if( additive.isSelected())
			emitter.useAdditive= true;
		else
			emitter.useAdditive= false;
	}
1305126
def hl_table2canvas(self, w, res_dict):
        """"""
        objlist = []

        # Remove existing highlight
        if self.maskhltag:
            try:
                self.canvas.delete_object_by_tag(self.maskhltag, redraw=False)
            except Exception:
                pass

        for sub_dict in res_dict.values():
            for seqno in sub_dict:
                mobj = self._maskobjs[int(seqno) - 1]
                dat = self._rgbtomask(mobj)
                obj = self.dc.Image(0, 0, masktorgb(
                    dat, color=self.hlcolor, alpha=self.hlalpha))
                objlist.append(obj)

        # Draw on canvas
        if len(objlist) > 0:
            self.maskhltag = self.canvas.add(self.dc.CompoundObject(*objlist))

        self.fitsimage.redraw()
488614
private void updateCursorsInScene(GVRScene scene, boolean add) {
        synchronized (mCursors) {
            for (Cursor cursor : mCursors) {
                if (cursor.isActive()) {
                    if (add) {
                        addCursorToScene(cursor);
                    } else {
                        removeCursorFromScene(cursor);
                    }
                }
            }
        }
    }
1121928
def add_axes(self, interactive=None, color=None):
        
        if interactive is None:
            interactive = rcParams['interactive']
        if hasattr(self, 'axes_widget'):
            self.axes_widget.SetInteractive(interactive)
            self._update_axes_color(color)
            return
        self.axes_actor = vtk.vtkAxesActor()
        self.axes_widget = vtk.vtkOrientationMarkerWidget()
        self.axes_widget.SetOrientationMarker(self.axes_actor)
        if hasattr(self, 'iren'):
            self.axes_widget.SetInteractor(self.iren)
            self.axes_widget.SetEnabled(1)
            self.axes_widget.SetInteractive(interactive)
        # Set the color
        self._update_axes_color(color)
398754
private RectangleArranger<PlotItem> arrangeVisualizations(double width, double height) {
    if(!(width > 0. && height > 0.)) {
      LOG.warning("No size information during arrange()", new Throwable());
      return new RectangleArranger<>(1., 1.);
    }
    RectangleArranger<PlotItem> plotmap = new RectangleArranger<>(width, height);

    Hierarchy<Object> vistree = context.getVisHierarchy();
    for(It<Projector> iter2 = vistree.iterAll().filter(Projector.class); iter2.valid(); iter2.advance()) {
      Collection<PlotItem> projs = iter2.get().arrange(context);
      for(PlotItem it : projs) {
        if(it.w <= 0.0 || it.h <= 0.0) {
          LOG.warning("Plot item with improper size information: " + it);
          continue;
        }
        plotmap.put(it.w, it.h, it);
      }
    }

    nextTask: for(It<VisualizationTask> iter2 = vistree.iterAll().filter(VisualizationTask.class); iter2.valid(); iter2.advance()) {
      VisualizationTask task = iter2.get();
      if(!task.isVisible()) {
        continue;
      }
      if(vistree.iterParents(task).filter(Projector.class).valid()) {
        continue nextTask;
      }
      if(task.getRequestedWidth() <= 0.0 || task.getRequestedHeight() <= 0.0) {
        LOG.warning("Task with improper size information: " + task);
        continue;
      }
      PlotItem it = new PlotItem(task.getRequestedWidth(), task.getRequestedHeight(), null);
      it.tasks.add(task);
      plotmap.put(it.w, it.h, it);
    }
    return plotmap;
  }
693562
def _normalize(self):
        

        unique_sprite_names = set(sprite.name for sprite in self.sprites)
        if len(unique_sprite_names) < len(self.sprites):
            raise ValueError, "Sprite names must be unique"

        # sync self.sprites and self.actors
        for sprite in self.sprites:
            if sprite not in self.actors:
                self.actors.append(sprite)
        for actor in self.actors:
            if isinstance(actor, Sprite):
                if actor not in self.sprites:
                    raise ValueError, \
                        "Can't have sprite on stage that isn't in sprites"

        # normalize Scriptables
        self.stage._normalize()
        for sprite in self.sprites:
            sprite._normalize()

        # normalize actors
        for actor in self.actors:
            if not isinstance(actor, Scriptable):
                actor._normalize()

        # make Watchers if needed
        for thing in [self, self.stage] + self.sprites:
            for (name, var) in thing.variables.items():
                if not var.watcher:
                    var.watcher = kurt.Watcher(thing,
                            kurt.Block("var", name), is_visible=False)
                    self.actors.append(var.watcher)
            for (name, list_) in thing.lists.items():
                if not list_.watcher:
                    list_.watcher = kurt.Watcher(thing,
                            kurt.Block("list", name), is_visible=False)
                    self.actors.append(list_.watcher)

        # notes - line endings
        self.notes = self.notes.replace("\r\n", "\n").replace("\r", "\n")

        # convert scripts
        def convert_block(block):
            # convert block
            try:
                if isinstance(block.type, CustomBlockType):
                    if "Custom Blocks" not in self._plugin.features:
                        raise BlockNotSupported(
                                "%s doesn't support custom blocks"
                                % self._plugin.display_name)

                else: # BlockType
                    pbt = block.type.convert(self._plugin)
            except BlockNotSupported, err:
                err.message += ". Caused by: %r" % block
                err.block = block
                err.scriptable = scriptable
                err.args = (err.message,)
                if getattr(block.type, '_workaround', None):
                    block = block.type._workaround(block)
                    if not block:
                        raise
                else:
                    raise

            # convert args
            args = []
            for arg in block.args:
                if isinstance(arg, Block):
                    arg = convert_block(arg)
                elif isinstance(arg, list):
                    arg = map(convert_block, arg)
                args.append(arg)
            block.args = args

            return block

        for scriptable in [self.stage] + self.sprites:
            for script in scriptable.scripts:
                if isinstance(script, Script):
                    script.blocks = map(convert_block, script.blocks)

        # workaround unsupported features
        for feature in kurt.plugin.Feature.FEATURES.values():
            if feature not in self._plugin.features:
                for x in feature.workaround(self):
                    yield UnsupportedFeature(feature, x)

        # normalize supported features
        for feature in self._plugin.features:
            feature.normalize(self)
918243
function ParseVisualScenes (library_visual_scenes) {
  var visualScene = library_visual_scenes[0].visual_scene[0]
  var parsedJoints = {}

  // Some .dae files will export a shrunken model. Here's how to scale it
  var armatureScale = null
  visualScene.node.forEach(function (node) {
    // node.node is the location of all top level parent nodes
    if (node.node) {
      if (node.scale && node.scale.length > 0) {
        armatureScale = node.scale[0]._.split(' ').map(Number)
      }
      parsedJoints = parseJoints(node.node)
    }
    /*
    // Check for an instance controller. If one exists we have a skeleton
    if (node.instance_controller) {
    // TODO: Do I need to remove the leading `#` ?
    joints = node.instance_controller[0].skeleton
    }
    */
  })

  return {
    jointParents: parsedJoints,
    armatureScale: armatureScale
  }
}
1247103
private void fillFilterAnnotations(VisualizerInput visInput, int type) {
		List<String> displayedAnnotations = null;
		Map<String, Set<String>> displayedAnnotationsMap = null;

		switch (type) {
		case (0): {
			displayedAnnotations = EventExtractor.computeDisplayAnnotations(visInput, SNode.class);
			displayedAnnotationsMap = displayedNodeAnnotations;
			break;
		}
		case (1): {
			displayedAnnotations = computeDisplayedRelAnnotations(visInput, configurations.get(type),
					SPointingRelation.class);
			displayedAnnotationsMap = displayedPointingRelAnnotations;
			break;
		}
		case (2): {
			displayedAnnotations = computeDisplayedRelAnnotations(visInput, configurations.get(type),
					SSpanningRelation.class);
			displayedAnnotationsMap = displayedSpanningRelAnnotations;
			break;
		}
		case (3): {
			displayedAnnotations = computeDisplayedRelAnnotations(visInput, configurations.get(type),
					SDominanceRelation.class);
			displayedAnnotationsMap = displayedDominanceRelAnnotations;
			break;
		}
		default: {
			throw new IllegalArgumentException();
		}

		}

		for (String annotation : displayedAnnotations) {
			String anno = null;
			String ns = null;
			Set<String> namespaces = null;

			if (annotation.contains("::")) {
				String[] annotationParts = annotation.split("::");
				if (annotationParts.length == 2) {
					anno = annotationParts[1];
					ns = annotationParts[0];

				} else {
					throw new IllegalArgumentException(
							"The annotation string in resolver_vis_map table is not well formed.");
				}

			} else {
				anno = annotation;
			}

			if (displayedAnnotationsMap.containsKey(anno)) {
				namespaces = displayedAnnotationsMap.get(anno);
			} else {
				namespaces = new HashSet<String>();
			}

			if (ns != null) {
				namespaces.add(ns);
			}

			displayedAnnotationsMap.put(anno, namespaces);

		}

	}
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
1057720
function extractSceneRendererProps(
  props: NavigationSceneRendererProps
): NavigationSceneRendererProps {
  return {
    layout: props.layout,
    navigationState: props.navigationState,
    position: props.position,
    progress: props.progress,
    scene: props.scene,
    scenes: props.scenes,
  };
}
74946
function (sContext) {
			var oOptions = this._getContextOptions(sContext);

			if (!oOptions) {
				return this;
			}

			if (!this.isContextSensitive) {
				Log.error("The bar control you are using does not implement all the members of the IBar interface", this);
				return this;
			}

			//If this class does not gets added by the renderer, add it here
			if (!this.getRenderer().shouldAddIBarContext()) {
				this.addStyleClass(IBAR_CSS_CLASS + "-CTX");
			}

			if (this.isContextSensitive()) {
				this.addStyleClass(oOptions.contextClass);
			}

			return this;
		}
321193
void addTriangulatedStereoFeatures(View base , Motion edge , double scale ) {
		View viewA = edge.viewSrc;
		View viewB = edge.viewDst;

		boolean baseIsA = base == viewA;
		View other = baseIsA ? viewB : viewA;

		// Determine transform from other to world
		edge.a_to_b.T.scale(scale);
		Se3_F64 otherToBase = baseIsA ? edge.a_to_b.invert(null) : edge.a_to_b.copy();
		otherToBase.concat(base.viewToWorld, other.viewToWorld);

		// Convert already computed stereo 3D features and turn them into real features
		for (int i = 0; i < edge.stereoTriangulations.size(); i++) {
			Feature3D edge3D = edge.stereoTriangulations.get(i);

			int indexSrc = edge3D.obsIdx.get(0);
			int indexDst = edge3D.obsIdx.get(1);

			Feature3D world3D = baseIsA ? viewA.features3D[indexSrc] : viewB.features3D[indexDst];

			// find the 3D location of the point in world frame
			edge3D.worldPt.scale(scale);
			if( baseIsA ) {
				viewA.viewToWorld.transform(edge3D.worldPt, edge3D.worldPt);
			} else {
				edge.a_to_b.transform(edge3D.worldPt, edge3D.worldPt);
				viewB.viewToWorld.transform(edge3D.worldPt, edge3D.worldPt);
			}

			// See if the feature is already known
			if( world3D != null ) {
				// Add the other view if another feature in the other view was not already associated with this feature
				if( !world3D.views.contains(other) ) {
					world3D.views.add(other);
					world3D.obsIdx.add( baseIsA ? indexDst : indexSrc );
				}

				// Retriangulate the point if it appears that this stereo pair is better than the one which originally
				// computed it
				if( world3D.triangulationAngle >= edge3D.triangulationAngle ) {
					continue;
				}
				world3D.worldPt.set(edge3D.worldPt);
				world3D.triangulationAngle = edge3D.triangulationAngle;
				other.features3D[baseIsA ? indexDst : indexSrc] = edge3D;
			} else {
				graph.features3D.add(edge3D);
				viewA.features3D[indexSrc] = edge3D;
				viewB.features3D[indexDst] = edge3D;
			}
		}

		// free memory
		edge.stereoTriangulations = new ArrayList<>();
	}
417917
def _remove_mapper_from_plotter(plotter, actor, reset_camera):
    """"""
    try:
        mapper = actor.GetMapper()
    except AttributeError:
        return
    for name in list(plotter._scalar_bar_mappers.keys()):
        try:
            plotter._scalar_bar_mappers[name].remove(mapper)
        except ValueError:
            pass
        if len(plotter._scalar_bar_mappers[name]) < 1:
            slot = plotter._scalar_bar_slot_lookup.pop(name)
            plotter._scalar_bar_mappers.pop(name)
            plotter._scalar_bar_ranges.pop(name)
            plotter.remove_actor(plotter._scalar_bar_actors.pop(name), reset_camera=reset_camera)
            plotter._scalar_bar_slots.add(slot)
    return
1046394
def hl_canvas2table(self, canvas, button, data_x, data_y):
        """"""
        self.treeview.clear_selection()

        # Remove existing highlight
        if self.maskhltag:
            try:
                canvas.delete_object_by_tag(self.maskhltag, redraw=True)
            except Exception:
                pass

        # Nothing to do if no masks are displayed
        try:
            obj = canvas.get_object_by_tag(self.masktag)
        except Exception:
            return

        if obj.kind != 'compound':
            return

        # Nothing to do if table has no data
        if len(self._maskobjs) == 0:
            return

        for i, mobj in enumerate(self._maskobjs):
            mask1 = self._rgbtomask(mobj)

            # Highlight mask covering selected cursor position
            if mask1[int(data_y), int(data_x)]:
                self._highlight_path(self._treepaths[i])