aListNamesOfFeatures.push_back(anObjectName);
aListNamesOfFeatures.push_back(aFeature->data()->name());
}
+ else if (aFeature->getKind() == "AddNode")
+ {
+ std::map<std::string, std::string> aFeatureDimensions;
+ aFeatureDimensions = ExchangePlugin_ExportRoot::computeAddNode(aFeature);
+ std::wstring anObjectName = aFeature->firstResult()->data()->name();
+ anAlgo->buildAddNode(anObjectName, aFeatureDimensions);
+ aListNamesOfFeatures.push_back(anObjectName);
+ aListNamesOfFeatures.push_back(aFeature->data()->name());
+ }
}
// Create the end of files
#include <PrimitivesPlugin_Box.h>
#include <PrimitivesPlugin_Cylinder.h>
#include <OperaPlugin_Volume.h>
-
+#include <OperaPlugin_AddNode.h>
#include <GeomAlgoAPI_PointBuilder.h>
return aFeatureDim;
}
+ //===============================================================================================
+ std::map<std::string, std::string> computeAddNode(FeaturePtr theFeature)
+ {
+ //Get attributes
+ std::string aMedium;
+
+ // Get attributes
+ AttributeSelectionPtr aMainSel = theFeature->data()->selection(OperaPlugin_AddNode::MAIN_OBJECT_ID());
+ AttributeSelectionPtr aToolSel = theFeature->data()->selection(OperaPlugin_AddNode::TOOL_OBJECT_ID());
+
+ // Get main data
+ ResultPtr aMainResult = aMainSel->context();
+ FeaturePtr aMainSelFeature = aMainResult->document()->feature(aMainResult);
+ std::wstring aWMainName = aMainResult ? aMainResult->data()->name() : aMainSelFeature->firstResult()->data()->name();
+
+ // Get tool data
+ ResultPtr aToolResult = aToolSel->context();
+ FeaturePtr aToolSelFeature = aToolResult->document()->feature(aToolResult);
+ std::wstring aWToolName = aToolResult ? aToolResult->data()->name() : aToolSelFeature->firstResult()->data()->name();
+
+ // Data out
+ std::map<std::string, std::string> aFeatureDim;
+
+ std::string aMainName(aWMainName.begin(), aWMainName.end());
+ aFeatureDim["main"] = aMainName;
+
+ std::string aToolName(aWToolName.begin(), aWToolName.end());
+ aFeatureDim["tool"] = aToolName;
+
+ return aFeatureDim;
+ }
+
} // namespace ExchangePlugin_ExportRoot
EXCHANGEPLUGIN_EXPORT std::map<std::string, double> computeBox(FeaturePtr theFeature);
EXCHANGEPLUGIN_EXPORT std::map<std::string, double> computeCylinder(FeaturePtr theFeature);
EXCHANGEPLUGIN_EXPORT std::map<std::string, std::string> computeVolume(FeaturePtr theFeature);
+ EXCHANGEPLUGIN_EXPORT std::map<std::string, std::string> computeAddNode(FeaturePtr theFeature);
}
#endif /* EXCHANGEPLUGIN_EXPORTROOT_H_ */
<< std::endl;
}
+//=================================================================================================
+void GeomAlgoAPI_ROOTExport::buildAddNode(const std::wstring &theObjectName,
+ const std::map<std::string, std::string> theFeatureDim)
+{
+ std::string anObjectName(theObjectName.begin(), theObjectName.end());
+
+ myContent << "\t"
+ << "//Exporting AddNode_" << anObjectName << std::endl;
+
+ myContent << "\t"
+ << theFeatureDim["main"] << "->AddNode(" << theFeatureDim["tool"] << ", 1);"
+ << std::endl
+ << std::endl;
+}
+
//=================================================================================================
void GeomAlgoAPI_ROOTExport::buildEnd(const std::string theSolidName,
const std::string theExportName)
const std::map<std::string, std::string> theFeatureDim,
const int theMediumIndex);
+ /// Build AddNode
+ GEOMALGOAPI_EXPORT void buildAddNode(const std::wstring &theObjectName,
+ const std::map<std::string, std::string> theFeatureDim);
+
/// Build Medium
GEOMALGOAPI_EXPORT void addMedium(const std::string theMediumName);