Hi Laurens,
On 18 February 2016 at 08:14, Voerman, L. <[email protected]> wrote:
> No problem (i think) only weird to make variables zero and one and assign
> both value zero.
>
I have just reviewed the code and the naming is what is mis-leading rather
than assigning the both values to 0. The zero and one values are counts
that are incremented by the getTransparencyCounts() method.
To avoid this confusion I have renamed the variables to transparentCount
and opaqueCount. These changes are now checked into master and the OSG-3.4
branch.
Robert
$ git diff
diff --git a/src/osgPlugins/dae/daeRMaterials.cpp
b/src/osgPlugins/dae/daeRMaterials.cpp
index 59c16a5..158ca35 100644
--- a/src/osgPlugins/dae/daeRMaterials.cpp
+++ b/src/osgPlugins/dae/daeRMaterials.cpp
@@ -39,7 +39,7 @@ using namespace ColladaDOM141;
#endif
template <typename T>
-void daeReader::getTransparencyCounts(daeDatabase* database, int& zero,
int& one) const
+void daeReader::getTransparencyCounts(daeDatabase* database, int&
transparentCount, int& opaqueCount) const
{
std::vector<T*> constantVec;
database->typeLookup(constantVec);
@@ -51,7 +51,7 @@ void daeReader::getTransparencyCounts(daeDatabase*
database, int& zero, int& one
domFx_opaque_enum opaque = pTransparent->getOpaque();
if (opaque == FX_OPAQUE_ENUM_RGB_ZERO)
{
- ++one;
+ ++opaqueCount;
continue;
}
}
@@ -77,11 +77,11 @@ void daeReader::getTransparencyCounts(daeDatabase*
database, int& zero, int& one
if (transparency < 0.01f)
{
- ++zero;
+ ++transparentCount;
}
else if (transparency > 0.99f)
{
- ++one;
+ ++opaqueCount;
}
}
@@ -91,13 +91,13 @@ void daeReader::getTransparencyCounts(daeDatabase*
database, int& zero, int& one
bool daeReader::findInvertTransparency(daeDatabase* database) const
{
- int zero = 0, one = 0;
-
getTransparencyCounts<domProfile_COMMON::domTechnique::domConstant>(database,
zero, one);
-
getTransparencyCounts<domProfile_COMMON::domTechnique::domLambert>(database,
zero, one);
-
getTransparencyCounts<domProfile_COMMON::domTechnique::domPhong>(database,
zero, one);
-
getTransparencyCounts<domProfile_COMMON::domTechnique::domBlinn>(database,
zero, one);
+ int transparentCount = 0, opaqueCount = 0;
+
getTransparencyCounts<domProfile_COMMON::domTechnique::domConstant>(database,
transparentCount, opaqueCount);
+
getTransparencyCounts<domProfile_COMMON::domTechnique::domLambert>(database,
transparentCount, opaqueCount);
+
getTransparencyCounts<domProfile_COMMON::domTechnique::domPhong>(database,
transparentCount, opaqueCount);
+
getTransparencyCounts<domProfile_COMMON::domTechnique::domBlinn>(database,
transparentCount, opaqueCount);
- return zero > one;
+ return transparentCount > opaqueCount;
}
// <bind_material>
Robert.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org