Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Plugin-PropertyVis
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenFlipper-Free
Plugin-PropertyVis
Commits
5ccaa333
Commit
5ccaa333
authored
Nov 03, 2017
by
Martin Heistermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setPropertyFromFile: use reference instead of pointer; cosmetics
parent
8c30c68e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
17 deletions
+17
-17
OpenMesh/OMPropertyModel.hh
OpenMesh/OMPropertyModel.hh
+1
-1
OpenMesh/OMPropertyModelT.cc
OpenMesh/OMPropertyModelT.cc
+3
-3
SingleObjectPropertyModel.cc
SingleObjectPropertyModel.cc
+12
-12
SingleObjectPropertyModel.hh
SingleObjectPropertyModel.hh
+1
-1
No files found.
OpenMesh/OMPropertyModel.hh
View file @
5ccaa333
...
...
@@ -117,7 +117,7 @@ private:
virtual
void
saveProperty
();
virtual
bool
parseHeader
(
QString
header
,
PropertyVisualizer
*&
propVis
,
unsigned
int
&
n
);
virtual
void
setPropertyFromFile
(
QTextStream
*
file_stream_
,
unsigned
int
n
,
PropertyVisualizer
*
propVis
);
virtual
void
setPropertyFromFile
(
QTextStream
&
file_stream
,
unsigned
int
n
,
PropertyVisualizer
*
propVis
);
/// Disables picking.
void
resetPicking
();
...
...
OpenMesh/OMPropertyModelT.cc
View file @
5ccaa333
...
...
@@ -305,7 +305,7 @@ bool OMPropertyModel<MeshT>::parseHeader(QString header, PropertyVisualizer*& pr
template
<
typename
MeshT
>
void
OMPropertyModel
<
MeshT
>::
setPropertyFromFile
(
QTextStream
*
file_stream_
,
unsigned
int
n
,
PropertyVisualizer
*
propVis
)
void
OMPropertyModel
<
MeshT
>::
setPropertyFromFile
(
QTextStream
&
file_stream
,
unsigned
int
n
,
PropertyVisualizer
*
propVis
)
{
#ifdef ENABLE_SKELETON_SUPPORT
if
(
propVis
->
getPropertyInfo
().
typeinfo
()
==
proptype_SkinWeights
)
...
...
@@ -314,7 +314,7 @@ void OMPropertyModel<MeshT>::setPropertyFromFile(QTextStream* file_stream_, unsi
{
QString
propertyText
=
""
;
QString
tmp
;
while
((
tmp
=
file_stream
_
->
readLine
())
!=
""
)
while
((
tmp
=
file_stream
.
readLine
())
!=
""
)
propertyText
=
propertyText
+
tmp
;
propVis
->
setPropertyFromText
(
i
,
propertyText
);
}
...
...
@@ -322,7 +322,7 @@ void OMPropertyModel<MeshT>::setPropertyFromFile(QTextStream* file_stream_, unsi
else
#endif
{
SingleObjectPropertyModel
::
setPropertyFromFile
(
file_stream
_
,
n
,
propVis
);
SingleObjectPropertyModel
::
setPropertyFromFile
(
file_stream
,
n
,
propVis
);
}
}
...
...
SingleObjectPropertyModel.cc
View file @
5ccaa333
...
...
@@ -262,20 +262,20 @@ void SingleObjectPropertyModel::saveProperty(unsigned int propId)
QString
filename
=
getSaveFilename
(
propId
);
if
(
filename
==
""
)
return
;
QFile
file
_
(
filename
);
if
(
!
file
_
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Text
|
QIODevice
::
Truncate
))
{
QFile
file
(
filename
);
if
(
!
file
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Text
|
QIODevice
::
Truncate
))
{
std
::
cerr
<<
"PropertyVis saveProperty(): cannot open file for writing"
<<
std
::
endl
;
return
;
}
QTextStream
file_stream
_
(
&
file_
);
QTextStream
file_stream
(
&
file
);
file_stream
_
<<
propVis
->
getHeader
()
<<
'\n'
;
file_stream
<<
propVis
->
getHeader
()
<<
'\n'
;
int
n
=
propVis
->
getEntityCount
();
for
(
int
i
=
0
;
i
<
n
;
++
i
)
{
QString
propertyText
=
propVis
->
getPropertyText
(
i
);
file_stream
_
<<
propertyText
<<
'\n'
;
file_stream
<<
propertyText
<<
'\n'
;
}
}
...
...
@@ -285,21 +285,21 @@ void SingleObjectPropertyModel::loadProperty()
QString
filename
=
getLoadFilename
();
if
(
filename
==
""
)
return
;
QFile
file
_
(
filename
);
if
(
!
file
_
.
open
(
QIODevice
::
ReadOnly
|
QIODevice
::
Text
))
{
QFile
file
(
filename
);
if
(
!
file
.
open
(
QIODevice
::
ReadOnly
|
QIODevice
::
Text
))
{
std
::
cerr
<<
"PropertyVis loadProperty(): cannot open file for reading"
<<
std
::
endl
;
return
;
}
QTextStream
file_stream
_
(
&
file_
);
QTextStream
file_stream
(
&
file
);
QString
header
=
file_stream
_
.
readLine
();
QString
header
=
file_stream
.
readLine
();
PropertyVisualizer
*
propVis
;
unsigned
int
n
;
if
(
parseHeader
(
header
,
propVis
,
n
))
{
setPropertyFromFile
(
&
file_stream_
,
n
,
propVis
);
setPropertyFromFile
(
file_stream
,
n
,
propVis
);
}
else
{
...
...
@@ -308,11 +308,11 @@ void SingleObjectPropertyModel::loadProperty()
}
void
SingleObjectPropertyModel
::
setPropertyFromFile
(
QTextStream
*
file_stream_
,
unsigned
int
n
,
PropertyVisualizer
*
propVis
)
void
SingleObjectPropertyModel
::
setPropertyFromFile
(
QTextStream
&
file_stream
,
unsigned
int
n
,
PropertyVisualizer
*
propVis
)
{
for
(
unsigned
int
i
=
0
;
i
<
n
;
++
i
)
{
QString
propertyText
=
file_stream
_
->
readLine
();
QString
propertyText
=
file_stream
.
readLine
();
propVis
->
setPropertyFromText
(
i
,
propertyText
);
}
}
...
...
SingleObjectPropertyModel.hh
View file @
5ccaa333
...
...
@@ -170,7 +170,7 @@ protected:
void
loadProperty
();
/// Sets the property values from a given file.
virtual
void
setPropertyFromFile
(
QTextStream
*
file_stream_
,
unsigned
int
n
,
PropertyVisualizer
*
propVis
);
virtual
void
setPropertyFromFile
(
QTextStream
&
file_stream
,
unsigned
int
n
,
PropertyVisualizer
*
propVis
);
/**
* @brief Parses the property file header.
...
...
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