public void DisplaySceneInTree() { if (sceneTreeView.InvokeRequired) { //If an invoke is required because we are running on a different thread //we make an instance of the delegate here, once Invoke is called this method //will be called again, this time in the context of the called thread //when that occurs, InvokeRequired will then have a value of 'false' //and we can then update the scenetree with the latest scene information var d = new ThreadSafeDisplaySceneElements(DisplaySceneInTree); sceneTreeView.Invoke(d, Array.Empty <object>()); } else { //grab the scene _application = (PulsarApplication)_renderScene.DrawingSurface.Application; if (_application != null) { _scene = _application.DisplayScene; _sceneTree.CurrentScene = _scene; _sceneTree.DisplaySceneElements(); } } }
public Gizmo(string name, PulsarScene scene, Node gizmoNode, BaseEntity baseEntity) { _name = name; _scene = scene; _gizmoNode = gizmoNode; BaseEntity = baseEntity; }
private void Pulsar_Shown(object sender, EventArgs e) { PulsarApplication pulsarApplication = (PulsarApplication)_formRenderScene.DrawingSurface.Application; if (pulsarApplication != null) { _formSceneTree.MainApplication = pulsarApplication; _scene = pulsarApplication.DisplayScene; _pulsarExtendedProperties.MainApplication = pulsarApplication; _pulsarExtendedProperties.Scene = _scene; pulsarApplication.ApplicationForms.Add(_formRenderScene); pulsarApplication.ApplicationForms.Add(_formSceneTree); pulsarApplication.ApplicationForms.Add(_pulsarExtendedProperties); pulsarApplication.ApplicationForms.Add(_pulsarAssets); } DisplaySceneInTree(); Resize += Main_Resize; //registration for messages Registrant registrant = new Registrant { Subscriber = this, Type = PulsarMessage.MessageType.ClearSelectedObjects }; }
public BoxEntity(string name, PulsarScene scene, DebugRenderer debugRenderer, bool inDesign) { _name = name; _scene = scene; if (_scene != null) { _node = _scene.CreateChild(_name); if (_node != null) { _baseEntity = _node.CreateComponent <BaseEntity>(); _baseEntity.Name = name; _baseEntity.Node = _node; _baseEntity.PulsarScene = scene; _baseEntity.SetDebugRenderer(debugRenderer); InDesign = inDesign; _baseEntity.InDesign = inDesign; base.BaseEntity = _baseEntity; CreateEntity(); } } PulsarComponentClass = ComponentClass.Node; PulsarComponentType = ComponentType.NodeProperties; RegisterForMessages(); }
public PyramidEntity(PulsarScene scene, PulsarApplication application, DebugRenderer debugRenderer) { _scene = scene; _application = application; _debugRenderer = debugRenderer; CreateEntity(); }
public static void SetAsSelected(Node node, Gizmo gizmo, PulsarScene scene) { StaticModel nodeModel = node.GetComponent <StaticModel>(); if (nodeModel != null && scene != null) { PulsarApplication pulsarApplication = scene.GetApplication(); if (pulsarApplication != null) { MaterialTemp tempMaterial = new MaterialTemp(nodeModel, pulsarApplication); if (tempMaterial != null) { tempMaterial.Name = "materialTemp"; try { tempMaterial.SetTransparentMaterial(); } catch (PulsarGizmoException gizmoException) { gizmoException.Source = "[GizmoHelper:SetAsSelected]"; throw gizmoException; } node.AddComponent(tempMaterial); if (gizmo != null) { gizmo.Node.Position = node.Position; gizmo.SetGizmoVisible(true); gizmo.Node.Enabled = true; } } } } }
public BaseEntity(string name, PulsarScene scene, DebugRenderer debugRenderer, Vector3 position, Vector3 rotation, Vector3 scale) { _components = new List <PulsarComponent>(); _componentProperties = new List <PulsarComponent>(); _name = name; _scene = scene; _debugRenderer = debugRenderer; if (scene != null) { _node = scene.CreateChild(_name); if (_node != null) { _node.AddComponent(this); _pulsarActions = new PulsarActions(_node); } } SetPosition(position); SetRotation(rotation); SetScale(scale); CreateEntity(); ReceiveSceneUpdates = true; }
public BaseEntity(string name, PulsarScene scene) { _components = new List <PulsarComponent>(); _componentProperties = new List <PulsarComponent>(); _name = name; _scene = scene; if (scene != null) { _node = scene.CreateChild(_name); if (_node != null) { _node.AddComponent(this); } } }
public BaseEntity(string name, PulsarScene scene) { _components = new List <PulsarComponent>(); _componentProperties = new List <PulsarComponent>(); _name = name; _scene = scene; if (scene != null) { _node = scene.CreateChild(_name); if (_node != null) { _node.AddComponent(this); _pulsarActions = new PulsarActions(_node); } } ReceiveSceneUpdates = true; }
public BaseEntity(string name, PulsarScene scene, DebugRenderer debugRenderer, Vector3 position) { _components = new List <PulsarComponent>(); _componentProperties = new List <PulsarComponent>(); _name = name; _scene = scene; _debugRenderer = debugRenderer; if (scene != null) { _node = scene.CreateChild(_name); if (_node != null) { _node.AddComponent(this); } } SetPosition(position); CreateEntity(); }
public static void SetAsSelected(Node node, Gizmo gizmo, PulsarScene scene) { StaticModel nodeModel = node.GetComponent <StaticModel>(); if (nodeModel != null) { MaterialTemp tempMaterial = new MaterialTemp(nodeModel, scene.GetApplication()); if (tempMaterial != null) { tempMaterial.Name = "materialTemp"; tempMaterial.SetTransparentMaterial(); node.AddComponent(tempMaterial); if (gizmo != null) { gizmo.Node.Position = node.Position; Debug.Print("GizmoHelper.SetAsSelected - Calling gizmo.SetGizmoVisible with value true for gizmo '" + gizmo.Name); gizmo.SetGizmoVisible(true); Debug.Print("GizmoHelper.SetAsSelected - Setting gizmo.Node.Enabled to true for gizmo '" + gizmo.Name); gizmo.Node.Enabled = true; } } } }
public PyramidEntity(PulsarScene scene) { _scene = scene; CreateEntity(); }
public Gizmo(string name, PulsarScene scene, Node gizmoNode) { _name = name; _scene = scene; _gizmoNode = gizmoNode; }
public Gizmo(PulsarScene scene) { _scene = scene; }
public void SetScene(PulsarScene scene) { _scene = scene; }
public PyramidEntity(PulsarScene scene, PulsarApplication application) { _scene = scene; _application = application; CreateEntity(); }
public WirePlane(string name, PulsarScene pulsarScene) { _name = name; _scene = pulsarScene; }
public TorusEntity(PulsarScene scene) { _scene = scene; CreateEntity(); }