myDumpBuffer << ".setDeflection(" << aDeflectionAttr->value() << ")" << std::endl;
}
}
+ // set result transparency
+ if (!isDefaultTransparency(*aResIt)) {
+ AttributeDoublePtr aTransparencyAttr =
+ (*aResIt)->data()->real(ModelAPI_Result::TRANSPARENCY_ID());
+ if(aTransparencyAttr.get() && aTransparencyAttr->isInitialized()) {
+ *this << *aResIt;
+ myDumpBuffer << ".setTransparency(" << aTransparencyAttr->value() << ")" << std::endl;
+ }
+ }
}
myNames[aLastDumped.myEntity].myIsDumped = true;
return fabs(aCurrent - aDefault) < 1.e-12;
}
+bool ModelHighAPI_Dumper::isDefaultTransparency(const ResultPtr& theResult) const
+{
+ AttributeDoublePtr anAttribute = theResult->data()->real(ModelAPI_Result::TRANSPARENCY_ID());
+ if(!anAttribute || !anAttribute->isInitialized()) {
+ return true;
+ }
+ return fabs(anAttribute->value()) < 1.e-12;
+}
+
ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(const char theChar)
{
myDumpBuffer << theChar;
std::list<ResultPtr>::const_iterator aResIt = aResults.begin();
for (; aResIt != aResults.end(); ++aResIt) {
if (!myNames[*aResIt].myIsDefault || !isDefaultColor(*aResIt) ||
- !isDefaultDeflection(*aResIt))
+ !isDefaultDeflection(*aResIt) || !isDefaultTransparency(*aResIt))
aResultsWithNameOrColor.push_back(*aResIt);
ResultCompSolidPtr aCompSolid =
for (int i = 0; i < aNbSubs; ++i) {
ResultPtr aCurRes = aCompSolid->subResult(i);
if (!myNames[aCurRes].myIsDefault || !isDefaultColor(aCurRes) ||
- !isDefaultDeflection(aCurRes))
+ !isDefaultDeflection(aCurRes) || !isDefaultTransparency(aCurRes))
aResultsWithNameOrColor.push_back(aCurRes);
}
}