2018-12-24 12:37:51 -08:00
|
|
|
from manimlib.utils.config_ops import digest_config
|
2018-01-29 13:37:17 -08:00
|
|
|
|
2018-05-09 14:03:53 -07:00
|
|
|
# Currently, this is only used by both Scene and Mobject.
|
2018-01-29 13:37:17 -08:00
|
|
|
# Still, we abstract its functionality here, albeit purely nominally.
|
|
|
|
# All actual implementation has to be handled by derived classes for now.
|
|
|
|
|
2018-05-09 14:03:53 -07:00
|
|
|
# TODO: Move the "remove" functionality of Scene to this class
|
|
|
|
|
2018-04-06 13:58:59 -07:00
|
|
|
|
2018-01-29 13:37:17 -08:00
|
|
|
class Container(object):
|
Added DocStrings for all methods in Container, Scene, GraphScene, MovingCameraScene, SceneFileWriter, ThreeDScene, SpecialThreeDScene, ZoomedScene, VectorScene, and LinearTransformationScene. (#1040)
* Added DocStrings for methods in Container and Scene.
Removed 2 unused imports from scene.py.
* Added DocStrings for all methods in GraphScene, MovingCameraScene, SceneFileWriter, ThreeDScene, SpecialThreeDScene and ZoomedScene.
* Added DocStrings for all methods in `VectorScene` and LinearTransformationScene...
...except `position_x_coordinate` and `position_y_coordinate`
Co-authored-by: Aathish Sivasubrahmanian <aathishs@Aathishs-MacBook-Air.local>
2020-05-14 11:11:22 +05:30
|
|
|
"""
|
|
|
|
Base class for Scenes and Mobjects. Generic container.
|
|
|
|
"""
|
2019-02-06 21:16:26 -08:00
|
|
|
def __init__(self, **kwargs):
|
2018-01-29 13:37:17 -08:00
|
|
|
digest_config(self, kwargs)
|
|
|
|
|
|
|
|
def add(self, *items):
|
Added DocStrings for all methods in Container, Scene, GraphScene, MovingCameraScene, SceneFileWriter, ThreeDScene, SpecialThreeDScene, ZoomedScene, VectorScene, and LinearTransformationScene. (#1040)
* Added DocStrings for methods in Container and Scene.
Removed 2 unused imports from scene.py.
* Added DocStrings for all methods in GraphScene, MovingCameraScene, SceneFileWriter, ThreeDScene, SpecialThreeDScene and ZoomedScene.
* Added DocStrings for all methods in `VectorScene` and LinearTransformationScene...
...except `position_x_coordinate` and `position_y_coordinate`
Co-authored-by: Aathish Sivasubrahmanian <aathishs@Aathishs-MacBook-Air.local>
2020-05-14 11:11:22 +05:30
|
|
|
"""
|
|
|
|
Generic method to add items to Container.
|
|
|
|
Must be implemented by subclasses.
|
|
|
|
"""
|
2018-04-06 13:58:59 -07:00
|
|
|
raise Exception(
|
|
|
|
"Container.add is not implemented; it is up to derived classes to implement")
|
2018-01-29 13:37:17 -08:00
|
|
|
|
|
|
|
def remove(self, *items):
|
Added DocStrings for all methods in Container, Scene, GraphScene, MovingCameraScene, SceneFileWriter, ThreeDScene, SpecialThreeDScene, ZoomedScene, VectorScene, and LinearTransformationScene. (#1040)
* Added DocStrings for methods in Container and Scene.
Removed 2 unused imports from scene.py.
* Added DocStrings for all methods in GraphScene, MovingCameraScene, SceneFileWriter, ThreeDScene, SpecialThreeDScene and ZoomedScene.
* Added DocStrings for all methods in `VectorScene` and LinearTransformationScene...
...except `position_x_coordinate` and `position_y_coordinate`
Co-authored-by: Aathish Sivasubrahmanian <aathishs@Aathishs-MacBook-Air.local>
2020-05-14 11:11:22 +05:30
|
|
|
"""
|
|
|
|
Generic method to remove items from Container.
|
|
|
|
Must be implemented by subclasses.
|
|
|
|
"""
|
2018-04-06 13:58:59 -07:00
|
|
|
raise Exception(
|
|
|
|
"Container.remove is not implemented; it is up to derived classes to implement")
|