本文整理汇总了C++中base::Placement::fromMatrix方法的典型用法代码示例。如果您正苦于以下问题:C++ Placement::fromMatrix方法的具体用法?C++ Placement::fromMatrix怎么用?C++ Placement::fromMatrix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类base::Placement
的用法示例。
在下文中一共展示了Placement::fromMatrix方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onChanged
void Feature::onChanged(const App::Property* prop)
{
// if the placement has changed apply the change to the point data as well
if (prop == &this->Placement) {
TopoShape& shape = const_cast<TopoShape&>(this->Shape.getShape());
shape.setTransform(this->Placement.getValue().toMatrix());
}
// if the point data has changed check and adjust the transformation as well
else if (prop == &this->Shape) {
if (this->isRecomputing()) {
TopoShape& shape = const_cast<TopoShape&>(this->Shape.getShape());
shape.setTransform(this->Placement.getValue().toMatrix());
}
else {
Base::Placement p;
// shape must not be null to override the placement
if (!this->Shape.getValue().IsNull()) {
p.fromMatrix(this->Shape.getShape().getTransform());
if (p != this->Placement.getValue())
this->Placement.setValue(p);
}
}
}
GeoFeature::onChanged(prop);
}
示例2: onChanged
void Feature::onChanged(const App::Property* prop)
{
// if the placement has changed apply the change to the point data as well
if (prop == &this->Placement) {
PointKernel& pts = const_cast<PointKernel&>(this->Points.getValue());
pts.setTransform(this->Placement.getValue().toMatrix());
}
// if the point data has changed check and adjust the transformation as well
else if (prop == &this->Points) {
Base::Placement p;
p.fromMatrix(this->Points.getValue().getTransform());
if (p != this->Placement.getValue())
this->Placement.setValue(p);
}
GeoFeature::onChanged(prop);
}
示例3: onChanged
void Feature::onChanged(const App::Property* prop)
{
// if the placement has changed apply the change to the mesh data as well
if (prop == &this->Placement) {
MeshObject& mesh = const_cast<MeshObject&>(this->Mesh.getValue());
mesh.setTransform(this->Placement.getValue().toMatrix());
}
// if the mesh data has changed check and adjust the transformation as well
else if (prop == &this->Mesh) {
Base::Placement p;
p.fromMatrix(this->Mesh.getValue().getTransform());
if (p != this->Placement.getValue())
this->Placement.setValue(p);
}
// Note: If the Mesh property has changed the property and this object are marked as 'touched'
// but no recomputation of this objects needs to be done because the Mesh property is regarded
// as output of a previous recomputation The mustExecute() method returns 0 in that case.
// However, objects that reference this object the Mesh property can be an input parameter.
// As this object and the property are touched such objects can check this and return a value 1
// (or -1) in their mustExecute() to be recomputed the next time the document recomputes itself.
DocumentObject::onChanged(prop);
}