gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] libvob include/vob/vobs/Fillet.hxx vob/demo/mul...


From: Janne V. Kujala
Subject: [Gzz-commits] libvob include/vob/vobs/Fillet.hxx vob/demo/mul...
Date: Fri, 27 Jun 2003 07:53:15 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Branch:         
Changes by:     Janne V. Kujala <address@hidden>        03/06/27 07:53:15

Modified files:
        include/vob/vobs: Fillet.hxx 
        vob/demo/multifil: fillet3d.py multifil.py randgraph.py 
                           stretching.py 
        vob/fillet     : light3d.py 
Removed files:
        vob/demo/multifil: long.py short.py 

Log message:
        cleanup

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/vobs/Fillet.hxx.diff?tr1=1.31&tr2=1.32&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/demo/multifil/fillet3d.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/demo/multifil/multifil.py.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/demo/multifil/randgraph.py.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/demo/multifil/stretching.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/fillet/light3d.py.diff?tr1=1.7&tr2=1.8&r1=text&r2=text

Patches:
Index: libvob/include/vob/vobs/Fillet.hxx
diff -u libvob/include/vob/vobs/Fillet.hxx:1.31 
libvob/include/vob/vobs/Fillet.hxx:1.32
--- libvob/include/vob/vobs/Fillet.hxx:1.31     Fri Jun 27 06:39:31 2003
+++ libvob/include/vob/vobs/Fillet.hxx  Fri Jun 27 07:53:14 2003
@@ -122,6 +122,38 @@
 
 VOB_DEFINED(SortedConnections);
 
+/** A vob which is used for graph rendering: given a number of coordinate 
systems,
+ * it calls its child vob for each
+ * @param single The child vob to call
+ * @param nconst The number of constant coordinate systems (minus one) to pass 
forth to the child.
+ */
+struct IterConnections {
+    enum { NTrans = -1 };
+
+    Vob *single;
+    int nconst;
+
+    template<class F> void params(F &f) {
+       f(single, nconst);
+    }
+
+    void render(const Transform **t, int n) const {
+       const Transform *ct[nconst + 2];
+       for(int i=0; i<nconst; i++)
+           ct[i] = t[i];
+
+       ct[nconst] = t[nconst + 0]; 
+
+       for(int i=nconst + 1; i<n; i++) {
+           ct[nconst + 1] = t[i], 
+           single->render(ct, nconst + 2);
+       }
+    }
+
+};
+
+VOB_DEFINED(IterConnections);
+
 struct FilletSpan2 {
     enum { NTrans = -1 };
 
Index: libvob/vob/demo/multifil/fillet3d.py
diff -u libvob/vob/demo/multifil/fillet3d.py:1.6 
libvob/vob/demo/multifil/fillet3d.py:1.7
--- libvob/vob/demo/multifil/fillet3d.py:1.6    Fri Jun 27 06:08:43 2003
+++ libvob/vob/demo/multifil/fillet3d.py        Fri Jun 27 07:53:14 2003
@@ -50,16 +50,7 @@
             self, 
            SlideLin("x", 200, 20, "x", "Left", "Right"),
            SlideLin("y", 300, 20, "y", "Up", "Down"),
-           SlideLin("angle", 1, .05, "tan(meet angle)", "+", "-"),
-           SlideLin("thick", 1, .1, "thickness", "T", "t"),
-           Toggle("depthColor", 0, "Color from depth", "d"),
-           Toggle("lines", 0, "Toggle showing lines", "l"),
-           Toggle("ellipses", 1, "Toggle ellipses", "s"),
-           Toggle("stretched", 1, "Toggle stretched", "v"),
-           Toggle("curvature", 0, "Show curvature", "c"),
-           Toggle("sectors", 1, "Show sectors", "z"),
-           SlideLin("size", 50, 5, "Node size", "K", "k"),
-           SlideLin("dice", 20, 1, "Dice factor", "P", "p"),
+            *light3d.commonkeys
        )
     def scene(self, vs):
        vs.put( background((.8,.4,0)))
Index: libvob/vob/demo/multifil/multifil.py
diff -u libvob/vob/demo/multifil/multifil.py:1.17 
libvob/vob/demo/multifil/multifil.py:1.18
--- libvob/vob/demo/multifil/multifil.py:1.17   Wed Jun 25 10:26:46 2003
+++ libvob/vob/demo/multifil/multifil.py        Fri Jun 27 07:53:15 2003
@@ -28,7 +28,7 @@
 from vob.putil.misc import *
 from vob.putil.demokeys import *
 from vob.paper.texcache import getCachedTexture
-
+from vob.fillet import light3d
 
 
 class Scene:
@@ -38,18 +38,7 @@
             self, 
            SlideLin("x", 200, 20, "x", "Left", "Right"),
            SlideLin("y", 300, 20, "y", "Up", "Down"),
-           SlideLin("angle", 1, .05, "tan(meet angle)", "+", "-"),
-           SlideLin("thick", 1, .1, "thickness", "T", "t"),
-           Toggle("drawEdge", 1, "Draw edge", "e"),
-           Toggle("drawInside", 1, "Draw inside", "i"),
-           Toggle("depthColor", 0, "Color from depth", "d"),
-           Toggle("lines", 0, "Toggle showing lines", "l"),
-           Toggle("ellipses", 1, "Toggle ellipses", "s"),
-           Toggle("stretched", 1, "Toggle stretched", "v"),
-           Toggle("curvature", 0, "Show curvature", "c"),
-           Toggle("sectors", 1, "Show sectors", "z"),
-           SlideLin("size", 50, 5, "Node size", "K", "k"),
-           SlideLin("dice", 20, 1, "Dice factor", "P", "p"),
+            *light3d.commonkeys
        )
     def scene(self, vs):
        vs.put( background((.5,1,.2)))
Index: libvob/vob/demo/multifil/randgraph.py
diff -u libvob/vob/demo/multifil/randgraph.py:1.19 
libvob/vob/demo/multifil/randgraph.py:1.20
--- libvob/vob/demo/multifil/randgraph.py:1.19  Fri Jun 27 06:39:31 2003
+++ libvob/vob/demo/multifil/randgraph.py       Fri Jun 27 07:53:15 2003
@@ -45,26 +45,7 @@
             self, 
            SlideLin("x", 200, 20, "x", "Left", "Right"),
            SlideLin("y", 300, 20, "y", "Up", "Down"),
-           SlideLin("angle", 1, .05, "tan(meet angle)", "+", "-"),
-           SlideLin("thick", 1, .1, "thickness", "T", "t"),
-           Toggle("drawEdge", 1, "Draw edge", "e"),
-           Toggle("drawInside", 1, "Draw inside", "i"),
-           Toggle("depthColor", 0, "Color from depth", "d"),
-           Toggle("lines", 0, "Toggle showing lines", "l"),
-           Toggle("ellipses", 1, "Toggle ellipses", "s"),
-           Toggle("stretched", 1, "Toggle stretched", "v"),
-           Toggle("curvature", 1, "Show curvature", "c"),
-           Toggle("sectors", 1, "Show sectors", "z"),
-           SlideLin("N", 21, 3, "N", "N", "n"),
-           SlideLin("ang", 21, 3, "Rotation angle", "Prior", "Next"),
-           Toggle("fillets", 1, "Toggle filleting", "f"),
-           SlideLin("seed", 42, 1, "seed number", "A", "a"),
-           SlideLin("size", 100, 10, "Node size", "K", "k"),
-           SlideLin("dice", 20, 1, "Dice factor", "P", "p"),
-           Toggle("fillet3d", 0, "3D fillets", "3"),
-           SlideLin("linewidth", 2, 1, "line width", "B", "b"),
-           Toggle("perspective", 0, "perspective", "F"),
-           Toggle("texture", 0, "texture", "x"),
+            *light3d.commonkeys
        )
     def scene(self, vs):
        vs.put( background((.5,1,.2)))
@@ -99,7 +80,8 @@
                                     64 * self.stretched +
                                     128 * self.sectors), 2)
 
-       conns3d = GLRen.createFillet3D(border, self.dice, 0);
+       conns3d =  GLRen.createIterConnections(
+            GLRen.createFillet3D(border, self.dice, 0), 2);
 
 
         rng = Random(self.seed)
@@ -185,11 +167,7 @@
                 uLookAt 400 400 -1000 400 400 400 0 -1 0
                 """))
 
-            for node in nodes:
-                if node["conns"]:
-                    for other in node["conns"]:
-                        vs.put(conns3d, [thick, angle, node["cs"], other])
-
+            pc(conns3d)
 
             vs.put(getDListNocoords("""
             MatrixMode PROJECTION
Index: libvob/vob/demo/multifil/stretching.py
diff -u libvob/vob/demo/multifil/stretching.py:1.1 
libvob/vob/demo/multifil/stretching.py:1.2
--- libvob/vob/demo/multifil/stretching.py:1.1  Wed Jun 25 10:26:46 2003
+++ libvob/vob/demo/multifil/stretching.py      Fri Jun 27 07:53:15 2003
@@ -28,6 +28,7 @@
 from vob.putil.misc import *
 from vob.putil.demokeys import *
 from vob.paper.texcache import getCachedTexture
+from vob.fillet import light3d
 
 
 
@@ -38,17 +39,8 @@
             self, 
            SlideLin("x", 0, 20, "x", "Left", "Right"),
            SlideLin("angle", .15, .05, "angle scaling constant", "+", "-"),
-           SlideLin("thick", 1, .1, "thickness", "T", "t"),
-           Toggle("drawEdge", 1, "Draw edge", "e"),
-           Toggle("drawInside", 1, "Draw inside", "i"),
-           Toggle("depthColor", 0, "Color from depth", "d"),
-           Toggle("lines", 0, "Toggle showing lines", "l"),
-           Toggle("ellipses", 1, "Toggle ellipses", "s"),
-           Toggle("stretched", 1, "Toggle stretched", "v"),
-           Toggle("curvature", 0, "Show curvature", "c"),
-           Toggle("sectors", 1, "Show sectors", "z"),
-           SlideLin("size", 40, 5, "Node size", "K", "k"),
-           SlideLin("dice", 20, 1, "Dice factor", "P", "p"),
+           SlideLin("thickc", 1, .1, "thickness", "T", "t"),
+            *light3d.commonkeys
        )
     def scene(self, vs):
        vs.put( background((.5,1,.2)))
@@ -69,7 +61,7 @@
        #thick = vs.orthoCS(0, "Thi", 0, self.thick, 0, 0, 0);
         #thick = vs.orthoCS(0, "Thi", 0, 100*(self.thick / (math.hypot(self.x 
- 500, self.y - 500)+50)), 0, 0, 0);
 
-        thick = vs.coords.rational1D22(0, self.thick, 0, 0,  1, 1, 0);
+        thick = vs.coords.rational1D22(0, self.thickc, 0, 0,  1, 1, 0);
         angle = vs.coords.rational1D22(0, self.angle, 0, 0, 1, 0, 0);
         angle = vs.coords.rational1D22(0, 1, 0, self.angle, 0, 1, 0);
         vs.matcher.add(thick, "Thi")
Index: libvob/vob/fillet/light3d.py
diff -u libvob/vob/fillet/light3d.py:1.7 libvob/vob/fillet/light3d.py:1.8
--- libvob/vob/fillet/light3d.py:1.7    Fri Jun 27 06:25:53 2003
+++ libvob/vob/fillet/light3d.py        Fri Jun 27 07:53:15 2003
@@ -1,6 +1,7 @@
 # (c) Janne V. Kujala and Tuomas J. Lukka
 from org.nongnu.libvob.gl import GL, GLRen
 from vob.putil import cg
+from vob.putil.demokeys import *
 
 vp = [
 GL.createProgram(cg.compile("""
@@ -84,3 +85,27 @@
 }
     
 """, "fp30"))
+
+
+commonkeys = [
+           SlideLin("angle", 1, .05, "tan(meet angle)", "+", "-"),
+           SlideLin("thick", 1, .1, "thickness", "T", "t"),
+           Toggle("drawEdge", 1, "Draw edge", "e"),
+           Toggle("drawInside", 1, "Draw inside", "i"),
+           Toggle("depthColor", 0, "Color from depth", "d"),
+           Toggle("lines", 0, "Toggle showing lines", "l"),
+           Toggle("ellipses", 1, "Toggle ellipses", "s"),
+           Toggle("stretched", 1, "Toggle stretched", "v"),
+           Toggle("curvature", 0, "Show curvature", "c"),
+           Toggle("sectors", 1, "Show sectors", "z"),
+           SlideLin("N", 21, 3, "N", "N", "n"),
+           SlideLin("ang", 21, 3, "Rotation angle", "Prior", "Next"),
+           Toggle("fillets", 1, "Toggle filleting", "f"),
+           SlideLin("seed", 42, 1, "seed number", "A", "a"),
+           SlideLin("size", 100, 10, "Node size", "K", "k"),
+           SlideLin("dice", 20, 1, "Dice factor", "P", "p"),
+           Toggle("fillet3d", 0, "3D fillets", "3"),
+           SlideLin("linewidth", 2, 1, "line width", "B", "b"),
+           Toggle("perspective", 0, "perspective", "F"),
+           Toggle("texture", 0, "texture", "x"),
+]




reply via email to

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