61 #include "TypeBSplineSurface.hh"
68 TypeBSplineSurfacePlugin::
69 TypeBSplineSurfacePlugin() :
70 renderControlNetAction_(0),
71 renderSurfaceAction_(0),
72 renderCPSelectionAction_(0),
73 renderKnotSelectionAction_(0),
74 renderNoSelectionAction_(0)
86 if ( OpenFlipper::Options::gui() ){
88 QMenu* contextMenu =
new QMenu(
"Rendering");
90 QString iconPath = OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator();
106 QActionGroup* group =
new QActionGroup(
this);
107 group->setExclusive(
true);
117 renderKnotSelectionAction_ =
new QAction(tr(
"Render Knot Selection"), group);
118 renderKnotSelectionAction_->setStatusTip(tr(
"Render Knot Selection"));
120 renderKnotSelectionAction_->setCheckable(
true);
121 renderKnotSelectionAction_->setChecked(
true);
124 renderNoSelectionAction_ =
new QAction(tr(
"Don't Render Selection"), group);
125 renderNoSelectionAction_->setStatusTip(tr(
"Don't Render Selection"));
127 renderNoSelectionAction_->setCheckable(
true);
128 renderNoSelectionAction_->setChecked(
true);
138 contextMenu->addSeparator();
140 contextMenu->addAction(renderKnotSelectionAction_);
141 contextMenu->addAction(renderNoSelectionAction_);
152 if ( _objectId == -1)
161 if(bsplineSurfaceObject != 0){
175 int objectId = contextObject.toInt();
186 if(bsplineSurfaceObject != 0){
197 int objectId = contextObject.toInt();
208 if(bsplineSurfaceObject != 0){
218 QVariant contextObject = _action->data();
219 int objectId = contextObject.toInt();
230 if(bsplineSurfaceObject != 0){
234 }
else if(_action == renderKnotSelectionAction_) {
237 }
else if(_action == renderNoSelectionAction_) {
248 TypeBSplineSurfacePlugin::
251 addDataType(
"BSplineSurface",tr(
"B-Spline Surface"));
252 setTypeIcon(
"BSplineSurface",
"BSplineSurfaceType.png");
276 object->target(
true);
281 object->target(
true);
285 object->target(
true);
288 QString
name =
"BSplineSurface_" + QString::number( object->
id() ) +
".bss";
292 object->setName( f.fileName() );
295 const QColor color = OpenFlipper::Options::defaultColor();
296 const ACG::Vec4f default_color(color.redF(), color.greenF(), color.blueF(), color.alphaF());
297 object->materialNode()->set_color(default_color);
305 emit emptyObjectAdded (object->
id() );
312 #if QT_VERSION < 0x050000
void pluginsInitialized()
Second initialization phase.
QString getObjectinfo()
Get all Info for the Object as a string.
void slotRenderControlNet()
Slot triggered from context menu, if the control net should be rendered.
QAction * renderSurfaceAction_
Context menu action.
bool getObject(int _identifier, BSplineCurveObject *&_object)
void slotUpdateContextMenu(int _objectId)
DataType supportedType()
Return your supported object type( e.g. DATA_TRIANGLE_MESH )
DLLEXPORT OpenFlipperQSettings & OpenFlipperSettings()
QSettings object containing all program settings of OpenFlipper.
QString name()
Return a name for the plugin.
#define DATA_BSPLINE_SURFACE
DLLEXPORT void setTypeIcon(DataType _id, QString _icon)
Set an Icon for a given DataType.
void slotRenderSurface()
Slot triggered from context menu, if the surface should be rendered.
QAction * renderCPSelectionAction_
Context menu action (render selection texture)
virtual void updatedObject(int _objectId)
An object has been changed or added by this plugin.
QAction * renderControlNetAction_
Context menu action.
The Menu will be shown when an object was picked.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
int objectCount()
Get the number of available objects.
int addEmpty()
Create an empty object.
DLLEXPORT DataType addDataType(QString _name, QString _readableName)
Adds a datatype and returns the id for the new type.
void slotRenderSelection(QAction *_action)
Slot triggered from context menu, if the selection rendering should be altered.
int targetCount()
Get the number of target objects.
ACG::SceneGraph::BSplineSurfaceNodeT< BSplineSurface > * splineSurfaceNode()
Return pointer to the bspline surface node.