# Path: webalchemy/config.py
# DEFAULT_SETTINGS = {
#     'SERVER_STATIC_PATH': 'static',
#     'SERVER_PORT': 8080,
#     'SERVER_SSL_CERT': None,
#     'SERVER_SSL_KEY': None,
#     'SERVER_MONITORED_FILES': None,
#     'SERVER_MAIN_ROUTE': None,
#     'FREEZE_OUTPUT': None,
# }
# def read_config_from_app(app):
# def from_object(obj):
# def from_pyfile(filename, root=None):
# def from_envvar(variable_name):
# def from_dict(d):
#     def __init__(self, **kwargs):
#     def from_object(self, obj):
#     def from_pyfile(self, filename, root=None):
#     def from_envvar(self, variable_name):
#     def from_dict(self, d):
# class Config(dict):


from webalchemy import config

FREEZE_OUTPUT = 'webglearth.html'


class Earth:

    def __init__(self):
        self.width = window.innerWidth
        self.height = window.innerHeight

        # Earth params
        self.radius = 0.5
        self.segments = 64
        self.rotation = 6

        self.scene = new(THREE.Scene)

        self.camera = new(THREE.PerspectiveCamera, 45, self.width / self.height, 0.01, 1000)
        self.camera.position.z = 1.5

        self.renderer = new(THREE.WebGLRenderer)
        self.renderer.setSize(self.width, self.height)

        self.scene.add(new(THREE.AmbientLight, 0x333333))

        self.light = new(THREE.DirectionalLight, 0xffffff, 1)
        self.light.position.set(5, 3, 5)
        self.scene.add(self.light)

        self.sphere = self.createSphere(self.radius, self.segments)

# Path: webalchemy/config.py
# DEFAULT_SETTINGS = {
#     'SERVER_STATIC_PATH': 'static',
#     'SERVER_PORT': 8080,
#     'SERVER_SSL_CERT': None,
#     'SERVER_SSL_KEY': None,
#     'SERVER_MONITORED_FILES': None,
#     'SERVER_MAIN_ROUTE': None,
#     'FREEZE_OUTPUT': None,
# }
# def read_config_from_app(app):
# def from_object(obj):
# def from_pyfile(filename, root=None):
# def from_envvar(variable_name):
# def from_dict(d):
#     def __init__(self, **kwargs):
#     def from_object(self, obj):
#     def from_pyfile(self, filename, root=None):
#     def from_envvar(self, variable_name):
#     def from_dict(self, d):
# class Config(dict):


# Path: examples/three_d_earth/three_d_earth.py
from webalchemy import config


FREEZE_OUTPUT = 'webglearth.html'


class Earth:

    def __init__(self):
        self.width = window.innerWidth
        self.height = window.innerHeight

        # Earth params
        self.radius = 0.5
        self.segments = 64
        self.rotation = 6

        self.scene = new(THREE.Scene)

        self.camera = new(THREE.PerspectiveCamera, 45, self.width / self.height, 0.01, 1000)
        self.camera.position.z = 1.5

        self.renderer = new(THREE.WebGLRenderer)
        self.renderer.setSize(self.width, self.height)

        self.scene.add(new(THREE.AmbientLight, 0x333333))

        self.light = new(THREE.DirectionalLight, 0xffffff, 1)
        self.light.position.set(5, 3, 5)
        self.scene.add(self.light)

        self.sphere = self.createSphere(self.radius, self.segments)

        self.sphere.rotation.y = self.rotation