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 "BaseObject.hh"
00067 #include <vector>
00068 #include <ACG/Scenegraph/MaterialNode.hh>
00069 #include <ACG/Scenegraph/SeparatorNode.hh>
00070 #include <ACG/Scenegraph/ShaderNode.hh>
00071 #include <ACG/Scenegraph/BaseNode.hh>
00072 #include <ACG/Scenegraph/BoundingBoxNode.hh>
00073 #include <ACG/Scenegraph/StencilRefNode.hh>
00074 #include <ACG/QtScenegraph/QtTranslationManipulatorNode.hh>
00075
00076
00077
00078
00080 typedef ACG::SceneGraph::MaterialNode MaterialNode;
00082 typedef ACG::SceneGraph::QtTranslationManipulatorNode QtTranslationManipulatorNode;
00084 typedef ACG::SceneGraph::SeparatorNode SeparatorNode;
00086 typedef ACG::SceneGraph::BaseNode BaseNode;
00088 typedef ACG::SceneGraph::BoundingBoxNode BoundingBoxNode;
00090 typedef ACG::SceneGraph::StencilRefNode StencilRefNode;
00091
00092
00093
00097 class DLLEXPORT BaseObjectData : public BaseObject
00098 {
00099 public:
00100
00105 BaseObjectData(const BaseObjectData& _object);
00106
00108 BaseObjectData(SeparatorNode* _rootNode);
00109
00111 virtual ~BaseObjectData();
00112
00113 protected:
00115 virtual void init();
00116
00119
00122
00123
00124 public:
00128 virtual void cleanup();
00129
00132
00135
00136
00137 public:
00138
00145 void setFromFileName(QString _filename );
00146
00148 virtual void setName( QString _name );
00149
00151 QString path();
00152
00154 void path(QString _path);
00155
00156 private:
00157
00159 QString path_;
00160
00165
00168
00169
00170 public :
00172 void show();
00173
00175 void hide();
00176
00178 bool visible();
00179
00181 void visible(bool _visible);
00182
00186 SeparatorNode* baseNode();
00187
00191 QtTranslationManipulatorNode* manipulatorNode();
00192
00198 virtual ACG::SceneGraph::ShaderNode* shaderNode();
00199
00201 MaterialNode* materialNode();
00202
00204 BoundingBoxNode* boundingBoxNode();
00205
00207 StencilRefNode* stencilRefNode();
00208
00210 void setBaseColor(ACG::Vec4f _color);
00211
00213 bool manipPlaced();
00214
00216 void manipPlaced( bool _placed );
00217
00219 void getBoundingBox(ACG::Vec3d& bbmin, ACG::Vec3d& bbmax);
00220
00221 private :
00222
00223
00224 bool manipPlaced_;
00225
00227 SeparatorNode* rootNode_;
00228
00230 SeparatorNode* separatorNode_;
00231
00233 QtTranslationManipulatorNode* manipulatorNode_;
00234
00236 MaterialNode* materialNode_;
00237
00239 BoundingBoxNode * boundingBoxNode_;
00240
00242 StencilRefNode* stencilRefNode_;
00243
00247
00250
00251
00252 public :
00254 virtual bool picked( uint _node_idx );
00255
00260 virtual void enablePicking( bool _enable );
00261
00266 virtual bool pickingEnabled();
00267
00270
00273
00274
00275 public:
00282 virtual void update();
00283
00286
00289
00290 public:
00305 template< typename NodeT >
00306 bool addAdditionalNode(NodeT* _node , QString _pluginName, QString _nodeName , int _id = 0);
00307
00318 bool hasAdditionalNode(QString _pluginName, QString _nodeName , int _id = 0);
00319
00330 template< typename NodeT >
00331 bool getAdditionalNode(NodeT*& _node , QString _pluginName, QString _nodeName , int _id = 0 );
00332
00345 template< typename NodeT >
00346 bool removeAdditionalNode(NodeT*& _node, QString _pluginName, QString _nodeName , int _id = 0 );
00347 private:
00351 std::vector< std::pair <BaseNode*,QString> > additionalNodes_;
00352
00355 };
00356
00357
00358
00359
00360 #if defined(INCLUDE_TEMPLATES) && !defined(BASEOBJECTDATA_C)
00361 #define BASEOBJECT_TEMPLATES
00362 #include "BaseObjectDataT.cc"
00363 #endif
00364
00365
00366 #endif // BASEOBJECTDATA_HH defined
00367