Fixed the input/output handling of ReferenceFrame values to be RELATIVE and ABSOLUTE
rather than long original names.
This commit is contained in:
parent
8ac0211b81
commit
f7166c4541
@ -27,13 +27,16 @@ bool LightSource_readLocalData(Object& obj, Input& fr)
|
||||
|
||||
LightSource& lightsource = static_cast<LightSource&>(obj);
|
||||
|
||||
if (fr[0].matchWord("referenceFrame")) {
|
||||
if (fr[1].matchWord("RELATIVE_TO_ABSOLUTE") || fr[1].matchWord("ABSOLUTE")) {
|
||||
if (fr[0].matchWord("referenceFrame"))
|
||||
{
|
||||
if (fr[1].matchWord("RELATIVE_TO_ABSOLUTE") || fr[1].matchWord("ABSOLUTE"))
|
||||
{
|
||||
lightsource.setReferenceFrame(LightSource::ABSOLUTE_RF);
|
||||
fr += 2;
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
if (fr[1].matchWord("RELATIVE_TO_PARENTS") || fr[1].matchWord("RELATIVE")) {
|
||||
if (fr[1].matchWord("RELATIVE_TO_PARENTS") || fr[1].matchWord("RELATIVE"))
|
||||
{
|
||||
lightsource.setReferenceFrame(LightSource::RELATIVE_RF);
|
||||
fr += 2;
|
||||
iteratorAdvanced = true;
|
||||
@ -57,9 +60,10 @@ bool LightSource_writeLocalData(const Object& obj, Output& fw)
|
||||
const LightSource& lightsource = static_cast<const LightSource&>(obj);
|
||||
|
||||
fw.indent() << "referenceFrame ";
|
||||
switch (lightsource.getReferenceFrame()) {
|
||||
switch (lightsource.getReferenceFrame())
|
||||
{
|
||||
case LightSource::ABSOLUTE_RF:
|
||||
fw << "RELATIVE_TO_ABSOLUTE\n";
|
||||
fw << "ABSOLUTE\n";
|
||||
break;
|
||||
case LightSource::RELATIVE_RF:
|
||||
default:
|
||||
|
@ -25,7 +25,6 @@ RegisterDotOsgWrapperProxy g_TransformProxy
|
||||
DotOsgWrapper::READ_AND_WRITE
|
||||
);
|
||||
|
||||
|
||||
bool Transform_readLocalData(Object& obj, Input& fr)
|
||||
{
|
||||
bool iteratorAdvanced = false;
|
||||
@ -49,13 +48,16 @@ bool Transform_readLocalData(Object& obj, Input& fr)
|
||||
|
||||
}
|
||||
|
||||
if (fr[0].matchWord("referenceFrame")) {
|
||||
if (fr[1].matchWord("RELATIVE_TO_ABSOLUTE") || fr[1].matchWord("ABSOLUTE") ) {
|
||||
if (fr[0].matchWord("referenceFrame"))
|
||||
{
|
||||
if (fr[1].matchWord("RELATIVE_TO_ABSOLUTE") || fr[1].matchWord("ABSOLUTE") )
|
||||
{
|
||||
transform.setReferenceFrame(Transform::ABSOLUTE_RF);
|
||||
fr += 2;
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
if (fr[1].matchWord("RELATIVE_TO_PARENTS") || fr[1].matchWord("RELATIVE")) {
|
||||
if (fr[1].matchWord("RELATIVE_TO_PARENTS") || fr[1].matchWord("RELATIVE"))
|
||||
{
|
||||
transform.setReferenceFrame(Transform::RELATIVE_RF);
|
||||
fr += 2;
|
||||
iteratorAdvanced = true;
|
||||
@ -71,7 +73,8 @@ bool Transform_writeLocalData(const Object& obj, Output& fw)
|
||||
const Transform& transform = static_cast<const Transform&>(obj);
|
||||
|
||||
fw.indent() << "referenceFrame ";
|
||||
switch (transform.getReferenceFrame()) {
|
||||
switch (transform.getReferenceFrame())
|
||||
{
|
||||
case Transform::ABSOLUTE_RF:
|
||||
fw << "ABSOLUTE\n";
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user