DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Data Fields
DGtal::Viewer3D::compFarthestTriangleFromCamera Struct Reference

#include <Viewer3D.h>

Public Member Functions

bool operator() (triangleD3D t1, triangleD3D t2)

Data Fields

qglviewer::Vec posCam

Detailed Description

Definition at line 312 of file Viewer3D.h.


Member Function Documentation

bool DGtal::Viewer3D::compFarthestTriangleFromCamera::operator() ( triangleD3D  t1,
triangleD3D  t2 
)
inline

Definition at line 315 of file Viewer3D.h.

References posCam, DGtal::Display3D::triangleD3D::x1, DGtal::Display3D::triangleD3D::x2, DGtal::Display3D::triangleD3D::x3, DGtal::Display3D::triangleD3D::y1, DGtal::Display3D::triangleD3D::y2, DGtal::Display3D::triangleD3D::y3, DGtal::Display3D::triangleD3D::z1, DGtal::Display3D::triangleD3D::z2, and DGtal::Display3D::triangleD3D::z3.

{
qglviewer::Vec center1 ( ( t1.x1+t1.x2+t1.x3 ) /3.0, ( t1.y1+t1.y2+t1.y3 ) /3.0, ( t1.z1+t1.z2+t1.z3 ) /3.0 );
qglviewer::Vec center2 ( ( t2.x1+t2.x2+t2.x3 ) /3.0, ( t2.y1+t2.y2+t2.y3 ) /3.0, ( t2.z1+t2.z2+t2.z3 ) /3.0 );
double dist1= sqrt ( ( posCam.x-center1.x ) * ( posCam.x-center1.x ) + ( posCam.y-center1.y ) * ( posCam.y-center1.y ) + ( posCam.z-center1.z ) * ( posCam.z-center1.z ) );
double dist2= sqrt ( ( posCam.x-center2.x ) * ( posCam.x-center2.x ) + ( posCam.y-center2.y ) * ( posCam.y-center2.y ) + ( posCam.z-center2.z ) * ( posCam.z-center2.z ) );
return dist1>dist2;
}

Field Documentation

qglviewer::Vec DGtal::Viewer3D::compFarthestTriangleFromCamera::posCam

Definition at line 314 of file Viewer3D.h.

Referenced by operator()(), and DGtal::Viewer3D::sortTriangleFromCamera().


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