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
DLLEXPORT OpenFlipperQSettings & OpenFlipperSettings()
QSettings object containing all program settings of OpenFlipper.
void slotRenderControlNet()
Slot triggered from context menu, if the control net should be rendered.
QAction * renderControlNetAction_
Context menu action.
DLLEXPORT void setTypeIcon(DataType _id, QString _icon)
Set an Icon for a given DataType.
int targetCount()
Get the number of target objects.
void slotUpdateContextMenu(int _objectId)
QString name()
Return a name for the plugin.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
bool getObject(int _identifier, BSplineCurveObject *&_object)
virtual void updatedObject(int _objectId)
An object has been changed or added by this plugin.
DLLEXPORT DataType addDataType(QString _name, QString _readableName)
Adds a datatype and returns the id for the new type.
DataType supportedType()
Return your supported object type( e.g. DATA_TRIANGLE_MESH )
void slotRenderSelection(QAction *_action)
Slot triggered from context menu, if the selection rendering should be altered.
void slotRenderSurface()
Slot triggered from context menu, if the surface should be rendered.
int addEmpty()
Create an empty object.
ACG::SceneGraph::BSplineSurfaceNodeT< BSplineSurface > * splineSurfaceNode()
Return pointer to the bspline surface node.
QAction * renderSurfaceAction_
Context menu action.
#define DATA_BSPLINE_SURFACE
void pluginsInitialized()
Second initialization phase.
The Menu will be shown when an object was picked.
int objectCount()
Get the number of available objects.
QString getObjectinfo()
Get all Info for the Object as a string.
QAction * renderCPSelectionAction_
Context menu action (render selection texture)