_elementVector.resize(size);
for (unsigned i = oldSize; i < size; ++i)
_elementVector[i] = newElement(i);
+ setDirty(true);
return true;
}
_elementVector[index] = value;
if (value)
value->attachStamp(*this);
+ setDirty(true);
}
void
_elementVector.resize(size);
for (unsigned i = oldSize; i < size; ++i)
_elementVector[i] = newElement();
+ setDirty(true);
return true;
}
_elementVector[index] = value;
if (value)
value->attachStamp(*this);
+ setDirty(true);
}
void
const std::string& getValue() const
{ return _value; }
void setValue(const std::string& value)
- { _value = value; }
+ { _value = value; setDirty(true); }
virtual bool setNumElements(unsigned count)
{
const SGVec2<T>& getValue() const
{ return _value; }
void setValue(const SGVec2<T>& value)
- { _value = value; }
+ { _value = value; setDirty(true); }
virtual bool setNumElements(unsigned count)
{
const SGVec3<T>& getValue() const
{ return _value; }
void setValue(const SGVec3<T>& value)
- { _value = value; }
+ { _value = value; setDirty(true); }
virtual bool setNumElements(unsigned count)
{
const SGVec4<T>& getValue() const
{ return _value; }
void setValue(const SGVec4<T>& value)
- { _value = value; }
+ { _value = value; setDirty(true); }
virtual bool setNumElements(unsigned count)
{
const SGQuat<T>& getValue() const
{ return _value; }
void setValue(const SGQuat<T>& value)
- { _value = value; }
+ { _value = value; setDirty(true); }
virtual bool setNumElements(unsigned count)
{
HLA##type##DataElement::setValue(ctype value) \
{ \
_value = value; \
+ setDirty(true); \
}
IMPLEMENT_TYPED_HLA_BASIC_DATA_ELEMENT(Char, char);
_fieldVector[index] = value;
if (value)
value->attachStamp(*this);
+ setDirty(true);
}
void
_attributeVector[index]._dataElement = dataElement;
if (_attributeVector[index]._dataElement.valid())
_attributeVector[index]._dataElement->createStamp();
- if (getAttributeOwned(index))
- encodeAttributeValue(index);
}
class HLAObjectInstance::DataElementFactoryVisitor : public HLADataElementFactoryVisitor {
{
unsigned numAttributes = _attributeVector.size();
for (unsigned i = 0; i < numAttributes;++i) {
- if (!_attributeVector[i]._unconditionalUpdate)
- continue;
- encodeAttributeValue(i);
+ if (_attributeVector[i]._unconditionalUpdate) {
+ encodeAttributeValue(i);
+ } else if (_attributeVector[i]._enabledUpdate) {
+ const HLADataElement* dataElement = getAttributeDataElement(i);
+ if (dataElement && dataElement->getDirty())
+ encodeAttributeValue(i);
+ }
}
}
SG_LOG(SG_IO, SG_INFO, "Not updating inactive object!");
return;
}
- const HLADataElement* dataElement = getAttributeDataElement(index);
+ HLADataElement* dataElement = getAttributeDataElement(index);
if (!dataElement)
return;
_rtiObjectInstance->encodeAttributeData(index, *dataElement);
+ dataElement->setDirty(false);
}
void
return false;
_dataElement.swap(dataElement);
_alternativeIndex = index;
+ setDirty(true);
return true;
}