Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics

Example for MeshVS_NodalColorPrsBuilder

Example for MeshVS_NodalColorPrsBuilder
Brandt 2010/07/20 01:21

I have found some examples for MeshVS_MeshPrsBuilder and it works well. But i want to colorize each triangle in a different color. MeshVS_NodalColorPrsBuilder or MeshVS_ElementalColorPrsBuilder should do the job. But i could'nt get both to work.

Does anybody has an example for MeshVS_NodalColorPrsBuilder or MeshVS_ElementalColorPrsBuilder? Or an instruction how to handle these builder?

Thanks for your help.

Sebastian Starkey 2011/02/11 15:14
Hi Brandt,

Did you solve your problem? I am trying to do something similar.

Thanks a lot,
Sepp Forcher 2012/07/06 13:34

you can do it with MeshVS_ElementalColorPrsBuilder:

Handle_MeshVS_ElementalColorPrsBuilder aBuilder = new MeshVS_ElementalColorPrsBuilder( meshVS, MeshVS_DMF_ElementalColorDataPrs | MeshVS_DMF_OCCMask);
const TColStd_PackedMapOfInteger& anAllElements = meshVS->GetDataSource()->GetAllElements();
               TColStd_MapIteratorOfPackedMapOfInteger anIter(anAllElements);

               for ( ; anIter.More(); anIter.Next() )
                    aBuilder->SetColor1( anIter.Key(), Quantity_Color(Quantity_NOC_WHITE));
int nBuilder = meshVS->GetBuildersCount();
               if(nBuilder > 1)
               meshVS->AddBuilder( aBuilder, Standard_True );
Latest news
  • Open CASCADE JT Assistant Sources
  • JT Assistant Linux and CAD Assistant
  • Open CASCADE JT Assistant

  • © OPEN CASCADE 2000 - 2015  |  Search  |  Contacts   |  Site map