예제 #1
0
void SceneObjectPanel::notifyRotationChange(MyGUI::Widget* _sender)
{
	if(mPickableObj == nullptr) return;

	MyGUI::Button* btn = static_cast<MyGUI::Button*>(_sender);
 
	//TODO: change compare to AnyData injected in the widget later
	std::string btnName = btn->getName();
	btnName = btnName.substr(mPrefix.length(),btnName.length() - mPrefix.length());

	if(btnName == "BT_ROTATE_Y_LEFT")
	{
 		*mRotateAngleY -= 1;
		std::string str = Ogre::StringConverter::toString(*mRotateAngleY);
		mEditBoxRotateY->setCaption(str);
 	}
 	else if(btnName == "BT_ROTATE_Y_RIGHT")
	{
 		*mRotateAngleY += 1;
		std::string str = Ogre::StringConverter::toString(*mRotateAngleY);
		mEditBoxRotateY->setCaption(str);
 	}
	
 	mPickableObj->applyOperation(1);

}
예제 #2
0
void SceneObjectPanel::notifyStateChanged(MyGUI::Widget* _sender)
{
	if(mPickableObj == nullptr) return;


	MyGUI::Button *btn = static_cast<MyGUI::Button*>(_sender);

	std::string btnName = btn->getName();
	btnName = btnName.substr(mPrefix.length(),btnName.length() - mPrefix.length());

	if(btnName == "RB_FIX_XAXIS")
	{
		*mIsXFixed = !(*mIsXFixed);
		btn->setStateSelected((*mIsXFixed));
	}
	else if(btnName == "RB_FIX_YAXIS")
	{
		*mIsYFixed = !(*mIsYFixed);
		btn->setStateSelected((*mIsYFixed));
	}
	else
	{
		*mIsZFixed = !(*mIsZFixed);
		btn->setStateSelected((*mIsZFixed));
 	}
}
예제 #3
0
void SceneObjectPanel::notifyScaleChange(MyGUI::Widget* _sender)
{
	if(mPickableObj == nullptr) return; 

	MyGUI::Button* btn = static_cast<MyGUI::Button*>(_sender);
 
	//TODO: change compare to AnyData injected in the widget later
	std::string btnName = btn->getName();
	btnName = btnName.substr(mPrefix.length(),btnName.length() - mPrefix.length());

	if(btnName  ==  "BT_SCALE_X_RIGHT")
	{
		mScale->x += 1;
		std::string str = Ogre::StringConverter::toString(mScale->x);
		mEditBoxScaleX->setCaption(str);
 	}
	else if(btnName == "BT_SCALE_X_LEFT")
	{
 		mScale->x -= 1;
		std::string str = Ogre::StringConverter::toString(mScale->x);
		mEditBoxScaleX->setCaption(str);
 	}
 	else if(btnName == "BT_SCALE_Y_LEFT")
	{
 		mScale->y -= 1;
		std::string str = Ogre::StringConverter::toString(mScale->y);
		mEditBoxScaleY->setCaption(str);
 	}
 	else if(btnName == "BT_SCALE_Y_RIGHT")
	{
 		mScale->y += 1;
		std::string str = Ogre::StringConverter::toString(mScale->y);
		mEditBoxScaleY->setCaption(str);
 	}
 	else if(btnName == "BT_SCALE_Z_LEFT")
	{
 		mScale->z -= 1;
		std::string str = Ogre::StringConverter::toString(mScale->z);
		mEditBoxScaleZ->setCaption(str);
 	}
 	else if(btnName == "BT_SCALE_Z_RIGHT")
	{
 		mScale->z += 1;
		std::string str = Ogre::StringConverter::toString(mScale->z);
		mEditBoxScaleZ->setCaption(str);
 	}
	mPickableObj->applyOperation(0); 
}
예제 #4
0
void SceneObjectPanel::notifyApplyOperation(MyGUI::Widget* _sender)
{
	if(mPickableObj == nullptr) return;

	MyGUI::Button* btn = static_cast<MyGUI::Button*>(_sender);
 
	//TODO: change compare to AnyData injected in the widget later
	std::string btnName = btn->getName();
	btnName = btnName.substr(mPrefix.length(),btnName.length() - mPrefix.length());

	if(btnName == "BT_APPLY_SCALE")
	{
		if(mPickableObj != nullptr)
			mPickableObj->applyOperation(0);
	}
	else if(btnName == "BT_APPLY_ROTATE")
	{
		if(mPickableObj != nullptr)
			mPickableObj->applyOperation(1);
	}
}
예제 #5
0
void CameraPanel::notifyMouseButtonClick(MyGUI::Widget* _sender)
{
	MyGUI::Button* button = _sender->castType<MyGUI::Button>();
	bool pressed = button->getStateSelected();
	
	if(!pressed)
	{
		mBtnFixed->setStateSelected(false);
		mBtnManipulable->setStateSelected(false);
		mBtnTracking->setStateSelected(false);
		button->setStateSelected(!pressed);
		
		std::string btName = button->getName();
 		if(btName == "RBCamFixed")
			mCamMode = 0;
		else if(btName == "RBCamFixed")
			mCamMode = 1;
		else 
			mCamMode = 2;
	}
}