[BACK]Return to MyOpenGLController.m CVS log [TXT][DIR] Up to [local] / OpenXM / src / cfep

Diff for /OpenXM/src/cfep/MyOpenGLController.m between version 1.2 and 1.4

version 1.2, 2006/03/07 11:15:23 version 1.4, 2018/10/18 04:59:45
Line 9 
Line 9 
 #import "MyOpenGLController.h"  #import "MyOpenGLController.h"
   
 // MyOpenGL window id (gid) is an indeger.  // MyOpenGL window id (gid) is an indeger.
 static MyOpenGLController *oglWindow[GID_MAX];  // gid --> MyOpenGLController instance.  static MyOpenGLController *oglWindow[MY_GID_MAX];  // gid --> MyOpenGLController instance.
 static MyDocument *oglParent[GID_MAX];           // gid --> parent MyDocument.  static MyDocument *oglParent[MY_GID_MAX];           // gid --> parent MyDocument.
 static int MyOpenGLControllerInitialized = 0;  static int MyOpenGLControllerInitialized = 0;
 static int Gid=0;  static int Gid=0;
   
Line 19  static int Gid=0;
Line 19  static int Gid=0;
 +(void) initMyOpenGLController {  +(void) initMyOpenGLController {
   int i;    int i;
   if (MyOpenGLControllerInitialized) return;    if (MyOpenGLControllerInitialized) return;
   for (i=0; i<GID_MAX; i++) { oglWindow[i] = nil; oglParent[i] = nil; }    for (i=0; i<MY_GID_MAX; i++) { oglWindow[i] = nil; oglParent[i] = nil; }
   MyOpenGLControllerInitialized = 1;    MyOpenGLControllerInitialized = 1;
 }  }
 +(MyOpenGLController *)getOglWindow: (int) tid {  +(MyOpenGLController *)getOglWindow: (int) tid {
Line 31  static int Gid=0;
Line 31  static int Gid=0;
   
 +(int) myOpenGLControllerOwnedBy: (MyDocument *) owner with: (int) tid {  +(int) myOpenGLControllerOwnedBy: (MyDocument *) owner with: (int) tid {
    MyOpenGLController *ogl;     MyOpenGLController *ogl;
    if ((tid >= 0) && (tid <GID_MAX)) {     if ((tid >= 0) && (tid <MY_GID_MAX)) {
      if (oglWindow[tid]) return tid;       if (oglWindow[tid]) return tid;
          else {           else {
                 ogl = [[MyOpenGLController allocWithZone:[MyOpenGLController zone]] init];                  ogl = [[MyOpenGLController allocWithZone:[MyOpenGLController zone]] init];
Line 50  static int Gid=0;
Line 50  static int Gid=0;
   
    [MyOpenGLController initMyOpenGLController];     [MyOpenGLController initMyOpenGLController];
    tid = Gid;     tid = Gid;
    if (tid < GID_MAX) {     if (tid < MY_GID_MAX) {
     Gid++;      Gid++;
         return [MyOpenGLController myOpenGLControllerOwnedBy: owner with: tid];          return [MyOpenGLController myOpenGLControllerOwnedBy: owner with: tid];
    }else{     }else{
Line 60  static int Gid=0;
Line 60  static int Gid=0;
 +(void) removeMyOpenGLControllerOwnedBy: (MyDocument *) owner {  +(void) removeMyOpenGLControllerOwnedBy: (MyDocument *) owner {
   int i;    int i;
   [MyOpenGLController initMyOpenGLController];    [MyOpenGLController initMyOpenGLController];
   for (i=0; i<GID_MAX; i++) {    for (i=0; i<MY_GID_MAX; i++) {
     if (oglParent[i] == owner) {      if (oglParent[i] == owner) {
            [MyOpenGLController removeMyOpenGLControllerWithGid: i];             [MyOpenGLController removeMyOpenGLControllerWithGid: i];
         }          }
Line 84  static int Gid=0;
Line 84  static int Gid=0;
 */  */
   
 +(void) addOglComm:     (NSString *)comm to: (int) tid from: (MyDocument *) owner {  +(void) addOglComm:     (NSString *)comm to: (int) tid from: (MyDocument *) owner {
   if ((0<=tid) && (tid<GID_MAX)) {    if ((0<=tid) && (tid<MY_GID_MAX)) {
         if (oglWindow[tid] == nil) {          if (oglWindow[tid] == nil) {
           tid = [MyOpenGLController myOpenGLControllerOwnedBy: owner with: tid];            tid = [MyOpenGLController myOpenGLControllerOwnedBy: owner with: tid];
         }          }
Line 92  static int Gid=0;
Line 92  static int Gid=0;
   }else ;    }else ;
 }  }
 +(void) addOglInitComm: (NSString *)comm to: (int) tid from: (MyDocument *) owner {  +(void) addOglInitComm: (NSString *)comm to: (int) tid from: (MyDocument *) owner {
   if ((0<=tid) && (tid<GID_MAX)) {    if ((0<=tid) && (tid<MY_GID_MAX)) {
         if (oglWindow[tid] == nil) {          if (oglWindow[tid] == nil) {
           tid = [MyOpenGLController myOpenGLControllerOwnedBy: owner with: tid];            tid = [MyOpenGLController myOpenGLControllerOwnedBy: owner with: tid];
         }          }
Line 154  static int Gid=0;
Line 154  static int Gid=0;
 -(NSMutableArray *) getListOfOglInitComm { return [myogl getListOfOglInitComm]; }  -(NSMutableArray *) getListOfOglInitComm { return [myogl getListOfOglInitComm]; }
 -(void) showEyeX: (float) x Y: (float) y Z: (float) z {  -(void) showEyeX: (float) x Y: (float) y Z: (float) z {
   [self clearOutput];    [self clearOutput];
   [self output: [NSString stringWithFormat: @"gid=%d, n=%d, position of your eye:(%1.2f,%1.2f,%1.2f)",gid,[self countOfOglComm],x,y,z]];    [self output: [NSString stringWithFormat: @"gid=%d, n=%d, position of your eye:(%1.2f,%1.2f,%1.2f), nc=%d, ni=%d",gid,[self countOfOglComm],x,y,z,[myogl getOglCommSize],[myogl getOglInitCommSize]]];
 }  }
 -(void) showCount {  -(void) showCount {
   [self clearOutput];    [self clearOutput];

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.4

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>