Hi,
I've just tried using Encapsulate Field for the first time, and had a couple of issues with it.
The variable is defined as:
Imath::V3f m_position;
When I click Encapsulate Field, it pops up the window, and the suggested values for the getter and setter are both "Position".
If I go ahead and use the suggestion, here's the code it creates:
Imath Position() const { return Position(); }
void Position( Imath val ) { Position( val ); }
There are 2 issues here. First is the fact that these methods are just calling themselves. If I change the names of the getter and setter in the pop up window, it does what it should:
Imath getPosition() const { return m_position; }
void setPosition( Imath val ) { m_position = val; }
(note - I just tried doing it with the default values again, and this time it did the right thing. I'm not sure where the first result came from.)
The second issue here is that it hasn't realised that the variable type has a namespace, and has generated code with just the namespace, and not the actual type.
The code that I'd expect to be generated would be:
Imath::V3f getPosition() const { return m_position; }
void setPosition( Imath::V3f val ) { m_position = val; }
Thanks