Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes
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 RenderLine (QGLWidget *gla, Point3f AA, Point3f BB)
 RenderLine draws a line from two points.
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 }
 Render a text label near the endpoint (if it exists). More...

Private Member Functions

vcg::Point2f DevicePixelConvert (const Point3f)

Private Attributes

RubberPhase currentphase
Point3f end
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

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

Parameters:
textthe text to render.
glwthe GL widget.
Enumerator:
RUBBER_BEGIN 
RUBBER_DRAGGING 
RUBBER_DRAGGED 

Definition at line 138 of file rubberband.h.


Constructor & Destructor Documentation

The constructor.

Initialize the rubberband data.

Definition at line 38 of file rubberband.cpp.

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

The destructor.

Definition at line 66 of file rubberband.h.


Member Function Documentation

Definition at line 218 of file rubberband.cpp.

void Rubberband::Drag ( QPoint  cursor)

Set the current rubberband endpoint.

This function should be called after MouseMove events.

Parameters:
cursorthe cursor position.

Definition at line 183 of file rubberband.cpp.

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

Get the rubberband start and end points.

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

Definition at line 211 of file rubberband.cpp.

Return true if the rubberband has been drawn.

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

Definition at line 206 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:
cursorthe cursor position.

Definition at line 189 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:
glwthe GL widget.

Definition at line 44 of file rubberband.cpp.

void Rubberband::RenderLine ( QGLWidget *  gla,
Point3f  AA,
Point3f  BB 
)

RenderLine draws a line from two points.

Parameters:
glwthe GL widget.
AAthe start point.
BBthe end point.

Definition at line 142 of file rubberband.cpp.

Reset the rubberband.

Definition at line 197 of file rubberband.cpp.


Member Data Documentation

The color of the rubberband.

Definition at line 50 of file rubberband.h.

Definition at line 143 of file rubberband.h.

Definition at line 145 of file rubberband.h.

Definition at line 146 of file rubberband.h.

QPoint vcg::Rubberband::qt_cursor [private]

Definition at line 144 of file rubberband.h.

Definition at line 145 of file rubberband.h.


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


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:41:20