Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
igl::opengl2::RotateWidget Class Reference

#include <src/libigl/igl/opengl2/RotateWidget.h>

Public Types

enum  DownType {
  DOWN_TYPE_X = 0 , DOWN_TYPE_Y = 1 , DOWN_TYPE_Z = 2 , DOWN_TYPE_OUTLINE = 3 ,
  DOWN_TYPE_TRACKBALL = 4 , DOWN_TYPE_NONE = 5 , NUM_DOWN_TYPES = 6
}
 

Public Member Functions

 RotateWidget ()
 
Eigen::Vector3d unproject_onto (const int x, const int y) const
 
bool intersect (const int x, const int y, Eigen::Vector3d &hit) const
 
double unprojected_inner_radius () const
 
bool down (const int x, const int y)
 
bool drag (const int x, const int y)
 
bool up (const int x, const int y)
 
bool is_down () const
 
void draw () const
 
void draw_guide () const
 

Static Public Member Functions

static Eigen::Quaterniond axis_q (const int a)
 
static Eigen::Vector3d view_direction (const int x, const int y)
 
static Eigen::Vector3d view_direction (const Eigen::Vector3d &pos)
 

Public Attributes

Eigen::Vector3d pos
 
Eigen::Quaterniond rot
 
Eigen::Quaterniond down_rot
 
Eigen::Vector2d down_xy
 
Eigen::Vector2d drag_xy
 
Eigen::Vector2d down_dir
 
Eigen::Vector3d udown
 
Eigen::Vector3d udrag
 
double outer_radius_on_screen
 
double outer_over_inner
 
bool m_is_enabled
 
enum igl::opengl2::RotateWidget::DownType down_type
 
enum igl::opengl2::RotateWidget::DownType selected_type
 

Static Private Member Functions

static void glColor4fv (const bool a, const Eigen::Vector4f &A)
 

Detailed Description

Member Enumeration Documentation

◆ DownType

Enumerator
DOWN_TYPE_X 
DOWN_TYPE_Y 
DOWN_TYPE_Z 
DOWN_TYPE_OUTLINE 
DOWN_TYPE_TRACKBALL 
DOWN_TYPE_NONE 
NUM_DOWN_TYPES 
37 {
38 DOWN_TYPE_X = 0,
39 DOWN_TYPE_Y = 1,
40 DOWN_TYPE_Z = 2,
enum igl::opengl2::RotateWidget::DownType selected_type
@ NUM_DOWN_TYPES
Definition RotateWidget.h:44
@ DOWN_TYPE_X
Definition RotateWidget.h:38
@ DOWN_TYPE_OUTLINE
Definition RotateWidget.h:41
@ DOWN_TYPE_NONE
Definition RotateWidget.h:43
@ DOWN_TYPE_TRACKBALL
Definition RotateWidget.h:42
@ DOWN_TYPE_Y
Definition RotateWidget.h:39
@ DOWN_TYPE_Z
Definition RotateWidget.h:40
enum igl::opengl2::RotateWidget::DownType down_type

Constructor & Destructor Documentation

◆ RotateWidget()

igl::opengl2::RotateWidget::RotateWidget ( )
inline
136 :
137 pos(0,0,0),
139 down_rot(rot),
140 down_xy(-1,-1),drag_xy(-1,-1),
142 outer_over_inner(1.13684210526),
143 m_is_enabled(true),
146{
147}
Eigen::Vector3d pos
Definition RotateWidget.h:29
Eigen::Quaterniond down_rot
Definition RotateWidget.h:30
Eigen::Vector2d down_xy
Definition RotateWidget.h:31
Eigen::Vector2d drag_xy
Definition RotateWidget.h:31
double outer_radius_on_screen
Definition RotateWidget.h:33
Eigen::Quaterniond rot
Definition RotateWidget.h:30
bool m_is_enabled
Definition RotateWidget.h:35
double outer_over_inner
Definition RotateWidget.h:34
static EIGEN_DEVICE_FUNC Quaternion< Scalar > Identity()
Definition Quaternion.h:111

Member Function Documentation

◆ axis_q()

Eigen::Quaterniond igl::opengl2::RotateWidget::axis_q ( const int  a)
inlinestatic
111{
112 assert(a<3 && a>=0);
113 const Eigen::Quaterniond axes[3] = {
114 Eigen::Quaterniond(Eigen::AngleAxisd(igl::PI*0.5,Eigen::Vector3d(0,1,0))),
115 Eigen::Quaterniond(Eigen::AngleAxisd(igl::PI*0.5,Eigen::Vector3d(1,0,0))),
117 return axes[a];
118}
The quaternion class used to represent 3D orientations and rotations.
Definition Quaternion.h:233
Represents a 3D rotation as a rotation angle around an arbitrary 3D axis.
Definition AngleAxis.h:50
Quaternion< double > Quaterniond
Definition Quaternion.h:310
const double PI
Definition PI.h:16

References Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::Identity(), and igl::PI.

+ Here is the call graph for this function:

◆ down()

bool igl::opengl2::RotateWidget::down ( const int  x,
const int  y 
)
inline
205{
206 using namespace Eigen;
207 using namespace std;
208 if(!m_is_enabled)
209 {
210 return false;
211 }
214 down_xy = Vector2d(x,y);
216 down_rot = rot;
217 Vector3d ppos = project(pos);
218 const double r = (ppos.head(2) - down_xy).norm();
219 const double thresh = 3;
220 if(fabs(r - outer_radius_on_screen)<thresh)
221 {
222 udown = unproject_onto(x,y);
223 udrag = udown;
226 // project mouse to same depth as pos
227 return true;
228 }else if(r < outer_radius_on_screen/outer_over_inner+thresh*0.5)
229 {
230 Vector3d hit;
231 const bool is_hit = intersect(down_xy(0),down_xy(1),hit);
232 if(!is_hit)
233 {
234 //cout<<"~~~!is_hit"<<endl;
235 }
236 auto on_meridian = [&](
237 const Vector3d & hit,
238 const Quaterniond & rot,
239 const Quaterniond & m,
240 Vector3d & pl_hit) -> bool
241 {
242 // project onto rotate plane
243 pl_hit = hit-pos;
244 pl_hit = (m.conjugate()*rot.conjugate()*pl_hit).eval();
245 pl_hit(2) = 0;
246 pl_hit = (rot*m*pl_hit).eval();
247 pl_hit.normalize();
248 pl_hit *= unprojected_inner_radius();
249 pl_hit += pos;
250 return (project(pl_hit).head(2)-project(hit).head(2)).norm()<2*thresh;
251 };
252 udown = (hit-pos).normalized()/outer_radius_on_screen;
253 udrag = udown;
254 for(int a = 0;a<3;a++)
255 {
256 Vector3d pl_hit;
257 if(on_meridian(hit,rot,Quaterniond(axis_q(a)),pl_hit))
258 {
259 udown = (pl_hit-pos).normalized()/outer_radius_on_screen;
260 udrag = udown;
263 {
264 Vector3d dir3 = axis_q(a).conjugate()*down_rot.conjugate()*(hit-pos);
265 dir3 = AngleAxisd(-PI*0.5,Vector3d(0,0,1))*dir3;
266 dir3 = (rot*axis_q(a)*dir3).eval();
267 down_dir = (project((hit+dir3).eval())-project(hit)).head(2);
268 down_dir.normalize();
271 //down_dir(1) *= -1;
272 }
273 return true;
274 }
275 }
276 //assert(is_hit);
279 return true;
280 }else
281 {
282 return false;
283 }
284}
EIGEN_DEVICE_FUNC SegmentReturnType head(Index n)
This is the const version of head(Index).
Definition BlockMethods.h:919
Eigen::Vector3d unproject_onto(const int x, const int y) const
Definition RotateWidget.h:149
Eigen::Vector3d udown
Definition RotateWidget.h:32
double unprojected_inner_radius() const
Definition RotateWidget.h:194
static Eigen::Quaterniond axis_q(const int a)
Definition RotateWidget.h:110
Eigen::Vector3d udrag
Definition RotateWidget.h:32
DownType
Definition RotateWidget.h:37
bool intersect(const int x, const int y, Eigen::Vector3d &hit) const
Definition RotateWidget.h:175
Eigen::Vector2d down_dir
Definition RotateWidget.h:31
EIGEN_DEVICE_FUNC Quaternion< Scalar > conjugate() const
Definition Quaternion.h:695
Definition LDLT.h:16
IGL_INLINE int project(const double objX, const double objY, const double objZ, double *winX, double *winY, double *winZ)
Definition project.cpp:14
STL namespace.

References head(), igl::intersect(), igl::PI, and igl::opengl2::project().

+ Here is the call graph for this function:

◆ drag()

bool igl::opengl2::RotateWidget::drag ( const int  x,
const int  y 
)
inline
287{
288 using namespace std;
289 using namespace Eigen;
290 if(!m_is_enabled)
291 {
292 return false;
293 }
294 drag_xy = Vector2d(x,y);
295 switch(down_type)
296 {
297 case DOWN_TYPE_NONE:
298 return false;
299 default:
300 {
302 const double dtheta = -(drag_xy - down_xy).dot(down_dir)/
304 Quaterniond dq(AngleAxisd(dtheta,down_rot*q*Vector3d(0,0,1)));
305 rot = dq * down_rot;
306 udrag = dq * udown;
307 return true;
308 }
310 {
311 Vector3d ppos = project(pos);
312 // project mouse to same depth as pos
313 udrag = unproject_onto(x,y);
314 const Vector2d A = down_xy - ppos.head(2);
315 const Vector2d B = drag_xy - ppos.head(2);
316 const double dtheta = atan2(A(0)*B(1)-A(1)*B(0),A(0)*B(0)+A(1)*B(1));
317 Vector3d n = view_direction(pos).normalized();
318 Quaterniond dq(AngleAxisd(dtheta,-n));
319 //Vector3d n = udrag.cross(udown).normalized();
320 //Quaterniond dq(AngleAxisd(fabs(dtheta),-n));
321 rot = dq * down_rot;
322 }
323 return true;
325 {
326 Vector3d ppos = project(pos);
327 const double r = (double)outer_radius_on_screen/outer_over_inner*2.0;
328 //const int h = w;
329 Vector4i vp;
330 glGetIntegerv(GL_VIEWPORT,vp.data());
331 const int h = vp(3);
332 Quaterniond dq;
333 trackball(
334 r,r,
335 1,
336 Quaterniond::Identity(),
337 double( down_xy(0)-ppos(0) )+r/2.,
338 double((h-down_xy(1))-(h-ppos(1)))+r/2.,
339 double( x-ppos(0) )+r/2.,
340 double( (h-y)-(h-ppos(1)))+r/2.,
341 dq);
342 // We've computed change in rotation according to this view:
343 // R = mv * r, R' = rot * (mv * r)
344 // But we only want new value for r:
345 // R' = mv * r'
346 // mv * r' = rot * (mv * r)
347 // r' = mv* * rot * mv * r
348 Matrix4d mv;
349 glGetDoublev(GL_MODELVIEW_MATRIX,mv.data());
350 Quaterniond scene_rot;
351 // Convert modelview matrix to quaternion
352 mat4_to_quat(mv.data(),scene_rot.coeffs().data());
353 scene_rot.normalize();
354 rot = scene_rot.conjugate() * dq * scene_rot * down_rot;
355 }
356 return true;
357 }
358}
static Eigen::Vector3d view_direction(const int x, const int y)
Definition RotateWidget.h:120
EIGEN_DEVICE_FUNC Coefficients & coeffs()
Definition Quaternion.h:284
EIGEN_DEVICE_FUNC void normalize()
Definition Quaternion.h:129
Eigen::Matrix< double, 4, 4, Eigen::DontAlign > Matrix4d
Definition Point.hpp:73
IGL_INLINE double dot(const double *a, const double *b)
Definition dot.cpp:11
IGL_INLINE void trackball(const double w, const double h, const Q_type speed_factor, const double down_mouse_x, const double down_mouse_y, const double mouse_x, const double mouse_y, Q_type *quat)
Definition trackball.cpp:43
IGL_INLINE void mat4_to_quat(const Q_type *m, Q_type *q)
Definition mat_to_quat.cpp:33

References Eigen::Quaternion< _Scalar, _Options >::coeffs(), Eigen::QuaternionBase< Derived >::conjugate(), igl::dot(), igl::mat4_to_quat(), Eigen::QuaternionBase< Derived >::normalize(), igl::PI, igl::opengl2::project(), and igl::trackball().

+ Here is the call graph for this function:

◆ draw()

void igl::opengl2::RotateWidget::draw ( ) const
inline
373{
374 using namespace Eigen;
375 using namespace std;
376 glPushAttrib(GL_ENABLE_BIT | GL_LIGHTING_BIT | GL_DEPTH_BUFFER_BIT | GL_LINE_BIT);
377 glDisable(GL_CLIP_PLANE0);
378
379 glDisable(GL_LIGHTING);
380 glDisable(GL_DEPTH_TEST);
381 glLineWidth(2.0);
382
383 double r = unprojected_inner_radius();
384 Vector3d view = view_direction(pos).normalized();
385
386 auto draw_circle = [&](const bool cull)
387 {
388 Vector3d view = view_direction(pos).normalized();
389 glBegin(GL_LINES);
390 const double th_step = (2.0*igl::PI/100.0);
391 for(double th = 0;th<2.0*igl::PI+th_step;th+=th_step)
392 {
393 Vector3d a(cos(th),sin(th),0.0);
394 Vector3d b(cos(th+th_step),sin(th+th_step),0.0);
395 if(!cull || (0.5*(a+b)).dot(view)<FLOAT_EPS)
396 {
397 glVertex3dv(a.data());
398 glVertex3dv(b.data());
399 }
400 }
401 glEnd();
402 };
403
404
405 glPushMatrix();
406 glTranslated(pos(0),pos(1),pos(2));
407
408 glScaled(r,r,r);
409 // Draw outlines
410 {
411 glPushMatrix();
413 Quaterniond q;
414 q.setFromTwoVectors(Vector3d(0,0,1),view);
415 glMultMatrixd(Affine3d(q).matrix().data());
416 draw_circle(false);
419 {
421 }else
422 {
424 }
425 draw_circle(false);
426 glPopMatrix();
427 }
428 // Draw quartiles
429 {
430 glPushMatrix();
431 glMultMatrixd(Affine3d(rot).matrix().data());
433 {
435 }else
436 {
438 }
439 draw_circle(true);
441 {
443 }else
444 {
446 }
447 glRotated(90.0,1.0,0.0,0.0);
448 draw_circle(true);
450 {
452 }else
453 {
455 }
456 glRotated(90.0,0.0,1.0,0.0);
457 draw_circle(true);
458 glPopMatrix();
459 }
461 draw_guide();
462 glPopMatrix();
463
464 glPopAttrib();
465};
EIGEN_DEVICE_FUNC const CosReturnType cos() const
Definition ArrayCwiseUnaryOps.h:202
EIGEN_DEVICE_FUNC const SinReturnType sin() const
Definition ArrayCwiseUnaryOps.h:220
static void glColor4fv(const bool a, const Eigen::Vector4f &A)
Definition RotateWidget.h:92
void draw_guide() const
Definition RotateWidget.h:467
EIGEN_DEVICE_FUNC Derived & setFromTwoVectors(const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b)
Definition Quaternion.h:582
Represents an homogeneous transformation in a N dimensional space.
Definition Transform.h:202
constexpr auto data(C &c) -> decltype(c.data())
Definition span.hpp:195
const Eigen::Vector4f MAYA_RED(234./255., 63./255., 52./255., 1.)
const Eigen::Vector4f MAYA_CYAN(131./255., 219./255., 252./255., 1.)
const Eigen::Vector4f MAYA_YELLOW(255./255., 247./255., 50./255., 1.)
const Eigen::Vector4f MAYA_BLUE(0./255., 73./255., 252./255., 1.)
const float FLOAT_EPS
Definition EPS.h:16
const Eigen::Vector4f MAYA_GREY(0.5, 0.5, 0.5, 1.0)
const Eigen::Vector4f MAYA_GREEN(128./255., 242./255., 0./255., 1.)

References cos(), igl::dot(), igl::FLOAT_EPS, igl::MAYA_BLUE(), igl::MAYA_CYAN(), igl::MAYA_GREEN(), igl::MAYA_GREY(), igl::MAYA_RED(), igl::MAYA_YELLOW(), igl::PI, Eigen::QuaternionBase< Derived >::setFromTwoVectors(), and sin().

+ Here is the call graph for this function:

◆ draw_guide()

void igl::opengl2::RotateWidget::draw_guide ( ) const
inline
468{
469 using namespace Eigen;
470 using namespace std;
471 glPushAttrib(
472 GL_DEPTH_BUFFER_BIT |
473 GL_ENABLE_BIT |
474 GL_POLYGON_BIT |
475 GL_POINT_BIT |
476 GL_TRANSFORM_BIT |
477 GL_STENCIL_BUFFER_BIT |
478 GL_LIGHTING_BIT);
479
480 // http://www.codeproject.com/Articles/23444/A-Simple-OpenGL-Stipple-Polygon-Example-EP_OpenGL_
481 const GLubyte halftone[] = {
482 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
483 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
484 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
485 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
486 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
487 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
488 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
489 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
490 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
491 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
492 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
493 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
494 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
495 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
496 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
497 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55};
498
499
500 switch(down_type)
501 {
502 case DOWN_TYPE_NONE:
504 goto finish;
507 break;
508 default:
509 break;
510 }
511 {
512 const Vector3d nudown(udown.normalized()),
513 nudrag(udrag.normalized());
514 glPushMatrix();
515 glDisable(GL_CULL_FACE);
516 glDisable(GL_POINT_SMOOTH);
517 glPointSize(5.);
518 glBegin(GL_POINTS);
519 glVertex3dv(nudown.data());
520 glVertex3d(0,0,0);
521 glVertex3dv(nudrag.data());
522 glEnd();
523 glBegin(GL_LINE_STRIP);
524 glVertex3dv(nudown.data());
525 glVertex3d(0,0,0);
526 glVertex3dv(nudrag.data());
527 glEnd();
528 glEnable(GL_POLYGON_STIPPLE);
529 glPolygonStipple(halftone);
530 glBegin(GL_TRIANGLE_FAN);
531 glVertex3d(0,0,0);
533 //dq.setFromTwoVectors(nudown,nudrag);
534 for(double t = 0;t<1;t+=0.1)
535 {
536 const Vector3d p = Quaterniond::Identity().slerp(t,dq) * nudown;
537 glVertex3dv(p.data());
538 }
539 glVertex3dv(nudrag.data());
540 glEnd();
541 glPopMatrix();
542 }
543finish:
544 glPopAttrib();
545}
unsigned char GLubyte
Definition glu-libtess.h:60
#define GL_TRIANGLE_FAN
Definition glu-libtess.h:77

References Eigen::QuaternionBase< Derived >::conjugate(), and GL_TRIANGLE_FAN.

+ Here is the call graph for this function:

◆ glColor4fv()

void igl::opengl2::RotateWidget::glColor4fv ( const bool  a,
const Eigen::Vector4f &  A 
)
inlinestaticprivate
95{
96 if(a)
97 {
98 ::glColor4fv(A.data());
99 }else
100 {
101 Eigen::Vector4f B;
102 const double f = 0.95; // desaturate by 95%
103 const double L = 0.3*A(0) + 0.6*A(1) + 0.1*A(2);
104 B.head(3) = A.head(3).array() + f*(L-A.head(3).array());
105 B(3) = A(3);
106 ::glColor4fv(B.data());
107 }
108}
#define L(s)
Definition I18N.hpp:18

References glColor4fv(), and L.

Referenced by glColor4fv().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ intersect()

bool igl::opengl2::RotateWidget::intersect ( const int  x,
const int  y,
Eigen::Vector3d &  hit 
) const
inline
179{
180 using namespace Eigen;
181 Vector3d view = view_direction(x,y);
182 const Vector3d ppos = project(pos);
183 Vector3d uxy = unproject(Vector3d(x,y,ppos(2)));
184 double t0,t1;
186 {
187 return false;
188 }
189 hit = uxy+t0*view;
190 return true;
191}
IGL_INLINE void unproject(const double winX, const double winY, const double winZ, double *objX, double *objY, double *objZ)
Definition unproject.cpp:16
IGL_INLINE int ray_sphere_intersect(const Eigen::PlainObjectBase< Derivedo > &o, const Eigen::PlainObjectBase< Derivedd > &d, const Eigen::PlainObjectBase< Derivedc > &c, r_type r, t_type &t0, t_type &t1)
Definition ray_sphere_intersect.cpp:16

References igl::opengl2::project(), igl::ray_sphere_intersect(), and igl::opengl2::unproject().

+ Here is the call graph for this function:

◆ is_down()

bool igl::opengl2::RotateWidget::is_down ( ) const
inline
368{
369 return down_type != DOWN_TYPE_NONE;
370}

Referenced by igl::opengl2::MouseController::is_widget_down().

+ Here is the caller graph for this function:

◆ unproject_onto()

Eigen::Vector3d igl::opengl2::RotateWidget::unproject_onto ( const int  x,
const int  y 
) const
inline
152{
153 using namespace Eigen;
154 // KNOWN BUG: This projects to same depths as pos. I think what we actually
155 // want is The intersection with the plane perpendicular to the view
156 // direction at pos. If the field of view angle is small then this difference
157 // is negligible.
158 //const Vector3d ppos = project(pos);
159 //const Vector3d uxy = unproject( Vector3d(x,y,ppos(2)));
160 // http://en.wikipedia.org/wiki/Line-plane_intersection
161 //
162 // Hrrmmm. There's still something wrong here if the ball's in the corner of
163 // the screen. Am I somehow not accounting for perspective correctly?
164 //
165 // Q: What about just projecting the circle's equation and solving for the
166 // distance?
167 const Vector3d l0 = unproject(Vector3d(x,y,0));
168 const Vector3d l = unproject(Vector3d(x,y,1))-l0;
169 const Vector3d n = view_direction(pos);
170 const double t = (pos-l0).dot(n)/l.dot(n);
171 const Vector3d uxy = l0+t*l;
173}

References igl::dot(), and igl::opengl2::unproject().

+ Here is the call graph for this function:

◆ unprojected_inner_radius()

double igl::opengl2::RotateWidget::unprojected_inner_radius ( ) const
inline
195{
196 using namespace Eigen;
197 Vector3d off,ppos,ppos_off,pos_off;
198 project(pos,ppos);
199 ppos_off = ppos;
201 unproject(ppos_off,pos_off);
202 return (pos-pos_off).norm();
203}

References igl::opengl2::project(), and igl::opengl2::unproject().

+ Here is the call graph for this function:

◆ up()

bool igl::opengl2::RotateWidget::up ( const int  x,
const int  y 
)
inline
361{
362 // even if disabled process up
364 return false;
365}

◆ view_direction() [1/2]

Eigen::Vector3d igl::opengl2::RotateWidget::view_direction ( const Eigen::Vector3d &  pos)
inlinestatic
130{
131 using namespace Eigen;
132 const Vector3d ppos = project(pos);
133 return view_direction(ppos(0),ppos(1));
134}

References igl::opengl2::project().

+ Here is the call graph for this function:

◆ view_direction() [2/2]

Eigen::Vector3d igl::opengl2::RotateWidget::view_direction ( const int  x,
const int  y 
)
inlinestatic
121{
122 using namespace Eigen;
123 const Vector3d win_s(x,y,0), win_d(x,y,1);
124 const Vector3d s = unproject(win_s);
125 const Vector3d d = unproject(win_d);
126 return d-s;
127}

References igl::opengl2::unproject().

+ Here is the call graph for this function:

Member Data Documentation

◆ down_dir

Eigen::Vector2d igl::opengl2::RotateWidget::down_dir

◆ down_rot

Eigen::Quaterniond igl::opengl2::RotateWidget::down_rot

◆ down_type

enum igl::opengl2::RotateWidget::DownType igl::opengl2::RotateWidget::down_type

◆ down_xy

Eigen::Vector2d igl::opengl2::RotateWidget::down_xy

◆ drag_xy

Eigen::Vector2d igl::opengl2::RotateWidget::drag_xy

◆ m_is_enabled

bool igl::opengl2::RotateWidget::m_is_enabled

◆ outer_over_inner

double igl::opengl2::RotateWidget::outer_over_inner

◆ outer_radius_on_screen

double igl::opengl2::RotateWidget::outer_radius_on_screen

◆ pos

Eigen::Vector3d igl::opengl2::RotateWidget::pos

◆ rot

Eigen::Quaterniond igl::opengl2::RotateWidget::rot

◆ selected_type

enum igl::opengl2::RotateWidget::DownType igl::opengl2::RotateWidget::selected_type

◆ udown

Eigen::Vector3d igl::opengl2::RotateWidget::udown

◆ udrag

Eigen::Vector3d igl::opengl2::RotateWidget::udrag

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