本文整理汇总了C++中CamWndPtr::jumpToObject方法的典型用法代码示例。如果您正苦于以下问题:C++ CamWndPtr::jumpToObject方法的具体用法?C++ CamWndPtr::jumpToObject怎么用?C++ CamWndPtr::jumpToObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CamWndPtr
的用法示例。
在下文中一共展示了CamWndPtr::jumpToObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onMouseDown
// Handles the mouseDown event, basically determines which action should be performed (select or manipulate)
void RadiantWindowObserver::onMouseDown(const WindowVector& position, GdkEventButton* ev)
{
// Retrieve the according ObserverEvent for the GdkEventButton
ui::ObserverEvent observerEvent = GlobalEventManager().MouseEvents().getObserverEvent(ev);
// Check if the user wants to copy/paste a texture
if (observerEvent == ui::obsCopyTexture || observerEvent == ui::obsPasteTextureProjected ||
observerEvent == ui::obsPasteTextureNatural || observerEvent == ui::obsPasteTextureCoordinates ||
observerEvent == ui::obsPasteTextureToBrush || observerEvent == ui::obsJumpToObject)
{
// Get the mouse position
DeviceVector devicePosition(device_constrained(window_to_normalised_device(position, _width, _height)));
// Check the target object
render::View scissored(*_selectObserver._view);
ConstructSelectionTest(scissored, Rectangle::ConstructFromPoint(devicePosition, _selectObserver._epsilon));
SelectionVolume volume(scissored);
// Do we have a camera view (fill() == true)?
if (_selectObserver._view->fill())
{
if (observerEvent == ui::obsJumpToObject) {
CamWndPtr cam = GlobalCamera().getActiveCamWnd();
if (cam != NULL) {
cam->jumpToObject(volume);
}
}
// If the apply texture modifier is held
else if (observerEvent == ui::obsPasteTextureProjected) {
// Paste the shader projected (TRUE), but not to an entire brush (FALSE)
selection::algorithm::pasteShader(volume, true, false);
}
// If the copy texture modifier is held
else if (observerEvent == ui::obsCopyTexture) {
// Set the source texturable from the given test
GlobalShaderClipboard().setSource(volume);
}
else if (observerEvent == ui::obsPasteTextureNatural) {
// Paste the shader naturally (FALSE), but not to an entire brush (FALSE)
selection::algorithm::pasteShader(volume, false, false);
}
else if (observerEvent == ui::obsPasteTextureCoordinates) {
// Clone the texture coordinates from the patch in the clipboard
selection::algorithm::pasteTextureCoords(volume);
}
else if (observerEvent == ui::obsPasteTextureToBrush) {
// Paste the shader projected (TRUE), and to the entire brush (TRUE)
selection::algorithm::pasteShader(volume, true, true);
}
}
}
// Have any of the "selection" events occurred?
// greebo: This could be an "else if (observerEvent != obsNothing)" as well,
// but perhaps there will be more events in the future that aren't selection events.
if (observerEvent == ui::obsManipulate || observerEvent == ui::obsSelect ||
observerEvent == ui::obsToggle || observerEvent == ui::obsToggleFace ||
observerEvent == ui::obsToggleGroupPart ||
observerEvent == ui::obsReplace || observerEvent == ui::obsReplaceFace)
{
_mouseDown = true;
// Determine the current mouse position
DeviceVector devicePosition(window_to_normalised_device(position, _width, _height));
if (observerEvent == ui::obsManipulate && _manipulateObserver.mouseDown(devicePosition)) {
// This is a manipulation operation, register the callbacks
// Note: the mouseDown call in the if clause returned already true,
// so a manipulator could be successfully selected
_mouseMotionCallback = boost::bind(&ManipulateObserver::mouseMoved, &_manipulateObserver, _1);
_mouseUpCallback = boost::bind(&ManipulateObserver::mouseUp, &_manipulateObserver, _1);
_listenForCancelEvents = true;
}
else {
// Call the mouseDown method of the selector class, this covers all of the other events
_selectObserver.mouseDown(devicePosition);
_mouseMotionCallback = boost::bind(&SelectObserver::mouseMoved, &_selectObserver, _1);
_mouseUpCallback = boost::bind(&SelectObserver::mouseUp, &_selectObserver, _1);
// greebo: the according actions (toggle face, replace, etc.) are handled in the mouseUp methods.
}
}
}