示例#1
0
/*
 *	zDictionarySortCleanup
 *
 *	Author:	Christian Schafmeister (1991)
 *
 *	If there is a vaSort VARARRAY defined then
 *	destroy it.
 */
static void
zDictionarySortCleanup(DICTIONARY dDict)
{
    if ( dDict->vaSort ) {
	VarArrayDestroy( &(dDict->vaSort) );
    }
}
示例#2
0
/*
 *	XAUESelectRings
 *
 *	Author:	Christian Schafmeister (1991)
 *
 *	Select all of the rings that have ATOMs selected.
 */
XtCallbackProc
XAUESelectRings( Widget wCur, caddr_t PAppData, caddr_t PArg )
{
    LOOP		lInternals, lAtoms;
    int		i;
    INTERNAL	iInt;
    UNIT		uUnit;
    VARARRAY	vaRings;
    ATOM		aFirst, aAtom;
    Widget		wTank;

    PushCurrentPrintSink(ziXAUEPrintSink(wCur));
    DisplayerAccumulateUpdates();


    wTank = zwXAUETank( wCur );


    uUnit = uTankUnit((TANK)wTank);
    vaRings = vaVarArrayCreate(sizeof(INTERNAL));

    /* Find all of the rings in the UNIT and search through the */
    /* INTERNALs of the atom that the user selected for the INTERNAL */
    /* that represents the smallest ring the ATOM is in */

    GraphUtilFindAllSmallestRings(uUnit);

    lAtoms = lLoop((OBJEKT) uUnit, ATOMS );
    while ( (aFirst = (ATOM)oNext(&lAtoms)) ) {
        if ( !bAtomFlagsSet( aFirst, ATOMSELECTED ) )
            continue;
        lInternals = lLoop((OBJEKT) aFirst, INTERNALS );
        while ( (iInt = (INTERNAL)oNext(&lInternals)) ) {
            if ( iInternalType(iInt) == INTERNALRING ) {
                VarArrayAdd( vaRings, (GENP)&iInt );
            }
        }
    }

    for ( i=0; i<iVarArrayElementCount(vaRings); i++ ) {
        iInt = *PVAI( vaRings, INTERNAL, i );
        InternalRingLoopAtoms(iInt);
        MESSAGE(( "Ring size: %d\n", iInternalRingSize(iInt) ));
        while ( (aAtom = aInternalRingNextAtom(iInt)) ) {
            MESSAGE(( "Selecting atom: %s\n", sAtomName(aAtom) ));
            AtomSetFlags( aAtom, ATOMSELECTED );
        }
    }

    lAtoms = lLoop((OBJEKT) uUnit, ATOMS );
    BuildDestroyInternals(&lAtoms);
    VarArrayDestroy( &vaRings );

    TankRedisplayUnit((TANK)wTank);
    DisplayerReleaseUpdates();
    PopCurrentPrintSink();
    return NULL;
}
示例#3
0
/*
 *      ResidueDestroy
 *
 *	Author:	Christian Schafmeister (1991)
 *
 *      Destroy the RESIDUE and all of the residues/atoms within it.
 *
 *      Arguments:
 *      oObject -       A pointer to the object.
 */
void
ResidueDestroy( RESIDUE *rPResidue )
{
    if ( (*rPResidue)->vaImpropers )
	VarArrayDestroy( &(*rPResidue)->vaImpropers );

    FREE( *rPResidue );
    *rPResidue = NULL; 
}