Esempio n. 1
0
TEST(MangleTest, vecAndVecPtr) {
  // "frexp(float2, __global int2*)"
  const char* s = "_Z5frexpDv2_fPU3AS1Dv2_i";
  FunctionDescriptor fd;
  RefParamType primitiveFloat(new PrimitiveType(PRIMITIVE_FLOAT));
  RefParamType vectorFloat(new VectorType(primitiveFloat, 2));

  RefParamType primitiveInt(new PrimitiveType(PRIMITIVE_INT));
  RefParamType vectorInt(new VectorType(primitiveInt, 2));
  PointerType *ptrInt = new PointerType(vectorInt);
  ptrInt->setAddressSpace(ATTR_GLOBAL);
  RefParamType ptrIntRef(ptrInt);

  fd.name = "frexp";
  fd.parameters.push_back(vectorFloat);
  fd.parameters.push_back(ptrIntRef);

  std::string mangled = mangle(fd);
  ASSERT_STREQ(s, mangled.c_str());
}
Esempio n. 2
0
ExampleClass::ExampleClass(void):
    QObject()
{
    Frame = new QFrame();
    Layout = new QVBoxLayout();

    DynamicVectorDoubleRead = new vctQtWidgetDynamicVectorDoubleRead();
    DynamicVectorDoubleRead->SetPrecision(5);
    Layout->addWidget(DynamicVectorDoubleRead);

    DynamicVectorDoubleWriteText = new vctQtWidgetDynamicVectorDoubleWrite(vctQtWidgetDynamicVectorDoubleWrite::TEXT_WIDGET);
    Layout->addWidget(DynamicVectorDoubleWriteText);
    connect(DynamicVectorDoubleWriteText, SIGNAL(valueChanged()), this, SLOT(DoubleTextValueChangedSlot()));

    DynamicVectorDoubleWriteSpinBox = new vctQtWidgetDynamicVectorDoubleWrite(vctQtWidgetDynamicVectorDoubleWrite::SPINBOX_WIDGET);
    Layout->addWidget(DynamicVectorDoubleWriteSpinBox);
    connect(DynamicVectorDoubleWriteSpinBox, SIGNAL(valueChanged()), this, SLOT(DoubleSpinBoxValueChangedSlot()));

    DynamicVectorDoubleWriteSlider = new vctQtWidgetDynamicVectorDoubleWrite(vctQtWidgetDynamicVectorDoubleWrite::SLIDER_WIDGET);
    Layout->addWidget(DynamicVectorDoubleWriteSlider);
    connect(DynamicVectorDoubleWriteSlider, SIGNAL(valueChanged()), this, SLOT(DoubleSliderValueChangedSlot()));

    vctDynamicVector<double> vectorDouble(NUMBER_OF_ELEMENTS);
    vctRandom(vectorDouble, -100, 100);
    DynamicVectorDoubleRead->SetValue(vectorDouble);
    DynamicVectorDoubleWriteText->SetValue(vectorDouble);
    DynamicVectorDoubleWriteSpinBox->SetValue(vectorDouble);
    DynamicVectorDoubleWriteSlider->SetValue(vectorDouble);

    DynamicVectorIntRead = new vctQtWidgetDynamicVectorIntRead();
    DynamicVectorIntRead->SetBase(16);
    Layout->addWidget(DynamicVectorIntRead);

    DynamicVectorIntWriteText = new vctQtWidgetDynamicVectorIntWrite(vctQtWidgetDynamicVectorIntWrite::TEXT_WIDGET);
    Layout->addWidget(DynamicVectorIntWriteText);
    connect(DynamicVectorIntWriteText, SIGNAL(valueChanged()), this, SLOT(IntTextValueChangedSlot()));

    DynamicVectorIntWriteSpinBox = new vctQtWidgetDynamicVectorIntWrite(vctQtWidgetDynamicVectorIntWrite::SPINBOX_WIDGET);
    Layout->addWidget(DynamicVectorIntWriteSpinBox);
    connect(DynamicVectorIntWriteSpinBox, SIGNAL(valueChanged()), this, SLOT(IntSpinBoxValueChangedSlot()));

    DynamicVectorIntWriteSlider = new vctQtWidgetDynamicVectorIntWrite(vctQtWidgetDynamicVectorIntWrite::SLIDER_WIDGET);
    Layout->addWidget(DynamicVectorIntWriteSlider);
    connect(DynamicVectorIntWriteSlider, SIGNAL(valueChanged()), this, SLOT(IntSliderValueChangedSlot()));

    vctDynamicVector<int> vectorInt(NUMBER_OF_ELEMENTS);
    vctRandom(vectorInt, -100, 100);
    DynamicVectorIntRead->SetValue(vectorInt);
    DynamicVectorIntWriteText->SetValue(vectorInt);
    DynamicVectorIntWriteSpinBox->SetValue(vectorInt);
    DynamicVectorIntWriteSlider->SetValue(vectorInt);

    RotationDoubleRead = new vctQtWidgetRotationDoubleRead();
    Layout->addWidget(RotationDoubleRead);
    vctRandom(Rotation3D);
    RotationDoubleRead->SetValue(Rotation3D);

    FrameDoubleRead = new vctQtWidgetFrameDoubleRead();
    Layout->addWidget(FrameDoubleRead);
    vctRandom(Frame3D.Rotation());
    vctRandom(Frame3D.Translation(), -10.0, 10.0);
    FrameDoubleRead->SetValue(Frame3D);

    Frame->setLayout(Layout);
    Frame->show();
}