module::opengl::painters::texture_colored_selection_painter Class Reference

#include <texture_colored_selection_painter_gl.h>

Inheritance diagram for module::opengl::painters::texture_colored_selection_painter:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 texture_colored_selection_painter (k3d::iplugin_factory &Factory, k3d::idocument &Document, const k3d::color UnselectedMeshColor=k3d::color(0.0, 0.0, 0.0), const k3d::color SelectedMeshColor=k3d::color(1.0, 1.0, 1.0), const k3d::color SelectedComponentColor=k3d::color(1.0, 0.0, 0.0), const k3d::color SelectedParentMeshColor=k3d::color(0.5, 0.5, 0.5))
void paint_mesh (const k3d::mesh &Mesh, const k3d::gl::painter_render_state &RenderState, k3d::iproperty::changed_signal_t &ChangedSignal)
 Called to render a mesh for on-screen display.
void select_mesh (const k3d::mesh &Mesh, const k3d::gl::painter_render_state &RenderState, const k3d::gl::painter_selection_state &SelectionState, k3d::iproperty::changed_signal_t &ChangedSignal)
 Called to render a mesh for interactive selection.

Protected Member Functions

sigc::slot< void, k3d::ihint * > make_async_redraw_slot ()
 Returns a slot that will schedule an asynchronous screen update when called.
void async_redraw (k3d::ihint *)
 Schedules an asynchronous screen update.
virtual void on_paint_mesh (const k3d::mesh &Mesh, const k3d::gl::painter_render_state &RenderState, k3d::iproperty::changed_signal_t &ChangedSignal)
 Implement this in derived classes to draw mesh components.
virtual void on_select_mesh (const k3d::mesh &Mesh, const k3d::gl::painter_render_state &RenderState, const k3d::gl::painter_selection_state &SelectionState, k3d::iproperty::changed_signal_t &ChangedSignal)
 Implement this in derived classes to draw mesh components for selection.
void bind_unselected_mesh_color (bool ParentSelected)
 Return the unselected mesh color. May be different if the parent mesh is selected.
void bind_selected_mesh_color ()
 Return the selected mesh color.
void bind_selected_component_color ()
 Return the selected component color.

Private Types

typedef k3d::node base

Private Member Functions

void init_textures ()
void setup_texture (GLuint Name, GLubyte Texels[][3])
void set_uniform_color (const k3d::color &Color, GLubyte ColorArray[][3])
void make_unselected_texture (k3d::ihint *Hint)
void make_parent_selected_texture (k3d::ihint *Hint)
void make_selected_texture (k3d::ihint *Hint)
void make_component_texture (k3d::ihint *Hint)
 k3d_data (bool, immutable_name, change_signal, with_undo, local_storage, no_constraint, writable_property, with_serialization) m_enabled
 Used to enable/disable the painter.
 k3d_data (k3d::color, immutable_name, change_signal, with_undo, local_storage, no_constraint, writable_property, with_serialization) m_unselected_mesh_color
 Color used when the mesh is not selected.
 k3d_data (k3d::color, immutable_name, change_signal, with_undo, local_storage, no_constraint, writable_property, with_serialization) m_parent_selected_mesh_color
 Color used when the mesh is not selected, but its parent is.
 k3d_data (k3d::color, immutable_name, change_signal, with_undo, local_storage, no_constraint, writable_property, with_serialization) m_selected_mesh_color
 Color used for unselected components on selected mesh.
 k3d_data (k3d::color, immutable_name, change_signal, with_undo, local_storage, no_constraint, writable_property, with_serialization) m_selected_component_color
 Color used for selected components.

Private Attributes

GLubyte m_unselected_texels [TEX_SIZE][3]
 1D Texture arrays for each selection type
GLubyte m_parent_selected_texels [TEX_SIZE][3]
GLubyte m_selected_texels [TEX_SIZE][3]
GLubyte m_component_texels [TEX_SIZE][3]
GLuint m_unselected_name
GLuint m_parent_selected_name
GLuint m_selected_name
GLuint m_component_name

Static Private Attributes

static const k3d::uint_t TEX_SIZE = 256

Member Typedef Documentation


Constructor & Destructor Documentation

module::opengl::painters::texture_colored_selection_painter::texture_colored_selection_painter ( k3d::iplugin_factory Factory,
k3d::idocument Document,
const k3d::color  UnselectedMeshColor = k3d::color(0.0, 0.0, 0.0),
const k3d::color  SelectedMeshColor = k3d::color(1.0, 1.0, 1.0),
const k3d::color  SelectedComponentColor = k3d::color(1.0, 0.0, 0.0),
const k3d::color  SelectedParentMeshColor = k3d::color(0.5, 0.5, 0.5) 
) [inline]

Member Function Documentation

void module::opengl::painters::texture_colored_selection_painter::async_redraw ( k3d::ihint  )  [inline, protected]
void module::opengl::painters::texture_colored_selection_painter::bind_selected_component_color (  )  [inline, protected]

Return the selected component color.

References m_component_name, and return_if_fail.

Referenced by paint_mesh().

void module::opengl::painters::texture_colored_selection_painter::bind_selected_mesh_color (  )  [inline, protected]

Return the selected mesh color.

References m_selected_name, and return_if_fail.

Referenced by paint_mesh().

void module::opengl::painters::texture_colored_selection_painter::bind_unselected_mesh_color ( bool  ParentSelected  )  [inline, protected]

Return the unselected mesh color. May be different if the parent mesh is selected.

References m_parent_selected_name, m_unselected_name, and return_if_fail.

Referenced by paint_mesh().

void module::opengl::painters::texture_colored_selection_painter::init_textures (  )  [inline, private]
module::opengl::painters::texture_colored_selection_painter::k3d_data ( k3d::color  ,
immutable_name  ,
change_signal  ,
with_undo  ,
local_storage  ,
no_constraint  ,
writable_property  ,
with_serialization   
) [private]

Color used for selected components.

module::opengl::painters::texture_colored_selection_painter::k3d_data ( k3d::color  ,
immutable_name  ,
change_signal  ,
with_undo  ,
local_storage  ,
no_constraint  ,
writable_property  ,
with_serialization   
) [private]

Color used for unselected components on selected mesh.

module::opengl::painters::texture_colored_selection_painter::k3d_data ( k3d::color  ,
immutable_name  ,
change_signal  ,
with_undo  ,
local_storage  ,
no_constraint  ,
writable_property  ,
with_serialization   
) [private]

Color used when the mesh is not selected, but its parent is.

module::opengl::painters::texture_colored_selection_painter::k3d_data ( k3d::color  ,
immutable_name  ,
change_signal  ,
with_undo  ,
local_storage  ,
no_constraint  ,
writable_property  ,
with_serialization   
) [private]

Color used when the mesh is not selected.

module::opengl::painters::texture_colored_selection_painter::k3d_data ( bool  ,
immutable_name  ,
change_signal  ,
with_undo  ,
local_storage  ,
no_constraint  ,
writable_property  ,
with_serialization   
) [private]

Used to enable/disable the painter.

sigc::slot<void, k3d::ihint*> module::opengl::painters::texture_colored_selection_painter::make_async_redraw_slot (  )  [inline, protected]
void module::opengl::painters::texture_colored_selection_painter::make_component_texture ( k3d::ihint Hint  )  [inline, private]
void module::opengl::painters::texture_colored_selection_painter::make_parent_selected_texture ( k3d::ihint Hint  )  [inline, private]
void module::opengl::painters::texture_colored_selection_painter::make_selected_texture ( k3d::ihint Hint  )  [inline, private]
void module::opengl::painters::texture_colored_selection_painter::make_unselected_texture ( k3d::ihint Hint  )  [inline, private]
virtual void module::opengl::painters::texture_colored_selection_painter::on_paint_mesh ( const k3d::mesh Mesh,
const k3d::gl::painter_render_state RenderState,
k3d::iproperty::changed_signal_t ChangedSignal 
) [inline, protected, virtual]

Implement this in derived classes to draw mesh components.

Reimplemented in module::opengl::painters::sds_edge_painter, module::opengl::painters::sds_face_painter, and module::opengl::painters::sds_point_painter.

Referenced by paint_mesh().

virtual void module::opengl::painters::texture_colored_selection_painter::on_select_mesh ( const k3d::mesh Mesh,
const k3d::gl::painter_render_state RenderState,
const k3d::gl::painter_selection_state SelectionState,
k3d::iproperty::changed_signal_t ChangedSignal 
) [inline, protected, virtual]

Implement this in derived classes to draw mesh components for selection.

Reimplemented in module::opengl::painters::sds_edge_painter, module::opengl::painters::sds_face_painter, and module::opengl::painters::sds_point_painter.

Referenced by select_mesh().

void module::opengl::painters::texture_colored_selection_painter::paint_mesh ( const k3d::mesh Mesh,
const k3d::gl::painter_render_state RenderState,
k3d::iproperty::changed_signal_t ChangedSignal 
) [inline, virtual]

Called to render a mesh for on-screen display.

The ChangedSignal argument is a signal that is emitted when the supplied mesh changes. It could be used by painters caching data to notify them when the cache needs updating

Implements k3d::gl::imesh_painter.

References mesh::attributes, bind_selected_component_color(), bind_selected_mesh_color(), bind_unselected_mesh_color(), init_textures(), m_component_name, m_parent_selected_name, m_selected_name, m_unselected_name, k3d::gl::render_state::node_selection, on_paint_mesh(), k3d::gl::render_state::parent_selection, and k3d::gl::painter_render_state::show_component_selection.

void module::opengl::painters::texture_colored_selection_painter::select_mesh ( const k3d::mesh Mesh,
const k3d::gl::painter_render_state RenderState,
const k3d::gl::painter_selection_state SelectionState,
k3d::iproperty::changed_signal_t ChangedSignal 
) [inline, virtual]

Called to render a mesh for interactive selection.

Implements k3d::gl::imesh_painter.

References on_select_mesh().

void module::opengl::painters::texture_colored_selection_painter::set_uniform_color ( const k3d::color Color,
GLubyte  ColorArray[][3] 
) [inline, private]
void module::opengl::painters::texture_colored_selection_painter::setup_texture ( GLuint  Name,
GLubyte  Texels[][3] 
) [inline, private]

Member Data Documentation

Referenced by make_component_texture().

Referenced by make_selected_texture().

1D Texture arrays for each selection type

Referenced by make_unselected_texture().


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

Generated on Mon Mar 21 07:44:10 2011 for K-3D by doxygen 1.6.3