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

Search the Forums
See All Topics
Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Shape factory
Shape gallery
What's new
System requirements
Download Center
Public license
Getting started
Open Source community
Training and e-learning
A-la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
Home / Developer Corner / Forums / Usage issues / Example for MeshVS_NodalColorPrsBuilder

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 Technology 6.7.0 is available for download!
  • Open CASCADE Technology 6.6.0 is available for download!
  • Open CASCADE Technology 6.5.5 is available for download!

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