public static Node BuildSubShape(Document document, Node referenceShape, TopAbsShapeEnum shapeType,
                                         int faceNumber, bool visible)
        {
            // Build subshape targeting a parent node
            var builder = new NodeBuilder(document, FunctionNames.SubShape, DisplayedShapeNames.Face);
            var node    = builder.Node;

            // Attach the shape containing the face on which the Extrusion is applied
            builder[0].Reference = referenceShape;
            // Save the number of the face on which the extrusion is applied
            builder[1].Integer = faceNumber;
            builder[2].Integer = (int)shapeType;

            if (!builder.ExecuteFunction())
            {
                return(null);
            }

            builder.Node.Set <TreeViewVisibilityInterpreter>();
            // Attach an integer attribute to L to memorize it's not displayed
            if (!visible)
            {
                NodeUtils.Hide(builder.Node);
            }
            else
            {
                NodeUtils.Show(builder.Node);
            }
            return(node);
        }
Beispiel #2
0
 public static TopoDSShape ExtractSubShape(
     Node nodeShape,
     int facePosition,
     TopAbsShapeEnum shapeType)
 {
     return(ExtractSubShape(ExtractShape(nodeShape), facePosition, shapeType));
 }
Beispiel #3
0
        public static TopoDSShape ExtractSubShape(
            TopoDSShape originalShape,
            int facePosition,
            TopAbsShapeEnum shapeType)
        {
            if (originalShape == null)
            {
                return(null);
            }
            // Find the face
            var baseEx = new TopExpExplorer();

            baseEx.Init(originalShape, shapeType, TopAbsShapeEnum.TopAbs_SHAPE);

            while (baseEx.More && (facePosition != 1))
            {
                baseEx.Next();
                facePosition--;
            }
            //if (!baseEx.More())
            //    return null;
            TopoDSShape shape = null;

            switch (shapeType)
            {
            case TopAbsShapeEnum.TopAbs_VERTEX:
                shape = TopoDS.Vertex(baseEx.Current);
                break;

            case TopAbsShapeEnum.TopAbs_EDGE:
                shape = TopoDS.Edge(baseEx.Current);
                break;

            case TopAbsShapeEnum.TopAbs_WIRE:
                shape = TopoDS.Wire(baseEx.Current);
                break;

            case TopAbsShapeEnum.TopAbs_FACE:
                shape = TopoDS.Face(baseEx.Current);
                break;

            case TopAbsShapeEnum.TopAbs_SOLID:
            case TopAbsShapeEnum.TopAbs_COMPOUND:
                return(originalShape);
            }
            return(shape);
        }
        public void SwitchSelectionMode(TopAbsShapeEnum selectionMode)
        {
            CurrentSelectionMode = selectionMode;
            CleanupDetectionEnvironment();

            if (selectionMode == TopAbsShapeEnum.TopAbs_SOLID)
            {
                return;
            }

            if (Context == null)
            {
                return;
            }
            Context.OpenLocalContext(true, true, false, false);
            Context.ActivateStandardMode(selectionMode);
        }
 public void Check(TopAbsShapeEnum T, TopoDSShape S)
 {
     BRepTools_ShapeSet_Check6E774DE2(Instance, (int)T, S.Instance);
 }
Beispiel #6
0
 public static void MapShapesAndAncestors(TopoDSShape S, TopAbsShapeEnum TS, TopAbsShapeEnum TA, TopToolsIndexedDataMapOfShapeListOfShape M)
 {
     TopExp_MapShapesAndAncestors1E6131DC(S.Instance, (int)TS, (int)TA, M.Instance);
 }
Beispiel #7
0
 public static void MapShapes(TopoDSShape S, TopAbsShapeEnum T, TopToolsIndexedMapOfShape M)
 {
     TopExp_MapShapes9B2ADE8F(S.Instance, (int)T, M.Instance);
 }
 public static int SelectionMode(TopAbsShapeEnum aShapeType)
 {
     return(AIS_Shape_SelectionModeC6FD32C4((int)aShapeType));
 }
Beispiel #9
0
 public bool ActsOn(TopAbsShapeEnum aStandardMode)
 {
     return(SelectMgr_Filter_ActsOnC6FD32C4(Instance, (int)aStandardMode));
 }
Beispiel #10
0
 protected void ClearSelectionList(TopAbsShapeEnum selectMode)
 {
     Selection[selectMode].Clear();
 }
Beispiel #11
0
 protected void InitSelectionList(TopAbsShapeEnum selectMode)
 {
     Selection[selectMode] = new List <SceneSelectedEntity>();
 }
Beispiel #12
0
 public List <SceneSelectedEntity> this[TopAbsShapeEnum selectionMode]
 {
     get { return(!Selection.ContainsKey(selectionMode) ? null : Selection[selectionMode]); }
 }
Beispiel #13
0
 public void Init(TopoDSShape S, TopAbsShapeEnum ToFind, TopAbsShapeEnum ToAvoid)
 {
     TopExp_Explorer_InitBEBE8016(Instance, S.Instance, (int)ToFind, (int)ToAvoid);
 }
Beispiel #14
0
 public TopExpExplorer(TopoDSShape S, TopAbsShapeEnum ToFind, TopAbsShapeEnum ToAvoid)
     :
     base(TopExp_Explorer_CtorBEBE8016(S.Instance, (int)ToFind, (int)ToAvoid))
 {
 }
 private void InitializePipe()
 {
     PreviousSelectionMode = TopAbsShapeEnum.TopAbs_SOLID;
 }