Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
Graphic3d_ArrayOfQuadrangleStrips Class Reference

Contains quadrangles strip array definition. WARNING! Quadrangle primitives might be unsupported by graphics library. Triangulation should be used instead of quads for better compatibility. More...

#include <Graphic3d_ArrayOfQuadrangleStrips.hxx>

Inheritance diagram for Graphic3d_ArrayOfQuadrangleStrips:
Inheritance graph
[legend]

Public Member Functions

 Graphic3d_ArrayOfQuadrangleStrips (int theMaxVertexs, int theMaxStrips, Graphic3d_ArrayFlags theArrayFlags)
 Creates an array of quadrangle strips (Graphic3d_TOPA_QUADRANGLESTRIPS), a polygon can be filled as: 1) Creating a single strip defined with his vertexes, i.e:
 
 Graphic3d_ArrayOfQuadrangleStrips (int theMaxVertexs, int theMaxStrips=0, bool theHasVNormals=false, bool theHasVColors=false, bool theHasSColors=false, bool theHasVTexels=false)
 Creates an array of quadrangle strips (Graphic3d_TOPA_QUADRANGLESTRIPS).
 
- Public Member Functions inherited from Graphic3d_ArrayOfPrimitives
 ~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 charStringType () 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.
 
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.
 
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.
 

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

Detailed Description

Contains quadrangles strip array definition. WARNING! Quadrangle primitives might be unsupported by graphics library. Triangulation should be used instead of quads for better compatibility.

Constructor & Destructor Documentation

◆ Graphic3d_ArrayOfQuadrangleStrips() [1/2]

Graphic3d_ArrayOfQuadrangleStrips::Graphic3d_ArrayOfQuadrangleStrips ( int theMaxVertexs,
int theMaxStrips,
Graphic3d_ArrayFlags theArrayFlags )
inline

Creates an array of quadrangle strips (Graphic3d_TOPA_QUADRANGLESTRIPS), a polygon can be filled as: 1) Creating a single strip defined with his vertexes, i.e:

myArray->AddVertex (x1, y1, z1);
....
myArray->AddVertex (x7, y7, z7);
Graphic3d_ArrayOfQuadrangleStrips(int theMaxVertexs, int theMaxStrips, Graphic3d_ArrayFlags theArrayFlags)
Creates an array of quadrangle strips (Graphic3d_TOPA_QUADRANGLESTRIPS), a polygon can be filled as: ...
Definition Graphic3d_ArrayOfQuadrangleStrips.hxx:52
STL input iterator that wraps an OCCT More()/Next() iterator.
Definition NCollection_ForwardRange.hxx:142

2) Creating separate strips defined with a predefined number of strips and the number of vertex per strip, i.e:

myArray->AddBound (4);
myArray->AddVertex (x1, y1, z1);
....
myArray->AddVertex (x4, y4, z4);
myArray->AddBound (4);
myArray->AddVertex (x5, y5, z5);
....
myArray->AddVertex (x8, y8, z8);

The number of quadrangle really drawn is: VertexNumber()/2 - std::min(1, BoundNumber()).

Parameters
theMaxVertexsdefines the maximum allowed vertex number in the array
theMaxStripsdefines the maximum allowed strip number in the array
theArrayFlagsarray flags

◆ Graphic3d_ArrayOfQuadrangleStrips() [2/2]

Graphic3d_ArrayOfQuadrangleStrips::Graphic3d_ArrayOfQuadrangleStrips ( int theMaxVertexs,
int theMaxStrips = 0,
bool theHasVNormals = false,
bool theHasVColors = false,
bool theHasSColors = false,
bool theHasVTexels = false )
inline

Creates an array of quadrangle strips (Graphic3d_TOPA_QUADRANGLESTRIPS).

Parameters
theMaxVertexsdefines the maximum allowed vertex number in the array
theMaxStripsdefines the maximum allowed strip number in the array

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