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 #ifndef _CIvfObject_h_
00026 #define _CIvfObject_h_
00027
00028 #include <ivf/IvfBase.h>
00029 #include <ivfmath/IvfBoundingSphere.h>
00030 #include <ivf/IvfRenderState.h>
00031
00032 #include <ivf/IvfGL.h>
00033
00034 IvfSmartPointer(CIvfObject);
00035
00036 static double g_nodeSize = 0.2;
00037
00046 class IVF_API CIvfObject : public CIvfBase {
00047 public:
00048 enum TObjectState {
00049 OS_ON,
00050 OS_OFF
00051 };
00052
00053 enum TSelectState {
00054 SS_ON,
00055 SS_OFF
00056 };
00057 private:
00058 std::string m_objectName;
00059 long m_tag;
00060 TSelectState m_selectState;
00061 TObjectState m_state;
00062 CIvfBoundingSpherePtr m_boundSphere;
00063 GLuint m_displayList;
00064 bool m_useList;
00065 bool m_dynamic;
00066 bool m_useSelectShape;
00067 bool m_culled;
00068 bool m_renderMaterial;
00069 CIvfRenderStatePtr m_renderState;
00070
00071 public:
00072 bool getRenderMaterial();
00073 void setRenderMaterial(bool flag);
00074 bool isSelectEnabled();
00075 void disableSelect();
00076 void enableSelect();
00077 bool isEnabled();
00078 void disable();
00079 void enable();
00081 CIvfObject ();
00082
00084 CIvfObject (const CIvfObject&);
00085
00087 virtual ~CIvfObject ();
00088 CIvfObject& operator = (const CIvfObject &arg);
00089
00090 IvfClassInfo("CIvfObject",CIvfBase);
00091
00098 void setTag(long tag);
00099
00101 long getTag();
00102
00115 void setSelect(TSelectState selectState);
00116
00118 TSelectState getSelect();
00119
00129 void setState(TObjectState state);
00130
00132 TObjectState getState();
00133
00134 bool getUseSelectShape();
00135 void setUseSelectShape(bool flag);
00136
00142 CIvfBoundingSphere* getBoundingSphere();
00143
00149 void setDisplayList(GLuint nList);
00150
00156 GLuint getDisplayList();
00157
00164 void setUselist(bool flag);
00165
00167 bool getUselist();
00168
00185 virtual void render ();
00186
00194 void initBoundingSphere();
00195
00205 virtual void updateBoundingSphere();
00206
00213 void setCulled(bool flag);
00214
00216 bool getCulled();
00217
00219 const char* getName();
00220
00222 void setName(const char* name);
00223
00233 void setRenderState(CIvfRenderState* state);
00234
00236 CIvfRenderState* getRenderState();
00237
00238 protected:
00239 virtual void preGeometry();
00240 virtual void postGeometry();
00241
00247 virtual void compileList();
00248
00255 virtual void createSelect();
00256
00265 virtual void createGeometry ();
00266
00275 virtual void createMaterial ();
00276
00285 virtual void beginTransform ();
00286
00294 virtual void endTransform ();
00295
00296 };
00297 #endif