#include <string>
#include <utility>
//--------------------------------------------------------------------------------------
+class GeomAPI_Pnt;
class GeomAPI_Shape;
class ModelAPI_AttributeSelection;
class ModelAPI_AttributeSelectionList;
typedef std::pair<std::shared_ptr<ModelAPI_Result>, std::shared_ptr<GeomAPI_Shape> >
ResultSubShapePair;
typedef std::pair<std::string, std::string> TypeSubShapeNamePair;
+typedef std::pair<std::string, std::shared_ptr<GeomAPI_Pnt> > TypeInnerPointPair;
+typedef std::pair<std::string, std::pair<std::string, int> > TypeWeakNamingPair;
//--------------------------------------------------------------------------------------
/**\class ModelHighAPI_Selection
* \ingroup CPPHighAPI
enum VariantType {
VT_Empty,
VT_ResultSubShapePair,
- VT_TypeSubShapeNamePair
+ VT_TypeSubShapeNamePair,
+ VT_TypeInnerPointPair,
+ VT_WeakNamingPair
};
public:
MODELHIGHAPI_EXPORT
ModelHighAPI_Selection(const std::string& theType,
const std::string& theSubShapeName);
+
+ /// Constructor for sub-shape by inner point coordinates
+ MODELHIGHAPI_EXPORT
+ ModelHighAPI_Selection(const std::string& theType,
+ const std::shared_ptr<GeomAPI_Pnt>& theSubShapeInnerPoint);
+
+
+ /// Constructor for sub-shape by weak naming identifier
+ MODELHIGHAPI_EXPORT
+ ModelHighAPI_Selection(const std::string& theType,
+ const std::string& theContextName, const int theIndex);
+
/// Destructor
MODELHIGHAPI_EXPORT
virtual ~ModelHighAPI_Selection();
MODELHIGHAPI_EXPORT
virtual TypeSubShapeNamePair typeSubShapeNamePair() const;
+ /// \return pair of sub-shape type and inner point to identify sub-shape.
+ MODELHIGHAPI_EXPORT
+ virtual TypeInnerPointPair typeInnerPointPair() const;
+
/// \return shape type.
MODELHIGHAPI_EXPORT
virtual std::string shapeType() const;
MODELHIGHAPI_EXPORT
void setName(const std::string& theName);
+ /// Shortcut for result()->data()->name()
+ MODELHIGHAPI_EXPORT
+ std::string name() const;
+
/// Change result's color
MODELHIGHAPI_EXPORT
void setColor(int theRed, int theGreen, int theBlue);
VariantType myVariantType;
ResultSubShapePair myResultSubShapePair;
TypeSubShapeNamePair myTypeSubShapeNamePair;
+ TypeInnerPointPair myTypeInnerPointPair;
+ TypeWeakNamingPair myWeakNamingPair;
};
//--------------------------------------------------------------------------------------