wxVariant wxAABBox3DProperty::ChildChanged( wxVariant& thisValue, int childIndex, wxVariant& childValue ) const { AABBox3D& box = AABBox3DRefFromVariant(thisValue); switch ( childIndex ) { case 0: box.Set(Vector3RefFromVariant(childValue), box.Max()); break; case 1: box.Set(box.Min(), Vector3RefFromVariant(childValue)); break; } wxVariant newVariant; newVariant << box; return newVariant; }
void InspectorPropertyGridPage::OnPropertyChanged(wxPropertyGridEvent& event) { wxPGProperty* property = event.GetProperty(); if (property == nameID) { sceneNode->SetNodeName(std::string(property->GetValue().GetString().c_str())); } else if (property == positionID) { Vector3 val = Vector3RefFromVariant(property->GetValue()); sceneNode->SetPosition(val._x, val._y, val._z); } else if (property == scaleID) { Vector3 val = Vector3RefFromVariant(property->GetValue()); sceneNode->SetScale(val._x, val._y, val._z); } }
void nsVector3Property::RefreshChildren(void) { if (!GetChildCount()) return; const Vector3& vector = Vector3RefFromVariant(m_value); Item(0)->SetValue(vector._x); Item(1)->SetValue(vector._y); Item(2)->SetValue(vector._z); }
void wxVector3Property::RefreshChildren() { if (GetChildCount()) { Vector3& vec = Vector3RefFromVariant(m_value); Item(0)->SetValue(vec.X); Item(1)->SetValue(vec.Y); Item(2)->SetValue(vec.Z); } }
wxVariant wxVector3Property::ChildChanged( wxVariant& thisValue, int childIndex, wxVariant& childValue ) const { Vector3& vec = Vector3RefFromVariant(thisValue); switch ( childIndex ) { case 0: vec.X = childValue.GetDouble(); break; case 1: vec.Y = childValue.GetDouble(); break; case 2: vec.Z = childValue.GetDouble(); break; } wxVariant newVariant; newVariant << vec; return newVariant; }