上等兵
UID9443669
U币1
G币116
技术0
主题3
精华0
阅读权限20
注册时间2020-10-25
最后登录2022-2-13
在线时间14 小时
上等兵
|
C++
//设置图层透明度
DisplayModification *displayModification1;
displayModification1 = theSession->DisplayManager()->NewDisplayModification();
displayModification1->SetApplyToAllFaces(false);
displayModification1->SetApplyToOwningParts(false);
//判断
if (EnumValue == 0)
{
for (int i = 0;i < theselection0.size();i++)
{
displayModification1->SetNewTranslucency(100); //设置透明度
std::vector<DisplayableObject *> objects1(1);
Face *face1(dynamic_cast<Face *>(NXObjectManager::Get(theselection0->Tag())));
objects1[0] = face1;
displayModification1->Apply(objects1);
}
}
else if (EnumValue == 1)
{
for (int i = 0;i < theselection0.size();i++)
{
displayModification1->SetNewTranslucency(0); //设置透明度
std::vector<DisplayableObject *> objects1(1);
Face *face1(dynamic_cast<Face *>(NXObjectManager::Get(theselection0->Tag())));
objects1[0] = face1;
displayModification1->Apply(objects1);
}
}
delete displayModification1;
|
|