mirror of
https://github.com/3b1b/manim.git
synced 2025-07-27 12:03:03 +08:00

* 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>
32 lines
1022 B
Python
32 lines
1022 B
Python
from manimlib.utils.config_ops import digest_config
|
|
|
|
# Currently, this is only used by both Scene and Mobject.
|
|
# Still, we abstract its functionality here, albeit purely nominally.
|
|
# All actual implementation has to be handled by derived classes for now.
|
|
|
|
# TODO: Move the "remove" functionality of Scene to this class
|
|
|
|
|
|
class Container(object):
|
|
"""
|
|
Base class for Scenes and Mobjects. Generic container.
|
|
"""
|
|
def __init__(self, **kwargs):
|
|
digest_config(self, kwargs)
|
|
|
|
def add(self, *items):
|
|
"""
|
|
Generic method to add items to Container.
|
|
Must be implemented by subclasses.
|
|
"""
|
|
raise Exception(
|
|
"Container.add is not implemented; it is up to derived classes to implement")
|
|
|
|
def remove(self, *items):
|
|
"""
|
|
Generic method to remove items from Container.
|
|
Must be implemented by subclasses.
|
|
"""
|
|
raise Exception(
|
|
"Container.remove is not implemented; it is up to derived classes to implement")
|