00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __IFD_IPRObject__
00019 #define __IFD_IPRObject__
00020
00021 #include "IFD_API.h"
00022 #include <UT/UT_SmallObject.h>
00023
00024 class UT_IStream;
00025 class ROP_IPRObject;
00026 class IFD_IPRTree;
00027
00028 enum {
00029 IFD_IPR_LIGHT,
00030 IFD_IPR_INSTANCE,
00031 IFD_IPR_FOG,
00032 IFD_IPR_DETAIL,
00033 IFD_IPR_MAX_STYLES
00034 };
00035
00036 class IFD_API IFD_IPRObject
00037 : public UT_SmallObject<IFD_IPRObject,
00038 UT_SMALLOBJECT_CLEANPAGES_ON,
00039 1024,
00040 UT_SMALLOBJECT_THREADSAFE_ON>
00041 {
00042 public:
00043 IFD_IPRObject(IFD_IPRTree *tree);
00044 virtual ~IFD_IPRObject();
00045
00046 virtual ROP_IPRObject *castToROP();
00047 virtual const ROP_IPRObject *castToROP() const;
00048
00049
00050
00051
00052
00053
00054
00055
00056 bool isInScene() const { return myInScene; }
00057 void setInScene(bool onoff) { myInScene = onoff; }
00058
00059 void setTreeIndex(int idx) { myTreeIndex = idx; }
00060 int getTreeIndex() const { return myTreeIndex; }
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072 virtual bool isDirty(const char *attribute) = 0;
00073
00074
00075
00076 virtual int getUniqueId() const = 0;
00077 virtual int getGeometryObject(int) const { return getUniqueId(); }
00078 virtual int getInstancePoint(int) const { return -1; }
00079 virtual int getSurfaceId(int, int) const { return -1; }
00080 virtual int getDisplaceId(int, int) const { return -1; }
00081
00082
00083 virtual void dump();
00084
00085 virtual int save(ostream &os) { return 1; }
00086 virtual bool load(UT_IStream &is, float now) { return true; }
00087 virtual int afterLoad(float now) { return 1; }
00088
00089
00090 protected:
00091
00092
00093
00094 void setTreeDirty();
00095
00096 IFD_IPRTree *myTree;
00097 int myTreeIndex;
00098 bool myInScene;
00099 };
00100
00101 class IFD_API IFD_IPRObjectFactory
00102 {
00103 public:
00104 IFD_IPRObjectFactory() {}
00105 virtual ~IFD_IPRObjectFactory() {}
00106
00107 virtual IFD_IPRObject *create() = 0;
00108 };
00109
00110 #endif