The Sketch result was displayed after Redo operation, sub-Sketch feature(line) was not displayed.
connect(theFeature, SIGNAL(triggered(bool)), this, SLOT(onFeatureTriggered()));
}
+bool ModuleBase_IModule::canDisplayObject(const ObjectPtr& theObject) const
+{
+ ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
+ return anOperation && anOperation->hasObject(theObject);
+}
void ModuleBase_IModule::onFeatureTriggered()
{
/// It is called as on clearing of property panel as on filling with new widgets\r
virtual void propertyPanelDefined(ModuleBase_Operation* theOperation) {}\r
\r
+ /// Returns whether the object can be displayed at the bounds of the active operation.\r
+ /// Display only current operation results\r
+ /// \param theObject a model object\r
+ virtual bool canDisplayObject(const ObjectPtr& theObject) const;\r
+\r
public slots:\r
/// Called on call of command corresponded to a feature\r
void onFeatureTriggered();\r
myWorkshop->viewer()->removeSelectionFilter(myDocumentShapeFilter);
}
+bool PartSet_Module::canDisplayObject(const ObjectPtr& theObject) const
+{
+ bool aCanDisplay = false;
+ if (mySketchMgr->activeSketch()) {
+ FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
+
+ if (aFeature.get() != NULL) {
+ if (aFeature == mySketchMgr->activeSketch()) {
+ aCanDisplay = false;
+ }
+ else {
+ aCanDisplay = mySketchMgr->sketchOperationIdList().contains(aFeature->getKind().c_str());
+ }
+ }
+ }
+ else {
+ aCanDisplay = ModuleBase_IModule::canDisplayObject(theObject);
+ }
+ return aCanDisplay;
+}
void PartSet_Module::propertyPanelDefined(ModuleBase_Operation* theOperation)
{
/// \param theOperation a stopped operation
virtual void operationStopped(ModuleBase_Operation* theOperation);
+ /// Returns whether the object can be displayed at the bounds of the active operation.
+ /// Display only current operation results for usual operation and ask the sketcher manager
+ /// if it is a sketch operation
+ /// \param theObject a model object
+ virtual bool canDisplayObject(const ObjectPtr& theObject) const;
+
public slots:
/// SLOT, that is called by no more widget signal emitted by property panel
/// Set a specific flag to restart the sketcher operation
/**
* A class for management of sketch operations
+ At the time of the sketcher operation active, only the sketch sub-feature results are
+ displayed in the viewer. After the sketch create/edit operation is finished, the sub-feature
+ are hidden, the sketch feature result is displayed
*/
class PARTSET_EXPORT PartSet_SketcherMgr : public QObject
{
const int MOUSE_SENSITIVITY_IN_PIXEL = 10; ///< defines the local context mouse selection sensitivity
+//#ifdef DEBUG_DISPLAY
// Workaround for bug #25637
void displayedObjects(const Handle(AIS_InteractiveContext)& theAIS, AIS_ListOfInteractive& theList)
if (isVisible(theObject)) {
redisplay(theObject, isUpdateViewer);
} else {
+#ifdef DEBUG_DISPLAY
+ FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
+ if (aFeature.get() != NULL) {
+ qDebug(QString("display feature: %1, displayed: %2").
+ arg(aFeature->data()->name().c_str()).
+ arg(displayedObjects().size()).toStdString().c_str());
+ }
+#endif
AISObjectPtr anAIS;
GeomPresentablePtr aPrs = std::dynamic_pointer_cast<GeomAPI_IPresentable>(theObject);
std::set<ObjectPtr>::const_iterator aIt;
for (aIt = aObjects.begin(); aIt != aObjects.end(); ++aIt) {
ObjectPtr aObj = (*aIt);
+
bool aHide = !aObj->data() || !aObj->data()->isValid();
if (!aHide) { // check that this is not hidden result
ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
} else {
if (myOperationMgr->hasOperation()) {
ModuleBase_Operation* aOperation = myOperationMgr->currentOperation();
- // Display only current operation results if operation has preview
- if (aOperation->hasObject(aObj)/* && aOperation->hasPreview()*/) {
+ if (myModule->canDisplayObject(aObj)) {
displayObject(aObj);
// Deactivate object of current operation from selection
if (myDisplayer->isActive(aObj))
bool aHasPart = false;
bool isDisplayed = false;
for (aIt = aObjects.begin(); aIt != aObjects.end(); ++aIt) {
+
ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(*aIt);
if (aPart) {
aHasPart = true;
// If a feature is created from the aplication's python console
// it doesn't stored in the operation mgr and doesn't displayed
- } else if (myOperationMgr->hasOperation()) {
- ModuleBase_Operation* aOperation = myOperationMgr->currentOperation();
- if (aOperation->hasObject(*aIt)) { // Display only current operation results
- displayObject(*aIt);
- isDisplayed = true;
- }
+ } else if (myModule->canDisplayObject(*aIt)) {
+ displayObject(*aIt);
+ isDisplayed = true;
}
}
if (myObjectBrowser)