return AddVertex (theVertex.x(), theVertex.y(), theVertex.z());
}
+inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex,
+ const Graphic3d_Vec4ub& theColor)
+{
+ const Standard_Integer anIndex = AddVertex (theVertex);
+ SetVertexColor (anIndex, theColor);
+ return anIndex;
+}
+
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_Real theX,
const Standard_Real theY,
const Standard_Real theZ)
{
Graphic3d_Vec4ub aColor (Standard_Byte(theR * 255.0),
Standard_Byte(theG * 255.0),
- Standard_Byte(theB * 255.0), 0);
+ Standard_Byte(theB * 255.0), 255);
SetVertexColor (theIndex, *reinterpret_cast<Standard_Integer*>(&aColor));
}
myAttribs->NbElements = Max (theIndex, myAttribs->NbElements);
}
+inline void Graphic3d_ArrayOfPrimitives::SetVertexColor (const Standard_Integer theIndex,
+ const Graphic3d_Vec4ub& theColor)
+{
+ SetVertexColor (theIndex, *reinterpret_cast<const Standard_Integer*> (&theColor));
+}
+
inline void Graphic3d_ArrayOfPrimitives::SetVertexNormal (const Standard_Integer theIndex,
const Standard_Real theNX,
const Standard_Real theNY,
}
Standard_Integer aColorInt = 0;
VertexColor (theIndex, aColorInt);
- const Graphic3d_Vec4ub& aColor = *reinterpret_cast<const Graphic3d_Vec4ub* >(aColorInt);
+ const Graphic3d_Vec4ub& aColor = *reinterpret_cast<const Graphic3d_Vec4ub* >(&aColorInt);
theR = Standard_Real(aColor.r()) / 255.0;
theG = Standard_Real(aColor.g()) / 255.0;
theB = Standard_Real(aColor.b()) / 255.0;