#include <QtxActionMenuMgr.h>
#include <QtxActionToolMgr.h>
+/*!Icon.*/
static const char* ModuleIcon[] = {
"20 20 2 1",
" c None",
return toolMgr()->createToolBar( name );
}
-
+/*! Create tool. Register action \a a with id \a id.
+ * Insert QAction to tool manager.
+ *\param a - QAction
+ *\param tBar - integer
+ *\param id - integer
+ *\param idx - integer
+ *\retval integer id of new action in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createTool( QAction* a, const int tBar, const int id, const int idx )
{
if ( !toolMgr() )
return intId != -1 ? regId : -1;
}
+/*! Create tool. Register action \a a with id \a id.
+ * Insert QAction to tool manager.
+ *\param a - QAction
+ *\param tBar - QString&
+ *\param id - integer
+ *\param idx - integer
+ *\retval integer id of new action in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createTool( QAction* a, const QString& tBar, const int id, const int idx )
{
if ( !toolMgr() )
return intId != -1 ? regId : -1;
}
+/*! Create tool.
+ * Insert QAction with id \a id from action map(myActionMap) to tool manager.
+ *\param a - QAction
+ *\param tBar - integer
+ *\param id - integer
+ *\param idx - integer
+ *\retval integer id of new action in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createTool( const int id, const int tBar, const int idx )
{
if ( !toolMgr() )
return intId != -1 ? id : -1;
}
+/*! Create tool.
+ * Insert QAction with id \a id from action map(myActionMap) to tool manager.
+ *\param a - QAction
+ *\param tBar - QString&
+ *\param id - integer
+ *\param idx - integer
+ *\retval integer id of new action in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createTool( const int id, const QString& tBar, const int idx )
{
if ( !toolMgr() )
return intId != -1 ? id : -1;
}
+/*! Create menu.
+ * Insert submenu \a subMenu to menu manager.
+ *\param subMenu - QString&
+ *\param menu - integer
+ *\param id - integer
+ *\param group - integer
+ *\param index - integer
+ *\retval integer id of new menu in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createMenu( const QString& subMenu, const int menu,
const int id, const int group, const int index )
{
return menuMgr()->insert( subMenu, menu, group, index );
}
+/*! Create menu.
+ * Insert submenu \a subMenu to menu manager.
+ *\param subMenu - QString&
+ *\param menu - QString&
+ *\param id - integer
+ *\param group - integer
+ *\param index - integer
+ *\retval integer id of new menu in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createMenu( const QString& subMenu, const QString& menu,
const int id, const int group, const int index )
{
return menuMgr()->insert( subMenu, menu, group, index );
}
+
+/*! Create menu. Register action \a a with id \a id.
+ * Insert QAction to menu manager.
+ *\param a - Qaction
+ *\param menu - integer
+ *\param id - integer
+ *\param group - integer
+ *\param index - integer
+ *\retval integer id of new menu in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createMenu( QAction* a, const int menu, const int id, const int group, const int index )
{
if ( !a || !menuMgr() )
return intId != -1 ? regId : -1;
}
+/*! Create menu. Register action \a a with id \a id.
+ * Insert QAction to menu manager.
+ *\param a - Qaction
+ *\param menu - QString&
+ *\param id - integer
+ *\param group - integer
+ *\param index - integer
+ *\retval integer id of new menu in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createMenu( QAction* a, const QString& menu, const int id, const int group, const int index )
{
if ( !a || !menuMgr() )
return intId != -1 ? regId : -1;
}
+/*! Create menu.
+ * Insert QAction with id \a id from action map(myActionMap) to menu manager.
+ *\param menu - integer
+ *\param id - integer
+ *\param group - integer
+ *\param index - integer
+ *\retval integer id of new menu in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createMenu( const int id, const int menu, const int group, const int index )
{
if ( !menuMgr() )
return intId != -1 ? id : -1;
}
+/*! Create menu.
+ * Insert QAction with id \a id from action map(myActionMap) to menu manager.
+ *\param menu - QString&
+ *\param id - integer
+ *\param group - integer
+ *\param index - integer
+ *\retval integer id of new menu in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createMenu( const int id, const QString& menu, const int group, const int index )
{
if ( !menuMgr() )
#pragma warning( disable: 4251 )
#endif
+/*!
+ * Class provide support of tool and menu managers.
+ */
class CAM_EXPORT CAM_Module : public QObject
{
Q_OBJECT
#include <QtxAction.h>
+/*!
+ Constructor.
+*/
SUIT_ActionOperation::SUIT_ActionOperation( SUIT_Application* app )
: SUIT_Operation( app ),
myAction( 0 )
{
}
+/*!
+ Destructor.
+*/
SUIT_ActionOperation::~SUIT_ActionOperation()
{
}
+/*!
+ Gets action.
+*/
QtxAction* SUIT_ActionOperation::action() const
{
return myAction;
}
+/*!Set action.
+ * Create new instance of QtxAction and set.
+ */
void SUIT_ActionOperation::setAction( const QString& text, const QIconSet& icon,
- const QString& menuText, QKeySequence accel,
+ const QString& menuText, QKeySequence accel,
QObject* parent, const char* name, bool toggle )
{
setAction( new QtxAction( text, icon, menuText, accel, parent, name, toggle ) );
}
+/*!Set action.
+ * Create new instance of QtxAction and set.
+ */
void SUIT_ActionOperation::setAction( const QString& text, const QString& menuText,
- QKeySequence accel, QObject* parent, const char* name, bool toggle )
+ QKeySequence accel, QObject* parent, const char* name, bool toggle )
{
setAction( new QtxAction(text, menuText, accel, parent, name, toggle ) );
}
+/*!Set action.
+ */
void SUIT_ActionOperation::setAction( QtxAction* a )
{
if ( myAction == a )
connect( myAction, SIGNAL( activated() ), SLOT( start() ) );
}
+/*! Add action to widget \a wid.
+ *\retval TRUE - successful, FALSE - not successful.
+ */
bool SUIT_ActionOperation::addTo( QWidget* wid )
{
if ( !action() )
return action()->addTo( wid );
}
+/*! Add action to widget \a wid.
+ *\retval TRUE - successful, FALSE - not successful.
+ */
bool SUIT_ActionOperation::addTo( QWidget* wid, int idx )
{
if ( !action() )
return action()->addTo( wid, idx );
}
+/*! Set status tip for action.
+*/
void SUIT_ActionOperation::setStatusTip( const QString& tip )
{
- if ( action() )
- action()->setStatusTip( tip );
+ if ( action() )
+ action()->setStatusTip( tip );
}
class QtxAction;
+/*!Provide support QtxAction*/
class SUIT_EXPORT SUIT_ActionOperation : public SUIT_Operation
{
Q_OBJECT
QtxAction* action() const;
- /** @name GUI management*/ //@{
- virtual void setAction( const QString& text, const QIconSet& icon, const QString& menuText,
- QKeySequence accel, QObject* parent, const char* name = 0, bool toggle = false );
+ /** @name GUI management*/
+ //@{
+ virtual void setAction( const QString& text, const QIconSet& icon, const QString& menuText,
+ QKeySequence accel, QObject* parent, const char* name = 0, bool toggle = false );
- virtual void setAction( const QString& text, const QString& menuText, QKeySequence accel,
- QObject* parent, const char* name = 0, bool toggle = false );
+ virtual void setAction( const QString& text, const QString& menuText, QKeySequence accel,
+ QObject* parent, const char* name = 0, bool toggle = false );
virtual void setAction( QtxAction* theAction );
- bool addTo( QWidget* theWidget );
- bool addTo( QWidget* theWidget, int thePos );
-
- void setStatusTip( const QString& theTip );//@}
-
+ bool addTo( QWidget* theWidget );
+ bool addTo( QWidget* theWidget, int thePos );
+
+ void setStatusTip( const QString& theTip );
+ //@}
+
private:
QtxAction* myAction;
{
}
+/*!
+ Destructor.
+*/
SUIT_DataObject::Signal::~Signal()
{
SUIT_DataObject* o = myOwner;
}
}
+/*!
+ Set owner \a o.
+*/
void SUIT_DataObject::Signal::setOwner( SUIT_DataObject* o )
{
myOwner = o;
}
+/*!
+ emit signal destroed owner.
+*/
void SUIT_DataObject::Signal::emitSignal()
{
if ( myOwner )
#pragma warning( disable:4251 )
#endif
+/*!
+ Class provide support data object.
+*/
class SUIT_EXPORT SUIT_DataObject
{
public:
#include "SUIT_DataObjectIterator.h"
+/*!
+ Constructor.
+*/
SUIT_DataObjectIterator::SUIT_DataObjectIterator( SUIT_DataObject* root, const int det, const bool fromTrueRoot )
: myRoot( root ),
myDetourType( det ),
myCurrent = myExtremeChild = myRoot;
}
+/*!
+ Gets parent for object \a obj.
+*/
SUIT_DataObject* SUIT_DataObjectIterator::parent( SUIT_DataObject* obj ) const
{
SUIT_DataObject* result = 0;
return result;
}
+/*!
+ Increment operator.
+*/
void SUIT_DataObjectIterator::operator++()
{
SUIT_DataObject* aNext = 0;
}
}
+/*!
+ Gets current data object.
+*/
SUIT_DataObject* SUIT_DataObjectIterator::current() const
{
return myCurrent;
}
+/*!
+ Gets depth of current lavel.
+*/
int SUIT_DataObjectIterator::depth() const
{
return myCurrentLevel;
}
+/*!
+ Gets detour type.
+*/
int SUIT_DataObjectIterator::detour() const
{
return myDetourType;
}
+/*!
+ Gets global sibling for object \a obj
+*/
SUIT_DataObject* SUIT_DataObjectIterator::globalSibling( SUIT_DataObject* obj, bool next ) const
{
SUIT_DataObject* par;
return 0;
}
+/*!
+ * Gets first or last data object from list.
+ * Get firls, if \a FromLeft == true, else last.
+ */
SUIT_DataObject* SUIT_DataObjectIterator::extreme( DataObjectList& aList, bool FromLeft ) const
{
if ( FromLeft )
return aList.getLast();
}
-
+/*!
+ Constructor.
+*/
SUIT_DataObjectLevelIterator::SUIT_DataObjectLevelIterator( SUIT_DataObject* root,
int start, int end, bool LeftToRight )
: SUIT_DataObjectIterator( root, LeftToRight ? BreadthLeft : BreadthRight )
SUIT_DataObjectIterator::operator++();
}
+/*!
+ Increment operator.
+*/
void SUIT_DataObjectLevelIterator::operator++()
{
if ( myCurrent )
#include "SUIT_DataObject.h"
+/*!
+ Class provide data object iterator.
+*/
class SUIT_EXPORT SUIT_DataObjectIterator
{
public:
#define _typeinfo type_info
#endif
+/*!\class SUIT_DataObjectKey
+ * Key for personal idetfication of SUIT_DataObject.
+ */
+
/*!
- Class: SUIT_DataObjectKey
- Descr: Key for personal idetfication of SUIT_DataObject.
+ Constructor.
*/
-
SUIT_DataObjectKey::SUIT_DataObjectKey()
: refCounter( 0 )
{
}
+/*!
+ Destructor.
+*/
SUIT_DataObjectKey::~SUIT_DataObjectKey()
{
}
+/*!\class SUIT_DataObjectKeyHandle
+ * Wrapper around the pointer of class SUIT_DataObjectKey.
+ */
+
/*!
- Class: SUIT_DataObjectKeyHandle
- Descr: Wrapper around the pointer of class SUIT_DataObjectKey.
+ Constructor.
*/
-
SUIT_DataObjectKeyHandle::SUIT_DataObjectKeyHandle()
: myKey( 0 )
{
}
+/*!
+ Copy Constructor.
+*/
SUIT_DataObjectKeyHandle::SUIT_DataObjectKeyHandle( const SUIT_DataObjectKeyHandle& other )
: myKey( other.myKey )
{
beginScope();
}
+/*!
+ Constructor. Initialize by key \a key.
+*/
SUIT_DataObjectKeyHandle::SUIT_DataObjectKeyHandle( SUIT_DataObjectKey* key )
: myKey( key )
{
beginScope();
}
+/*!
+ Destructor.
+*/
SUIT_DataObjectKeyHandle::~SUIT_DataObjectKeyHandle()
{
nullify();
}
+/*!
+ * Checks: Is key null?
+ *\retval TRUE - if null, esle false.
+*/
bool SUIT_DataObjectKeyHandle::isNull() const
{
return !myKey;
}
+/*!
+ Nullify key.
+*/
void SUIT_DataObjectKeyHandle::nullify()
{
endScope();
}
+/*!
+ * Operator less.
+ *\retval boolean. TRUE - If current key less than \a kw.
+ */
bool SUIT_DataObjectKeyHandle::operator<( const SUIT_DataObjectKeyHandle& kw ) const
{
if ( myKey == kw.myKey )
return myKey->isLess( kw.myKey );
}
+/*!
+ * Operator is equal.
+ *\retval boolean. TRUE - If current key equal \a kw.
+ */
bool SUIT_DataObjectKeyHandle::operator==( const SUIT_DataObjectKeyHandle& kw ) const
{
if ( myKey == kw.myKey )
return myKey->isEqual( kw.myKey );
}
+/*!
+ * Copy value of key \a kw to current.
+ */
SUIT_DataObjectKeyHandle& SUIT_DataObjectKeyHandle::operator=( const SUIT_DataObjectKeyHandle& kw )
{
if ( myKey != kw.myKey )
return *this;
}
+/*!
+ * Inctrement reference counter for current key.
+ */
void SUIT_DataObjectKeyHandle::beginScope()
{
if ( myKey )
myKey->refCounter++;
}
+/*!
+ * Decrement reference counter for current key.
+ */
void SUIT_DataObjectKeyHandle::endScope()
{
if ( !myKey )
#include <qstatusbar.h>
#include <qapplication.h>
+/*!\class SUIT_Desktop
+ * Provide desktop management:\n
+ * \li menu manager
+ * \li tool manager
+ * \li windows
+ */
+
+/*!
+ Constructor.
+*/
SUIT_Desktop::SUIT_Desktop()
: QtxMainWindow()
{
myToolMgr = new QtxActionToolMgr( this );
}
+/*!
+ Destructor.
+*/
SUIT_Desktop::~SUIT_Desktop()
{
}
+/*!
+ Emit on event \a e.
+*/
bool SUIT_Desktop::event( QEvent* e )
{
if ( !e )
return QMainWindow::event( e );
}
+/*!
+ Close event \a e.
+*/
void SUIT_Desktop::closeEvent( QCloseEvent* e )
{
emit closing( this, e );
e->ignore();
}
+/*!
+ Child event.
+*/
void SUIT_Desktop::childEvent( QChildEvent* e )
{
if ( e->type() == QEvent::ChildInserted && parentArea() &&
QtxMainWindow::childEvent( e );
}
+/*!
+ Gets menu manager.
+*/
QtxActionMenuMgr* SUIT_Desktop::menuMgr() const
{
return myMenuMgr;
}
+/*!
+ Gets tool manager.
+*/
QtxActionToolMgr* SUIT_Desktop::toolMgr() const
{
return myToolMgr;
#include <qapplication.h>
+/*!\class SUIT_ExceptionHandler
+ * Show exception message on error handler.
+ */
+
+/*!
+ Checks: is internal handle on object \a o?
+*/
bool SUIT_ExceptionHandler::handle( QObject* o, QEvent* e )
{
return internalHandle( o, e );
}
+/*!
+ Checks: is internal handle on object \a o?
+*/
bool SUIT_ExceptionHandler::internalHandle( QObject* o, QEvent* e )
{
return qApp ? qApp->QApplication::notify( o, e ) : false;
}
+/*!
+ Show error message \a mgs, if application is not null.
+*/
void SUIT_ExceptionHandler::showMessage( const QString& title, const QString& msg )
{
if ( !qApp )
delete mySignal;
}
+/*!
+ Connect popup request.
+*/
bool SUIT_PopupClient::connectPopupRequest( QObject* reciever, const char* slot )
{
if ( !reciever || !slot )
reciever, slot );
}
+/*!
+ Disconnect popup request.
+*/
bool SUIT_PopupClient::disconnectPopupRequest( QObject* reciever, const char* slot )
{
if ( !reciever || !slot || !mySignal )
reciever, slot );
}
+/*!
+ Send signal on context menu request.
+*/
void SUIT_PopupClient::contextMenuRequest( QContextMenuEvent* e )
{
if ( mySignal )
mySignal->sendSignal( this, e );
}
-/*
- Class: SUIT_PopupClient::Signal [internal]
- Descr: invoke signal which is connected to reciever in SUIT_PopupClient
-*/
+/*!
+ * \class SUIT_PopupClient::Signal
+ * Descr: invoke signal which is connected to reciever in SUIT_PopupClient
+ */
/*! constructor*/
SUIT_PopupClient::Signal::Signal()
SUIT_PopupClient::Signal::~Signal()
{}
+/*! Send signal to \a client on context menu request \a e.
+ */
void SUIT_PopupClient::Signal::sendSignal( SUIT_PopupClient* client, QContextMenuEvent* e )
{
emit contextMenuRequest( client, e );
class QPopupMenu;
class QContextMenuEvent;
-/*!Class: SUIT_PopupClient [public] \n
+/*!\class SUIT_PopupClient
* Descr: Base class for instances which creates popup menu on QContextMenuEvent
*/
class SUIT_EXPORT SUIT_PopupClient
#include "SUIT_SelectionMgr.h"
+/*!\class SUIT_SelectionMgr
+ * Provide selection manager. Manipulate by selection filters, modes, data owners.
+ */
+
/*!constructor. initialize myIterations and myIsSelChangeEnabled.*/
SUIT_SelectionMgr::SUIT_SelectionMgr( const bool Feedback )
: myIterations( Feedback ? 1 : 0 ),
mySelectors.setAutoDelete( true );
}
+/*!Add selector \a sel to selectors list,if it's not exists in list.*/
void SUIT_SelectionMgr::installSelector( SUIT_Selector* sel )
{
if ( sel && !mySelectors.contains( sel ) )
mySelectors.append( sel );
}
+/*!Remove selector \a sel from list.*/
void SUIT_SelectionMgr::removeSelector( SUIT_Selector* sel )
{
mySelectors.remove( sel );
}
+/*!Gets selectors list to \a lst.*/
void SUIT_SelectionMgr::selectors( QPtrList<SUIT_Selector>& lst ) const
{
lst.clear();
lst.append( it.current() );
}
+/*!Gets selectors list to \a lst with type \a typ.*/
void SUIT_SelectionMgr::selectors( const QString& typ, QPtrList<SUIT_Selector>& lst ) const
{
lst.clear();
}
}
+/*! Sets ebabled to \a on for all data owners with type \a typ.
+*/
void SUIT_SelectionMgr::setEnabled( const bool on, const QString& typ )
{
for ( SelectorListIterator it( mySelectors ); it.current(); ++it )
}
}
+/*! Gets selected data owners from list with type \a type to list \a lst.
+*/
void SUIT_SelectionMgr::selected( SUIT_DataOwnerPtrList& lst, const QString& type ) const
{
lst.clear();
}
}
+/*! Sets selected data owners from \a lst and append to list, if \a append - true.
+*/
void SUIT_SelectionMgr::setSelected( const SUIT_DataOwnerPtrList& lst, const bool append )
{
SUIT_DataOwnerPtrList owners;
}
}
+/*! Clear selected data owners.
+*/
void SUIT_SelectionMgr::clearSelected()
{
setSelected( SUIT_DataOwnerPtrList() );
}
+/*! On selection \a sel changed.
+*/
void SUIT_SelectionMgr::selectionChanged( SUIT_Selector* sel )
{
if ( !sel || !myIsSelChangeEnabled || !sel->isEnabled() )
emit selectionChanged();
}
+/*! Checks: Is selection manager has selection mode \a mode?
+*/
bool SUIT_SelectionMgr::hasSelectionMode( const int mode ) const
{
return mySelModes.contains( mode );
}
+/*! Gets selection modes to list \a vals.
+*/
void SUIT_SelectionMgr::selectionModes( QValueList<int>& vals ) const
{
vals = mySelModes;
}
+/*! Set selection mode \a mode to list of selection modes.
+*/
void SUIT_SelectionMgr::setSelectionModes( const int mode )
{
QValueList<int> lst;
setSelectionModes( lst );
}
+/*! Sets selection modes list from \a lst.
+*/
void SUIT_SelectionMgr::setSelectionModes( const QValueList<int>& lst )
{
mySelModes = lst;
}
+/*! Append selection mode \a mode to list of selection modes.
+*/
void SUIT_SelectionMgr::appendSelectionModes( const int mode )
{
QValueList<int> lst;
appendSelectionModes( lst );
}
+/*! Append selection modes \a lst list.
+*/
void SUIT_SelectionMgr::appendSelectionModes( const QValueList<int>& lst )
{
QMap<int, int> map;
}
}
+/*! Remove selection mode \a mode from list.
+*/
void SUIT_SelectionMgr::removeSelectionModes( const int mode )
{
QValueList<int> lst;
removeSelectionModes( lst );
}
+/*! Remove selection modea \a lst from list.
+*/
void SUIT_SelectionMgr::removeSelectionModes( const QValueList<int>& lst )
{
QMap<int, int> map;
mySelModes.append( iter.key() );
}
+/*! Checks data owner is ok?
+*/
bool SUIT_SelectionMgr::isOk( const SUIT_DataOwner* owner ) const
{
if ( !owner )
return ok;
}
+/*! Checks data owner pointer is ok?
+*/
bool SUIT_SelectionMgr::isOk( const SUIT_DataOwnerPtr& ptr ) const
{
if ( ptr.isNull() )
return isOk( ptr.operator->() );
}
+/*! Checks selection manager has filter \a f?
+*/
bool SUIT_SelectionMgr::hasFilter( SUIT_SelectionFilter* f ) const
{
return myFilters.contains( f );
}
+/*! Install filter \a f and set selected, if \a update = true.
+*/
void SUIT_SelectionMgr::installFilter( SUIT_SelectionFilter* f, const bool updateSelection )
{
if ( !hasFilter( f ) )
}
}
+/*! Remove filter \a f from filters list.
+*/
void SUIT_SelectionMgr::removeFilter( SUIT_SelectionFilter* f )
{
myFilters.remove( f );
}
+/*! Clear filters list.
+*/
void SUIT_SelectionMgr::clearFilters()
{
myFilters.clear();
}
+/*! Sets auto delete filter.
+*/
bool SUIT_SelectionMgr::autoDeleteFilter() const
{
return myFilters.autoDelete();
}
+/*! Sets auto delete filter to \a on.
+*/
void SUIT_SelectionMgr::setAutoDeleteFilter( const bool on )
{
myFilters.setAutoDelete( on );
}
+/*! Gets good data owners list to \a out from \a in.
+*/
void SUIT_SelectionMgr::filterOwners( const SUIT_DataOwnerPtrList& in, SUIT_DataOwnerPtrList& out ) const
{
out.clear();
#include "SUIT_SelectionMgr.h"
+/*!\class SUIT_Selector
+ * Class provide selector for data owners.
+ */
+
+/*!
+ Constructor.
+*/
SUIT_Selector::SUIT_Selector( SUIT_SelectionMgr* selMgr, QObject* parent ) :
QObject( parent ),
mySelMgr( selMgr ),
selMgr->installSelector( this );
}
+/*!
+ Destructor.
+*/
SUIT_Selector::~SUIT_Selector()
{
if ( selectionMgr() )
selectionMgr()->removeSelector( this );
}
+/*!
+ Gets selection manager.
+*/
SUIT_SelectionMgr* SUIT_Selector::selectionMgr() const
{
return mySelMgr;
}
+/*!
+ Checks: Is selctor enabled?
+*/
bool SUIT_Selector::isEnabled() const
{
return myEnabled;
}
+/*!
+ Sets selctor anbled to \a on.
+*/
void SUIT_Selector::setEnabled( const bool on )
{
myEnabled = on;
}
+/*!
+ Checks: Is selector auto block?
+*/
bool SUIT_Selector::autoBlock() const
{
return myAutoBlock;
}
+/*!
+ Sets selctor autoblock to \a on.
+*/
void SUIT_Selector::setAutoBlock( const bool on )
{
myAutoBlock = on;
}
+/*!
+ Puts to \a lst selection list of data owners.
+*/
void SUIT_Selector::selected( SUIT_DataOwnerPtrList& lst ) const
{
lst.clear();
getSelection( lst );
}
+/*!
+ Puts to selection list of data owners \a lst..
+*/
void SUIT_Selector::setSelected( const SUIT_DataOwnerPtrList& lst )
{
if ( !isEnabled() )
myBlock = block;
}
+/*!
+ On selection changed.
+*/
void SUIT_Selector::selectionChanged()
{
if ( selectionMgr() && isEnabled() && ( !autoBlock() || !myBlock ) )
selectionMgr()->selectionChanged( this );
}
+/*!
+ Checks: Is selection manager has selection mode \a mode?
+*/
bool SUIT_Selector::hasSelectionMode( const int mode ) const
{
if ( !selectionMgr() )
return selectionMgr()->hasSelectionMode( mode );
}
+/*!
+ Puts to list \a lst selection modes from selection manager.
+*/
void SUIT_Selector::selectionModes( QValueList<int>& lst ) const
{
if ( selectionMgr() )
class SUIT_ResourceMgr;
class SUIT_ExceptionHandler;
-/*!
- The class Sesssion manages launching of Applications. Application must be returned
- by static function "createApplication" in external library. The Library must be loaded with
- loadLibrary method and after that application can be started.
-*/
-
#ifdef WNT
#pragma warning( disable:4251 )
#endif
-
+/*!
+ The class Sesssion manages launching of Applications. Application must be returned \n
+ by static function "createApplication" in external library. The Library must be loaded with \n
+ loadLibrary method and after that application can be started.
+*/
class SUIT_EXPORT SUIT_Session: public QObject
{
Q_OBJECT
#include "SUIT_MessageBox.h"
#include "SUIT_Application.h"
+/*!\class SUIT_Study
+ * Support study management. Object management. Operation management.
+ */
+
+/*!Constructor.*/
SUIT_Study::SUIT_Study( SUIT_Application* app )
: QObject(),
myApp( app ),
myOperations.setAutoDelete( false );
}
+/*!Destructor.*/
SUIT_Study::~SUIT_Study()
{
delete myRoot;
myRoot = 0;
}
+/*!
+ *\retval study id.
+ */
int SUIT_Study::id() const
{
return myId;
}
+/*!
+ *\retval root data object.
+ */
SUIT_DataObject* SUIT_Study::root() const
{
return myRoot;
}
+/*!
+ *\retval Application.
+ */
SUIT_Application* SUIT_Study::application() const
{
return myApp;
}
+/*!
+ *\retval study name
+ */
QString SUIT_Study::studyName() const
{
return myName;
}
+/*!
+ *\retval active operation.
+ */
SUIT_Operation* SUIT_Study::activeOperation() const
{
return myOperations.current();
}
+/*!
+ *\retval TRUE - if study saved, else FALSE.
+ */
bool SUIT_Study::isSaved() const
{
return myIsSaved;
}
+/*!
+ *\retval TRUE - if study modified, else FALSE.
+ */
bool SUIT_Study::isModified() const
{
return myIsModified;
}
+/*!
+ *Close document. NOT IMPLEMENTED.
+ */
void SUIT_Study::closeDocument(bool permanently)
{
}
*/
}
+/*!
+ * Open document. Sets file name. return true.
+ */
bool SUIT_Study::openDocument( const QString& fileName )
{
myName = fileName;
return true;
}
+/*!
+ * Save document as \a fileName. Set file name.
+ */
bool SUIT_Study::saveDocumentAs( const QString& fileName )
{
myName = fileName;
return true;
}
+/*!
+ *\retval TRUE - if document saved successful, else FALSE.
+ */
bool SUIT_Study::saveDocument()
{
return saveDocumentAs( myName );
}
+/*!
+ *Abort all operations.
+ */
void SUIT_Study::abortAllOperations()
{
SUIT_Operation* aOperation = 0;
}
}
+/*!
+ Update study. NOT IMPLEMENTED HERE.
+ */
void SUIT_Study::update()
{
}
+/*!
+ Emit study modified.
+ */
void SUIT_Study::sendChangesNotification()
{
emit studyModified( this );
}
+/*!
+ Set study saved to \a on.
+ */
void SUIT_Study::setIsSaved( const bool on )
{
myIsSaved = on;
}
+/*!
+ Set study modified to \a on.
+ */
void SUIT_Study::setIsModified( const bool on )
{
myIsModified = on;
}
+/*!
+ Set root object.
+ */
void SUIT_Study::setRoot( SUIT_DataObject* obj )
{
if ( myRoot == obj )
myRoot = obj;
}
+/*!
+ Set study name.
+ */
void SUIT_Study::setStudyName( const QString& name )
{
myName = name;
}
+/*!
+ Stop operation.
+ */
void SUIT_Study::stopOperation()
{
myOperations.pop();
myIsModified = true;
}
+/*!
+ * Set can start operation \a theOperation.
+ *\retval FALSE - if can't start.
+ */
bool SUIT_Study::canStartOperation( SUIT_Operation* theOperation )
{
SUIT_Operation* anActiveOperation = (SUIT_Operation*)activeOperation();
#include <qpopupmenu.h>
#include <qstyle.h>
+/*!Constructor.*/
SUIT_ToolButton::SUIT_ToolButton( QWidget *parent,
const char *name,
bool changeItemAfterClick)
initialize();
}
-
+/*!Constructor.*/
SUIT_ToolButton::SUIT_ToolButton( const QPixmap & pm,
const QString &textLabel,
const QString& grouptext,
}
-//********************************************************************************
+/*!Initialize tool buttons.*/
void SUIT_ToolButton::initialize()
{
mySignal = NULL;
setPopupDelay(250);
}
-//********************************************************************************
+/*!drawButton is redefined to draw DownArrow*/
void SUIT_ToolButton::drawButton( QPainter * p )
{
QToolButton::drawButton(p);
}
-//********************************************************************************
+/*! Add action into popup*/
void SUIT_ToolButton::AddAction(QAction* theAction)
{
bool aIsFirst = false;
theAction->addTo( myPopup );
}
-
-//********************************************************************************
+/*! Sets myPopup item with theIndex as current*/
void SUIT_ToolButton::SetItem(int theIndex)
{
int anId = myPopup->idAt(theIndex);
}
}
-//********************************************************************************
+/*!Public SLOT.
+ * On select action (icon and text set with id = \a theItemID)
+ */
void SUIT_ToolButton::OnSelectAction(int theItemID)
{
if (myChangeItemAfterClick)
-//********************************************************************************
+/*!On mouse release event.*/
void SUIT_ToolButton::mouseReleaseEvent ( QMouseEvent * theEvent)
{
QToolButton::mouseReleaseEvent(theEvent);
bool changeItemAfterClick = true );
//@}
- /*!drawButton is redefined to draw DownArrow*/
void drawButton( QPainter * pQPainter);
- /*! Add action into popup*/
void AddAction(QAction* theAction);
- /*! Sets myPopup item with theIndex as current*/
void SetItem(int theIndex);
public slots:
#include <windows.h>
#endif
-//***************************************************************
+/*!\class SUIT_ViewManager.
+ * Class provide manipulation with view windows.
+ */
+
+/*!Constructor.*/
SUIT_ViewManager::SUIT_ViewManager( SUIT_Study* theStudy,
SUIT_Desktop* theDesktop,
SUIT_ViewModel* theViewModel )
connect( myStudy, SIGNAL( destroyed() ), this, SLOT( onDeleteStudy() ) );
}
-//***************************************************************
+/*!Destructor.*/
SUIT_ViewManager::~SUIT_ViewManager()
{
if (myViewModel) {
}
}
-//***************************************************************
+/*!Sets view model \a theViewModel to view manager.*/
void SUIT_ViewManager::setViewModel(SUIT_ViewModel* theViewModel)
{
if (myViewModel && myViewModel != theViewModel) {
myViewModel->setViewManager(this);
}
-//***************************************************************
+/*!Sets view name for view window \a theView.*/
void SUIT_ViewManager::setViewName(SUIT_ViewWindow* theView)
{
int aPos = myViews.find(theView);
theView->setCaption(myTitle + QString(":%1").arg(aPos+1));
}
-//***************************************************************
+/*! Creates View, adds it into list of views and returns just created view window*/
SUIT_ViewWindow* SUIT_ViewManager::createViewWindow()
{
SUIT_ViewWindow* aView = myViewModel->createView(myDesktop);
return aView;
}
-//***************************************************************
+/*!Create view window.*/
void SUIT_ViewManager::createView()
{
createViewWindow();
}
-//***************************************************************
+/*!Insert view window to view manager.
+ *\retval false - if something wrong, else true.
+ */
bool SUIT_ViewManager::insertView(SUIT_ViewWindow* theView)
{
unsigned int aSize = myViews.size();
return false;
}
-
-//***************************************************************
+/*!Emit delete view. Remove view window \a theView from view manager.
+*/
void SUIT_ViewManager::onDeleteView(SUIT_ViewWindow* theView)
{
emit deleteView(theView);
removeView(theView);
}
-//***************************************************************
+/*!Remove view window \a theView from view manager.
+ *And close the last view, if it has \a theView.
+*/
void SUIT_ViewManager::removeView(SUIT_ViewWindow* theView)
{
theView->disconnect(this);
emit lastViewClosed(this);
}
-//***************************************************************
+/*!Emit on \a theEvent mouse pressed in \a theView.*/
void SUIT_ViewManager::onMousePressed(SUIT_ViewWindow* theView, QMouseEvent* theEvent)
{
emit mousePress(theView, theEvent);
}
-//***************************************************************
+/*!Emit activated for view \a view.
+*/
void SUIT_ViewManager::onWindowActivated(SUIT_ViewWindow* view)
{
if (view) {
}
}
-//***************************************************************
+/*!Close all views.
+*/
void SUIT_ViewManager::closeAllViews()
{
unsigned int aSize = myViews.size();
}
}
-
-//***************************************************************
+/*!
+ *\retval QString - type of view model.
+ */
QString SUIT_ViewManager::getType() const
{
return (!myViewModel)? "": myViewModel->getType();
}
-//***************************************************************
+/*!
+ *\retval SUIT_Study* - current study.
+ */
SUIT_Study* SUIT_ViewManager::study() const
{
return myStudy;
}
-//***************************************************************
+/*!
+ * Sets stydy to NULL.
+ */
void SUIT_ViewManager::onDeleteStudy()
{
myStudy = NULL;
}
-//***************************************************************
void SUIT_ViewManager::onContextMenuRequested( QContextMenuEvent* e )
{
/*! invoke method of SUIT_PopupClient, which notifies about popup*/
contextMenuRequest( e );
}
-//***************************************************************
+/*!Context menu popup for \a popup.*/
void SUIT_ViewManager::contextMenuPopup( QPopupMenu* popup )
{
SUIT_ViewModel* vm = getViewModel();
QString getTitle() const { return myTitle;}
void setTitle(QString theTitle) { myTitle = theTitle; }
- /*! Creates View, adds it into list of views and returns just created view window*/
SUIT_ViewWindow* createViewWindow();
public slots:
#include "SUIT_ViewModel.h"
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
SUIT_ViewModel::StatesMap SUIT_ViewModel::myStateMap;
SUIT_ViewModel::ButtonsMap SUIT_ViewModel::myButtonMap;
static bool isInitialized = false;
+/*!Constructor.*/
SUIT_ViewModel::SUIT_ViewModel()
{
if (!isInitialized) {
myViewManager = 0;
}
+/*!Destructor..*/
SUIT_ViewModel::~SUIT_ViewModel()
{
}
-//***************************************************************
+/*!Create new instance of view window on desktop \a theDesktop.
+ *\retval SUIT_ViewWindow* - created view window pointer.
+ */
SUIT_ViewWindow* SUIT_ViewModel::createView(SUIT_Desktop* theDesktop)
{
return new SUIT_ViewWindow(theDesktop);
}
-//*********************************************************************
+/*! Sets hot button
+ *\param theOper - hot operation
+ *\param theState - adding state to state map operations.
+ *\param theButton - adding state to button map operations.
+ */
void SUIT_ViewModel::setHotButton(HotOperation theOper, Qt::ButtonState theState,
- Qt::ButtonState theButton)
+ Qt::ButtonState theButton)
{
myStateMap[theOper] = theState;
myButtonMap[theOper] = theButton;
}
-//*********************************************************************
+/*! Gets hot button for operation \a theOper.
+ *\param theOper - input hot operation
+ *\param theState - output state from state map operations.
+ *\param theButton - output state from button map operations.
+*/
void SUIT_ViewModel::getHotButton(HotOperation theOper, Qt::ButtonState& theState,
- Qt::ButtonState& theButton)
+ Qt::ButtonState& theButton)
{
theState = myStateMap[theOper];
theButton = myButtonMap[theOper];
#include <qobject.h>
#include <qcursor.h>
+#ifdef WIN32
+#pragma warning( disable:4251 )
+#endif
/*!
* This object manages the definition and behaviour of a View Window. \n
* In case of definition of this object in an external lib that lib must \n
* have an exported function "createViewModel" which returns newly created \n
* instance of SUIT_ViewModel.
*/
-
-#ifdef WIN32
-#pragma warning( disable:4251 )
-#endif
-
class SUIT_EXPORT SUIT_ViewModel : public QObject
{
Q_OBJECT
#include "qpopupmenu.h"
#include "qapplication.h"
-// Dump view custom event
-const int DUMP_EVENT = QEvent::User + 123;
+/*!\class SUIT_ViewWindow
+ * Class provide view window.
+ */
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
+/*! Dump view custom event*/
+const int DUMP_EVENT = QEvent::User + 123;
+/*! Constructor.*/
SUIT_ViewWindow::SUIT_ViewWindow(SUIT_Desktop* theDesktop)
: QMainWindow( theDesktop, "SUIT_ViewWindow", Qt::WDestructiveClose )
{
myDesktop = theDesktop;
}
-
+/*! Destructor.*/
SUIT_ViewWindow::~SUIT_ViewWindow()
{
}
-//***************************************************************
+/*! Close event \a theEvent.
+*/
void SUIT_ViewWindow::closeEvent(QCloseEvent* theEvent)
{
QMainWindow::closeEvent( theEvent );
emit closing( this );
}
-//****************************************************************
+/*! Context menu requested for event \a e.
+*/
void SUIT_ViewWindow::contextMenuEvent ( QContextMenuEvent * e )
{
if ( e->reason() != QContextMenuEvent::Mouse )
emit contextMenuRequested( e );
}
-//****************************************************************
+/*! Post events on dump view.
+*/
void SUIT_ViewWindow::onDumpView()
{
qApp->postEvent( this, new QPaintEvent( QRect( 0, 0, width(), height() ), TRUE ) );
qApp->postEvent( this, new QCustomEvent( DUMP_EVENT ) );
}
-//****************************************************************
+/*! Reaction view window on event \a e.
+*/
bool SUIT_ViewWindow::event( QEvent* e )
{
if ( e->type() == DUMP_EVENT ) {
}
return QMainWindow::event( e );
}
-
-//****************************************************************
#include "LocalTraceBufferPool.hxx"
-/*!
- * For each message to put in the trace, a specific ostingstream object is
- * created and destroyed automatically at the end of the message macro.
- * The insert function of LocalTraceBufferPool class gets a buffer in a
- * buffer pool (unique with the help of mutexes and semaphores) and copy the
- * message in the buffer.
- * This buffer is read later by a specific thread in charge of trace print.
- * Order of trace entries is globally respected. Nevertheless, if there are
- * several threads waiting for a free buffer to trace, the order of
+/** \file utilities.h
+ * For each message to put in the trace, a specific ostingstream object is \n
+ * created and destroyed automatically at the end of the message macro. \n
+ * The insert function of LocalTraceBufferPool class gets a buffer in a \n
+ * buffer pool (unique with the help of mutexes and semaphores) and copy the \n
+ * message in the buffer.\n
+ * This buffer is read later by a specific thread in charge of trace print.\n
+ * Order of trace entries is globally respected. Nevertheless, if there are \n
+ * several threads waiting for a free buffer to trace, the order of \n
* thread waken up is not garanteed (no fifo or priority rules in Linux Kernel)
*/
<< " at " << __TIME__ << MESS_END }
#ifdef _DEBUG_
-// --- the following MACROS are useful at debug time
-
+/** @name the following MACROS are useful at debug time*/
+//@{
#define MESSAGE(msg) {MESS_BEGIN("- Trace ") << msg << MESS_END}
#define SCRUTE(var) {MESS_BEGIN("- Trace ") << #var << "=" << var <<MESS_END}
#define ASSERT(condition) \
if (!(condition)){INTERRUPTION("CONDITION "<<#condition<<" NOT VERIFIED")}
#endif /* ASSERT */
-
+//@}
#else /* ifdef _DEBUG_*/
myTrihedron->Delete();
}
+/*!Checks: is trihedron displayed.*/
bool VTKViewer_ViewWindow::isTrihedronDisplayed(){
return myTrihedron->GetVisibility() == VTKViewer_Trihedron::eOn;
}
-/*!
- Activates 'zooming' transformation
-*/
+/*!Activates 'zooming' transformation*/
void VTKViewer_ViewWindow::activateZoom()
{
myRWInteractor->GetInteractorStyle()->startZoom();
}
-/*!
- Activates 'panning' transformation
-*/
+/*!Activates 'panning' transformation*/
void VTKViewer_ViewWindow::activatePanning()
{
myRWInteractor->GetInteractorStyle()->startPan();
}
-/*!
- Activates 'rotation' transformation
-*/
+/*!Activates 'rotation' transformation*/
void VTKViewer_ViewWindow::activateRotation()
{
myRWInteractor->GetInteractorStyle()->startRotate();
}
+/*!Activate global panning.*/
void VTKViewer_ViewWindow::activateGlobalPanning()
{
//if(myTrihedron->GetVisibleActorCount(myRenderer))
myRWInteractor->GetInteractorStyle()->startGlobalPan();
}
-/*!
- Activates 'fit area' transformation
-*/
+/*!Activates 'fit area' transformation*/
void VTKViewer_ViewWindow::activateWindowFit()
{
myRWInteractor->GetInteractorStyle()->startFitArea();
}
+/*!Create actions:*/
void VTKViewer_ViewWindow::createActions()
{
if (!myActionsMap.isEmpty()) return;
QtxAction* aAction;
- // Dump view
+ //! \li Dump view
aAction = new QtxAction(tr("MNU_DUMP_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_DUMP" ) ),
tr( "MNU_DUMP_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_DUMP_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onDumpView()));
myActionsMap[ DumpId ] = aAction;
- // FitAll
+ //! \li FitAll
aAction = new QtxAction(tr("MNU_FITALL"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITALL" ) ),
tr( "MNU_FITALL" ), 0, this);
aAction->setStatusTip(tr("DSC_FITALL"));
connect(aAction, SIGNAL(activated()), this, SLOT(onFitAll()));
myActionsMap[ FitAllId ] = aAction;
- // FitRect
+ //! \li FitRect
aAction = new QtxAction(tr("MNU_FITRECT"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITAREA" ) ),
tr( "MNU_FITRECT" ), 0, this);
aAction->setStatusTip(tr("DSC_FITRECT"));
connect(aAction, SIGNAL(activated()), this, SLOT(activateWindowFit()));
myActionsMap[ FitRectId ] = aAction;
- // Zoom
+ //! \li Zoom
aAction = new QtxAction(tr("MNU_ZOOM_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ZOOM" ) ),
tr( "MNU_ZOOM_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(activateZoom()));
myActionsMap[ ZoomId ] = aAction;
- // Panning
+ //! \li Panning
aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_PAN" ) ),
tr( "MNU_PAN_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_PAN_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(activatePanning()));
myActionsMap[ PanId ] = aAction;
- // Global Panning
+ //! \li Global Panning
aAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_GLOBALPAN" ) ),
tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(activateGlobalPanning()));
myActionsMap[ GlobalPanId ] = aAction;
- // Rotation
+ //! \li Rotation
aAction = new QtxAction(tr("MNU_ROTATE_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ROTATE" ) ),
tr( "MNU_ROTATE_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_ROTATE_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(activateRotation()));
myActionsMap[ RotationId ] = aAction;
- // Projections
+ //! \li Projections
aAction = new QtxAction(tr("MNU_FRONT_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FRONT" ) ),
tr( "MNU_FRONT_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_FRONT_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onFrontView()));
myActionsMap[ FrontId ] = aAction;
+ //! \li Back view
aAction = new QtxAction(tr("MNU_BACK_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BACK" ) ),
tr( "MNU_BACK_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_BACK_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onBackView()));
myActionsMap[ BackId ] = aAction;
+ //! \li Top view
aAction = new QtxAction(tr("MNU_TOP_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TOP" ) ),
tr( "MNU_TOP_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_TOP_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onTopView()));
myActionsMap[ TopId ] = aAction;
+ //! \li Bottom view
aAction = new QtxAction(tr("MNU_BOTTOM_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BOTTOM" ) ),
tr( "MNU_BOTTOM_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_BOTTOM_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onBottomView()));
myActionsMap[ BottomId ] = aAction;
+ //! \li Left view
aAction = new QtxAction(tr("MNU_LEFT_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_LEFT" ) ),
tr( "MNU_LEFT_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_LEFT_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onLeftView()));
myActionsMap[ LeftId ] = aAction;
+ //! \li Right view
aAction = new QtxAction(tr("MNU_RIGHT_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RIGHT" ) ),
tr( "MNU_RIGHT_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_RIGHT_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onRightView()));
myActionsMap[ RightId ] = aAction;
- // Reset
+ //! \li Reset
aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ),
tr( "MNU_RESET_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_RESET_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onResetView()));
myActionsMap[ ResetId ] = aAction;
+ //! \li Trihedron shown
aAction = new QtxAction(tr("MNU_SHOW_TRIHEDRON"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ),
tr( "MNU_SHOW_TRIHEDRON" ), 0, this);
aAction->setStatusTip(tr("DSC_SHOW_TRIHEDRON"));
myActionsMap[ TrihedronShowId ] = aAction;
}
+/*!Create tool bar.*/
void VTKViewer_ViewWindow::createToolBar()
{
myActionsMap[DumpId]->addTo(myToolBar);
myActionsMap[ResetId]->addTo(myToolBar);
}
+/*!On front view event.*/
void VTKViewer_ViewWindow::onFrontView()
{
vtkCamera* camera = myRenderer->GetActiveCamera();
onFitAll();
}
+/*!On back view slot.*/
void VTKViewer_ViewWindow::onBackView()
{
vtkCamera* camera = myRenderer->GetActiveCamera();
onFitAll();
}
+/*!On back view slot.*/
void VTKViewer_ViewWindow::onTopView()
{
vtkCamera* camera = myRenderer->GetActiveCamera();
onFitAll();
}
+/*!On bottom view slot.*/
void VTKViewer_ViewWindow::onBottomView()
{
vtkCamera* camera = myRenderer->GetActiveCamera();
onFitAll();
}
+/*!On left view slot.*/
void VTKViewer_ViewWindow::onLeftView()
{
vtkCamera* camera = myRenderer->GetActiveCamera();
onFitAll();
}
+/*!On right view slot.*/
void VTKViewer_ViewWindow::onRightView()
{
vtkCamera* camera = myRenderer->GetActiveCamera();
onFitAll();
}
+/*!On reset view slot.*/
void VTKViewer_ViewWindow::onResetView()
{
int aTriedronIsVisible = isTrihedronDisplayed();
Repaint();
}
+/*!On fit all slot.*/
void VTKViewer_ViewWindow::onFitAll()
{
myRWInteractor->GetInteractorStyle()->ViewFitAll();
Repaint();
}
-/*!
- Set background of the viewport
-*/
+/*!Set background of the viewport*/
void VTKViewer_ViewWindow::setBackgroundColor( const QColor& color )
{
if ( myRenderer )
myRenderer->SetBackground( color.red()/255., color.green()/255., color.blue()/255. );
}
-/*!
- Returns background of the viewport
-*/
+/*!Returns background of the viewport*/
QColor VTKViewer_ViewWindow::backgroundColor() const
{
float backint[3];
return SUIT_ViewWindow::backgroundColor();
}
+/*!Repaint window. If \a theUpdateTrihedron is true - recalculate trihedron.*/
void VTKViewer_ViewWindow::Repaint(bool theUpdateTrihedron)
{
if (theUpdateTrihedron) onAdjustTrihedron();
myRenderWindow->update();
}
+/*!Get scale of transformation filter.*/
void VTKViewer_ViewWindow::GetScale( double theScale[3] ) {
myTransform->GetScale( theScale );
}
+/*!Set scale of transformation filter and repaint window.*/
void VTKViewer_ViewWindow::SetScale( double theScale[3] ) {
myTransform->SetMatrixScale( theScale[0], theScale[1], theScale[2] );
myRWInteractor->Render();
Repaint();
}
+/*!Calculation trihedron size.*/
void VTKViewer_ViewWindow::onAdjustTrihedron(){
if( !isTrihedronDisplayed() )
return;
::ResetCameraClippingRange(myRenderer);
}
+/*!Emit key pressed.*/
void VTKViewer_ViewWindow::onKeyPressed(QKeyEvent* event)
{
emit keyPressed( this, event );
}
+/*!Emit key released.*/
void VTKViewer_ViewWindow::onKeyReleased(QKeyEvent* event)
{
emit keyReleased( this, event );
}
+/*!Emit key pressed.*/
void VTKViewer_ViewWindow::onMousePressed(QMouseEvent* event)
{
emit mousePressed(this, event);
}
+/*!Emit mouse released.*/
void VTKViewer_ViewWindow::onMouseReleased(QMouseEvent* event)
{
emit mouseReleased( this, event );
}
+/*!Emit mouse moving.*/
void VTKViewer_ViewWindow::onMouseMoving(QMouseEvent* event)
{
emit mouseMoving( this, event );
}
+/*!Emit mouse double clicked.*/
void VTKViewer_ViewWindow::onMouseDoubleClicked( QMouseEvent* event )
{
emit mouseDoubleClicked( this, event );
}
+/*!Insert actor to renderer and transformation filter.
+ *Move Internal actors, if \a theMoveInternalActors is true.
+ */
void VTKViewer_ViewWindow::InsertActor( VTKViewer_Actor* theActor, bool theMoveInternalActors ){
theActor->AddToRender(myRenderer);
theActor->SetTransform(myTransform);
myRWInteractor->MoveInternalActors();
}
+/*!Add actor.Repaint window if \a theUpdate is true.
+ *@see InsertActor( VTKViewer_Actor* theActor, bool theMoveInternalActors )
+ */
void VTKViewer_ViewWindow::AddActor( VTKViewer_Actor* theActor, bool theUpdate /*=false*/ ){
InsertActor(theActor);
if(theUpdate)
Repaint();
}
+/*!Remove \a theActor from renderer and pepaint, if \a theUpdate is true.*/
void VTKViewer_ViewWindow::RemoveActor( VTKViewer_Actor* theActor, bool theUpdate /*=false*/ ){
theActor->RemoveFromRender(myRenderer);
if(theUpdate)
Repaint();
}
+/*!@see RemoveActor() and InsertActor().*/
void VTKViewer_ViewWindow::MoveActor( VTKViewer_Actor* theActor)
{
RemoveActor(theActor);
InsertActor(theActor,true);
}
+/*!On trihedron show slot.*/
void VTKViewer_ViewWindow::onTrihedronShow()
{
if (isTrihedronDisplayed())
myRenderWindow->update();
}
+/*!Dump view.*/
QImage VTKViewer_ViewWindow::dumpView()
{
QPixmap px = QPixmap::grabWindow( myRenderWindow->winId() );