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();
93 renderControlNetAction_ =
new QAction(tr(
"Render Control Net"),
this);
94 renderControlNetAction_->setStatusTip(tr(
"Render Control Net"));
96 renderControlNetAction_->setCheckable(
true);
97 renderControlNetAction_->setChecked(
false);
100 renderSurfaceAction_ =
new QAction(tr(
"Render Surface"),
this);
101 renderSurfaceAction_->setStatusTip(tr(
"Render Surface"));
103 renderSurfaceAction_->setCheckable(
true);
104 renderSurfaceAction_->setChecked(
true);
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);
131 connect(renderControlNetAction_, SIGNAL(triggered()),
this, SLOT(slotRenderControlNet()) );
132 connect(renderSurfaceAction_, SIGNAL(triggered()),
this, SLOT(slotRenderSurface()) );
136 contextMenu->addAction(renderControlNetAction_);
137 contextMenu->addAction(renderSurfaceAction_);
138 contextMenu->addSeparator();
140 contextMenu->addAction(renderKnotSelectionAction_);
141 contextMenu->addAction(renderNoSelectionAction_);
152 if ( _objectId == -1)
161 if(bsplineSurfaceObject != 0){
162 renderControlNetAction_->setChecked( bsplineSurfaceObject->
splineSurfaceNode()->render_control_net() );
163 renderSurfaceAction_->setChecked( bsplineSurfaceObject->
splineSurfaceNode()->render_bspline_surface() );
174 QVariant contextObject = renderControlNetAction_->data();
175 int objectId = contextObject.toInt();
186 if(bsplineSurfaceObject != 0){
187 bsplineSurfaceObject->
splineSurfaceNode()->render_control_net(renderControlNetAction_->isChecked());
196 QVariant contextObject = renderSurfaceAction_->data();
197 int objectId = contextObject.toInt();
208 if(bsplineSurfaceObject != 0){
209 bsplineSurfaceObject->
splineSurfaceNode()->render_bspline_surface(renderSurfaceAction_->isChecked());
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 int addEmpty()
Create an empty object.
void slotRenderSelection(QAction *_action)
Slot triggered from context menu, if the selection rendering should be altered.
virtual void updatedObject(int _objectId)
An object has been changed or added by this plugin.
void slotRenderControlNet()
Slot triggered from context menu, if the control net should be rendered.
QAction * renderCPSelectionAction_
Context menu action (render selection texture)
QString name()
Return a name for the plugin.
bool getObject(int _identifier, BSplineCurveObject *&_object)
void pluginsInitialized()
Second initialization phase.
The Menu will be shown when an object was picked.
void slotRenderSelection(QAction *_action)
Slot triggered from context menu, if the selection rendering should be altered.
DLLEXPORT OpenFlipperQSettings & OpenFlipperSettings()
QSettings object containing all program settings of OpenFlipper.
void slotRenderSurface()
Slot triggered from context menu, if the surface should be rendered.
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 )
int objectCount()
Get the number of available objects.
void slotUpdateContextMenu(int _objectId)
DLLEXPORT void setTypeIcon(DataType _id, QString _icon)
Set an Icon for a given DataType.
int targetCount()
Get the number of target objects.
ACG::SceneGraph::BSplineSurfaceNodeT< BSplineSurface > * splineSurfaceNode()
Return pointer to the bspline surface node.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
#define DATA_BSPLINE_SURFACE
QString getObjectinfo()
Get all Info for the Object as a string.