DGtal  1.3.beta
Public Member Functions | Data Fields
DGtal::Viewer3D< TSpace, TKSpace >::CompFarthestVoxelFromCamera Struct Reference

#include <DGtal/io/viewers/Viewer3D.h>

Public Member Functions

bool operator() (typename Viewer3D< Space, KSpace >::CubeD3D s1, typename Viewer3D< Space, KSpace >::CubeD3D s2)
 

Data Fields

qglviewer::Vec posCam
 

Detailed Description

template<typename TSpace = SpaceND<3>, typename TKSpace = KhalimskySpaceND<3>>
struct DGtal::Viewer3D< TSpace, TKSpace >::CompFarthestVoxelFromCamera

Used to sort pixel from camera

Definition at line 1051 of file Viewer3D.h.

Member Function Documentation

◆ operator()()

template<typename TSpace = SpaceND<3>, typename TKSpace = KhalimskySpaceND<3>>
bool DGtal::Viewer3D< TSpace, TKSpace >::CompFarthestVoxelFromCamera::operator() ( typename Viewer3D< Space, KSpace >::CubeD3D  s1,
typename Viewer3D< Space, KSpace >::CubeD3D  s2 
)
inline

Definition at line 1054 of file Viewer3D.h.

1056  {
1057  double dist1 =
1058  sqrt( ( posCam.x - s1.center[ 0 ] ) * ( posCam.x - s1.center[ 0 ] ) +
1059  ( posCam.y - s1.center[ 1 ] ) * ( posCam.y - s1.center[ 1 ] ) +
1060  ( posCam.z - s1.center[ 2 ] ) * ( posCam.z - s1.center[ 2 ] ) );
1061  double dist2 =
1062  sqrt( ( posCam.x - s2.center[ 0 ] ) * ( posCam.x - s2.center[ 0 ] ) +
1063  ( posCam.y - s2.center[ 1 ] ) * ( posCam.y - s2.center[ 1 ] ) +
1064  ( posCam.z - s2.center[ 2 ] ) * ( posCam.z - s2.center[ 2 ] ) );
1065  return dist1 > dist2;
1066  }

References DGtal::Viewer3D< TSpace, TKSpace >::CompFarthestVoxelFromCamera::posCam.

Field Documentation

◆ posCam

template<typename TSpace = SpaceND<3>, typename TKSpace = KhalimskySpaceND<3>>
qglviewer::Vec DGtal::Viewer3D< TSpace, TKSpace >::CompFarthestVoxelFromCamera::posCam

The documentation for this struct was generated from the following file:
DGtal::Viewer3D::CompFarthestVoxelFromCamera::posCam
qglviewer::Vec posCam
Definition: Viewer3D.h:1053