Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

GraphicsUtil.h

Go to the documentation of this file.
00001 #ifndef GraphicsUtilH
00002 #define GraphicsUtilH
00003 /*******************************************************************************
00004 Copyright 1998,1999,2000,2001,2002 Petr Kulhanek
00005 
00006     This file is part of Core plugin.
00007 
00008     Core plugin is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012 
00013     Core plugin is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with Core plugin; if not, write to the Free Software
00020     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021 *******************************************************************************/
00022 /*******************************************************************************
00023 ** PROJECT:             Project NEMESIS
00024 ** FILE:                GraphicsUtil
00025 ** FUNCTION:            common graphics utilities
00026 ** VERSION:             1.0
00027 ** LANGUAGE:            CBuilder C++
00028 ** TARGET COMPUTER:     IBM PC
00029 ** PROGRAMMER:          Petr Kulhánek
00030 ** HISTORY:
00031 VERSION DATE        NOTE
00032 *******************************************************************************/
00033 
00037 /* HEADER FILES ***************************************************************/
00038 
00039 #include "CoreMainHeader.h"
00040 #include "Point.h"
00041 #include "Color.h"
00042 
00043 /* HEADER FILES END ***********************************************************/
00044 
00045 class CSmallString;
00046 
00047 //---------------------------------------------------------------------------
00048 
00050 
00053 class NEMESIS_CORE_PACKAGE CElementColors{
00054     public:
00055          __fastcall CElementColors(void);
00056 
00057     void __fastcall SetColor(bool excite,GLenum face=GL_FRONT_AND_BACK) const;
00058 
00059     void __fastcall SetTransparency(float transparency);
00060 
00061     public:
00062     bool        Uniform;
00063 
00064     CColor      Ambient;
00065     CColor      Diffuse;
00066     CColor      Specular;
00067     CColor      Emission;
00068     int         Shininess;
00069 
00070     CColor      ExciteAmbient;
00071     CColor      ExciteDiffuse;
00072     CColor      ExciteSpecular;
00073     CColor      ExciteEmission;
00074     int         ExciteShininess;
00075 
00076     CColor      Color;
00077     CColor      ExciteColor;
00078     };
00079 
00080 //---------------------------------------------------------------------------
00081 
00083 
00086 class NEMESIS_CORE_PACKAGE CSphere{
00087     public:
00088     __fastcall CSphere(void);   // default tessellation=3
00089     __fastcall ~CSphere(void);
00090     void __fastcall Draw(const float radius);
00091     bool __fastcall SetTessellationQuality(const unsigned int quality);
00092     private:
00093     CSimplePoint<float>* Vertices;      // vrcholy na povrchu koule
00094     unsigned int         NumOfVertices; // počet vrcholů
00095     unsigned int         Tessellation;  // kvalita povrchu
00096     unsigned int         DummyPos;
00097     void __fastcall ComputeVertices(void);
00098     void __fastcall ComputePartition(const CSimplePoint<GLfloat>& v1,const CSimplePoint<GLfloat>& v2,const CSimplePoint<GLfloat>& v3,CSimplePoint<GLfloat> data[],const unsigned int complexity);
00099     };
00100 
00101 //---------------------------------------------------------------------------
00102 
00104 
00107 class NEMESIS_CORE_PACKAGE CHalfSphere{
00108     public:
00109     __fastcall CHalfSphere(void);   // default tessellation=3
00110     __fastcall ~CHalfSphere(void);
00111 
00112     void __fastcall Draw(const float radius);
00113     bool __fastcall SetTessellationQuality(const unsigned int quality);
00114     private:
00115     CSimplePoint<float>* Vertices;      // vrcholy na povrchu koule
00116     unsigned int         NumOfVertices; // počet vrcholů
00117     unsigned int         Tessellation;  // kvalita povrchu
00118     unsigned int         DummyPos;
00119 
00120     void __fastcall ComputeVertices(void);
00121     void __fastcall ComputePartition(const CSimplePoint<GLfloat>& v1,const CSimplePoint<GLfloat>& v2,const CSimplePoint<GLfloat>& v3,CSimplePoint<GLfloat> data[],const unsigned int complexity);
00122     };
00123 
00124 //---------------------------------------------------------------------------
00125 
00127 
00130 class NEMESIS_CORE_PACKAGE CCylinder{
00131     public:
00132     __fastcall CCylinder(void);   // default tessellation=3
00133     __fastcall ~CCylinder(void);
00134     
00135     void __fastcall Draw(const float radius,const float height);
00136     void __fastcall Draw(const float radius,const float height,const CColor* color1,const CColor* color2);
00137     void __fastcall Draw(const float radius,const float height,const CElementColors* color1,bool excite1,const CElementColors* color2,bool excite2);
00138     void __fastcall Draw(const float radius1,const float radius2,const float height);
00139     bool __fastcall SetTessellationQuality(const unsigned int quality);
00140     private:
00141     CSimplePoint<float>* Vertices;      // vrcholy na povrchu koule
00142     unsigned int         NumOfFaces;    // počet vrcholů
00143     unsigned int         Tessellation;  // kvalita povrchu
00144 
00145     void __fastcall ComputeVertices(void);
00146     };
00147 
00148 //---------------------------------------------------------------------------
00149 
00151 
00154 class NEMESIS_CORE_PACKAGE CArc{
00155     public:
00156     __fastcall CArc(void);   // default tessellation=3
00157     __fastcall ~CArc(void);
00158 
00159     void __fastcall Draw(const CSimplePoint<GLfloat>& v1,const CSimplePoint<GLfloat>& v2,const CSimplePoint<GLfloat>& v3,float angle,CSimplePoint<GLfloat>& str);
00160     bool __fastcall SetTessellationQuality(const unsigned int quality);
00161 
00162     private:
00163     CSimplePoint<float>* Vertices;      // vrcholy na povrchu koule
00164     unsigned int         NumOfFaces;    // počet vrcholů
00165     unsigned int         Tessellation;  // kvalita povrchu
00166 
00167     void __fastcall ComputeVertices(void);
00168     };
00169 
00170 //---------------------------------------------------------------------------
00171 
00173 
00176 class NEMESIS_CORE_PACKAGE COpenGL2DFont{
00177     public:
00178         __fastcall COpenGL2DFont(void);
00179         __fastcall ~COpenGL2DFont(void);
00180 
00181     bool __fastcall CreateFont(TFont* p_font,TWinControl* p_win);
00182     bool __fastcall IsInitialized(void);
00183     bool __fastcall DestroyFont(void);
00184 
00185     void __fastcall DrawText(const CSmallString& text);
00186 
00187     private:
00188     unsigned int   FirstGylph;
00189     unsigned int   NumGylph;
00190     unsigned int   ListBase;
00191     };
00192 
00193 //---------------------------------------------------------------------------
00194 
00195 class CObject;
00196 
00197 GLenum __fastcall NEMESIS_CORE_PACKAGE GLGetMode(void);
00198 void __fastcall NEMESIS_CORE_PACKAGE GLLoadObject(CObject* object);
00199 
00200 
00201 #endif

Generated on Sun Feb 9 12:53:51 2003 for NemesisCore by doxygen1.3-rc2