void CCorespondDisplay::update_actors(float layerID,int& lineID)
{
  std::map<float,CLineSetDisplay*>::iterator itr,etr;
  itr=map_line_actors.begin();etr=map_line_actors.end();
  for (;itr!=etr;++itr)
  {
    if (draw_by_layer)
    {
      bool b=check_display(layerID,itr->first);
      if (b==true)
      {
        itr->second->m_actor->SetVisibility(true);

      }
      else
      {
        itr->second->m_actor->SetVisibility(false);

      }
      itr->second->m_actor->Modified();
    }
    else
    {
      bool b=check_display(layerID,itr->first);
      if (b==true)
      {
        itr->second->set_actor_visibility(true,lineID);
      }
      else
      {
        itr->second->set_actor_visibility(false,lineID);
      }
    }
  }
}
int main(){
    int num;
    printf("Enter positive enter to check:\n");
    scanf("%d",&num);
    check_display(num);  /* Argument num is passed to function. */
    return 0;
}
Exemple #3
0
void motif_init(QSP_ARG_DECL  const char *progname)
{
	const char *argv[1];
	int argc=1;

	argv[0]=progname;

	the_dname = check_display(SINGLE_QSP_ARG);

	/*
	 * initialize the Xt toolkit and create an application context
	 * and shell
	 */

	XtSetLanguageProc ( (XtAppContext) NULL, (XtLanguageProc) NULL, (XtPointer) NULL );
	XtToolkitInitialize ();
	globalAppContext = XtCreateApplicationContext ();
	display = XtOpenDisplay (globalAppContext, the_dname, argv[0],"guimenu",
			NULL, 0, &argc, (char **)argv);
	if (!display) {
		fprintf(stderr, "can't open display\n");
		return;
	}

	add_event_func(QSP_ARG  motif_dispatch);

	// This is not really a motif-specific thing,
	// but we do this here because nav_panel_itp is
	// static to this file...
	if( nav_panel_itp == NO_ITEM_TYPE ){
		init_nav_panels(SINGLE_QSP_ARG);
		add_genwin(QSP_ARG  nav_panel_itp, &navp_genwin_funcs, NULL);
	}
}
Exemple #4
0
static Disp_Obj * default_x_display(SINGLE_QSP_ARG_DECL)
{
	const char *dname;
	Disp_Obj *dop;
	int which_depth;
	char *s;

	dname = check_display(SINGLE_QSP_ARG);

	/* these two lines added so this can be called more than once */
	dop = disp_obj_of(QSP_ARG  dname);
	if( dop != NO_DISP_OBJ ) return(dop);

	s=getenv("DESIRED_DEPTH");
	if( s != NULL ){
		int desired_depth;

		desired_depth=atoi(s);

sprintf(ERROR_STRING,"Desired depth %d obtained from environment",desired_depth);
advise(ERROR_STRING);
		dop = open_display(QSP_ARG  dname,desired_depth);
		if( dop != NO_DISP_OBJ ) return(dop);

		sprintf(ERROR_STRING,"Unable to open display %s with $DESIRED_DEPTH (%d)",
			dname,desired_depth);
		NWARN(ERROR_STRING);
	}
			

	for(which_depth=0;which_depth<MAX_DISPLAY_DEPTHS;which_depth++){
		dop = open_display(QSP_ARG  dname,possible_depths[which_depth]);
		if( dop != NO_DISP_OBJ ){
			if( verbose ){
				sprintf(ERROR_STRING,
					"Using depth %d on display %s",
					possible_depths[which_depth],dname);
				advise(ERROR_STRING);
			}
			return(dop);
		} else {
			if( verbose && which_depth<(MAX_DISPLAY_DEPTHS-1) ){
				sprintf(ERROR_STRING,
			"Couldn't get %d bit visual on device %s, trying %d",
					possible_depths[which_depth],dname,
					possible_depths[which_depth+1]);
				advise(ERROR_STRING);
			}
		}
	}
	if( verbose ){
		sprintf(ERROR_STRING,
	"Couldn't get %d bit visual on device %s, giving up",
			possible_depths[MAX_DISPLAY_DEPTHS-1],dname);
		advise(ERROR_STRING);
	}
	return(dop);
} /* end default_x_display */
Exemple #5
0
const char *_which_display( SINGLE_QSP_ARG_DECL )
{
	display_name = check_display();
	if( !strncmp(display_name, ":0", 1 ))
		display_name=getenv("HOSTNAME");

	if( display_name != NULL && *display_name != 0 ){
	
		if( verbose ) {
			sprintf(DEFAULT_ERROR_STRING,"Using display %s\n",display_name);
			advise(DEFAULT_ERROR_STRING);
		}
		return(display_name);
	}

	if( display_name == NULL )
		warn("environment variable HOSTNAME not set, using :0");
	else if( *display_name == 0 )
		warn("environment variable HOSTNAME set to null string, using :0");
	display_name=":0";

	return(display_name);
}