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"
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< Face > | FaceSmartPointer |
typedef std::vector < FaceSmartPointer > | Faces |
typedef SelectionList < FaceInstance > | FaceInstancesList |
typedef std::list< std::size_t > | VertexSelection |
typedef const Plane3 * | PlanePointer |
typedef PlanePointer * | PlanesIterator |
typedef std::vector< FaceInstance > | FaceInstances |
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) |
BrushInstance * | Instance_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 |
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.
typedef std::vector<Brush*> brush_vector_t |
typedef std::size_t faceIndex_t |
typedef std::vector<FaceInstance> FaceInstances |
typedef SelectionList<FaceInstance> FaceInstancesList |
typedef std::vector<FaceSmartPointer> Faces |
typedef SmartPointer<Face> FaceSmartPointer |
typedef const Plane3* PlanePointer |
typedef DoubleVector3 PlanePoints[3] |
typedef PlanePointer* PlanesIterator |
typedef double(* QuantiseFunc)(double f) |
typedef std::list<std::size_t> VertexSelection |
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().
const Functor& Brush_forEachFace | ( | Brush & | brush, | |
const Functor & | functor | |||
) | [inline] |
Definition at line 3502 of file brush.h.
References Brush::forEachFace().
const Functor& Brush_forEachFace | ( | const Brush & | brush, | |
const Functor & | functor | |||
) | [inline] |
Definition at line 3495 of file brush.h.
References Brush::forEachFace().
const Functor& Brush_forEachFace | ( | BrushInstance & | brush, | |
const Functor & | functor | |||
) | [inline] |
Definition at line 3473 of file brush.h.
References BrushInstance::forEachFaceInstance().
const Functor& Brush_ForEachFaceInstance | ( | BrushInstance & | brush, | |
const Functor & | functor | |||
) | [inline] |
Definition at line 3524 of file brush.h.
References BrushInstance::forEachFaceInstance().
void Brush_textureChanged | ( | ) |
Referenced by Face::shaderChanged(), and Face::texdefChanged().
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] |
Definition at line 270 of file brush.h.
References ContentsFlagsValue::m_contentFlags, ContentsFlagsValue::m_contentFlagsDirty, ContentsFlagsValue::m_surfaceFlags, ContentsFlagsValue::m_surfaceFlagsDirty, ContentsFlagsValue::m_value, and ContentsFlagsValue::m_valueDirty.
Referenced by FaceShader::setFlags().
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] |
Definition at line 3388 of file brush.h.
Referenced by BrushVisibleWalker< Functor >::pre(), BrushVisibleSelectedVisitor< Functor >::visit(), and BrushSelectedVisitor< Functor >::visit().
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().
TextOuputStreamType& ostream_write | ( | TextOuputStreamType & | ostream, | |
const Matrix4 & | m | |||
) | [inline] |
Definition at line 583 of file brush.h.
References Plane3::dist(), Plane3::normal(), and plane3_transformed().
Definition at line 577 of file brush.h.
References Plane3::dist(), Plane3::normal(), and plane3_translated().
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] |
Definition at line 120 of file brush.h.
Referenced by FacePlane::copy(), FacePlane::SavedState::exportState(), Face::Face(), FacePlane::FacePlane(), Face::freezeTransform(), Face::revertTransform(), FacePlane::SavedState::SavedState(), and FaceInstance::snapComponents().
bool planepts_equal | ( | const PlanePoints | planepts, | |
const PlanePoints | other | |||
) | [inline] |
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] |
Definition at line 127 of file brush.h.
References vector3_snap().
Referenced by FaceInstance::update_move_planepts_edge(), Face::update_move_planepts_vertex(), and FaceInstance::update_move_planepts_vertex2().
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] |
Definition at line 187 of file brush.h.
References BasicVector3< Element >::x(), BasicVector3< Element >::y(), and BasicVector3< Element >::z().
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().
const Functor& Scene_forEachBrush | ( | scene::Graph & | graph, | |
const Functor & | functor | |||
) | [inline] |
Definition at line 3531 of file brush.h.
Referenced by Scene_ForEachBrush_ForEachFace(), and Scene_ForEachBrush_ForEachFaceInstance().
const Functor& Scene_ForEachBrush_ForEachFace | ( | scene::Graph & | graph, | |
const Functor & | functor | |||
) | [inline] |
Definition at line 3582 of file brush.h.
References Scene_forEachBrush().
const Functor& Scene_ForEachBrush_ForEachFaceInstance | ( | scene::Graph & | graph, | |
const Functor & | functor | |||
) | [inline] |
Definition at line 3590 of file brush.h.
References Scene_forEachBrush().
const Functor& Scene_forEachSelectedBrush | ( | const Functor & | functor | ) | [inline] |
Definition at line 3412 of file brush.h.
References SelectionSystem::foreachSelected(), and GlobalSelectionSystem().
Referenced by Scene_ForEachSelectedBrush_ForEachFace(), and Scene_ForEachSelectedBrush_ForEachFaceInstance().
const Functor& Scene_ForEachSelectedBrush_ForEachFace | ( | scene::Graph & | graph, | |
const Functor & | functor | |||
) | [inline] |
Definition at line 3597 of file brush.h.
References Scene_forEachSelectedBrush().
const Functor& Scene_ForEachSelectedBrush_ForEachFaceInstance | ( | scene::Graph & | graph, | |
const Functor & | functor | |||
) | [inline] |
Definition at line 3604 of file brush.h.
References Scene_forEachSelectedBrush().
const Functor& Scene_ForEachSelectedBrushFace | ( | const Functor & | functor | ) | [inline] |
Definition at line 3627 of file brush.h.
References FaceInstanceSet::foreach().
const Functor& Scene_forEachVisibleBrush | ( | scene::Graph & | graph, | |
const Functor & | functor | |||
) | [inline] |
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().
Vector3 triangle_cross | ( | const BasicVector3< Element > & | x, | |
const BasicVector3< Element > | y, | |||
const BasicVector3< Element > & | z | |||
) | [inline] |
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().
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] |
Definition at line 2269 of file brush.h.
References BasicVector3< Element >::dot(), and triangle_cross().
Referenced by FaceInstance::update_move_planepts_vertex2().
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] |
VertexSelection::iterator VertexSelection_find | ( | VertexSelection & | self, | |
std::size_t | value | |||
) | [inline] |
Definition at line 2231 of file brush.h.
Referenced by FaceInstance::selected_edge(), FaceInstance::selected_vertex(), VertexSelection_erase(), and VertexSelection_insert().
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.
Referenced by BrushClipPlane::render(), and Face::render().
void Winding_DrawWireframe | ( | const Winding & | winding | ) | [inline] |
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().
const unsigned int BRUSH_DETAIL_FLAG = 27 |
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 |