public static ISceneNode AddChild(IStoryService storyService, ICommonNodeFactory commonNodeFactory, int parent, object transaction) { storyService.OnBeginTransaction(transaction); var newNode = commonNodeFactory.StoryNode(); if (storyService.GlobalGraph.Leaves.Contains(parent)) { var nexts = storyService.GlobalGraph.Next[parent].ToArray(); var prevs = storyService.GlobalGraph.Previous[parent].ToArray(); foreach (var prev in prevs) { storyService.RemoveEdge(prev, parent); } foreach (var next in nexts) { storyService.RemoveEdge(parent, next); } storyService.GlobalGraph.NodeObjects[parent].ChildNodes.Add(newNode); foreach (var prev in prevs) { storyService.AddEdge(prev, newNode.Id); } foreach (var next in nexts) { storyService.AddEdge(newNode.Id, next); } } else { storyService.GlobalGraph.NodeObjects[parent].ChildNodes.Add(newNode); } storyService.OnEndTransaction(transaction); return(newNode); }
public StoryBranchIntoTool(int from, IRayHitIndex rayHitIndex, IToolService toolService, IStoryService storyService, ICommonNodeFactory commonNodeFactory) { this.from = from; this.rayHitIndex = rayHitIndex; this.toolService = toolService; this.storyService = storyService; this.commonNodeFactory = commonNodeFactory; }
public DefaultStateInitializer(IViewService viewService, IWorldTreeService worldTreeService, Lazy <IAppModeService> appModeServiceLazy, ICommonNodeFactory commonNodeFactory, IAmDiBasedObjectFactory objectFactory, IStoryService storyService, IGui gui) { this.viewService = viewService; this.worldTreeService = worldTreeService; this.appModeServiceLazy = appModeServiceLazy; this.commonNodeFactory = commonNodeFactory; this.objectFactory = objectFactory; this.storyService = storyService; this.gui = gui; }
protected RectangleComponent(ICommonNodeFactory commonNodeFactory, Lazy <IAppModeService> appModeServiceLazy, IViewService viewService) { this.appModeServiceLazy = appModeServiceLazy; hittable = new RectangleHittable <RectangleComponent>(this, Transform.Identity, c => c.Rectangle, c => 0); editInteractionElems = new IInteractionElement[] { new SelectOnClickInteractionElement(this, viewService), new EditRectangleInteractionElement(this, commonNodeFactory), }; }
protected EditingView(ICommonNodeFactory commonNodeFactory, INavigationService navigationService) { this.navigationService = navigationService; FocusNode = commonNodeFactory.WorldRoot(false); var scene = Scene.Create(FocusNode); mainLayer = new ViewLayer { VisibleScene = scene, Camera = new PlaneOrthoBoundControlledCamera(FocusNode, PlaneOrthoBoundControlledCamera.Props.Default, false) }; Layers = new[] { mainLayer }; }
public DebugVrPresentationView(INavigationService navigationService, IStoryService storyService, IUserQueryService userQueryService, ICommonNodeFactory commonNodeFactory, IAppModeService appModeService, IGlobalObjectService globalObjectService) { this.navigationService = navigationService; this.storyService = storyService; this.userQueryService = userQueryService; this.appModeService = appModeService; uiCarrier = globalObjectService.UICarrier; uiCanvas = uiCarrier.EnumerateChildren().Single(); var canvasTransform = uiCanvas.GetComponent <RectTransform>(); canvasTransform.sizeDelta = new Vector2(Screen.width, Screen.height); mainLayer = new ViewLayer(); Layers = new[] { mainLayer }; }
protected StoryComponent(IViewService viewService, ICommonNodeFactory commonNodeFactory, IToolService toolService, IToolFactory toolFactory, IRenderService renderService, Lazy <IStoryService> storyGraphServiceLazy, INavigationService navigationService, Lazy <IAppModeService> appModeServiceLazy) { this.viewService = viewService; this.commonNodeFactory = commonNodeFactory; this.toolService = toolService; this.toolFactory = toolFactory; this.renderService = renderService; this.storyGraphServiceLazy = storyGraphServiceLazy; this.navigationService = navigationService; this.appModeServiceLazy = appModeServiceLazy; ShowAux1 = true; ShowAux2 = true; selectInteractionElement = new SelectOnClickInteractionElement(this, viewService); focusInteractionElement = new FocusOnDoubleClickInteractionElement(this); navigateInteractionElement = new NavigateOnDoubleClickInteractionElement(this, navigationService); }
protected PresentationView(INavigationService navigationService, IStoryService storyService, IUserQueryService userQueryService, ICommonNodeFactory commonNodeFactory, IAppModeService appModeService) { this.navigationService = navigationService; this.storyService = storyService; this.userQueryService = userQueryService; this.appModeService = appModeService; mainLayer = new ViewLayer(); userQueryLayer = new ViewLayer(); Layers = new[] { mainLayer, userQueryLayer }; querySceneComponent = AmFactory.Create <UserQuerySceneComponent>(); var uqSceneRoot = commonNodeFactory.WorldRoot(false); uqSceneRoot.Components.Add(querySceneComponent); var uqScene = Scene.Create(uqSceneRoot); var uqCamera = new PlaneOrthoBoundControlledCamera(uqSceneRoot, PlaneOrthoBoundControlledCamera.Props.Default, false); userQueryLayer.VisibleScene = uqScene; userQueryLayer.Camera = uqCamera; }
public AddRectangleTool(IToolService toolService, IUndoRedoService undoRedo, ICommonNodeFactory commonNodeFactory, IAmDiBasedObjectFactory objectFactory, IImage image, IMovie movie, bool text) { this.toolService = toolService; this.undoRedo = undoRedo; if (text) { entity = commonNodeFactory.RichTextRectangle(objectFactory.Create <RichText>()); } else if (movie != null) { entity = commonNodeFactory.MovieRectangleNode(movie); } else if (image != null) { entity = commonNodeFactory.ImageRectangleNode(image); } else { entity = commonNodeFactory.ColorRectangleNode(GetRandomSaturatedColor()); } rectangleComponent = entity.GetComponent <IRectangleComponent>(); if (movie != null) { aspectRatio = (float)movie.Width / Math.Max(movie.Height, 1); preserveAspectRatio = true; } else if (image != null) { aspectRatio = (float)image.Size.Width / Math.Max(image.Size.Height, 1); preserveAspectRatio = true; } state = State.Ready; }
public PptxPresentationImporter(ICommonNodeFactory commonNodeFactory) { this.commonNodeFactory = commonNodeFactory; }
public EditRectangleInteractionElement(ISceneNodeBound master, ICommonNodeFactory commonNodeFactory) { this.master = master; this.commonNodeFactory = commonNodeFactory; }