syBR::map2syBR::Brush Class Reference

Brush. More...

#include <Brush.hpp>

List of all members.

Public Member Functions

 Brush ()
 Constructor.
 ~Brush ()
 Destructor.
void addFace (BrushFace *pBrushFace)
 Add a face to the faces list.
const unsigned long getFaceCount () const
 Get the face count.
void toPolygons ()
 Create the polygons from the faces list.
const unsigned long getPolygonCount () const
 Get the polygon count.
void mergePolygons (std::vector< Polygon * > &vpPolygons)
 Merge the polygon list with another polygon list.
Brushclone () const
 Clone / duplicate the brush.
void clipToBrush (Brush *pBrush, bool clipOnPlane)
 Clip a brush to another one.

Static Public Member Functions

static void setTextureManager (TextureManager *pManager)
 Set texture manager used to load textures and retrieve the size of textures.

Private Member Functions

const bool isVectorInBrush (const Vector3 &vec) const
 Check if a vector is inside the brush.
bool addVectorToPolygon (const Vector3 &vec, unsigned long index, BrushFace *pFace)
 Add a vector to a polygon.

Private Attributes

std::list< BrushFace * > m_lstFaces
 List of faces of the brush.
std::vector< Polygon * > m_vpPolygons
 List of polygons of the brush, created from the faces list.
bool m_mustDeletePolygons
 Indicate if this object must delete its polygons or not.

Static Private Attributes

static TextureManagersm_pTextureManager = NULL
 Texture manager.


Detailed Description

Brush.

Constructor & Destructor Documentation

syBR::map2syBR::Brush::Brush (  ) 

Constructor.

syBR::map2syBR::Brush::~Brush (  ) 

Destructor.


Member Function Documentation

void syBR::map2syBR::Brush::addFace ( BrushFace pBrushFace  ) 

Add a face to the faces list.

Parameters:
pBrushFace Face to add to the list, memory allocated for the face will be freed by the brush when it is no longer needed

const unsigned long syBR::map2syBR::Brush::getFaceCount (  )  const

Get the face count.

Returns:
Face count

void syBR::map2syBR::Brush::toPolygons (  ) 

Create the polygons from the faces list.

Here are the two steps of this creation:

const unsigned long syBR::map2syBR::Brush::getPolygonCount (  )  const

Get the polygon count.

Returns:
Polygon count

void syBR::map2syBR::Brush::mergePolygons ( std::vector< Polygon * > &  vpPolygons  ) 

Merge the polygon list with another polygon list.

Parameters:
vpPolygons Polygon list with which this polygon list must be merged

Brush * syBR::map2syBR::Brush::clone (  )  const

Clone / duplicate the brush.

Returns:
Pointer to a brush with exactly the same polygons as this one

void syBR::map2syBR::Brush::clipToBrush ( Brush pBrush,
bool  clipOnPlane 
)

Clip a brush to another one.

Parameters:
pBrush Brush against which this brush must be clipped
clipOnPlane One of these:
  • true to clip polygons which are on the same plane as those of the brush
  • false otherwise

void syBR::map2syBR::Brush::setTextureManager ( TextureManager pManager  )  [static]

Set texture manager used to load textures and retrieve the size of textures.

Parameters:
pManager Pointer to the texture manager to use

const bool syBR::map2syBR::Brush::isVectorInBrush ( const Vector3 vec  )  const [private]

Check if a vector is inside the brush.

Parameters:
vec Vector to check
Returns:
One of these:
  • true if the vector is in the brush
  • false otherwise

bool syBR::map2syBR::Brush::addVectorToPolygon ( const Vector3 vec,
unsigned long  index,
BrushFace pFace 
) [private]

Add a vector to a polygon.

Parameters:
vec Vector to add
index Index of the polygon to which the vector must be added
pFace Face to which this vector belongs (used for texture coordinates determination)
Returns:
One of these:
  • true in case of success
  • false otherwise


Member Data Documentation

TextureManager * syBR::map2syBR::Brush::sm_pTextureManager = NULL [static, private]

Texture manager.

The texture manager is used to load textures and then retrieve the dimensions of textures in order to calculate texture coordinates of vertices.

std::list<BrushFace *> syBR::map2syBR::Brush::m_lstFaces [private]

List of faces of the brush.

std::vector<Polygon *> syBR::map2syBR::Brush::m_vpPolygons [private]

List of polygons of the brush, created from the faces list.

bool syBR::map2syBR::Brush::m_mustDeletePolygons [private]

Indicate if this object must delete its polygons or not.

It is equal to true by default but is reverter to false when mergePolygons is called.


The documentation for this class was generated from the following files:

Copyright © 2008 by Sebastien Frippiat
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
Last modified Tue Dec 30 17:57:34 2008