KiCad PCB EDA Suite
sg_node.cpp File Reference
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <sstream>
#include <wx/log.h>
#include "3d_cache/sg/sg_node.h"
#include "plugins/3dapi/c3dmodel.h"

Go to the source code of this file.

Functions

static void getNodeName (S3D::SGTYPES nodeType, std::string &aName)
 

Variables

static const std::string node_names [S3D::SGTYPE_END+1]
 
static unsigned int node_counts [S3D::SGTYPE_END] = { 1, 1, 1, 1, 1, 1, 1, 1, 1 }
 

Function Documentation

static void getNodeName ( S3D::SGTYPES  nodeType,
std::string &  aName 
)
static

Definition at line 57 of file sg_node.cpp.

References node_counts, node_names, and S3D::SGTYPE_END.

Referenced by SGNODE::GetName(), and SGNODE::SetName().

58 {
59  if( nodeType < 0 || nodeType >= S3D::SGTYPE_END )
60  {
61  aName = node_names[S3D::SGTYPE_END];
62  return;
63  }
64 
65  unsigned int seqNum = node_counts[nodeType];
66  ++node_counts[nodeType];
67 
68  std::ostringstream ostr;
69  ostr << node_names[nodeType] << "_" << seqNum;
70  aName = ostr.str();
71 
72  return;
73 }
static unsigned int node_counts[S3D::SGTYPE_END]
Definition: sg_node.cpp:48
static const std::string node_names[S3D::SGTYPE_END+1]
Definition: sg_node.cpp:34

Variable Documentation

unsigned int node_counts[S3D::SGTYPE_END] = { 1, 1, 1, 1, 1, 1, 1, 1, 1 }
static

Definition at line 48 of file sg_node.cpp.

Referenced by getNodeName(), and SGNODE::ResetNodeIndex().

const std::string node_names[S3D::SGTYPE_END+1]
static
Initial value:
= {
"TXFM",
"APP",
"COL",
"COLIDX",
"FACE",
"COORD",
"COORDIDX",
"NORM",
"SHAPE",
"INVALID"
}

Definition at line 34 of file sg_node.cpp.

Referenced by SGNODE::DisassociateWrapper(), getNodeName(), S3D::GetNodeTypeName(), and SGNODE::GetNodeTypeName().