Exemple #1
0
void 
PropertyManager::updateGrid(wxPropertyGridManager *pg, nau::AttribSet &attribs, AttributeValues *attribVal) {

	std::map<std::string, std::unique_ptr<Attribute>> & attributes = attribs.getAttributes();

	pg->ClearSelection();

	for (auto &attrib : attributes) {

		std::unique_ptr<Attribute> &a = attrib.second;
		switch (a->getType()) {

		case Enums::ENUM: updateEnum(pg, a->getName(), attribVal->getPrope((AttributeValues::EnumProperty)a->getId())); break;
		case Enums::BOOL: updateBool(pg, a->getName(), attribVal->getPropb((AttributeValues::BoolProperty)a->getId())); break;
		case Enums::BVEC4: updateBVec4(pg, a->getName(), attribVal->getPropb4((AttributeValues::Bool4Property)a->getId())); break;
		case Enums::INT: updateInt(pg, a->getName(), attribVal->getPropi((AttributeValues::IntProperty)a->getId())); break;
		case Enums::IVEC3: updateIVec3(pg, a->getName(), attribVal->getPropi3((AttributeValues::Int3Property)a->getId())); break;
		case Enums::UINT: updateInt(pg, a->getName(), attribVal->getPropui((AttributeValues::UIntProperty)a->getId())); break;
		case Enums::UIVEC2: updateUIVec2(pg, a->getName(), attribVal->getPropui2((AttributeValues::UInt2Property)a->getId())); break;
		case Enums::UIVEC3: updateUIVec3(pg, a->getName(), attribVal->getPropui3((AttributeValues::UInt3Property)a->getId())); break;
		case Enums::FLOAT: updateFloat(pg, a->getName(), attribVal->getPropf((AttributeValues::FloatProperty)a->getId())); break;
		case Enums::VEC2: updateVec2(pg, a->getName(), attribVal->getPropf2((AttributeValues::Float2Property)a->getId())); break;
		case Enums::VEC3: updateVec3(pg, a->getName(), attribVal->getPropf3((AttributeValues::Float3Property)a->getId())); break;
		case Enums::VEC4: 
			if (a->getSemantics() == Attribute::Semantics::COLOR)
				updateVec4Color(pg, a->getName(), attribVal->getPropf4((AttributeValues::Float4Property)a->getId()));
			else
				updateVec4(pg, a->getName(), attribVal->getPropf4((AttributeValues::Float4Property)a->getId()));
			break;
		case Enums::MAT3: updateMat3(pg, a->getName(), attribVal->getPropm3((AttributeValues::Mat3Property)a->getId())); break;
		case Enums::MAT4: updateMat4(pg, a->getName(), attribVal->getPropm4((AttributeValues::Mat4Property)a->getId())); break;
		case Enums::STRING: updateString(pg, a->getName(), attribVal->getProps((AttributeValues::StringProperty)a->getId())); break;
		default: assert(false && "Missing datatype in property manager");
		}
	}
}
int FloatBinding::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = DataBinding::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: updateInt((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 1: updateString((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 2: intChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 3: stringChanged((*reinterpret_cast< QString(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 4;
    }
    return _id;
}
Exemple #3
0
bool Interval::updateStartEndTime(const int t1, const int t2)
{
    return (updateInt("t1", t1) && updateInt("t2", t2) && updateExecute());
}