KiCad PCB EDA Suite
3d_cache.cpp File Reference
#include <iostream>
#include <sstream>
#include <fstream>
#include <utility>
#include <iterator>
#include <wx/datetime.h>
#include <wx/filename.h>
#include <wx/log.h>
#include <wx/stdpaths.h>
#include <boost/uuid/sha1.hpp>
#include <glm/glm.hpp>
#include <glm/ext.hpp>
#include "common.h"
#include "3d_cache.h"
#include "3d_info.h"
#include "sg/scenegraph.h"
#include "3d_filename_resolver.h"
#include "3d_plugin_manager.h"
#include "plugins/3dapi/ifsg_api.h"

Go to the source code of this file.

Classes

class  S3D_CACHE_ENTRY
 

Macros

#define GLM_FORCE_RADIANS
 
#define MASK_3D_CACHE   "3D_CACHE"
 

Functions

static bool isSHA1Same (const unsigned char *shaA, const unsigned char *shaB)
 
static bool checkTag (const char *aTag, void *aPluginMgrPtr)
 
static const wxString sha1ToWXString (const unsigned char *aSHA1Sum)
 

Variables

static wxCriticalSection lock3D_cache
 

Macro Definition Documentation

#define GLM_FORCE_RADIANS

Definition at line 24 of file 3d_cache.cpp.

Function Documentation

static bool checkTag ( const char *  aTag,
void *  aPluginMgrPtr 
)
static

Definition at line 64 of file 3d_cache.cpp.

References S3D_PLUGIN_MANAGER::CheckTag().

Referenced by S3D_CACHE::loadCacheData().

65 {
66  if( NULL == aTag || NULL == aPluginMgrPtr )
67  return false;
68 
69  S3D_PLUGIN_MANAGER *pp = (S3D_PLUGIN_MANAGER*) aPluginMgrPtr;
70 
71  return pp->CheckTag( aTag );
72 }
bool CheckTag(const char *aTag)
Function CheckTag checks the given tag and returns true if the plugin named in the tag is not loaded ...
static bool isSHA1Same ( const unsigned char *  shaA,
const unsigned char *  shaB 
)
static

Definition at line 55 of file 3d_cache.cpp.

Referenced by S3D_CACHE::load().

56 {
57  for( int i = 0; i < 20; ++i )
58  if( shaA[i] != shaB[i] )
59  return false;
60 
61  return true;
62 }
static const wxString sha1ToWXString ( const unsigned char *  aSHA1Sum)
static

Definition at line 74 of file 3d_cache.cpp.

Referenced by S3D_CACHE_ENTRY::GetCacheBaseName().

75 {
76  unsigned char uc;
77  unsigned char tmp;
78  char sha1[41];
79  int j = 0;
80 
81  for( int i = 0; i < 20; ++i )
82  {
83  uc = aSHA1Sum[i];
84  tmp = uc / 16;
85 
86  if( tmp > 9 )
87  tmp += 87;
88  else
89  tmp += 48;
90 
91  sha1[j++] = tmp;
92  tmp = uc % 16;
93 
94  if( tmp > 9 )
95  tmp += 87;
96  else
97  tmp += 48;
98 
99  sha1[j++] = tmp;
100  }
101 
102  sha1[j] = 0;
103 
104  return wxString::FromUTF8Unchecked( sha1 );
105 }

Variable Documentation

wxCriticalSection lock3D_cache
static

Definition at line 53 of file 3d_cache.cpp.

Referenced by S3D_CACHE::load().