51 #include "TypeCamera.hh" 56 TypeCameraPlugin::TypeCameraPlugin() :
64 if ( OpenFlipper::Options::gui() ){
65 contextMenu_ =
new QMenu(tr(
"Rendering"));
69 lastAction = contextMenu_->addAction( tr(
"Show viewing frustum") );
70 lastAction->setCheckable(
true);
71 lastAction->setChecked(
false);
72 lastAction->setToolTip(tr(
"Visualize cameras viewing frustum."));
73 lastAction->setStatusTip( lastAction->toolTip() );
78 connect(contextMenu_, SIGNAL(triggered(QAction*)),
this ,SLOT(contextMenuClicked(QAction*)));
82 void TypeCameraPlugin::slotUpdateContextMenuObject(
int _objectId) {
86 void TypeCameraPlugin::contextMenuClicked(QAction* _contextAction) {
88 QVariant contextObject = _contextAction->data();
89 int objectId = contextObject.toInt();
98 if (_contextAction->text() == tr(
"Show viewing frustum")) {
107 bool TypeCameraPlugin::registerType() {
120 object->target(
true);
125 object->target(
true);
129 object->target(
true);
132 QString
name = QString(tr(
"New Camera %1.cam").arg( object->
id() ));
135 object->setName ( name );
143 emit emptyObjectAdded ( object->
id() );
148 #if QT_VERSION < 0x050000
int addEmpty()
Create an empty object.
void showFrustum(bool _showFrustum)
Set if viewing frustum should be shown or not.
bool getObject(int _identifier, BSplineCurveObject *&_object)
The Menu will be shown when an object was picked.
DLLEXPORT OpenFlipperQSettings & OpenFlipperSettings()
QSettings object containing all program settings of OpenFlipper.
DLLEXPORT DataType addDataType(QString _name, QString _readableName)
Adds a datatype and returns the id for the new type.
int objectCount()
Get the number of available objects.
QString name()
Return a name for the plugin.
DLLEXPORT void setTypeIcon(DataType _id, QString _icon)
Set an Icon for a given DataType.
int targetCount()
Get the number of target objects.
CameraNode * cameraNode()
Get the scenegraph Node.
void pluginsInitialized()
Initialize Plugin step 2.
QString getObjectinfo()
Get all Info for the Object as a string.