Open CASCADE Technology 7.8.0
Public Member Functions
MeshVS_ElementalColorPrsBuilder Class Reference

This class provides methods to create presentation of elements with assigned colors. The class contains two color maps: map of same colors for front and back side of face and map of different ones,. More...

#include <MeshVS_ElementalColorPrsBuilder.hxx>

Inheritance diagram for MeshVS_ElementalColorPrsBuilder:
Inheritance graph
[legend]

Public Member Functions

 MeshVS_ElementalColorPrsBuilder (const Handle< MeshVS_Mesh > &Parent, const MeshVS_DisplayModeFlags &Flags=MeshVS_DMF_ElementalColorDataPrs, const Handle< MeshVS_DataSource > &DS=0, const Standard_Integer Id=-1, const MeshVS_BuilderPriority &Priority=MeshVS_BP_ElemColor)
 Constructor.
 
virtual void Build (const Handle< Prs3d_Presentation > &Prs, const TColStd_PackedMapOfInteger &IDs, TColStd_PackedMapOfInteger &IDsToExclude, const Standard_Boolean IsElement, const Standard_Integer DisplayMode) const override
 Builds presentation of elements with assigned colors.
 
const MeshVS_DataMapOfIntegerColorGetColors1 () const
 Returns map of colors same for front and back side of face.
 
void SetColors1 (const MeshVS_DataMapOfIntegerColor &Map)
 Sets map of colors same for front and back side of face.
 
Standard_Boolean HasColors1 () const
 Returns true, if map of colors isn't empty.
 
Standard_Boolean GetColor1 (const Standard_Integer ID, Quantity_Color &theColor) const
 Returns color assigned with element number ID.
 
void SetColor1 (const Standard_Integer ID, const Quantity_Color &theColor)
 Sets color assigned with element number ID.
 
const MeshVS_DataMapOfIntegerTwoColorsGetColors2 () const
 Returns map of different colors for front and back side of face.
 
void SetColors2 (const MeshVS_DataMapOfIntegerTwoColors &Map)
 Sets map of different colors for front and back side of face.
 
Standard_Boolean HasColors2 () const
 Returns true, if map isn't empty.
 
Standard_Boolean GetColor2 (const Standard_Integer ID, MeshVS_TwoColors &theColor) const
 Returns colors assigned with element number ID.
 
Standard_Boolean GetColor2 (const Standard_Integer ID, Quantity_Color &theColor1, Quantity_Color &theColor2) const
 Returns colors assigned with element number ID theColor1 is the front element color theColor2 is the back element color.
 
void SetColor2 (const Standard_Integer ID, const MeshVS_TwoColors &theTwoColors)
 Sets colors assigned with element number ID.
 
void SetColor2 (const Standard_Integer ID, const Quantity_Color &theColor1, const Quantity_Color &theColor2)
 Sets color assigned with element number ID theColor1 is the front element color theColor2 is the back element color.
 
- Public Member Functions inherited from MeshVS_PrsBuilder
virtual void CustomBuild (const Handle< Prs3d_Presentation > &Prs, const TColStd_PackedMapOfInteger &IDs, TColStd_PackedMapOfInteger &IDsToExclude, const Standard_Integer DisplayMode) const
 This method is called to build presentation of custom elements (they have MeshVS_ET_0D type). IDs is set of numeric identificators of elements for custom building. IDsToExclude is set of IDs to exclude from processing. If some entity has been excluded, it is not processed by other builders. DisplayMode is numeric constant describing display mode (see MeshVS_DisplayModeFlags.hxx)
 
virtual Handle< Select3D_SensitiveEntityCustomSensitiveEntity (const Handle< SelectMgr_EntityOwner > &Owner, const Standard_Integer SelectMode) const
 This method is called to build sensitive of custom elements ( they have MeshVS_ET_0D type )
 
Standard_Integer GetFlags () const
 Returns flags, assigned with builder during creation.
 
virtual Standard_Boolean TestFlags (const Standard_Integer DisplayMode) const
 Test whether display mode has flags assigned with this builder. This method has default implementation and can be redefined for advance behavior Returns Standard_True only if display mode is appropriate for this builder.
 
Standard_Integer GetId () const
 Returns builder ID.
 
Standard_Integer GetPriority () const
 Returns priority; as priority bigger, as soon builder will be called.
 
Handle< MeshVS_DataSourceGetDataSource () const
 Returns custom data source or default ( from MeshVS_Mesh ) if custom is NULL.
 
void SetDataSource (const Handle< MeshVS_DataSource > &newDS)
 Change custom data source.
 
Handle< MeshVS_DrawerGetDrawer () const
 Returns custom drawer or default ( from MeshVS_Mesh ) if custom is NULL.
 
void SetDrawer (const Handle< MeshVS_Drawer > &newDr)
 Change custom drawer.
 
void SetExcluding (const Standard_Boolean state)
 Set excluding state. If it is Standard_True, the nodes or elements, processed by current builder will be noted and next builder won't process its.
 
Standard_Boolean IsExcludingOn () const
 Read excluding state.
 
void SetPresentationManager (const Handle< PrsMgr_PresentationManager > &thePrsMgr)
 Set presentation manager for builder.
 
Handle< PrsMgr_PresentationManagerGetPresentationManager () const
 Get presentation manager of builder.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
Standard_Boolean IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
 
Standard_Integer GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object.
 
Standard_Integer DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 
- Protected Member Functions inherited from MeshVS_PrsBuilder
 MeshVS_PrsBuilder (const Handle< MeshVS_Mesh > &Parent, const MeshVS_DisplayModeFlags &Flags, const Handle< MeshVS_DataSource > &DS, const Standard_Integer Id, const MeshVS_BuilderPriority &Priority=MeshVS_BP_Default)
 Constructor Parent is pointer to MeshVS_Mesh object Flags is set of display modes corresponding to this builder DS is data source object, from which builder will pick geometry and topological information Id is numeric identificator of builder. You must set it to positive integer, but if you set it to -1, constructor will select the smallest integer, not occupied by other builders Priority is numerical priority constant. As priority bigger, as sooner builder starts during presentation construction.
 
Handle< MeshVS_DataSourceDataSource () const
 Returns only custom data source.
 
Handle< MeshVS_DrawerDrawer () const
 Returns only custom drawer.
 
- Protected Attributes inherited from MeshVS_PrsBuilder
MeshVS_MeshPtr myParentMesh
 

Detailed Description

This class provides methods to create presentation of elements with assigned colors. The class contains two color maps: map of same colors for front and back side of face and map of different ones,.

Constructor & Destructor Documentation

◆ MeshVS_ElementalColorPrsBuilder()

MeshVS_ElementalColorPrsBuilder::MeshVS_ElementalColorPrsBuilder ( const Handle< MeshVS_Mesh > &  Parent,
const MeshVS_DisplayModeFlags Flags = MeshVS_DMF_ElementalColorDataPrs,
const Handle< MeshVS_DataSource > &  DS = 0,
const Standard_Integer  Id = -1,
const MeshVS_BuilderPriority Priority = MeshVS_BP_ElemColor 
)

Constructor.

Member Function Documentation

◆ Build()

virtual void MeshVS_ElementalColorPrsBuilder::Build ( const Handle< Prs3d_Presentation > &  Prs,
const TColStd_PackedMapOfInteger IDs,
TColStd_PackedMapOfInteger IDsToExclude,
const Standard_Boolean  IsElement,
const Standard_Integer  DisplayMode 
) const
overridevirtual

Builds presentation of elements with assigned colors.

Implements MeshVS_PrsBuilder.

◆ GetColor1()

Standard_Boolean MeshVS_ElementalColorPrsBuilder::GetColor1 ( const Standard_Integer  ID,
Quantity_Color theColor 
) const

Returns color assigned with element number ID.

◆ GetColor2() [1/2]

Standard_Boolean MeshVS_ElementalColorPrsBuilder::GetColor2 ( const Standard_Integer  ID,
MeshVS_TwoColors theColor 
) const

Returns colors assigned with element number ID.

◆ GetColor2() [2/2]

Standard_Boolean MeshVS_ElementalColorPrsBuilder::GetColor2 ( const Standard_Integer  ID,
Quantity_Color theColor1,
Quantity_Color theColor2 
) const

Returns colors assigned with element number ID theColor1 is the front element color theColor2 is the back element color.

◆ GetColors1()

const MeshVS_DataMapOfIntegerColor & MeshVS_ElementalColorPrsBuilder::GetColors1 ( ) const

Returns map of colors same for front and back side of face.

◆ GetColors2()

const MeshVS_DataMapOfIntegerTwoColors & MeshVS_ElementalColorPrsBuilder::GetColors2 ( ) const

Returns map of different colors for front and back side of face.

◆ HasColors1()

Standard_Boolean MeshVS_ElementalColorPrsBuilder::HasColors1 ( ) const

Returns true, if map of colors isn't empty.

◆ HasColors2()

Standard_Boolean MeshVS_ElementalColorPrsBuilder::HasColors2 ( ) const

Returns true, if map isn't empty.

◆ SetColor1()

void MeshVS_ElementalColorPrsBuilder::SetColor1 ( const Standard_Integer  ID,
const Quantity_Color theColor 
)

Sets color assigned with element number ID.

◆ SetColor2() [1/2]

void MeshVS_ElementalColorPrsBuilder::SetColor2 ( const Standard_Integer  ID,
const MeshVS_TwoColors theTwoColors 
)

Sets colors assigned with element number ID.

◆ SetColor2() [2/2]

void MeshVS_ElementalColorPrsBuilder::SetColor2 ( const Standard_Integer  ID,
const Quantity_Color theColor1,
const Quantity_Color theColor2 
)

Sets color assigned with element number ID theColor1 is the front element color theColor2 is the back element color.

◆ SetColors1()

void MeshVS_ElementalColorPrsBuilder::SetColors1 ( const MeshVS_DataMapOfIntegerColor Map)

Sets map of colors same for front and back side of face.

◆ SetColors2()

void MeshVS_ElementalColorPrsBuilder::SetColors2 ( const MeshVS_DataMapOfIntegerTwoColors Map)

Sets map of different colors for front and back side of face.


The documentation for this class was generated from the following file: