Antiprism 0.23

- Main Page
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Protected Member Functions

# col_geom Class Reference

Holder for element colours. More...

`#include <col_geom.h>`

Inheritance diagram for col_geom:
[legend]

List of all members.

## Public Member Functions
void | set_v_col (int idx, col_val col)
| Set a vertex colour.
col_val | get_v_col (int idx) const
| Get a vertex colour.
void | set_e_col (int idx, col_val col)
| Set an edge colour.
col_val | get_e_col (int idx) const
| Get an edge colour.
void | set_f_col (int idx, col_val col)
| Set a face colour.
col_val | get_f_col (int idx) const
| Get a face colour.
void | clear_v_cols ()
| Clear all the vertex colours.
void | clear_e_cols ()
| Clear all the face colours.
void | clear_f_cols ()
| Clear all the edge colours.
void | clear_cols ()
| Clear all the colours.
const map< int, col_val > & | vert_cols () const
| Read access to vertex colours.
map< int, col_val > & | raw_vert_cols ()
| Write access to vertex colours.
const map< int, col_val > & | edge_cols () const
| Read access to edge colours.
map< int, col_val > & | raw_edge_cols ()
| Write access to edge colours.
const map< int, col_val > & | face_cols () const
| Read access to face colours.
map< int, col_val > & | raw_face_cols ()
| Write access to face colours.
## Static Public Member Functions
static void | set_col (map< int, col_val > &elem, int idx, col_val col)
| Set a colour in an element-index-to-colour map.
static col_val | get_col (const map< int, col_val > &elem, int idx)
| Get a colour from an element-index-to-colour map.
## Protected Member Functions
void | append (const col_geom &geom, int v_size, int e_size, int f_size)
| Append a geometry colour holder.
void | remap_vert_cols (const map< int, int > &chg_map)
| Map the vertex colours to different index numbers.
void | remap_edge_cols (const map< int, int > &chg_map)
| Map the edge colours to different index numbers.
void | remap_face_cols (const map< int, int > &chg_map)
| Map the face colours to different index numbers.

## Detailed Description

Holder for element colours.

## Member Function Documentation

void col_geom::append | ( | const col_geom & | geom,
|  | int | v_size,
|  | int | e_size,
|  | int | f_size
| ) |  | `[protected]`

Append a geometry colour holder.

Parameters:

  geom | geometry colour holder to append.
  v_size | number of vertices in geometry associated with geom.
  e_size | number of edges in geometry associated with geom.
  f_size | number of faces in geometry associated with geomi.

const map< int, col_val > & col_geom::edge_cols | ( |  | ) | const`[inline]`

Read access to edge colours.

Returns:
  The colour map

const map< int, col_val > & col_geom::face_cols | ( |  | ) | const`[inline]`

Read access to face colours.

Returns:
  The colour map

col_val col_geom::get_col | ( | const map< int, col_val > & | elem,
|  | int | idx
| ) |  | `[inline, static]`

Get a colour from an element-index-to-colour map.

Parameters:

  elem | element-index-to-colour map
  idx | element index to get the colour for

Returns:
  col The colour. The colour will be in the unset state if the element did not have a colour.

col_val col_geom::get_e_col | ( | int | idx | ) | const`[inline]`

Get an edge colour.

Parameters:

  idx | the edge index number.

Returns:
  The colour.

col_val col_geom::get_f_col | ( | int | idx | ) | const`[inline]`

Get a face colour.

Parameters:

  idx | the face index number.

Returns:
  The colour.

col_val col_geom::get_v_col | ( | int | idx | ) | const`[inline]`

Get a vertex colour.

Parameters:

  idx | the vertex index number.

Returns:
  The colour.

map< int, col_val > & col_geom::raw_edge_cols | ( |  | ) | `[inline]`

Write access to edge colours.

Returns:
  The colour map

map< int, col_val > & col_geom::raw_face_cols | ( |  | ) | `[inline]`

Write access to face colours.

Returns:
  The colour map

map< int, col_val > & col_geom::raw_vert_cols | ( |  | ) | `[inline]`

Write access to vertex colours.

Returns:
  The colour map

void col_geom::remap_edge_cols | ( | const map< int, int > & | chg_map | ) | `[inline, protected]`

Map the edge colours to different index numbers.

Used to maintain colors when index numbers are changed. This can happen after deletions.

Parameters:

  chg_map | a map of old index numbers to new index numbers. if the new index number is `-1` then the element index has been deleted so the colour is deleted.

void col_geom::remap_face_cols | ( | const map< int, int > & | chg_map | ) | `[inline, protected]`

Map the face colours to different index numbers.

Used to maintain colors when index numbers are changed. This can happen after deletions.

Parameters:

  chg_map | a map of old index numbers to new index numbers. if the new index number is `-1` then the element index has been deleted so the colour is deleted.

void col_geom::remap_vert_cols | ( | const map< int, int > & | chg_map | ) | `[inline, protected]`

Map the vertex colours to different index numbers.

Used to maintain colors when index numbers are changed. This can happen after deletions.

Parameters:

  chg_map | a map of old index numbers to new index numbers. if the new index number is `-1` then the element index has been deleted so the colour is deleted.

void col_geom::set_col | ( | map< int, col_val > & | elem,
|  | int | idx,
|  | col_val | col
| ) |  | `[inline, static]`

Set a colour in an element-index-to-colour map.

Parameters:

  elem | element-index-to-colour map
  idx | element index
  col | colour to set

void col_geom::set_e_col | ( | int | idx,
|  | col_val | col
| ) |  | `[inline]`

Set an edge colour.

Parameters:

  idx | the edge index number.
  col | the colour to set.

void col_geom::set_f_col | ( | int | idx,
|  | col_val | col
| ) |  | `[inline]`

Set a face colour.

Parameters:

  idx | the face index number.
  col | the colour to set.

void col_geom::set_v_col | ( | int | idx,
|  | col_val | col
| ) |  | `[inline]`

Set a vertex colour.

Parameters:

  idx | the vertex index number.
  col | the colour to set.

const map< int, col_val > & col_geom::vert_cols | ( |  | ) | const`[inline]`

Read access to vertex colours.

Returns:
  The colour map

The documentation for this class was generated from the following files:

- base/col_geom.h
- base/col_geom.cc