DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Style2DFactory.ih
1 
29 
30 // Implementation of inline methods //
31 
33 // Implementation of inline functions and external operators //
34 
35 #ifndef UNUSED_ARGUMENT
36 #define UNUSED_ARGUMENT(x) (void)x
37 #endif
38 
39 
40 
41 namespace DGtal
42 {
43 
44 
45  // AngleLinearMinimizer
50  {
51  virtual void setStyle( Board2D & aBoard ) const
52  {
53  aBoard.setPenColorRGBi(160,160,160);
55  aBoard.setFillColorRGBi(220,220,220);
56  aBoard.setLineWidth(1);
57  }
58  };
59  // AngleLinearMinimizer
60 
61 
62  // ArithmeticalDSS
67  {
72  virtual void setStyle(Board2D & aBoard) const
73  {
74  // Set board style
76  aBoard.setPenColor(Color::Red);
77  aBoard.setLineWidth(1);
78  aBoard.setFillColor(Color::None);
79  }
80  };
81 
86  {
91  virtual void setStyle(Board2D & aBoard) const
92  {
93  // Set board style
95  aBoard.setPenColor(Color::Black);
96  aBoard.setLineWidth(2);
97  aBoard.setFillColor(Color::None);
98  }
99  };
100  // ArithmeticalDSS
101 
102 
103  // CircleFrom2Points
104  // CircleFrom2Points
105 
106 
107  // CircleFrom3Points
108  // CircleFrom3Points
109 
110 
111  // DigitalSetBySTLSet
116  {
117  virtual void setStyle(Board2D & aBoard) const
118  {
120  aBoard.setFillColorRGBi(160,160,160);
121  aBoard.setPenColorRGBi(80,80,80);
122  }
123  };
124  // DigitalSetBySTLSet
125 
126 
127  // DigitalSetBySTLVector
132  {
133  virtual void setStyle(Board2D & aBoard) const
134  {
135  aBoard.setLineWidth(1);
137  aBoard.setFillColorRGBi(160,160,160);
138  aBoard.setPenColorRGBi(80,80,80);
139  }
140  };
141  // DigitalSetBySTLVector
142 
143 
144  // FP
149  {
154  virtual void setStyle(Board2D & aBoard) const
155  {
156  // Set board style
158  aBoard.setPenColor(Color::Red);
159  aBoard.setLineWidth(2);
160  aBoard.setFillColor(Color::None);
161  }
162  };
163  // FP
164 
165 
166  // FreemanChain
168  {
169  virtual void setStyle( Board2D & aBoard ) const
170  {
172  aBoard.setFillColor(Color::None);
173  }
174  };
175 
177  {
178  virtual void setStyle( Board2D & aBoard ) const
179  {
181  aBoard.setFillColor(Color::None);
182  }
183  };
184  // FreemanChain
185 
186 
187  // GeometricalDSS
192  {
197  virtual void setStyle(Board2D & aBoard) const
198  {
200  aBoard.setPenColor(Color::Red);
201  aBoard.setLineWidth(1.5);
202  aBoard.setFillColor(Color::None);
203  }
204  };
205  // GeometricalDSS
206 
207  //GeometricalDCA
212  {
217  virtual void setStyle(Board2D & aBoard) const
218  {
220  aBoard.setPenColor(Color::Red);
221  aBoard.setLineWidth(1.5);
222  aBoard.setFillColor(Color::None);
223  }
224  };
225  // GeometricalDCA
226 
227 
228  //FrechetShortcut
233  {
238  virtual void setStyle(Board2D & aBoard) const
239  {
241  aBoard.setPenColor(Color::Red);
242  aBoard.setLineWidth(1.5);
243  aBoard.setFillColor(Color::None);
244  }
245  };
246 
247  //FrechetShortcut
248 
249  // GridCurve
250  // we use friend because of inner classes
251  // GridCurve
252 
253 
254  // HyperRectDomain
259  {
260  virtual void setStyle(Board2D & aBoard) const
261  {
262  aBoard.setPenColorRGBi(160, 160, 160);
263  aBoard.setFillColorRGBi(255, 255, 255);
265  aBoard.setLineWidth( 1 );
266  }
267  };
268 
273  {
274  virtual void setStyle(Board2D & aBoard) const
275  {
276  aBoard.setPenColorRGBi(160, 160, 160);
277  aBoard.setFillColorRGBi(160, 160, 160);
279  aBoard.setLineWidth( 1 );
280  }
281  };
282  // HyperRectDomain
283 
284 
285  // ImageContainerByHashTree
287  {
288  virtual void setStyle(Board2D & aboard) const
289  {
290  aboard.setPenColorRGBi(60, 60, 60);
292  }
293  };
294  // ImageContainerByHashTree
295 
296 
297  // ImageContainerBySTLVector
302  {
303  virtual void setStyle( Board2D & aBoard ) const
304  {
305  aBoard.setPenColorRGBi(60, 60, 60);
307  }
308  };
309  // ImageContainerBySTLVector
310 
311 
312  // KhalimskyCell
317  {
318  virtual void setStyle( Board2D & aBoard ) const
319  {
320  aBoard.setPenColorRGBi( 50, 50, 50 );
322  aBoard.setFillColorRGBi( 80, 80, 80 );
323  aBoard.setLineWidth( 1 );
324  }
325  };
326  // KhalimskyCell
327 
328 
329  // Object
334  {
335  virtual void setStyle(Board2D & aBoard) const
336  {
337  // line width decreased to avoid too large arrows to display adjacency.
338  aBoard.setLineWidth(0.75);
340  aBoard.setFillColorRGBi(160, 160, 160);
341  aBoard.setPenColorRGBi(80, 80, 80);
342  }
343  };
344  // Object
345 
346 
347  // PointVector
352  {
353  virtual void setStyle( Board2D & aBoard ) const
354  {
355  aBoard.setPenColorRGBi(160,160,160);
357  aBoard.setFillColorRGBi(220,220,220);
358  aBoard.setLineWidth(1);
359  }
360  };
361 
366  {
367  virtual void setStyle( Board2D & aBoard ) const
368  {
369  aBoard.setPenColor(Color::Black);
371  }
372  };
373  // PointVector
374 
375 
376  // Preimage2D
377  // Preimage2D
378 
379 
380  // SignedKhalimskyCell
385  {
386  virtual void setStyle( Board2D & aBoard ) const
387  {
388  aBoard.setPenColorRGBi( 50, 50, 50 );
390  aBoard.setFillColorRGBi( 80, 80, 80 );
391  aBoard.setLineWidth( 1 );
392  }
393  };
394  // SignedKhalimskyCell
395 
396  // LatticePolytope2D
398  {
399  virtual void setStyle( Board2D & aBoard ) const
400  {
401  aBoard.setPenColorRGBi( 30, 30, 30 );
403  aBoard.setFillColorRGBi( 200, 200, 200 );
404  aBoard.setLineWidth( 2 );
405  }
406  };
408  {
409  virtual void setStyle( Board2D & aBoard ) const
410  {
411  aBoard.setPenColorRGBi( 30, 30, 30 );
413  aBoard.setFillColor( DGtal::Color::None ); //200, 200, 200 );
414  aBoard.setLineWidth( 2 );
415  }
416  };
417  // LatticePolytope2D
418 
419 
420  // StraightLineFrom2Points
421  // StraightLineFrom2Points
422 
423 
424 }
425 
426 
427 //
428 
429 
430 // AngleLinearMinimizer
431 inline
432 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::AngleLinearMinimizer & /*a*/, std::string mode = "" )
433 {
434  UNUSED_ARGUMENT(mode);
435  //only one style actually...
436  return new DefaultDrawStyleCircular_AngleLinearMinimizer;
437 }
438 // AngleLinearMinimizer
439 
440 
441 // ArithmeticalDSS
442 template <typename TIterator, typename TInteger, int connectivity>
443 inline
444 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::ArithmeticalDSS<TIterator,TInteger,connectivity> & /*a*/, std::string mode = "" )
445 {
446  if ( ( mode == "" ) || ( mode == "BoundingBox" ) )
447  return new DefaultDrawStyleBB_ArithmeticalDSS;
448  else // mode == "Points"
449  return new DefaultDrawStylePoints_ArithmeticalDSS;
450 }
451 // ArithmeticalDSS
452 
453 
454 // CircleFrom2Points
455 template <typename TPoint>
456 inline
457 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::CircleFrom2Points<TPoint> & /*cf2p*/, std::string mode = "" )
458 {
459  UNUSED_ARGUMENT(mode);
460  return new DrawableWithBoard2D;
461 }
462 // CircleFrom2Points
463 
464 
465 // CircleFrom3Points
466 template <typename TPoint>
467 inline
468 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::CircleFrom3Points<TPoint> & /*cf3p*/, std::string mode = "" )
469 {
470  UNUSED_ARGUMENT(mode);
471  return new DrawableWithBoard2D;
472 }
473 // CircleFrom3Points
474 
475 
476 // DigitalSetBySTLSet
477 template<typename Domain>
478 inline
479 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::DigitalSetBySTLSet<Domain> & /*s*/, std::string mode = "" )
480 {
481  UNUSED_ARGUMENT(mode);
482  return new DefaultDrawStyle_DigitalSetBySTLSet;
483 }
484 // DigitalSetBySTLSet
485 
486 
487 // DigitalSetBySTLVector
488 template<typename Domain>
489 inline
490 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::DigitalSetBySTLVector<Domain> & /*v*/, std::string mode = "" )
491 {
492  UNUSED_ARGUMENT(mode);
493  return new DefaultDrawStyle_DigitalSetBySTLVector;
494 }
495 // DigitalSetBySTLVector
496 
497 
498 // FP
499 template <typename TIterator, typename TInteger, int connectivity>
500 inline
502  std::string mode = "" )
503 {
504  UNUSED_ARGUMENT(mode);
505  return new DefaultDrawStyle_FP;
506 }
507 // FP
508 
509 
510 // FreemanChain
511 template <typename TInteger>
512 inline
513 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::FreemanChain<TInteger> & /*f*/,
514  std::string mode = "" )
515 {
516  if ( ( mode == "" ) || ( mode == "Grid" ) )
517  return new DefaultDrawStyleGrid_FreemanChain;
518  else
519  return new DefaultDrawStyleInterGrid_FreemanChain;
520 }
521 // FreemanChain
522 
523 
524 // GeometricalDSS
525 template <typename TConstIterator>
526 inline
528  std::string mode = "" )
529 {
530  UNUSED_ARGUMENT(mode);
531  return new DefaultDrawStyle_GeometricalDSS;
532 }
533 // GeometricalDSS
534 
535 // GeometricalDCA
536 template <typename TConstIterator>
537 inline
539  std::string mode = "" )
540 {
541  UNUSED_ARGUMENT(mode);
542  return new DefaultDrawStyle_GeometricalDCA;
543 }
544 // GeometricalDCA
545 
546 // // FrechetShortcut
547 template <typename TIterator, typename TInteger>
548 inline
549 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::FrechetShortcut<TIterator,TInteger> & /*f*/, std::string mode = "" )
550 {
551  UNUSED_ARGUMENT(mode);
552  return new DefaultDrawStyle_FrechetShortcut;
553 }
554 // // FrechetShortcut
555 
556 
557 
558 // GridCurve
559 template <typename TKSpace>
561 defaultStyle(const GridCurve<TKSpace> & /*object*/,
562  std::string mode = "" )
563 {
564  UNUSED_ARGUMENT(mode);
565  return new DrawableWithBoard2D;
566 }
567 // GridCurve
568 
569 // SCellsRange
570 template <typename TIterator, typename TSCell>
572 defaultStyle(const ConstRangeAdapter<TIterator, DefaultFunctor, TSCell> & /*object*/,
573  std::string mode = "" )
574 {
575  UNUSED_ARGUMENT(mode);
576  return new DrawableWithBoard2D;
577 }
578 // SCellsRange
579 
580 // PointsRange
581 template <typename TIterator, typename TKSpace>
583 defaultStyle(const ConstRangeAdapter<TIterator, SCellToPoint<TKSpace>, typename TKSpace::Point> & /*object*/,
584  std::string mode = "" )
585 {
586  UNUSED_ARGUMENT(mode);
587  return new DrawableWithBoard2D;
588 }
589 // PointsRange
590 
591 // MidPointsRange
592 template <typename TIterator, typename TKSpace>
594 defaultStyle(const ConstRangeAdapter<TIterator, SCellToMidPoint<TKSpace>,
595  typename TKSpace::Space::RealPoint> & /*object*/,
596  std::string mode = "" )
597 {
598  UNUSED_ARGUMENT(mode);
599  return new DrawableWithBoard2D;
600 }
601 // MidPointsRange
602 
603 // ArrowsRange
604 template <typename TIterator, typename TKSpace>
606 defaultStyle(const ConstRangeAdapter<TIterator, SCellToArrow<TKSpace>,
607  std::pair<typename TKSpace::Point, typename TKSpace::Vector> > & /*object*/,
608  std::string mode = "" )
609 {
610  UNUSED_ARGUMENT(mode);
611  return new DrawableWithBoard2D;
612 }
613 // ArrowsRange
614 
615 // InnerPointsRange
616 template <typename TIterator, typename TKSpace>
618 defaultStyle(const ConstRangeAdapter<TIterator, SCellToInnerPoint<TKSpace>, typename TKSpace::Point> & /*object*/,
619  std::string mode = "" )
620 {
621  UNUSED_ARGUMENT(mode);
622  return new DrawableWithBoard2D;
623 }
624 // InnerPointsRange
625 
626 // OuterPointsRange
627 template <typename TIterator, typename TKSpace>
629 defaultStyle(const ConstRangeAdapter<TIterator, SCellToOuterPoint<TKSpace>, typename TKSpace::Point> & /*object*/,
630  std::string mode = "" )
631 {
632  UNUSED_ARGUMENT(mode);
633  return new DrawableWithBoard2D;
634 }
635 // OuterPointsRange
636 
637 // IncidentPointsRange
638 template <typename TIterator, typename TKSpace>
640 defaultStyle(const ConstRangeAdapter<TIterator, SCellToIncidentPoints<TKSpace>,
641  std::pair<typename TKSpace::Point, typename TKSpace::Point> > & /*object*/,
642  std::string mode = "" )
643 {
644  UNUSED_ARGUMENT(mode);
645  return new DrawableWithBoard2D;
646 }
647 // IncidentPointsRange
648 
649 // HyperRectDomain
650 template<typename TSpace>
651 inline
652 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::HyperRectDomain<TSpace> & /*h*/, std::string mode = "" )
653 {
654  if ( ( mode == "" ) || ( mode == "Both" ) || ( mode == "Grid" ) )
655  return new DefaultDrawStyleGrid_HyperRectDomain;
656  else // mode == "Paving"
657  return new DefaultDrawStylePaving_HyperRectDomain;
658 }
659 // HyperRectDomain
660 
661 
662 // ImageContainerByHashTree
663 template <typename Domain, typename Value, typename HashKey >
664 inline
665 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::ImageContainerByHashTree<Domain, Value, HashKey > & /*icbht*/, std::string mode = "" )
666 {
667  UNUSED_ARGUMENT(mode);
668  return new DefaultDrawStyle_ImageContainerByHashTree;
669 }
670 // ImageContainerByHashTree
671 
672 
673 // ImageContainerBySTLVector
674 template <typename D, typename V>
675 inline
676 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::ImageContainerBySTLVector<D, V> & /*icbsv*/, std::string mode = "" )
677 {
678  UNUSED_ARGUMENT(mode);
679  return new DefaultDrawStyle_ImageContainerBySTLVector;
680 }
681 // ImageContainerBySTLVector
682 
683 
684 // KhalimskyCell
685 template < Dimension dim, typename TInteger >
686 inline
687 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::KhalimskyCell<dim, TInteger> & /*k*/, std::string mode = "" )
688 {
689  UNUSED_ARGUMENT(mode);
690  return new DefaultDrawStyle_KhalimskyCell;
691 }
692 // KhalimskyCell
693 
694 
695 // Object
696 template <typename TDigitalTopology, typename TDigitalSet>
697 inline
698 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::Object<TDigitalTopology, TDigitalSet> & /*o*/, std::string mode = "" )
699 {
700  UNUSED_ARGUMENT(mode);
701  return new DefaultDrawStyle_Object;
702 }
703 // Object
704 
705 
706 // PointVector
707 template<Dimension dim, typename TComponent>
708 inline
709 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::PointVector<dim,TComponent> & /*p*/, std::string mode = "")
710 {
711  if ( ( mode == "" ) || ( mode == "Paving" ) )
712  return new DefaultDrawStylePaving_PointVector;
713  else // mode == "Grid"
714  return new DefaultDrawStyleGrid_PointVector;
715 }
716 // PointVector
717 
718 
719 // Preimage2D
720 template <typename Shape>
721 inline
722 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::Preimage2D<Shape> & /*p*/, std::string mode = "")
723 {
724  UNUSED_ARGUMENT(mode);
725  return new DrawableWithBoard2D;
726 }
727 // Preimage2D
728 
729 
730 // SignedKhalimskyCell
731 template < Dimension dim, typename TInteger >
732 inline
733 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::SignedKhalimskyCell<dim, TInteger> & /*sk*/, std::string mode = "" )
734 {
735  UNUSED_ARGUMENT(mode);
736  return new DefaultDrawStyle_SignedKhalimskyCell;
737 }
738 // SignedKhalimskyCell
739 
740 
741 // StraightLineFrom2Points
742 template <typename TPoint>
743 inline
744 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::StraightLineFrom2Points<TPoint> & /*slf2p*/, std::string mode = "" )
745 {
746  UNUSED_ARGUMENT(mode);
747  return new DrawableWithBoard2D;
748 }
749 // StraightLineFrom2Points
750 
751 // LatticePolytope2D
752 template < typename TSpace, typename TSequence>
753 inline
755 defaultStyle( const DGtal::LatticePolytope2D<TSpace,TSequence> & /*cip*/,
756  std::string mode = "" )
757 {
758  if ( ( mode == "" ) || ( mode == "Transparent" ) )
759  return new DefaultDrawStyleTransparent_LatticePolytope2D;
760  else // "Filled"
761  return new DefaultDrawStyleFilled_LatticePolytope2D;
762 }
763 // LatticePolytope2D
764 
765 //
766 
767 
768 inline
769 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::CustomStyle & /*cs*/, std::string mode = "" )
770 {
771  UNUSED_ARGUMENT(mode);
772  return 0;
773 }
774 
775 inline
776 DGtal::DrawableWithBoard2D* defaultStyle(const DGtal::SetMode & /*sm*/, std::string mode = "" )
777 {
778  UNUSED_ARGUMENT(mode);
779  return 0;
780 }
781 
782 
783 // //
785 
786