Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
agg::vertex_stl_storage< Container > Class Template Reference

#include <src/agg/agg_path_storage.h>

Public Types

typedef Container::value_type vertex_type
 
typedef vertex_type::value_type value_type
 

Public Member Functions

void remove_all ()
 
void free_all ()
 
void add_vertex (double x, double y, unsigned cmd)
 
void modify_vertex (unsigned idx, double x, double y)
 
void modify_vertex (unsigned idx, double x, double y, unsigned cmd)
 
void modify_command (unsigned idx, unsigned cmd)
 
void swap_vertices (unsigned v1, unsigned v2)
 
unsigned last_command () const
 
unsigned last_vertex (double *x, double *y) const
 
unsigned prev_vertex (double *x, double *y) const
 
double last_x () const
 
double last_y () const
 
unsigned total_vertices () const
 
unsigned vertex (unsigned idx, double *x, double *y) const
 
unsigned command (unsigned idx) const
 

Private Attributes

Container m_vertices
 

Detailed Description

template<class Container>
class agg::vertex_stl_storage< Container >

Member Typedef Documentation

◆ value_type

template<class Container >
typedef vertex_type::value_type agg::vertex_stl_storage< Container >::value_type

◆ vertex_type

template<class Container >
typedef Container::value_type agg::vertex_stl_storage< Container >::vertex_type

Member Function Documentation

◆ add_vertex()

template<class Container >
void agg::vertex_stl_storage< Container >::add_vertex ( double  x,
double  y,
unsigned  cmd 
)
inline
1468 {
1469 m_vertices.push_back(vertex_type(value_type(x),
1470 value_type(y),
1471 int8u(cmd)));
1472 }
Container m_vertices
Definition agg_path_storage.h:1557
Container::value_type vertex_type
Definition agg_path_storage.h:1461
vertex_type::value_type value_type
Definition agg_path_storage.h:1462
AGG_INT8U int8u
Definition agg_basics.h:120
struct command cmd[]
Definition term.c:94

References cmd, and agg::vertex_stl_storage< Container >::m_vertices.

◆ command()

template<class Container >
unsigned agg::vertex_stl_storage< Container >::command ( unsigned  idx) const
inline
1552 {
1553 return m_vertices[idx].cmd;
1554 }

References agg::vertex_stl_storage< Container >::m_vertices.

◆ free_all()

template<class Container >
void agg::vertex_stl_storage< Container >::free_all ( )
inline

◆ last_command()

template<class Container >
unsigned agg::vertex_stl_storage< Container >::last_command ( ) const
inline
1502 {
1503 return m_vertices.size() ?
1504 m_vertices[m_vertices.size() - 1].cmd :
1506 }
@ path_cmd_stop
Definition agg_basics.h:370

References agg::vertex_stl_storage< Container >::m_vertices, and agg::path_cmd_stop.

◆ last_vertex()

template<class Container >
unsigned agg::vertex_stl_storage< Container >::last_vertex ( double *  x,
double *  y 
) const
inline
1509 {
1510 if(m_vertices.size() == 0)
1511 {
1512 *x = *y = 0.0;
1513 return path_cmd_stop;
1514 }
1515 return vertex(m_vertices.size() - 1, x, y);
1516 }
unsigned vertex(unsigned idx, double *x, double *y) const
Definition agg_path_storage.h:1543
const Scalar & y
Definition MathFunctions.h:552
TCoord< P > x(const P &p)
Definition geometry_traits.hpp:297

References agg::vertex_stl_storage< Container >::m_vertices, agg::path_cmd_stop, and agg::vertex_stl_storage< Container >::vertex().

+ Here is the call graph for this function:

◆ last_x()

template<class Container >
double agg::vertex_stl_storage< Container >::last_x ( ) const
inline
1529 {
1530 return m_vertices.size() ? m_vertices[m_vertices.size() - 1].x : 0.0;
1531 }

References agg::vertex_stl_storage< Container >::m_vertices.

◆ last_y()

template<class Container >
double agg::vertex_stl_storage< Container >::last_y ( ) const
inline
1534 {
1535 return m_vertices.size() ? m_vertices[m_vertices.size() - 1].y : 0.0;
1536 }

References agg::vertex_stl_storage< Container >::m_vertices.

◆ modify_command()

template<class Container >
void agg::vertex_stl_storage< Container >::modify_command ( unsigned  idx,
unsigned  cmd 
)
inline
1490 {
1491 m_vertices[idx].cmd = int8u(cmd);
1492 }

References cmd, and agg::vertex_stl_storage< Container >::m_vertices.

◆ modify_vertex() [1/2]

template<class Container >
void agg::vertex_stl_storage< Container >::modify_vertex ( unsigned  idx,
double  x,
double  y 
)
inline
1475 {
1476 vertex_type& v = m_vertices[idx];
1477 v.x = value_type(x);
1478 v.y = value_type(y);
1479 }

References agg::vertex_stl_storage< Container >::m_vertices.

◆ modify_vertex() [2/2]

template<class Container >
void agg::vertex_stl_storage< Container >::modify_vertex ( unsigned  idx,
double  x,
double  y,
unsigned  cmd 
)
inline
1482 {
1483 vertex_type& v = m_vertices[idx];
1484 v.x = value_type(x);
1485 v.y = value_type(y);
1486 v.cmd = int8u(cmd);
1487 }

References cmd, and agg::vertex_stl_storage< Container >::m_vertices.

◆ prev_vertex()

template<class Container >
unsigned agg::vertex_stl_storage< Container >::prev_vertex ( double *  x,
double *  y 
) const
inline
1519 {
1520 if(m_vertices.size() < 2)
1521 {
1522 *x = *y = 0.0;
1523 return path_cmd_stop;
1524 }
1525 return vertex(m_vertices.size() - 2, x, y);
1526 }

References agg::vertex_stl_storage< Container >::m_vertices, agg::path_cmd_stop, and agg::vertex_stl_storage< Container >::vertex().

+ Here is the call graph for this function:

◆ remove_all()

template<class Container >
void agg::vertex_stl_storage< Container >::remove_all ( )
inline

◆ swap_vertices()

template<class Container >
void agg::vertex_stl_storage< Container >::swap_vertices ( unsigned  v1,
unsigned  v2 
)
inline
1495 {
1496 vertex_type t = m_vertices[v1];
1497 m_vertices[v1] = m_vertices[v2];
1498 m_vertices[v2] = t;
1499 }

References agg::vertex_stl_storage< Container >::m_vertices.

◆ total_vertices()

template<class Container >
unsigned agg::vertex_stl_storage< Container >::total_vertices ( ) const
inline
1539 {
1540 return m_vertices.size();
1541 }

References agg::vertex_stl_storage< Container >::m_vertices.

◆ vertex()

template<class Container >
unsigned agg::vertex_stl_storage< Container >::vertex ( unsigned  idx,
double *  x,
double *  y 
) const
inline
1544 {
1545 const vertex_type& v = m_vertices[idx];
1546 *x = v.x;
1547 *y = v.y;
1548 return v.cmd;
1549 }

References agg::vertex_stl_storage< Container >::m_vertices.

Referenced by agg::vertex_stl_storage< Container >::last_vertex(), and agg::vertex_stl_storage< Container >::prev_vertex().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_vertices


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