fenfire-commits
[Top][All Lists]
Advanced

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

[ff-cvs] libvob include/vob/vobs/Fillet.hxx vob/fillet/l...


From: Asko Soukka
Subject: [ff-cvs] libvob include/vob/vobs/Fillet.hxx vob/fillet/l...
Date: Tue, 26 Aug 2003 09:09:00 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Branch:         
Changes by:     Asko Soukka <address@hidden>    03/08/26 09:08:59

Modified files:
        include/vob/vobs: Fillet.hxx 
        vob/fillet     : light3d.py 

Log message:
        2d fillets support nodes without connections

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/vobs/Fillet.hxx.diff?tr1=1.52&tr2=1.53&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/fillet/light3d.py.diff?tr1=1.40&tr2=1.41&r1=text&r2=text

Patches:
Index: libvob/include/vob/vobs/Fillet.hxx
diff -u libvob/include/vob/vobs/Fillet.hxx:1.52 
libvob/include/vob/vobs/Fillet.hxx:1.53
--- libvob/include/vob/vobs/Fillet.hxx:1.52     Tue Aug 19 05:32:35 2003
+++ libvob/include/vob/vobs/Fillet.hxx  Tue Aug 26 09:08:59 2003
@@ -60,14 +60,15 @@
  * @param single The child vob to call
  * @param nconst The number of constant coordinate systems to pass forth to 
the child.
  */
+
 struct SortedConnections {
     enum { NTrans = -1 };
 
-    Vob *single;
+    Vob *single, *single0;
     int nconst;
 
     template<class F> void params(F &f) {
-       f(single, nconst);
+       f(single, single0, nconst);
     }
 
     struct AngleInd {
@@ -90,6 +91,12 @@
            a[i].ind = i;
        }
 
+       // Special case, with no connections
+       if (nconst + 1 == n) {
+         if (single0) single0->render(t, nconst + 1);
+         return;
+       }
+
        std::sort(a + nconst, a+n);
 
        // Render the circle
@@ -104,7 +111,7 @@
                    << a[i].ind << " "
                    << a[i+1].ind <<"\n";
                    
-           ct[nconst + 1] = t[a[i].ind], 
+           ct[nconst + 1] = t[a[i].ind],
            ct[nconst + 2] = t[a[i+1].ind];
            single->render(ct, nconst + 3);
        }
@@ -116,7 +123,6 @@
        ct[nconst + 1] = t[a[n-1].ind], 
        ct[nconst + 2] = t[a[nconst+1].ind];
        single->render(ct, nconst + 3);
-       
     }
 
 };
@@ -325,6 +331,16 @@
     }
 
     void render(const Transform **t, int n) const {
+        // If no connections, render a single circle
+        if (n == 3) {
+         const Transform &t0 = *t[2];
+         ZVec ctr = t0.transform(0.5 * t0.getSqSize());
+         float csize = crad(t0);
+         CircularNode node(ctr, csize);
+         renderSpan(CircularNodeSpan(node, 0, 2*M_PI), 1);
+         return;
+        }
+
        const Transform &thick_t = *t[0];
        const Transform &angle_t = *t[1];
 
Index: libvob/vob/fillet/light3d.py
diff -u libvob/vob/fillet/light3d.py:1.40 libvob/vob/fillet/light3d.py:1.41
--- libvob/vob/fillet/light3d.py:1.40   Mon Aug 25 01:22:50 2003
+++ libvob/vob/fillet/light3d.py        Tue Aug 26 09:08:59 2003
@@ -123,6 +123,7 @@
              ;
     // Fog
     // float t = 8*mul(glstate.matrix.mvp, pos).z;
+    // t = 8*mul(glstate.matrix.mvp, pos).z*40;
     // ocol.rgb = ocol.rgb * (1 - t) + float3(1,.5,.2) * t;
     ocol.a = 1;
 
@@ -304,31 +305,28 @@
            vs.put(getDListNocoords("PolygonMode FRONT_AND_BACK LINE"))
 
        border = 2
-       conns = GLRen.createSortedConnections(
-           GLRen.createFilletSpan2(border, self.dice, 
+        spans = GLRen.createFilletSpan2(border, self.dice, 
                                     1 +
                                     4 * self.depthColor +
                                     16 * self.ellipses +
                                     64 * self.stretched +
-                                    128 * self.sectors),
-           2)
-       conns_l = GLRen.createSortedConnections(
-           GLRen.createFilletSpan2(border, self.dice, 
+                                    128 * self.sectors)
+       conns = GLRen.createSortedConnections(spans, spans, 2)
+        spans = GLRen.createFilletSpan2(border, self.dice, 
                                     2 +
                                     4 * self.depthColor +
                                     16 * self.ellipses +
                                     64 * self.stretched +
-                                    128 * self.sectors),
-           2)
-       conns_c = GLRen.createSortedConnections(
-           GLRen.createFilletSpan2(1000, self.dice, 
+                                    128 * self.sectors)
+       conns_l = GLRen.createSortedConnections(spans, spans, 2)
+        spans = GLRen.createFilletSpan2(1000, self.dice, 
                                     2 +
                                     4 * self.depthColor +
                                     16 * self.ellipses +
                                     32 +
                                     64 * self.stretched +
-                                    128 * self.sectors),
-           2)
+                                    128 * self.sectors)
+       conns_c = GLRen.createSortedConnections(spans, spans, 2)
 
         f3d = GLRen.createFillet3D(border, self.dice, 1);
 




reply via email to

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