coding standard

This commit is contained in:
Seth Alves 2015-03-09 06:56:35 -07:00
parent 3604fd639a
commit 0833fc588b
3 changed files with 35 additions and 27 deletions
libraries/fbx/src
tools/vhacd/src

View file

@ -295,7 +295,11 @@ public:
Tokenizer(QIODevice* device) : _device(device), _pushedBackToken(-1) { }
enum SpecialToken { DATUM_TOKEN = 0x100 };
enum SpecialToken {
NO_TOKEN = -1,
NO_PUSHBACKED_TOKEN = -1,
DATUM_TOKEN = 0x100
};
int nextToken();
const QByteArray& getDatum() const { return _datum; }
@ -311,9 +315,9 @@ private:
};
int Tokenizer::nextToken() {
if (_pushedBackToken != -1) {
if (_pushedBackToken != NO_PUSHBACKED_TOKEN) {
int token = _pushedBackToken;
_pushedBackToken = -1;
_pushedBackToken = NO_PUSHBACKED_TOKEN;
return token;
}
@ -361,7 +365,7 @@ int Tokenizer::nextToken() {
return DATUM_TOKEN;
}
}
return -1;
return NO_TOKEN;
}
FBXNode parseTextFBXNode(Tokenizer& tokenizer) {
@ -378,7 +382,7 @@ FBXNode parseTextFBXNode(Tokenizer& tokenizer) {
int token;
bool expectingDatum = true;
while ((token = tokenizer.nextToken()) != -1) {
while ((token = tokenizer.nextToken()) != Tokenizer::NO_TOKEN) {
if (token == '{') {
for (FBXNode child = parseTextFBXNode(tokenizer); !child.name.isNull(); child = parseTextFBXNode(tokenizer)) {
node.children.append(child);

View file

@ -24,7 +24,11 @@
class OBJTokenizer {
public:
OBJTokenizer(QIODevice* device) : _device(device), _pushedBackToken(-1) { }
enum SpecialToken { DATUM_TOKEN = 0x100 };
enum SpecialToken {
NO_TOKEN = -1,
NO_PUSHBACKED_TOKEN = -1,
DATUM_TOKEN = 0x100
};
int nextToken();
const QByteArray& getDatum() const { return _datum; }
void skipLine() { _device->readLine(); }
@ -39,9 +43,9 @@ private:
int OBJTokenizer::nextToken() {
if (_pushedBackToken != -1) {
if (_pushedBackToken != NO_PUSHBACKED_TOKEN) {
int token = _pushedBackToken;
_pushedBackToken = -1;
_pushedBackToken = NO_PUSHBACKED_TOKEN;
return token;
}
@ -84,7 +88,7 @@ int OBJTokenizer::nextToken() {
return DATUM_TOKEN;
}
}
return -1;
return NO_TOKEN;
}
@ -196,6 +200,8 @@ FBXGeometry readOBJ(QIODevice* device, const QVariantHash& mapping) {
geometry.meshes.append(FBXMesh());
try {
// call parseOBJGroup as long as it's returning true. Each successful call will
// add a new meshPart to the geometry's single mesh.
while (parseOBJGroup(tokenizer, mapping, geometry)) {
}

View file

@ -143,25 +143,23 @@ VHACDUtilApp::VHACDUtilApp(int argc, char* argv[]) :
//set parameters for V-HACD
params.m_callback = &pCallBack; //progress callback
params.m_resolution = 100000; // 100000
params.m_depth = 20; // 20
params.m_concavity = 0.001; // 0.001
params.m_delta = 0.01; // 0.05
params.m_planeDownsampling = 4; // 4
params.m_convexhullDownsampling = 4; // 4
params.m_alpha = 0.05; // 0.05 // controls the bias toward clipping along symmetry planes
params.m_beta = 0.05; // 0.05
params.m_gamma = 0.0005; // 0.0005
params.m_pca = 0; // 0 enable/disable normalizing the mesh before applying the convex decomposition
params.m_mode = 0; // 0: voxel-based (recommended), 1: tetrahedron-based
params.m_maxNumVerticesPerCH = 64; // 64
params.m_minVolumePerCH = 0.00001; // 0.0001
params.m_callback = 0; // 0
params.m_logger = 0; // 0
params.m_resolution = 100000; // 100000
params.m_depth = 20; // 20
params.m_concavity = 0.001; // 0.001
params.m_delta = 0.01; // 0.05
params.m_planeDownsampling = 4; // 4
params.m_convexhullDownsampling = 4; // 4
params.m_alpha = 0.05; // 0.05 // controls the bias toward clipping along symmetry planes
params.m_beta = 0.05; // 0.05
params.m_gamma = 0.0005; // 0.0005
params.m_pca = 0; // 0 enable/disable normalizing the mesh before applying the convex decomposition
params.m_mode = 0; // 0: voxel-based (recommended), 1: tetrahedron-based
params.m_maxNumVerticesPerCH = 64; // 64
params.m_minVolumePerCH = 0.00001; // 0.0001
params.m_callback = 0; // 0
params.m_logger = 0; // 0
params.m_convexhullApproximation = true; // true
params.m_oclAcceleration = true; // true
params.m_oclAcceleration = true; // true
// load the mesh