*.orig
*~
/.project
+*DFBrowser*
+
bool GeomAPI_Edge::isEqual(const std::shared_ptr<GeomAPI_Shape> theEdge) const
{
+ if (!theEdge.get() || ! theEdge->isEdge())
+ return false;
const TopoDS_Shape& aMyShape = const_cast<GeomAPI_Edge*>(this)->impl<TopoDS_Shape>();
const TopoDS_Shape& aInShape = theEdge->impl<TopoDS_Shape>();
bool GeomAPI_Vertex::isEqual(const std::shared_ptr<GeomAPI_Shape> theVert) const
{
+ if (!theVert.get() || ! theVert->isVertex())
+ return false;
const TopoDS_Shape& aMyShape = const_cast<GeomAPI_Vertex*>(this)->impl<TopoDS_Shape>();
const TopoDS_Shape& aInShape = theVert->impl<TopoDS_Shape>();
// take the face that more close by the indexes
ResultConstructionPtr aConstructionContext =
std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
+ FeaturePtr aContextFeature = aContext->document()->feature(aContext);
// sketch sub-element
if (aConstructionContext &&
- std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aContext).get())
+ std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aContextFeature).get())
{
TDF_Label aLab = myRef.myRef->Label();
// getting a type of selected shape
bool aNoIndexes =
!aLab.FindAttribute(TDataStd_IntPackedMap::GetID(), aSubIds) || aSubIds->Extent() == 0;
// for now working only with composite features
- FeaturePtr aContextFeature = aContext->document()->feature(aContext);
CompositeFeaturePtr aComposite =
std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aContextFeature);
- if (!aComposite || aComposite->numberOfSubs() == 0) {
+ if (!aComposite.get() || aComposite->numberOfSubs() == 0) {
return false;
}
void Model_ResultConstruction::setShape(std::shared_ptr<GeomAPI_Shape> theShape)
{
- if (myShape != theShape) {
+ if (myShape != theShape && (!theShape.get() || !theShape->isEqual(myShape))) {
myShape = theShape;
- if (theShape.get() && (!myShape.get() || !theShape->isEqual(myShape))) {
+ if (theShape.get()) {
myFacesUpToDate = false;
myFaces.clear();
}
{
FeaturePtr aF = std::dynamic_pointer_cast<ModelAPI_Feature>(*aFIter);
if (aF && aF->getKind() == "Extrusion") {
- if (aF->selection("extrusion_face")) {
- ResultPtr aSketchRes = aF->selection("extrusion_face")->context();
- if (aSketchRes) {
- static Events_ID HIDE_DISP = Events_Loop::loop()->eventByName(EVENT_OBJECT_TOHIDE);
- ModelAPI_EventCreator::get()->sendUpdated(aSketchRes, HIDE_DISP);
+ AttributeSelectionListPtr aBase = aF->selectionList("base");
+ if (aBase.get()) {
+ for(int a = aBase->size() - 1; a >= 0; a--) {
+ ResultPtr aSketchRes = aBase->value(a)->context();
+ if (aSketchRes) {
+ static Events_ID HIDE_DISP = Events_Loop::loop()->eventByName(EVENT_OBJECT_TOHIDE);
+ ModelAPI_EventCreator::get()->sendUpdated(aSketchRes, HIDE_DISP);
+ }
}
}
}