Ejemplo n.º 1
0
    /**
     * @brief ComponentsMaker::makeField
     * @return
     */
    OptionalEntity ComponentsMaker::makeField(const Tokens &tokens)
    {
        Q_ASSERT(!tokens.isEmpty() && tokens[int(FieldGroupNames::Typename)]->isSingle() &&
                 !tokens[int(FieldGroupNames::Typename)]->token().isEmpty() &&
                 tokens[int(FieldGroupNames::Name)]->isSingle() &&
                 !tokens[int(FieldGroupNames::Name)]->token().isEmpty());

        Q_ASSERT(checkCommonState());

        // Make field with lhs keywords
        auto newField = std::make_shared<entity::Field>();
        newField->setName(tokens[int(FieldGroupNames::Name)]->token());
        if (!tokens[int(FieldGroupNames::LhsKeywords)]->token().isEmpty()) {
            auto keyword =
                utility::fieldKeywordFromString(tokens[int(FieldGroupNames::LhsKeywords)]->token());
            Q_ASSERT(keyword != entity::FieldKeyword::Invalid);
            newField->addKeyword(keyword);
        }

        // Make type
        Tokens typeTokens(int(TypeGroups::GroupsCount));
        std::copy(std::begin(tokens) + int(FieldGroupNames::ConstStatus),
                  std::begin(tokens) + int(FieldGroupNames::Name),        // do not include name
                  std::begin(typeTokens) + int(TypeGroups::ConstStatus)); // add first group offset
        auto optionalType = makeType(typeTokens);
        if (!optionalType.errorMessage.isEmpty())
            return {optionalType.errorMessage, nullptr};

        Q_ASSERT(optionalType.resultEntity);
        newField->setTypeId(optionalType.resultEntity->id());

        return {"", newField};
    }
Ejemplo n.º 2
0
DrawVideoElm::DrawVideoElm(OGLWidget *drawWidget, QObject *parent) : DrawElement(drawWidget, parent)
{
    setType("video");
    setTypeId(Element_type::Video);
    delta = 0;

}
Ejemplo n.º 3
0
DrawImageElm::DrawImageElm(OGLWidget *drawWidget, QObject *parent) : DrawElement(drawWidget, parent)
{
    setType("image");
    setTypeId(Element_type::Image);
    if(gif != NULL)
        delete gif;
    /* ShaderEffect alphaEffect(OGLWidget::ALPHA_SHADER);
    ShaderEffect alphaEffect2(OGLWidget::ALPHA_SHADER);
    ShaderEffect spiralEffect(OGLWidget::SPIRAL_SHADER);
    alphaEffect.setEffectTimeHowLong(500);
    alphaEffect.setStartTimeMS(0);
    //alphaEffect.setReverse(true);
    alphaEffect2.setEffectTimeHowLong(500);
    alphaEffect2.setReverse(true);
    alphaEffect2.setStartTimeMS(500);
    alphaEffect2.setAnchorToEnd(true);
    //alphaEffect.setAnchorToEnd(true);
    //alphaEffect2.setReverse(false);
 //   spiralEffect.setEffectTimeHowLong(1000);

    //qDebug() << "alpha effect created";

     effects.push_back(alphaEffect); //ADD DEFAULT EFFECT
     effects.push_back(alphaEffect2); //ADD DEFAULT EFFECT
     //effects.push_back(alphaEffect2); //ADD DEFAULT EFFECT
     //effects.push_back(spiralEffect); //ADD DEFAULT EFFECT
     */

}
Ejemplo n.º 4
0
// Sets the type ID
bool RfSensor::setSlotTypeId(const base::String* const msg)
{
   bool ok = false;

   if (msg != nullptr) {
      ok = setTypeId( msg->getString() );
   }

   return ok;
}
Ejemplo n.º 5
0
// Sets the type ID
bool RfSensor::setSlotTypeId(const Basic::String* const msg)
{
    bool ok = false;

    if (msg != 0) {
        ok = setTypeId( msg->getString() );
    }

    return ok;
}
Ejemplo n.º 6
0
// Sets the OTW entity type number
bool Otm::setSlotTypeId(const Basic::Number* const msg)
{
   bool ok = false;
   if (msg != 0) {
      int i = msg->getInt();
      if (i >= 0) {
         ok = setTypeId( static_cast<unsigned int>(i) );
      }
   }
   return ok;
}
Ejemplo n.º 7
0
bool DrawElement::loadTypeId(QIODevice* device)
{
    QDataStream stream(device);
    int temp_type;
    stream >> temp_type  ;

    // typeId = static_cast<Element_type>(temp_type);
    Element_type temp_2 ;
    temp_2 = (Element_type)(temp_type);
    setTypeId(temp_2);
    qDebug() << "DrawElement::load temp_type = " << getTypeId();

}
Ejemplo n.º 8
0
//------------------------------------------------------------------------------
// copyData() -- copy member data
//------------------------------------------------------------------------------
void Otm::copyData(const Otm& org, const bool cc)
{
   BaseClass::copyData(org);

   if (cc) {
      refFormName = 0;
      refTypeName = 0;
   }

   setTypeId( org.typeId );
   setSlotRefFormName( org.refFormName );
   setSlotRefTypeName( org.refTypeName );
}
Ejemplo n.º 9
0
//------------------------------------------------------------------------------
// deleteData() -- delete member data
//------------------------------------------------------------------------------
void Otm::deleteData()
{
   setTypeId( 0 );
   setSlotRefFormName( 0 );
   setSlotRefTypeName( 0 );
}
Ejemplo n.º 10
0
MsvcToolChainFactory::MsvcToolChainFactory()
{
    setTypeId(Constants::MSVC_TOOLCHAIN_TYPEID);
    setDisplayName(tr("MSVC"));
}
ShaderVariableReal::ShaderVariableReal(void) :
    Inherited()
{
    setTypeId(ShaderVariable::SHVTypeReal);
}
ShaderVariableMUInt::ShaderVariableMUInt(void) :
    Inherited()
{
    setTypeId(ShaderVariable::SHVTypeMUInt);
}
Ejemplo n.º 13
0
ShaderParameterMInt::ShaderParameterMInt(void) :
    Inherited()
{
    setTypeId(ShaderParameter::SHPTypeMInt);
}
ShaderVariableUniformBlock::ShaderVariableUniformBlock(void) :
    Inherited()
{
    setTypeId(ShaderVariable::SHVTypeUniformBlock);
}
ShaderParameterMReal::ShaderParameterMReal(void) :
    Inherited()
{
    setTypeId(ShaderParameter::SHPTypeMReal);
}
ShaderVariableMVec2f::ShaderVariableMVec2f(void) :
    Inherited()
{
    setTypeId(ShaderVariable::SHVTypeMVec2f);
}
Ejemplo n.º 17
0
ShaderParameterVec3f::ShaderParameterVec3f(void) :
    Inherited()
{
    setTypeId(ShaderParameter::SHPTypeVec3f);
}
ShaderVariablePnt3f::ShaderVariablePnt3f(void) :
    Inherited()
{
    setTypeId(ShaderVariable::SHVTypePnt3f);
}
Ejemplo n.º 19
0
DrawTextElm::DrawTextElm(OGLWidget *drawWidget, QObject *parent) : DrawElement(drawWidget, parent)
{
    setType("text");
    setTypeId(Element_type::Text);
}
Ejemplo n.º 20
0
ShaderParameterMVec4f::ShaderParameterMVec4f(void) :
    Inherited()
{
    setTypeId(ShaderParameter::SHPTypeMVec4f);
}
Ejemplo n.º 21
0
ShaderParameterBool::ShaderParameterBool(void) :
    Inherited()
{
    setTypeId(ShaderParameter::SHPTypeBool);
}