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

BRUSH Class Reference

#include <brush.h>

List of all members.

Public Methods

 BRUSH ()
 ~BRUSH ()
int Compare (const BRUSH &Brush)
int GetMyPosition () const
void SetMyPosition (int newPosition)
bool IsLast ()
BRUSH * GetNext ()
void AddBrush (BRUSH *Brush)
void SetNext (BRUSH *Brush)
BRUSH * CopyList ()
const bool BRUSH::operator== (const BRUSH &Brush) const

Public Attributes

int linkPosition
BRUSH * NextBrush
int id
int numPolygons
POLYGON Polygon [30]


Constructor & Destructor Documentation

BRUSH::BRUSH  
 

Definition at line 19 of file brush.cpp.

References id, NextBrush, and numPolygons.

00020 {
00021     NextBrush = NULL;
00022     numPolygons    = 0;
00023     id = 0;
00024 }

BRUSH::~BRUSH  
 

Definition at line 26 of file brush.cpp.

00027 {
00028 }


Member Function Documentation

void BRUSH::AddBrush BRUSH *    Brush
 

Definition at line 80 of file brush.cpp.

References GetNext(), IsLast(), and NextBrush.

Referenced by CopyList(), and CreateBrushSet().

00081 {
00082     if (Brush != NULL)
00083     {
00084         if (IsLast())
00085         {
00086             NextBrush = Brush;
00087             return;
00088         }
00089 
00090         BRUSH* TempBrush = NextBrush;
00091 
00092         while (!TempBrush->IsLast())
00093             TempBrush = TempBrush->GetNext();
00094 
00095         TempBrush->NextBrush = Brush;
00096     }
00097 }

const bool BRUSH::BRUSH::operator== const BRUSH &    Brush const [inline]
 

Definition at line 33 of file brush.h.

References id, numPolygons, and Polygon.

00034         {
00035             if (id == Brush.id)
00036             {
00037                 if (numPolygons == Brush.numPolygons)
00038                 {
00039                     for (int loop = 0; loop < numPolygons; loop++)
00040                     {
00041                         if (!(Polygon[loop] == Brush.Polygon[loop]))
00042                             return false;
00043                     }
00044                     return true;
00045                 }
00046             }
00047             return false;
00048         }

int BRUSH::Compare const BRUSH &    Brush
 

Definition at line 99 of file brush.cpp.

References bigger, linkPosition, same, and smaller.

00100 {
00101     if (linkPosition < Brush.linkPosition)
00102             return smaller;
00103       if (linkPosition > Brush.linkPosition)
00104             return bigger;
00105       else
00106             return same;
00107 }

BRUSH * BRUSH::CopyList  
 

Definition at line 63 of file brush.cpp.

References AddBrush(), id, IsLast(), NextBrush, numPolygons, and Polygon.

00064 {
00065     BRUSH* TempBrush = new BRUSH;
00066 
00067     TempBrush->id = id;
00068 
00069     TempBrush->numPolygons = numPolygons;
00070 
00071     for (int loop = 0; loop < numPolygons; loop++)
00072         TempBrush->Polygon[loop] = Polygon[loop];
00073 
00074     if (!IsLast())
00075         TempBrush->AddBrush(NextBrush->CopyList());
00076 
00077     return TempBrush;
00078 }

int BRUSH::GetMyPosition   const [inline]
 

Definition at line 16 of file brush.h.

References linkPosition.

00016 {return linkPosition;}

BRUSH * BRUSH::GetNext  
 

Definition at line 38 of file brush.cpp.

References IsLast(), and NextBrush.

Referenced by AddBrush(), CSGAddition(), DeleteList(), and SetNext().

00039 {
00040     if (!IsLast())
00041         return NextBrush;
00042     else
00043         return NULL;
00044 }

bool BRUSH::IsLast  
 

Definition at line 30 of file brush.cpp.

References NextBrush.

Referenced by AddBrush(), CopyList(), DeleteList(), GetNext(), and SetNext().

00031 {
00032     if (NextBrush == NULL)
00033         return true;
00034     else
00035         return false;
00036 }

void BRUSH::SetMyPosition int    newPosition [inline]
 

Definition at line 17 of file brush.h.

References linkPosition.

00017 {linkPosition = newPosition;}

void BRUSH::SetNext BRUSH *    Brush
 

Definition at line 46 of file brush.cpp.

References GetNext(), IsLast(), and NextBrush.

00047 {
00048     if (IsLast())
00049     {
00050         NextBrush = Brush;
00051         return;
00052     }
00053 
00054     BRUSH* TempBrush = Brush;
00055 
00056     while (!TempBrush->IsLast())
00057         TempBrush = TempBrush->GetNext();
00058 
00059     TempBrush->SetNext(NextBrush);
00060     NextBrush = Brush;
00061 }


Member Data Documentation

int BRUSH::id
 

Definition at line 28 of file brush.h.

Referenced by BRUSH(), BRUSH::operator==(), CopyList(), and ResetBrushes().

int BRUSH::linkPosition
 

Definition at line 18 of file brush.h.

Referenced by Compare(), GetMyPosition(), and SetMyPosition().

BRUSH* BRUSH::NextBrush
 

Definition at line 21 of file brush.h.

Referenced by AddBrush(), BRUSH(), CopyList(), GetNext(), IsLast(), and SetNext().

int BRUSH::numPolygons
 

Definition at line 29 of file brush.h.

Referenced by BRUSH(), BRUSH::operator==(), CopyList(), CSGAddition(), InvertBrushPolygons(), RenderTexturedBrush(), RenderWireframeBrush(), ResetBrushes(), and SetBrushPolygons().

POLYGON BRUSH::Polygon[30]
 

Definition at line 30 of file brush.h.

Referenced by BRUSH::operator==(), CopyList(), CSGAddition(), InvertBrushPolygons(), RenderTexturedBrush(), RenderWireframeBrush(), ResetBrushes(), and SetBrushPolygons().


The documentation for this class was generated from the following files:
Generated on Fri Dec 23 05:15:51 2005 for Constructive Solid Geometry by doxygen1.2.15