public ModelContainer(ModelMeshAndPositionNeighbors modelMeshAndPositionNeighbors, CreateMeshContract createMeshContract) { InitializeComponent(); _modelMeshAndPositionNeighbors = modelMeshAndPositionNeighbors; _createMeshContract = createMeshContract; //smoothen two times by default const int defaultSmoothening = 2; var newMesh = GetNewModifiableMeshWithNoSmoothing(); var newModel = SmoothenProcessor.SmoothenMesh(defaultSmoothening, _modelMeshAndPositionNeighbors.PositionNeighbors, newMesh); _currentSmootheningCount = defaultSmoothening; SetSmootheningCountDisplayToCurrent(); _currentModel = new GeometryModel3D { Geometry = newModel, BackMaterial = new DiffuseMaterial(Brushes.DarkOliveGreen) }; SetNoTextureDisplay(); this.Loaded += OnLoad; }
private void InitiateModelCreation(CreateMeshContract contract) { _contract = contract; _totalImageCount = contract.ClickInputs.Angles.Length; //set the carousel display //_imageCarousel.ImagePaths = new List<string>(); //var angles = contract.ClickInputs.Angles; //for (var index = 0; index < angles.Length; index++) //{ // //var clickInput = contract.ClickInputs.ImageClickInputDetailsList[index]; // //var imagePath = string.Format(@"{0}\{1}", contract.ImageFolder, clickInput.ImageName); // //_imageCarousel.ImagePaths.Add(imagePath); //} _bw = new BackgroundWorker { WorkerReportsProgress = true, WorkerSupportsCancellation = true }; _bw.DoWork += BwDoWork; _bw.ProgressChanged += BwProgressChanged; _bw.RunWorkerCompleted += BwRunWorkerCompleted; _bw.WorkerSupportsCancellation = true; _bw.RunWorkerAsync(contract); ProcessedImageCountDisplay.Text = string.Format(ProcessingMessage, 1, _totalImageCount); }
private void ResetValues() { _folderPath = null; _clickInputs = null; _modelMeshAndPositionNeighbors = null; _createMeshContract = null; _firstImageFilePath = null; _backgroundStrippingParams = null; _meshDensity = null; }
private void SetModelDisplay(ModelMeshAndPositionNeighbors modelMeshAndPositionNeighbors, CreateMeshContract createMeshContract) { _modelMeshAndPositionNeighbors = modelMeshAndPositionNeighbors; _createMeshContract = createMeshContract; if (_processContainer != null) { //remove existing display BaseGrid.Children.Remove(_processContainer); _processContainer = null; } DisplayModelViewContainer(); }
public ProcessContainer(CreateMeshContract contract) { InitializeComponent(); InitiateModelCreation(contract); }