// angle base unit has been specified). If startAngle and endAngle have the same value, a circle is specified.
void X3DImporter::ParseNode_Geometry2D_Arc2D()
{
-std::string def, use;
-float endAngle = AI_MATH_HALF_PI_F;
-float radius = 1;
-float startAngle = 0;
-CX3DImporter_NodeElement* ne;
+ std::string def, use;
+ float endAngle = AI_MATH_HALF_PI_F;
+ float radius = 1;
+ float startAngle = 0;
+ CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
// viewed from the +Z-axis, the texture is mapped onto each face with the same orientation as if the image were displayed normally in 2D.
void X3DImporter::ParseNode_Geometry2D_ArcClose2D()
{
-std::string def, use;
-std::string closureType("PIE");
-float endAngle = AI_MATH_HALF_PI_F;
-float radius = 1;
-bool solid = false;
-float startAngle = 0;
-CX3DImporter_NodeElement* ne;
+ std::string def, use;
+ std::string closureType("PIE");
+ float endAngle = AI_MATH_HALF_PI_F;
+ float radius = 1;
+ bool solid = false;
+ float startAngle = 0;
+ CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
// />
void X3DImporter::ParseNode_Geometry2D_Circle2D()
{
-std::string def, use;
-float radius = 1;
-CX3DImporter_NodeElement* ne;
+ std::string def, use;
+ float radius = 1;
+ CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
// the Disk2D, when viewed from the +Z-axis, the texture is mapped onto each face with the same orientation as if the image were displayed normally in 2D.
void X3DImporter::ParseNode_Geometry2D_Disk2D()
{
-std::string def, use;
-float innerRadius = 0;
-float outerRadius = 1;
-bool solid = false;
-CX3DImporter_NodeElement* ne;
+ std::string def, use;
+ float innerRadius = 0;
+ float outerRadius = 1;
+ bool solid = false;
+ CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
// />
void X3DImporter::ParseNode_Geometry2D_Polyline2D()
{
-std::string def, use;
-std::list<aiVector2D> lineSegments;
-CX3DImporter_NodeElement* ne;
+ std::string def, use;
+ std::list<aiVector2D> lineSegments;
+ CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
// />
void X3DImporter::ParseNode_Geometry2D_Polypoint2D()
{
-std::string def, use;
-std::list<aiVector2D> point;
-CX3DImporter_NodeElement* ne;
+ std::string def, use;
+ std::list<aiVector2D> point;
+ CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
// />
void X3DImporter::ParseNode_Geometry2D_Rectangle2D()
{
-std::string def, use;
-aiVector2D size(2, 2);
-bool solid = false;
-CX3DImporter_NodeElement* ne;
+ std::string def, use;
+ aiVector2D size(2, 2);
+ bool solid = false;
+ CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
// />
void X3DImporter::ParseNode_Geometry2D_TriangleSet2D()
{
-std::string def, use;
-bool solid = false;
-std::list<aiVector2D> vertices;
-CX3DImporter_NodeElement* ne;
+ std::string def, use;
+ bool solid = false;
+ std::list<aiVector2D> vertices;
+ CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
// 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);
// />
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);
// />
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);
// 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);
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,
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
{
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.
// />
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);
// </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);
// />
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);
// A Group node contains children nodes without introducing a new transformation. It is equivalent to a Transform node containing an identity transform.
void X3DImporter::ParseNode_Grouping_Group()
{
-std::string def, use;
+ std::string def, use;
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
// contain any USE references outside the StaticGroup.
void X3DImporter::ParseNode_Grouping_StaticGroup()
{
-std::string def, use;
+ std::string def, use;
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
// is chosen.
void X3DImporter::ParseNode_Grouping_Switch()
{
-std::string def, use;
-int32_t whichChoice = -1;
+ std::string def, use;
+ int32_t whichChoice = -1;
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
// P' = T * C * R * SR * S * -SR * -C * P
void X3DImporter::ParseNode_Grouping_Transform()
{
-aiVector3D center(0, 0, 0);
-float rotation[4] = {0, 0, 1, 0};
-aiVector3D scale(1, 1, 1);// A value of zero indicates that any child geometry shall not be displayed
-float scale_orientation[4] = {0, 0, 1, 0};
-aiVector3D translation(0, 0, 0);
-aiMatrix4x4 matr, tmatr;
-std::string use, def;
+ aiVector3D center(0, 0, 0);
+ float rotation[4] = {0, 0, 1, 0};
+ aiVector3D scale(1, 1, 1);// A value of zero indicates that any child geometry shall not be displayed
+ float scale_orientation[4] = {0, 0, 1, 0};
+ aiVector3D translation(0, 0, 0);
+ aiMatrix4x4 matr, tmatr;
+ std::string use, def;
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
if(an == "scaleOrientation")
{
std::vector<float> tvec;
-
XML_ReadNode_GetAttrVal_AsArrF(idx, tvec);
- if(tvec.size() != 4) throw DeadlyImportError("<Transform>: scaleOrientation vector must have 4 elements.");
+ if ( tvec.size() != 4 )
+ {
+ throw DeadlyImportError( "<Transform>: scaleOrientation vector must have 4 elements." );
+ }
- memcpy(scale_orientation, tvec.data(), sizeof(scale_orientation));
+ ::memcpy(scale_orientation, tvec.data(), sizeof(scale_orientation) );
continue;
}
// if "USE" defined then find already defined element.
if(!use.empty())
{
- CX3DImporter_NodeElement* ne;
+ CX3DImporter_NodeElement* ne( nullptr );
MACRO_USE_CHECKANDAPPLY(def, use, ENET_Group, ne);
}
{
ParseHelper_Group_Begin();// create new grouping element and go deeper if node has children.
// at this place new group mode created and made current, so we can name it.
- if(!def.empty()) NodeElement_Cur->ID = def;
+ if ( !def.empty() )
+ {
+ NodeElement_Cur->ID = def;
+ }
//
// also set values specific to this type of group
//
- // calculate tranformation matrix
+ // calculate transformation matrix
aiMatrix4x4::Translation(translation, matr);// T
aiMatrix4x4::Translation(center, tmatr);// C
matr *= tmatr;
// in grouping set of nodes check X3DMetadataObject is not needed, because it is done in <Scene> parser function.
// for empty element exit from node in that place
- if(mReader->isEmptyElement()) ParseHelper_Node_Exit();
+ if ( mReader->isEmptyElement() )
+ {
+ ParseHelper_Node_Exit();
+ }
}// if(!use.empty()) else
}
bool global = false;
float intensity = 1;
bool on = true;
- CX3DImporter_NodeElement* ne;
+ CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
aiVector3D location( 0, 0, 0 );
bool on = true;
float radius = 100;
- CX3DImporter_NodeElement* ne;
+ CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
aiVector3D location( 0, 0, 0 );
bool on = true;
float radius = 100;
- CX3DImporter_NodeElement* ne;
+ CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
std::string def, use;
std::string name, reference;
std::list<bool> value;
- CX3DImporter_NodeElement* ne;
+ CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
std::string def, use;
std::string name, reference;
std::list<double> value;
- CX3DImporter_NodeElement* ne;
+ CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
// />
void X3DImporter::ParseNode_MetadataFloat()
{
-std::string def, use;
-std::string name, reference;
-std::list<float> value;
-CX3DImporter_NodeElement* ne;
+ std::string def, use;
+ std::string name, reference;
+ std::list<float> value;
+ CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
std::string def, use;
std::string name, reference;
std::list<int32_t> value;
- CX3DImporter_NodeElement* ne;
+ CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
{
std::string def, use;
std::string name, reference;
- CX3DImporter_NodeElement* ne;
+ CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
std::string def, use;
std::string name, reference;
std::list<std::string> value;
- CX3DImporter_NodeElement* ne;
+ CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);