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
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 #ifndef INC_GRE_3DDC_H
00058 #define INC_GRE_3DDC_H
00059
00060 #ifndef INC_FILLPOLY_H
00061 #include <mi32/fillpoly.h>
00062 #endif
00063
00064 #ifndef INC_GRE_3DFILTER_H
00065 #include <gre/3dfilter.h>
00066 #endif
00067
00068 #ifndef INC_GRE_3DTEXTUR_H
00069 #include <gre/3dtextur.h>
00070 #endif
00071
00072 namespace GRE {
00073
00074
00075
00076
00077
00078 class DRAWINGCONTEXT3D {
00079
00080 public:
00081
00082 DRAWINGCONTEXT3D (
00083 );
00084
00085 virtual ~DRAWINGCONTEXT3D (
00086 );
00087
00088
00089 void DrawBegin (
00090 SCENE3D* scene,
00091 MGD::CONTEXT* context
00092 );
00093
00094
00095 void DrawEnd (
00096 );
00097
00098 void DrawPoint (
00099 const DPOINT3D& point
00100 );
00101
00102 void DrawLine (
00103 const DPOINT3D& begin,
00104 const DPOINT3D& end
00105 );
00106
00107
00108 void DrawTriangles (
00109 const TRIANGULATIONVECTOR& triangulations
00110 );
00111
00112
00113 void DrawPixels (
00114 const PIXALIZATIONVECTOR& pixalizations
00115 );
00116
00117 void RenderPixel (
00118 const INT32 col,
00119 const INT32 lin,
00120 const double z
00121 );
00122
00123 void SetColor (
00124 const COLOR& color
00125 ) {
00126 if (m_Context != 0) m_Context->SetColor(color);
00127 return;
00128 };
00129
00130 SCENE3D* GetScene (
00131 ) { return m_Scene; }
00132
00133 double GetPixelSizeInMM (
00134 ) const;
00135
00136 private:
00137
00138 #ifndef GENERATING_DOXYGEN_OUTPUT
00139
00140 class SPAN : public FILLPOLYGON::SPAN {
00141
00142 public:
00143
00144 SPAN (
00145 DRAWINGCONTEXT3D *dc3d
00146 ) :
00147 m_DC3D(dc3d)
00148 {
00149 };
00150
00151 private:
00152
00153 void VProcess (
00154 const double x1,
00155 const double x2,
00156 const double y
00157 );
00158
00159 SPAN (
00160 );
00161
00162 DRAWINGCONTEXT3D *m_DC3D;
00163 };
00164
00165 friend class SPAN;
00166
00167 MGD::CONTEXT *m_Context;
00168 SCENE3D *m_Scene;
00169
00170 TRIANGULATION *m_Triangulation;
00171
00172 DOUBLE_ARRAY<DPOINT3DH> m_Vertices;
00173 DOUBLE_ARRAY<DPOINT3DH> m_Points;
00174
00175 DOUBLE_ARRAY<DPOINT3DH> m_TempPoints;
00176 POLYLINE m_Polyline;
00177
00178 SCREENPLANE m_ScreenPlane;
00179
00180 void FillSpan (const INT32 col1, const INT32 col2, const INT32 lin);
00181 void FillSolidSpan (const INT32 col1, const INT32 col2, const INT32 lin);
00182 void FillPointsFieldSpan (const INT32 col1, const INT32 col2, const INT32 lin);
00183
00184 void DrawTINWireframe (const TRIANGULATION *triangulation);
00185 void DrawTINSolid (const TRIANGULATION *triangulation);
00186
00187 void DrawStripWireframe (const TRIANGULATION *triangulation);
00188 void DrawStripSolid (const TRIANGULATION *triangulation);
00189
00190 void DrawFanWireframe (const TRIANGULATION *triangulation);
00191 void DrawFanSolid (const TRIANGULATION *triangulation);
00192
00193 void DrawTexturizedPixels (const PIXALIZATION *pixalization);
00194 void DrawColoredPixels (const PIXALIZATION *pixalization);
00195 void DrawPointsFieldPixels (const PIXALIZATION *pixalization);
00196 void DrawBitmapPixels (const PIXALIZATION *pixalization);
00197
00198 };
00199
00200 #endif // GENERATING_DOXYGEN_OUTPUT
00201
00202 }
00203
00204 #endif
00205