void RadiantSelectionSystem::initialiseModule(const ApplicationContext& ctx) 
{
    rMessage() << "RadiantSelectionSystem::initialiseModule called.\n";

    constructStatic();

    SetManipulatorMode(eTranslate);
    pivotChanged();

    _sigSelectionChanged.connect(
        sigc::mem_fun(this, &RadiantSelectionSystem::pivotChangedSelection)
    );

    GlobalGrid().signal_gridChanged().connect(
        sigc::mem_fun(this, &RadiantSelectionSystem::pivotChanged)
    );

    GlobalRegistry().signalForKey(RKEY_ROTATION_PIVOT).connect(
        sigc::mem_fun(this, &RadiantSelectionSystem::keyChanged)
    );

    // Pass a reference to self to the global event manager
    GlobalEventManager().connectSelectionSystem(this);

    // Connect the bounds changed caller
    GlobalSceneGraph().signal_boundsChanged().connect(
        sigc::mem_fun(this, &RadiantSelectionSystem::onSceneBoundsChanged)
    );

    GlobalRenderSystem().attachRenderable(*this);
}
Esempio n. 2
0
RadiantSelectionSystem::RadiantSelectionSystem() :
	_requestWorkZoneRecalculation(true), _undoBegun(false), _mode(ePrimitive), _componentMode(eDefault), _countPrimitive(0),
			_countComponent(0),
			_translateManipulator(*this, 2, 64), // initialise the Manipulators with a pointer to self
			_rotateManipulator(*this, 8, 64), _scaleManipulator(*this, 0, 64), _pivotChanged(false),
			_pivotMoving(false)
{
	SetManipulatorMode(eTranslate);
	pivotChanged();
	addSelectionChangeCallback(PivotChangedSelectionCaller(*this));
	GlobalGrid().addGridChangeCallback(PivotChangedCaller(*this));

	// Pass a reference to self to the global event manager
	GlobalEventManager().connectSelectionSystem(this);
}