[BACK]Return to ray.rr CVS log [TXT][DIR] Up to [local] / OpenXM / src / cfep / Samples

File: [local] / OpenXM / src / cfep / Samples / ray.rr (download)

Revision 1.1.1.1 (vendor branch), Fri Mar 3 23:31:12 2006 UTC (18 years, 2 months ago) by takayama
Branch: TAKAYAMA, MAIN
CVS Tags: R_1_3_1-2, RELEASE_1_3_1_13b, RELEASE_1_2_3_12, RELEASE_0_9, HEAD, DEB_REL_1_2_3-9
Changes since 1.1: +0 -0 lines

The initial release of cfep (cocoa front end view process for OpenXM engines).
It has been built and tested on Mac OS X 10.4 (tigers) and xcode 2.2.
The default engine is risa/asir.

def test2() {
  glib_init_send("0;[glib3_ray_init]");
  glib_init_send("0;[glib_flush]");
  glib_send("0;[glib3_ray]");
  glib_send("0;[glib_flush]");
}
def myline(X,Y,X2,Y2,C) {
  X = rtostr(deval(X)); Y = rtostr(deval(Y)); 
  X2 = rtostr(deval(X2)); Y2=rtostr(deval(Y2));
  CC = C[0]*(256*256)+C[1]*256+C[0];
  CC=rtostr(CC); print(C,0); print(CC);
  glib_send("1; [glib_line,"+X+","+Y+","+X2+","+Y2+","+CC+"]");
}
def t_encode1(X) {
  return [
     ior(0xf8,iand(0x3,ishift(X,6))),
     ior(0xf0,iand(0x7,ishift(X,3))),
     ior(0xf0,iand(0x7,X))];
}
def t_encode_str(S) {
  Ans = [ ];
  Codes = strtoascii(S);
  N = length(Codes);
  for (I=0; I<N; I++) {
     T = t_encode1(Codes[I]);
     Ans = cons(T[0],Ans);
     Ans = cons(T[1],Ans);
     Ans = cons(T[2],Ans);
  }
  return reverse(Ans);
}
def t_encode(S) {
  return asciitostr(t_encode_str(S));
}
def glib_send(S) {
   S=S+"\n";
   N=length(strtoascii(S))+1;
   C=t_encode("{1<"+rtostr(N)+" "+S+" >}");
   ctrl("hex",1); 
   output(); ctrl("hex",0);
   print(C); output(); /* channel 1 にコマンドを送る */
}  
def glib_init_send(S) {
   S=S+"\n";
   N=length(strtoascii(S))+1;
   C=t_encode("{2<"+rtostr(N)+" "+S+" >}");
   ctrl("hex",1); 
   output(); ctrl("hex",0);
   print(C); output(); /* channel 2 にコマンドを送る. OpenGL 初期化 */
}  
test2();