TechDraw: Link related changes
* Support link and group objects * Support view sync by implementing view provider API getMDIView() * Use handleChangedPropertyType() for object migration instead of reimplementing Restore() because of a lots of changes in PropertyContainer::Restore(). * Various other small fixes.
This commit is contained in:
@@ -127,9 +127,6 @@ MeasureType Measurement::getType()
|
||||
|
||||
for (;obj != objects.end(); ++obj, ++subEl) {
|
||||
|
||||
const Part::Feature *refObj = static_cast<const Part::Feature*>((*obj));
|
||||
const Part::TopoShape& refShape = refObj->Shape.getShape();
|
||||
|
||||
// Check if solid object
|
||||
if(strcmp((*subEl).c_str(), "") == 0) {
|
||||
vols++;
|
||||
@@ -137,7 +134,9 @@ MeasureType Measurement::getType()
|
||||
|
||||
TopoDS_Shape refSubShape;
|
||||
try {
|
||||
refSubShape = refShape.getSubShape((*subEl).c_str());
|
||||
refSubShape = Part::Feature::getShape(*obj,(*subEl).c_str(),true);
|
||||
if(refSubShape.IsNull())
|
||||
return Invalid;
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
std::stringstream errorMsg;
|
||||
@@ -210,22 +209,13 @@ MeasureType Measurement::getType()
|
||||
|
||||
TopoDS_Shape Measurement::getShape(App::DocumentObject *obj , const char *subName) const
|
||||
{
|
||||
const Part::Feature *refObj = static_cast<const Part::Feature*>(obj);
|
||||
const Part::TopoShape& refShape = refObj->Shape.getShape();
|
||||
|
||||
// Check if selecting whol object
|
||||
if(strcmp(subName, "") == 0) {
|
||||
return refShape.getShape();
|
||||
} else {
|
||||
|
||||
TopoDS_Shape refSubShape;
|
||||
try {
|
||||
refSubShape = refShape.getSubShape(subName);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
return refSubShape;
|
||||
try {
|
||||
auto shape = Part::Feature::getShape(obj,subName,true);
|
||||
if(shape.IsNull())
|
||||
throw Part::NullShapeException("null shape");
|
||||
return shape;
|
||||
} catch (Standard_Failure& e) {
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user