BaseObjectData.hh

Go to the documentation of this file.
00001 /*===========================================================================*\
00002  *                                                                           *
00003  *                              OpenFlipper                                  *
00004  *      Copyright (C) 2001-2009 by Computer Graphics Group, RWTH Aachen      *
00005  *                           www.openflipper.org                             *
00006  *                                                                           *
00007  *---------------------------------------------------------------------------*
00008  *  This file is part of OpenFlipper.                                        *
00009  *                                                                           *
00010  *  OpenFlipper is free software: you can redistribute it and/or modify      *
00011  *  it under the terms of the GNU Lesser General Public License as           *
00012  *  published by the Free Software Foundation, either version 3 of           *
00013  *  the License, or (at your option) any later version with the              *
00014  *  following exceptions:                                                    *
00015  *                                                                           *
00016  *  If other files instantiate templates or use macros                       *
00017  *  or inline functions from this file, or you compile this file and         *
00018  *  link it with other files to produce an executable, this file does        *
00019  *  not by itself cause the resulting executable to be covered by the        *
00020  *  GNU Lesser General Public License. This exception does not however       *
00021  *  invalidate any other reasons why the executable file might be            *
00022  *  covered by the GNU Lesser General Public License.                        *
00023  *                                                                           *
00024  *  OpenFlipper is distributed in the hope that it will be useful,           *
00025  *  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
00026  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            *
00027  *  GNU Lesser General Public License for more details.                      *
00028  *                                                                           *
00029  *  You should have received a copy of the GNU LesserGeneral Public          *
00030  *  License along with OpenFlipper. If not,                                  *
00031  *  see <http://www.gnu.org/licenses/>.                                      *
00032  *                                                                           *
00033 \*===========================================================================*/
00034 
00035 /*===========================================================================*\
00036  *                                                                           *
00037  *   $Revision: 7338 $                                                         *
00038  *   $Author: moebius $                                                      *
00039  *   $Date: 2009-10-07 17:04:05 +0200 (Mi, 07. Okt 2009) $                   *
00040  *                                                                           *
00041 \*===========================================================================*/
00042 
00043 
00044 
00045 
00046 //=============================================================================
00047 //
00048 //  Types
00049 //
00050 //=============================================================================
00051 
00059 #ifndef BASEOBJECTDATA_HH
00060 #define BASEOBJECTDATA_HH
00061 
00062 
00063 //== INCLUDES =================================================================
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 //== TYPEDEFS =================================================================
00077 
00078 //== TYPEDEFS FOR SCENEGRAPH ===============================================
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 //== CLASS DEFINITION =========================================================
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 //=============================================================================

acg pic Project OpenFlipper, ©  Computer Graphics Group, RWTH Aachen. Documentation generated using doxygen .