Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
4b22e8ed
Commit
4b22e8ed
authored
Apr 15, 2015
by
Wayne Stambaugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix wxLogTrace string argument format specifiers for size_t types in vrml_v2_parser.cpp
parent
9c0c8925
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
50 deletions
+67
-50
vrml_v2_modelparser.cpp
3d-viewer/vrml_v2_modelparser.cpp
+67
-50
No files found.
3d-viewer/vrml_v2_modelparser.cpp
View file @
4b22e8ed
...
@@ -69,16 +69,19 @@ VRML2_MODEL_PARSER::~VRML2_MODEL_PARSER()
...
@@ -69,16 +69,19 @@ VRML2_MODEL_PARSER::~VRML2_MODEL_PARSER()
{
{
}
}
void
VRML2_MODEL_PARSER
::
debug_enter
()
void
VRML2_MODEL_PARSER
::
debug_enter
()
{
{
m_debugSpacer
.
Append
(
' '
);
m_debugSpacer
.
Append
(
' '
);
}
}
void
VRML2_MODEL_PARSER
::
debug_exit
()
void
VRML2_MODEL_PARSER
::
debug_exit
()
{
{
m_debugSpacer
.
RemoveLast
();
m_debugSpacer
.
RemoveLast
();
}
}
bool
VRML2_MODEL_PARSER
::
Load
(
const
wxString
&
aFilename
)
bool
VRML2_MODEL_PARSER
::
Load
(
const
wxString
&
aFilename
)
{
{
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"Loading: %s"
),
GetChars
(
aFilename
)
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"Loading: %s"
),
GetChars
(
aFilename
)
);
...
@@ -89,7 +92,8 @@ bool VRML2_MODEL_PARSER::Load( const wxString& aFilename )
...
@@ -89,7 +92,8 @@ bool VRML2_MODEL_PARSER::Load( const wxString& aFilename )
if
(
m_file
==
NULL
)
if
(
m_file
==
NULL
)
{
{
debug_exit
();
debug_exit
();
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"Failed to open file: %s"
),
GetChars
(
aFilename
)
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"Failed to open file: %s"
),
GetChars
(
aFilename
)
);
return
false
;
return
false
;
}
}
...
@@ -111,7 +115,8 @@ bool VRML2_MODEL_PARSER::Load( const wxString& aFilename, S3D_MESH_PTR aTransfor
...
@@ -111,7 +115,8 @@ bool VRML2_MODEL_PARSER::Load( const wxString& aFilename, S3D_MESH_PTR aTransfor
{
{
if
(
aTransformationModel
)
if
(
aTransformationModel
)
{
{
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"Loading: %s"
),
GetChars
(
aFilename
)
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"Loading: %s"
),
GetChars
(
aFilename
)
);
debug_enter
();
debug_enter
();
m_file
=
wxFopen
(
aFilename
,
wxT
(
"rt"
)
);
m_file
=
wxFopen
(
aFilename
,
wxT
(
"rt"
)
);
...
@@ -119,7 +124,8 @@ bool VRML2_MODEL_PARSER::Load( const wxString& aFilename, S3D_MESH_PTR aTransfor
...
@@ -119,7 +124,8 @@ bool VRML2_MODEL_PARSER::Load( const wxString& aFilename, S3D_MESH_PTR aTransfor
if
(
m_file
==
NULL
)
if
(
m_file
==
NULL
)
{
{
debug_exit
();
debug_exit
();
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"Failed to open file: %s"
),
GetChars
(
aFilename
)
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"Failed to open file: %s"
),
GetChars
(
aFilename
)
);
return
false
;
return
false
;
}
}
...
@@ -178,7 +184,7 @@ int VRML2_MODEL_PARSER::loadFileModel( S3D_MESH_PTR aTransformationModel )
...
@@ -178,7 +184,7 @@ int VRML2_MODEL_PARSER::loadFileModel( S3D_MESH_PTR aTransformationModel )
m_model
->
m_rotation
=
aTransformationModel
->
m_rotation
;
m_model
->
m_rotation
=
aTransformationModel
->
m_rotation
;
m_model
->
m_scale
=
aTransformationModel
->
m_scale
;
m_model
->
m_scale
=
aTransformationModel
->
m_scale
;
}
}
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"loadFileModel: Add model with %
lu points, %lu coordIndex, %l
u childs."
),
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"loadFileModel: Add model with %
zu points, %zu coordIndex, %z
u childs."
),
m_model
->
m_Point
.
size
(),
m_model
->
m_Point
.
size
(),
m_model
->
m_CoordIndex
.
size
(),
m_model
->
m_CoordIndex
.
size
(),
m_model
->
childs
.
size
()
);
m_model
->
childs
.
size
()
);
...
@@ -214,7 +220,7 @@ int VRML2_MODEL_PARSER::loadFileModel( S3D_MESH_PTR aTransformationModel )
...
@@ -214,7 +220,7 @@ int VRML2_MODEL_PARSER::loadFileModel( S3D_MESH_PTR aTransformationModel )
m_model
->
m_rotation
=
aTransformationModel
->
m_rotation
;
m_model
->
m_rotation
=
aTransformationModel
->
m_rotation
;
m_model
->
m_scale
=
aTransformationModel
->
m_scale
;
m_model
->
m_scale
=
aTransformationModel
->
m_scale
;
}
}
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"loadFileModel: Add model with %
lu points, %lu coordIndex, %l
u childs."
),
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"loadFileModel: Add model with %
zu points, %zu coordIndex, %z
u childs."
),
m_model
->
m_Point
.
size
(),
m_model
->
m_Point
.
size
(),
m_model
->
m_CoordIndex
.
size
(),
m_model
->
m_CoordIndex
.
size
(),
m_model
->
childs
.
size
()
);
m_model
->
childs
.
size
()
);
...
@@ -251,7 +257,7 @@ int VRML2_MODEL_PARSER::loadFileModel( S3D_MESH_PTR aTransformationModel )
...
@@ -251,7 +257,7 @@ int VRML2_MODEL_PARSER::loadFileModel( S3D_MESH_PTR aTransformationModel )
m_model
->
m_scale
=
aTransformationModel
->
m_scale
;
m_model
->
m_scale
=
aTransformationModel
->
m_scale
;
}
}
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"loadFileModel: Add model with %
lu points, %lu coordIndex, %l
u childs."
),
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"loadFileModel: Add model with %
zu points, %zu coordIndex, %z
u childs."
),
m_model
->
m_Point
.
size
(),
m_model
->
m_Point
.
size
(),
m_model
->
m_CoordIndex
.
size
(),
m_model
->
m_CoordIndex
.
size
(),
m_model
->
childs
.
size
()
);
m_model
->
childs
.
size
()
);
...
@@ -342,7 +348,7 @@ int VRML2_MODEL_PARSER::read_Transform()
...
@@ -342,7 +348,7 @@ int VRML2_MODEL_PARSER::read_Transform()
}
}
else
else
{
{
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Transform: Add child model with %
lu points, %lu coordIndex, %l
u childs."
),
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Transform: Add child model with %
zu points, %zu coordIndex, %z
u childs."
),
m_model
->
m_Point
.
size
(),
m_model
->
m_Point
.
size
(),
m_model
->
m_CoordIndex
.
size
(),
m_model
->
m_CoordIndex
.
size
(),
m_model
->
childs
.
size
()
);
m_model
->
childs
.
size
()
);
...
@@ -376,7 +382,8 @@ int VRML2_MODEL_PARSER::read_Transform()
...
@@ -376,7 +382,8 @@ int VRML2_MODEL_PARSER::read_Transform()
m_model
->
m_rotation
[
2
]
=
0.0
f
;
m_model
->
m_rotation
[
2
]
=
0.0
f
;
m_model
->
m_rotation
[
3
]
=
0.0
f
;
m_model
->
m_rotation
[
3
]
=
0.0
f
;
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"rotation failed, setting to zeros"
)
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"rotation failed, setting to zeros"
)
);
}
}
else
else
{
{
...
@@ -393,7 +400,8 @@ int VRML2_MODEL_PARSER::read_Transform()
...
@@ -393,7 +400,8 @@ int VRML2_MODEL_PARSER::read_Transform()
{
{
ParseVertex
(
m_file
,
m_model
->
m_scale
);
ParseVertex
(
m_file
,
m_model
->
m_scale
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"scale (%f,%f,%f)"
),
m_model
->
m_scale
.
x
,
m_model
->
m_scale
.
y
,
m_model
->
m_scale
.
z
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"scale (%f,%f,%f)"
),
m_model
->
m_scale
.
x
,
m_model
->
m_scale
.
y
,
m_model
->
m_scale
.
z
);
}
}
else
if
(
strcmp
(
text
,
"scaleOrientation"
)
==
0
)
else
if
(
strcmp
(
text
,
"scaleOrientation"
)
==
0
)
{
{
...
@@ -478,15 +486,15 @@ int VRML2_MODEL_PARSER::read_Transform()
...
@@ -478,15 +486,15 @@ int VRML2_MODEL_PARSER::read_Transform()
{
{
m_model
=
save_ptr
;
m_model
=
save_ptr
;
if
(
((
m_model
->
m_Point
.
size
()
==
0
)
||
(
m_model
->
m_CoordIndex
.
size
()
==
0
))
&&
if
(
((
m_model
->
m_Point
.
size
()
==
0
)
||
(
m_model
->
m_CoordIndex
.
size
()
==
0
))
(
m_model
->
childs
.
size
()
==
0
)
)
&&
(
m_model
->
childs
.
size
()
==
0
)
)
{
{
m_model
.
reset
();
m_model
.
reset
();
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Transform: Shape, skipping model with no points or childs"
)
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Transform: Shape, skipping model with no points or childs"
)
);
}
}
else
else
{
{
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Transform: Shape, Add child model with %
lu points, %lu coordIndex, %l
u childs."
),
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Transform: Shape, Add child model with %
zu points, %zu coordIndex, %z
u childs."
),
m_model
->
m_Point
.
size
(),
m_model
->
m_Point
.
size
(),
m_model
->
m_CoordIndex
.
size
(),
m_model
->
m_CoordIndex
.
size
(),
m_model
->
childs
.
size
()
);
m_model
->
childs
.
size
()
);
...
@@ -498,7 +506,8 @@ int VRML2_MODEL_PARSER::read_Transform()
...
@@ -498,7 +506,8 @@ int VRML2_MODEL_PARSER::read_Transform()
{
{
m_model
.
reset
();
m_model
.
reset
();
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Transform: Shape, discard child."
)
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Transform: Shape, discard child."
)
);
}
}
}
}
else
else
...
@@ -554,7 +563,7 @@ int VRML2_MODEL_PARSER::read_Transform()
...
@@ -554,7 +563,7 @@ int VRML2_MODEL_PARSER::read_Transform()
m_counter_USE_GROUP
++
;
m_counter_USE_GROUP
++
;
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Transform: USE %s Add child model with %
lu points, %lu coordIndex, %l
u childs."
),
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Transform: USE %s Add child model with %
zu points, %zu coordIndex, %z
u childs."
),
useLabel
,
useLabel
,
ptrModel
->
m_Point
.
size
(),
ptrModel
->
m_Point
.
size
(),
ptrModel
->
m_CoordIndex
.
size
(),
ptrModel
->
m_CoordIndex
.
size
(),
...
@@ -566,13 +575,15 @@ int VRML2_MODEL_PARSER::read_Transform()
...
@@ -566,13 +575,15 @@ int VRML2_MODEL_PARSER::read_Transform()
else
else
{
{
debug_exit
();
debug_exit
();
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Transform: USE Failed to get the label name"
)
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Transform: USE Failed to get the label name"
)
);
return
-
1
;
return
-
1
;
}
}
}
}
else
else
{
{
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Transform: %s NotImplemented"
),
text
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Transform: %s NotImplemented"
),
text
);
Read_NotImplemented
(
m_file
,
'}'
);
Read_NotImplemented
(
m_file
,
'}'
);
}
}
}
}
...
@@ -652,7 +663,8 @@ int VRML2_MODEL_PARSER::read_Inline()
...
@@ -652,7 +663,8 @@ int VRML2_MODEL_PARSER::read_Inline()
}
}
else
else
{
{
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"URL Failed to open file: %s"
),
text
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"URL Failed to open file: %s"
),
text
);
}
}
}
}
else
else
...
@@ -681,7 +693,8 @@ int VRML2_MODEL_PARSER::read_DEF_Coordinate()
...
@@ -681,7 +693,8 @@ int VRML2_MODEL_PARSER::read_DEF_Coordinate()
if
(
!
GetNextTag
(
m_file
,
text
,
sizeof
(
text
)
)
)
if
(
!
GetNextTag
(
m_file
,
text
,
sizeof
(
text
)
)
)
{
{
debug_exit
();
debug_exit
();
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_DEF_Coordinate failed to get next tag"
)
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_DEF_Coordinate failed to get next tag"
)
);
return
-
1
;
return
-
1
;
}
}
...
@@ -706,7 +719,8 @@ int VRML2_MODEL_PARSER::read_DEF_Coordinate()
...
@@ -706,7 +719,8 @@ int VRML2_MODEL_PARSER::read_DEF_Coordinate()
if
(
retVal
==
0
)
if
(
retVal
==
0
)
{
{
m_defCoordinateMap
.
insert
(
std
::
make_pair
(
coordinateName
,
m_model
->
m_Point
)
);
m_defCoordinateMap
.
insert
(
std
::
make_pair
(
coordinateName
,
m_model
->
m_Point
)
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_DEF_Coordinate insert %s"
),
coordinateName
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_DEF_Coordinate insert %s"
),
coordinateName
);
}
}
debug_exit
();
debug_exit
();
...
@@ -799,7 +813,7 @@ int VRML2_MODEL_PARSER::read_DEF()
...
@@ -799,7 +813,7 @@ int VRML2_MODEL_PARSER::read_DEF()
}
}
else
else
{
{
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_DEF: Shape, Add child model with %
lu points, %lu coordIndex, %l
u childs."
),
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_DEF: Shape, Add child model with %
zu points, %zu coordIndex, %z
u childs."
),
m_model
->
m_Point
.
size
(),
m_model
->
m_Point
.
size
(),
m_model
->
m_CoordIndex
.
size
(),
m_model
->
m_CoordIndex
.
size
(),
m_model
->
childs
.
size
()
);
m_model
->
childs
.
size
()
);
...
@@ -840,7 +854,7 @@ int VRML2_MODEL_PARSER::read_DEF()
...
@@ -840,7 +854,7 @@ int VRML2_MODEL_PARSER::read_DEF()
m_defGroupMap
[
groupName
]
=
new_mesh_model
;
m_defGroupMap
[
groupName
]
=
new_mesh_model
;
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"Group %s: inserted model with %
lu points, %lu coordIndex, %l
u childs."
),
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"Group %s: inserted model with %
zu points, %zu coordIndex, %z
u childs."
),
tagName
,
tagName
,
new_mesh_model
->
m_Point
.
size
(),
new_mesh_model
->
m_Point
.
size
(),
new_mesh_model
->
m_CoordIndex
.
size
(),
new_mesh_model
->
m_CoordIndex
.
size
(),
...
@@ -1538,7 +1552,8 @@ int VRML2_MODEL_PARSER::read_coordIndex()
...
@@ -1538,7 +1552,8 @@ int VRML2_MODEL_PARSER::read_coordIndex()
}
}
}
}
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_coordIndex m_CoordIndex.size: %lu"
),
m_model
->
m_CoordIndex
.
size
()
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_coordIndex m_CoordIndex.size: %zu"
),
m_model
->
m_CoordIndex
.
size
()
);
debug_exit
();
debug_exit
();
return
0
;
return
0
;
}
}
...
@@ -1595,9 +1610,9 @@ int VRML2_MODEL_PARSER::read_Normal()
...
@@ -1595,9 +1610,9 @@ int VRML2_MODEL_PARSER::read_Normal()
{
{
// Debug
// Debug
if
(
m_normalPerVertex
==
false
)
if
(
m_normalPerVertex
==
false
)
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Normal m_PerFaceNormalsNormalized.size: %
l
u"
),
m_model
->
m_PerFaceNormalsNormalized
.
size
()
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Normal m_PerFaceNormalsNormalized.size: %
z
u"
),
m_model
->
m_PerFaceNormalsNormalized
.
size
()
);
else
else
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Normal m_PerVertexNormalsNormalized.size: %
l
u"
),
m_model
->
m_PerVertexNormalsNormalized
.
size
()
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Normal m_PerVertexNormalsNormalized.size: %
z
u"
),
m_model
->
m_PerVertexNormalsNormalized
.
size
()
);
debug_exit
();
debug_exit
();
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Normal exit"
)
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Normal exit"
)
);
return
0
;
return
0
;
...
@@ -1637,7 +1652,9 @@ int VRML2_MODEL_PARSER::read_Coordinate()
...
@@ -1637,7 +1652,9 @@ int VRML2_MODEL_PARSER::read_Coordinate()
if
(
*
text
==
'}'
)
if
(
*
text
==
'}'
)
{
{
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Coordinate m_Point.size: %lu"
),
m_model
->
m_Point
.
size
()
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Coordinate m_Point.size: %zu"
),
m_model
->
m_Point
.
size
()
);
debug_exit
();
debug_exit
();
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Coordinate exit"
)
);
wxLogTrace
(
traceVrmlV2Parser
,
m_debugSpacer
+
wxT
(
"read_Coordinate exit"
)
);
return
0
;
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment