コード例 #1
0
ファイル: transverb_safety.cpp プロジェクト: Angeldude/pd
void transverb::m_signal(int n, float *const *in, float *const *out)
{
	float *outs = out[0];	
	
	// We are now ready for the main signal loop
	// float **in, float **outputs, long samples, int replacing
	
	int i = 0;
//	while (n--) {
		processX((float **)in,(float **)out,(long int)n,0);
//		*outs++  = (i++);
//	}
}  // end m_signal
コード例 #2
0
void vtkRegionGrowing::Start()
{
	
mVolume->GetExtent(mExt);
createSlice();


int n=mSeeds.size();
for(int i=0; i<n; i++)mQueue.push(mSeeds[i]);

if(mOrientation==0)processX();
if(mOrientation==1)processY();
if(mOrientation==2)processZ();

copySlice();
mSlice->Delete();	
}
コード例 #3
0
ファイル: glviewer.c プロジェクト: ematvey/NanoEngineer-1
int main(int argc, char **argv)
{
  XVisualInfo *vi;
  Colormap cmap;
  XSetWindowAttributes swa;
  Window win;
  GLXContext cx;
  XEvent event;
  fd_set readfds;
  struct timeval timeout;
  int xServerFD;
  int nselected;
    
  /* get a connection */
  xDisplay = XOpenDisplay(0);
  if (xDisplay == NULL) {
    fprintf(stderr, "can't open display\n");
    exit(1);
  }
    
  /* get an appropriate visual */
  vi = glXChooseVisual(xDisplay, DefaultScreen(xDisplay), attributeList);
  if (vi == NULL) {
    fprintf(stderr, "can't get visual\n");
    exit(1);
  }
    
  /* create a GLX context */
  cx = glXCreateContext(xDisplay, vi, 0, GL_FALSE);
  if (cx == NULL) {
    fprintf(stderr, "can't create GL context\n");
    exit(1);
  }
    
  /* create a color map */
  cmap = XCreateColormap(xDisplay, RootWindow(xDisplay, vi->screen), vi->visual, AllocNone);
    
  /* create a window */
  swa.colormap = cmap;
  swa.border_pixel = 0;
  swa.event_mask = StructureNotifyMask;

  windowWidth = 500;
  windowHeight = 500;
    
  win = XCreateWindow(xDisplay, RootWindow(xDisplay, vi->screen), 0, 0, windowWidth, windowHeight,
                      0, vi->depth, InputOutput, vi->visual,
                      CWBorderPixel|CWColormap|CWEventMask, &swa);

  XSelectInput(xDisplay, win, KeyPressMask | ExposureMask | StructureNotifyMask);
    
  XMapWindow(xDisplay, win);
  // wait for the window to be mapped
  XIfEvent(xDisplay, &event, WaitForNotify, (char*)win);
  /* connect the context to the window */
  glXMakeCurrent(xDisplay, win, cx);

  quad = gluNewQuadric();
  if (quad == NULL) {
    fprintf(stderr, "can't allocate quadric\n");
    exit(1);
  }

  resetEye();

  xServerFD = ConnectionNumber(xDisplay);
  XFlush(xDisplay);
  
  while (1) {
    while (processX()) {
    }
    if (needRepaint) {
      doPaint();
    }
    FD_ZERO(&readfds);
    if (!atEOF) {
      FD_SET(0, &readfds);
    }
    FD_SET(xServerFD, &readfds);
    timeout.tv_sec = 5;
    timeout.tv_usec = 0;
    nselected = select(xServerFD+1, &readfds, NULL, NULL, atEOF ? &timeout : NULL);
    if (nselected < 0) {
      perror("select");
      continue;
    }
    if (nselected == 0) {
      continue;
    }
    if (FD_ISSET(0, &readfds)) {
      processStdin();
    }
  }
}
コード例 #4
0
ファイル: transverb_safety.cpp プロジェクト: Angeldude/pd
void transverb::process(float **inputs, float **outputs, long samples) {
  processX(inputs,outputs,samples, 0);
}
コード例 #5
0
ファイル: transverb_safety.cpp プロジェクト: Angeldude/pd
void transverb::processReplacing(float **inputs, float **outputs, long samples) {
  processX(inputs,outputs,samples, 1);
}