To add a custom view to the .prc portion of a .pdf document:
OdPrcViewPtr pNewView = OdPrcView::createObject();
pNewFileStructure->addObject(pNewView);
OdPrcName name;
name.setName(L"NE Isometric");
pNewView->name() = name;
OdPrcProductOccurrencePtr productOc = pFile->fileStructures().last()->fileStructureTree().productOccurrence().last();
OdPrcObjectIdArray &arr_view = productOc->annotationViews();
arr_view.push_back(pNewView->id());
Note that it is important to set the name of the view. The view is available in the .pdf file through its name.
OdPrcSceneDisplayParametersPtr pSceneDisplayParameters = OdPrcSceneDisplayParameters::createObject();
pNewFileStructure->addObject(pSceneDisplayParameters);
pNewView->sceneDisplayParameters() = pSceneDisplayParameters->id();
OdPrcCameraPtr pCamera = OdPrcCamera::createObject();
pNewFileStructure->addObject(pCamera);
pCamera->lookAt().set(0.0, 0.0, 0.0);
pCamera->up().set(0.0, 0.0, 1.0);
pCamera->location().set(5.0, 5.0, 5.0);
pCamera->setXFov(1.0472);
pCamera->setYFov(1.0472);
pSceneDisplayParameters->camera() = pCamera->id();
You can choose the created view in a viewer application by its name:
![]() |
|
After selecting the created view, you can see the result:
![]() |
|
For additional details, in the examples see the simpleCrossSectioExample() function in the CrossSectionExample.cpp module.
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|