50 #include "ComponentsPlugin.hh" 52 #if QT_VERSION >= 0x050000 57 const char *SPLIT_COMPONENTS =
"SplitComponents";
58 const char *BIGGEST_COMPONENT =
"ComponentsPluginBiggestComponent";
67 biggestAction_(NULL){}
88 if ( ! OpenFlipper::Options::gui())
93 emit addPickMode( SPLIT_COMPONENTS );
94 emit addPickMode( BIGGEST_COMPONENT );
97 QToolBar* toolbar =
new QToolBar(
"Components Toolbar");
99 splitAction_ =
new QAction(tr(
"&Split into components"),
this);
101 splitAction_->setStatusTip(tr(
"Clicked objects are splitted into components"));
102 splitAction_->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"components_split_components.png") );
108 biggestAction_->setStatusTip(tr(
"Get the biggest component of the clicked object and delete the other components."));
109 biggestAction_->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"components_biggest_component.png") );
113 emit addToolbar( toolbar );
167 if (_event->type() == QEvent::MouseButtonPress )
169 unsigned int node_idx, target_idx;
194 if (_event->type() == QEvent::MouseButtonPress )
196 unsigned int node_idx, target_idx;
210 emit log(
LOGERR,tr(
"Unable to pick Object."));
216 emit createBackup(obj->
id(),
"GetBiggestComponents",
UPDATE_ALL);
222 #if QT_VERSION < 0x050000 bool scenegraphPick(ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, unsigned int &_nodeIdx, unsigned int &_targetIdx, ACG::Vec3d *_hitPointPtr=0)
Execute picking operation on scenegraph.
void slotBiggestComponentButton()
Split into Components Button was hit.
void biggestComponent(QMouseEvent *_event)
Split into Components Button was hit.
void slotMouseEvent(QMouseEvent *_event)
a mouse event occured
void slotPickModeChanged(const std::string &_mode)
the pickMode changed
QAction * splitAction_
Split into Components Button was hit.
QAction * biggestAction_
Split into Components Button was hit.
bool getPickedObject(const unsigned int _node_idx, BaseObjectData *&_object)
Get the picked mesh.
void slotSplitComponentsButton()
Split into Components Button was hit.
const std::string pickMode()
Get the current Picking mode.
void pluginsInitialized()
Second initialization phase.
void setDescriptions()
set scripting slot descriptions
void initializePlugin()
Initialize the plugin.
Viewer::ActionMode actionMode()
Get the current Action mode.
ComponentsPlugin()
Constructor.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
picks faces (should be implemented for all nodes)
void splitComponents(QMouseEvent *_event)
Split Components of picked object.