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
Hello,

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.

Brandt
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
hello,

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->RemoveBuilder(nBuilder-1);
               meshVS->AddBuilder( aBuilder, Standard_True );
 
 
Latest news
  • New features to enhance the development process
  • Open CASCADE Technology 6.7.1 is available for download!
  • Open CASCADE Technology 6.7.0 is available for download!

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