Board  0.9.5
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 <cstdlib>
#include <ctime>
#include <iostream>
#include "Board.h"

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 http://foureys.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().