mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0027655: Visualization - AIS_Triangulation disappears after setting non-zero transparency
Add a new methods in AIS_Triangulation: SetTransparency, UnsetTransparency, HasVertexColor, updatePresentation. Add a new methods in Graphic3d_ArrayOfPrimitives: AddVertex(gp_Pnt, Graphic3d_Vec4ub) and SetVertexColor(Standard_Integer, Graphic3d_Vec4ub). Type of color of array in AIS_Triangulation is Graphic3d_Vec4ub now.
This commit is contained in:
@@ -3167,20 +3167,13 @@ static int VDrawSphere (Draw_Interpretor& /*di*/, Standard_Integer argc, const c
|
||||
|
||||
// stupid initialization of Green color in RGBA space as integer
|
||||
// probably wrong for big-endian CPUs
|
||||
Standard_Integer aRed = 0;
|
||||
Standard_Integer aGreen = 255;
|
||||
Standard_Integer aBlue = 0;
|
||||
Standard_Integer anAlpha = 0; // not used
|
||||
Standard_Integer aColorInt = aRed;
|
||||
aColorInt += aGreen << 8;
|
||||
aColorInt += aBlue << 16;
|
||||
aColorInt += anAlpha << 24;
|
||||
const Graphic3d_Vec4ub aColor (0, 255, 0, 0);
|
||||
|
||||
// setup colors array per vertex
|
||||
Handle(TColStd_HArray1OfInteger) aColorArray = new TColStd_HArray1OfInteger (1, aNumberPoints);
|
||||
for (Standard_Integer aNodeId = 1; aNodeId <= aNumberPoints; ++aNodeId)
|
||||
{
|
||||
aColorArray->SetValue (aNodeId, aColorInt);
|
||||
aColorArray->SetValue (aNodeId, *reinterpret_cast<const Standard_Integer*> (&aColor));
|
||||
}
|
||||
aShape->SetColors (aColorArray);
|
||||
|
||||
|
Reference in New Issue
Block a user