Beispiel #1
0
OBJEKT AMBER_Combine(OBJEKT  objProt, OBJEKT objLig)
{
	UNIT            uCombined, uCurrent;
	LOOP            lTemp;
	RESIDUE         rRes = NULL;
	OBJEKT          oObj;
	uCombined = (UNIT)objProt;
	oObj = objLig;
	if ( iObjectType( oObj ) != UNITid ) 
	{
		PrintInfo(( "%s:  is type %s", "Ligand", sObjectType(oObj) ));
	}
	uCurrent = (UNIT)oCopy(oObj );
	PrintInfo(( "  Sequence: %s", sContainerName((CONTAINER) uCurrent) ));
	
	if ( uCombined == NULL ) 
	{
		printf( "Copying the first UNIT\n" );
		uCombined = uCurrent;
	} else 
	{
		printf( "Copied a subsequent UNIT\n" );
		printf( "Joining two UNITS \n" );
		UnitJoin( uCombined, uCurrent );
	}
	
	if ( uCombined == NULL ) 
	{
		printf( "No UNITS, so no combine performed\n" );
		return(NULL);
	}
	lTemp = lLoop( (OBJEKT)uCombined, RESIDUES );
	while ( rRes == (RESIDUE)oNext(&lTemp) ) 
	{
		ResidueSetPdbSequence( rRes, iContainerSequence((CONTAINER) rRes) );
	}
	
	return((OBJEKT)uCombined);
}
Beispiel #2
0
    void object::test<7>()
    {
        CPLStringList  oCSL;

        ensure( "7nil", oCSL.List() == NULL );
        
        oCSL.AddString( "def" );
        oCSL.AddString( "abc" );

        ensure_equals( "7", oCSL.Count(), 2 );
        ensure( "70", EQUAL(oCSL[0], "def") );
        ensure( "71", EQUAL(oCSL[1], "abc") );
        ensure( "72", oCSL[17] == NULL );
        ensure( "73", oCSL[-1] == NULL );
        ensure_equals( "74", oCSL.FindString("abc"), 1 );

        CSLDestroy( oCSL.StealList() );
        ensure_equals( "75", oCSL.Count(), 0 );
        ensure( "76", oCSL.List() == NULL );
        
        // Test that the list will make an internal copy when needed to
        // modify a read-only list. 

        oCSL.AddString( "def" );
        oCSL.AddString( "abc" );

        CPLStringList  oCopy( oCSL.List(), FALSE );

        ensure_equals( "77", oCSL.List(), oCopy.List() );
        ensure_equals( "78", oCSL.Count(), oCopy.Count() );

        oCopy.AddString( "xyz" );
        ensure( "79", oCSL.List() != oCopy.List() );
        ensure_equals( "7a", oCopy.Count(), 3 );
        ensure_equals( "7b", oCSL.Count(), 2 );
        ensure( "7c", EQUAL(oCopy[2], "xyz") );
    }