// dump "setName" for composite feature
if (isDumpSetName)
dumpEntitySetName();
+ // dump folders if any
+ dumpFolders();
return isOk;
}
+void ModelHighAPI_Dumper::dumpFolders()
+{
+ std::set<FolderPtr>::const_iterator aFolderIt = myNotDumpedFolders.begin();
+ while (aFolderIt != myNotDumpedFolders.end()) {
+ FolderPtr aFolder = *aFolderIt++;
+ dumpFolder(aFolder);
+ }
+}
+
void ModelHighAPI_Dumper::dumpSubFeatureNameAndColor(const std::string theSubFeatureGet,
const FeaturePtr& theSubFeature)
{
{
EntityNameMap::const_iterator aFound = myNames.find(theEntity);
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theEntity);
- return aFound != myNames.end() || myFeaturesToSkip.find(aFeature) != myFeaturesToSkip.end();
+ return (aFound != myNames.end() && aFound->second.myIsDumped) ||
+ myFeaturesToSkip.find(aFeature) != myFeaturesToSkip.end();
}
bool ModelHighAPI_Dumper::isDefaultColor(const ResultPtr& theResult) const
theDumper.myFullDump << aBufCopy;
// now, store all not dumped folders
- std::set<FolderPtr>::const_iterator aFolderIt = theDumper.myNotDumpedFolders.begin();
- while (aFolderIt != theDumper.myNotDumpedFolders.end()) {
- FolderPtr aFolder = *aFolderIt++;
- theDumper.dumpFolder(aFolder);
- }
+ theDumper.dumpFolders();
return theDumper;
}
/// Check the result feature has default transparency
bool isDefaultTransparency(const ResultPtr& theResult) const;
+ /// Dump stored folders if possible
+ void dumpFolders();
+
private:
struct EntityName {
std::string myCurrentName; ///< default name of current feature
#include "ModelHighAPI_Folder.h"
#include <ModelHighAPI_Dumper.h>
#include <ModelHighAPI_Reference.h>
+#include <ModelHighAPI_Tools.h>
#include <ModelAPI_AttributeReference.h>
#include <ModelAPI_Document.h>
std::shared_ptr<ModelAPI_Folder> aFolder = theDoc->addFolder(theFirstFeature.feature());
AttributeReferencePtr aFirstFeatAttr = aFolder->reference(ModelAPI_Folder::FIRST_FEATURE_ID());
- theFirstFeature.fillAttribute(aFirstFeatAttr);
+ fillAttribute(theFirstFeature.feature(), aFirstFeatAttr);
AttributeReferencePtr aLastFeatAttr = aFolder->reference(ModelAPI_Folder::LAST_FEATURE_ID());
- theLastFeature.fillAttribute(aLastFeatAttr);
+ fillAttribute(theLastFeature.feature(), aLastFeatAttr);
return std::shared_ptr<ModelHighAPI_Folder>(new ModelHighAPI_Folder(aFolder));
}