gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gfx/librenderables renderables.py


From: Matti Katila
Subject: [Gzz-commits] gzz/gfx/librenderables renderables.py
Date: Wed, 18 Dec 2002 11:12:35 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Matti Katila <address@hidden>   02/12/18 11:12:32

Modified files:
        gfx/librenderables: renderables.py 

Log message:
        Added continuousline thing.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.165&tr2=1.166&r1=text&r2=text

Patches:
Index: gzz/gfx/librenderables/renderables.py
diff -u gzz/gfx/librenderables/renderables.py:1.165 
gzz/gfx/librenderables/renderables.py:1.166
--- gzz/gfx/librenderables/renderables.py:1.165 Sat Dec 14 03:11:35 2002
+++ gzz/gfx/librenderables/renderables.py       Wed Dec 18 11:12:32 2002
@@ -1599,6 +1599,93 @@
 
 {
     "Type": "2",
+    "Name": "ContinuousLine",
+    "Data": """
+        int textId;
+        float width;
+        vector<float> points;
+        vector<float> color;
+        """,
+    "Params": """
+        int textId,
+        float width,
+        float[] points,
+        float[] colors
+      
+        """,
+    "ParamCode": """
+       this->textId = textId;
+       this->width = width;
+
+       """,
+    "ExtraClass" : """
+/*
+       template<class Coords> struct Vertexer {
+           const Coords &c;
+            float scale;
+            ZPt orig;
+            
+           Vertexer(Coords &c, float scale, ZPt orig) :
+                c(c), scale(scale), orig(orig) { }
+
+           template<class T> void operator()(const T &x, const T &y) {
+
+                ZPt tmp(x*scale, y*scale, 0);
+
+                tmp.x += orig.x;
+                tmp.y += orig.y;
+
+                c.vertex(tmp);
+           }
+       };
+*/
+       """,
+    "RenderCode" : """
+
+/*
+            // UNABLE TO IMPLEMENT AS LONG AS GL IS UNCOMPILABLE
+
+            DBG(dbg_continuous_line)
+              << "ContinuousLine - linewidth: " << width << "\\n"; 
+    
+           glPushAttrib(GL_ENABLE_BIT);
+           glEnable(GL_BLEND);
+            glDisable(GL_TEXTURE_2D);
+
+            if (color.size() >= 3) 
+              glColor3f(color[0], color[1], color[2];
+
+
+            // Linewidth
+            ZPt a = coords1.transform(ZPt(0,0,0));
+            ZPt b = coords1.transform(ZPt(0,linewidth,0));
+            float line_w = (b-a).length();
+           
+            Lines::ContinuousLine line(textId, "foo", line_w );
+
+
+            for (unsigned int i=0; i+2<points.size(); i+=3) {
+                 line.add(points[i], points[i+1], points[i+2]);
+            }
+
+
+            
+            // left -vert
+            line.draw(
+              coords1.transform( ZPt(0.0, 0.0, 0.0) ),
+              coords1.transform( ZPt(0.0, weeks + weekday_h + month_name_h, 
0.0) )
+              );
+
+            glColor3f(0.0, 0.0, 0.0);
+
+           glPopAttrib();
+*/
+            if (dbg) cout << "ContinuousLine done\\n";
+    """        
+},
+
+{
+    "Type": "2",
     "Name": "CalendarPaper",
     "Data": """
        TextRenderer *r_date;
@@ -1729,7 +1816,7 @@
             ZPt b = coords1.transform(ZPt(0,linewidth,0));
             float line_w = (b-a).length();
            
-            Lines::Lines line(line_w);
+            Lines::SimpleLine line(line_w);
             
             // left -vert
             line.draw(



reply via email to

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