ngoctn Thu, 01/20/2005 - 03:43 Forums: Other usage issuesHi everyone! How do i set an interactive object stays visible or invisble? Like SolidWorks, Show/Hide object(s) command. Danis (not verified) Thu, 01/20/2005 - 10:17 I think you need to use OCAF to do that! Log in to post comments Roman Lygin Fri, 01/21/2005 - 20:39 Hi, RTFM :-) AIS_InteractiveContext::Erase(), ::EraseAll() AIS_InteractiveContext::DisplayFromCollector(), ::DisplayAll(). Nothing to do with OCAF, by the way. Good luck. Roman Log in to post comments ngoctn Sat, 01/22/2005 - 08:36 Thanks Roman. Log in to post comments JuryS Sun, 04/18/2010 - 02:14 Hi, Roman. It's not work for me. I don't know why, but I make my code with OCAF And It's work. void DocumentCommon::UpdateFilter() { TDF_Label LabSat = myOCAFDoc->Main(); TDF_Label L; TDF_Label level0; Handle_TPrsStd_AISPresentation prs; bool isFound; Handle_TDataStd_Integer CurInt; int FilterValue; for (TDF_ChildIterator it(LabSat); it.More(); it.Next()) { L = it.Value(); if (!L.FindAttribute(TPrsStd_AISPresentation::GetID(),prs)) continue; level0 = L.FindChild(0,Standard_True); isFound = level0.FindChild(20).FindAttribute(TDataStd_Integer::GetID(),CurInt); if (!isFound) continue; FilterValue = CurInt->Get(); if ((FilterValue<1)||(FilterValue>21)) continue; if (CurrentViewFilter.at(FilterValue-1) == false) prs->Erase(Standard_False); else prs->Display(Standard_False); } myContext->UpdateCurrentViewer(); //Îáÿçàòåëüíî îáíîâèòü ýêðàí } Log in to post comments JuryS Sun, 04/18/2010 - 02:15 Also, CurrentViewFilter is QBitArray Log in to post comments
Thu, 01/20/2005 - 10:17
I think you need to use OCAF to do that!
Fri, 01/21/2005 - 20:39
Hi,
RTFM :-)
AIS_InteractiveContext::Erase(), ::EraseAll()
AIS_InteractiveContext::DisplayFromCollector(), ::DisplayAll().
Nothing to do with OCAF, by the way.
Good luck.
Roman
Sat, 01/22/2005 - 08:36
Thanks Roman.
Sun, 04/18/2010 - 02:14
Hi, Roman. It's not work for me. I don't know why, but I make my code with OCAF
And It's work.
void DocumentCommon::UpdateFilter()
{
TDF_Label LabSat = myOCAFDoc->Main();
TDF_Label L;
TDF_Label level0;
Handle_TPrsStd_AISPresentation prs;
bool isFound;
Handle_TDataStd_Integer CurInt;
int FilterValue;
for (TDF_ChildIterator it(LabSat); it.More(); it.Next())
{
L = it.Value();
if (!L.FindAttribute(TPrsStd_AISPresentation::GetID(),prs)) continue;
level0 = L.FindChild(0,Standard_True);
isFound = level0.FindChild(20).FindAttribute(TDataStd_Integer::GetID(),CurInt);
if (!isFound) continue;
FilterValue = CurInt->Get();
if ((FilterValue<1)||(FilterValue>21)) continue;
if (CurrentViewFilter.at(FilterValue-1) == false)
prs->Erase(Standard_False);
else
prs->Display(Standard_False);
}
myContext->UpdateCurrentViewer(); //Îáÿçàòåëüíî îáíîâèòü ýêðàí
}
Sun, 04/18/2010 - 02:15
Also, CurrentViewFilter is QBitArray