X3D: Some more reformattings and missing initializations.

This commit is contained in:
Kim Kulling
2016-10-04 18:40:58 +02:00
parent 7b9162136f
commit 86dc3f7a79
5 changed files with 137 additions and 130 deletions

View File

@@ -64,10 +64,10 @@ namespace Assimp
// respectively and each component value shall be greater than zero.
void X3DImporter::ParseNode_Geometry3D_Box()
{
std::string def, use;
bool solid = true;
aiVector3D size(2, 2, 2);
CX3DImporter_NodeElement* ne;
std::string def, use;
bool solid = true;
aiVector3D size(2, 2, 2);
CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
@@ -110,13 +110,13 @@ CX3DImporter_NodeElement* ne;
// />
void X3DImporter::ParseNode_Geometry3D_Cone()
{
std::string use, def;
bool bottom = true;
float bottomRadius = 1;
float height = 2;
bool side = true;
bool solid = true;
CX3DImporter_NodeElement* ne;
std::string use, def;
bool bottom = true;
float bottomRadius = 1;
float height = 2;
bool side = true;
bool solid = true;
CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
@@ -181,14 +181,14 @@ CX3DImporter_NodeElement* ne;
// />
void X3DImporter::ParseNode_Geometry3D_Cylinder()
{
std::string use, def;
bool bottom = true;
float height = 2;
float radius = 1;
bool side = true;
bool solid = true;
bool top = true;
CX3DImporter_NodeElement* ne;
std::string use, def;
bool bottom = true;
float height = 2;
float radius = 1;
bool side = true;
bool solid = true;
bool top = true;
CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
@@ -280,18 +280,18 @@ CX3DImporter_NodeElement* ne;
// If either the xDimension or the zDimension is less than two, the ElevationGrid contains no quadrilaterals.
void X3DImporter::ParseNode_Geometry3D_ElevationGrid()
{
std::string use, def;
bool ccw = true;
bool colorPerVertex = true;
float creaseAngle = 0;
std::list<float> height;
bool normalPerVertex = true;
bool solid = true;
int32_t xDimension = 0;
float xSpacing = 1;
int32_t zDimension = 0;
float zSpacing = 1;
CX3DImporter_NodeElement* ne;
std::string use, def;
bool ccw = true;
bool colorPerVertex = true;
float creaseAngle = 0;
std::list<float> height;
bool normalPerVertex = true;
bool solid = true;
int32_t xDimension = 0;
float xSpacing = 1;
int32_t zDimension = 0;
float zSpacing = 1;
CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
@@ -418,7 +418,7 @@ CX3DImporter_NodeElement* ne;
template<typename TVector>
static void GeometryHelper_Extrusion_CurveIsClosed(std::vector<TVector>& pCurve, const bool pDropTail, const bool pRemoveLastPoint, bool& pCurveIsClosed)
{
size_t cur_sz = pCurve.size();
size_t cur_sz = pCurve.size();
pCurveIsClosed = false;
// for curve with less than four points checking is have no sense,
@@ -461,9 +461,8 @@ size_t cur_sz = pCurve.size();
static aiVector3D GeometryHelper_Extrusion_GetNextY(const size_t pSpine_PointIdx, const std::vector<aiVector3D>& pSpine, const bool pSpine_Closed)
{
const size_t spine_idx_last = pSpine.size() - 1;
aiVector3D tvec;
const size_t spine_idx_last = pSpine.size() - 1;
aiVector3D tvec;
if((pSpine_PointIdx == 0) || (pSpine_PointIdx == spine_idx_last))// at first special cases
{
@@ -495,10 +494,10 @@ aiVector3D tvec;
static aiVector3D GeometryHelper_Extrusion_GetNextZ(const size_t pSpine_PointIdx, const std::vector<aiVector3D>& pSpine, const bool pSpine_Closed,
const aiVector3D pVecZ_Prev)
{
const aiVector3D zero_vec(0);
const size_t spine_idx_last = pSpine.size() - 1;
const aiVector3D zero_vec(0);
const size_t spine_idx_last = pSpine.size() - 1;
aiVector3D tvec;
aiVector3D tvec;
// at first special cases
if(pSpine.size() < 3)// spine have not enough points for vector calculations.
@@ -572,18 +571,18 @@ aiVector3D tvec;
// />
void X3DImporter::ParseNode_Geometry3D_Extrusion()
{
std::string use, def;
bool beginCap = true;
bool ccw = true;
bool convex = true;
float creaseAngle = 0;
std::vector<aiVector2D> crossSection;
bool endCap = true;
std::vector<float> orientation;
std::vector<aiVector2D> scale;
bool solid = true;
std::vector<aiVector3D> spine;
CX3DImporter_NodeElement* ne;
std::string use, def;
bool beginCap = true;
bool ccw = true;
bool convex = true;
float creaseAngle = 0;
std::vector<aiVector2D> crossSection;
bool endCap = true;
std::vector<float> orientation;
std::vector<aiVector2D> scale;
bool solid = true;
std::vector<aiVector3D> spine;
CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
@@ -855,18 +854,18 @@ CX3DImporter_NodeElement* ne;
// </IndexedFaceSet>
void X3DImporter::ParseNode_Geometry3D_IndexedFaceSet()
{
std::string use, def;
bool ccw = true;
std::list<int32_t> colorIndex;
bool colorPerVertex = true;
bool convex = true;
std::list<int32_t> coordIndex;
float creaseAngle = 0;
std::list<int32_t> normalIndex;
bool normalPerVertex = true;
bool solid = true;
std::list<int32_t> texCoordIndex;
CX3DImporter_NodeElement* ne;
std::string use, def;
bool ccw = true;
std::list<int32_t> colorIndex;
bool colorPerVertex = true;
bool convex = true;
std::list<int32_t> coordIndex;
float creaseAngle = 0;
std::list<int32_t> normalIndex;
bool normalPerVertex = true;
bool solid = true;
std::list<int32_t> texCoordIndex;
CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
@@ -942,10 +941,10 @@ CX3DImporter_NodeElement* ne;
// />
void X3DImporter::ParseNode_Geometry3D_Sphere()
{
std::string use, def;
float radius = 1;
bool solid = true;
CX3DImporter_NodeElement* ne;
std::string use, def;
float radius = 1;
bool solid = true;
CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);