Crash fix in sketch manager when find a dected owner.
PartSet_CustomPrs::PartSet_CustomPrs(ModuleBase_IWorkshop* theWorkshop)
: myWorkshop(theWorkshop)
{
+ Handle(PartSet_OperationPrs) myOperationPrs = new PartSet_OperationPrs(); /// AIS presentation for the feature of operation
}
-void PartSet_CustomPrs::setCustomized(const ObjectPtr& theObject)
+void PartSet_CustomPrs::setCustomized(const FeaturePtr& theFeature)
{
-/* QMap<ResultPtr, QList<GeomShapePtr> > aNewCustomized;
+
+ myOperationPrs->setFeature(theFeature);
+ /* QMap<ResultPtr, QList<GeomShapePtr> > aNewCustomized;
QList<GeomShapePtr> aShapeList;
ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
std::shared_ptr<GeomAPI_ICustomPrs> theCustomPrs)
{
bool isDone = false;
- if (myCustomized.contains(theResult)) {
+ /*if (myCustomized.contains(theResult)) {
std::vector<int> aColor = Config_PropManager::color("Visualization", "operation_parameter_color",
OPERATION_PARAMETER_COLOR);
isDone = thePrs->setColor(aColor[0], aColor[1], aColor[2]);
}
}
}
- thePrs->setPointMarker(5, 5.); // Set point as a '+' symbol*/
+ thePrs->setPointMarker(5, 5.); // Set point as a '+' symbol*+/
}
/*
std::vector<int> aColor;
#define PartSet_CustomPrs_H
#include "PartSet.h"
+#include "PartSet_OperationPrs.h"
#include <ModelAPI_Object.h>
#include <ModelAPI_Result.h>
+#include <ModelAPI_Feature.h>
#include <GeomAPI_ICustomPrs.h>
#include <GeomAPI_AISObject.h>
PARTSET_EXPORT PartSet_CustomPrs(ModuleBase_IWorkshop* theWorkshop);
PARTSET_EXPORT virtual ~PartSet_CustomPrs() {};
- void setCustomized(const ObjectPtr& theObject);
+ /// Set the feature is customized
+ /// \param theObject a feature object
+ void setCustomized(const FeaturePtr& theObject);
/// Modifies the given presentation in the custom way.
virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
std::shared_ptr<GeomAPI_ICustomPrs> theCustomPrs);
private:
ModuleBase_IWorkshop* myWorkshop; /// current workshop
-
- QMap<ResultPtr, QList<GeomShapePtr> > myCustomized; /// objects, which are customized
+ Handle(PartSet_OperationPrs) myOperationPrs; /// AIS presentation for the feature of operation
+ //QMap<ResultPtr, QList<GeomShapePtr> > myCustomized; /// objects, which are customized
};
#endif
aDisplayer->updateViewer();
}
-void PartSet_Module::setCustomized(const ObjectPtr& theObject)
+void PartSet_Module::setCustomized(const FeaturePtr& theFeature)
{
std::shared_ptr<PartSet_CustomPrs> aCustomPrs =
std::dynamic_pointer_cast<PartSet_CustomPrs>(myCustomPrs);
if (aCustomPrs.get())
- aCustomPrs->setCustomized(theObject);
+ aCustomPrs->setCustomized(theFeature);
}
bool PartSet_Module::customizeObject(ObjectPtr theObject)
virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
/// Set the object with the object results are customized
- /// \param theObject an object
- void setCustomized(const ObjectPtr& theObject);
+ /// \param theFeature a feature
+ void setCustomized(const FeaturePtr& theFeature);
/** Update the object presentable properties such as color, lines width and other
* If the object is result with the color attribute value set, it is used,
#include "PartSet_OperationPrs.h"
-#include <ModelAPI_Tools.h>
-#include <ModelAPI_ResultConstruction.h>
-#include <GeomAPI_PlanarEdges.h>
+//#include <ModelAPI_Tools.h>
+//#include <ModelAPI_ResultConstruction.h>
+//#include <GeomAPI_PlanarEdges.h>
-#include <BRep_Builder.hxx>
-#include <Prs3d_IsoAspect.hxx>
-#include <TopoDS_Builder.hxx>
+//#include <BRep_Builder.hxx>
+//#include <Prs3d_IsoAspect.hxx>
+//#include <TopoDS_Builder.hxx>
IMPLEMENT_STANDARD_HANDLE(PartSet_OperationPrs, ViewerData_AISShape);
IMPLEMENT_STANDARD_RTTIEXT(PartSet_OperationPrs, ViewerData_AISShape);
-PartSet_OperationPrs::PartSet_OperationPrs(FeaturePtr theFeature)
- : ViewerData_AISShape(TopoDS_Shape()), myFeature(theFeature)
+PartSet_OperationPrs::PartSet_OperationPrs()
+ : ViewerData_AISShape(TopoDS_Shape()), myFeature(FeaturePtr())
+{
+}
+
+void PartSet_OperationPrs::setFeature(FeaturePtr theFeature)
{
/* std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(theResult);
std::shared_ptr<GeomAPI_PlanarEdges> aWirePtr =
public:
/// Constructor
/// \param theResult a result object
- Standard_EXPORT PartSet_OperationPrs(FeaturePtr theFeature);
+ Standard_EXPORT PartSet_OperationPrs();
+
+ /// set the operation feature. It is used in Compute method to group the feature parameter shapes
+ /// theFeature a feature
+ void setFeature(FeaturePtr theFeature);
+
DEFINE_STANDARD_RTTI(PartSet_OperationPrs)
+
protected:
/// Redefinition of virtual function
Standard_EXPORT virtual void Compute(
myIsMouseOverViewProcessed = true;
operationMgr()->onValidateOperation();
- myModule->setCustomized(ObjectPtr());
+ myModule->setCustomized(FeaturePtr());
}
void PartSet_SketcherMgr::commitNestedSketch(ModuleBase_Operation* theOperation)