cWidget::Map::ClipperRect Class Reference

Inheritance diagram for cWidget::Map::ClipperRect:

Inheritance graph
[legend]
Collaboration diagram for cWidget::Map::ClipperRect:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void Begin (Map &map, tCoord const &e1, tCoord const &e2)
void End ()

Static Public Member Functions

static Clippercreate ()


Detailed Description

Definition at line 100 of file cMap.h.


Member Function Documentation

static Clipper* cWidget::Map::ClipperRect::create (  )  [inline, static]

Definition at line 102 of file cMap.h.

Referenced by cWidget::Map::Mode::Mode().

00102 {return new ClipperRect;}

Here is the caller graph for this function:

void cWidget::Map::ClipperRect::Begin ( Map map,
tCoord const &  e1,
tCoord const &  e2 
) [virtual]

Implements cWidget::Map::Clipper.

Definition at line 62 of file cMap.cpp.

References rGradient::BeginDraw(), rGradient::DrawPoint(), rGradient::DrawRect(), glBegin, glEnd, cWidget::WithBackground::m_background, cWidget::WithForeground::m_foreground, rGradient::SetGradientEdges(), tCoord::x, and tCoord::y.

00062                                                                        {
00063     // set clipping frame in map coordinates
00064     GLdouble pl0[4] = {1.0, 0.0, 0.0, -e1.x };
00065     GLdouble pl1[4] = {-1.0, 0.0, 0.0, e2.x };
00066     GLdouble pl2[4] = {0.0, 1.0, 0.0, -e1.y };
00067     GLdouble pl3[4] = {0.0, -1.0, 0.0, e2.y };
00068     glClipPlane(GL_CLIP_PLANE0, pl0);
00069     glEnable(GL_CLIP_PLANE0);
00070     glClipPlane(GL_CLIP_PLANE1, pl1);
00071     glEnable(GL_CLIP_PLANE1);
00072     glClipPlane(GL_CLIP_PLANE2, pl2);
00073     glEnable(GL_CLIP_PLANE2);
00074     glClipPlane(GL_CLIP_PLANE3, pl3);
00075     glEnable(GL_CLIP_PLANE3);
00076     // Add frame ...
00077     map.m_foreground.BeginDraw();
00078     glBegin(GL_LINE_STRIP);
00079     //TODO: this should use a function of the rGradient.
00080     map.m_foreground.DrawPoint(e1);
00081     map.m_foreground.DrawPoint(tCoord(e2.x, e1.y));
00082     map.m_foreground.DrawPoint(e2);
00083     map.m_foreground.DrawPoint(tCoord(e1.x, e2.y));
00084     map.m_foreground.DrawPoint(e1);
00085     glEnd();
00086     map.m_background.SetGradientEdges(e1, e2);
00087     map.m_background.DrawRect(e1, e2);
00088 }

Here is the call graph for this function:

void cWidget::Map::ClipperRect::End ( void   )  [virtual]

Implements cWidget::Map::Clipper.

Definition at line 90 of file cMap.cpp.

00090                          {
00091     glDisable(GL_CLIP_PLANE0);
00092     glDisable(GL_CLIP_PLANE1);
00093     glDisable(GL_CLIP_PLANE2);
00094     glDisable(GL_CLIP_PLANE3);
00095 }


The documentation for this class was generated from the following files:
Generated on Sun Mar 16 00:04:12 2008 for Armagetron Advanced by  doxygen 1.5.4