private void BuildLocalContextSelections()
        {
            List <SceneSelectedEntity> detectedShapes;
            var geomUtilsWrapper = new GeomUtilsWrapper();

            if (CurrentSelectionMode == TopAbsShapeEnum.TopAbs_FACE)
            {
                detectedShapes = geomUtilsWrapper.IdentifyDetectedNodes(Document.Root);
                if (detectedShapes.Count > 0)
                {
                    Selection[CurrentSelectionMode].AddRange(detectedShapes);
                }
            }
            if ((CurrentSelectionMode != TopAbsShapeEnum.TopAbs_EDGE) &&
                (CurrentSelectionMode != TopAbsShapeEnum.TopAbs_VERTEX))
            {
                return;
            }
            detectedShapes = geomUtilsWrapper.IdentifySelectedNodes(Document.Root);
            if (detectedShapes.Count > 0)
            {
                Selection[CurrentSelectionMode].AddRange(detectedShapes);
                return;
            }
            detectedShapes = geomUtilsWrapper.IdentifyDetectedNodes(Document.Root);
            if (detectedShapes.Count > 0)
            {
                Selection[CurrentSelectionMode].AddRange(detectedShapes);
            }
        }
Exemple #2
0
        public void SwitchSelectionModeTest()
        {
            var geomUtils          = new GeomUtilsWrapper();
            var selectionContainer = new SelectionContainer(geomUtils);

            selectionContainer.SwitchSelectionMode(TopAbsShapeEnum.TopAbs_FACE);
            Assert.IsTrue(selectionContainer.CurrentSelectionMode == TopAbsShapeEnum.TopAbs_FACE,
                          "switch selection mode not working");
        }
Exemple #3
0
        public override void OnRegister()
        {
            base.OnRegister();
            MapInputs();
            MapNotifications();

            var geomUtilsWrapper = new GeomUtilsWrapper();

            _selectionContainer = new SelectionContainer(geomUtilsWrapper);

            Enabled = true;
        }
Exemple #4
0
        public void SelectionContainerInitTest()
        {
            var geomUtils          = new GeomUtilsWrapper();
            var selectionContainer = new SelectionContainer(geomUtils);

            Assert.IsTrue(selectionContainer[TopAbsShapeEnum.TopAbs_VERTEX] != null,
                          "selection container vertex list not initialized properly");
            Assert.IsTrue(selectionContainer[TopAbsShapeEnum.TopAbs_EDGE] != null,
                          "selection container edge list not initialized properly");
            Assert.IsTrue(selectionContainer[TopAbsShapeEnum.TopAbs_FACE] != null,
                          "selection container face list not initialized properly");
            Assert.IsTrue(selectionContainer[TopAbsShapeEnum.TopAbs_SOLID] != null,
                          "selection container solid list not initialized properly");
        }
 public SelectionContainer(GeomUtilsWrapper geomUtilsWrapper)
 {
     InitSelectionContainer();
     _geomUtilsWrapper = geomUtilsWrapper;
 }