// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void TestErrorMessage() { PipelineMessage e0; QString a0("Some Class Name"); QString a1("Description"); int eCode = -10; PipelineMessage e1; PipelineMessage e2(a0, a1, eCode); AbstractFilter::Pointer f = AbstractFilter::New(); f->notifyErrorMessage("Some Test", a1, eCode); f->notifyErrorMessage("Another Test", "A description", -10); PipelineMessage pm("Joey's Test", "Testing Warning Message...", -23, PipelineMessage::Warning); PipelineMessage pm1("Joey's Test", "Testing Error Message...", -23, PipelineMessage::Error); PipelineMessage pm2("Joey's Test", "Testing Status Message...", -23, PipelineMessage::StatusMessage); PipelineMessage pm3("Joey's Test", "Testing Status Message...", -23, PipelineMessage::ProgressValue, 23); f->broadcastPipelineMessage(pm); f->broadcastPipelineMessage(pm1); f->broadcastPipelineMessage(pm2); if (true) { return; } }
void object::test<5>() { PrecisionModel pm3(0.001); GeometryFactory gf3(&pm3); WKTReader wktreader3(&gf3); GeomPtr geom ( wktreader3.read("POINT(123456 654321)") ); std::string result = wktwriter.write( geom.get() ); ensure_equals( result, std::string("POINT (123000 654000)") ); }
void TabGuides::restoreDefaults(struct GuidesPrefs *prefsData, struct TypoPrefs *prefsData2, int unitIndex) { QString unit = unitGetSuffixFromIndex(unitIndex); double unitRatio = unitGetRatioFromIndex(unitIndex); int decimals = unitGetPrecisionFromIndex(unitIndex); QPixmap pm3(54, 14); pm3.fill(prefsData->guideColor); colorGuides = prefsData->guideColor; guideColor->setIcon(pm3); QPixmap pm6(54, 14); pm6.fill(prefsData->marginColor); colorMargin = prefsData->marginColor; marginColor->setIcon(pm6); QPixmap pm1(54, 14); pm1.fill(prefsData->majorGridColor); colorMajorGrid = prefsData->majorGridColor; majorGridColor->setIcon(pm1); QPixmap pm(54, 14); pm.fill(prefsData->minorGridColor); colorMinorGrid = prefsData->minorGridColor; minorGridColor->setIcon(pm); QPixmap pm4(54, 14); pm4.fill(prefsData->baselineGridColor); colorBaselineGrid = prefsData->baselineGridColor; baselineColor->setIcon(pm4); minorSpace->setDecimals( decimals ); minorSpace->setValue(prefsData->minorGridSpacing * unitRatio); minorSpace->setSuffix( unit ); majorSpace->setDecimals( decimals ); majorSpace->setValue(prefsData->majorGridSpacing * unitRatio); majorSpace->setSuffix( unit ); snapDistance->setValue(qRound(prefsData->guideRad)); snapDistance->setSuffix( " " + tr( "px" ) ); grabDistance->setValue(prefsData->grabRadius); grabDistance->setSuffix( " " + tr( " px" ) ); baseGrid->setValue(prefsData->valueBaselineGrid); baseOffset->setValue(prefsData->offsetBaselineGrid); inBackground->setChecked( prefsData->guidePlacement ); inForeground->setChecked( !prefsData->guidePlacement ); baselineBox->setChecked(prefsData->baselineGridShown); checkGrid->setChecked(prefsData->gridShown); marginBox->setChecked(prefsData->marginsShown); guideBox->setChecked(prefsData->guidesShown); }