#include <PrimitivesPlugin_Sphere.h>
+#include <GeomAPI_ShapeExplorer.h>
+
#include <GeomAlgoAPI_PointBuilder.h>
#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_ResultConstruction.h>
#include <ModelAPI_Session.h>
+#include <sstream>
+
//=================================================================================================
PrimitivesPlugin_Sphere::PrimitivesPlugin_Sphere()
{
theSphereAlgo->prepareNamingFaces();
// Insert to faces
+ // Naming for faces and edges
int num = 1;
std::map< std::string, std::shared_ptr<GeomAPI_Shape> > listOfFaces =
theSphereAlgo->getCreatedFaces();
std::shared_ptr<GeomAPI_Shape> aFace = (*it).second;
theResultSphere->generated(aFace, (*it).first, num++);
}
+
+ // Naming vertices
+ GeomAPI_DataMapOfShapeShape aVertices;
+ GeomAPI_ShapeExplorer aVertExp(theSphereAlgo->shape(), GeomAPI_Shape::VERTEX);
+ for(int anIndex = 1; aVertExp.more(); aVertExp.next()) {
+ if (!aVertices.isBound(aVertExp.current())) {
+ std::ostringstream aStream;
+ aStream<<"Vertex_"<<anIndex++;
+ theResultSphere->generated(aVertExp.current(), aStream.str(), num++);
+ aVertices.bind(aVertExp.current(), aVertExp.current());
+ }
+ }
}