コード例 #1
0
static void pgfilterw_refresh ( void )
/************************************************************************
 * pgpalw_refresh    							*
 *									*
 * This function refeshes the drawn pgen elements and signals for a     *
 * reload of all frames in the loop.  The current pixmap is cleared and *
 * restored from the master copy, then cvg_redraw is called to redraw 	*
 * pgen elements.  The xw driver will then reload the pgen elements for *
 * all the remaining pixmaps in the loop.  This reload will take place  *
 * the next time they are displayed.					*
 *									*
 * static void pgfilterw_refresh ( )					*
 *									*
 * Input parameters:							*
 * Output parameters:							*
 * Return value:							*
 *			NONE						*
 **									*
 * Log:									*
 * J. Wu/SAIC	        07/04   copy from pgpalw_refresh()		*
 * S. Danz/AWC	        07/06   cvg_redraw before crg_rebuild so	*
 *                              autoplacement is ready			*
 * J. Wu/SAIC	        02/08   refresh under user's projection		*
 ***********************************************************************/
{
    Widget	canvas;
    Cardinal	width, height;
    int		ier;
    Boolean	compWinIsUp = False;
    /*---------------------------------------------------------------------*/

    /*
     * Check if the comptational window is up or not.  The refresh should be
     * done on the user's projection
     */
    if ( ncw_isup() ) {
        compWinIsUp = True;
        ncw_unset();
    }


    /*
     * Clear current display
     */
    canvas = (Widget)mcanvw_getDrawingW();
    XtVaGetValues ( canvas,
                    XmNwidth,	&width,
                    XmNheight,	&height,
                    NULL );

    XClearArea ( XtDisplay(canvas), XtWindow(canvas),
                 0, 0, width, height, False );

    /*
     * For each frame, copy from master pixmap to displayable
     * pixmaps in gemwindow.
     */
    xpgrestlp ();

    /*
     * Tell xw driver to refresh the vector graphics
     * for all pixmaps in the loop.
     */
    xpgrfrsh ();

    /*
     * Load and plot the vg elements in current frame.
     */
    cvg_redraw( cvg_getworkfile(), &ier );

    /*
     * Now that we have everything loaded, rebuild the range
     * records
     */
    crg_rebuild ();
    geplot ( &ier );


    /*
     * Reset the comptational window if necessary.
     */
    if ( compWinIsUp ) {
        ncw_set ();
        ncw_sproj ( "PREFS" );
    }

}
コード例 #2
0
ファイル: nmap_loop.c プロジェクト: ArielleBassanelli/gempak
void loop_changeLoop ( int new_loop )
/************************************************************************
 * loop_changeLoop							*
 *									*
 * This function does all the necessary details to change the current	*
 * loop.								*
 *									*
 * void loop_changeLoop (new_loop)					*
 *									*
 * Input parameters:							*
 *	new_loop	int	new loop				*
 *									*
 * Output parameters:							*
 * Return parameters:							*
 *			NONE						*
 *									*
 **									*
 * Log:									*
 * S. Law/GSC		06/00	moved from mbtnw_loopSelBtnCb		*
 * E. Safford/GSC	06/00	fixed order of operation error in pgen	*
 * E. Safford/GSC	06/00	remove loop check                     	*
 * E. Safford/GSC	10/00	add loopw_resetHide call               	*
 * E. Safford/GSC	02/01	avoid palette reset                   	*
 * E. Safford/GSC	04/01	add nmp_sproj() call			*
 * E. Safford/GSC	05/01	use nmp_rstrproj instead of nmp_sproj   *
 * M. Li/GSC		06/01	added mbotw_restoreFade			*
 * H. Zeng/EAI          06/01   added call to loopw_resetHide()         *
 * J. Wu/SAIC		11/01	add param in cvg_load()	calling		*
 * J. Wu/SAIC		11/01	remove redundant crg_init/geplot calls	*
 * J. Wu/SAIC		12/01	add layer in cvg_load()	call		*
 * J. Wu/SAIC		12/01	replace cvg_load() with cvg_redraw()	*
 * H. Zeng/EAI          03/02   set condition for roamw_setup()         *
 * T. Piper/SAIC	06/03	added loop_cmpAttr			*
 * E. Safford/SAIC	02/04	add params to mbotw_restoreFade()       *
 * J. Wu/SAIC		08/04	restart GFA win. if it was in ADD mode	*
 * J. Wu/SAIC		10/04	free GFA block memory			*
 * T. Piper/SAIC        12/04   added aodtw_refresh & cldhgtw_refresh   *
 * H. Zeng/SAIC		01/07   removed mcanvw_setLatlon()		*
 * H. Zeng/SAIC		03/07	added call to seekw_destroyWidget	*
 * B. Yin/SAIC		07/07	remove the part to restart GFA GUI	*
 ***********************************************************************/
{
    int		ier, prev_loop, xx, yy;
    Boolean	attr_flag, palw_flag;
/*---------------------------------------------------------------------*/

/*
 * Before switching loop, reset Hide/Show button.
 */
    loopw_resetHide();

/*
 * Proceed to do switching loop job.
 */
    if ( mmenuw_roamShareGet() ) {
        prev_loop = loop_getCurLoop();
        attr_flag = loop_cmpAttr(new_loop, prev_loop);
    }
    else {
	attr_flag = FALSE;
    }

    seekw_saveGhost (TRUE);

    if ( !attr_flag ) {
        nmp_rstrproj( new_loop, &ier );
    }

    palw_flag = pgpalw_isUp();
    
    if (palw_flag) {

/*
 *  Reset the drawing palete to terminate any pending action(s).
 */	
	pgpalw_classPopdown();
	pgpalw_setupOper();	
	
/*
 *  Restore the frames from the master copies.
 */
  	xpgrestlp (); 
    }

    loop_setCurLoop(new_loop);
    mbtnw_setMbtns();

    loop_restoreLut(new_loop);
    mbotw_restoreFade( new_loop, True );

/*
 *  Tell the xw driver of the new loop, but don't update
 *  the display yet.  Must set the roam factor and signal
 *  to reload the vg elements (if in PGEN) first.
 */ 
/*
 * Check if data selection window is up.
 */
    if ( attr_flag ) {
        if ( !dataw_isUp () ) {
	    xmroam_getPos (&xx,&yy);
	    xmloop_switchLoop (new_loop, FALSE);
	    xmroam_setPos (xx,yy);
        }
	else {
	    xmloop_switchLoop (new_loop, FALSE);
	}
    }
    else {
        xmloop_switchLoop (new_loop, FALSE);
        if ( !dataw_isUp () ) {
            roamw_setup (new_loop, TRUE);
        }
    }

    if (palw_flag) {
        xpgsvlp (&ier);
        xpgrfrsh ();
        crg_rebuild ();

/* 
 * load and plot the current frame.
 */
	cvg_redraw (NULL, &ier);

    }

/*
 *  Now update the display.
 */
    xmloop_switchLoop (new_loop, TRUE); 
    loopw_resetHide();
    aodtw_refresh(TRUE);
    cldhgtw_refresh(TRUE);
    seekw_saveGhost (FALSE);
    seekw_destroyWidget();

}