TopAbs_ShapeEnum translateType (const std::string& theType)
{
// map from the textual shape types to OCCT enumeration
- static std::map<std::string, TopAbs_ShapeEnum> MyShapeTypes;
- if (MyShapeTypes.size() == 0) {
- MyShapeTypes["face"] = TopAbs_FACE;
- MyShapeTypes["faces"] = TopAbs_FACE;
- MyShapeTypes["vertex"] = TopAbs_VERTEX;
- MyShapeTypes["vertices"] = TopAbs_VERTEX;
- MyShapeTypes["wire"] = TopAbs_WIRE;
- MyShapeTypes["edge"] = TopAbs_EDGE;
- MyShapeTypes["edges"] = TopAbs_EDGE;
- MyShapeTypes["shell"] = TopAbs_SHELL;
- MyShapeTypes["solid"] = TopAbs_SOLID;
- MyShapeTypes["solids"] = TopAbs_SOLID;
- MyShapeTypes["FACE"] = TopAbs_FACE;
- MyShapeTypes["FACES"] = TopAbs_FACE;
- MyShapeTypes["VERTEX"] = TopAbs_VERTEX;
- MyShapeTypes["VERTICES"] = TopAbs_VERTEX;
- MyShapeTypes["WIRE"] = TopAbs_WIRE;
- MyShapeTypes["EDGE"] = TopAbs_EDGE;
- MyShapeTypes["EDGES"] = TopAbs_EDGE;
- MyShapeTypes["SHELL"] = TopAbs_SHELL;
- MyShapeTypes["SOLID"] = TopAbs_SOLID;
- MyShapeTypes["SOLIDS"] = TopAbs_SOLID;
+ static std::map<std::string, TopAbs_ShapeEnum> aShapeTypes;
+
+ if(aShapeTypes.size() == 0) {
+ aShapeTypes["compound"] = TopAbs_COMPOUND;
+ aShapeTypes["compounds"] = TopAbs_COMPOUND;
+ aShapeTypes["compsolid"] = TopAbs_COMPSOLID;
+ aShapeTypes["compsolids"] = TopAbs_COMPSOLID;
+ aShapeTypes["solid"] = TopAbs_SOLID;
+ aShapeTypes["solids"] = TopAbs_SOLID;
+ aShapeTypes["shell"] = TopAbs_SHELL;
+ aShapeTypes["shells"] = TopAbs_SHELL;
+ aShapeTypes["face"] = TopAbs_FACE;
+ aShapeTypes["faces"] = TopAbs_FACE;
+ aShapeTypes["wire"] = TopAbs_WIRE;
+ aShapeTypes["wires"] = TopAbs_WIRE;
+ aShapeTypes["edge"] = TopAbs_EDGE;
+ aShapeTypes["edges"] = TopAbs_EDGE;
+ aShapeTypes["vertex"] = TopAbs_VERTEX;
+ aShapeTypes["vertices"] = TopAbs_VERTEX;
+ aShapeTypes["COMPOUND"] = TopAbs_COMPOUND;
+ aShapeTypes["COMPOUNDS"] = TopAbs_COMPOUND;
+ aShapeTypes["COMPSOLID"] = TopAbs_COMPSOLID;
+ aShapeTypes["COMPSOLIDS"] = TopAbs_COMPSOLID;
+ aShapeTypes["SOLID"] = TopAbs_SOLID;
+ aShapeTypes["SOLIDS"] = TopAbs_SOLID;
+ aShapeTypes["SHELL"] = TopAbs_SHELL;
+ aShapeTypes["SHELLS"] = TopAbs_SHELL;
+ aShapeTypes["FACE"] = TopAbs_FACE;
+ aShapeTypes["FACES"] = TopAbs_FACE;
+ aShapeTypes["WIRE"] = TopAbs_WIRE;
+ aShapeTypes["WIRES"] = TopAbs_WIRE;
+ aShapeTypes["EDGE"] = TopAbs_EDGE;
+ aShapeTypes["EDGES"] = TopAbs_EDGE;
+ aShapeTypes["VERTEX"] = TopAbs_VERTEX;
+ aShapeTypes["VERTICES"] = TopAbs_VERTEX;
}
- if (MyShapeTypes.find(theType) != MyShapeTypes.end())
- return MyShapeTypes[theType];
+ if (aShapeTypes.find(theType) != aShapeTypes.end())
+ return aShapeTypes[theType];
- Events_Error::send("Shape type defined in XML is not implemented!");
+ Events_InfoMessage("Model_SelectionNaming", "Shape type defined in XML is not implemented!").send();
return TopAbs_SHAPE;
}
#include <TopoDS_Iterator.hxx>
#include <GeomDataAPI_Point2D.h>
- #include <Events_Error.h>
+ #include <Events_InfoMessage.h>
+#include <GeomAPI_ShapeExplorer.h>
#include <Config_PropManager.h>
TopAbs_ShapeEnum shapeType(const QString& theType)
{
- if (MyShapeTypes.count() == 0) {
- MyShapeTypes["face"] = TopAbs_FACE;
- MyShapeTypes["faces"] = TopAbs_FACE;
- MyShapeTypes["vertex"] = TopAbs_VERTEX;
- MyShapeTypes["vertices"] = TopAbs_VERTEX;
- MyShapeTypes["wire"] = TopAbs_WIRE;
- MyShapeTypes["wires"] = TopAbs_WIRE;
- MyShapeTypes["edge"] = TopAbs_EDGE;
- MyShapeTypes["edges"] = TopAbs_EDGE;
- MyShapeTypes["shell"] = TopAbs_SHELL;
- MyShapeTypes["solid"] = TopAbs_SOLID;
- MyShapeTypes["solids"] = TopAbs_SOLID;
- MyShapeTypes["objects"] = TopAbs_SHAPE;
+ if (myShapeTypes.count() == 0) {
+ myShapeTypes["compound"] = TopAbs_COMPOUND;
+ myShapeTypes["compounds"] = TopAbs_COMPOUND;
+ myShapeTypes["compsolid"] = TopAbs_COMPSOLID;
+ myShapeTypes["compsolids"] = TopAbs_COMPSOLID;
+ myShapeTypes["solid"] = TopAbs_SOLID;
+ myShapeTypes["solids"] = TopAbs_SOLID;
+ myShapeTypes["shell"] = TopAbs_SHELL;
+ myShapeTypes["shells"] = TopAbs_SHELL;
+ myShapeTypes["face"] = TopAbs_FACE;
+ myShapeTypes["faces"] = TopAbs_FACE;
+ myShapeTypes["wire"] = TopAbs_WIRE;
+ myShapeTypes["wires"] = TopAbs_WIRE;
+ myShapeTypes["edge"] = TopAbs_EDGE;
+ myShapeTypes["edges"] = TopAbs_EDGE;
+ myShapeTypes["vertex"] = TopAbs_VERTEX;
+ myShapeTypes["vertices"] = TopAbs_VERTEX;
+ myShapeTypes["objects"] = TopAbs_SHAPE;
}
QString aType = theType.toLower();
- if (MyShapeTypes.contains(aType))
- return MyShapeTypes[aType];
+ if(myShapeTypes.contains(aType))
+ return myShapeTypes[aType];
- Events_Error::send("Shape type defined in XML is not implemented!");
+ Events_InfoMessage("ModuleBase_Tools", "Shape type defined in XML is not implemented!").send();
return TopAbs_SHAPE;
}