00001 #ifndef GraphicsProfileH
00002 #define GraphicsProfileH
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00038
00039
00040 #include "CoreMainHeader.h"
00041 #include "ExtObject.h"
00042 #include "Manipulator.h"
00043 #include <GL/GL.h>
00044 #include <GL/GLU.h>
00045
00046
00047
00048 class CGraphicsObjectsList;
00049 class CGraphicsObject;
00050 class CXMLElement;
00051 class CGraphicsProfile;
00052 class CAdvancedProject;
00053
00054
00055
00056
00057
00059
00062 class NEMESIS_CORE_PACKAGE CGraphicsProfileData{
00063 public:
00064
00065 __fastcall CGraphicsProfileData(void);
00066 __fastcall ~CGraphicsProfileData(void);
00067
00068
00069 void __fastcall GetFromProfile(CGraphicsProfile* p_profile);
00070 CGraphicsProfile* __fastcall MakeProfile(CAdvancedProject* p_project,CElementsRecord* history=NULL) const;
00071 inline int __fastcall GetProfileIndex(void) const;
00072
00073
00074 public:
00075 int ProfileIndex;
00076 CSmallString Name;
00077 CSmallString Description;
00078 CExtObject::CStatus Status;
00079 int NumOfObjects;
00080 int* Objects;
00081 bool UseGList;
00082 EDrawLevel Level;
00083 GLuint GListName;
00084 };
00085
00086
00087
00089
00092 class NEMESIS_CORE_PACKAGE CGraphicsProfile : public CExtObject, public CManipulator {
00093 public:
00094
00095 __fastcall CGraphicsProfile(CGraphicsObjectsList* p_bl);
00096 void __fastcall RemoveFromBaseList(CElementsRecord* history=NULL);
00097
00098
00099 bool __fastcall Delete(void);
00100 bool __fastcall MoveUpObject(CGraphicsObject* object);
00101 bool __fastcall MoveDownObject(CGraphicsObject* object);
00102 bool __fastcall AddObjectWithHistory(CGraphicsObject* object);
00103 bool __fastcall RemoveObjectWithHistory(CGraphicsObject* object);
00104
00105
00106 bool __fastcall AddObject(CGraphicsObject* object,CElementsRecord* history=NULL);
00107 bool __fastcall RemoveObject(CGraphicsObject* object,CElementsRecord* history=NULL);
00108 bool __fastcall MoveObject(CGraphicsObject* object,bool moveup);
00109
00110 inline bool __fastcall IsFirstObject(CGraphicsObject* object);
00111 inline bool __fastcall IsLastObject(CGraphicsObject* object);
00112
00113
00114 void __fastcall InitGL(TObject* sender);
00115 void __fastcall ResizeGL(TObject* sender,int glwidth,int glheight);
00116 void __fastcall SelectResizeGL(TObject* sender,int glwidth,int glheight,int x,int y,int w,int h);
00117 void __fastcall DrawGL(TObject* sender);
00118
00119
00120 inline void __fastcall SetUseGList(bool set);
00121 inline bool __fastcall IsInUseGList(void) const;
00122
00123 void __fastcall UpdateGList(void);
00124
00125 virtual void __fastcall SetLevel(EDrawLevel level);
00126
00127
00128 inline CGraphicsObjectsList* __fastcall GetGraphicsObjectsList(void);
00129 bool __fastcall IsActiveProfile(void);
00130 CGraphicsObject* __fastcall FindObject(int objectindex);
00131 void __fastcall GetSceneMetrics(CPoint& low,CPoint& high);
00132 bool __fastcall GLUUnproject(const CPoint& winpos,CPoint& scenepos);
00133
00134
00135 bool __fastcall Load(CXMLElement* p_el);
00136 bool __fastcall Save(CXMLElement* p_el);
00137
00138
00139 private:
00140 bool FUseGList;
00141 EDrawLevel FLevel;
00142 GLuint GListName;
00143 CSimpleList<CGraphicsObject> Objects;
00144 CGraphicsObjectsList* GraphicsObjectsList;
00145
00146
00147
00148 virtual void __fastcall _Draw(void);
00149
00150
00151 virtual void __fastcall RemoveFromRegistered(CExtObject* object,CElementsRecord* history=NULL);
00152
00153 friend class CGraphicsProfileObjectEnumerator;
00154 friend class CGraphicsProfileData;
00155
00156 public:
00157 __fastcall ~CGraphicsProfile(void);
00158 };
00159
00160
00161
00162 DECLARE_EVENT(GraphicsProfile_AddObject);
00163 DECLARE_EVENT(GraphicsProfile_RemoveObject);
00164 DECLARE_EVENT(GraphicsProfile_ObjectsOrderChange);
00165
00166 extern CPluginObjectInfo GraphicsProfileObjectInfo;
00167
00168
00169
00170
00171
00172 class CProfileDataHistory : public CElementData{
00173 public:
00174 __fastcall CProfileDataHistory(CGraphicsProfile* p_pro,bool create);
00175 private:
00176 virtual void __fastcall Forward(void);
00177 virtual void __fastcall Backward(void);
00178
00179 CAdvancedProject* Project;
00180 CGraphicsProfileData Data;
00181 };
00182
00183
00184
00185
00186
00187 class CGraphicsObjectUnregHistory: public CElementData{
00188 public:
00189 __fastcall CGraphicsObjectUnregHistory(CGraphicsProfile* p_pr,CGraphicsObject* p_go,bool reg);
00190
00191 private:
00192 CGraphicsObjectsList* GraphicsObjectsList;
00193 int ProfileIndex;
00194 int ObjectIndex;
00195
00196 virtual void __fastcall Forward(void);
00197 virtual void __fastcall Backward(void);
00198 };
00199
00200
00201
00202
00203
00204 class CProfileDeleteHistory:public CCoreElementsRecord{
00205 public:
00206 __fastcall CProfileDeleteHistory(CGraphicsProfile* p_profile);
00207
00208 private:
00209 CSmallString Name;
00210 virtual CSmallString __fastcall GetDescription(const CSmallString& format);
00211 };
00212
00213
00214
00215
00216
00217 class CProfileMoveObjectHistory:public CCoreElementsRecord{
00218 public:
00219 __fastcall CProfileMoveObjectHistory(CGraphicsProfile* p_profile,CGraphicsObject* p_go,bool moveup);
00220
00221 private:
00222 CAdvancedProject* Project;
00223 int ProfileIndex;
00224 int ObjectIndex;
00225 CSmallString ProfileName;
00226 CSmallString ObjectName;
00227 CSmallString ObjectType;
00228
00229 virtual CSmallString __fastcall GetDescription(const CSmallString& format);
00230 virtual void __fastcall Forward(void);
00231 virtual void __fastcall Backward(void);
00232 };
00233
00234
00235
00236 class CProfileInsertObjectHistory:public CCoreElementsRecord{
00237 public:
00238 __fastcall CProfileInsertObjectHistory(CGraphicsProfile* p_profile,CGraphicsObject* p_go,bool reg);
00239
00240 private:
00241 CSmallString ProfileName;
00242 CSmallString ObjectName;
00243 CSmallString ObjectType;
00244
00245 virtual CSmallString __fastcall GetDescription(const CSmallString& format);
00246 };
00247
00248
00249
00250
00251
00252 inline bool __fastcall CGraphicsProfile::IsInUseGList(void) const
00253 {
00254 return(FUseGList);
00255 }
00256
00257
00258
00259 inline CGraphicsObjectsList* __fastcall CGraphicsProfile::GetGraphicsObjectsList(void)
00260 {
00261 return(GraphicsObjectsList);
00262 }
00263
00264
00265
00266 inline int __fastcall CGraphicsProfileData::GetProfileIndex(void) const
00267 {
00268 return(ProfileIndex);
00269 }
00270
00271
00272
00273 inline bool __fastcall CGraphicsProfile::IsFirstObject(CGraphicsObject* object)
00274 {
00275 return( object == Objects.GetFirst());
00276 }
00277
00278
00279
00280 inline bool __fastcall CGraphicsProfile::IsLastObject(CGraphicsObject* object)
00281 {
00282 return( object == Objects.GetLast());
00283 }
00284
00285
00286 #endif