Blender V2.61 - r43446
Public Member Functions | Public Attributes

BSP_MVertex Class Reference

#include <BSP_MeshPrimitives.h>

List of all members.

Public Member Functions

 BSP_MVertex ()
 BSP_MVertex (const MT_Point3 &pos)
BSP_MVertexoperator= (const BSP_MVertex &other)
bool RemoveEdge (BSP_EdgeInd e)
void AddEdge (BSP_EdgeInd e)
void SwapEdge (BSP_EdgeInd e_old, BSP_EdgeInd e_new)
int OpenTag () const
void SetOpenTag (int tag)
bool SelectTag () const
void SetSelectTag (bool tag)

Public Attributes

MT_Point3 m_pos
BSP_EdgeList m_edges
bool m_select_tag
int m_open_tag

Detailed Description

linkage

The mesh is linked in a similar way to the decimation mesh, although the primitives are a little more general and not limited to manifold meshes. Vertices -> (2+)Edges Edges -> (1+)Polygons Edges -> (2)Vertices. Polygons -> (3+)Vertices.

this structure allows for arbitrary polygons (assumed to be convex). Edges can point to more than 2 polygons (non-manifold)

We also define 2 different link types between edges and their neighbouring polygons. A weak link and a strong link. A weak link means the polygon is in a different mesh fragment to the other polygon. A strong link means the polygon is in the same fragment. This is not entirely consistent as it means edges have to be associated with fragments, in reality only polygons will be - edges and vertices will live in global pools. I guess we should mark edges as being on plane boundaries. This leaves a problem with non-manifold edges because for example 3 of 4 possible edges could lie in 1 fragment and the remaining edge lie in another, there is no way to work out then from one polygon which neighbouring polygons are in the same/different mesh fragment.

By definition an edge will only ever lie on 1 hyperplane. We can then just tag neighbouring polygons with one of 3 tags to group them.

Definition at line 95 of file BSP_MeshPrimitives.h.


Constructor & Destructor Documentation

BSP_MVertex::BSP_MVertex ( )

Definition at line 42 of file BSP_MeshPrimitives.cpp.

BSP_MVertex::BSP_MVertex ( const MT_Point3 pos)

Definition at line 51 of file BSP_MeshPrimitives.cpp.


Member Function Documentation

void BSP_MVertex::AddEdge ( BSP_EdgeInd  e)

Definition at line 80 of file BSP_MeshPrimitives.cpp.

References m_edges.

int BSP_MVertex::OpenTag ( ) const

These operations are ONLY valid when the vertex has some edges associated with it. This is left to the user to guarentee. Also note that these tag's are not guarenteed to survive after a call to RemoveEdge(), because we use edges for the open tag.

Definition at line 120 of file BSP_MeshPrimitives.cpp.

References m_open_tag.

BSP_MVertex& BSP_MVertex::operator= ( const BSP_MVertex other) [inline]

Definition at line 120 of file BSP_MeshPrimitives.h.

References m_edges, m_open_tag, m_pos, and m_select_tag.

bool BSP_MVertex::RemoveEdge ( BSP_EdgeInd  e)

Definition at line 63 of file BSP_MeshPrimitives.cpp.

References credits_svn_gen::e, find(), and m_edges.

bool BSP_MVertex::SelectTag ( ) const

Definition at line 105 of file BSP_MeshPrimitives.cpp.

References m_select_tag.

void BSP_MVertex::SetOpenTag ( int  tag)

Definition at line 127 of file BSP_MeshPrimitives.cpp.

References m_open_tag.

void BSP_MVertex::SetSelectTag ( bool  tag)

Definition at line 112 of file BSP_MeshPrimitives.cpp.

References m_select_tag.

void BSP_MVertex::SwapEdge ( BSP_EdgeInd  e_old,
BSP_EdgeInd  e_new 
)

Definition at line 88 of file BSP_MeshPrimitives.cpp.

References credits_svn_gen::e, e_mesh_error, find(), m_edges, and MT_assert.


Member Data Documentation

Definition at line 110 of file BSP_MeshPrimitives.h.

Referenced by OpenTag(), operator=(), and SetOpenTag().

Definition at line 97 of file BSP_MeshPrimitives.h.

Referenced by BSP_CSGMesh_VertexIt_Fill(), and operator=().

TODO Is this boolean necessary or can we nick a few bits of m_edges[0] for example? The only problem with this is that if the vertex is degenerate then m_edges[0] may not exist. If the algorithm guarentees that this is not the case then it should be changed.

Definition at line 109 of file BSP_MeshPrimitives.h.

Referenced by operator=(), SelectTag(), and SetSelectTag().


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