42 #include "ComponentsPlugin.hh" 45 const char *SPLIT_COMPONENTS =
"SplitComponents";
46 const char *BIGGEST_COMPONENT =
"ComponentsPluginBiggestComponent";
55 biggestAction_(NULL){}
76 if ( ! OpenFlipper::Options::gui())
81 emit addPickMode( SPLIT_COMPONENTS );
82 emit addPickMode( BIGGEST_COMPONENT );
85 QToolBar* toolbar =
new QToolBar(
"Components Toolbar");
87 splitAction_ =
new QAction(tr(
"&Split into components"),
this);
89 splitAction_->setStatusTip(tr(
"Clicked objects are splitted into components"));
90 splitAction_->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"components_split_components.png") );
96 biggestAction_->setStatusTip(tr(
"Get the biggest component of the clicked object and delete the other components."));
97 biggestAction_->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"components_biggest_component.png") );
101 emit addToolbar( toolbar );
155 if (_event->type() == QEvent::MouseButtonPress )
157 size_t node_idx, target_idx;
182 if (_event->type() == QEvent::MouseButtonPress )
184 size_t node_idx, target_idx;
198 emit log(
LOGERR,tr(
"Unable to pick Object."));
204 emit createBackup(obj->
id(),
"GetBiggestComponents",
UPDATE_ALL);
bool scenegraphPick(ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, size_t &_nodeIdx, size_t &_targetIdx, ACG::Vec3d *_hitPointPtr=0)
Execute picking operation on scenegraph.
ComponentsPlugin()
Constructor.
void initializePlugin()
Initialize the plugin.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
picks faces (should be implemented for all nodes)
void biggestComponent(QMouseEvent *_event)
Split into Components Button was hit.
void splitComponents(QMouseEvent *_event)
Split Components of picked object.
void setDescriptions()
set scripting slot descriptions
QAction * biggestAction_
Split into Components Button was hit.
Viewer::ActionMode actionMode()
Get the current Action mode.
QAction * splitAction_
Split into Components Button was hit.
void slotMouseEvent(QMouseEvent *_event)
a mouse event occured
void slotPickModeChanged(const std::string &_mode)
the pickMode changed
void slotSplitComponentsButton()
Split into Components Button was hit.
const std::string pickMode()
Get the current Picking mode.
void pluginsInitialized()
Second initialization phase.
void slotBiggestComponentButton()
Split into Components Button was hit.
bool getPickedObject(const size_t _node_idx, BaseObjectData *&_object)
Get the picked mesh.