Board 0.9.6
Functions | Variables
traversal.cpp File Reference

Sample code showing the use of shape iterators as well as the ShapeList::topLevelFindLast<T>(n) method. More...

#include <Board.h>
#include <ctime>
#include <iostream>

Functions

ShapeList generateGroup (int n)
 
template<typename T >
ShapeList findAll (ShapeList &list)
 
int main (int, char *[])
 

Variables

const int NbColors = 4
 
const Color Colors [NbColors] = {Color("#cc0000"), Color("#00cc00"), Color("#0000cc"), Color("#c0c0c0")}
 

Detailed Description

Sample code showing the use of shape iterators as well as the ShapeList::topLevelFindLast<T>(n) method.

Author
Sebastien Fourey (GREYC)

This source code is part of the Board project, a C++ library whose purpose is to allow simple drawings in EPS, FIG or SVG files. Copyright (C) 2007 Sebastien Fourey https://fourey.users.greyc.fr

Function Documentation

◆ findAll()

template<typename T >
ShapeList findAll ( ShapeList list)

Extract all shapes of a given type (T) thanks to the topLevelFindLast<>() method.

Examples
examples/traversal.cpp.

References LibBoard::ShapeList::append(), and LibBoard::ShapeList::topLevelFindLast().

◆ generateGroup()

ShapeList generateGroup ( int  n)

◆ main()

int main ( int  ,
char *  [] 
)

Variable Documentation

◆ Colors

const Color Colors[NbColors] = {Color("#cc0000"), Color("#00cc00"), Color("#0000cc"), Color("#c0c0c0")}
Examples
examples/traversal.cpp.

Referenced by generateGroup().

◆ NbColors

const int NbColors = 4
Examples
examples/traversal.cpp.

Referenced by generateGroup().