Exemplo n.º 1
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);
        }
 public WholeShapeOptimizationModel(
     SessionData sessionData,
     SnappersManager snappersManager,
     IAnnotationConstraintsExtractor annotationConstraintsExtractor,
     PrimitivesReaderWriterFactory primitivesReaderWriterFactory)
 {
     this.sessionData     = sessionData;
     this.snappersManager = snappersManager;
     this.annotationConstraintsExtractor = annotationConstraintsExtractor;
     this.primitivesReaderWriterFactory  = primitivesReaderWriterFactory;
 }
Exemplo n.º 3
0
 public TemporarySnap(SessionData sessionData,
                      SnappersManager snappersManager,
                      PrimitivesReaderWriterFactory primitivesReaderWriterFactory,
                      IEventAggregator eventAggregator,
                      NewPrimitive newPrimitive,
                      IConstrainedOptimizer optimizer)
 {
     this.sessionData     = sessionData;
     this.snappersManager = snappersManager;
     this.primitivesReaderWriterFactory = primitivesReaderWriterFactory;
     this.eventAggregator = eventAggregator;
     this.newPrimitive    = newPrimitive;
     this.optimizer       = optimizer;
 }
Exemplo n.º 4
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);
        }