Exemplo n.º 1
0
void ContractLineRec::dump(ofstream &of) const
{
	of.width(2);
	char fc = of.fill('0');
	of << ContractLine
       << Date
       << PostingCode
       << Contract;

	RecordFactory::DumpDouble(of, Amount);
	RecordFactory::DumpDouble(of, Discount);

	of << RefNum
       << SvcAddr
       << CoveragePeriod
       << RenewalPeriod
       << ConsecutiveMonthsLeft
       << ConsecutiveMonthsTotal;

	RecordFactory::DumpDouble(of, Deviation);

	of.width(3);
	of << Location
	   << '\n';

	of.fill(fc);
}
Exemplo n.º 2
0
void InfoHeaderRec::dump(ofstream &of) const
{
	of.width(2);
	char fc = of.fill('0');
	of << InfoHeader << '\n';
	
	of.fill(fc);
}
Exemplo n.º 3
0
void PromptPayMsgRec::dump(ofstream &of) const
{
	of.width(2);
	char fc = of.fill('0');
	of << PromptPayMsg;
	
	of << Message << '\n';

	of.fill(fc);
}
Exemplo n.º 4
0
void MeterInfoRec::dump(ofstream &of) const
{
	of.width(2);
	char fc = of.fill('0');
	of << MeterInfo;

	of << '\n';
	
	of.fill(fc);
}
Exemplo n.º 5
0
void StatementAddrRec::dump(ofstream &of) const
{
	of.width(2);
	char fc = of.fill('0');
	of << StatementAddr;

	of.fill(' ');
	of << Address << '\n';

	of.fill(fc);
}
Exemplo n.º 6
0
void LineItemAddrRec::dump(ofstream &of) const
{
	of.width(2);
	char fc = of.fill('0');
	of << LineItemAddr;

	of.fill(' ');
	of << Address << '\n';

	of.fill(fc);
}
Exemplo n.º 7
0
void FinChgInfoRec::dump(ofstream &of) const
{
	of.width(2);
	char fc = of.fill('0');
	of << FinChgInfo;

	of << ChargeDate
	   << RefNum
	   << '\n';
	
	of.fill(fc);	
}
Exemplo n.º 8
0
void ContractInfoRec::dump(ofstream &of) const
{
	of.width(2);
	char fc = of.fill('0');
	of << ContractInfo;
	
	of << Contract;

    of << Text << '\n';

	of.fill(fc);
}
Exemplo n.º 9
0
void ContractFlagsRec::dump(ofstream &of) const
{
	of.width(2);
	char fc = of.fill('0');
	of << ContractFlags;

	of << TotalMessage
	   << BudgetIncludeFlag
	   << '\n';
	
	of.fill(fc);	
}
Exemplo n.º 10
0
void ContractTaxLineRec::dump(ofstream &of) const
{
	of.width(2);
	char fc = of.fill('0');
	of << ContractTaxLine;
	
	RecordFactory::DumpDouble(of, SalesTax);
	RecordFactory::DumpDouble(of, TotalAmount);

	of << '\n';

	of.fill(fc);
}
Exemplo n.º 11
0
void DiscntInfoRec::dump(ofstream &of) const
{
	of.width(2);
	char fc = of.fill('0');
	of << DiscntInfo;

	of << DiscDate;

	RecordFactory::DumpDouble(of, DiscAmt, 9, 2, true);

	of << '\n';

	of.fill(fc);
}
Exemplo n.º 12
0
void PostingCode::dump(ofstream &of) const
{
	of.width(2);
	char fc = of.fill('0');
	of << PostCode;
	of.width(3);
	of << Code;
	
	of << ShortDesc
	   << Description
	   << '\n';

	of.fill(fc);
}
Exemplo n.º 13
0
extern void ReportCrashInfo(ofstream& dump, EXCEPTION_POINTERS* exp)
{
	dump << "---------------------------------------------------------------------------------------------------\n";

	// report when exception occured
	dump.fill('0');

	SYSTEMTIME st;
	::GetLocalTime(&st);
	dump << st.wYear << '-' << setw(2) << st.wMonth << '-' << setw(2) << st.wDay << ' ' <<
		setw(2) << st.wHour << ':' << setw(2) << st.wMinute << ':' << setw(2) << st.wSecond << '.' << st.wMilliseconds;

	dump << '\n';

	// app version
	string app;
	WideStringToMultiByte(GetAppIdentifier(true), app);
	dump << app << '\n';

	// dump exception information
	if (exp)
		dump << DumpExceptionInfo(exp) << '\n';

	dump << DumpMemoryStatus() << '\n';

	// and call stack
	if (exp)
		dump << DumpTheStack(exp->ContextRecord) << endl;
}
Exemplo n.º 14
0
void DivisionRec::dump(ofstream &of) const
{
	of.width(2);
	char fc = of.fill('0');
	of << Division;
	of.width(2);
	of << DivNum;
	
	of << DivisionName
	   << DivisionAddr1
	   << DivisionAddr2
	   << DivisionAddr3
	   << '\n';

	of.fill(fc);
}
Exemplo n.º 15
0
void TrailerRec::dump(ofstream &of) const
{
	of.width(2);
	char fc = of.fill('0');
	of << Trailer;

	of << Date
	   << Time;

	of.fill(' ');
	of.width(7);
	of << TotalItems;
	
	of.fill('0');
	RecordFactory::DumpDouble(of, TotalBilled, 10);
	of << '\n';
	
	of.fill(fc);
}
Exemplo n.º 16
0
void DocumentHeaderRec::dump(ofstream &of) const
{
	of.width(2);
	char fc = of.fill('0');
	of << DocHeader;

	of << docType
	   << docDate
	   << db
	   << budgetDue
	   << budgetMonDue;
	for (int i = 0; i < 11; i++)
	{
		of << docMessage[i];
	}
	of << logo
	   << expDB
	   << '\n';

	of.fill(fc);
}
Exemplo n.º 17
0
void TrailerRec::dumpNew(ofstream &of, int dumpCount, double dump_stmt_bal) const
{
	of.width(2);
	char fc = of.fill('0');
	of << Trailer;

	time_t tt = time(0);
	struct tm *t = localtime(&tt);
	char timebuf[14+1];
	strftime(timebuf, sizeof(timebuf), "%m%d%y%I:%M %p", t);
	of << timebuf;

	of.fill(' ');
	of.width(7);
	of << dumpCount;
	
	of.fill('0');
	RecordFactory::DumpDouble(of, dump_stmt_bal, 10);

	of << '\n';
	
	of.fill(fc);
}
Exemplo n.º 18
0
/** writes the genotype of the individual to the stream (for multiple instances of the same trait)*/
void FileHandler::FHwriteIndividual2Stream(ofstream& FILE, Individual* ind, const int& ploidy, const int& position){
	int nb_locus;
	unsigned char** seq;
  for(int t=0; t<_nb_trait; ++t){
    nb_locus = _trait[t]->get_nb_locus();
		seq = (unsigned char**)ind->getTrait(_TTidx[t])->get_sequence();
		for(int k = 0; k < nb_locus; ++k) {
			for (int l = 0; l < ploidy; ++l) {
				FILE.fill('0');
				FILE.width(position);
				FILE<<(unsigned int)(seq[k][l]+1);
			}
			FILE<<" ";
		}
	}
}
Exemplo n.º 19
0
void CreditInfoRec::dump(ofstream &of) const
{
	of.width(2);
	char fc = of.fill('0');
	of << CreditInfo;

	RecordFactory::DumpDouble(of, FinanceCharge);
	RecordFactory::DumpDouble(of, BudgetInterest);
	if (file_ver <= 1)
	{
		RecordFactory::DumpDouble(of, CurrentOld);
		RecordFactory::DumpDouble(of, OldPastDue1);
		RecordFactory::DumpDouble(of, OldPastDue2);
		RecordFactory::DumpDouble(of, OldPastDue3);
		RecordFactory::DumpDouble(of, OldPastDue4);
	}
	else
	{
		RecordFactory::DumpDouble(of, Current);
		RecordFactory::DumpDouble(of, PastDue1);
		RecordFactory::DumpDouble(of, PastDue2);
		RecordFactory::DumpDouble(of, PastDue3);
		RecordFactory::DumpDouble(of, PastDue4);
	}

	if (PriceProgGallonsRemain * 100 < 0.99)
		of << "         ";
	else
		RecordFactory::DumpDouble(of, PriceProgGallonsRemain);

	of << Addr
	   << DunningMsg[0]
	   << DunningMsg[1];

	for (int i = 0; i < 24; i++)
		of << SummaryMsg[i];

	RecordFactory::DumpDouble(of, FinanceChargeAnnualRate, 4, 2, true);
	RecordFactory::DumpDouble(of, FinanceChargeMonthlyRate, 4, 2, true);
	RecordFactory::DumpDouble(of, AvgDailyBal, 9, 2, true);

	of << FinanceChargeDate;

	if (file_ver >= 1)
	{
		of << FinanceChargeDueDate;
		RecordFactory::DumpDouble(of, LateFee);
	}
	
	if (file_ver >= 2)
	{
		RecordFactory::DumpDouble(of, Current,  12);
		RecordFactory::DumpDouble(of, PastDue1, 12);
		RecordFactory::DumpDouble(of, PastDue2, 12);
		RecordFactory::DumpDouble(of, PastDue3, 12);
		RecordFactory::DumpDouble(of, PastDue4, 12);
	}

	of << "\n";
	of.fill(fc);
}
Exemplo n.º 20
0
void GeometryExportFile::writeModel( Object *o, ofstream &out )
{

    out << 
    "{ 'MODL'\n"
    "   { 'SRC' \"Innovation 3D exported by WF geometry exporter V0.11\"" 
    "   }\n"
    "   { 'TRGT' \"World Foundy Game Engine (www.worldfoundry.org)\"\n" 
    "   }\n" << endl;

    out <<
    "   { 'NAME' \"" << o->getName() << "\"\n" 
    "   }\n";


    out.setf(std::ios::showpoint);

     //Vector4 pos;
    float texturex=0;
    float texturey=0;
    float color=0;
     //pos = o->getPosition();

    int oldWidth = out.width(8);
    char oldFill = out.fill('0');

    // kts i3d is a left handed coordinate system with positive y up, WF is left handed with positive z up
    // so I rotate -90 degrees around x putting y up (swap y&z, negate the new y)

    VertexList *vlist = o->getVerts();
    int size = (int)vlist->size();
    Vector4 vertpos;
    Vector4 uv;

    for(int i=0; i<size; i++)
    {
        vertpos = (*vlist)[i]->getPosition();
        VertexAndUV vuv;
        vuv.position = vertpos;

    }

    CreateVertUVList(o);
    WriteVertexList(out);

    out << "    { 'MATL' //flags: [FLAT_SHADED=0, GOURAUD_SHADED=1] [SOLID_COLOR=0, TEXTURE_MAPPED=2] [SINGLE_SIDED=0, TWO_SIDED=8]" << endl;

        //save materials here.

    ObjectDB *odb = I3D::getDB();

    TextureMaterial *m;
    for(int materialIndex=0; materialIndex<odb->numMaterials(); materialIndex++)
    {
        m = odb->getMaterial(materialIndex);

        _MaterialOnDisk mod;

        mod._materialFlags = 0;
        if(m->enable_texture)
            mod._materialFlags |= TEXTURE_MAPPED;

        for(int temp=0;temp<MATERIAL_NAME_LEN;temp++)
            mod.textureName[temp] = 0;

        if(m->texture)
            strncpy(mod.textureName, m->texture->getFilename()->ascii(), MATERIAL_NAME_LEN);
        mod.textureName[MATERIAL_NAME_LEN-1] = 0;    // make sure it is 0 terminated

        mod._color = ((((unsigned int)m->cDiffuse.r)<<16) |
                      (((unsigned int)m->cDiffuse.g)<<8) |
                      ((unsigned int)m->cDiffuse.b));

        out << "            //Material " << materialIndex << ": flags: " << mod._materialFlags << ", color: " << hex << mod._color << dec << ", texturename: \"" << mod.textureName << "\"" << endl;
        out << "        ";
                                                                  
        for(int index=0;index<sizeof(_MaterialOnDisk);index++)
        {
            out << (unsigned int)(((unsigned char*)&mod)[index]) << "y ";
        }
        out << " // #" << materialIndex << endl;

    }
    out << "    }" << endl;        

    // faces
    size = (int)o->numFaces();

    out << "    { 'FACE' // count = " << size << endl;

        
    for(int faceIndex=0; faceIndex<size; faceIndex++)
    {
        Face* face = o->getFace(faceIndex);
        vector<int> *vlist = face->getVerts();
        vector<int> *uvlist = face->getUVs();

        assert(vlist->size() >= 3);              // must be at least a triangle

        // output list of triangles for this face
        
        // make a fan of triangles, first vertex is the same for all polys
        int vert1 = LookupVertUVEntry(CreateVUV(*face,vlist, 0, o->getTextureMaterial()));
        // second point                                         
        int vert2 = LookupVertUVEntry(CreateVUV(*face,vlist, 1, o->getTextureMaterial()));
        
        for(int vertexIndex=2;vertexIndex<vlist->size();vertexIndex++)
        {
            VertexAndUV vuv3 = CreateVUV(*face,vlist, vertexIndex, o->getTextureMaterial());
            int vert3 = LookupVertUVEntry(vuv3);
            int materialIndex = -1;
    
            if(o->getTextureMaterial() != 0)
            {
                materialIndex = I3D::getDB()->getMaterialIndex(o->getTextureMaterial());
            }
            else
                cerr << "material not set!" << endl;
            
            out << "        " << vert1 << "w " << vert2 << "w " << vert3 << "w " << materialIndex << "w   // face #" << faceIndex << ", poly #" << vertexIndex << endl;    
            
            // vert2 on next fan is vert3 from this fan
            vert2 = vert3;
        }
    }

    out << "    }" << endl;


    out << "}" << endl;
}
Exemplo n.º 21
0
void LineItemRec::dump(ofstream &of) const
{
	of.width(2);
	char fc = of.fill('0');
	of << LineItem;

	of << TransDate
	   << TransCode;
	
	of.fill('0');
	if (file_ver <= 1)
	{
		RecordFactory::DumpDouble(of, TransDollarsOld);
		RecordFactory::DumpDouble(of, TransGallonsOld, 9, 1);
	}
	else
	{
		RecordFactory::DumpDouble(of, TransDollars);
		RecordFactory::DumpDouble(of, TransGallons, 9, 1);
	}
	RecordFactory::DumpDouble(of, TransUnitPrice, 8, 4);

	of << RefNum
	   << Addr
	   << DetailMsg[0]
	   << DetailMsg[1]
	   << CylQuantDeliv
	   << CylQuantReturn
	   << PONum;

	if (TransWasMinCharge)
		of << 'Y';
	else
		of << ' ';

	if (file_ver == 0)
	{
		RecordFactory::DumpDouble(of, OrigTransDollarsOld);
	}
	else
	{
		RecordFactory::DumpDouble(of, OrigTransDollars);
	}

	if (file_ver <= 1)
	{
		of << "                                          ";
	}
	else if (file_ver >= 2)
	{
		of << DueDate << NetDays;
		if (KeyOffFlag || !Statement->isOpenItem())
			of << ' ';
		else
			of << 'N';
			
		if (EFTTrans)
			of << 'E';
		else
			of << 'N';
			
		RecordFactory::DumpDouble(of, TransGallons, 10);
		RecordFactory::DumpDouble(of, TransDollars, 10);
		RecordFactory::DumpDouble(of, OrigTransDollars, 10);
	}

	if (file_ver >= 3)
	{
		char fc = of.fill('0');
		of.width(3);
		of << TankNum;
		of.fill(fc);
	}
        if (file_ver >= 4)
        {
            RecordFactory::DumpDouble(of, TransUnitPrice2, 8);
        }

	of << '\n';
	of.fill(fc);
}