[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12229] trunk/blender/extern/qdune: Made a few overly verbose names of classes shorter.
Alfredo de Greef
eeshlo at yahoo.com
Mon Oct 8 06:40:31 CEST 2007
Revision: 12229
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12229
Author: eeshlo
Date: 2007-10-08 06:40:31 +0200 (Mon, 08 Oct 2007)
Log Message:
-----------
Made a few overly verbose names of classes shorter.
Also shortened some methodnames and tried to make them a bit more
similar to stl style names.
Modified Paths:
--------------
trunk/blender/extern/qdune/core/State.cpp
trunk/blender/extern/qdune/core/State.h
trunk/blender/extern/qdune/hider/ZbufferHider.cpp
trunk/blender/extern/qdune/mpgrid/MicroPolygonGrid.cpp
trunk/blender/extern/qdune/mpgrid/MicroPolygonGrid.h
trunk/blender/extern/qdune/primitives/CCSubdivision.cpp
trunk/blender/extern/qdune/primitives/CCSubdivision.h
trunk/blender/extern/qdune/primitives/Curves.cpp
trunk/blender/extern/qdune/primitives/Nurbs.cpp
trunk/blender/extern/qdune/primitives/Nurbs.h
trunk/blender/extern/qdune/primitives/Patches.cpp
trunk/blender/extern/qdune/primitives/Points.cpp
trunk/blender/extern/qdune/primitives/Polygons.cpp
trunk/blender/extern/qdune/primitives/Primitive.cpp
trunk/blender/extern/qdune/primitives/Primitive.h
trunk/blender/extern/qdune/qdtl/lrulist.h
trunk/blender/extern/qdune/qdtl/qdtl.h
trunk/blender/extern/qdune/ribparse/ribInterface.cpp
trunk/blender/extern/qdune/svm/TexCache.cpp
trunk/blender/extern/qdune/svm/TexCache.h
trunk/blender/extern/qdune/svm/slshader.h
Modified: trunk/blender/extern/qdune/core/State.cpp
===================================================================
--- trunk/blender/extern/qdune/core/State.cpp 2007-10-08 03:34:30 UTC (rev 12228)
+++ trunk/blender/extern/qdune/core/State.cpp 2007-10-08 04:40:31 UTC (rev 12229)
@@ -138,7 +138,7 @@
// init the hashtable for the ribInterface
_ribFunc* ribf = ribFuncTable;
while (ribf->name) {
- _riblu.addItem(ribf->name, ribf->func);
+ _riblu.insert(ribf->name, ribf->func);
ribf++;
}
@@ -681,7 +681,7 @@
// a durable copy is always made of the very first attribute
if (!ref_attr.empty()) {
// references not empty, re-use of already allocated ones possible?
- Attributes** ru_attr = hash_attr.findItem(ha);
+ Attributes** ru_attr = hash_attr.find(ha);
if (ru_attr) {
// do a memcmp() to make sure
if (memcmp(*ru_attr, &cur_attr, sizeof(Attributes)) == 0) return *ru_attr;
@@ -690,7 +690,7 @@
// first attribute, nothing found, or miss, so make a new durable copy
Attributes* new_attr = new Attributes(cur_attr);
ref_attr.push_back(new_attr);
- hash_attr.addItem(ha, new_attr);
+ hash_attr.insert(ha, new_attr);
return new_attr;
}
@@ -700,14 +700,14 @@
Transform& cur_xform = topTransform();
const unsigned int hx = hashfunc(reinterpret_cast<const unsigned char*>(&cur_xform), sizeof(Transform));
if (!ref_xform.empty()) {
- Transform** ru_xfrm = hash_xfrm.findItem(hx);
+ Transform** ru_xfrm = hash_xfrm.find(hx);
if (ru_xfrm) {
if (memcmp(*ru_xfrm, &cur_xform, sizeof(Transform)) == 0) return *ru_xfrm;
}
}
Transform* xf = new Transform(cur_xform);
ref_xform.push_back(xf);
- hash_xfrm.addItem(hx, xf);
+ hash_xfrm.insert(hx, xf);
return xf;
}
@@ -726,7 +726,7 @@
const size_t nla_bytes = sizeof(SlShaderInstance*)*numlights;
const unsigned int hl = hashfunc(reinterpret_cast<const unsigned char*>(nla), nla_bytes);
if (!ref_lights.empty()) {
- SlShaderInstance*** ru_light = hash_lights.findItem(hl); // !!!
+ SlShaderInstance*** ru_light = hash_lights.find(hl); // !!!
if (ru_light) {
if (memcmp(*ru_light, nla, nla_bytes) == 0) {
delete[] nla;
@@ -735,7 +735,7 @@
}
}
ref_lights.push_back(nla);
- hash_lights.addItem(hl, nla);
+ hash_lights.insert(hl, nla);
return nla;
}
Modified: trunk/blender/extern/qdune/core/State.h
===================================================================
--- trunk/blender/extern/qdune/core/State.h 2007-10-08 03:34:30 UTC (rev 12228)
+++ trunk/blender/extern/qdune/core/State.h 2007-10-08 04:40:31 UTC (rev 12229)
@@ -159,7 +159,7 @@
Camera cam, projcam; // projection camera init. by hider
// this only used by ribInterface, lookup of Rib callbacks
- StringHashMap<RIBFUNC> _riblu;
+ hashmap_t<RIBFUNC> _riblu;
// current framebuffer, used by the hiders
FrameBuffer* framebuffer;
@@ -176,15 +176,15 @@
// reference to all cloned attributes
std::vector<Attributes*> ref_attr;
- HashTable<unsigned int, Attributes*, 10> hash_attr;
+ hashtable_t<unsigned int, Attributes*, 10> hash_attr;
// reference to all cloned transforms
std::vector<Transform*> ref_xform;
- HashTable<unsigned int, Transform*, 10> hash_xfrm;
+ hashtable_t<unsigned int, Transform*, 10> hash_xfrm;
// reference to all cloned lightsource arrays
std::vector<SlShaderInstance**> ref_lights;
- HashTable<unsigned int, SlShaderInstance**, 10> hash_lights;
+ hashtable_t<unsigned int, SlShaderInstance**, 10> hash_lights;
// list of named coordinate systems
std::map<std::string, Transform> namedCoordSys;
Modified: trunk/blender/extern/qdune/hider/ZbufferHider.cpp
===================================================================
--- trunk/blender/extern/qdune/hider/ZbufferHider.cpp 2007-10-08 03:34:30 UTC (rev 12228)
+++ trunk/blender/extern/qdune/hider/ZbufferHider.cpp 2007-10-08 04:40:31 UTC (rev 12229)
@@ -480,7 +480,7 @@
// resample bucket and write to framebuffer
float coldat[5];
// z is maximum of samples in pixel
- FixedArray<float> zmax(bucket_sizeY);
+ fsArray_t<float> zmax(bucket_sizeY);
if (only_z) {
// for depth renders, only need to apply z depth filter
coldat[0] = coldat[1] = coldat[2] = coldat[3] = 0.f;
Modified: trunk/blender/extern/qdune/mpgrid/MicroPolygonGrid.cpp
===================================================================
--- trunk/blender/extern/qdune/mpgrid/MicroPolygonGrid.cpp 2007-10-08 03:34:30 UTC (rev 12228)
+++ trunk/blender/extern/qdune/mpgrid/MicroPolygonGrid.cpp 2007-10-08 04:40:31 UTC (rev 12229)
@@ -39,10 +39,10 @@
MicroPolygonGrid::~MicroPolygonGrid()
{
- float** fg = vertexvars.firstItem();
+ float** fg = vertexvars.first();
while (fg) {
delete[] *fg;
- fg = vertexvars.nextItem();
+ fg = vertexvars.next();
}
vertexvars.clear();
}
@@ -68,26 +68,26 @@
float* MicroPolygonGrid::addVariable(RtToken name, int grid_element_size)
{
- float** fg = vertexvars.findItem(name);
+ float** fg = vertexvars.find(name);
if (fg) return *fg; // already defined
// new grid
const unsigned int numfloats = nverts*grid_element_size;
float* nfg = new float[numfloats];
memset(nfg, 0, sizeof(float)*numfloats);
- vertexvars.addItem(name, nfg);
+ vertexvars.insert(name, nfg);
return nfg;
}
void MicroPolygonGrid::deleteVariable(RtToken name)
{
float* fg = NULL;
- vertexvars.removeItem(name, fg);
+ vertexvars.remove(name, fg);
if (fg) delete[] fg;
}
float* MicroPolygonGrid::findVariable(RtToken name)
{
- float** fg = vertexvars.findItem(name);
+ float** fg = vertexvars.find(name);
if (fg) return *fg;
return NULL;
}
Modified: trunk/blender/extern/qdune/mpgrid/MicroPolygonGrid.h
===================================================================
--- trunk/blender/extern/qdune/mpgrid/MicroPolygonGrid.h 2007-10-08 03:34:30 UTC (rev 12228)
+++ trunk/blender/extern/qdune/mpgrid/MicroPolygonGrid.h 2007-10-08 04:40:31 UTC (rev 12229)
@@ -75,7 +75,7 @@
const Primitive *parent; // Primitive from which we came
// a linked list with string keys actually is slightly faster than a hashtable in this case,
// maybe because the list is usually short, not sure
- NamedLinkedList_t<float*> vertexvars;
+ sklist_t<float*> vertexvars;
};
__END_QDRENDER
Modified: trunk/blender/extern/qdune/primitives/CCSubdivision.cpp
===================================================================
--- trunk/blender/extern/qdune/primitives/CCSubdivision.cpp 2007-10-08 03:34:30 UTC (rev 12228)
+++ trunk/blender/extern/qdune/primitives/CCSubdivision.cpp 2007-10-08 04:40:31 UTC (rev 12229)
@@ -85,12 +85,12 @@
static bool intpolBD = false;
-typedef FixedArray<ccVert>::iterator VertIter;
-typedef FixedArray<ccVert>::const_iterator VertConstIter;
-typedef FixedArray<ccFace>::iterator FaceIter;
-typedef FixedArray<ccFace>::const_iterator FaceConstIter;
-typedef FixedArray<ccEdge>::iterator EdgeIter;
-typedef FixedArray<ccEdge>::const_iterator EdgeConstIter;
+typedef fsArray_t<ccVert>::iterator VertIter;
+typedef fsArray_t<ccVert>::const_iterator VertConstIter;
+typedef fsArray_t<ccFace>::iterator FaceIter;
+typedef fsArray_t<ccFace>::const_iterator FaceConstIter;
+typedef fsArray_t<ccEdge>::iterator EdgeIter;
+typedef fsArray_t<ccEdge>::const_iterator EdgeConstIter;
// ugly macros... needs better implementation TODO
@@ -103,19 +103,19 @@
{\
unsigned int _idx1=_i1, _idx2=_i2;\
if (_idx1 > _idx2) SWAP(_idx1, _idx2);\
- int e_idx = *edge_id.findItem(_idx1 + (uint64)_num_verts*_idx2);\
+ int e_idx = *edge_id.find(_idx1 + (uint64)_num_verts*_idx2);\
ccFace* f = &_face_list[_fc_idx];\
f->edges.push_back(e_idx);\
E = &_edge_list[e_idx];\
E->v1 = &_vert_list[_i1], E->v2 = &_vert_list[_i2];\
if (E->v1->edges.size() == 0) {\
- const Array<int>* eiv = *edge_verts.findItem(E->v1);\
- for (Array<int>::const_iterator ei=eiv->begin(); ei!=eiv->end(); ++ei)\
+ const array_t<int>* eiv = *edge_verts.find(E->v1);\
+ for (array_t<int>::const_iterator ei=eiv->begin(); ei!=eiv->end(); ++ei)\
E->v1->edges.push_back(&_edge_list[*ei]);\
}\
if (E->v2->edges.size() == 0) {\
- const Array<int>* eiv = *edge_verts.findItem(E->v2);\
- for (Array<int>::const_iterator ei=eiv->begin(); ei!=eiv->end(); ++ei)\
+ const array_t<int>* eiv = *edge_verts.find(E->v2);\
+ for (array_t<int>::const_iterator ei=eiv->begin(); ei!=eiv->end(); ++ei)\
E->v2->edges.push_back(&_edge_list[*ei]);\
}\
E->faces.push_back(f);\
@@ -124,24 +124,24 @@
// macro to prepare for edge list initialization
// determines new number of edges & initializes hashtables
#define INIT_EDGES(_vert_list, _face_list, _num_verts, _num_faces, _num_edges)\
- AATree_t<uint64, unsigned int> edge_id;\
- HashTable<const ccVert*, Array<int>* > edge_verts;\
+ aatree_t<uint64, unsigned int> edge_id;\
+ hashtable_t<const ccVert*, array_t<int>* > edge_verts;\
_num_edges = 0;\
for (unsigned int fi=0; fi<_num_faces; ++fi) {\
ccFace* f = &_face_list[fi];\
- const Array<int>& fcverts = f->verts;\
+ const array_t<int>& fcverts = f->verts;\
const unsigned int nv = fcverts.size();\
for (unsigned int vi=0; vi<nv; ++vi) {\
unsigned int ri1 = fcverts[vi], ri2 = fcverts[(vi+1) % nv];\
unsigned int idx1 = ri1, idx2 = ri2;\
if (idx1 > idx2) SWAP(idx1, idx2);\
uint64 ID = idx1 + (uint64)_num_verts*idx2;\
- if (edge_id.findItem(ID) == NULL) {\
- edge_id.addItem(ID, _num_edges);\
+ if (edge_id.find(ID) == NULL) {\
+ edge_id.insert(ID, _num_edges);\
const ccVert *v1 = &_vert_list[ri1], *v2 = &_vert_list[ri2];\
- Array<int> **evi1 = edge_verts.findItem(v1), **evi2 = edge_verts.findItem(v2);\
- if (evi1 == NULL) { edge_verts.addItem(v1, new Array<int>); evi1 = edge_verts.findItem(v1); }\
- if (evi2 == NULL) { edge_verts.addItem(v2, new Array<int>); evi2 = edge_verts.findItem(v2); }\
+ array_t<int> **evi1 = edge_verts.find(v1), **evi2 = edge_verts.find(v2);\
+ if (evi1 == NULL) { edge_verts.insert(v1, new array_t<int>); evi1 = edge_verts.find(v1); }\
+ if (evi2 == NULL) { edge_verts.insert(v2, new array_t<int>); evi2 = edge_verts.find(v2); }\
(*evi1)->push_back(_num_edges);\
(*evi2)->push_back(_num_edges);\
_num_edges++;\
@@ -152,7 +152,7 @@
// helper function to set the boundary flag if edge has single face neighbour.
// Also, if edge on boundary then so are its two vertices and adjacent face
-inline void setBoundaryFlags(FixedArray<ccEdge>& edge_list)
+inline void setBoundaryFlags(fsArray_t<ccEdge>& edge_list)
{
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list