#include "winding.h"
#include "brush_primit.h"
-#define CONTENTS_DETAIL 0x8000000
-
+const unsigned int BRUSH_DETAIL_FLAG = 27;
+const unsigned int BRUSH_DETAIL_MASK = (1 << BRUSH_DETAIL_FLAG);
enum EBrushType
{
#endif
}
-const Colour4b colour_vertex(0, 255, 0, 255);
-
#include "shaderlib.h"
bool m_specified;
};
-inline unsigned int ContentFlags_assignable(unsigned int contentFlags)
-{
- return contentFlags & ~CONTENTS_DETAIL;
-}
-
-inline ContentsFlagsValue ContentsFlagsValue_maskDetail(const ContentsFlagsValue& other)
+inline void ContentsFlagsValue_assignMasked(ContentsFlagsValue& flags, const ContentsFlagsValue& other)
{
- return ContentsFlagsValue(other.m_surfaceFlags, ContentFlags_assignable(other.m_contentFlags), other.m_value, other.m_specified);
+ bool detail = bitfield_enabled(flags.m_contentFlags, BRUSH_DETAIL_MASK);
+ flags = other;
+ if(detail)
+ {
+ flags.m_contentFlags = bitfield_enable(flags.m_contentFlags, BRUSH_DETAIL_MASK);
+ }
+ else
+ {
+ flags.m_contentFlags = bitfield_disable(flags.m_contentFlags, BRUSH_DETAIL_MASK);
+ }
}
void setFlags(const ContentsFlagsValue& flags)
{
ASSERT_MESSAGE(m_realised, "FaceShader::setFlags: flags not valid when unrealised");
- m_flags = ContentsFlagsValue_maskDetail(flags);
+ ContentsFlagsValue_assignMasked(m_flags, flags);
}
Shader* state() const
};
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();
Brush_textureChanged();
m_observer->shaderChanged();
updateFiltered();
+ planeChanged();
SceneChangeNotify();
}
bool isDetail() const
{
- return (m_shader.m_flags.m_contentFlags & CONTENTS_DETAIL) != 0;
+ return (m_shader.m_flags.m_contentFlags & BRUSH_DETAIL_MASK) != 0;
}
void setDetail(bool detail)
{
undoSave();
if(detail && !isDetail())
{
- m_shader.m_flags.m_contentFlags |= CONTENTS_DETAIL;
+ m_shader.m_flags.m_contentFlags |= BRUSH_DETAIL_MASK;
}
else if(!detail && isDetail())
{
- m_shader.m_flags.m_contentFlags &= ~CONTENTS_DETAIL;
+ m_shader.m_flags.m_contentFlags &= ~BRUSH_DETAIL_MASK;
}
m_observer->shaderChanged();
}
m_render_faces(m_faceCentroidPoints, GL_POINTS),
m_render_vertices(m_uniqueVertexPoints, GL_POINTS),
m_render_edges(m_uniqueEdgePoints, GL_POINTS),
- m_planeChanged(false),
- m_transformChanged(false),
m_evaluateTransform(evaluateTransform),
- m_boundsChanged(boundsChanged)
+ m_boundsChanged(boundsChanged),
+ m_planeChanged(false),
+ m_transformChanged(false)
{
planeChanged();
}
m_render_faces(m_faceCentroidPoints, GL_POINTS),
m_render_vertices(m_uniqueVertexPoints, GL_POINTS),
m_render_edges(m_uniqueEdgePoints, GL_POINTS),
- m_planeChanged(false),
- m_transformChanged(false),
m_evaluateTransform(evaluateTransform),
- m_boundsChanged(boundsChanged)
+ m_boundsChanged(boundsChanged),
+ m_planeChanged(false),
+ m_transformChanged(false)
{
copy(other);
}
TransformNode(other),
Bounded(other),
Cullable(other),
+ Snappable(),
Undoable(other),
FaceObserver(other),
Filterable(other),
void shaderChanged()
{
updateFiltered();
+ planeChanged();
}
void evaluateBRep() const
m_face->getWinding()[2].vertex
),
"update_move_planepts_vertex2: error"
- )
+ );
m_face->m_move_planepts[0] = m_face->getWinding()[opposite].vertex;
m_face->m_move_planepts[1] = m_face->getWinding()[index].vertex;