BaseObjectData.hh
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00059 #ifndef BASEOBJECTDATA_HH
00060 #define BASEOBJECTDATA_HH
00061
00062
00063
00064
00065 #include <OpenFlipper/common/GlobalDefines.hh>
00066 #include <OpenFlipper/common/BaseObject.hh>
00067 #include <QObject>
00068 #include <vector>
00069 #include <ACG/Scenegraph/MaterialNode.hh>
00070 #include <ACG/Scenegraph/SeparatorNode.hh>
00071 #include <ACG/Scenegraph/ShaderNode.hh>
00072 #include <ACG/Scenegraph/BaseNode.hh>
00073 #include <ACG/Scenegraph/BoundingBoxNode.hh>
00074 #include <ACG/Scenegraph/StencilRefNode.hh>
00075 #include <ACG/QtScenegraph/QtTranslationManipulatorNode.hh>
00076
00077
00078
00079
00081 typedef ACG::SceneGraph::MaterialNode MaterialNode;
00083 typedef ACG::SceneGraph::QtTranslationManipulatorNode QtTranslationManipulatorNode;
00085 typedef ACG::SceneGraph::SeparatorNode SeparatorNode;
00087 typedef ACG::SceneGraph::BaseNode BaseNode;
00089 typedef ACG::SceneGraph::BoundingBoxNode BoundingBoxNode;
00091 typedef ACG::SceneGraph::StencilRefNode StencilRefNode;
00092
00093
00094
00098 class DLLEXPORT BaseObjectData : public BaseObject
00099 {
00100 Q_OBJECT
00101
00102 public:
00103
00108 BaseObjectData(const BaseObjectData& _object);
00109
00111 BaseObjectData();
00112
00114 virtual ~BaseObjectData();
00115
00116 protected:
00118 virtual void init();
00119
00122
00125
00126
00127 public:
00131 virtual void cleanup();
00132
00135
00138
00139
00140 public:
00141
00148 void setFromFileName(QString _filename );
00149
00151 virtual void setName( QString _name );
00152
00154 QString path();
00155
00157 void setPath(QString _path);
00158
00159 private:
00160
00162 QString path_;
00163
00168
00171
00172
00173 public :
00175 void show();
00176
00178 void hide();
00179
00181 virtual bool visible();
00182
00184 virtual void visible(bool _visible);
00185
00189 SeparatorNode* baseNode();
00190
00193 virtual BaseNode* primaryNode();
00194
00198 QtTranslationManipulatorNode* manipulatorNode();
00199
00205 virtual ACG::SceneGraph::ShaderNode* shaderNode();
00206
00208 MaterialNode* materialNode();
00209
00211 BoundingBoxNode* boundingBoxNode();
00212
00214 StencilRefNode* stencilRefNode();
00215
00217 void setBaseColor(ACG::Vec4f _color);
00218
00220 bool manipPlaced();
00221
00223 void manipPlaced( bool _placed );
00224
00226 void getBoundingBox(ACG::Vec3d& bbmin, ACG::Vec3d& bbmax);
00227
00228 private :
00229
00230
00231 bool manipPlaced_;
00232
00234 SeparatorNode* rootNode_;
00235
00237 SeparatorNode* separatorNode_;
00238
00240 QtTranslationManipulatorNode* manipulatorNode_;
00241
00243 MaterialNode* materialNode_;
00244
00246 BoundingBoxNode * boundingBoxNode_;
00247
00249 StencilRefNode* stencilRefNode_;
00250
00254
00257
00258
00259 public :
00261 virtual bool picked( uint _node_idx );
00262
00267 virtual void enablePicking( bool _enable );
00268
00273 virtual bool pickingEnabled();
00274
00277
00280
00281
00282 public:
00289 virtual void update();
00290
00293
00296
00297 public:
00312 template< typename NodeT >
00313 bool addAdditionalNode(NodeT* _node , QString _pluginName, QString _nodeName , int _id = 0);
00314
00325 bool hasAdditionalNode(QString _pluginName, QString _nodeName , int _id = 0);
00326
00337 template< typename NodeT >
00338 bool getAdditionalNode(NodeT*& _node , QString _pluginName, QString _nodeName , int _id = 0 );
00339
00352 template< typename NodeT >
00353 bool removeAdditionalNode(NodeT*& _node, QString _pluginName, QString _nodeName , int _id = 0 );
00354 private:
00358 std::vector< std::pair <BaseNode*,QString> > additionalNodes_;
00359
00362 };
00363
00364
00365
00366
00367 #if defined(INCLUDE_TEMPLATES) && !defined(BASEOBJECTDATA_C)
00368 #define BASEOBJECT_TEMPLATES
00369 #include "BaseObjectDataT.cc"
00370 #endif
00371
00372
00373 #endif // BASEOBJECTDATA_HH defined
00374