aConstr->setShape(GeomAlgoAPI_PointBuilder::point(aPnt));
setResult(aConstr);
}
+
+bool ConstructionPlugin_Point::customisePresentation(ResultPtr theResult,
+ AISObjectPtr thePrs,
+ std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs)
+{
+ bool isCustomized = theDefaultPrs.get() != NULL &&
+ theDefaultPrs->customisePresentation(theResult, thePrs, theDefaultPrs);
+ thePrs->setPointMarker(1, 1.); // Set point as a '+' symbol
+ return true;
+}
#include "ConstructionPlugin.h"
#include <ModelAPI_Feature.h>
#include <ModelAPI_Result.h>
+#include <GeomAPI_ICustomPrs.h>
/**\class ConstructionPlugin_Point
* \ingroup Plugins
* \brief Feature for creation of the new part in PartSet.
*/
-class ConstructionPlugin_Point : public ModelAPI_Feature
+class ConstructionPlugin_Point : public ModelAPI_Feature, public GeomAPI_ICustomPrs
{
public:
/// Returns the kind of a feature
/// Use plugin manager for features creation
ConstructionPlugin_Point();
+
+ /// Customize presentation of the feature
+ virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
+ std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs);
};
#endif
}
}
else if (aShapeType == 7) { // otherwise this is a vertex
- // thePrs->setPointMarker(6, 2.);
+ thePrs->setPointMarker(1, 1.); // Set point as a '+' symbol
}
return isCustomized;
}