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
 Function GetSize() Returns information about number of vertices stored. More...
 
unsigned int GetOffset () const
 Function GetOffset() Returns data offset in the container. More...
 
VERTEXGetVertices () const
 Function GetVertices() Returns pointer to the data used by the VERTEX_ITEM. More...
 

Private Member Functions

void setOffset (unsigned int aOffset)
 Function SetOffset() Sets data offset in the container. More...
 
void setSize (unsigned int aSize)
 Function SetSize() Sets 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 41 of file vertex_item.h.

Constructor & Destructor Documentation

◆ VERTEX_ITEM()

VERTEX_ITEM::VERTEX_ITEM ( const VERTEX_MANAGER aManager)
explicit

Definition at line 36 of file vertex_item.cpp.

36  :
37  m_manager( aManager ), m_offset( 0 ), m_size( 0 )
38 {
39  // As the item is created, we are going to modify it, so call to SetItem() is needed
40  m_manager.SetItem( *this );
41 }
unsigned int m_size
Definition: vertex_item.h:80
const VERTEX_MANAGER & m_manager
Definition: vertex_item.h:78
unsigned int m_offset
Definition: vertex_item.h:79
void SetItem(VERTEX_ITEM &aItem) const
Function SetItem() sets an item to start its modifications.

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

◆ ~VERTEX_ITEM()

VERTEX_ITEM::~VERTEX_ITEM ( )
virtual

Definition at line 44 of file vertex_item.cpp.

45 {
46  m_manager.FreeItem( *this );
47 }
const VERTEX_MANAGER & m_manager
Definition: vertex_item.h:78
void FreeItem(VERTEX_ITEM &aItem) const
Function FreeItem() frees 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()

◆ GetSize()

◆ GetVertices()

VERTEX * VERTEX_ITEM::GetVertices ( ) const

Function GetVertices() Returns pointer to the data used by the VERTEX_ITEM.

Definition at line 50 of file vertex_item.cpp.

51 {
52  return m_manager.GetVertices( *this );
53 }
const VERTEX_MANAGER & m_manager
Definition: vertex_item.h:78
VERTEX * GetVertices(const VERTEX_ITEM &aItem) const
Function GetVertices() returns 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

Function SetOffset() Sets data offset in the container.

Parameters
aOffsetis the offset expressed as a number of vertices.

Definition at line 87 of file vertex_item.h.

88  {
89  m_offset = aOffset;
90  }
unsigned int m_offset
Definition: vertex_item.h:79

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

Function SetSize() Sets data size in the container.

Parameters
aSizeis the size expressed as a number of vertices.

Definition at line 97 of file vertex_item.h.

98  {
99  m_size = aSize;
100  }
unsigned int m_size
Definition: vertex_item.h:80

References m_size.

Referenced by KIGFX::CACHED_CONTAINER::Allocate().

Friends And Related Function Documentation

◆ CACHED_CONTAINER

friend class CACHED_CONTAINER
friend

Definition at line 44 of file vertex_item.h.

◆ CACHED_CONTAINER_GPU

friend class CACHED_CONTAINER_GPU
friend

Definition at line 45 of file vertex_item.h.

◆ VERTEX_MANAGER

friend class VERTEX_MANAGER
friend

Definition at line 46 of file vertex_item.h.

Member Data Documentation

◆ m_manager

const VERTEX_MANAGER& KIGFX::VERTEX_ITEM::m_manager
private

Definition at line 78 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 79 of file vertex_item.h.

Referenced by GetOffset(), and setOffset().

◆ m_size

unsigned int KIGFX::VERTEX_ITEM::m_size
private

Definition at line 80 of file vertex_item.h.

Referenced by GetSize(), and setSize().


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