#include <TDataStd_ReferenceArray.hxx>
#include <TDataStd_ExtStringList.hxx>
#include <TDataStd_Integer.hxx>
+#include <TDataStd_UAttribute.hxx>
+
/// type of the selection, integer keeps the Selector_Type value
static const Standard_GUID kSEL_TYPE("db174d59-c2e3-4a90-955e-55544df090d6");
if (aContainer->select(theContext, theValue))
return aContainer;
delete aContainer;
- return false;
+ return NULL;
}
+
Selector_Intersect* anIntersect = new Selector_Intersect;
SET_ALGO_FLAGS(anIntersect);
bool aGoodIntersector = anIntersect->select(theContext, theValue);
}
if (!theUseNeighbors) {
delete anIntersect;
- return false;
+ return NULL;
}
// searching by neighbors
Selector_FilterByNeighbors* aNBs = new Selector_FilterByNeighbors;
}
if (!theUseNeighbors) {
delete aModify;
- return false;
+ return NULL;
}
// searching by neighbors
Selector_FilterByNeighbors* aNBs = new Selector_FilterByNeighbors;
return TopoDS_Shape(); // empty, error shape
}
-Selector_Algo* Selector_Algo::restoreByLab(TDF_Label theLab)
+Selector_Algo* Selector_Algo::restoreByLab(TDF_Label theLab, TDF_Label theBaseDocLab)
{
Handle(TDataStd_Integer) aTypeAttr;
- if (!myLab.FindAttribute(kSEL_TYPE, aTypeAttr))
+ if (!theLab.FindAttribute(kSEL_TYPE, aTypeAttr))
return NULL;
Selector_Type aType = Selector_Type(aTypeAttr->Get());
Selector_Algo* aResult = NULL;
}
}
if (aResult) {
- bool aGeomNaming = myLab.IsAttribute(kGEOMETRICAL_NAMING);
aResult->myLab = theLab;
- aResult->myBaseDocumentLab = myBaseDocumentLab;
- aResult->myGeometricalNaming = aGeomNaming;
- aResult->myUseNeighbors = myUseNeighbors;
- aResult->myUseIntersections = myUseIntersections;
+ aResult->myBaseDocumentLab = theBaseDocLab;
+ aResult->myGeometricalNaming = theLab.IsAttribute(kGEOMETRICAL_NAMING);
if (!aResult->restore()) {
delete aResult;
aResult = NULL;
}
} else if (theName[0] == '(') { // filter by neighbors
aResult = new Selector_FilterByNeighbors;
- } if (theName.find(pureWeakNameID()) == 0) { // weak naming identifier
+ } else if (theName.find(pureWeakNameID()) == 0) { // weak naming identifier
+ aResult = new Selector_WeakName;
} else if (theName.find('&') != std::string::npos) { // modification
aResult = new Selector_Modify;
} else { // primitive
void Selector_Algo::storeType(const Selector_Type theType)
{
+ myLab.ForgetAllAttributes(true);
TDataStd_Integer::Set(myLab, kSEL_TYPE, (int)(theType));
+ if (myGeometricalNaming)
+ TDataStd_UAttribute::Set(myLab, kGEOMETRICAL_NAMING);
}