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: 8728 $                                                         *
00038  *   $Author: wilden $                                                      *
00039  *   $Date: 2010-03-16 14:18:16 +0100 (Di, 16. Mär 2010) $                   *
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 <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 //== TYPEDEFS =================================================================
00078 
00079 //== TYPEDEFS FOR SCENEGRAPH ===============================================
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 //== CLASS DEFINITION =========================================================
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 //=============================================================================

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