fenfire-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ff-cvs] libvob/doc/pegboard/vobscene_recursion--tjl peg...


From: Tuomas J. Lukka
Subject: [ff-cvs] libvob/doc/pegboard/vobscene_recursion--tjl peg...
Date: Sun, 14 Sep 2003 07:59:40 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Branch:         
Changes by:     Tuomas J. Lukka <address@hidden>        03/09/14 07:59:40

Modified files:
        doc/pegboard/vobscene_recursion--tjl: peg.rst 

Log message:
        Arch sync

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/doc/pegboard/vobscene_recursion--tjl/peg.rst.diff?tr1=1.8&tr2=1.9&r1=text&r2=text

Patches:
Index: libvob/doc/pegboard/vobscene_recursion--tjl/peg.rst
diff -u libvob/doc/pegboard/vobscene_recursion--tjl/peg.rst:1.8 
libvob/doc/pegboard/vobscene_recursion--tjl/peg.rst:1.9
--- libvob/doc/pegboard/vobscene_recursion--tjl/peg.rst:1.8     Sun Sep 14 
04:57:20 2003
+++ libvob/doc/pegboard/vobscene_recursion--tjl/peg.rst Sun Sep 14 07:59:39 2003
@@ -3,8 +3,8 @@
 =============================================================
 
 :Author:   Tuomas J. Lukka
-:Last-Modified: $Date: 2003/09/14 08:57:20 $
-:Revision: $Revision: 1.8 $
+:Last-Modified: $Date: 2003/09/14 11:59:39 $
+:Revision: $Revision: 1.9 $
 :Status:   Current
 
 Performance problems in FenPDF as well as running out 
@@ -18,26 +18,22 @@
 - Should we have a "VobSceneVob", i.e. a Vob that contains a different
   VobScene or some other approach?
 
-    RESOLVED: Something like that, but extended, since we want to export
-    several coordinate systems from the child vobscene to the parent,
-    in order to do anchors. This cannot be done by a normal Vob so we need to
-    really touch the VobScene itself.
-
-    This is also because of interpolation: placing the "VobSceneVob"
-    into the parent must have a key to allow interpolation *inside*
-    a VobSceneVob. Therefore, it cannot be called a Vob. (This feature
-    will be implemented only in the future)
+    RESOLVED: Too many special properties to be a Vob or a coordsys
+    directly. 
 
-    In fact, it seems that we should support placing VobScenes directly.
+    We shall use a special ChildVobScene class.
 
-- What should the efficiency demands be? Linear w.r.t. child size?
+- What should the efficiency demands be when including a child
+  and when rendering? Linear w.r.t. child size?
 
     RESOLVED: Linear is not good enough! Consider a huge canvas that
     has been generated and is placed into a viewport, and most of it is
     culled away. One of the very reasons for this PEG is that we need
     to have more speed in this case.
 
-    Therefore, the time should be linear w.r.t. the **rendered**
+    Therefore, the time to include a child should be **constant**,
+    and the time to render a vobscene should be **linear** w.r.t. 
+    the *rendered*
     coordsystems of the child, but constant w.r.t. child size. This makes
     life a bit more difficult internally (can't just copy a list, have
     to point to it) but should be well worth it e.g. for FenPDF.
@@ -55,6 +51,11 @@
 
     This may change later; easiest to start strict.
 
+- [benja] Should we throw an exception if a child vobscene is modified?
+
+    RESOLVED: Too expensive - this is the innermost loops
+    of the Java code we are talking about, here.
+
 - Do we need to define coordinate systems other than the root of the
   child from the parent?
 
@@ -106,7 +107,7 @@
     needs a *key* from the parent coordinate system, to allow
     interpolation (not implemented now).
 
-- Matching between different versions of a coordinate system?
+- Matching between different versions of a child vobscene?
 
     RESOLVED: Later.
 
@@ -120,11 +121,54 @@
     ``GraphicsAPI.RenderingSurface.createChildVobScene(int reserveCS)``
     call.  
 
+- [benja] Should child vobscenes be their own class?
+
+    RESOLVED: Yes. Gives us type safety for placing child vobscenes.
+
+Introduction
+============
+
+This PEG proposes an important change to the VobScene model. So far,
+the model has been (we'll ignore keys for a while): 
+
+    A VobScene contains coordinate systems, indexed by integers,
+    and a list of Vobs, each of which is associated with 0 or more coordsyses.
+
+    The coordinate system 0 is the root (or unit) coordinate system, 
representing
+    screen coordinates.
+
+The new model is:
+
+    A VobScene contains coordinate systems, indexed by integers,
+    and a list of Vobs, each of which is associated with 0 or more coordsyses.
+
+    A VobScene can also contain a child VobScene, which is specially treated
+    both as a coordinate system *and* a Vob. A child VobScene can use a fixed
+    number of parameter coordinate systems from the parent. The VobScene can
+    also take coordinate systems from the child to use as normal coordinate
+    systems in the parent.
+
+    The coordinate system 0 is the unit coordinate system in the root
+    vobscene and (by convention) others.
+
+    The coordinate system 1 is the screen coordinate system, with the box size
+    giving the width/height in screen coordinates. This can also be used
+    as a convention in child vobscenes but is not as important as coordsys 0.
+
+This represents quite a complication; OTOH, the gains are important: 
+child VobScenes can be created directly as pure Functions of the structure,
+allowing REALLY efficient caching &c.
+
 Changes
 =======
 
 The API changes are minor. 
 
+Child VobScene
+--------------
+
+New class ``ChildVobScene``, extending ``VobScene``. No new methods.
+
 Creating Child VobScenes
 ------------------------
 
@@ -132,15 +176,15 @@
 
     /** Create a new VobScene that may be placed into a VobScene
      * by the putChildVobScene call.
-     * @param reserveCS The number of initial coordinate systems in scene
-     * to replace with coordinate systems of the surrounding scene.
+     * @param numberOfParameterCS The number of initial coordinate systems in 
the child scene
+     *                         that are to be given to it as parameters from 
the parent.
      */
-    VobScene createChildVobScene(Dimension size, int reserveCS);
+    ChildVobScene createChildVobScene(Dimension size, int numberOfParameterCS);
 
 Placing Child VobScenes
 -----------------------
 
-Extend ``VobScene`` by
+Extend ``VobScene`` by::
 
     /** Place the given VobScene as a child.
      * The given VobScene must not be modified after this call.
@@ -148,46 +192,53 @@
      *                 need to be created especially, through
      *         RenderingSurface.createChildVobScene
      * @param key The key to use
+     * @param cs The coordinate systems that shall be used as the first
+     *           coordinate systems of the child.
+     *           This *must* have the same number of elements as 
+     *           the createChildVobScene method was given.
      */
-     public void putChildVobScene(VobScene child, Object key, int[] cs);
+     public void putChildVobScene(ChildVobScene child, Object key, int[] cs);
 
-And correspondingly VobCoorder and VobPlacer by
+And correspondingly VobCoorder by::
 
-     public int _putChildVobScene(VobScene child, int[] cs)
+     public int _putChildVobScene(ChildVobScene child, int[] cs)
 
-(the VobScene method shall call both; the underscore means that 
-they should not be called by users).
+and VobPlacer by::
+    
+     public int _putChildVobScene(ChildVobScene child, int coorderResult,
+                                       int[] cs)
 
-The key shall be passed to VobMatcher in the normal way.
+(the VobScene method shall call both; the underscore means that 
+they should not be called by users. The VobScene method shall
+return the result from VobPlacer).
 
-VobScene methods 
-----------------
+The key shall be passed to VobMatcher in the normal way, using the integer
+returned by VobCoorder._putChildVobScene.
 
-Finally, a method getting VobSceneVob coordinate systems, in VobScene::
+Exporting coordinate systems
+----------------------------
 
-    public int subSceneCoordsys(int vobId, int nth);
+Finally, a method exporting child coordinate systems into the
+parent, in VobScene::
+
+    /** Get a coordinate system from a child vobscene placed
+     * using putChildVobScene into this VobScene.
+     * @param childVobSceneId The id returned from putChildVobScene
+     * @param nth The index of the coordinate system 
+     *            inside the child vobscene.
+     */
+    public int exportChildCoordsys(int childVobSceneId, int nth);
 
 VobScene semantics
 ------------------
 
-So far, the only special CS has been coordinate system 0.
-From now on, coordinate system **1** shall be the "root" coordinate system,
+So far, the only special CS has been coordinate system 0, which 
+has had the dual role of being both the "identity transformation" 
+and the "screen coordinate system".
+
+From now on, coordinate system **1** shall be the "screen" coordinate system,
 and **0** remains the "identity" coordinate system (representing
 an identity transformation).
 
 The unit box of CS 1 is set to screen size, while the unit box
 of CS 0 is (1,1).
-
-OpenGL implementation
----------------------
-
-In OpenGL, the recursion is implemented by a special coordinate system type
-and a special Vob. 
-
-The special coordinate system type causes the Coorder to call a method
-to get the child coorder through an interface given to it, giving itself
-as the parent parameter.
-
-
-
-




reply via email to

[Prev in Thread] Current Thread [Next in Thread]