Exemple #1
0
        public Snapper(
            SessionData sessionData,
            UiState uiState,
            ILoggerFacade logger,
            IUnityContainer container,
            IEventAggregator eventAggregator)
        {
            this.sessionData     = sessionData;
            this.uiState         = uiState;
            this.logger          = logger;
            this.container       = container;
            this.eventAggregator = eventAggregator;
            this.random          = new Random();

            snappersManager = new SnappersManager(uiState, sessionData);
            snappersManager.RegisterSnapper(new ConeSnapper());
            snappersManager.RegisterSnapper(new CylinderSnapper());

            logger.Log("NewSnapper created", Category.Debug, Priority.None);
        }
Exemple #2
0
        public Snapper(
            SessionData sessionData,
            UiState uiState,
            ILoggerFacade logger,
            IEventAggregator eventAggregator,
            IAnnotationInference annotationInference,
            IConstrainedOptimizer constrainedOptimizer,
            SnapOptions snapOptions)
        {
            this.sessionData          = sessionData;
            this.eventAggregator      = eventAggregator;
            this.annotationInference  = annotationInference;
            this.constrainedOptimizer = constrainedOptimizer;
            this.snapOptions          = snapOptions;

            primitivesReaderWriterFactory = new PrimitivesReaderWriterFactory();
            var annotationConstraintsExtractor = new AnnotationConstraintsExtractor();

            snappersManager = new SnappersManager(uiState, sessionData);
            snappersManager.RegisterSnapper(new ConeSnapper());
            snappersManager.RegisterSnapper(new CylinderSnapper());
            snappersManager.RegisterSnapper(new SphereSnapper());
            snappersManager.RegisterSnapper(new SgcSnapper());
            snappersManager.RegisterSnapper(new BgcSnapper());
            snappersManager.RegisterSnapper(new CuboidSnapper());

            wholeShapeOptimizationModel = new WholeShapeOptimizationModel(sessionData, snappersManager, annotationConstraintsExtractor, primitivesReaderWriterFactory);

            eventAggregator.GetEvent <GlobalShortcutEvent>().Subscribe(OnGlobalShortcut);

            logger.Log("NewSnapper created", Category.Debug, Priority.None);
        }