KiCad PCB EDA Suite
X3D_DICT Class Reference

#include <x3d_base.h>

Public Member Functions

bool AddName (const wxString &aName, X3DNODE *aNode)
 
bool DelName (const wxString &aName, X3DNODE *aNode)
 
X3DNODEFindName (const wxString &aName)
 

Private Attributes

std::map< wxString, X3DNODE * > reg
 

Detailed Description

Definition at line 48 of file x3d_base.h.

Member Function Documentation

◆ AddName()

bool X3D_DICT::AddName ( const wxString &  aName,
X3DNODE aNode 
)

Definition at line 35 of file x3d_base.cpp.

36 {
37  if( aName.empty() )
38  return false;
39 
40  std::map< wxString, X3DNODE* >::iterator ir = reg.find( aName );
41 
42  if( ir != reg.end() )
43  reg.erase( ir );
44 
45  reg.insert( std::pair< wxString, X3DNODE* >( aName, aNode ) );
46 
47  return true;
48 }
std::map< wxString, X3DNODE * > reg
Definition: x3d_base.h:56

References reg.

Referenced by X3DSHAPE::Read(), X3DAPP::Read(), X3DCOORDS::Read(), X3DTRANSFORM::readFields(), X3DAPP::readFields(), and X3DIFACESET::readFields().

◆ DelName()

bool X3D_DICT::DelName ( const wxString &  aName,
X3DNODE aNode 
)

Definition at line 51 of file x3d_base.cpp.

52 {
53  if( aName.empty() )
54  return false;
55 
56  std::map< wxString, X3DNODE* >::iterator ir = reg.find( aName );
57 
58  if( ir != reg.end() && ir->second == aNode )
59  {
60  reg.erase( ir );
61  return true;
62  }
63 
64  return false;
65 }
std::map< wxString, X3DNODE * > reg
Definition: x3d_base.h:56

References reg.

Referenced by X3DAPP::~X3DAPP(), and X3DNODE::~X3DNODE().

◆ FindName()

X3DNODE * X3D_DICT::FindName ( const wxString &  aName)

Definition at line 68 of file x3d_base.cpp.

69 {
70  if( aName.empty() )
71  return nullptr;
72 
73  std::map< wxString, X3DNODE* >::iterator ir = reg.find( aName );
74 
75  if( ir != reg.end() )
76  return ir->second;
77 
78  return nullptr;
79 }
std::map< wxString, X3DNODE * > reg
Definition: x3d_base.h:56

References reg.

Referenced by X3D::ReadAppearance(), X3D::ReadCoordinates(), X3DAPP::readFields(), X3D::ReadIndexedFaceSet(), X3D::ReadShape(), and X3D::ReadTransform().

Member Data Documentation

◆ reg

std::map< wxString, X3DNODE* > X3D_DICT::reg
private

Definition at line 56 of file x3d_base.h.

Referenced by AddName(), DelName(), and FindName().


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