本文整理汇总了C++中part::Feature::globalPlacement方法的典型用法代码示例。如果您正苦于以下问题:C++ Feature::globalPlacement方法的具体用法?C++ Feature::globalPlacement怎么用?C++ Feature::globalPlacement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类part::Feature
的用法示例。
在下文中一共展示了Feature::globalPlacement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
App::DocumentObjectExecReturn* ShapeBinder::execute(void) {
if (!this->isRestoring()) {
Part::Feature* obj = nullptr;
std::vector<std::string> subs;
ShapeBinder::getFilteredReferences(&Support, obj, subs);
//if we have a link we rebuild the shape, but we change nothing if we are a simple copy
if (obj) {
Part::TopoShape shape = ShapeBinder::buildShapeFromReferences(obj, subs);
//now, shape is in object's CS, and includes local Placement of obj but nothing else.
if (TraceSupport.getValue()) {
//compute the transform, and apply it to the shape.
Base::Placement sourceCS = //full placement of container of obj
obj->globalPlacement() * obj->Placement.getValue().inverse();
Base::Placement targetCS = //full placement of container of this shapebinder
this->globalPlacement() * this->Placement.getValue().inverse();
Base::Placement transform = targetCS.inverse() * sourceCS;
shape.setPlacement(transform * shape.getPlacement());
}
this->Placement.setValue(shape.getTransform());
this->Shape.setValue(shape);
}
}
return Part::Feature::execute();
}