netradiant-custom/include/iselection.h
Garux c845c5cd8f Radiant:
binds...
	* Tab: focus camera on selected

menus...
	* Modify->Nudge:+ Nudge +Z, Nudge -Z

misc...
	* improvement of: Scale tool: now scales bbox by gridsize increment
	* snap transform origin for rotate 90' commands, if one is not custom (is good to stay on grid)
	* 2d camera icon in ZY, ZX views represents yaw aswell
	* M3 camera direction control: disabled snapping
	* M3 camera direction control: affect yaw instead of doing pitch > 90' in ZY, ZX views
	* fix of: ctrl+m3 in 2d, release ctrl, then m3: m3 drag works like with ctrl pressed
	* removed 2 buttons mouse option: was only affecting m3 camera control binds
	* fix of: press any modifier (ctrl/shift/alt) + any mouse, release modifier, then mouse = chase mouse broken
	* removed 'Right Button Activates Context Menu' preference
	* brushExport plugin, prtview plugin, bobToolz::Polygon Builder, about, textures reset, messagebox windows live on top of main window
	* removed 'Update views on camera move' option: camera icon updating is enough quick
	* fix: bobToolz::split patch rows+columns - works if rows = 3 ( clos and rows were mixed up in general )
	* entitySetColour, entityNormalizeColour are undoable
	* bobToolz::splitPatch commands place result into parent entity (worldspawn or group one)
	* bobToolz::mergePatches places result into last selected patch's parent entity
	* bobToolz::mergePatches: remove left empty group entities
	* SelectAllOfType works for group entities, whose brush(es) are selected (no parent node selection needed).
		Algorithm is: get [ent inspector's keyName field(if visible) or classname]'s keyValues of selected ents ('no key' counts, as property, too);
		Then select ents with according keyName+keyValues; Worldspawn is omitted;
		Otherwise (nothing or worldspawn selected) select primitives, holding selected texture;
		in 'Faces' component mode = select specifically faces, holding selected texture;
	* SelectAllOfType selects child primitives of group entities
	* ExpandSelectionToEntities works for worldspawn entity too
2017-08-02 09:09:58 +03:00

146 lines
3.8 KiB
C++

/*
Copyright (C) 2001-2006, William Joseph.
All Rights Reserved.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#if !defined( INCLUDED_ISELECTION_H )
#define INCLUDED_ISELECTION_H
#include <cstddef>
#include "generic/constant.h"
#include "generic/callbackfwd.h"
#include "signal/signalfwd.h"
class Renderer;
class View;
class Selectable
{
public:
STRING_CONSTANT( Name, "Selectable" );
virtual void setSelected( bool select ) = 0;
virtual bool isSelected() const = 0;
};
namespace scene
{
class Instance;
};
class InstanceSelectionObserver
{
public:
virtual void onSelectedChanged( scene::Instance& instance ) = 0;
};
template<typename Element> class BasicVector3;
typedef BasicVector3<float> Vector3;
template<typename Element> class BasicVector4;
typedef BasicVector4<float> Vector4;
class Matrix4;
typedef Vector4 Quaternion;
typedef Callback1<const Selectable&> SelectionChangeCallback;
typedef SignalHandler1<const Selectable&> SelectionChangeHandler;
class SelectionSystem
{
public:
INTEGER_CONSTANT( Version, 1 );
STRING_CONSTANT( Name, "selection" );
enum EMode
{
eEntity,
ePrimitive,
eComponent,
};
enum EComponentMode
{
eDefault,
eVertex,
eEdge,
eFace,
};
enum EManipulatorMode
{
eTranslate,
eRotate,
eScale,
eDrag,
eClip,
};
virtual void SetMode( EMode mode ) = 0;
virtual EMode Mode() const = 0;
virtual void SetComponentMode( EComponentMode mode ) = 0;
virtual EComponentMode ComponentMode() const = 0;
virtual void SetManipulatorMode( EManipulatorMode mode ) = 0;
virtual EManipulatorMode ManipulatorMode() const = 0;
virtual SelectionChangeCallback getObserver( EMode mode ) = 0;
virtual std::size_t countSelected() const = 0;
virtual std::size_t countSelectedComponents() const = 0;
virtual void onSelectedChanged( scene::Instance& instance, const Selectable& selectable ) = 0;
virtual void onComponentSelection( scene::Instance& instance, const Selectable& selectable ) = 0;
virtual scene::Instance& ultimateSelected() const = 0;
virtual scene::Instance& penultimateSelected() const = 0;
virtual void setSelectedAll( bool selected ) = 0;
virtual void setSelectedAllComponents( bool selected ) = 0;
class Visitor
{
public:
virtual void visit( scene::Instance& instance ) const = 0;
};
virtual void foreachSelected( const Visitor& visitor ) const = 0;
virtual void foreachSelectedComponent( const Visitor& visitor ) const = 0;
virtual void addSelectionChangeCallback( const SelectionChangeHandler& handler ) = 0;
virtual void NudgeManipulator( const Vector3& nudge, const Vector3& view ) = 0;
virtual void translateSelected( const Vector3& translation ) = 0;
virtual void rotateSelected( const Quaternion& rotation, bool snapOrigin ) = 0;
virtual void scaleSelected( const Vector3& scaling ) = 0;
virtual void pivotChanged() const = 0;
virtual void setCustomPivotOrigin( Vector3& point ) const = 0;
};
#include "modulesystem.h"
template<typename Type>
class GlobalModule;
typedef GlobalModule<SelectionSystem> GlobalSelectionModule;
template<typename Type>
class GlobalModuleRef;
typedef GlobalModuleRef<SelectionSystem> GlobalSelectionModuleRef;
inline SelectionSystem& GlobalSelectionSystem(){
return GlobalSelectionModule::getTable();
}
#endif