IvfSelectComposite.h

00001 //
00002 // Copyright 1999-2006 by Structural Mechanics, Lund University.
00003 //
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Library General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2 of the License, or (at your option) any later version.
00008 //
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Library General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Library General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00017 // USA.
00018 //
00019 // Please report all bugs and problems to "ivf@byggmek.lth.se".
00020 //
00021 //
00022 // Written by Jonas Lindemann
00023 //
00024 
00025 #ifndef _CIvfSelectComposite_h_
00026 #define _CIvfSelectComposite_h_
00027 
00029 #include <ivf/ivfconfig.h>
00030 
00031 namespace std {};
00032 using namespace std;
00033 
00034 #include <ivf/IvfComposite.h>
00035 #include <ivf/IvfCoordinateSystem.h>
00036 #include <ivf/IvfView.h>
00037 #include <ivf/IvfShape.h>
00038 #include <ivf/IvfCursor.h>
00039 
00040 #include <ivfmath/IvfPoint3d.h>
00041 
00042 IvfSmartPointer(CIvfSelectComposite);
00043 
00050 class IVF_API CIvfSelectComposite : public CIvfComposite {
00051 public:
00053         CIvfSelectComposite ();
00054 
00056         virtual ~CIvfSelectComposite ();
00057 
00058         IvfClassInfo("CIvfSelectComposite",CIvfComposite);
00059 
00069         void setCamera(CIvfView* camera);
00070 
00072         CIvfView* getCamera();
00073 
00075         CIvfShape* getSelectedShape();
00076 
00077         void setRenderCamera(bool flag);
00078         void setUseCustomTransform(bool flag);
00079 
00090         GLint pick(int x, int y);
00091 
00093         void addChild(CIvfShape* shape);
00094 
00096         CIvfShape* removeChild(int index);
00097 
00099         CIvfShape* removeShape(CIvfShape *removeShape);
00100 
00102         void deleteChild(int index);
00103 
00104         void renameChildren();
00105 private:
00106         CIvfShape* m_selectedShape;
00107         int m_childCount;
00108         GLuint m_selectBuf[512];
00109         CIvfView* m_camera;
00110         vector<CIvfShape*> m_allObjects;
00111         bool m_useCustomTransform;
00112         bool m_renderCamera;
00113 
00114         void compositeRemove(CIvfComposite* composite, CIvfShape* deleteChild);
00115         void nameChildren(CIvfShape* shape);
00116 protected:
00117         void processHits(GLint hits, GLuint buffer[]);
00118         virtual void endTransform();
00119         virtual void beginTransform();
00120         virtual void createGeometry();
00121         virtual void initializeSelect(int x, int y, int w, int h);
00122         virtual void customView();
00123 };
00124 #endif
00125 

Generated on Fri Sep 1 15:36:46 2006 for Interactive Visualisation Framework - Ivf++ by  doxygen 1.4.6-NO