This class furnish services to defined and fill an array of primitives which can be passed directly to graphics rendering API.
More...
|
virtual | ~Graphic3d_ArrayOfPrimitives () |
| Destructor.
|
|
const Handle< Graphic3d_Buffer > & | Attributes () const |
| Returns vertex attributes buffer (colors, normals, texture coordinates).
|
|
Graphic3d_TypeOfPrimitiveArray | Type () const |
| Returns the type of this primitive.
|
|
Standard_CString | StringType () const |
| Returns the string type of this primitive.
|
|
Standard_Boolean | HasVertexNormals () const |
| Returns TRUE when vertex normals array is defined.
|
|
Standard_Boolean | HasVertexColors () const |
| Returns TRUE when vertex colors array is defined.
|
|
Standard_Boolean | HasVertexTexels () const |
| Returns TRUE when vertex texels array is defined.
|
|
Standard_Integer | VertexNumber () const |
| Returns the number of defined vertex.
|
|
Standard_Integer | VertexNumberAllocated () const |
| Returns the number of allocated vertex.
|
|
Standard_Integer | ItemNumber () const |
| Returns the number of total items according to the array type.
|
|
Standard_Boolean | IsValid () |
| Returns TRUE only when the contains of this array is available.
|
|
Standard_Integer | AddVertex (const gp_Pnt &theVertex) |
| Adds a vertice in the array.
|
|
Standard_Integer | AddVertex (const Graphic3d_Vec3 &theVertex) |
| Adds a vertice in the array.
|
|
Standard_Integer | AddVertex (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ) |
| Adds a vertice in the array.
|
|
Standard_Integer | AddVertex (const Standard_ShortReal theX, const Standard_ShortReal theY, const Standard_ShortReal theZ) |
| Adds a vertice in the array.
|
|
Standard_Integer | AddVertex (const gp_Pnt &theVertex, const Quantity_Color &theColor) |
| Adds a vertice and vertex color in the vertex array. Warning: theColor is ignored when the hasVColors constructor parameter is FALSE.
|
|
Standard_Integer | AddVertex (const gp_Pnt &theVertex, const Standard_Integer theColor32) |
| Adds a vertice and vertex color in the vertex array. Warning: theColor is ignored when the hasVColors constructor parameter is FALSE.
|
|
Standard_Integer | AddVertex (const gp_Pnt &theVertex, const Graphic3d_Vec4ub &theColor) |
| Adds a vertice and vertex color in the vertex array. Warning: theColor is ignored when the hasVColors constructor parameter is FALSE.
|
|
Standard_Integer | AddVertex (const gp_Pnt &theVertex, const gp_Dir &theNormal) |
| Adds a vertice and vertex normal in the vertex array. Warning: theNormal is ignored when the hasVNormals constructor parameter is FALSE.
|
|
Standard_Integer | AddVertex (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ, const Standard_Real theNX, const Standard_Real theNY, const Standard_Real theNZ) |
| Adds a vertice and vertex normal in the vertex array. Warning: Normal is ignored when the hasVNormals constructor parameter is FALSE.
|
|
Standard_Integer | AddVertex (const Standard_ShortReal theX, const Standard_ShortReal theY, const Standard_ShortReal theZ, const Standard_ShortReal theNX, const Standard_ShortReal theNY, const Standard_ShortReal theNZ) |
| Adds a vertice and vertex normal in the vertex array. Warning: Normal is ignored when the hasVNormals constructor parameter is FALSE.
|
|
Standard_Integer | AddVertex (const gp_Pnt &theVertex, const gp_Dir &theNormal, const Quantity_Color &theColor) |
| Adds a vertice,vertex normal and color in the vertex array. Warning: theNormal is ignored when the hasVNormals constructor parameter is FALSE and theColor is ignored when the hasVColors constructor parameter is FALSE.
|
|
Standard_Integer | AddVertex (const gp_Pnt &theVertex, const gp_Dir &theNormal, const Standard_Integer theColor32) |
| Adds a vertice,vertex normal and color in the vertex array. Warning: theNormal is ignored when the hasVNormals constructor parameter is FALSE and theColor is ignored when the hasVColors constructor parameter is FALSE.
|
|
Standard_Integer | AddVertex (const gp_Pnt &theVertex, const gp_Pnt2d &theTexel) |
| Adds a vertice and vertex texture in the vertex array. theTexel is ignored when the hasVTexels constructor parameter is FALSE.
|
|
Standard_Integer | AddVertex (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ, const Standard_Real theTX, const Standard_Real theTY) |
| Adds a vertice and vertex texture coordinates in the vertex array. Texel is ignored when the hasVTexels constructor parameter is FALSE.
|
|
Standard_Integer | AddVertex (const Standard_ShortReal theX, const Standard_ShortReal theY, const Standard_ShortReal theZ, const Standard_ShortReal theTX, const Standard_ShortReal theTY) |
| Adds a vertice and vertex texture coordinates in the vertex array. Texel is ignored when the hasVTexels constructor parameter is FALSE.
|
|
Standard_Integer | AddVertex (const gp_Pnt &theVertex, const gp_Dir &theNormal, const gp_Pnt2d &theTexel) |
| Adds a vertice,vertex normal and texture in the vertex array. Warning: theNormal is ignored when the hasVNormals constructor parameter is FALSE and theTexel is ignored when the hasVTexels constructor parameter is FALSE.
|
|
Standard_Integer | AddVertex (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ, const Standard_Real theNX, const Standard_Real theNY, const Standard_Real theNZ, const Standard_Real theTX, const Standard_Real theTY) |
| Adds a vertice,vertex normal and texture in the vertex array. Warning: Normal is ignored when the hasVNormals constructor parameter is FALSE and Texel is ignored when the hasVTexels constructor parameter is FALSE.
|
|
Standard_Integer | AddVertex (const Standard_ShortReal theX, const Standard_ShortReal theY, const Standard_ShortReal theZ, const Standard_ShortReal theNX, const Standard_ShortReal theNY, const Standard_ShortReal theNZ, const Standard_ShortReal theTX, const Standard_ShortReal theTY) |
| Adds a vertice,vertex normal and texture in the vertex array. Warning: Normal is ignored when the hasVNormals constructor parameter is FALSE and Texel is ignored when the hasVTexels constructor parameter is FALSE.
|
|
void | SetVertice (const Standard_Integer theIndex, const gp_Pnt &theVertex) |
| Change the vertice of rank theIndex in the array.
|
|
void | SetVertice (const Standard_Integer theIndex, const Standard_ShortReal theX, const Standard_ShortReal theY, const Standard_ShortReal theZ) |
| Change the vertice in the array.
|
|
void | SetVertexColor (const Standard_Integer theIndex, const Quantity_Color &theColor) |
| Change the vertex color in the array.
|
|
void | SetVertexColor (const Standard_Integer theIndex, const Standard_Real theR, const Standard_Real theG, const Standard_Real theB) |
| Change the vertex color in the array.
|
|
void | SetVertexColor (const Standard_Integer theIndex, const Graphic3d_Vec4ub &theColor) |
| Change the vertex color in the array.
|
|
void | SetVertexColor (const Standard_Integer theIndex, const Standard_Integer theColor32) |
| Change the vertex color in the array.
|
|
void | SetVertexNormal (const Standard_Integer theIndex, const gp_Dir &theNormal) |
| Change the vertex normal in the array.
|
|
void | SetVertexNormal (const Standard_Integer theIndex, const Standard_Real theNX, const Standard_Real theNY, const Standard_Real theNZ) |
| Change the vertex normal in the array.
|
|
void | SetVertexTexel (const Standard_Integer theIndex, const gp_Pnt2d &theTexel) |
| Change the vertex texel in the array.
|
|
void | SetVertexTexel (const Standard_Integer theIndex, const Standard_Real theTX, const Standard_Real theTY) |
| Change the vertex texel in the array.
|
|
gp_Pnt | Vertice (const Standard_Integer theRank) const |
| Returns the vertice from the vertex table if defined.
|
|
void | Vertice (const Standard_Integer theRank, Standard_Real &theX, Standard_Real &theY, Standard_Real &theZ) const |
| Returns the vertice coordinates at rank theRank from the vertex table if defined.
|
|
Quantity_Color | VertexColor (const Standard_Integer theRank) const |
| Returns the vertex color at rank theRank from the vertex table if defined.
|
|
void | VertexColor (const Standard_Integer theIndex, Graphic3d_Vec4ub &theColor) const |
| Returns the vertex color from the vertex table if defined.
|
|
void | VertexColor (const Standard_Integer theRank, Standard_Real &theR, Standard_Real &theG, Standard_Real &theB) const |
| Returns the vertex color values from the vertex table if defined.
|
|
void | VertexColor (const Standard_Integer theRank, Standard_Integer &theColor) const |
| Returns the vertex color values from the vertex table if defined.
|
|
gp_Dir | VertexNormal (const Standard_Integer theRank) const |
| Returns the vertex normal from the vertex table if defined.
|
|
void | VertexNormal (const Standard_Integer theRank, Standard_Real &theNX, Standard_Real &theNY, Standard_Real &theNZ) const |
| Returns the vertex normal coordinates at rank theRank from the vertex table if defined.
|
|
gp_Pnt2d | VertexTexel (const Standard_Integer theRank) const |
| Returns the vertex texture at rank theRank from the vertex table if defined.
|
|
void | VertexTexel (const Standard_Integer theRank, Standard_Real &theTX, Standard_Real &theTY) const |
| Returns the vertex texture coordinates at rank theRank from the vertex table if defined.
|
|
|
const Handle< Graphic3d_IndexBuffer > & | Indices () const |
| Returns optional index buffer.
|
|
Standard_Integer | EdgeNumber () const |
| Returns the number of defined edges.
|
|
Standard_Integer | EdgeNumberAllocated () const |
| Returns the number of allocated edges.
|
|
Standard_Integer | Edge (const Standard_Integer theRank) const |
| Returns the vertex index at rank theRank in the range [1,EdgeNumber()].
|
|
Standard_Integer | AddEdge (const Standard_Integer theVertexIndex) |
| Adds an edge in the range [1,VertexNumber()] in the array.
|
|
Standard_Integer | AddEdges (Standard_Integer theVertexIndex1, Standard_Integer theVertexIndex2) |
| Convenience method, adds two vertex indices (a segment) in the range [1,VertexNumber()] in the array.
|
|
Standard_Integer | AddSegmentEdges (Standard_Integer theVertexIndex1, Standard_Integer theVertexIndex2) |
| Convenience method, adds two vertex indices (a segment) in the range [1,VertexNumber()] in the array of segments (Graphic3d_TOPA_SEGMENTS). Raises exception if array is not of type Graphic3d_TOPA_SEGMENTS.
|
|
Standard_Integer | AddEdges (Standard_Integer theVertexIndex1, Standard_Integer theVertexIndex2, Standard_Integer theVertexIndex3) |
| Convenience method, adds three vertex indices (a triangle) in the range [1,VertexNumber()] in the array.
|
|
Standard_Integer | AddTriangleEdges (Standard_Integer theVertexIndex1, Standard_Integer theVertexIndex2, Standard_Integer theVertexIndex3) |
| Convenience method, adds three vertex indices of triangle in the range [1,VertexNumber()] in the array of triangles. Raises exception if array is not of type Graphic3d_TOPA_TRIANGLES.
|
|
Standard_Integer | AddTriangleEdges (const Graphic3d_Vec3i &theIndexes) |
| Convenience method, adds three vertex indices of triangle in the range [1,VertexNumber()] in the array of triangles. Raises exception if array is not of type Graphic3d_TOPA_TRIANGLES.
|
|
Standard_Integer | AddTriangleEdges (const Graphic3d_Vec4i &theIndexes) |
| Convenience method, adds three vertex indices (4th component is ignored) of triangle in the range [1,VertexNumber()] in the array of triangles. Raises exception if array is not of type Graphic3d_TOPA_TRIANGLES.
|
|
Standard_Integer | AddEdges (Standard_Integer theVertexIndex1, Standard_Integer theVertexIndex2, Standard_Integer theVertexIndex3, Standard_Integer theVertexIndex4) |
| Convenience method, adds four vertex indices (a quad) in the range [1,VertexNumber()] in the array.
|
|
Standard_Integer | AddQuadEdges (Standard_Integer theVertexIndex1, Standard_Integer theVertexIndex2, Standard_Integer theVertexIndex3, Standard_Integer theVertexIndex4) |
| Convenience method, adds four vertex indices (a quad) in the range [1,VertexNumber()] in the array of quads. Raises exception if array is not of type Graphic3d_TOPA_QUADRANGLES.
|
|
Standard_Integer | AddQuadTriangleEdges (Standard_Integer theVertexIndex1, Standard_Integer theVertexIndex2, Standard_Integer theVertexIndex3, Standard_Integer theVertexIndex4) |
| Convenience method, adds quad indices in the range [1,VertexNumber()] into array or triangles as two triangles. Raises exception if array is not of type Graphic3d_TOPA_TRIANGLES.
|
|
Standard_Integer | AddQuadTriangleEdges (const Graphic3d_Vec4i &theIndexes) |
| Convenience method, adds quad indices in the range [1,VertexNumber()] into array or triangles as two triangles. Raises exception if array is not of type Graphic3d_TOPA_TRIANGLES.
|
|
void | AddTriangleStripEdges (Standard_Integer theVertexLower, Standard_Integer theVertexUpper) |
| Add triangle strip into indexed triangulation array. N-2 triangles are added from N input nodes. Raises exception if array is not of type Graphic3d_TOPA_TRIANGLES.
|
|
void | AddTriangleFanEdges (Standard_Integer theVertexLower, Standard_Integer theVertexUpper, Standard_Boolean theToClose) |
| Add triangle fan into indexed triangulation array. N-2 triangles are added from N input nodes (or N-1 with closed flag). Raises exception if array is not of type Graphic3d_TOPA_TRIANGLES.
|
|
void | AddPolylineEdges (Standard_Integer theVertexLower, Standard_Integer theVertexUpper, Standard_Boolean theToClose) |
| Add line strip (polyline) into indexed segments array. N-1 segments are added from N input nodes (or N with closed flag). Raises exception if array is not of type Graphic3d_TOPA_SEGMENTS.
|
|
|
const Handle< Graphic3d_BoundBuffer > & | Bounds () const |
| Returns optional bounds buffer.
|
|
Standard_Boolean | HasBoundColors () const |
| Returns TRUE when bound colors array is defined.
|
|
Standard_Integer | BoundNumber () const |
| Returns the number of defined bounds.
|
|
Standard_Integer | BoundNumberAllocated () const |
| Returns the number of allocated bounds.
|
|
Standard_Integer | Bound (const Standard_Integer theRank) const |
| Returns the edge number at rank theRank.
|
|
Quantity_Color | BoundColor (const Standard_Integer theRank) const |
| Returns the bound color at rank theRank from the bound table if defined.
|
|
void | BoundColor (const Standard_Integer theRank, Standard_Real &theR, Standard_Real &theG, Standard_Real &theB) const |
| Returns the bound color values at rank theRank from the bound table if defined.
|
|
Standard_Integer | AddBound (const Standard_Integer theEdgeNumber) |
| Adds a bound of length theEdgeNumber in the bound array.
|
|
Standard_Integer | AddBound (const Standard_Integer theEdgeNumber, const Quantity_Color &theBColor) |
| Adds a bound of length theEdgeNumber and bound color theBColor in the bound array. Warning: theBColor is ignored when the hasBColors constructor parameter is FALSE.
|
|
Standard_Integer | AddBound (const Standard_Integer theEdgeNumber, const Standard_Real theR, const Standard_Real theG, const Standard_Real theB) |
| Adds a bound of length theEdgeNumber and bound color coordinates in the bound array. Warning: <theR,theG,theB> are ignored when the hasBColors constructor parameter is FALSE.
|
|
void | SetBoundColor (const Standard_Integer theIndex, const Quantity_Color &theColor) |
| Change the bound color of rank theIndex in the array.
|
|
void | SetBoundColor (const Standard_Integer theIndex, const Standard_Real theR, const Standard_Real theG, const Standard_Real theB) |
| Change the bound color of rank theIndex in the array.
|
|
Public Member Functions inherited from Standard_Transient |
| Standard_Transient () |
| Empty constructor.
|
|
| Standard_Transient (const Standard_Transient &) |
| Copy constructor – does nothing.
|
|
Standard_Transient & | operator= (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_Transient * | This () 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.
|
|
This class furnish services to defined and fill an array of primitives which can be passed directly to graphics rendering API.
The basic interface consists of the following parts: 1) Specifying primitive type. WARNING! Particular primitive types might be unsupported by specific hardware/graphics API (like quads and polygons). It is always preferred using one of basic types having maximum compatibility: Point, Triangle (or Triangle strip), Segment aka Lines (or Polyline aka Line Strip). Primitive strip types can be used to reduce memory usage as alternative to Indexed arrays. 2) Vertex array.
- Specifying the (maximum) number of vertexes within array.
- Specifying the vertex attributes, complementary to mandatory vertex Position (normal, color, UV texture coordinates).
- Defining vertex values by using various versions of AddVertex() or SetVertex*() methods. 3) Index array (optional).
- Specifying the (maximum) number of indexes (edges).
- Defining index values by using AddEdge() method; the index value should be within number of defined Vertexes.
Indexed array allows sharing vertex data across Primitives and thus reducing memory usage, since index size is much smaller then size of vertex with all its attributes. It is a preferred way for defining primitive array and main alternative to Primitive Strips for optimal memory usage, although it is also possible (but unusual) defining Indexed Primitive Strip. Note that it is NOT possible sharing Vertex Attributes partially (e.g. share Position, but have different Normals); in such cases Vertex should be entirely duplicated with all Attributes. 4) Bounds array (optional).
- Specifying the (maximum) number of bounds.
- Defining bounds using AddBound() methods.
Bounds allow splitting Primitive Array into sub-groups. This is useful only in two cases - for specifying per-group color and for restarting Primitive Strips. WARNING! Bounds within Primitive Array break rendering batches into parts (additional for loops), affecting rendering performance negatively (increasing CPU load).