<source path="chamfer_widget.xml"/>
</feature>
<feature id="FusionFaces" title="Fuse Faces" tooltip="Performs fusion of connected faces"
- icon="icons/Features/fusion_faces.png" auto_preview="true" helpfile="FeaturesPlugin/fusionFacesFeature.html">
+ icon="icons/Features/fusion_faces.png" auto_preview="true" helpfile="fuseFeatureFaces.html">
<source path="fusion_faces_widget.xml"/>
</feature>
<feature id="Defeaturing" title="Defeaturing" tooltip="Perform removing faces from solid"
#endif
}
// clear processed and fill modified recursively
+ std::set<FeaturePtr> aRefSet;
const std::set<std::shared_ptr<ModelAPI_Attribute> >& aRefs = theFeature->data()->refsToMe();
std::set<std::shared_ptr<ModelAPI_Attribute> >::const_iterator aRefIter = aRefs.cbegin();
for(; aRefIter != aRefs.cend(); aRefIter++) {
if ((*aRefIter)->isArgument()) {
FeaturePtr aReferenced = std::dynamic_pointer_cast<ModelAPI_Feature>((*aRefIter)->owner());
if (aReferenced.get()) {
- addModified(aReferenced, theFeature);
+ aRefSet.insert(aReferenced);
}
}
}
if ((*aRIter)->isArgument()) {
FeaturePtr aReferenced = std::dynamic_pointer_cast<ModelAPI_Feature>((*aRIter)->owner());
if (aReferenced.get()) {
- addModified(aReferenced, theFeature);
+ aRefSet.insert(aReferenced);
}
}
}
}
-
// also add part feature that contains this feature to the modified
if (theFeature->document()->kind() != "PartSet") {
FeaturePtr aPart = ModelAPI_Tools::findPartFeature(
ModelAPI_Session::get()->moduleDocument(), theFeature->document());
if (aPart.get())
- addModified(aPart, theFeature);
+ aRefSet.insert(aPart);
}
+ for(std::set<FeaturePtr>::iterator aRef = aRefSet.begin(); aRef != aRefSet.end(); aRef++)
+ addModified(*aRef, theFeature);
+
return true;
}
if (aStringAttr->isInitialized()) {
if (myIsEditing)
aCaseId = QString::fromStdString(aStringAttr->value());
- else
+ else {
aCaseId = QString::fromStdString(aDefVal.empty() ? aStringAttr->value() : aDefVal);
- if (!aStringAttr->isInitialized())
- storeValueCustom();
+ }
int idx = myCaseIds.indexOf(aCaseId);
if (idx == -1)
idx = currentPageIndex();
setCurrentPageIndex(idx);
+ if (aStringAttr->value() != aCaseId.toStdString())
+ storeValueCustom();
}
else {
// It is added because if user edits the feature created from Python
CompositeFeaturePtr aSketch = mySketchMgr->activeSketch();
if (aSketch.get()) {
ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
- if (PartSet_SketcherMgr::isSketchOperation(anOperation))
+ if (PartSet_SketcherMgr::isSketchOperation(anOperation) &&
+ mySketchMgr->previewSketchPlane()->isDisplayed())
mySketchMgr->previewSketchPlane()->createSketchPlane(aSketch, myWorkshop);
}
}
}
+void PartSet_PreviewSketchPlane::clearPlanePreview()
+{
+ myPlane = std::shared_ptr<GeomAPI_AISObject>();
+ myShape = std::shared_ptr<GeomAPI_Shape>();
+}
+
+
void PartSet_PreviewSketchPlane::createSketchPlane(const CompositeFeaturePtr& theSketch,
ModuleBase_IWorkshop* theWorkshop)
{
void setSizeOfView(double theSizeOfView, bool isUseSizeOfView,
const std::shared_ptr<GeomAPI_Pnt>& theCentralPoint = std::shared_ptr<GeomAPI_Pnt>());
+ /// Returns True if the plane preview is already created
bool isPlaneCreated() const {
return myPlane.get();
}
+ /// Returns current state of the plane preview visibility
+ bool isDisplayed() const { return myPreviewIsDisplayed; }
+
+ /// Displays preview planes
+ /// \param theWorkshop the application workshop
void displaySketchPlane(ModuleBase_IWorkshop* theWorkshop);
+ /// Nullyfies current plane preview object.
+ /// Important: Before call of this function the plane has to be erased from viewer
+ void clearPlanePreview();
+
private:
/// Create a square face by parameters
std::shared_ptr<GeomAPI_AISObject> createPreviewPlane();
myCurrentSketch = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aFOperation->feature());
double aSizeOfView = 0;
std::shared_ptr<GeomAPI_Pnt> aCentralPoint;
+ // Reset size of view from previous launches
+ mySketchPlane->setSizeOfView(aSizeOfView, false, aCentralPoint);
if (aFOperation->isEditOperation() &&
mySketchPlane->getDefaultSizeOfView(myCurrentSketch, aSizeOfView, aCentralPoint)) {
mySketchPlane->setSizeOfView(aSizeOfView, true, aCentralPoint);
aModule->sketchMgr()->previewSketchPlane()->setSizeOfView(aSizeOfView, isSetSizeOfView);
if (myViewVisible->isChecked())
aModule->sketchMgr()->previewSketchPlane()->createSketchPlane(aSketch, myWorkshop);
+ else
+ aModule->sketchMgr()->previewSketchPlane()->clearPlanePreview();
}
// 2. if the planes were displayed, change the view projection