|
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;
|
|