vcg::Rubberband Class Reference

The Rubberband class. More...

#include <rubberband.h>

List of all members.

Public Member Functions

void Drag (QPoint cursor)
 Set the current rubberband endpoint.
void GetPoints (Point3f &startpoint, Point3f &endpoint)
 Get the rubberband start and end points.
bool IsReady ()
 Return true if the rubberband has been drawn.
void Pin (QPoint cursor)
 Ask for picking.
void Render (QGLWidget *glw)
 Render the rubberband and do the picking.
void RenderLabel (QString text, QGLWidget *glw)
 Render a text label near the endpoint (if it exists).
void Reset ()
 Reset the rubberband.
 Rubberband (Color4b)
 The constructor.
virtual ~Rubberband ()

Public Attributes

Color4b color
 The color of the rubberband.

Private Types

enum  RubberPhase { RUBBER_BEGIN = 0, RUBBER_DRAGGING = 1, RUBBER_DRAGGED = 2 }

Private Member Functions

Point3f PixelConvert (const Point3f)

Private Attributes

RubberPhase currentphase
Point3f end
QFont font
bool have_to_pick
QPoint qt_cursor
Point3f start

Detailed Description

The Rubberband class.

This class is useful for interactively draw a straight line between 2 pickable points in a GL widget.

Definition at line 44 of file rubberband.h.


Member Enumeration Documentation

Enumerator:
RUBBER_BEGIN 
RUBBER_DRAGGING 
RUBBER_DRAGGED 

Definition at line 130 of file rubberband.h.


Constructor & Destructor Documentation

Rubberband::Rubberband ( Color4b  c  ) 

The constructor.

Initialize the rubberband data.

Definition at line 37 of file rubberband.cpp.

virtual vcg::Rubberband::~Rubberband (  )  [inline, virtual]

The destructor.

Definition at line 66 of file rubberband.h.


Member Function Documentation

void Rubberband::Drag ( QPoint  cursor  ) 

Set the current rubberband endpoint.

This function should be called after MouseMove events.

Parameters:
cursor the cursor position.

Definition at line 135 of file rubberband.cpp.

void Rubberband::GetPoints ( Point3f startpoint,
Point3f endpoint 
)

Get the rubberband start and end points.

Parameters:
startpoint is set to the rubberband start point.
endpoint is set to the rubberband end point.
Warning:
Don't call this function until IsReady() returns true!

Definition at line 163 of file rubberband.cpp.

bool Rubberband::IsReady (  ) 

Return true if the rubberband has been drawn.

Returns:
true if the line has been drawn, false otherwise.

Definition at line 158 of file rubberband.cpp.

void Rubberband::Pin ( QPoint  cursor  ) 

Ask for picking.

This function should be called after MouseRelease events.

The first time is called, if the picking is successful, sets the startpoint. The second time sets, if the picking is successful, the endpoint. After the second time this has no effect.

Parameters:
cursor the cursor position.

Definition at line 141 of file rubberband.cpp.

Point3f Rubberband::PixelConvert ( const Point3f  p  )  [private]

Definition at line 229 of file rubberband.cpp.

void Rubberband::Render ( QGLWidget *  glw  ) 

Render the rubberband and do the picking.

Is important that this function is called in order to apply the Drag and Pin commands.

Parameters:
glw the GL widget.

Definition at line 45 of file rubberband.cpp.

void Rubberband::RenderLabel ( QString  text,
QGLWidget *  glw 
)

Render a text label near the endpoint (if it exists).

Parameters:
text the text to render.
glw the GL widget.

Definition at line 170 of file rubberband.cpp.

void Rubberband::Reset (  ) 

Reset the rubberband.

Definition at line 149 of file rubberband.cpp.


Member Data Documentation

The color of the rubberband.

Definition at line 50 of file rubberband.h.

Definition at line 135 of file rubberband.h.

Definition at line 137 of file rubberband.h.

QFont vcg::Rubberband::font [private]

Definition at line 139 of file rubberband.h.

Definition at line 138 of file rubberband.h.

QPoint vcg::Rubberband::qt_cursor [private]

Definition at line 136 of file rubberband.h.

Definition at line 137 of file rubberband.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


vcglib
Author(s): Christian Bersch
autogenerated on Fri Jan 11 09:23:04 2013