# vPresent is an immersive presentation creation and display application.
# Copyright (C) 2007-2008 by Infiscape Corporation
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

import opendocument as od
dr3d_base = od.bases.dr3d
AI = od.AttributeInfo

class Scene(dr3d_base.Scene):
   __metaclass__ = od.OpenDocumentMeta
   childTypes = ['vpresent:model', 'vpresent:box', 'vpresent:cylinder',
                 'vpresent:billboard', 'vpresent:fisheye',
                 'vpresent:cylinder-panorama']

class Sphere(dr3d_base.Sphere):
   __metaclass__ = od.OpenDocumentMeta
   overrides = {'dr3d:size': AI(default=1.0, get=od.getGTZFloat,
                                set=od.setGTZFloat, required=True,
                                doc="Radius of the sphere."),
                'vpresent:latres': AI(default=50,
                                      get=lambda o,rn,d: od.getInteger(o,rn,d,4),
                                      set=lambda o,rn,d: od.setInteger(o,rn,d,4),
                                      required=False, doc="Latitude resolution."),
                'vpresent:lonres': AI(default=50,
                                      get=lambda o,rn,d: od.getInteger(o,rn,d,4),
                                      set=lambda o,rn,d: od.setInteger(o,rn,d,4),
                                      required=False, doc="Longitude resolution."),
                'dr3d:transform':AI(required=False,
                                    default="1.0 0.0 0.0  0.0 1.0 0.0  0.0 0.0 1.0  0.0 0.0 0.0")
                }
