OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    Graphic3d_ArrayOfPrimitives Class Reference

    This class furnish services to defined and fill an array of primitives which can be passed directly to graphics rendering API. More...

    #include <Graphic3d_ArrayOfPrimitives.hxx>

    Inheritance diagram for Graphic3d_ArrayOfPrimitives:

    Public Member Functions

     ~Graphic3d_ArrayOfPrimitives () override
     Destructor.
    const occ::handle< Graphic3d_Buffer > & Attributes () const
     Returns vertex attributes buffer (colors, normals, texture coordinates).
    Graphic3d_TypeOfPrimitiveArray Type () const
     Returns the type of this primitive.
    const char * StringType () const
     Returns the string type of this primitive.
    bool HasVertexNormals () const
     Returns TRUE when vertex normals array is defined.
    bool HasVertexColors () const
     Returns TRUE when vertex colors array is defined.
    bool HasVertexTexels () const
     Returns TRUE when vertex texels array is defined.
    int VertexNumber () const
     Returns the number of defined vertex.
    int VertexNumberAllocated () const
     Returns the number of allocated vertex.
    int ItemNumber () const
     Returns the number of total items according to the array type.
    bool IsValid ()
     Returns TRUE only when the contains of this array is available.
    int AddVertex (const gp_Pnt &theVertex)
     Adds a vertice in the array.
    int AddVertex (const NCollection_Vec3< float > &theVertex)
     Adds a vertice in the array.
    int AddVertex (const double theX, const double theY, const double theZ)
     Adds a vertice in the array.
    int AddVertex (const float theX, const float theY, const float theZ)
     Adds a vertice in the array.
    int 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.
    int AddVertex (const gp_Pnt &theVertex, const int theColor32)
     Adds a vertice and vertex color in the vertex array. Warning: theColor is ignored when the hasVColors constructor parameter is FALSE.
    int AddVertex (const gp_Pnt &theVertex, const NCollection_Vec4< uint8_t > &theColor)
     Adds a vertice and vertex color in the vertex array. Warning: theColor is ignored when the hasVColors constructor parameter is FALSE.
    int 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.
    int AddVertex (const double theX, const double theY, const double theZ, const double theNX, const double theNY, const double theNZ)
     Adds a vertice and vertex normal in the vertex array. Warning: Normal is ignored when the hasVNormals constructor parameter is FALSE.
    int AddVertex (const float theX, const float theY, const float theZ, const float theNX, const float theNY, const float theNZ)
     Adds a vertice and vertex normal in the vertex array. Warning: Normal is ignored when the hasVNormals constructor parameter is FALSE.
    int 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.
    int AddVertex (const gp_Pnt &theVertex, const gp_Dir &theNormal, const int 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.
    int 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.
    int AddVertex (const double theX, const double theY, const double theZ, const double theTX, const double theTY)
     Adds a vertice and vertex texture coordinates in the vertex array. Texel is ignored when the hasVTexels constructor parameter is FALSE.
    int AddVertex (const float theX, const float theY, const float theZ, const float theTX, const float theTY)
     Adds a vertice and vertex texture coordinates in the vertex array. Texel is ignored when the hasVTexels constructor parameter is FALSE.
    int 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.
    int AddVertex (const double theX, const double theY, const double theZ, const double theNX, const double theNY, const double theNZ, const double theTX, const double 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.
    int AddVertex (const float theX, const float theY, const float theZ, const float theNX, const float theNY, const float theNZ, const float theTX, const float 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 int theIndex, const gp_Pnt &theVertex)
     Change the vertice of rank theIndex in the array.
    void SetVertice (const int theIndex, const float theX, const float theY, const float theZ)
     Change the vertice in the array.
    void SetVertexColor (const int theIndex, const Quantity_Color &theColor)
     Change the vertex color in the array.
    void SetVertexColor (const int theIndex, const double theR, const double theG, const double theB)
     Change the vertex color in the array.
    void SetVertexColor (const int theIndex, const NCollection_Vec4< uint8_t > &theColor)
     Change the vertex color in the array.
    void SetVertexColor (const int theIndex, const int theColor32)
     Change the vertex color in the array.
    void SetVertexNormal (const int theIndex, const gp_Dir &theNormal)
     Change the vertex normal in the array.
    void SetVertexNormal (const int theIndex, const double theNX, const double theNY, const double theNZ)
     Change the vertex normal in the array.
    void SetVertexTexel (const int theIndex, const gp_Pnt2d &theTexel)
     Change the vertex texel in the array.
    void SetVertexTexel (const int theIndex, const double theTX, const double theTY)
     Change the vertex texel in the array.
    gp_Pnt Vertice (const int theRank) const
     Returns the vertice from the vertex table if defined.
    void Vertice (const int theRank, double &theX, double &theY, double &theZ) const
     Returns the vertice coordinates at rank theRank from the vertex table if defined.
    Quantity_Color VertexColor (const int theRank) const
     Returns the vertex color at rank theRank from the vertex table if defined.
    void VertexColor (const int theIndex, NCollection_Vec4< uint8_t > &theColor) const
     Returns the vertex color from the vertex table if defined.
    void VertexColor (const int theRank, double &theR, double &theG, double &theB) const
     Returns the vertex color values from the vertex table if defined.
    void VertexColor (const int theRank, int &theColor) const
     Returns the vertex color values from the vertex table if defined.
    gp_Dir VertexNormal (const int theRank) const
     Returns the vertex normal from the vertex table if defined.
    void VertexNormal (const int theRank, double &theNX, double &theNY, double &theNZ) const
     Returns the vertex normal coordinates at rank theRank from the vertex table if defined.
    gp_Pnt2d VertexTexel (const int theRank) const
     Returns the vertex texture at rank theRank from the vertex table if defined.
    void VertexTexel (const int theRank, double &theTX, double &theTY) const
     Returns the vertex texture coordinates at rank theRank from the vertex table if defined.
    optional array of Indices/Edges for using shared Vertex data

    Returns optional index buffer.

    const occ::handle< Graphic3d_IndexBuffer > & Indices () const
     Returns the number of defined edges.
    int EdgeNumber () const
     Returns the number of defined edges.
    int EdgeNumberAllocated () const
     Returns the number of allocated edges.
    int Edge (const int theRank) const
     Returns the vertex index at rank theRank in the range [1,EdgeNumber()].
    int AddEdge (const int theVertexIndex)
     Adds an edge in the range [1,VertexNumber()] in the array.
    int AddEdges (int theVertexIndex1, int theVertexIndex2)
     Convenience method, adds two vertex indices (a segment) in the range [1,VertexNumber()] in the array.
    int AddSegmentEdges (int theVertexIndex1, int 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.
    int AddEdges (int theVertexIndex1, int theVertexIndex2, int theVertexIndex3)
     Convenience method, adds three vertex indices (a triangle) in the range [1,VertexNumber()] in the array.
    int AddTriangleEdges (int theVertexIndex1, int theVertexIndex2, int 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.
    int AddTriangleEdges (const NCollection_Vec3< int > &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.
    int AddTriangleEdges (const NCollection_Vec4< int > &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.
    int AddEdges (int theVertexIndex1, int theVertexIndex2, int theVertexIndex3, int theVertexIndex4)
     Convenience method, adds four vertex indices (a quad) in the range [1,VertexNumber()] in the array.
    int AddQuadEdges (int theVertexIndex1, int theVertexIndex2, int theVertexIndex3, int 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.
    int AddQuadTriangleEdges (int theVertexIndex1, int theVertexIndex2, int theVertexIndex3, int 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.
    int AddQuadTriangleEdges (const NCollection_Vec4< int > &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 (int theVertexLower, int 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 (int theVertexLower, int theVertexUpper, bool 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 (int theVertexLower, int theVertexUpper, bool 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.
    optional array of Bounds/Subgroups within primitive array (e.g. restarting

    primitives / assigning colors) Returns optional bounds buffer.

    const occ::handle< Graphic3d_BoundBuffer > & Bounds () const
     Returns TRUE when bound colors array is defined.
    bool HasBoundColors () const
     Returns TRUE when bound colors array is defined.
    int BoundNumber () const
     Returns the number of defined bounds.
    int BoundNumberAllocated () const
     Returns the number of allocated bounds.
    int Bound (const int theRank) const
     Returns the edge number at rank theRank.
    Quantity_Color BoundColor (const int theRank) const
     Returns the bound color at rank theRank from the bound table if defined.
    void BoundColor (const int theRank, double &theR, double &theG, double &theB) const
     Returns the bound color values at rank theRank from the bound table if defined.
    int AddBound (const int theEdgeNumber)
     Adds a bound of length theEdgeNumber in the bound array.
    int AddBound (const int 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.
    int AddBound (const int theEdgeNumber, const double theR, const double theG, const double 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 int theIndex, const Quantity_Color &theColor)
     Change the bound color of rank theIndex in the array.
    void SetBoundColor (const int theIndex, const double theR, const double theG, const double 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_Transientoperator= (const Standard_Transient &)
     Assignment operator, needed to avoid copying reference counter.
    virtual ~Standard_Transient ()=default
     Destructor must be virtual.
    virtual const opencascade::handle< Standard_Type > & DynamicType () const
     Returns a type descriptor about this object.
    bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
     Returns a true value if this is an instance of Type.
    bool IsInstance (const char *const theTypeName) const
     Returns a true value if this is an instance of TypeName.
    bool 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.
    bool IsKind (const char *const 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.
    int GetRefCount () const noexcept
     Get the reference counter of this object.
    void IncrementRefCounter () noexcept
     Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
    int DecrementRefCounter () noexcept
     Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
    virtual void Delete () const
     Memory deallocator for transient classes.

    Static Public Member Functions

    static occ::handle< Graphic3d_ArrayOfPrimitivesCreateArray (Graphic3d_TypeOfPrimitiveArray theType, int theMaxVertexs, int theMaxEdges, Graphic3d_ArrayFlags theArrayFlags)
     Create an array of specified type.
    static occ::handle< Graphic3d_ArrayOfPrimitivesCreateArray (Graphic3d_TypeOfPrimitiveArray theType, int theMaxVertexs, int theMaxBounds, int theMaxEdges, Graphic3d_ArrayFlags theArrayFlags)
     Create an array of specified type.
    static constexpr const char * get_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

    protected constructors

    Main constructor.

    Parameters
    theTypetype of primitive
    theMaxVertexslength of vertex attributes buffer to be allocated (maximum number of vertexes,
    See also
    ::AddVertex())
    Parameters
    theMaxBoundslength of bounds buffer to be allocated (maximum number of bounds,
    See also
    ::AddBound())
    Parameters
    theMaxEdgeslength of edges (index) buffer to be allocated (maximum number of indexes
    See also
    ::AddEdge())
    Parameters
    theArrayFlagsarray flags
     Graphic3d_ArrayOfPrimitives (Graphic3d_TypeOfPrimitiveArray theType, int theMaxVertexs, int theMaxBounds, int theMaxEdges, Graphic3d_ArrayFlags theArrayFlags)
     Array constructor.
    void init (Graphic3d_TypeOfPrimitiveArray theType, int theMaxVertexs, int theMaxBounds, int theMaxEdges, Graphic3d_ArrayFlags theArrayFlags)
     Array constructor.

    Additional Inherited Members

    typedef void base_type
     Returns a type descriptor about this object.

    Detailed Description

    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).

    Constructor & Destructor Documentation

    ◆ ~Graphic3d_ArrayOfPrimitives()

    Graphic3d_ArrayOfPrimitives::~Graphic3d_ArrayOfPrimitives ( )
    override

    Destructor.

    ◆ Graphic3d_ArrayOfPrimitives()

    Graphic3d_ArrayOfPrimitives::Graphic3d_ArrayOfPrimitives ( Graphic3d_TypeOfPrimitiveArray theType,
    int theMaxVertexs,
    int theMaxBounds,
    int theMaxEdges,
    Graphic3d_ArrayFlags theArrayFlags )
    inlineprotected

    Array constructor.

    Member Function Documentation

    ◆ AddBound() [1/3]

    int Graphic3d_ArrayOfPrimitives::AddBound ( const int theEdgeNumber)

    Adds a bound of length theEdgeNumber in the bound array.

    Returns
    the actual bounds number

    ◆ AddBound() [2/3]

    int Graphic3d_ArrayOfPrimitives::AddBound ( const int theEdgeNumber,
    const double theR,
    const double theG,
    const double 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.

    Returns
    the actual bounds number

    ◆ AddBound() [3/3]

    int Graphic3d_ArrayOfPrimitives::AddBound ( const int theEdgeNumber,
    const Quantity_Color & theBColor )
    inline

    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.

    Returns
    the actual bounds number

    ◆ AddEdge()

    int Graphic3d_ArrayOfPrimitives::AddEdge ( const int theVertexIndex)

    Adds an edge in the range [1,VertexNumber()] in the array.

    Returns
    the actual edges number

    ◆ AddEdges() [1/3]

    int Graphic3d_ArrayOfPrimitives::AddEdges ( int theVertexIndex1,
    int theVertexIndex2 )
    inline

    Convenience method, adds two vertex indices (a segment) in the range [1,VertexNumber()] in the array.

    Returns
    the actual edges number

    ◆ AddEdges() [2/3]

    int Graphic3d_ArrayOfPrimitives::AddEdges ( int theVertexIndex1,
    int theVertexIndex2,
    int theVertexIndex3 )
    inline

    Convenience method, adds three vertex indices (a triangle) in the range [1,VertexNumber()] in the array.

    Returns
    the actual edges number

    ◆ AddEdges() [3/3]

    int Graphic3d_ArrayOfPrimitives::AddEdges ( int theVertexIndex1,
    int theVertexIndex2,
    int theVertexIndex3,
    int theVertexIndex4 )
    inline

    Convenience method, adds four vertex indices (a quad) in the range [1,VertexNumber()] in the array.

    Returns
    the actual edges number

    ◆ AddPolylineEdges()

    void Graphic3d_ArrayOfPrimitives::AddPolylineEdges ( int theVertexLower,
    int theVertexUpper,
    bool 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.

    Parameters
    [in]theVertexLowerindex of first node defining line strip fun (center)
    [in]theVertexUpperindex of last node defining triangle fun
    [in]theToCloseclose triangle fan (connect first and last points)

    ◆ AddQuadEdges()

    int Graphic3d_ArrayOfPrimitives::AddQuadEdges ( int theVertexIndex1,
    int theVertexIndex2,
    int theVertexIndex3,
    int theVertexIndex4 )
    inline

    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.

    Returns
    the actual edges number

    ◆ AddQuadTriangleEdges() [1/2]

    int Graphic3d_ArrayOfPrimitives::AddQuadTriangleEdges ( const NCollection_Vec4< int > & theIndexes)
    inline

    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.

    Returns
    the actual edges number

    ◆ AddQuadTriangleEdges() [2/2]

    int Graphic3d_ArrayOfPrimitives::AddQuadTriangleEdges ( int theVertexIndex1,
    int theVertexIndex2,
    int theVertexIndex3,
    int theVertexIndex4 )
    inline

    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.

    Returns
    the actual edges number

    ◆ AddSegmentEdges()

    int Graphic3d_ArrayOfPrimitives::AddSegmentEdges ( int theVertexIndex1,
    int theVertexIndex2 )
    inline

    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.

    Returns
    the actual edges number

    ◆ AddTriangleEdges() [1/3]

    int Graphic3d_ArrayOfPrimitives::AddTriangleEdges ( const NCollection_Vec3< int > & theIndexes)
    inline

    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.

    Returns
    the actual edges number

    ◆ AddTriangleEdges() [2/3]

    int Graphic3d_ArrayOfPrimitives::AddTriangleEdges ( const NCollection_Vec4< int > & theIndexes)
    inline

    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.

    Returns
    the actual edges number

    ◆ AddTriangleEdges() [3/3]

    int Graphic3d_ArrayOfPrimitives::AddTriangleEdges ( int theVertexIndex1,
    int theVertexIndex2,
    int theVertexIndex3 )
    inline

    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.

    Returns
    the actual edges number

    ◆ AddTriangleFanEdges()

    void Graphic3d_ArrayOfPrimitives::AddTriangleFanEdges ( int theVertexLower,
    int theVertexUpper,
    bool 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.

    Parameters
    [in]theVertexLowerindex of first node defining triangle fun (center)
    [in]theVertexUpperindex of last node defining triangle fun
    [in]theToCloseclose triangle fan (connect first and last points)

    ◆ AddTriangleStripEdges()

    void Graphic3d_ArrayOfPrimitives::AddTriangleStripEdges ( int theVertexLower,
    int 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.

    Parameters
    [in]theVertexLowerindex of first node defining triangle strip
    [in]theVertexUpperindex of last node defining triangle strip

    ◆ AddVertex() [1/18]

    int Graphic3d_ArrayOfPrimitives::AddVertex ( const double theX,
    const double theY,
    const double theZ )
    inline

    Adds a vertice in the array.

    Returns
    the actual vertex number

    ◆ AddVertex() [2/18]

    int Graphic3d_ArrayOfPrimitives::AddVertex ( const double theX,
    const double theY,
    const double theZ,
    const double theNX,
    const double theNY,
    const double theNZ )
    inline

    Adds a vertice and vertex normal in the vertex array. Warning: Normal is ignored when the hasVNormals constructor parameter is FALSE.

    Returns
    the actual vertex number

    ◆ AddVertex() [3/18]

    int Graphic3d_ArrayOfPrimitives::AddVertex ( const double theX,
    const double theY,
    const double theZ,
    const double theNX,
    const double theNY,
    const double theNZ,
    const double theTX,
    const double theTY )
    inline

    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.

    Returns
    the actual vertex number

    ◆ AddVertex() [4/18]

    int Graphic3d_ArrayOfPrimitives::AddVertex ( const double theX,
    const double theY,
    const double theZ,
    const double theTX,
    const double theTY )
    inline

    Adds a vertice and vertex texture coordinates in the vertex array. Texel is ignored when the hasVTexels constructor parameter is FALSE.

    Returns
    the actual vertex number

    ◆ AddVertex() [5/18]

    int Graphic3d_ArrayOfPrimitives::AddVertex ( const float theX,
    const float theY,
    const float theZ )
    inline

    Adds a vertice in the array.

    Returns
    the actual vertex number.

    ◆ AddVertex() [6/18]

    int Graphic3d_ArrayOfPrimitives::AddVertex ( const float theX,
    const float theY,
    const float theZ,
    const float theNX,
    const float theNY,
    const float theNZ )
    inline

    Adds a vertice and vertex normal in the vertex array. Warning: Normal is ignored when the hasVNormals constructor parameter is FALSE.

    Returns
    the actual vertex number

    ◆ AddVertex() [7/18]

    int Graphic3d_ArrayOfPrimitives::AddVertex ( const float theX,
    const float theY,
    const float theZ,
    const float theNX,
    const float theNY,
    const float theNZ,
    const float theTX,
    const float theTY )
    inline

    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.

    Returns
    the actual vertex number

    ◆ AddVertex() [8/18]

    int Graphic3d_ArrayOfPrimitives::AddVertex ( const float theX,
    const float theY,
    const float theZ,
    const float theTX,
    const float theTY )
    inline

    Adds a vertice and vertex texture coordinates in the vertex array. Texel is ignored when the hasVTexels constructor parameter is FALSE.

    Returns
    the actual vertex number

    ◆ AddVertex() [9/18]

    int Graphic3d_ArrayOfPrimitives::AddVertex ( const gp_Pnt & theVertex)
    inline

    Adds a vertice in the array.

    Returns
    the actual vertex number

    ◆ AddVertex() [10/18]

    int Graphic3d_ArrayOfPrimitives::AddVertex ( const gp_Pnt & theVertex,
    const gp_Dir & theNormal )
    inline

    Adds a vertice and vertex normal in the vertex array. Warning: theNormal is ignored when the hasVNormals constructor parameter is FALSE.

    Returns
    the actual vertex number

    ◆ AddVertex() [11/18]

    int Graphic3d_ArrayOfPrimitives::AddVertex ( const gp_Pnt & theVertex,
    const gp_Dir & theNormal,
    const gp_Pnt2d & theTexel )
    inline

    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.

    Returns
    the actual vertex number

    ◆ AddVertex() [12/18]

    int Graphic3d_ArrayOfPrimitives::AddVertex ( const gp_Pnt & theVertex,
    const gp_Dir & theNormal,
    const int theColor32 )
    inline

    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.

    theColor32 = Alpha << 24 + Blue << 16 + Green << 8 + Red
    Returns
    the actual vertex number

    ◆ AddVertex() [13/18]

    int Graphic3d_ArrayOfPrimitives::AddVertex ( const gp_Pnt & theVertex,
    const gp_Dir & theNormal,
    const Quantity_Color & theColor )
    inline

    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.

    Returns
    the actual vertex number

    ◆ AddVertex() [14/18]

    int Graphic3d_ArrayOfPrimitives::AddVertex ( const gp_Pnt & theVertex,
    const gp_Pnt2d & theTexel )
    inline

    Adds a vertice and vertex texture in the vertex array. theTexel is ignored when the hasVTexels constructor parameter is FALSE.

    Returns
    the actual vertex number

    ◆ AddVertex() [15/18]

    int Graphic3d_ArrayOfPrimitives::AddVertex ( const gp_Pnt & theVertex,
    const int theColor32 )
    inline

    Adds a vertice and vertex color in the vertex array. Warning: theColor is ignored when the hasVColors constructor parameter is FALSE.

    theColor32 = Alpha << 24 + Blue << 16 + Green << 8 + Red
    Returns
    the actual vertex number

    ◆ AddVertex() [16/18]

    int Graphic3d_ArrayOfPrimitives::AddVertex ( const gp_Pnt & theVertex,
    const NCollection_Vec4< uint8_t > & theColor )
    inline

    Adds a vertice and vertex color in the vertex array. Warning: theColor is ignored when the hasVColors constructor parameter is FALSE.

    Returns
    the actual vertex number

    ◆ AddVertex() [17/18]

    int Graphic3d_ArrayOfPrimitives::AddVertex ( const gp_Pnt & theVertex,
    const Quantity_Color & theColor )
    inline

    Adds a vertice and vertex color in the vertex array. Warning: theColor is ignored when the hasVColors constructor parameter is FALSE.

    Returns
    the actual vertex number

    ◆ AddVertex() [18/18]

    int Graphic3d_ArrayOfPrimitives::AddVertex ( const NCollection_Vec3< float > & theVertex)
    inline

    Adds a vertice in the array.

    Returns
    the actual vertex number

    ◆ Attributes()

    const occ::handle< Graphic3d_Buffer > & Graphic3d_ArrayOfPrimitives::Attributes ( ) const
    inline

    Returns vertex attributes buffer (colors, normals, texture coordinates).

    ◆ Bound()

    int Graphic3d_ArrayOfPrimitives::Bound ( const int theRank) const
    inline

    Returns the edge number at rank theRank.

    ◆ BoundColor() [1/2]

    Quantity_Color Graphic3d_ArrayOfPrimitives::BoundColor ( const int theRank) const
    inline

    Returns the bound color at rank theRank from the bound table if defined.

    ◆ BoundColor() [2/2]

    void Graphic3d_ArrayOfPrimitives::BoundColor ( const int theRank,
    double & theR,
    double & theG,
    double & theB ) const
    inline

    Returns the bound color values at rank theRank from the bound table if defined.

    ◆ BoundNumber()

    int Graphic3d_ArrayOfPrimitives::BoundNumber ( ) const
    inline

    Returns the number of defined bounds.

    ◆ BoundNumberAllocated()

    int Graphic3d_ArrayOfPrimitives::BoundNumberAllocated ( ) const
    inline

    Returns the number of allocated bounds.

    ◆ Bounds()

    const occ::handle< Graphic3d_BoundBuffer > & Graphic3d_ArrayOfPrimitives::Bounds ( ) const
    inline

    Returns TRUE when bound colors array is defined.

    ◆ CreateArray() [1/2]

    occ::handle< Graphic3d_ArrayOfPrimitives > Graphic3d_ArrayOfPrimitives::CreateArray ( Graphic3d_TypeOfPrimitiveArray theType,
    int theMaxVertexs,
    int theMaxBounds,
    int theMaxEdges,
    Graphic3d_ArrayFlags theArrayFlags )
    static

    Create an array of specified type.

    ◆ CreateArray() [2/2]

    occ::handle< Graphic3d_ArrayOfPrimitives > Graphic3d_ArrayOfPrimitives::CreateArray ( Graphic3d_TypeOfPrimitiveArray theType,
    int theMaxVertexs,
    int theMaxEdges,
    Graphic3d_ArrayFlags theArrayFlags )
    inlinestatic

    Create an array of specified type.

    ◆ Edge()

    int Graphic3d_ArrayOfPrimitives::Edge ( const int theRank) const
    inline

    Returns the vertex index at rank theRank in the range [1,EdgeNumber()].

    ◆ EdgeNumber()

    int Graphic3d_ArrayOfPrimitives::EdgeNumber ( ) const
    inline

    Returns the number of defined edges.

    ◆ EdgeNumberAllocated()

    int Graphic3d_ArrayOfPrimitives::EdgeNumberAllocated ( ) const
    inline

    Returns the number of allocated edges.

    ◆ HasBoundColors()

    bool Graphic3d_ArrayOfPrimitives::HasBoundColors ( ) const
    inline

    Returns TRUE when bound colors array is defined.

    ◆ HasVertexColors()

    bool Graphic3d_ArrayOfPrimitives::HasVertexColors ( ) const
    inline

    Returns TRUE when vertex colors array is defined.

    ◆ HasVertexNormals()

    bool Graphic3d_ArrayOfPrimitives::HasVertexNormals ( ) const
    inline

    Returns TRUE when vertex normals array is defined.

    ◆ HasVertexTexels()

    bool Graphic3d_ArrayOfPrimitives::HasVertexTexels ( ) const
    inline

    Returns TRUE when vertex texels array is defined.

    ◆ Indices()

    const occ::handle< Graphic3d_IndexBuffer > & Graphic3d_ArrayOfPrimitives::Indices ( ) const
    inline

    Returns the number of defined edges.

    ◆ init()

    void Graphic3d_ArrayOfPrimitives::init ( Graphic3d_TypeOfPrimitiveArray theType,
    int theMaxVertexs,
    int theMaxBounds,
    int theMaxEdges,
    Graphic3d_ArrayFlags theArrayFlags )
    protected

    Array constructor.

    ◆ IsValid()

    bool Graphic3d_ArrayOfPrimitives::IsValid ( )

    Returns TRUE only when the contains of this array is available.

    ◆ ItemNumber()

    int Graphic3d_ArrayOfPrimitives::ItemNumber ( ) const

    Returns the number of total items according to the array type.

    ◆ SetBoundColor() [1/2]

    void Graphic3d_ArrayOfPrimitives::SetBoundColor ( const int theIndex,
    const double theR,
    const double theG,
    const double theB )
    inline

    Change the bound color of rank theIndex in the array.

    ◆ SetBoundColor() [2/2]

    void Graphic3d_ArrayOfPrimitives::SetBoundColor ( const int theIndex,
    const Quantity_Color & theColor )
    inline

    Change the bound color of rank theIndex in the array.

    ◆ SetVertexColor() [1/4]

    void Graphic3d_ArrayOfPrimitives::SetVertexColor ( const int theIndex,
    const double theR,
    const double theG,
    const double theB )
    inline

    Change the vertex color in the array.

    Parameters
    [in]theIndexnode index within [1, VertexNumberAllocated()] range
    [in]theRred color value within [0, 1] range
    [in]theGgreen color value within [0, 1] range
    [in]theBblue color value within [0, 1] range

    ◆ SetVertexColor() [2/4]

    void Graphic3d_ArrayOfPrimitives::SetVertexColor ( const int theIndex,
    const int theColor32 )
    inline

    Change the vertex color in the array.

    theColor32 = Alpha << 24 + Blue << 16 + Green << 8 + Red
    Parameters
    [in]theIndexnode index within [1, VertexNumberAllocated()] range
    [in]theColor32packed RGBA color values

    ◆ SetVertexColor() [3/4]

    void Graphic3d_ArrayOfPrimitives::SetVertexColor ( const int theIndex,
    const NCollection_Vec4< uint8_t > & theColor )
    inline

    Change the vertex color in the array.

    Parameters
    [in]theIndexnode index within [1, VertexNumberAllocated()] range
    [in]theColornode RGBA color values within [0, 255] range

    ◆ SetVertexColor() [4/4]

    void Graphic3d_ArrayOfPrimitives::SetVertexColor ( const int theIndex,
    const Quantity_Color & theColor )
    inline

    Change the vertex color in the array.

    Parameters
    [in]theIndexnode index within [1, VertexNumberAllocated()] range
    [in]theColornode color

    ◆ SetVertexNormal() [1/2]

    void Graphic3d_ArrayOfPrimitives::SetVertexNormal ( const int theIndex,
    const double theNX,
    const double theNY,
    const double theNZ )
    inline

    Change the vertex normal in the array.

    Parameters
    [in]theIndexnode index within [1, VertexNumberAllocated()] range
    [in]theNXsurface normal X component
    [in]theNYsurface normal Y component
    [in]theNZsurface normal Z component

    ◆ SetVertexNormal() [2/2]

    void Graphic3d_ArrayOfPrimitives::SetVertexNormal ( const int theIndex,
    const gp_Dir & theNormal )
    inline

    Change the vertex normal in the array.

    Parameters
    [in]theIndexnode index within [1, VertexNumberAllocated()] range
    [in]theNormalnormalized surface normal

    ◆ SetVertexTexel() [1/2]

    void Graphic3d_ArrayOfPrimitives::SetVertexTexel ( const int theIndex,
    const double theTX,
    const double theTY )
    inline

    Change the vertex texel in the array.

    Parameters
    [in]theIndexnode index within [1, VertexNumberAllocated()] range
    [in]theTXnode U coordinate
    [in]theTYnode V coordinate

    ◆ SetVertexTexel() [2/2]

    void Graphic3d_ArrayOfPrimitives::SetVertexTexel ( const int theIndex,
    const gp_Pnt2d & theTexel )
    inline

    Change the vertex texel in the array.

    Parameters
    [in]theIndexnode index within [1, VertexNumberAllocated()] range
    [in]theTexelnode UV coordinates

    ◆ SetVertice() [1/2]

    void Graphic3d_ArrayOfPrimitives::SetVertice ( const int theIndex,
    const float theX,
    const float theY,
    const float theZ )
    inline

    Change the vertice in the array.

    Parameters
    [in]theIndexnode index within [1, VertexNumberAllocated()] range
    [in]theXcoordinate X
    [in]theYcoordinate Y
    [in]theZcoordinate Z

    ◆ SetVertice() [2/2]

    void Graphic3d_ArrayOfPrimitives::SetVertice ( const int theIndex,
    const gp_Pnt & theVertex )
    inline

    Change the vertice of rank theIndex in the array.

    Parameters
    [in]theIndexnode index within [1, VertexNumberAllocated()] range
    [in]theVertex3D coordinates

    ◆ StringType()

    const char * Graphic3d_ArrayOfPrimitives::StringType ( ) const

    Returns the string type of this primitive.

    ◆ Type()

    Graphic3d_TypeOfPrimitiveArray Graphic3d_ArrayOfPrimitives::Type ( ) const
    inline

    Returns the type of this primitive.

    ◆ VertexColor() [1/4]

    void Graphic3d_ArrayOfPrimitives::VertexColor ( const int theIndex,
    NCollection_Vec4< uint8_t > & theColor ) const
    inline

    Returns the vertex color from the vertex table if defined.

    Parameters
    [in]theIndexnode index within [1, VertexNumber()] range
    [out]theColornode RGBA color values within [0, 255] range

    ◆ VertexColor() [2/4]

    Quantity_Color Graphic3d_ArrayOfPrimitives::VertexColor ( const int theRank) const
    inline

    Returns the vertex color at rank theRank from the vertex table if defined.

    Parameters
    [in]theRanknode index within [1, VertexNumber()] range
    Returns
    node color RGB value

    ◆ VertexColor() [3/4]

    void Graphic3d_ArrayOfPrimitives::VertexColor ( const int theRank,
    double & theR,
    double & theG,
    double & theB ) const
    inline

    Returns the vertex color values from the vertex table if defined.

    Parameters
    [in]theRanknode index within [1, VertexNumber()] range
    [out]theRnode red color component value within [0, 1] range
    [out]theGnode green color component value within [0, 1] range
    [out]theBnode blue color component value within [0, 1] range

    ◆ VertexColor() [4/4]

    void Graphic3d_ArrayOfPrimitives::VertexColor ( const int theRank,
    int & theColor ) const
    inline

    Returns the vertex color values from the vertex table if defined.

    Parameters
    [in]theRanknode index within [1, VertexNumber()] range
    [out]theColornode RGBA color packed into 32-bit integer

    ◆ VertexNormal() [1/2]

    gp_Dir Graphic3d_ArrayOfPrimitives::VertexNormal ( const int theRank) const
    inline

    Returns the vertex normal from the vertex table if defined.

    Parameters
    [in]theRanknode index within [1, VertexNumber()] range
    Returns
    normalized 3D vector defining surface normal

    ◆ VertexNormal() [2/2]

    void Graphic3d_ArrayOfPrimitives::VertexNormal ( const int theRank,
    double & theNX,
    double & theNY,
    double & theNZ ) const
    inline

    Returns the vertex normal coordinates at rank theRank from the vertex table if defined.

    Parameters
    [in]theRanknode index within [1, VertexNumber()] range
    [out]theNXnormal X coordinate
    [out]theNYnormal Y coordinate
    [out]theNZnormal Z coordinate

    ◆ VertexNumber()

    int Graphic3d_ArrayOfPrimitives::VertexNumber ( ) const
    inline

    Returns the number of defined vertex.

    ◆ VertexNumberAllocated()

    int Graphic3d_ArrayOfPrimitives::VertexNumberAllocated ( ) const
    inline

    Returns the number of allocated vertex.

    ◆ VertexTexel() [1/2]

    gp_Pnt2d Graphic3d_ArrayOfPrimitives::VertexTexel ( const int theRank) const
    inline

    Returns the vertex texture at rank theRank from the vertex table if defined.

    Parameters
    [in]theRanknode index within [1, VertexNumber()] range
    Returns
    UV coordinates

    ◆ VertexTexel() [2/2]

    void Graphic3d_ArrayOfPrimitives::VertexTexel ( const int theRank,
    double & theTX,
    double & theTY ) const
    inline

    Returns the vertex texture coordinates at rank theRank from the vertex table if defined.

    Parameters
    [in]theRanknode index within [1, VertexNumber()] range
    [out]theTXtexel U coordinate value
    [out]theTYtexel V coordinate value

    ◆ Vertice() [1/2]

    gp_Pnt Graphic3d_ArrayOfPrimitives::Vertice ( const int theRank) const
    inline

    Returns the vertice from the vertex table if defined.

    Parameters
    [in]theRanknode index within [1, VertexNumber()] range
    Returns
    node 3D coordinates

    ◆ Vertice() [2/2]

    void Graphic3d_ArrayOfPrimitives::Vertice ( const int theRank,
    double & theX,
    double & theY,
    double & theZ ) const
    inline

    Returns the vertice coordinates at rank theRank from the vertex table if defined.

    Parameters
    [in]theRanknode index within [1, VertexNumber()] range
    [out]theXnode X coordinate value
    [out]theYnode Y coordinate value
    [out]theZnode Z coordinate value

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