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/version.hpp>
#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 "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 25 of file 3d_cache.cpp.

Function Documentation

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

Definition at line 73 of file 3d_cache.cpp.

References S3D_PLUGIN_MANAGER::CheckTag().

Referenced by S3D_CACHE::loadCacheData().

74 {
75  if( NULL == aTag || NULL == aPluginMgrPtr )
76  return false;
77 
78  S3D_PLUGIN_MANAGER *pp = (S3D_PLUGIN_MANAGER*) aPluginMgrPtr;
79 
80  return pp->CheckTag( aTag );
81 }
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 63 of file 3d_cache.cpp.

References i.

Referenced by S3D_CACHE::load().

64 {
65  for( int i = 0; i < 20; ++i )
66  if( shaA[i] != shaB[i] )
67  return false;
68 
69  return true;
70 }
size_t i
Definition: json11.cpp:597
static const wxString sha1ToWXString ( const unsigned char *  aSHA1Sum)
static

Definition at line 84 of file 3d_cache.cpp.

References i.

Referenced by S3D_CACHE_ENTRY::GetCacheBaseName().

85 {
86  unsigned char uc;
87  unsigned char tmp;
88  char sha1[41];
89  int j = 0;
90 
91  for( int i = 0; i < 20; ++i )
92  {
93  uc = aSHA1Sum[i];
94  tmp = uc / 16;
95 
96  if( tmp > 9 )
97  tmp += 87;
98  else
99  tmp += 48;
100 
101  sha1[j++] = tmp;
102  tmp = uc % 16;
103 
104  if( tmp > 9 )
105  tmp += 87;
106  else
107  tmp += 48;
108 
109  sha1[j++] = tmp;
110  }
111 
112  sha1[j] = 0;
113 
114  return wxString::FromUTF8Unchecked( sha1 );
115 }
size_t i
Definition: json11.cpp:597

Variable Documentation

wxCriticalSection lock3D_cache
static

Definition at line 60 of file 3d_cache.cpp.

Referenced by S3D_CACHE::load().