SCamera and Some Related Classes - TheAliceProject/alice3 GitHub Wiki

Alice Cameras

SCamera is the user exposed class. It uses annotations in the Java to determine what a user sees in the Alice IDE.

SThing
    STurnable
        SMovableTurnable
            SCamera

The hierarchy is entirely in the org.lgna.story package.

SCamera holds an implementation that it delegates most logic to

private final SymmetricPerspectiveCameraImp implementation = new SymmetricPerspectiveCameraImp(this);

Hierarchy in org.lgna.story.implementation

PropertyOwnerImp
    EntityImp
        AbstractTransformableImp
            TransformableImp
                CameraImp<S extends AbstractCamera>
                    SymmetricPerspectiveCameraImp extends CameraImp<SymmetricPerspectiveCamera>
                    OrthographicCameraImp extends CameraImp<OrthographicCamera>

The CameraImp holds references to both the AbstractCamera and the SCamera. It also maintains the primary source for the placement and sizing of things in the scene.

// in SymmetricPerspectiveCameraImp
private final SCamera abstraction;

// in superclass CameraImp
private final S sgCamera;

// superclass TransformableImp
private final Transformable sgTransformable = new Transformable();

AbstractCamera is part of the scene graph. This is what DragAdaptors, CameraPair, and CameraInformedManipulators work with. It does not maintain a reference back to the CameraImp that created it.

AbstractReleasable (edu.cmu.cs.dennisc.pattern)
    AbstractNameable
        AbstractInstancePropertyOwner
            Element (edu.cmu.cs.dennisc.scenegraph)
                Component
                    Leaf
                        AbstractCamera
                            ProjectionCamera
                            AbstractNearPlaneAndFarPlaneCamera
                                AbstractPerspectiveCamera
                                    SymmetricPerspectiveCamera
                                    FrustumPerspectiveCamera
                                OrthographicCamera
                    Composite
                        AbstractTransformable
                            Transformable
                                Ghost
                                ModelTransformable (edu.cmu.cs.dennisc.scenegraph.util)
                                Arrow (edu.cmu.cs.dennisc.scenegraph.util)
                                SnapGrid (org.alice.interact.manipulator.scenegraph)
                                ManipulationHandle3D (org.alice.interact.handle)
                                ExtravagantAxes (edu.cmu.cs.dennisc.scenegraph.util)
                                Jack (edu.cmu.cs.dennisc.scenegraph.util)
                                Model (edu.cmu.cs.dennisc.scenegraph.util)
                                DebugSphere (org.alice.interact.debug)
                                SnapLine (org.alice.interact.manipulator.scenegraph)
                                Joint
                                SnapSphere (org.alice.interact.manipulator.scenegraph)

The hierarchy for AbstractCamera. Unless noted classes are in the package edu.cmu.cs.dennisc.scenegraph.

ProjectionCamera and FrustumPerspectiveCamera appear to be unused. Most of the subclasses of Transformable are unused or deprecated.

The rendering of the SceneGraph objects is handled by adapters. They are dynamically linked in the AdapterFactory using java reflection on the scene graph class name. The factory links the Glr instances to scene graph Elements as the owner Here is some of the corresponding hierarchy in edu.cmu.cs.dennisc.render.gl.imp.adapters

GlrObject
    GlrElement
        GlrComponent
            GlrLeaf
                GlrAbstractCamera
                    GlrProjectionCamera
                    GlrAbstractNearPlaneAndFarPlaneCamera
                        GlrAbstractPerspectiveCamera
                            GlrFrustumPerspectiveCamera
                            GlrSymmetricPerspectiveCamera
                        GlrOrthographicCamera