Beispiel #1
0
std::ostream & XmlConverter::print(std::ostream & out, const INode & node)
{
	out << "<node id=" << node.id() << " lat=" << node.latd() << " lon=" << node.lond()  << ">\n";
	printTags(out, node, "\t");
	out << "</node>";
	return out;
}
Beispiel #2
0
std::ostream & XmlConverter::print(std::ostream & out, const IRelation & relation)
{
	out << "<relation id=" << relation.id() << ">\n";
	for(osmpbf::IMemberStream mem(relation.getMemberStream()); !mem.isNull(); mem.next()) {
		out << "\t<member type=" << primitiveTypeToString( mem.type() ) << " ref=" << mem.id() << " role=" << mem.role() << "/>\n";
	}
	printTags(out, relation, "\t");
	out << "</relation>";
	return out;
}
Beispiel #3
0
std::ostream & XmlConverter::print(std::ostream & out, const IWay & way)
{
	out << "<way id=" << way.id() << ">\n";
	for(osmpbf::RefIterator refIt(way.refBegin()), refEnd(way.refEnd()); refIt != refEnd; ++refIt) {
		out << "\t<nd ref=" << *refIt << "/>" << std::endl;
	}
	printTags(out, way, "\t");
	out << "</way>";
	return out;
}
Beispiel #4
0
int main(int argc, char *argv[]) {
	MD3Reader reader;
	MD3Mesh mesh;

	if (argc > 1) {
		reader.open(argv[1]);
	} else {
		reader.open(FILE_PATH);
	}
	bool good_read = reader.readMesh(&mesh);
	reader.close();

	if (!good_read)
		return -1;

	printHeader(mesh.header);
	printFrames(mesh.header->num_frames, mesh.frames);
	printTags(mesh.header->num_tags, mesh.tags);
	printSurfaces(mesh.header->num_surfaces, mesh.surfaces);
}
std::ostream& ossimNitfFileHeader::print(std::ostream& out,
                                         const std::string& prefix ) const
{
   return printTags(out, prefix);
}
Beispiel #6
0
std::ostream& ossimNitfImageHeaderV2_0::print(std::ostream& out,
                                              const std::string& prefix) const
{
   out << setiosflags(std::ios::left)
       << prefix << std::setw(24) << "IM:"
       << theType << "\n"
       << prefix << std::setw(24) << "IID:"
       << theImageId  << "\n"
       << prefix << std::setw(24) << "IDATIM:"
       << theDateTime << "\n" 
       << prefix << std::setw(24) << "TGTID:"
       << theTargetId  << "\n"
       << prefix << std::setw(24) << "ITITLE:"
       << theTitle  << "\n"   
       << prefix << std::setw(24) << "ISCLAS:"
       << theSecurityClassification << "\n"
       << prefix << std::setw(24) << "ISCODE:"
       << theCodewords  << "\n"
       << prefix << std::setw(24) << "ISCTLH:"
       << theControlAndHandling << "\n" 
       << prefix << std::setw(24) << "ISREL:"
       << theReleasingInstructions << "\n" 
       << prefix << std::setw(24) << "ISCAUT:"
       << theClassificationAuthority << "\n" 
       << prefix << std::setw(24) << "ISCTLN:"
       << theSecurityControlNumber << "\n" 
       << prefix << std::setw(24) << "ISDWNG:"
       << theSecurityDowngrade  << "\n"    
       << prefix << std::setw(24) << "ISDEBT:"
       << theDowngradingEvent  << "\n"
       << prefix << std::setw(24) << "ENCRYP:"
       << theEncryption  << "\n"
       << prefix << std::setw(24) << "ISORCE:"
       << theImageSource  << "\n"
       << prefix << std::setw(24) << "NROWS:"
       << theSignificantRows  << "\n"
       << prefix << std::setw(24) << "NCOLS:"
       << theSignificantCols  << "\n"
       << prefix << std::setw(24) << "PVTYPE:"
       << thePixelValueType  << "\n"
       << prefix << std::setw(24) << "IREP:"
       << theRepresentation  << "\n"
       << prefix << std::setw(24) << "ICAT:"
       << theCategory  << "\n"      
       << prefix << std::setw(24) << "ABPP:"
       << theActualBitsPerPixelPerBand << "\n"
       << prefix << std::setw(24) << "PJUST:"
       << theJustification  << "\n"
       << prefix << std::setw(24) << "ICORDS:"
       << theCoordinateSystem  << "\n"
       << prefix << std::setw(24) << "IGEOLO:"
       << theGeographicLocation  << "\n"
       << prefix << std::setw(24) << "NICOM:"
       << theNumberOfComments << "\n" 
       << prefix << std::setw(24) << "IC:"
       << theCompression  << "\n"     
       << prefix << std::setw(24) << "COMRAT:"
       << theCompressionRateCode  << "\n"
       << prefix << std::setw(24) << "NBANDS:"
       << theNumberOfBands  << "\n";

   ossim_uint32 idx = 0;
   for(idx = 0; idx < theImageBands.size(); ++idx)
   {
      if(theImageBands[idx].valid())
      {
         theImageBands[idx]->print(out, prefix, idx); 
      }
   }
   
   out << prefix << std::setw(24) << "ISYNC:"
       << theImageSyncCode << "\n" 
       << prefix << std::setw(24) << "IMODE:"
       << theImageMode  << "\n"
       << prefix << std::setw(24) << "NBPR:"
       << theNumberOfBlocksPerRow << "\n" 
       << prefix << std::setw(24) << "NBPC:"
       << theNumberOfBlocksPerCol << "\n" 
       << prefix << std::setw(24) << "NPPBH:"
       << theNumberOfPixelsPerBlockHoriz << "\n" 
       << prefix << std::setw(24) << "NPPBV:"
       << theNumberOfPixelsPerBlockVert  << "\n"
       << prefix << std::setw(24) << "NBPP:"
       << theNumberOfBitsPerPixelPerBand  << "\n"
       << prefix << std::setw(24) << "IDLVL:"
       << theDisplayLevel << "\n"
       << prefix << std::setw(24) << "IALVL:"
       << theAttachmentLevel << "\n" 
       << prefix << std::setw(24) << "ILOC:"
       << theImageLocation << "\n" 
       << prefix << std::setw(24) << "IMAG:"
       << theImageMagnification  << "\n"
       << prefix << std::setw(24) << "UDIDL:"
       << theUserDefinedImageDataLength  << "\n"
       << prefix << std::setw(24) << "UDOFL:"
       << theUserDefinedOverflow  << "\n"
       << prefix << std::setw(24) << "IXSHDL:"
       << theExtendedSubheaderDataLen  << "\n"
       << prefix << std::setw(24) << "IXSOFL:"
       << theExtendedSubheaderOverflow  << "\n";

   if ( traceDebug() )
   {
       out << prefix << std::setw(24) << "theDataLocation:"
           << theDataLocation << "\n"
           << prefix << std::setw(24) << "theBlockedImageDataOffset:"
           << theBlockedImageDataOffset << "\n"
           << prefix << std::setw(24) << "theBlockMaskRecordLength:"
           << theBlockMaskRecordLength << "\n"
           << prefix << std::setw(24) << "thePadPixelMaskRecordLength:"
           << thePadPixelMaskRecordLength << "\n"
           << prefix << std::setw(24) << "theTransparentOutputPixelCodeLength:"
           << theTransparentOutputPixelCodeLength << "\n"
           << prefix << std::setw(24) << "thePadOutputPixelCode:"
           << thePadOutputPixelCode << "\n";
   }

   if(theCompressionHeader.valid())
   {
      theCompressionHeader->print(out, prefix);
   }

   out << std::endl;

   return printTags(out, prefix);
}
void SlideProperties::paintEvent(QPaintEvent*)
{
    QPainter p(this);

    QString str;
    PhotoInfoContainer photoInfo = d->info.photoInfo;
    QString            comment   = d->info.comment;
    QString            title     = d->info.title;
    QStringList tags             = d->info.tags;
    int offset                   = 0;

    // Display tag names.

    if (d->settings.printTags)
    {
        printTags(p, offset, tags);
    }

    // Display Titles.

    if (d->settings.printTitle)
    {
        str.clear();

        if (!title.isEmpty())
        {
            str += title;
            printInfoText(p, offset, str);
        }
    }

    // Display Captions if no Titles.

    if (d->settings.printCapIfNoTitle)
    {
        str.clear();

        if (title.isEmpty())
        {
            str += comment;
            printComments(p, offset, str);
        }
    }

    // Display Comments.

    if (d->settings.printComment)
    {
        str = comment;
        printComments(p, offset, str);
    }

    // Display Make and Model.

    if (d->settings.printMakeModel)
    {
        str.clear();

        if (!photoInfo.make.isEmpty())
        {
            ImagePropertiesTab::shortenedMakeInfo(photoInfo.make);
            str = photoInfo.make;
        }

        if (!photoInfo.model.isEmpty())
        {
            if (!photoInfo.make.isEmpty())
            {
                str += QString(" / ");
            }

            ImagePropertiesTab::shortenedModelInfo(photoInfo.model);
            str += photoInfo.model;
        }

        printInfoText(p, offset, str);
    }

    // Display Exposure and Sensitivity.

    if (d->settings.printExpoSensitivity)
    {
        str.clear();

        if (!photoInfo.exposureTime.isEmpty())
        {
            str = photoInfo.exposureTime;
        }

        if (!photoInfo.sensitivity.isEmpty())
        {
            if (!photoInfo.exposureTime.isEmpty())
            {
                str += QString(" / ");
            }

            str += i18n("%1 ISO", photoInfo.sensitivity);
        }

        printInfoText(p, offset, str);
    }

    // Display Aperture and Focal.

    if (d->settings.printApertureFocal)
    {
        str.clear();

        if (!photoInfo.aperture.isEmpty())
        {
            str = photoInfo.aperture;
        }

        if (photoInfo.focalLength35mm.isEmpty())
        {
            if (!photoInfo.focalLength.isEmpty())
            {
                if (!photoInfo.aperture.isEmpty())
                {
                    str += QString(" / ");
                }

                str += photoInfo.focalLength;
            }
        }
        else
        {
            if (!photoInfo.aperture.isEmpty())
            {
                str += QString(" / ");
            }

            if (!photoInfo.focalLength.isEmpty())
            {
                str += QString("%1 (%2)").arg(photoInfo.focalLength).arg(photoInfo.focalLength35mm);
            }
            else
            {
                str += QString("%1").arg(photoInfo.focalLength35mm);
            }
        }

        printInfoText(p, offset, str);
    }

    // Display Creation Date.

    if (d->settings.printDate)
    {
        if (photoInfo.dateTime.isValid())
        {
            str = KGlobal::locale()->formatDateTime(photoInfo.dateTime, KLocale::ShortDate, true);
            printInfoText(p, offset, str);
        }
    }

    // Display image File Name.

    if (d->settings.printName)
    {
        printInfoText(p, offset, d->url.fileName());
    }
}
int main(void) {

	setvbuf(stdout, NULL, _IONBF, 0);

	char HtmlDoc[50000];
	char buffer[BUFSIZ + 1];
	char url[BUFSIZ + 1];
	int count = 0;

	printf("URL:\n");
	gets(url);

	char urlString[BUFSIZ + 1];
	strcpy(urlString, "curl -s ");
	strcat(urlString, url);

	fp = popen(urlString, "r");

	char * tempSrc;
	char *pQ1;
	char *pQ2;
	char tempWord[BUFSIZ + 1];
	char * tempTags;
	int numBetween;

	//Reads in the data from the URL
	while (!feof(fp)) {
		numBetween = 0;

		fgets(buffer, BUFSIZ, fp);

		strcat(HtmlDoc, buffer);

		tempSrc = strstr(buffer, "src=");

		if ((tempSrc != NULL) && (isspace(*(tempSrc - 1)))) {
			count++;
			int i = 1;

		}

	}

	pclose(fp);

	printf("Ready\n");

	char command = 'n';
	int done = 0;

	while (done == 0) {

		command = *gets(buffer);
		// A switch that waits for a command to print things
		switch (command) {

		//Prints number of valid src attributes
		case 'c':
			printf("%d\n", count);
			printf("Ready\n");
			break;

			//Prints number of tags
		case 't':
			printTags(HtmlDoc);

			printf("Ready\n");
			break;

			// Prints the URLS
		case 'u':
			printURLS(HtmlDoc);
			printf("Ready\n");
			break;
		case 'f':
			printf("f");
			printf("Ready\n");
			break;

			//Quits the program
		case 'q':

			tempTags = strstr(buffer, "<");

			printf("Complete\n");
			done = 1;
			break;
		}

	}

}