Beispiel #1
0
    def deallocate_displists(self):
        """
        Free any allocated display lists.
        (Also clear or initialize shader primitives and all other cached
         drawing state, but not constructor parameters.)

        @note: this is part of our external API.

        @see: _clear_when_deallocate_DLs_might_be_unsafe,
              which does all possible clearing *except* for
              deallocating display lists, for use when we're not sure
              deallocating them is safe.
        """
        # With CSDL active, self.dl duplicates either selected_dl or color_dl.

        #bruce 090224 rewrote to make no assumptions about which DLs
        # are currently allocated or overlapping -- just delete all valid ones.
        DLs = {}
        for dl in [self.dl, self.color_dl, self.nocolor_dl, self.selected_dl]:
            DLs[dl] = dl
        # piotr 080420: The second level dl's are 2-element lists of DL ids
        # rather than just a list of ids. The second DL is used in case
        # of multi-color objects and is required for highlighting
        # and selection (not in rc1)
        for clr_junk, dls in self._per_color_dls:  # Second-level dl's.
            for dl in dls:  # iterate over DL pairs.
                DLs[dl] = dl
        for dl in DLs:
            if dl:  # skip 0 or None (not sure if None ever happens)
                glDeleteLists(dl, 1)
            continue
        self._clear_when_deallocate_DLs_might_be_unsafe()
        return
    def deallocate_displists(self):
        """
        Free any allocated display lists.
        (Also clear or initialize shader primitives and all other cached
         drawing state, but not constructor parameters.)

        @note: this is part of our external API.

        @see: _clear_when_deallocate_DLs_might_be_unsafe,
              which does all possible clearing *except* for
              deallocating display lists, for use when we're not sure
              deallocating them is safe.
        """
        # With CSDL active, self.dl duplicates either selected_dl or color_dl.

        # bruce 090224 rewrote to make no assumptions about which DLs
        # are currently allocated or overlapping -- just delete all valid ones.
        DLs = {}
        for dl in [self.dl, self.color_dl, self.nocolor_dl, self.selected_dl]:
            DLs[dl] = dl
        # piotr 080420: The second level dl's are 2-element lists of DL ids
        # rather than just a list of ids. The second DL is used in case
        # of multi-color objects and is required for highlighting
        # and selection (not in rc1)
        for clr_junk, dls in self._per_color_dls:  # Second-level dl's.
            for dl in dls:  # iterate over DL pairs.
                DLs[dl] = dl
        for dl in DLs:
            if dl:  # skip 0 or None (not sure if None ever happens)
                glDeleteLists(dl, 1)
            continue
        self._clear_when_deallocate_DLs_might_be_unsafe()
        return
Beispiel #3
0
 def __del__(self):
     if DEBUG:
         print("Deleting object %s" % self.name())
     for key in self.drawListDict.keys():
         if key.upper() != "NONE":
             if self.drawListDict[key] > 0:
                 glDeleteLists(self.drawListDict[key], 1)
     del self._privateConfigurationWidget
     try:
         Object3DBase.Object3D.__del__(self)
     except AttributeError:
         pass
Beispiel #4
0
 def __del__(self):
     if DEBUG:
         print("Deleting object %s" % self.name())
     for key in self.drawListDict.keys():
         if key.upper() != "NONE":
             if self.drawListDict[key] > 0:
                 glDeleteLists(self.drawListDict[key], 1)
     del self._privateConfigurationWidget
     try:
         Object3DBase.Object3D.__del__(self)
     except AttributeError:
         pass
Beispiel #5
0
 def deallocate_displists(self):
     """
     Free any allocated display lists.
     """
     # With CSDL active, self.dl duplicates either selected_dl or color_dl.
     if (self.dl is not self.color_dl and
         self.dl is not self.selected_dl):
         glDeleteLists(self.dl, 1)
     for dl in [self.color_dl, self.nocolor_dl, self.selected_dl]:
         if dl != 0:
             glDeleteLists(dl, 1) 
             pass
         continue
     # piotr 080420: The second level dl's are 2-element lists of DL ids 
     # rather than just a list of ids. The second DL is used in case
     # of multi-color objects and is required for highlighting 
     # and selection (not in rc1)
     for clr, dls in self.per_color_dls: # Second-level dl's.
         for dl in dls: # iterate over DL pairs.
             if dl != 0:
                 glDeleteLists(dl, 1) 
                 pass
             continue
     self.clear()
     return
Beispiel #6
0
 def deallocate_displists(self):
     """
     Free any allocated display lists.
     """
     # With CSDL active, self.dl duplicates either selected_dl or color_dl.
     if (self.dl is not self.color_dl and self.dl is not self.selected_dl):
         glDeleteLists(self.dl, 1)
     for dl in [self.color_dl, self.nocolor_dl, self.selected_dl]:
         if dl != 0:
             glDeleteLists(dl, 1)
             pass
         continue
     # piotr 080420: The second level dl's are 2-element lists of DL ids
     # rather than just a list of ids. The second DL is used in case
     # of multi-color objects and is required for highlighting
     # and selection (not in rc1)
     for clr, dls in self.per_color_dls:  # Second-level dl's.
         for dl in dls:  # iterate over DL pairs.
             if dl != 0:
                 glDeleteLists(dl, 1)
                 pass
             continue
     self.clear()
     return
Beispiel #7
0
 def delete_list(self, l):
     glDeleteLists(l, 1)
     if l in self.names:
         del self.names[l]
Beispiel #8
0
 def free_display_list():
     glDeleteLists(gl_id, 1)
 def free_display_list():
     glDeleteLists(gl_id, 1)
Beispiel #10
0
 def delete_list(self, l):
     glDeleteLists(l, 1)
     if l in self.names:
         del self.names[l]
Beispiel #11
0
 def __del__(self):
     try:
         glDeleteLists( self.id, 1 )
     except TypeError:
         pass
Beispiel #12
0
 def __del__(self):
     if self._glID:
         glDeleteLists(self._glID,1)