Now fillet validator will ignore coincides with lines which are not on start/end point.
SketchPlugin_Tools::findCoincidences(theConstraintCoincidence,
SketchPlugin_ConstraintCoincidence::ENTITY_A(),
- aCoincides);
+ aCoincides,
+ true);
SketchPlugin_Tools::findCoincidences(theConstraintCoincidence,
SketchPlugin_ConstraintCoincidence::ENTITY_B(),
- aCoincides);
+ aCoincides,
+ true);
// Remove points from set of coincides.
std::set<FeaturePtr> aNewSetOfCoincides;
for(std::set<FeaturePtr>::iterator anIt = aCoincides.begin(); anIt != aCoincides.end(); ++anIt) {
std::shared_ptr<SketchPlugin_SketchEntity> aSketchEntity =
std::dynamic_pointer_cast<SketchPlugin_SketchEntity>(*anIt);
- if(aSketchEntity.get() && aSketchEntity->isCopy()) {
+ if(aSketchEntity.get() && (aSketchEntity->isCopy() || aSketchEntity->isExternal())) {
continue;
}
if((*anIt)->getKind() == SketchPlugin_Line::ID()) {
void findCoincidences(const FeaturePtr theStartCoin,
const std::string& theAttr,
- std::set<FeaturePtr>& theList)
+ std::set<FeaturePtr>& theList,
+ const bool theIsAttrOnly)
{
AttributeRefAttrPtr aPnt = theStartCoin->refattr(theAttr);
if(!aPnt) {
if(aOrig.get() == NULL) {
return;
}
- theList.insert(aObj);
+ if(!theIsAttrOnly || !aPnt->isObject()) {
+ theList.insert(aObj);
+ }
std::set<FeaturePtr> aCoincidences = findCoincidentConstraints(aObj);
std::set<FeaturePtr>::const_iterator aCIt = aCoincidences.begin();
for (; aCIt != aCoincidences.end(); ++aCIt) {
FeaturePtr aConstrFeature = *aCIt;
std::shared_ptr<GeomAPI_Pnt2d> aPnt = getCoincidencePoint(aConstrFeature);
if(aPnt.get() && aOrig->isEqual(aPnt)) {
- findCoincidences(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_A(), theList);
- findCoincidences(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_B(), theList);
+ findCoincidences(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_A(), theList, theIsAttrOnly);
+ findCoincidences(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_B(), theList, theIsAttrOnly);
}
}
}
/// \param[in] theStartCoin coincidence feature
/// \param[in] theAttr attribute name
/// \param[out] theList list of lines
+/// \param[in] theIsAttrOnly if true includes only coincidences with attributes.
void findCoincidences(const FeaturePtr theStartCoin,
const std::string& theAttr,
- std::set<FeaturePtr>& theList);
+ std::set<FeaturePtr>& theList,
+ const bool theIsAttrOnly = false);
/// Find all features the point is coincident to.
std::set<FeaturePtr> findFeaturesCoincidentToPoint(const AttributePoint2DPtr& thePoint);
std::set<FeaturePtr> aCoinsides;
SketchPlugin_Tools::findCoincidences(aConstraintCoincidence,
SketchPlugin_ConstraintCoincidence::ENTITY_A(),
- aCoinsides);
+ aCoinsides,
+ true);
SketchPlugin_Tools::findCoincidences(aConstraintCoincidence,
SketchPlugin_ConstraintCoincidence::ENTITY_B(),
- aCoinsides);
+ aCoinsides,
+ true);
- // Remove points from set of coincides.
+ // Remove points and external lines from set of coincides.
std::set<FeaturePtr> aNewSetOfCoincides;
for(std::set<FeaturePtr>::iterator anIt = aCoinsides.begin();
anIt != aCoinsides.end(); ++anIt) {
std::shared_ptr<SketchPlugin_SketchEntity> aSketchEntity =
std::dynamic_pointer_cast<SketchPlugin_SketchEntity>(*anIt);
- if(aSketchEntity.get() && aSketchEntity->isCopy()) {
+ if(aSketchEntity.get() && (aSketchEntity->isCopy() || aSketchEntity->isExternal())) {
continue;
}
if((*anIt)->getKind() != SketchPlugin_Line::ID() &&