DGtal  1.3.beta
DrawWithViewer3DModifier.h
1 
17 #pragma once
18 
30 #if defined(DrawWithViewer3DModifier_RECURSES)
31 #error Recursive header files inclusion detected in DrawWithViewer3DModifier.h
32 #else // defined(DrawWithViewer3DModifier_RECURSES)
33 
34 #define DrawWithViewer3DModifier_RECURSES
35 
36 #if !defined DrawWithViewer3DModifier_h
37 
38 #define DrawWithViewer3DModifier_h
39 
41 // Inclusions
42 #include <iostream>
43 #include "DGtal/base/Common.h"
44 #include "DGtal/base/Alias.h"
45 #include "DGtal/base/ConstAlias.h"
46 #include "DGtal/images/CConstImage.h"
47 #include "DGtal/base/CountedPtr.h"
48 #include "DGtal/topology/KhalimskySpaceND.h"
49 #include "DGtal/io/DrawWithDisplay3DModifier.h"
51 
52 namespace DGtal
53 {
54 
61  {
62  std::string className() const;
63  };
64 
65 
66 #ifndef DrawWithBoard3DTo2DModifier_h
67 
71  {
79  CameraPosition( const double x, const double y, const double z ):eyex(x), eyey(y), eyez(z)
80  {
81  }
82 
83  double eyex, eyey, eyez;
84  };
85 
86 
90  struct CameraDirection : public DrawWithViewer3DModifier
91  {
99  CameraDirection( const double x, const double y, const double z ): dirx(x), diry(y), dirz(z)
100  {
101  }
102 
103  double dirx, diry, dirz;
104  };
105 
106 
110  struct CameraUpVector : public DrawWithViewer3DModifier
111  {
119  CameraUpVector( const double x, const double y, const double z ): upx(x), upy(y), upz(z)
120  {
121  upx=x; upy=y; upz=z;
122  }
123 
124  double upx, upy, upz;
125  };
126 
127 
128 
132  struct CameraZNearFar : public DrawWithViewer3DModifier
133  {
140  CameraZNearFar( const double near, const double far ): ZNear(near), ZFar(far)
141  {
142  }
143  double ZNear, ZFar;
144  };
145 
146 #endif
147 
148 
149 
150 
156  template < typename Space, typename KSpace>
158  {
159 
171  UpdateImage3DEmbedding(unsigned int anIndex,
172  typename Space::Point aPoint1, typename Space::Point aPoint2,
173  typename Space::Point aPoint3, typename Space::Point aPoint4): myIndex(anIndex),
174  myNewPoint1(aPoint1),
175  myNewPoint2(aPoint2),
176  myNewPoint3(aPoint3),
177  myNewPoint4(aPoint4)
178  {
179  }
180  unsigned int myIndex;
185  };
186 
187 
193  template < typename Space, typename KSpace>
195  {
196 
208  UpdateImagePosition(unsigned int anIndex,typename Viewer3D<Space,KSpace>::ImageDirection newDir,
209  double posXbottomLeft, double posYbottomLeft, double posZbottomLeft ): myIndex(anIndex),
210  myPosXBottomLeft(posXbottomLeft),
211  myPosYBottomLeft(posYbottomLeft),
212  myPosZBottomLeft(posZbottomLeft),
213  myNewDirection(newDir)
214  {}
215 
216  unsigned int myIndex;
221  };
222 
223 
224 
250  template <typename TImageType, typename TFunctor, typename Space, typename KSpace>
252  {
255 
261  Clone<TFunctor> aFunctor,
262  TTextureMode aMode = TTextureMode::GrayScaleMode): my2DImage(&anImage),
263  myFunctor(aFunctor),
264  myMode(aMode)
265  {
266 
267  }
268  const TImageType *my2DImage;
269  const TFunctor myFunctor;
271  };
272 
297  template <typename TImageType, typename TFunctor, typename Space, typename KSpace>
299  {
307  Clone<TFunctor> aFunctor,
308  TTextureMode aMode =
309  TTextureMode::GrayScaleMode): my3DImage(&anImage),
310  myFunctor(aFunctor),
311  myMode(aMode)
312  {
313 
314  }
315  const TImageType *my3DImage;
316  const TFunctor myFunctor;
318  };
319 
320 
321 
327  template < typename Space, typename KSpace>
329  {
330 
342  double posXbottomLeft, double posYbottomLeft, double posZbottomLeft ):
343  myPosXBottomLeft(posXbottomLeft),
344  myPosYBottomLeft(posYbottomLeft),
345  myPosZBottomLeft(posZbottomLeft),
346  myNewDirection(newDir)
347  {
348 
349  }
354  };
355 
356 
357 
358 
364  template<typename TImageType, typename TFunctor= functors::Cast<unsigned int> >
366  {
367 
382  UpdateImageData(unsigned int anIndex, ConstAlias<TImageType> anImage, double translateX=0,
383  double translateY=0, double translateZ=0,
384  double rotationAngle=0.0, typename Viewer3D<>::ImageDirection dirRotation=Viewer3D<>::zDirection,
385  Clone<TFunctor> aFunctor = TFunctor() ): myIndex(anIndex),
386  myImage(&anImage),
387  myTranslateX (translateX),
388  myTranslateY (translateY),
389  myTranslateZ (translateZ),
390  myFunctor(aFunctor),
391  myRotationAngle(rotationAngle),
392  myRotationDir(dirRotation)
393  {}
394 
395  unsigned int myIndex;
396  const TImageType *myImage;
400  const TFunctor myFunctor;
403  };
404 
405 
406 
407 
414  {
415 
427  Translate2DDomain(unsigned int anIndex, double translateX=0,
428  double translateY=0, double translateZ=0 ): myIndex(anIndex),
429  myTranslateX (translateX),
430  myTranslateY (translateY),
431  myTranslateZ (translateZ)
432  { }
433 
434  unsigned int myIndex;
438  };
439 
440 
441 
442 
443 
444 
450  template < typename Space, typename KSpace>
452  {
453 
465  Update2DDomainPosition(unsigned int anIndex, typename Viewer3D<Space,KSpace>::ImageDirection newDir,
466  double posXbottomLeft, double posYbottomLeft, double posZbottomLeft ): myIndex(anIndex),
467  myPosXBottomLeft(posXbottomLeft),
468  myPosYBottomLeft(posYbottomLeft),
469  myPosZBottomLeft(posZbottomLeft),
470  myNewDirection(newDir)
471  { }
472 
473  unsigned int myIndex;
478  };
479 
480 
481 
482 
483 } // namespace DGtal
484 
485 
486 // //
488 
489 #endif // !defined DrawWithViewer3DModifier_h
490 
491 #undef DrawWithViewer3DModifier_RECURSES
492 #endif // else defined(DrawWithViewer3DModifier_RECURSES)
DGtal::Clone
Aim: This class encapsulates its parameter class to indicate that the given parameter is required to ...
Definition: Clone.h:266
DGtal::UpdateImagePosition::myIndex
unsigned int myIndex
Definition: DrawWithViewer3DModifier.h:216
DGtal::AddTextureImage3DWithFunctor::myFunctor
const TFunctor myFunctor
Definition: DrawWithViewer3DModifier.h:316
DGtal::AddTextureImage3DWithFunctor::my3DImage
const TImageType * my3DImage
Definition: DrawWithViewer3DModifier.h:315
DGtal::UpdateImage3DEmbedding::myNewPoint2
Space::Point myNewPoint2
Definition: DrawWithViewer3DModifier.h:182
DGtal::UpdateImageData::myRotationDir
Viewer3D ::ImageDirection myRotationDir
Definition: DrawWithViewer3DModifier.h:402
DGtal::ConstAlias
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:186
DGtal::Update2DDomainPosition::myPosXBottomLeft
double myPosXBottomLeft
Definition: DrawWithViewer3DModifier.h:474
DGtal::Update2DDomainPosition::myPosYBottomLeft
double myPosYBottomLeft
Definition: DrawWithViewer3DModifier.h:475
DGtal::UpdateLastImagePosition::UpdateLastImagePosition
UpdateLastImagePosition(typename Viewer3D< Space, KSpace >::ImageDirection newDir, double posXbottomLeft, double posYbottomLeft, double posZbottomLeft)
Definition: DrawWithViewer3DModifier.h:341
DGtal::DrawWithDisplay3DModifier
Base class specifying the methods for classes which intend to modify a Viewer3D stream.
Definition: DrawWithDisplay3DModifier.h:60
DGtal::CameraDirection::dirx
double dirx
Definition: DrawWithBoard3DTo2DModifier.h:103
DGtal::CameraPosition::CameraPosition
CameraPosition(const double x, const double y, const double z)
Definition: DrawWithViewer3DModifier.h:79
DGtal::Translate2DDomain::myIndex
unsigned int myIndex
Definition: DrawWithViewer3DModifier.h:434
DGtal::UpdateImagePosition
class to modify the position and orientation of an textured 2D image.
Definition: DrawWithViewer3DModifier.h:194
DGtal::CameraUpVector::CameraUpVector
CameraUpVector(const double x, const double y, const double z)
Definition: DrawWithViewer3DModifier.h:119
DGtal::UpdateImageData::myTranslateY
int myTranslateY
Definition: DrawWithViewer3DModifier.h:398
DGtal::AddTextureImage2DWithFunctor::AddTextureImage2DWithFunctor
AddTextureImage2DWithFunctor(ConstAlias< TImageType > anImage, Clone< TFunctor > aFunctor, TTextureMode aMode=TTextureMode::GrayScaleMode)
Definition: DrawWithViewer3DModifier.h:260
DGtal::CameraPosition::eyey
double eyey
Definition: DrawWithBoard3DTo2DModifier.h:83
DGtal::AddTextureImage3DWithFunctor::AddTextureImage3DWithFunctor
AddTextureImage3DWithFunctor(ConstAlias< TImageType > anImage, Clone< TFunctor > aFunctor, TTextureMode aMode=TTextureMode::GrayScaleMode)
Definition: DrawWithViewer3DModifier.h:306
DGtal::UpdateImage3DEmbedding
class to modify the 3d embedding of the image (useful to display not only 2D slice images)....
Definition: DrawWithViewer3DModifier.h:157
DGtal::CameraUpVector::upz
double upz
Definition: DrawWithBoard3DTo2DModifier.h:124
DGtal::UpdateImagePosition::myNewDirection
Viewer3D< Space, KSpace >::ImageDirection myNewDirection
Definition: DrawWithViewer3DModifier.h:220
DGtal::UpdateLastImagePosition::myPosYBottomLeft
double myPosYBottomLeft
Definition: DrawWithViewer3DModifier.h:351
DGtal::AddTextureImage2DWithFunctor::my2DImage
const TImageType * my2DImage
Definition: DrawWithViewer3DModifier.h:268
DGtal::CameraPosition::eyez
double eyez
Definition: DrawWithBoard3DTo2DModifier.h:83
DGtal::UpdateLastImagePosition::myNewDirection
Viewer3D< Space, KSpace >::ImageDirection myNewDirection
Definition: DrawWithViewer3DModifier.h:353
DGtal::UpdateImage3DEmbedding::myNewPoint4
Space::Point myNewPoint4
Definition: DrawWithViewer3DModifier.h:184
DGtal::UpdateImageData::myTranslateZ
int myTranslateZ
Definition: DrawWithViewer3DModifier.h:399
DGtal::AddTextureImage2DWithFunctor::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CConstImage< TImageType >))
DGtal::CameraDirection::dirz
double dirz
Definition: DrawWithBoard3DTo2DModifier.h:103
DGtal::Viewer3D
Definition: Viewer3D.h:135
DGtal::UpdateImageData::UpdateImageData
UpdateImageData(unsigned int anIndex, ConstAlias< TImageType > anImage, double translateX=0, double translateY=0, double translateZ=0, double rotationAngle=0.0, typename Viewer3D<>::ImageDirection dirRotation=Viewer3D<>::zDirection, Clone< TFunctor > aFunctor=TFunctor())
Definition: DrawWithViewer3DModifier.h:382
DGtal::UpdateImage3DEmbedding::myIndex
unsigned int myIndex
Definition: DrawWithViewer3DModifier.h:180
DGtal::UpdateImagePosition::myPosZBottomLeft
double myPosZBottomLeft
Definition: DrawWithViewer3DModifier.h:219
DGtal::Translate2DDomain::Translate2DDomain
Translate2DDomain(unsigned int anIndex, double translateX=0, double translateY=0, double translateZ=0)
Definition: DrawWithViewer3DModifier.h:427
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::AddTextureImage3DWithFunctor
class to insert a custom 3D textured image by using a conversion functor and allows to change the def...
Definition: DrawWithViewer3DModifier.h:298
DGtal::UpdateImagePosition::myPosXBottomLeft
double myPosXBottomLeft
Definition: DrawWithViewer3DModifier.h:217
DGtal::UpdateImageData::myRotationAngle
double myRotationAngle
Definition: DrawWithViewer3DModifier.h:401
DGtal::UpdateLastImagePosition::myPosXBottomLeft
double myPosXBottomLeft
Definition: DrawWithViewer3DModifier.h:350
DGtal::UpdateImageData::myImage
const TImageType * myImage
Definition: DrawWithViewer3DModifier.h:396
DGtal::Translate2DDomain::myTranslateZ
int myTranslateZ
Definition: DrawWithViewer3DModifier.h:437
DGtal::UpdateLastImagePosition
class to modify the position and orientation of an textured 2D image.
Definition: DrawWithViewer3DModifier.h:328
DGtal::CameraDirection::diry
double diry
Definition: DrawWithBoard3DTo2DModifier.h:103
DGtal::AddTextureImage2DWithFunctor::myMode
TTextureMode myMode
Definition: DrawWithViewer3DModifier.h:270
DGtal::CameraPosition::eyex
double eyex
Definition: DrawWithBoard3DTo2DModifier.h:83
DGtal::Translate2DDomain::myTranslateY
int myTranslateY
Definition: DrawWithViewer3DModifier.h:436
DGtal::CameraZNearFar::CameraZNearFar
CameraZNearFar(const double near, const double far)
Definition: DrawWithViewer3DModifier.h:140
DGtal::Viewer3D::ImageDirection
ImageDirection
the 3 possible axes for the image direction
Definition: Viewer3D.h:474
DGtal::Update2DDomainPosition::myIndex
unsigned int myIndex
Definition: DrawWithViewer3DModifier.h:473
DGtal::UpdateImageData::myTranslateX
int myTranslateX
Definition: DrawWithViewer3DModifier.h:397
DGtal::DrawWithViewer3DModifier::className
std::string className() const
DGtal::Translate2DDomain::myTranslateX
int myTranslateX
Definition: DrawWithViewer3DModifier.h:435
DGtal::UpdateImagePosition::UpdateImagePosition
UpdateImagePosition(unsigned int anIndex, typename Viewer3D< Space, KSpace >::ImageDirection newDir, double posXbottomLeft, double posYbottomLeft, double posZbottomLeft)
Definition: DrawWithViewer3DModifier.h:208
DGtal::AddTextureImage2DWithFunctor
class to insert a custom 2D textured image by using a conversion functor and allows to change the def...
Definition: DrawWithViewer3DModifier.h:251
DGtal::CameraPosition
CameraPosition class to set camera position.
Definition: DrawWithBoard3DTo2DModifier.h:70
DGtal::PointVector< dim, Integer >
DGtal::CameraUpVector::upx
double upx
Definition: DrawWithBoard3DTo2DModifier.h:124
DGtal::UpdateImageData::myFunctor
const TFunctor myFunctor
Definition: DrawWithViewer3DModifier.h:400
DGtal::Update2DDomainPosition::myPosZBottomLeft
double myPosZBottomLeft
Definition: DrawWithViewer3DModifier.h:476
DGtal::AddTextureImage2DWithFunctor::TTextureMode
Viewer3D< Space, KSpace >::TextureMode TTextureMode
Definition: DrawWithViewer3DModifier.h:254
DGtal::Update2DDomainPosition::Update2DDomainPosition
Update2DDomainPosition(unsigned int anIndex, typename Viewer3D< Space, KSpace >::ImageDirection newDir, double posXbottomLeft, double posYbottomLeft, double posZbottomLeft)
Definition: DrawWithViewer3DModifier.h:465
DGtal::Translate2DDomain
class to modify the data of an given image and also the possibility to translate it (optional).
Definition: DrawWithViewer3DModifier.h:413
DGtal::Update2DDomainPosition
class to modify the position and orientation of an 2D domain.
Definition: DrawWithViewer3DModifier.h:451
DGtal::CameraZNearFar::ZFar
double ZFar
Definition: DrawWithBoard3DTo2DModifier.h:144
DGtal::CameraZNearFar::ZNear
double ZNear
Definition: DrawWithBoard3DTo2DModifier.h:144
DGtal::AddTextureImage2DWithFunctor::myFunctor
const TFunctor myFunctor
Definition: DrawWithViewer3DModifier.h:269
DGtal::UpdateImage3DEmbedding::UpdateImage3DEmbedding
UpdateImage3DEmbedding(unsigned int anIndex, typename Space::Point aPoint1, typename Space::Point aPoint2, typename Space::Point aPoint3, typename Space::Point aPoint4)
Definition: DrawWithViewer3DModifier.h:171
DGtal::AddTextureImage3DWithFunctor::TTextureMode
Viewer3D< Space, KSpace >::TextureMode TTextureMode
Definition: DrawWithViewer3DModifier.h:301
DGtal::UpdateLastImagePosition::myPosZBottomLeft
double myPosZBottomLeft
Definition: DrawWithViewer3DModifier.h:352
DGtal::CameraDirection::CameraDirection
CameraDirection(const double x, const double y, const double z)
Definition: DrawWithViewer3DModifier.h:99
DGtal::Update2DDomainPosition::myNewDirection
Viewer3D< Space, KSpace >::ImageDirection myNewDirection
Definition: DrawWithViewer3DModifier.h:477
DGtal::CameraUpVector::upy
double upy
Definition: DrawWithBoard3DTo2DModifier.h:124
DGtal::concepts::CConstImage
Aim: Defines the concept describing a read-only image, which is a refinement of CPointFunctor.
Definition: CConstImage.h:94
DGtal::DrawWithViewer3DModifier
Base class specifying the methods for classes which intend to modify a Viewer3D stream.
Definition: DrawWithViewer3DModifier.h:60
DGtal::UpdateImageData::myIndex
unsigned int myIndex
Definition: DrawWithViewer3DModifier.h:395
DGtal::AddTextureImage3DWithFunctor::myMode
TTextureMode myMode
Definition: DrawWithViewer3DModifier.h:317
DGtal::UpdateImage3DEmbedding::myNewPoint3
Space::Point myNewPoint3
Definition: DrawWithViewer3DModifier.h:183
DGtal::UpdateImagePosition::myPosYBottomLeft
double myPosYBottomLeft
Definition: DrawWithViewer3DModifier.h:218
DGtal::UpdateImage3DEmbedding::myNewPoint1
Space::Point myNewPoint1
Definition: DrawWithViewer3DModifier.h:181
DGtal::UpdateImageData
class to modify the data of an given image and also the possibility to translate it (optional).
Definition: DrawWithViewer3DModifier.h:365
DGtal::AddTextureImage3DWithFunctor::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CConstImage< TImageType >))