Hi,
try the following:
1) add XCAFPrs_Driver to your drivers:
Handle(XCAFPrs_Driver) myPresDriver = new XCAFPrs_Driver();
TPrsStd_DriverTable::Get();
TPrsStd_DriverTable::Get()->InitStandardDrivers();
TPrsStd_DriverTable::Get()->AddDriver(XCAFPrs_Driver::GetID(), myPresDriver);
2) for adding a shape I do the following:
Standard_Boolean Im_Presentation3DAIS::AddShape(const TDF_Label &lab)
{
if (!m_pViewerAIS.IsNull())
{
if (!m_pViewerAIS->m_pAISContext.IsNull())
{
Handle(TPrsStd_AISPresentation) TPrsPresentation;
if (! lab.FindAttribute ( TPrsStd_AISPresentation::GetID(), TPrsPresentation ) )
{
// TPrsPresentation = TPrsStd_AISPresentation::Set(lab,TNaming_NamedShape::GetID());
TPrsPresentation = TPrsStd_AISPresentation::Set(lab,XCAFPrs_Driver::GetID());
}
TPrsPresentation->SetMaterial ( Graphic3d_NOM_SATIN );
XCAFPrs::SetViewNameMode(Standard_False);
TPrsPresentation->Display(Standard_True);
if (!m_pDocRoot.IsNull())
TPrsStd_AISViewer::Update(m_pDocRoot->GetData()->Root());
return Standard_True;
}
return Standard_False;
}
return Standard_False;
HTH,
Commenter-1