Пример #1
0
        self.group = group

    def apply(self, skelcontext, boundary):
        skelobj = skelcontext.getObject()
        node_set = skelcontext.nodes_from_node_aggregate(self.group)
        skelcontext.addNodesToBdy(boundary, node_set)


registeredclass.Registration(
    "Add nodes",
    BoundaryModifier,
    AddNodes,
    ordering=302,
    targets=(skeletonboundary.SkelContextPointBoundary, ),
    params=[
        skeletongroupparams.NodeAggregateParameter(
            'group', tip="The nodes to add to the boundary.")
    ],
    tip="Add a set of nodes to an existing point boundary.",
    discussion=xmlmenudump.loadFile('DISCUSSIONS/engine/reg/add_nodes.xml'))


class RemoveNodes(BoundaryModifier):
    def __init__(self, group):
        self.group = group

    def apply(self, skelcontext, boundary):
        node_set = skelcontext.nodes_from_node_aggregate(self.group)
        skelcontext.removeNodesfromBdy(boundary, node_set)


registeredclass.Registration(
Пример #2
0
        if config.dimension() == 2:
            (startnode, seg_list) = _segset2seglist(seg_set, self.direction,
                                                    skelobj)
            skelcontext.createEdgeBoundary(name, seg_list, startnode)
        else:  # 3D
            segmentsequence = _segset2seglist3D(seg_set, self.direction)
            skelcontext.createEdgeBoundary3D(name, segmentsequence)


registeredclass.Registration(
    "Edge boundary from nodes",
    BoundaryConstructor,
    EdgeFromNodes,
    ordering=_edgeBdyConstructor + _nodeBdySource,
    params=[
        skeletongroupparams.NodeAggregateParameter(
            'group', tip="Node group from which to deduce segments"),
        director.DirectorParameter('direction',
                                   director0,
                                   tip="Direction of Boundary.")
    ],
    tip="Construct an edge boundary from a collection of nodes.",
    discussion=xmlmenudump.loadFile(
        'DISCUSSIONS/engine/reg/edge_from_nodes.xml'))

# ## ### #### ##### ###### ####### ######## ####### ###### ##### #### ### ## #


# Point boundary construction can be done from either
# segments or nodes, both cases are very simple.
class PointFromNodes(BoundaryConstructor):
    def __init__(self, group):