KiCad PCB EDA Suite
KIGFX::VERTEX_ITEM Class Reference

#include <vertex_item.h>

Public Member Functions

 VERTEX_ITEM (const VERTEX_MANAGER &aManager)
 
virtual ~VERTEX_ITEM ()
 
unsigned int GetSize () const
 Return information about number of vertices stored. More...
 
unsigned int GetOffset () const
 Return data offset in the container. More...
 
VERTEXGetVertices () const
 Return pointer to the data used by the VERTEX_ITEM. More...
 

Private Member Functions

void setOffset (unsigned int aOffset)
 Set data offset in the container. More...
 
void setSize (unsigned int aSize)
 Set data size in the container. More...
 

Private Attributes

const VERTEX_MANAGERm_manager
 
unsigned int m_offset
 
unsigned int m_size
 

Friends

class CACHED_CONTAINER
 
class CACHED_CONTAINER_GPU
 
class VERTEX_MANAGER
 

Detailed Description

Definition at line 43 of file vertex_item.h.

Constructor & Destructor Documentation

◆ VERTEX_ITEM()

VERTEX_ITEM::VERTEX_ITEM ( const VERTEX_MANAGER aManager)
explicit

Definition at line 38 of file vertex_item.cpp.

38  :
39  m_manager( aManager ),
40  m_offset( 0 ),
41  m_size( 0 )
42 {
43  // As the item is created, we are going to modify it, so call to SetItem() is needed
44  m_manager.SetItem( *this );
45 }
unsigned int m_size
Definition: vertex_item.h:101
const VERTEX_MANAGER & m_manager
Definition: vertex_item.h:99
unsigned int m_offset
Definition: vertex_item.h:100
void SetItem(VERTEX_ITEM &aItem) const
Set an item to start its modifications.

References m_manager, and KIGFX::VERTEX_MANAGER::SetItem().

◆ ~VERTEX_ITEM()

VERTEX_ITEM::~VERTEX_ITEM ( )
virtual

Definition at line 48 of file vertex_item.cpp.

49 {
50  m_manager.FreeItem( *this );
51 }
const VERTEX_MANAGER & m_manager
Definition: vertex_item.h:99
void FreeItem(VERTEX_ITEM &aItem) const
Free the memory occupied by the item, so it is no longer stored in the container.

References KIGFX::VERTEX_MANAGER::FreeItem(), and m_manager.

Member Function Documentation

◆ GetOffset()

unsigned int KIGFX::VERTEX_ITEM::GetOffset ( ) const
inline

◆ GetSize()

◆ GetVertices()

VERTEX * VERTEX_ITEM::GetVertices ( ) const

Return pointer to the data used by the VERTEX_ITEM.

Definition at line 54 of file vertex_item.cpp.

55 {
56  return m_manager.GetVertices( *this );
57 }
const VERTEX_MANAGER & m_manager
Definition: vertex_item.h:99
VERTEX * GetVertices(const VERTEX_ITEM &aItem) const
Return a pointer to the vertices owned by an item.

References KIGFX::VERTEX_MANAGER::GetVertices(), and m_manager.

◆ setOffset()

void KIGFX::VERTEX_ITEM::setOffset ( unsigned int  aOffset)
inlineprivate

Set data offset in the container.

Parameters
aOffsetis the offset expressed as a number of vertices.

Definition at line 84 of file vertex_item.h.

85  {
86  m_offset = aOffset;
87  }
unsigned int m_offset
Definition: vertex_item.h:100

References m_offset.

Referenced by KIGFX::CACHED_CONTAINER::defragment(), KIGFX::CACHED_CONTAINER_GPU::defragmentResize(), and KIGFX::CACHED_CONTAINER::reallocate().

◆ setSize()

void KIGFX::VERTEX_ITEM::setSize ( unsigned int  aSize)
inlineprivate

Set data size in the container.

Parameters
aSizeis the size expressed as a number of vertices.

Definition at line 94 of file vertex_item.h.

95  {
96  m_size = aSize;
97  }
unsigned int m_size
Definition: vertex_item.h:101

References m_size.

Referenced by KIGFX::CACHED_CONTAINER::Allocate(), and KIGFX::CACHED_CONTAINER::Delete().

Friends And Related Function Documentation

◆ CACHED_CONTAINER

friend class CACHED_CONTAINER
friend

Definition at line 46 of file vertex_item.h.

◆ CACHED_CONTAINER_GPU

friend class CACHED_CONTAINER_GPU
friend

Definition at line 47 of file vertex_item.h.

◆ VERTEX_MANAGER

friend class VERTEX_MANAGER
friend

Definition at line 48 of file vertex_item.h.

Member Data Documentation

◆ m_manager

const VERTEX_MANAGER& KIGFX::VERTEX_ITEM::m_manager
private

Definition at line 99 of file vertex_item.h.

Referenced by GetVertices(), VERTEX_ITEM(), and ~VERTEX_ITEM().

◆ m_offset

unsigned int KIGFX::VERTEX_ITEM::m_offset
private

Definition at line 100 of file vertex_item.h.

Referenced by GetOffset(), and setOffset().

◆ m_size

unsigned int KIGFX::VERTEX_ITEM::m_size
private

Definition at line 101 of file vertex_item.h.

Referenced by GetSize(), and setSize().


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