Exemplo n.º 1
0
        public MeshTreeViewModel(MeshCollection meshList)
        {
            _meshList = meshList;
            MeshList  = new ObservableCollection <MeshViewModel>();
            RootLevel = new ObservableCollection <MeshViewModel>();


            AddMeshCommand    = new DelegateCommand(AddMesh);
            RemoveMeshCommand = new DelegateCommand <MeshViewModel>(RemoveMesh);

            // Instantiate meshes
            foreach (Mesh mesh in _meshList.meshes)
            {
                MeshViewModel mv = new MeshViewModel(mesh);
                MeshList.Add(mv);
                mv.PropertyChanged += new PropertyChangedEventHandler(Mesh_PropertyChanged);
            }


            // Linking Tree
            foreach (MeshViewModel mv in MeshList)
            {
                mv.Model.LinkToParent(_meshList.meshes);
                MeshViewModel parent = MeshList.FirstOrDefault(x => (x.Model == mv.Model.parent));
                mv.Parent = parent;
                if (mv.Parent != null)
                {
                    if (!parent.Children.Contains(mv))
                    {
                        parent.Children.Add(mv);
                    }
                }
                mv.PropertyChanged += Mv_PropertyChanged;
            }

            // Create Scene
            Scene = new OGLScene(_meshList.meshes);
        }
Exemplo n.º 2
0
        public ShipHull(ShipHullTable table)
        {
            // General
            GetFromTable(table);
            // Mesh
            interiorMeshes = new MeshCollection(table.shipInterior);
            exteriorMeshes = new MeshCollection(table.shipExterior);

            // Subsystems
            List <Subsystem> subsystemList = new List <Subsystem>();

            subsystemList.Add(new AccessoriesManager(table));
            subsystemList.Add(new AttachementsManager(table));
            subsystemList.Add(new BMS(table));
            subsystemList.Add(new CameraManager(table));
            subsystemList.Add(new COMM(table));
            subsystemList.Add(new CSSM(table));
            subsystemList.Add(new ECS(table));
            subsystemList.Add(new FCM(table));
            subsystemList.Add(new LENR(table));
            subsystemList.Add(new LSS(table));
            subsystemList.Add(new MES(table));
            subsystemList.Add(new MFD(table));
            subsystemList.Add(new MTS(table));
            subsystemList.Add(new NAS(table));
            subsystemList.Add(new RCM(table));
            subsystemList.Add(new RCS(table));
            subsystemList.Add(new RMS(table));
            subsystemList.Add(new TMS(table));
            subsystemList.Add(new VMS(table));


            subsystemList.Add(new LegacySystems());


            subsystemsManager = new SubsystemsManager(subsystemList);
        }
Exemplo n.º 3
0
 public ShipHull()
 {
     subsystemsManager = new SubsystemsManager();
     interiorMeshes    = new MeshCollection();
     exteriorMeshes    = new MeshCollection();
 }