本文整理汇总了C++中Output类的典型用法代码示例。如果您正苦于以下问题:C++ Output类的具体用法?C++ Output怎么用?C++ Output使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Output类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: selectOutput
void ShellSurface::setFullscreen()
{
m_nextType = Type::Toplevel;
m_toplevel.fullscreen = true;
m_toplevel.maximized = false;
Output *output = selectOutput();
QRect rect = output->geometry();
Debug::debug("Fullscrening surface '{}' on output '{}' with rect {}", surface(), output, rect);
sendConfigure(rect.width(), rect.height());
}
示例2: _writeFloatInRange
void CmfSaver::_writeFloatInRange (Output &output, float v, float min, float range)
{
if (range > EPSILON)
{
float v2 = (((v - min) / range) * 65535 + 0.5f);
if (v2 < 0 || v2 > 65536)
throw Error("Internal error: Value %f is outsize of [%f, %f]", v, min, min + range);
output.writeBinaryWord((word)v2);
}
else
output.writeBinaryWord(0);
}
示例3: print_method
void print_method(Output& out, const Func* func) {
auto const finfo = find_func_info(func);
out.fmtln(".method{} {}({}) {{",
opt_attrs(AttrContext::Func, func->attrs()),
func->name()->data(),
func_param_list(finfo));
indented(out, [&] {
print_func_directives(out, func);
print_func_body(out, finfo);
});
out.fmtln("}}");
}
示例4: TEST
// -----------------------------------------
// tests
// -----------------------------------------
TEST(ExtendedKalmanFilterTest, initialization)
{
ExtendedKalmanFilter ekf;
// check setting required params
EXPECT_THROW(ekf.validate(), IEstimator::estimator_error); // "STM missing"
ekf.setStateTransitionModel(f);
EXPECT_THROW(ekf.validate(), IEstimator::estimator_error); // "Jacobian of STM missing"
ekf.setJacobianOfStateTransitionModel(df);
EXPECT_THROW(ekf.validate(), IEstimator::estimator_error); // "OM missing"
ekf.setObservationModel(h);
EXPECT_THROW(ekf.validate(), IEstimator::estimator_error); // "Jacobian of OM missing"
ekf.setJacobianOfObservationModel(dh);
EXPECT_THROW(ekf.validate(), IEstimator::estimator_error); // "PNC missing"
MatrixXd Q(1,1); Q << 0.1;
ekf.setProcessNoiseCovariance(Q);
EXPECT_THROW(ekf.validate(), IEstimator::estimator_error); // "MNC missing"
MatrixXd R(1,1); R << 10;
ekf.setMeasurementNoiseCovariance(R);
EXPECT_NO_THROW(ekf.validate()); // all required params given
// check setting optional params
// optional params doesn't set new sizes
MatrixXd P0_f(2,2); P0_f << 1, 0, 0, 1;
ekf.setInitialErrorCovariance(P0_f);
EXPECT_NO_THROW(ekf.validate());
EXPECT_EQ(ekf.getState().size(), 1);
VectorXd x_f(2); x_f << 0,1;
ekf.setInitialState(x_f);
EXPECT_NO_THROW(ekf.validate());
EXPECT_NE(ekf.getState().size(), 2);
// required param Q sets new size of x and out
MatrixXd Q2(2,2); Q2 << 0.1, 0, 0, 0.1;
ekf.setProcessNoiseCovariance(Q2);
EXPECT_NO_THROW(ekf.validate());
EXPECT_EQ(ekf.getState().size(), 2);
EXPECT_EQ(ekf.getLastEstimate().size(), 2);
// check initialization of output
Output out = ekf.getLastEstimate();
OutputValue defaultOutVal;
EXPECT_GT(out.size(), 0);
EXPECT_DOUBLE_EQ(out.getValue(), defaultOutVal.getValue());
// check setting the control input
InputValue ctrl(0);
Input in_ctrl(ctrl);
EXPECT_THROW(ekf.setControlInput(in_ctrl), length_error);
ekf.setControlInputSize(1);
EXPECT_NO_THROW(ekf.setControlInput(in_ctrl));
}
示例5: PositionAttitudeTransform_writeLocalData
bool PositionAttitudeTransform_writeLocalData(const Object& obj, Output& fw)
{
const PositionAttitudeTransform& transform = static_cast<const PositionAttitudeTransform&>(obj);
fw.indent()<<"position "<<transform.getPosition()<<std::endl;
fw.indent()<<"attitude "<<transform.getAttitude()<<std::endl;
fw.indent()<<"scale "<<transform.getScale()<<std::endl;
fw.indent()<<"pivotPoint "<<transform.getPivotPoint()<<std::endl;
return true;
}
示例6: print_cls_inheritance_list
void print_cls_inheritance_list(Output& out, const PreClass* cls) {
if (!cls->parent()->empty()) {
out.fmt(" extends {}", cls->parent());
}
if (!cls->interfaces().empty()) {
out.fmt(" implements (");
for (auto i = uint32_t{}; i < cls->interfaces().size(); ++i) {
out.fmt("{}{}", i != 0 ? " " : "", cls->interfaces()[i].get());
}
out.fmt(")");
}
}
示例7: TexGenNode_writeLocalData
bool TexGenNode_writeLocalData(const Object& obj, Output& fw)
{
const TexGenNode& texGenNode = static_cast<const TexGenNode&>(obj);
fw.indent()<<"TextureUnit "<<texGenNode.getTextureUnit()<<std::endl;
if (texGenNode.getTexGen())
{
fw.writeObject(*texGenNode.getTexGen());
}
return true;
}
示例8: FrontFace_writeLocalData
bool FrontFace_writeLocalData(const Object &obj, Output &fw)
{
const FrontFace &frontface = static_cast<const FrontFace&>(obj);
switch (frontface.getMode())
{
case (FrontFace::CLOCKWISE): fw.indent() << "mode CLOCKWISE" << std::endl; break;
case (FrontFace::COUNTER_CLOCKWISE): fw.indent() << "mode COUNTER_CLOCKWISE" << std::endl; break;
}
return true;
}
示例9: VisibilityGroup_writeLocalData
bool VisibilityGroup_writeLocalData(const Object& obj, Output& fw)
{
const VisibilityGroup& vg = static_cast<const VisibilityGroup&>(obj);
fw.indent()<<"volumeIntersectionMask 0x"<<std::hex<<vg.getVolumeIntersectionMask()<<std::dec<<std::endl;
fw.indent()<<"segmentLength "<<vg.getSegmentLength()<<std::endl;
fw.indent()<<"visibilityVolume" <<std::endl;
fw.moveIn();
fw.writeObject(*vg.getVisibilityVolume());
fw.moveOut();
return true;
}
示例10: action_set_output
/* Set an output's next value to the value of the sensor */
void action_set_output(int pin, int value, void *arg)
{
Output *out = (Output *)arg;
out->setValue(value);
DEBUG3_PRINT("set_output: pin-");
DEBUG3_PRINT(pin);
DEBUG3_PRINT(" value-");
DEBUG3_PRINT(value);
DEBUG3_PRINT(" outpin-");
DEBUG3_PRINT(out->_value);
DEBUG3_PRINT("\n");
}
示例11: Geode_writeLocalData
bool Geode_writeLocalData(const osg::Object& obj, Output& fw)
{
const Geode& geode = static_cast<const Geode&>(obj);
fw.indent() << "num_drawables " << geode.getNumDrawables() << std::endl;
for(unsigned int i=0;i<geode.getNumDrawables();++i)
{
fw.writeObject(*geode.getDrawable(i));
}
return true;
}
示例12: print_cls_used_traits
void print_cls_used_traits(Output& out, const PreClass* cls) {
auto& traits = cls->usedTraits();
if (traits.empty()) return;
out.indent();
out.fmt(".use");
for (auto i = uint32_t{0}; i < traits.size(); ++i) {
out.fmt(" {}", traits[i].get());
}
auto& precRules = cls->traitPrecRules();
auto& aliasRules = cls->traitAliasRules();
if (precRules.empty() && aliasRules.empty()) {
out.fmt(";");
out.nl();
return;
}
out.fmt(" {{");
out.nl();
indented(out, [&] {
for (auto& prec : precRules) {
out.fmtln("{}::{} insteadof{};",
prec.selectedTraitName()->data(),
prec.methodName()->data(),
[&]() -> std::string {
auto ret = std::string{};
for (auto& name : prec.otherTraitNames()) {
ret += folly::format(" {}", name.get()).str();
}
return ret;
}()
);
}
for (auto& alias : aliasRules) {
out.fmtln("{}{} as{}{};",
alias.traitName()->empty()
? std::string{}
: folly::format("{}::", alias.traitName()).str(),
alias.origMethodName()->data(),
opt_attrs(AttrContext::TraitImport, alias.modifiers()),
alias.newMethodName() != alias.origMethodName()
? std::string(" ") + alias.newMethodName()->data()
: std::string{}
);
}
});
out.fmtln("}}");
}
示例13: Output
RefTargetHandle Output::Clone(RemapDir &remap) {
Output *mnew = new Output();
*((MtlBase*)mnew) = *((MtlBase*)this); // copy superclass stuff
mnew->ReplaceReference(1,remap.CloneRef(texout));
mnew->ivalid.SetEmpty();
for (int i = 0; i<NSUBTEX; i++) {
mnew->subTex[i] = NULL;
if (subTex[i])
mnew->ReplaceReference(i,remap.CloneRef(subTex[i]));
mnew->mapOn[i] = mapOn[i];
}
BaseClone(this, mnew, remap);
return (RefTargetHandle)mnew;
}
示例14: workspaceViewForOutput
void Dashboard::toggle(Seat *seat)
{
if (seat->pointer()->isGrabActive()) {
return;
}
m_visible = !m_visible;
Output *output = m_shell->selectPrimaryOutput();
View *wsv = workspaceViewForOutput(this, output);
Transform tr;
tr.translate(m_visible ? 0 : -output->width(), m_visible ? 0 : output->height());
wsv->setTransform(tr, true);
}
示例15: _printCounterData
void ProfilingSystem::_printCounterData (const Record::Data &data, Output &output)
{
if (data.count == 0)
{
output.printf("-\t0\t\t\t");
return;
}
float avg_value = (float)data.value / data.count;
// To avoid platform-specific code qwords were casted to doubles
double sigma_sq = data.square_sum / data.count - avg_value * avg_value;
output.printf("%0.0lf\t%0.0lf\t%0.1f\t%0.1lf\t%0.0lf",
(double)data.value, (double)data.count, avg_value, sqrt(sigma_sq), (double)data.max_value);
}