00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef FXGLOBJECT_H
00025 #define FXGLOBJECT_H
00026
00027 #ifndef FXOBJECT_H
00028 #include "FXObject.h"
00029 #endif
00030
00031 namespace FX {
00032
00033
00034 class FXGLViewer;
00035 class FXGLObject;
00036
00037
00038
00039 typedef FXObjectListOf<FXGLObject> FXGLObjectList;
00040
00041
00042 class FXAPI FXGLObject : public FXObject {
00043 FXDECLARE(FXGLObject)
00044 public:
00045 enum {
00046 ID_LAST=10000
00047 };
00048 public:
00049
00050
00051 FXGLObject(){}
00052
00053
00054 FXGLObject(const FXGLObject& orig):FXObject(orig){}
00055
00056
00057 virtual void bounds(FXRangef& box);
00058
00059
00060 virtual void draw(FXGLViewer* viewer);
00061
00062
00063 virtual void hit(FXGLViewer* viewer);
00064
00065
00066 virtual FXGLObject* copy();
00067
00068
00069 virtual FXGLObject* identify(FXuint* path);
00070
00071
00072 virtual FXbool canDrag() const;
00073
00074
00075 virtual FXbool canDelete() const;
00076
00077
00078 virtual FXbool drag(FXGLViewer* viewer,FXint fx,FXint fy,FXint tx,FXint ty);
00079
00080
00081 virtual ~FXGLObject(){}
00082 };
00083
00084
00085
00086 #ifdef _MSC_VER
00087 #if _MSC_VER >= 1200
00088 #pragma warning( push )
00089 #endif
00090 #pragma warning( disable : 4251 )
00091 #endif
00092
00093
00094
00095 class FXAPI FXGLGroup : public FXGLObject {
00096 FXDECLARE(FXGLGroup)
00097 protected:
00098 FXGLObjectList list;
00099 public:
00100
00101
00102 FXGLGroup(){ }
00103
00104
00105 FXGLGroup(const FXGLGroup& orig):FXGLObject(orig),list(orig.list){ }
00106
00107
00108 FXGLObjectList& getList(){ return list; }
00109
00110
00111 virtual void bounds(FXRangef& box);
00112
00113
00114 virtual void draw(FXGLViewer* viewer);
00115
00116
00117 virtual void hit(FXGLViewer* viewer);
00118
00119
00120 virtual FXGLObject* copy();
00121
00122
00123 virtual FXGLObject* identify(FXuint* path);
00124
00125
00126 virtual FXbool canDrag() const;
00127
00128
00129 virtual FXbool drag(FXGLViewer* viewer,FXint fx,FXint fy,FXint tx,FXint ty);
00130
00131
00132 FXint no() const { return list.no(); }
00133
00134
00135 FXGLObject* child(FXint pos) const { return list[pos]; }
00136
00137
00138 void insert(FXint pos,FXGLObject* obj){ list.insert(pos,obj); }
00139
00140
00141 void prepend(FXGLObject* obj){ list.prepend(obj); }
00142
00143
00144 void append(FXGLObject* obj){ list.append(obj); }
00145
00146
00147 void replace(FXint pos,FXGLObject* obj){ list.replace(pos,obj); }
00148
00149
00150 void remove(FXGLObject* obj){ list.remove(obj); }
00151
00152
00153 void erase(FXint pos){ list.erase(pos); }
00154
00155
00156 void clear(){ list.clear(); }
00157
00158
00159 virtual void save(FXStream& store) const;
00160 virtual void load(FXStream& store);
00161
00162
00163 virtual ~FXGLGroup();
00164 };
00165
00166
00167
00168 #ifdef _MSC_VER
00169 #if _MSC_VER >= 1200
00170 #pragma warning( pop )
00171 #endif
00172 #endif
00173
00174
00175
00176 class FXAPI FXGLPoint : public FXGLObject {
00177 FXDECLARE(FXGLPoint)
00178 public:
00179 FXVec3f pos;
00180 public:
00181
00182
00183 FXGLPoint();
00184
00185
00186 FXGLPoint(const FXGLPoint& orig);
00187
00188
00189 FXGLPoint(FXfloat x,FXfloat y,FXfloat z);
00190
00191
00192 virtual FXGLObject* copy();
00193
00194
00195 virtual void bounds(FXRangef& box);
00196
00197
00198 virtual void draw(FXGLViewer* viewer);
00199
00200
00201 virtual void hit(FXGLViewer* viewer);
00202
00203
00204 virtual void save(FXStream& store) const;
00205
00206
00207 virtual void load(FXStream& store);
00208 };
00209
00210
00211
00212 class FXAPI FXGLLine : public FXGLObject {
00213 FXDECLARE(FXGLLine)
00214 public:
00215 FXGLPoint fm,to;
00216 public:
00217
00218
00219 FXGLLine();
00220
00221
00222 FXGLLine(const FXGLLine& orig);
00223
00224
00225 FXGLLine(FXfloat fx,FXfloat fy,FXfloat fz,FXfloat tx,FXfloat ty,FXfloat tz);
00226
00227
00228 virtual void bounds(FXRangef& box);
00229
00230
00231 virtual void draw(FXGLViewer* viewer);
00232
00233
00234 virtual FXGLObject* copy();
00235
00236
00237 virtual void hit(FXGLViewer* viewer);
00238
00239
00240 virtual void save(FXStream& store) const;
00241
00242
00243 virtual void load(FXStream& store);
00244 };
00245
00246 }
00247
00248 #endif
00249