brush.h File Reference

The brush primitive. More...

#include "debugging/debugging.h"
#include "itexdef.h"
#include "iundo.h"
#include "iselection.h"
#include "irender.h"
#include "imap.h"
#include "ibrush.h"
#include "igl.h"
#include "ifilter.h"
#include "nameable.h"
#include "moduleobserver.h"
#include <set>
#include "cullable.h"
#include "renderable.h"
#include "selectable.h"
#include "editable.h"
#include "mapfile.h"
#include "math/frustum.h"
#include "selectionlib.h"
#include "render.h"
#include "texturelib.h"
#include "container/container.h"
#include "generic/bitfield.h"
#include "signal/signalfwd.h"
#include "winding.h"
#include "brush_primit.h"
#include "shaderlib.h"
Include dependency graph for brush.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  FaceShaderObserver
class  FaceShaderObserverRealise
class  FaceShaderObserverUnrealise
class  ContentsFlagsValue
class  FaceShader
class  FaceShader::SavedState
class  FaceTexdef
class  FaceTexdef::SavedState
class  FacePlane
class  FacePlane::SavedState
class  FaceFilter
class  FaceObserver
class  Face
class  Face::SavedState
class  FaceVertexId
struct  EdgeRenderIndices
struct  EdgeFaces
class  RenderableWireframe
class  BrushFilter
class  SelectableEdge
class  SelectableVertex
class  BrushObserver
class  BrushVisitor
class  Brush
class  Brush::BrushUndoMemento
 The undo memento for a brush stores only the list of face references - the faces are not copied. More...
class  FaceInstanceSet
class  VectorLightList
class  FaceInstance
class  FaceInstance::RenderablePointVectorPushBack
class  BrushClipPlane
class  EdgeInstance
class  VertexInstance
class  BrushInstanceVisitor
class  BrushInstance
class  BrushInstance::TypeCasts
class  BrushSelectedVisitor< Functor >
class  BrushVisibleSelectedVisitor< Functor >
class  BrushForEachFace
class  FaceInstanceVisitFace< Functor >
class  FaceVisitAll< Functor >
class  FaceInstanceVisitAll< Functor >
class  InstanceIfVisible< Type, Functor >
class  BrushVisibleWalker< Functor >
class  FaceVisitorWrapper< Functor >

Defines

#define INCLUDED_BRUSH_H

Typedefs

typedef DoubleVector3 PlanePoints [3]
typedef ReferencePair
< FaceShaderObserver
FaceShaderObserverPair
typedef double(* QuantiseFunc )(double f)
typedef std::size_t faceIndex_t
typedef std::vector< Brush * > brush_vector_t
typedef SmartPointer< FaceFaceSmartPointer
typedef std::vector
< FaceSmartPointer
Faces
typedef SelectionList
< FaceInstance
FaceInstancesList
typedef std::list< std::size_t > VertexSelection
typedef const Plane3PlanePointer
typedef PlanePointerPlanesIterator
typedef std::vector< FaceInstanceFaceInstances

Functions

template<typename TextOuputStreamType >
TextOuputStreamType & ostream_write (TextOuputStreamType &ostream, const Matrix4 &m)
bool texdef_sane (const texdef_t &texdef)
void Winding_DrawWireframe (const Winding &winding)
void Winding_Draw (const Winding &winding, const Vector3 &normal, RenderStateFlags state)
 Brush rendering.
bool planepts_equal (const PlanePoints planepts, const PlanePoints other)
void planepts_assign (PlanePoints planepts, const PlanePoints other)
void planepts_quantise (PlanePoints planepts, double snap)
float vector3_max_component (const Vector3 &vec3)
void edge_snap (Vector3 &edge, double snap)
void planepts_snap (PlanePoints planepts, double snap)
PointVertex pointvertex_for_planept (const DoubleVector3 &point, const Colour4b &colour)
PointVertex pointvertex_for_windingpoint (const Vector3 &point, const Colour4b &colour)
bool check_plane_is_integer (const PlanePoints &planePoints)
void brush_check_shader (const char *name)
static void ContentsFlagsValue_assignMasked (ContentsFlagsValue &flags, const ContentsFlagsValue &other)
void planepts_print (const PlanePoints &planePoints, TextOutputStream &ostream)
Plane3 Plane3_applyTranslation (const Plane3 &plane, const Vector3 &translation)
Plane3 Plane3_applyTransform (const Plane3 &plane, const Matrix4 &matrix)
void Winding_testSelect (Winding &winding, SelectionTest &test, SelectionIntersection &best)
double quantiseInteger (double f)
double quantiseFloating (double f)
bool face_filtered (Face &face)
void add_face_filter (FaceFilter &filter, int mask, bool invert=false)
void Brush_addTextureChangedCallback (const SignalHandler &callback)
void Brush_textureChanged ()
bool brush_filtered (Brush &brush)
void add_brush_filter (BrushFilter &filter, int mask, bool invert=false)
bool plane3_inside (const Plane3 &self, const Plane3 &other)
 Returns true if 'self' takes priority when building brush b-rep.
FaceVertexId next_edge (const Faces &faces, FaceVertexId faceVertex)
 Returns the unique-id of the edge adjacent to faceVertex in the edge-pair for the set of faces.
FaceVertexId next_vertex (const Faces &faces, FaceVertexId faceVertex)
 Returns the unique-id of the vertex adjacent to faceVertex in the vertex-ring for the set of faces.
VertexSelection::iterator VertexSelection_find (VertexSelection &self, std::size_t value)
VertexSelection::const_iterator VertexSelection_find (const VertexSelection &self, std::size_t value)
VertexSelection::iterator VertexSelection_insert (VertexSelection &self, std::size_t value)
void VertexSelection_erase (VertexSelection &self, std::size_t value)
bool triangle_reversed (std::size_t x, std::size_t y, std::size_t z)
template<typename Element >
Vector3 triangle_cross (const BasicVector3< Element > &x, const BasicVector3< Element > y, const BasicVector3< Element > &z)
template<typename Element >
bool triangles_same_winding (const BasicVector3< Element > &x1, const BasicVector3< Element > y1, const BasicVector3< Element > &z1, const BasicVector3< Element > &x2, const BasicVector3< Element > y2, const BasicVector3< Element > &z2)
BrushInstanceInstance_getBrush (scene::Instance &instance)
template<typename Functor >
const Functor & Scene_forEachSelectedBrush (const Functor &functor)
template<typename Functor >
const Functor & Scene_forEachVisibleSelectedBrush (const Functor &functor)
template<typename Functor >
const Functor & Brush_forEachFace (BrushInstance &brush, const Functor &functor)
template<typename Functor >
const Functor & Brush_forEachFace (const Brush &brush, const Functor &functor)
template<typename Functor >
const Functor & Brush_forEachFace (Brush &brush, const Functor &functor)
template<typename Functor >
const Functor & Brush_ForEachFaceInstance (BrushInstance &brush, const Functor &functor)
template<typename Functor >
const Functor & Scene_forEachBrush (scene::Graph &graph, const Functor &functor)
template<typename Functor >
const Functor & Scene_forEachVisibleBrush (scene::Graph &graph, const Functor &functor)
template<typename Functor >
const Functor & Scene_ForEachBrush_ForEachFace (scene::Graph &graph, const Functor &functor)
template<typename Functor >
const Functor & Scene_ForEachBrush_ForEachFaceInstance (scene::Graph &graph, const Functor &functor)
template<typename Functor >
const Functor & Scene_ForEachSelectedBrush_ForEachFace (scene::Graph &graph, const Functor &functor)
template<typename Functor >
const Functor & Scene_ForEachSelectedBrush_ForEachFaceInstance (scene::Graph &graph, const Functor &functor)
template<typename Functor >
const Functor & Scene_ForEachSelectedBrushFace (const Functor &functor)

Variables

const unsigned int BRUSH_DETAIL_FLAG = 27
const unsigned int BRUSH_DETAIL_MASK = 0x08000000
const unsigned int BRUSH_WATER_MASK = 0x0020
const double GRID_MIN = 0.125
bool g_brush_texturelock_enabled
FaceInstanceSet g_SelectedFaceInstances

Detailed Description

The brush primitive.

A collection of planes that define a convex polyhedron. The Boundary-Representation of this primitive is a manifold polygonal mesh. Each face polygon is represented by a list of vertices in a Winding. Each vertex is associated with another face that is adjacent to the edge formed by itself and the next vertex in the winding. This information can be used to find edge-pairs and vertex-rings.

Definition in file brush.h.


Define Documentation

#define INCLUDED_BRUSH_H

Definition at line 23 of file brush.h.


Typedef Documentation

typedef std::vector<Brush*> brush_vector_t

Definition at line 1286 of file brush.h.

typedef std::size_t faceIndex_t

Definition at line 1239 of file brush.h.

typedef std::vector<FaceInstance> FaceInstances

Definition at line 2783 of file brush.h.

typedef SelectionList<FaceInstance> FaceInstancesList

Definition at line 2186 of file brush.h.

typedef std::vector<FaceSmartPointer> Faces

Definition at line 1311 of file brush.h.

Definition at line 241 of file brush.h.

typedef SmartPointer<Face> FaceSmartPointer

Definition at line 1310 of file brush.h.

typedef const Plane3* PlanePointer

Definition at line 2276 of file brush.h.

Definition at line 113 of file brush.h.

Definition at line 2277 of file brush.h.

typedef double(* QuantiseFunc)(double f)

Definition at line 722 of file brush.h.

typedef std::list<std::size_t> VertexSelection

Definition at line 2229 of file brush.h.


Function Documentation

void add_brush_filter ( BrushFilter filter,
int  mask,
bool  invert = false 
)
void add_face_filter ( FaceFilter filter,
int  mask,
bool  invert = false 
)
void Brush_addTextureChangedCallback ( const SignalHandler callback  ) 
void brush_check_shader ( const char *  name  )  [inline]

Definition at line 206 of file brush.h.

References shader_valid().

Referenced by FaceShader::captureShader().

bool brush_filtered ( Brush brush  ) 

Referenced by Brush::updateFiltered().

template<typename Functor >
const Functor& Brush_forEachFace ( Brush brush,
const Functor &  functor 
) [inline]

Definition at line 3502 of file brush.h.

References Brush::forEachFace().

template<typename Functor >
const Functor& Brush_forEachFace ( const Brush brush,
const Functor &  functor 
) [inline]

Definition at line 3495 of file brush.h.

References Brush::forEachFace().

template<typename Functor >
const Functor& Brush_forEachFace ( BrushInstance brush,
const Functor &  functor 
) [inline]

Definition at line 3473 of file brush.h.

References BrushInstance::forEachFaceInstance().

template<typename Functor >
const Functor& Brush_ForEachFaceInstance ( BrushInstance brush,
const Functor &  functor 
) [inline]

Definition at line 3524 of file brush.h.

References BrushInstance::forEachFaceInstance().

void Brush_textureChanged (  ) 
bool check_plane_is_integer ( const PlanePoints planePoints  )  [inline]

Definition at line 198 of file brush.h.

References float_is_integer().

Referenced by FacePlane::MakePlane(), and FacePlane::transform().

static void ContentsFlagsValue_assignMasked ( ContentsFlagsValue flags,
const ContentsFlagsValue other 
) [inline, static]
void edge_snap ( Vector3 edge,
double  snap 
) [inline]

Definition at line 139 of file brush.h.

References f, scale, vector3_max_component(), and vector3_snap().

Referenced by planepts_snap().

bool face_filtered ( Face face  ) 

Referenced by Face::updateFiltered().

BrushInstance* Instance_getBrush ( scene::Instance &  instance  )  [inline]
FaceVertexId next_edge ( const Faces faces,
FaceVertexId  faceVertex 
) [inline]

Returns the unique-id of the edge adjacent to faceVertex in the edge-pair for the set of faces.

Definition at line 1314 of file brush.h.

References FaceVertexId::getFace(), and FaceVertexId::getVertex().

Referenced by next_vertex(), EdgeInstance::select_edge(), and EdgeInstance::selected_edge().

FaceVertexId next_vertex ( const Faces faces,
FaceVertexId  faceVertex 
) [inline]

Returns the unique-id of the vertex adjacent to faceVertex in the vertex-ring for the set of faces.

Definition at line 1328 of file brush.h.

References FaceVertexId::getFace(), FaceVertexId::getVertex(), and next_edge().

Referenced by VertexInstance::select_vertex(), and VertexInstance::selected_vertex().

template<typename TextOuputStreamType >
TextOuputStreamType& ostream_write ( TextOuputStreamType &  ostream,
const Matrix4 &  m 
) [inline]

Definition at line 73 of file brush.h.

Plane3 Plane3_applyTransform ( const Plane3 plane,
const Matrix4 &  matrix 
) [inline]

Definition at line 583 of file brush.h.

References Plane3::dist(), Plane3::normal(), and plane3_transformed().

Plane3 Plane3_applyTranslation ( const Plane3 plane,
const Vector3 translation 
) [inline]

Definition at line 577 of file brush.h.

References Plane3::dist(), Plane3::normal(), and plane3_translated().

bool plane3_inside ( const Plane3 self,
const Plane3 other 
) [inline]

Returns true if 'self' takes priority when building brush b-rep.

Definition at line 1302 of file brush.h.

References Plane3::dist(), Plane3::normal(), and vector3_equal_epsilon().

Referenced by Brush::plane_unique().

void planepts_assign ( PlanePoints  planepts,
const PlanePoints  other 
) [inline]
bool planepts_equal ( const PlanePoints  planepts,
const PlanePoints  other 
) [inline]

Definition at line 115 of file brush.h.

void planepts_print ( const PlanePoints planePoints,
TextOutputStream &  ostream 
) [inline]

Definition at line 570 of file brush.h.

Referenced by FacePlane::MakePlane().

void planepts_quantise ( PlanePoints  planepts,
double  snap 
) [inline]
void planepts_snap ( PlanePoints  planepts,
double  snap 
) [inline]

Definition at line 148 of file brush.h.

References BasicVector3< Element >::dot(), edge_snap(), and vector3_snap().

Referenced by Face::snapto().

PointVertex pointvertex_for_planept ( const DoubleVector3 point,
const Colour4b &  colour 
) [inline]
PointVertex pointvertex_for_windingpoint ( const Vector3 point,
const Colour4b &  colour 
) [inline]

Definition at line 193 of file brush.h.

Referenced by FaceInstance::RenderablePointVectorPushBack::operator()().

double quantiseFloating ( double  f  )  [inline]

Definition at line 717 of file brush.h.

References float_snapped().

Referenced by Brush::constructStatic().

double quantiseInteger ( double  f  )  [inline]

Definition at line 712 of file brush.h.

References float_to_integer().

template<typename Functor >
const Functor& Scene_forEachBrush ( scene::Graph &  graph,
const Functor &  functor 
) [inline]
template<typename Functor >
const Functor& Scene_ForEachBrush_ForEachFace ( scene::Graph &  graph,
const Functor &  functor 
) [inline]

Definition at line 3582 of file brush.h.

References Scene_forEachBrush().

template<typename Functor >
const Functor& Scene_ForEachBrush_ForEachFaceInstance ( scene::Graph &  graph,
const Functor &  functor 
) [inline]

Definition at line 3590 of file brush.h.

References Scene_forEachBrush().

template<typename Functor >
const Functor& Scene_forEachSelectedBrush ( const Functor &  functor  )  [inline]
template<typename Functor >
const Functor& Scene_ForEachSelectedBrush_ForEachFace ( scene::Graph &  graph,
const Functor &  functor 
) [inline]

Definition at line 3597 of file brush.h.

References Scene_forEachSelectedBrush().

template<typename Functor >
const Functor& Scene_ForEachSelectedBrush_ForEachFaceInstance ( scene::Graph &  graph,
const Functor &  functor 
) [inline]

Definition at line 3604 of file brush.h.

References Scene_forEachSelectedBrush().

template<typename Functor >
const Functor& Scene_ForEachSelectedBrushFace ( const Functor &  functor  )  [inline]

Definition at line 3627 of file brush.h.

References FaceInstanceSet::foreach().

template<typename Functor >
const Functor& Scene_forEachVisibleBrush ( scene::Graph &  graph,
const Functor &  functor 
) [inline]

Definition at line 3575 of file brush.h.

template<typename Functor >
const Functor& Scene_forEachVisibleSelectedBrush ( const Functor &  functor  )  [inline]

Definition at line 3437 of file brush.h.

References SelectionSystem::foreachSelected(), and GlobalSelectionSystem().

bool texdef_sane ( const texdef_t &  texdef  )  [inline]

Definition at line 80 of file brush.h.

Referenced by FaceTexdef::shift().

template<typename Element >
Vector3 triangle_cross ( const BasicVector3< Element > &  x,
const BasicVector3< Element >  y,
const BasicVector3< Element > &  z 
) [inline]

Definition at line 2263 of file brush.h.

bool triangle_reversed ( std::size_t  x,
std::size_t  y,
std::size_t  z 
) [inline]

Definition at line 2258 of file brush.h.

Referenced by FaceInstance::update_move_planepts_vertex2().

template<typename Element >
bool triangles_same_winding ( const BasicVector3< Element > &  x1,
const BasicVector3< Element >  y1,
const BasicVector3< Element > &  z1,
const BasicVector3< Element > &  x2,
const BasicVector3< Element >  y2,
const BasicVector3< Element > &  z2 
) [inline]
float vector3_max_component ( const Vector3 vec3  )  [inline]

Definition at line 134 of file brush.h.

Referenced by edge_snap().

void VertexSelection_erase ( VertexSelection self,
std::size_t  value 
) [inline]

Definition at line 2250 of file brush.h.

References i, and VertexSelection_find().

Referenced by FaceInstance::select_edge(), and FaceInstance::select_vertex().

VertexSelection::const_iterator VertexSelection_find ( const VertexSelection self,
std::size_t  value 
) [inline]

Definition at line 2236 of file brush.h.

VertexSelection::iterator VertexSelection_find ( VertexSelection self,
std::size_t  value 
) [inline]
VertexSelection::iterator VertexSelection_insert ( VertexSelection self,
std::size_t  value 
) [inline]

Definition at line 2241 of file brush.h.

References i, and VertexSelection_find().

Referenced by FaceInstance::select_edge(), and FaceInstance::select_vertex().

void Winding_Draw ( const Winding &  winding,
const Vector3 normal,
RenderStateFlags  state 
) [inline]

Brush rendering.

Definition at line 94 of file brush.h.

References GLsizei, and i.

Referenced by BrushClipPlane::render(), and Face::render().

void Winding_DrawWireframe ( const Winding &  winding  )  [inline]

Definition at line 85 of file brush.h.

References GLsizei.

Referenced by BrushClipPlane::render().

void Winding_testSelect ( Winding &  winding,
SelectionTest test,
SelectionIntersection best 
) [inline]

Definition at line 704 of file brush.h.

References SelectionTest::TestPolygon().

Referenced by Face::testSelect().


Variable Documentation

const unsigned int BRUSH_DETAIL_FLAG = 27

Definition at line 68 of file brush.h.

const unsigned int BRUSH_DETAIL_MASK = 0x08000000

Definition at line 69 of file brush.h.

Referenced by Face::isDetail(), and Face::setDetail().

const unsigned int BRUSH_WATER_MASK = 0x0020

Definition at line 70 of file brush.h.

const double GRID_MIN = 0.125

Definition at line 710 of file brush.h.


Generated by  doxygen 1.6.2