コード例 #1
0
 def _currentStructureParams(self):
     """
     Return current structure parameters of interest to self.model_changed. 
     Right now it only returns the number of nanotubes within the structure
     (or None). This is a good enough check (and no need to compare 
     each and every nanotube within the structure with a previously stored 
     set of strands).
     """
     params = None
     
     if self.command: # and self.command.hasValidStructure():
         nanotubeSegmentList = []
         nanotubeSegmentList = getAllNanotubeSegmentsInPart(self.win.assy)
         params = len(nanotubeSegmentList)
     
     return params
コード例 #2
0
    def _currentStructureParams(self):
        """
        Return current structure parameters of interest to self.model_changed.
        Right now it only returns the number of nanotubes within the structure
        (or None). This is a good enough check (and no need to compare
        each and every nanotube within the structure with a previously stored
        set of strands).
        """
        params = None

        if self.command:  # and self.command.hasValidStructure():
            nanotubeSegmentList = []
            nanotubeSegmentList = getAllNanotubeSegmentsInPart(self.win.assy)
            params = len(nanotubeSegmentList)

        return params
コード例 #3
0
    def updateNanotubesListWidget(self):
        """
        Updates the nanotubes (selection) groupbox. This includes both the
        nanotube selection list widget (showing all nanotubes in the part)
        and the B{Edit Properties} button just below it (enabled if only
        one of the nanotubes is selected).
        """
        nanotubeSegmentList = getAllNanotubeSegmentsInPart(self.win.assy)

        if nanotubeSegmentList:
            self.nanotubeListWidget.insertItems(row=0, items=nanotubeSegmentList)
        else:
            self.nanotubeListWidget.clear()

        self.updateNanotubePropertiesButton()
        return
コード例 #4
0
    def updateNanotubesListWidget(self):
        """
        Updates the nanotubes (selection) groupbox. This includes both the
        nanotube selection list widget (showing all nanotubes in the part)
        and the B{Edit Properties} button just below it (enabled if only
        one of the nanotubes is selected).
        """
        nanotubeSegmentList = getAllNanotubeSegmentsInPart(self.win.assy)

        if nanotubeSegmentList:
            self.nanotubeListWidget.insertItems(row=0,
                                                items=nanotubeSegmentList)
        else:
            self.nanotubeListWidget.clear()

        self.updateNanotubePropertiesButton()
        return