DGtal 1.4.0
|
#include <iostream>
#include <sstream>
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/io/boards/Board2D.h"
#include "DGtal/geometry/curves/ArithmeticalDSL.h"
Go to the source code of this file.
Functions | |
void | exampleNaiveDSL () |
Function that illustrates the basic usage of a naive DSL. | |
void | exampleStandardDSL () |
Function that illustrates the basic usage of a standard DSL. | |
template<typename DSL > | |
void | drawArithmeticalDSL (typename DSL::Integer a, typename DSL::Integer b, unsigned short octant, unsigned int n) |
Function that draws the steps and the shift vector of a DSL of slope a / b and intercept 0. | |
void | exampleArithmeticalDSLOctant () |
Function that draws the steps and the shift vector of a naive and a standard DSL in each octant. | |
void | exampleArithmeticalDSLTypes () |
Function that creates a naive DSL with different types. | |
int | main (int argc, char **argv) |
Program that illustrates the basic usages of instances of ArithmeticalDSL. | |
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
An example file named exampleArithmeticalDSL.
This file is part of the DGtal library.
Definition in file exampleArithmeticalDSL.cpp.
void drawArithmeticalDSL | ( | typename DSL::Integer | a, |
typename DSL::Integer | b, | ||
unsigned short | octant, | ||
unsigned int | n ) |
Function that draws the steps and the shift vector of a DSL of slope a / b and intercept 0.
a | a-parameter of the DSL |
b | b-parameter of the DSL |
octant | octant index for tracing (from 0 to 7). |
n | number of points to draw |
DSL | type of a naive or standard DSL |
Definition at line 185 of file exampleArithmeticalDSL.cpp.
References DGtal::Trace::beginBlock(), DGtal::HyperRectDomain< TSpace >::className(), domain, LibBoard::Board::drawArrow(), DGtal::Trace::endBlock(), LibBoard::Board::saveCairo(), LibBoard::Board::setPenColorRGBi(), and DGtal::trace.
Referenced by exampleArithmeticalDSLOctant().
void exampleArithmeticalDSLOctant | ( | ) |
Function that draws the steps and the shift vector of a naive and a standard DSL in each octant.
Definition at line 313 of file exampleArithmeticalDSL.cpp.
References drawArithmeticalDSL().
Referenced by main().
void exampleArithmeticalDSLTypes | ( | ) |
Function that creates a naive DSL with different types.
[ArithmeticalDSLNaiveCtorTypes]
[ArithmeticalDSLNaiveCtorTypes]
Definition at line 356 of file exampleArithmeticalDSL.cpp.
References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), DGtal::Trace::info(), DGtal::ArithmeticalDSL< TCoordinate, TInteger, adjacency >::isValid(), and DGtal::trace.
Referenced by main().
void exampleNaiveDSL | ( | ) |
Function that illustrates the basic usage of a naive DSL.
[ArithmeticalDSLNaiveCtor]
[ArithmeticalDSLNaiveCtor]
[ArithmeticalDSLIteration]
[ArithmeticalDSLIteration]
Definition at line 61 of file exampleArithmeticalDSL.cpp.
References DGtal::ArithmeticalDSL< TCoordinate, TInteger, adjacency >::a(), DGtal::ArithmeticalDSL< TCoordinate, TInteger, adjacency >::b(), DGtal::ArithmeticalDSL< TCoordinate, TInteger, adjacency >::begin(), DGtal::Trace::beginBlock(), DGtal::HyperRectDomain< TSpace >::className(), domain, LibBoard::Board::drawArrow(), DGtal::ArithmeticalDSL< TCoordinate, TInteger, adjacency >::end(), DGtal::Trace::endBlock(), DGtal::Trace::info(), DGtal::ArithmeticalDSL< TCoordinate, TInteger, adjacency >::negate(), LibBoard::Board::saveCairo(), LibBoard::Board::saveSVG(), and DGtal::trace.
Referenced by main().
void exampleStandardDSL | ( | ) |
Function that illustrates the basic usage of a standard DSL.
[ArithmeticalDSLStandardCtor]
[ArithmeticalDSLStandardCtor]
Definition at line 121 of file exampleArithmeticalDSL.cpp.
References DGtal::ArithmeticalDSL< TCoordinate, TInteger, adjacency >::a(), DGtal::ArithmeticalDSL< TCoordinate, TInteger, adjacency >::b(), DGtal::ArithmeticalDSL< TCoordinate, TInteger, adjacency >::begin(), DGtal::Trace::beginBlock(), DGtal::HyperRectDomain< TSpace >::className(), domain, LibBoard::Board::drawArrow(), DGtal::ArithmeticalDSL< TCoordinate, TInteger, adjacency >::end(), DGtal::Trace::endBlock(), DGtal::Trace::info(), DGtal::ArithmeticalDSL< TCoordinate, TInteger, adjacency >::negate(), LibBoard::Board::saveCairo(), LibBoard::Board::saveSVG(), and DGtal::trace.
Referenced by main().
int main | ( | int | argc, |
char ** | argv ) |
Program that illustrates the basic usages of instances of ArithmeticalDSL.
argc | number of arguments |
argv | list of arguments |
Definition at line 384 of file exampleArithmeticalDSL.cpp.
References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), exampleArithmeticalDSLOctant(), exampleArithmeticalDSLTypes(), exampleNaiveDSL(), exampleStandardDSL(), DGtal::Trace::info(), and DGtal::trace.