Adobe Source Libraries 1.49.0
A collection of C++ libraries.
|
A container used to represent a linear boolean selection. More...
#include <selection.hpp>
Public Types | |
typedef std::size_t | value_type |
value_type for selection_t | |
typedef std::vector< value_type > | store_type |
store_type for selection_t | |
typedef store_type::const_iterator | iterator |
iterator for selection_t | |
typedef store_type::const_iterator | const_iterator |
const_iterator for selection_t | |
typedef store_type::size_type | size_type |
size_type for selection_t | |
typedef store_type::difference_type | difference_type |
difference_type for selection_t | |
typedef value_type & | reference |
reference for selection_t | |
typedef const value_type & | const_reference |
const_reference for selection_t | |
typedef value_type * | pointer |
pointer for selection_t | |
typedef const value_type * | const_pointer |
const_pointer for selection_t |
Public Member Functions | |
selection_t (bool start_selected=false) | |
template<typename I> | |
selection_t (I first, I last, bool start_selected=false) | |
size_type | size () const |
bool | empty () const |
void | push_back (const value_type &x) |
const_iterator | begin () const |
gets an iterator to the beginning of the toggle point sequence | |
const_iterator | end () const |
gets an iterator to the end of the toggle point sequence | |
const value_type & | operator[] (const size_type &i) const |
fetches a toggle point at index i of the toggle point sequence | |
void | invert () |
bool | start_selected () const |
Friends | |
bool | operator== (const selection_t &x, const selection_t &y) |
A linear boolean selection is a set of context-free indices, each of which toggles the selection "on" or "off". From an implementation standpoint, each selection index must be greater than the one that precedes it (strictly monotonically increasing). There is also a boolean value associated with the selection, and that is to represent whether or not the selection is to start out "on" or "off" – thus the inversion of a selection has the same selection boundary set but a different boolean value.
Selections are context-free, meaning that a selection can be spoken about without making reference to a container. This allows for selections to be manipulated without applying them to a series of elements (e.g., union, size, etc.). Selections can then be applied to a container to get context-relevant information (e.g., the number of elements contained within a selection). Selections can also be used in place of a predicate for some algorithms. There are a series of algorithms associated with the selection container; Please see selection.
Definition at line 47 of file selection.hpp.
typedef std::size_t value_type |
Definition at line 50 of file selection.hpp.
typedef std::vector<value_type> store_type |
Definition at line 52 of file selection.hpp.
typedef store_type::const_iterator iterator |
Definition at line 54 of file selection.hpp.
typedef store_type::const_iterator const_iterator |
Definition at line 56 of file selection.hpp.
typedef store_type::size_type size_type |
Definition at line 58 of file selection.hpp.
typedef store_type::difference_type difference_type |
Definition at line 60 of file selection.hpp.
typedef value_type& reference |
Definition at line 62 of file selection.hpp.
typedef const value_type& const_reference |
Definition at line 64 of file selection.hpp.
typedef value_type* pointer |
Definition at line 66 of file selection.hpp.
typedef const value_type* const_pointer |
Definition at line 68 of file selection.hpp.
|
explicit |
Default constructor.
start_selected | Specifies whether or not this selection begins "on" or not. If so, a selection has everything selected when it is first constructed (as it has no other toggle points). |
Definition at line 77 of file selection.hpp.
selection_t | ( | I | first, |
I | last, | ||
bool | start_selected = false ) |
Constructor with the ability to initialize the selection with toggle points from the get-go.
[ first, last )
is strictly monotonically increasingfirst | an iterator to the first toggle point to include |
last | an iterator to one past the last toggle point to include |
start_selected | Specifies whether or not this selection begins "on" or not. |
Definition at line 90 of file selection.hpp.
size_type size | ( | ) | const |
selection_t::size_type selected_element_size(adobe::size(selection,
container))
Definition at line 99 of file selection.hpp.
bool empty | ( | ) | const |
true
if there is at least one toggle point, or the selection starts selected. Definition at line 102 of file selection.hpp.
void push_back | ( | const value_type & | x | ) |
pushes a toggle point onto the back of the selection. The index must be greater than the previous toggle point.
Definition at line 106 of file selection.hpp.
const_iterator begin | ( | ) | const |
Definition at line 113 of file selection.hpp.
const_iterator end | ( | ) | const |
Definition at line 116 of file selection.hpp.
const value_type & operator[] | ( | const size_type & | i | ) | const |
Definition at line 119 of file selection.hpp.
void invert | ( | ) |
inverts the selection.
Definition at line 124 of file selection.hpp.
bool start_selected | ( | ) | const |
Definition at line 129 of file selection.hpp.
|
friend |
Definition at line 131 of file selection.hpp.