コード例 #1
0
ファイル: camera.py プロジェクト: PCabralSoftware/reuleaux
    def get_mobjects_to_display(
        self, mobjects,
        include_submobjects=True,
        excluded_mobjects=None,
    ):
        if include_submobjects:
            mobjects = self.extract_mobject_family_members(
                mobjects, only_those_with_points=True
            )
            if excluded_mobjects:
                all_excluded = self.extract_mobject_family_members(
                    excluded_mobjects
                )
                mobjects = list_difference_update(mobjects, all_excluded)

        if self.use_z_coordinate_for_display_order:
            # Should perhaps think about what happens here when include_submobjects is False,
            # (for now, the onus is then on the caller to ensure this is handled correctly by
            # passing us an appropriately pre-flattened list of mobjects if need be)
            return sorted(
                mobjects,
                lambda a, b: cmp(self.z_buff_func(a), self.z_buff_func(b))
            )
        else:
            return mobjects
コード例 #2
0
 def capture_mobjects(self, mobjects, **kwargs):
     self.update_sub_cameras()
     for imfc in self.image_mobjects_from_cameras:
         to_add = list(mobjects)
         if not self.allow_cameras_to_capture_their_own_display:
             to_add = list_difference_update(to_add, imfc.get_family())
         imfc.camera.capture_mobjects(to_add, **kwargs)
     MovingCamera.capture_mobjects(self, mobjects, **kwargs)
コード例 #3
0
 def capture_mobjects(self, mobjects, **kwargs):
     self.update_sub_cameras()
     for imfc in self.image_mobjects_from_cameras:
         to_add = list(mobjects)
         if not self.allow_cameras_to_capture_their_own_display:
             to_add = list_difference_update(
                 to_add, imfc.submobject_family()
             )
         imfc.camera.capture_mobjects(to_add, **kwargs)
     MovingCamera.capture_mobjects(self, mobjects, **kwargs)
コード例 #4
0
 def get_mobjects_to_display(self,
                             mobjects,
                             include_submobjects=True,
                             excluded_mobjects=None):
     if include_submobjects:
         mobjects = self.extract_mobject_family_members(
             mobjects,
             only_those_with_points=True,
         )
         if excluded_mobjects:
             all_excluded = self.extract_mobject_family_members(
                 excluded_mobjects)
             mobjects = list_difference_update(mobjects, all_excluded)
     return mobjects
コード例 #5
0
ファイル: camera.py プロジェクト: jurjsorinliviu/manim
 def get_mobjects_to_display(
     self,
     mobjects,
     include_submobjects=True,
     excluded_mobjects=None,
 ):
     if include_submobjects:
         mobjects = self.extract_mobject_family_members(
             mobjects, only_those_with_points=True)
         if excluded_mobjects:
             all_excluded = self.extract_mobject_family_members(
                 excluded_mobjects)
             mobjects = list_difference_update(mobjects, all_excluded)
     if self.use_z_coordinate_for_display_order:
         # Should perhaps think about what happens here when include_submobjects is False,
         # (for now, the onus is then on the caller to ensure this is handled correctly by
         # passing us an appropriately pre-flattened list of mobjects if need be)
         return sorted(
             mobjects,
             lambda a, b: cmp(self.z_buff_func(a), self.z_buff_func(b)))
     else:
         return mobjects