Open CASCADE Technology
7.2.0
|
Contains polylines array definition. More...
#include <Graphic3d_ArrayOfPolylines.hxx>
Public Member Functions | |
Graphic3d_ArrayOfPolylines (const Standard_Integer maxVertexs, const Standard_Integer maxBounds=0, const Standard_Integer maxEdges=0, const Standard_Boolean hasVColors=Standard_False, const Standard_Boolean hasBColors=Standard_False) | |
Creates an array of polylines, a polyline can be filled as: 1) creating a single polyline defined with his vertexs. i.e: myArray = Graphic3d_ArrayOfPolylines(7) myArray->AddVertex(x1,y1,z1) .... myArray->AddVertex(x7,y7,z7) 2) creating separate polylines defined with a predefined number of bounds and the number of vertex per bound. i.e: myArray = Graphic3d_ArrayOfPolylines(7,2) myArray->AddBound(4) myArray->AddVertex(x1,y1,z1) .... myArray->AddVertex(x4,y4,z4) myArray->AddBound(3) myArray->AddVertex(x5,y5,z5) .... myArray->AddVertex(x7,y7,z7) 3) creating a single indexed polyline defined with his vertex ans edges. i.e: myArray = Graphic3d_ArrayOfPolylines(4,0,6) myArray->AddVertex(x1,y1,z1) .... myArray->AddVertex(x4,y4,z4) myArray->AddEdge(1) myArray->AddEdge(2) myArray->AddEdge(3) myArray->AddEdge(1) myArray->AddEdge(2) myArray->AddEdge(4) 4) creating separate polylines defined with a predefined number of bounds and the number of edges per bound. i.e: myArray = Graphic3d_ArrayOfPolylines(6,4,14) myArray->AddBound(3) myArray->AddVertex(x1,y1,z1) myArray->AddVertex(x2,y2,z2) myArray->AddVertex(x3,y3,z3) myArray->AddEdge(1) myArray->AddEdge(2) myArray->AddEdge(3) myArray->AddBound(3) myArray->AddVertex(x4,y4,z4) myArray->AddVertex(x5,y5,z5) myArray->AddVertex(x6,y6,z6) myArray->AddEdge(4) myArray->AddEdge(5) myArray->AddEdge(6) myArray->AddBound(4) myArray->AddEdge(2) myArray->AddEdge(3) myArray->AddEdge(5) myArray->AddEdge(6) myArray->AddBound(4) myArray->AddEdge(1) myArray->AddEdge(3) myArray->AddEdge(5) myArray->AddEdge(4) More... | |
Public Member Functions inherited from Graphic3d_ArrayOfPrimitives | |
virtual | ~Graphic3d_ArrayOfPrimitives () |
Destructor. More... | |
const Handle< Graphic3d_Buffer > & | Attributes () const |
Returns vertex attributes buffer (colors, normals, texture coordinates). More... | |
Graphic3d_TypeOfPrimitiveArray | Type () const |
Returns the type of this primitive. More... | |
Standard_CString | StringType () const |
Returns the string type of this primitive. More... | |
Standard_Boolean | HasVertexNormals () const |
Returns TRUE when vertex normals array is defined. More... | |
Standard_Boolean | HasVertexColors () const |
Returns TRUE when vertex colors array is defined. More... | |
Standard_Boolean | HasVertexTexels () const |
Returns TRUE when vertex texels array is defined. More... | |
Standard_Integer | VertexNumber () const |
Returns the number of defined vertex. More... | |
Standard_Integer | ItemNumber () const |
Returns the number of total items according to the array type. More... | |
Standard_Boolean | IsValid () |
Returns TRUE only when the contains of this array is available. More... | |
Standard_Integer | AddVertex (const gp_Pnt &theVertex) |
Adds a vertice in the array. More... | |
Standard_Integer | AddVertex (const Graphic3d_Vec3 &theVertex) |
Adds a vertice in the array. More... | |
Standard_Integer | AddVertex (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ) |
Adds a vertice in the array. More... | |
Standard_Integer | AddVertex (const Standard_ShortReal theX, const Standard_ShortReal theY, const Standard_ShortReal theZ) |
Adds a vertice in the array. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
void | SetVertice (const Standard_Integer theIndex, const gp_Pnt &theVertex) |
Change the vertice of rank theIndex in the array. More... | |
void | SetVertice (const Standard_Integer theIndex, const Standard_ShortReal theX, const Standard_ShortReal theY, const Standard_ShortReal theZ) |
Change the vertice of rank theIndex in the array. More... | |
void | SetVertexColor (const Standard_Integer theIndex, const Quantity_Color &theColor) |
Change the vertex color of rank theIndex in the array. More... | |
void | SetVertexColor (const Standard_Integer theIndex, const Standard_Real theR, const Standard_Real theG, const Standard_Real theB) |
Change the vertex color of rank theIndex in the array. More... | |
void | SetVertexColor (const Standard_Integer theIndex, const Graphic3d_Vec4ub &theColor) |
Change the vertex color of rank theIndex in the array. More... | |
void | SetVertexColor (const Standard_Integer theIndex, const Standard_Integer theColor32) |
Change the vertex color of rank theIndex> in the array. More... | |
void | SetVertexNormal (const Standard_Integer theIndex, const gp_Dir &theNormal) |
Change the vertex normal of rank theIndex in the array. More... | |
void | SetVertexNormal (const Standard_Integer theIndex, const Standard_Real theNX, const Standard_Real theNY, const Standard_Real theNZ) |
Change the vertex normal of rank theIndex in the array. More... | |
void | SetVertexTexel (const Standard_Integer theIndex, const gp_Pnt2d &theTexel) |
Change the vertex texel of rank theIndex in the array. More... | |
void | SetVertexTexel (const Standard_Integer theIndex, const Standard_Real theTX, const Standard_Real theTY) |
Change the vertex texel of rank theIndex in the array. More... | |
gp_Pnt | Vertice (const Standard_Integer theRank) const |
Returns the vertice at rank theRank from the vertex table if defined. More... | |
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. More... | |
Quantity_Color | VertexColor (const Standard_Integer theRank) const |
Returns the vertex color at rank theRank from the vertex table if defined. More... | |
void | VertexColor (const Standard_Integer theIndex, Graphic3d_Vec4ub &theColor) const |
Returns the vertex color at rank theIndex from the vertex table if defined. More... | |
void | VertexColor (const Standard_Integer theRank, Standard_Real &theR, Standard_Real &theG, Standard_Real &theB) const |
Returns the vertex color values at rank theRank from the vertex table if defined. More... | |
void | VertexColor (const Standard_Integer theRank, Standard_Integer &theColor) const |
Returns the vertex color values at rank theRank from the vertex table if defined. More... | |
gp_Dir | VertexNormal (const Standard_Integer theRank) const |
Returns the vertex normal at rank theRank from the vertex table if defined. More... | |
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. More... | |
gp_Pnt2d | VertexTexel (const Standard_Integer theRank) const |
Returns the vertex texture at rank theRank from the vertex table if defined. More... | |
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. More... | |
const Handle< Graphic3d_IndexBuffer > & | Indices () const |
Returns optional index buffer. More... | |
Standard_Integer | EdgeNumber () const |
Returns the number of defined edges. More... | |
Standard_Integer | Edge (const Standard_Integer theRank) const |
Returns the vertex index at rank theRank in the range [1,EdgeNumber()]. More... | |
Standard_Integer | AddEdge (const Standard_Integer theVertexIndex) |
Adds an edge in the range [1,VertexNumber()] in the array. More... | |
const Handle< Graphic3d_BoundBuffer > & | Bounds () const |
Returns optional bounds buffer. More... | |
Standard_Boolean | HasBoundColors () const |
Returns TRUE when bound colors array is defined. More... | |
Standard_Integer | BoundNumber () const |
Returns the number of defined bounds. More... | |
Standard_Integer | Bound (const Standard_Integer theRank) const |
Returns the edge number at rank theRank. More... | |
Quantity_Color | BoundColor (const Standard_Integer theRank) const |
Returns the bound color at rank theRank from the bound table if defined. More... | |
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. More... | |
Standard_Integer | AddBound (const Standard_Integer theEdgeNumber) |
Adds a bound of length theEdgeNumber in the bound array. More... | |
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. More... | |
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. More... | |
void | SetBoundColor (const Standard_Integer theIndex, const Quantity_Color &theColor) |
Change the bound color of rank theIndex in the array. More... | |
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. More... | |
Public Member Functions inherited from Standard_Transient | |
Standard_Transient () | |
Empty constructor. More... | |
Standard_Transient (const Standard_Transient &) | |
Copy constructor – does nothing. More... | |
Standard_Transient & | operator= (const Standard_Transient &) |
Assignment operator, needed to avoid copying reference counter. More... | |
virtual | ~Standard_Transient () |
Destructor must be virtual. More... | |
virtual void | Delete () const |
Memory deallocator for transient classes. More... | |
virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
Returns a type descriptor about this object. More... | |
Standard_Boolean | IsInstance (const opencascade::handle< Standard_Type > &theType) const |
Returns a true value if this is an instance of Type. More... | |
Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
Returns a true value if this is an instance of TypeName. More... | |
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. More... | |
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. More... | |
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. More... | |
Standard_Integer | GetRefCount () const |
Get the reference counter of this object. More... | |
void | IncrementRefCounter () const |
Increments the reference counter of this object. More... | |
Standard_Integer | DecrementRefCounter () const |
Decrements the reference counter of this object; returns the decremented value. More... | |
Additional Inherited Members | |
Public Types inherited from Standard_Transient | |
typedef void | base_type |
Returns a type descriptor about this object. More... | |
Static Public Member Functions inherited from Standard_Transient | |
static const char * | get_type_name () |
Returns a type descriptor about this object. More... | |
static const opencascade::handle< Standard_Type > & | get_type_descriptor () |
Returns type descriptor of Standard_Transient class. More... | |
Protected Member Functions inherited from Graphic3d_ArrayOfPrimitives | |
Graphic3d_ArrayOfPrimitives (const Graphic3d_TypeOfPrimitiveArray theType, const Standard_Integer theMaxVertexs, const Standard_Integer theMaxBounds, const Standard_Integer theMaxEdges, const Standard_Boolean theHasVNormals, const Standard_Boolean theHasVColors, const Standard_Boolean theHasBColors, const Standard_Boolean theHasVTexels) | |
Warning You must use a coherent set of AddVertex() methods according to the theHasVNormals,theHasVColors,theHasVTexels,theHasBColors. User is responsible of confuse vertex and bad normal orientation. You must use AddBound() method only if the theMaxBounds constructor parameter is > 0. You must use AddEdge() method only if the theMaxEdges constructor parameter is > 0. More... | |
Contains polylines array definition.
Graphic3d_ArrayOfPolylines::Graphic3d_ArrayOfPolylines | ( | const Standard_Integer | maxVertexs, |
const Standard_Integer | maxBounds = 0 , |
||
const Standard_Integer | maxEdges = 0 , |
||
const Standard_Boolean | hasVColors = Standard_False , |
||
const Standard_Boolean | hasBColors = Standard_False |
||
) |
Creates an array of polylines, a polyline can be filled as: 1) creating a single polyline defined with his vertexs. i.e: myArray = Graphic3d_ArrayOfPolylines(7) myArray->AddVertex(x1,y1,z1) .... myArray->AddVertex(x7,y7,z7) 2) creating separate polylines defined with a predefined number of bounds and the number of vertex per bound. i.e: myArray = Graphic3d_ArrayOfPolylines(7,2) myArray->AddBound(4) myArray->AddVertex(x1,y1,z1) .... myArray->AddVertex(x4,y4,z4) myArray->AddBound(3) myArray->AddVertex(x5,y5,z5) .... myArray->AddVertex(x7,y7,z7) 3) creating a single indexed polyline defined with his vertex ans edges. i.e: myArray = Graphic3d_ArrayOfPolylines(4,0,6) myArray->AddVertex(x1,y1,z1) .... myArray->AddVertex(x4,y4,z4) myArray->AddEdge(1) myArray->AddEdge(2) myArray->AddEdge(3) myArray->AddEdge(1) myArray->AddEdge(2) myArray->AddEdge(4) 4) creating separate polylines defined with a predefined number of bounds and the number of edges per bound. i.e: myArray = Graphic3d_ArrayOfPolylines(6,4,14) myArray->AddBound(3) myArray->AddVertex(x1,y1,z1) myArray->AddVertex(x2,y2,z2) myArray->AddVertex(x3,y3,z3) myArray->AddEdge(1) myArray->AddEdge(2) myArray->AddEdge(3) myArray->AddBound(3) myArray->AddVertex(x4,y4,z4) myArray->AddVertex(x5,y5,z5) myArray->AddVertex(x6,y6,z6) myArray->AddEdge(4) myArray->AddEdge(5) myArray->AddEdge(6) myArray->AddBound(4) myArray->AddEdge(2) myArray->AddEdge(3) myArray->AddEdge(5) myArray->AddEdge(6) myArray->AddBound(4) myArray->AddEdge(1) myArray->AddEdge(3) myArray->AddEdge(5) myArray->AddEdge(4)
<maxVertexs> defined the maximun allowed vertex number in the array. <maxBounds> defined the maximun allowed bound number in the array. <maxEdges> defined the maximun allowed edge number in the array. Warning: When <hasVColors> is TRUE , you must use one of AddVertex(Point,Color) or AddVertex(Point,Normal,Color) methods. When <hasBColors> is TRUE , <maxBounds> must be > 0 and you must use the AddBound(number,Color) method.