Open CASCADE Technology  7.5.0
Public Member Functions | Protected Attributes
RWGltf_GltfLatePrimitiveArray Class Reference

Mesh data wrapper for delayed primitive array loading from glTF file. Class inherits Poly_Triangulation so that it can be put temporarily into TopoDS_Face within assembly structure, to be replaced with proper Poly_Triangulation loaded later on. More...

#include <RWGltf_GltfLatePrimitiveArray.hxx>

Inheritance diagram for RWGltf_GltfLatePrimitiveArray:
Inheritance graph
[legend]

Public Member Functions

 RWGltf_GltfLatePrimitiveArray (const TCollection_AsciiString &theId, const TCollection_AsciiString &theName)
 Constructor. More...
 
virtual ~RWGltf_GltfLatePrimitiveArray ()
 Destructor. More...
 
const TCollection_AsciiStringId () const
 Entity id. More...
 
const TCollection_AsciiStringName () const
 Entity name. More...
 
void SetName (const TCollection_AsciiString &theName)
 Assign entity name. More...
 
RWGltf_GltfPrimitiveMode PrimitiveMode () const
 Return type of primitive array. More...
 
void SetPrimitiveMode (RWGltf_GltfPrimitiveMode theMode)
 Set type of primitive array. More...
 
bool HasStyle () const
 Return true if primitive array has assigned material. More...
 
Quantity_ColorRGBA BaseColor () const
 Return base color. More...
 
const Handle< RWGltf_MaterialMetallicRoughness > & MaterialPbr () const
 Return PBR material definition. More...
 
void SetMaterialPbr (const Handle< RWGltf_MaterialMetallicRoughness > &theMat)
 Set PBR material definition. More...
 
const Handle< RWGltf_MaterialCommon > & MaterialCommon () const
 Return common (obsolete) material definition. More...
 
void SetMaterialCommon (const Handle< RWGltf_MaterialCommon > &theMat)
 Set common (obsolete) material definition. More...
 
const NCollection_Sequence< RWGltf_GltfPrimArrayData > & Data () const
 Return primitive array data elements. More...
 
RWGltf_GltfPrimArrayDataAddPrimArrayData (RWGltf_GltfArrayType theType)
 Add primitive array data element. More...
 
const Bnd_BoxBoundingBox () const
 Return bounding box defined within glTF file, or VOID if not specified. More...
 
void SetBoundingBox (const Bnd_Box &theBox)
 This method sets input bounding box and assigns a FAKE data to underlying Poly_Triangulation as Min/Max corners of bounding box, so that standard tools like BRepBndLib::Add() can be used transparently for computing bounding box of this face. More...
 
- Public Member Functions inherited from Poly_Triangulation
 Poly_Triangulation (const Standard_Integer nbNodes, const Standard_Integer nbTriangles, const Standard_Boolean UVNodes)
 Constructs a triangulation from a set of triangles. The triangulation is initialized without a triangle or a node, but capable of containing nbNodes nodes, and nbTriangles triangles. Here the UVNodes flag indicates whether 2D nodes will be associated with 3D ones, (i.e. to enable a 2D representation). More...
 
 Poly_Triangulation (const TColgp_Array1OfPnt &Nodes, const Poly_Array1OfTriangle &Triangles)
 Constructs a triangulation from a set of triangles. The triangulation is initialized with 3D points from Nodes and triangles from Triangles. More...
 
 Poly_Triangulation (const TColgp_Array1OfPnt &Nodes, const TColgp_Array1OfPnt2d &UVNodes, const Poly_Array1OfTriangle &Triangles)
 Constructs a triangulation from a set of triangles. The triangulation is initialized with 3D points from Nodes, 2D points from UVNodes and triangles from Triangles, where coordinates of a 2D point from UVNodes are the (u, v) parameters of the corresponding 3D point from Nodes on the surface approximated by the constructed triangulation. More...
 
virtual Handle< Poly_TriangulationCopy () const
 Creates full copy of current triangulation. More...
 
 Poly_Triangulation (const Handle< Poly_Triangulation > &theTriangulation)
 Copy constructor for triangulation. More...
 
Standard_Real Deflection () const
 Returns the deflection of this triangulation. More...
 
void Deflection (const Standard_Real theDeflection)
 Sets the deflection of this triangulation to theDeflection. See more on deflection in Polygon2D. More...
 
void RemoveUVNodes ()
 Deallocates the UV nodes. More...
 
Standard_Integer NbNodes () const
 Returns the number of nodes for this triangulation. More...
 
Standard_Integer NbTriangles () const
 Returns the number of triangles for this triangulation. More...
 
Standard_Boolean HasUVNodes () const
 Returns Standard_True if 2D nodes are associated with 3D nodes for this triangulation. More...
 
const TColgp_Array1OfPntNodes () const
 Returns the table of 3D nodes (3D points) for this triangulation. More...
 
TColgp_Array1OfPntChangeNodes ()
 Returns the table of 3D nodes (3D points) for this triangulation. The returned array is shared. Therefore if the table is selected by reference, you can, by simply modifying it, directly modify the data structure of this triangulation. More...
 
const gp_PntNode (const Standard_Integer theIndex) const
 Returns node at the given index. Raises Standard_OutOfRange exception if theIndex is less than 1 or greater than NbNodes. More...
 
gp_PntChangeNode (const Standard_Integer theIndex)
 Give access to the node at the given index. Raises Standard_OutOfRange exception if theIndex is less than 1 or greater than NbNodes. More...
 
const TColgp_Array1OfPnt2dUVNodes () const
 Returns the table of 2D nodes (2D points) associated with each 3D node of this triangulation. The function HasUVNodes checks if 2D nodes are associated with the 3D nodes of this triangulation. Const reference on the 2d nodes values. More...
 
TColgp_Array1OfPnt2dChangeUVNodes ()
 Returns the table of 2D nodes (2D points) associated with each 3D node of this triangulation. Function ChangeUVNodes shares the returned array. Therefore if the table is selected by reference, you can, by simply modifying it, directly modify the data structure of this triangulation. More...
 
const gp_Pnt2dUVNode (const Standard_Integer theIndex) const
 Returns UVNode at the given index. Raises Standard_OutOfRange exception if theIndex is less than 1 or greater than NbNodes. More...
 
gp_Pnt2dChangeUVNode (const Standard_Integer theIndex)
 Give access to the UVNode at the given index. Raises Standard_OutOfRange exception if theIndex is less than 1 or greater than NbNodes. More...
 
const Poly_Array1OfTriangleTriangles () const
 Returns the table of triangles for this triangulation. More...
 
Poly_Array1OfTriangleChangeTriangles ()
 Returns the table of triangles for this triangulation. Function ChangeUVNodes shares the returned array. Therefore if the table is selected by reference, you can, by simply modifying it, directly modify the data structure of this triangulation. More...
 
const Poly_TriangleTriangle (const Standard_Integer theIndex) const
 Returns triangle at the given index. Raises Standard_OutOfRange exception if theIndex is less than 1 or greater than NbTriangles. More...
 
Poly_TriangleChangeTriangle (const Standard_Integer theIndex)
 Give access to the triangle at the given index. Raises Standard_OutOfRange exception if theIndex is less than 1 or greater than NbTriangles. More...
 
void SetNormals (const Handle< TShort_HArray1OfShortReal > &theNormals)
 Sets the table of node normals. raises exception if length of theNormals != 3*NbNodes. More...
 
const TShort_Array1OfShortRealNormals () const
 Returns the table of node normals. More...
 
TShort_Array1OfShortRealChangeNormals ()
 Gives access to the table of node normals. More...
 
Standard_Boolean HasNormals () const
 Returns Standard_True if nodal normals are defined. More...
 
gp_Dir Normal (const Standard_Integer theIndex) const
 
void SetNormal (const Standard_Integer theIndex, const gp_Dir &theNormal)
 Changes normal at the given index. Raises Standard_OutOfRange exception. More...
 
virtual void DumpJson (Standard_OStream &theOStream, Standard_Integer theDepth=-1) const
 Dumps the content of me into the stream. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (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_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. 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...
 

Protected Attributes

NCollection_Sequence< RWGltf_GltfPrimArrayDatamyData
 
Handle< RWGltf_MaterialMetallicRoughnessmyMaterialPbr
 PBR material. More...
 
Handle< RWGltf_MaterialCommonmyMaterialCommon
 common (obsolete) material More...
 
Bnd_Box myBox
 bounding box More...
 
TCollection_AsciiString myId
 entity id More...
 
TCollection_AsciiString myName
 entity name More...
 
RWGltf_GltfPrimitiveMode myPrimMode
 type of primitive array More...
 
- Protected Attributes inherited from Poly_Triangulation
Standard_Real myDeflection
 
TColgp_Array1OfPnt myNodes
 
Handle< TColgp_HArray1OfPnt2d > myUVNodes
 
Poly_Array1OfTriangle myTriangles
 
Handle< TShort_HArray1OfShortReal > myNormals
 

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

Detailed Description

Mesh data wrapper for delayed primitive array loading from glTF file. Class inherits Poly_Triangulation so that it can be put temporarily into TopoDS_Face within assembly structure, to be replaced with proper Poly_Triangulation loaded later on.

Constructor & Destructor Documentation

◆ RWGltf_GltfLatePrimitiveArray()

RWGltf_GltfLatePrimitiveArray::RWGltf_GltfLatePrimitiveArray ( const TCollection_AsciiString theId,
const TCollection_AsciiString theName 
)

Constructor.

◆ ~RWGltf_GltfLatePrimitiveArray()

virtual RWGltf_GltfLatePrimitiveArray::~RWGltf_GltfLatePrimitiveArray ( )
virtual

Destructor.

Member Function Documentation

◆ AddPrimArrayData()

RWGltf_GltfPrimArrayData& RWGltf_GltfLatePrimitiveArray::AddPrimArrayData ( RWGltf_GltfArrayType  theType)

Add primitive array data element.

◆ BaseColor()

Quantity_ColorRGBA RWGltf_GltfLatePrimitiveArray::BaseColor ( ) const

Return base color.

◆ BoundingBox()

const Bnd_Box& RWGltf_GltfLatePrimitiveArray::BoundingBox ( ) const
inline

Return bounding box defined within glTF file, or VOID if not specified.

◆ Data()

const NCollection_Sequence<RWGltf_GltfPrimArrayData>& RWGltf_GltfLatePrimitiveArray::Data ( ) const
inline

Return primitive array data elements.

◆ HasStyle()

bool RWGltf_GltfLatePrimitiveArray::HasStyle ( ) const
inline

Return true if primitive array has assigned material.

◆ Id()

const TCollection_AsciiString& RWGltf_GltfLatePrimitiveArray::Id ( ) const
inline

Entity id.

◆ MaterialCommon()

const Handle< RWGltf_MaterialCommon >& RWGltf_GltfLatePrimitiveArray::MaterialCommon ( ) const
inline

Return common (obsolete) material definition.

◆ MaterialPbr()

const Handle< RWGltf_MaterialMetallicRoughness >& RWGltf_GltfLatePrimitiveArray::MaterialPbr ( ) const
inline

Return PBR material definition.

◆ Name()

const TCollection_AsciiString& RWGltf_GltfLatePrimitiveArray::Name ( ) const
inline

Entity name.

◆ PrimitiveMode()

RWGltf_GltfPrimitiveMode RWGltf_GltfLatePrimitiveArray::PrimitiveMode ( ) const
inline

Return type of primitive array.

◆ SetBoundingBox()

void RWGltf_GltfLatePrimitiveArray::SetBoundingBox ( const Bnd_Box theBox)

This method sets input bounding box and assigns a FAKE data to underlying Poly_Triangulation as Min/Max corners of bounding box, so that standard tools like BRepBndLib::Add() can be used transparently for computing bounding box of this face.

◆ SetMaterialCommon()

void RWGltf_GltfLatePrimitiveArray::SetMaterialCommon ( const Handle< RWGltf_MaterialCommon > &  theMat)
inline

Set common (obsolete) material definition.

◆ SetMaterialPbr()

void RWGltf_GltfLatePrimitiveArray::SetMaterialPbr ( const Handle< RWGltf_MaterialMetallicRoughness > &  theMat)
inline

Set PBR material definition.

◆ SetName()

void RWGltf_GltfLatePrimitiveArray::SetName ( const TCollection_AsciiString theName)
inline

Assign entity name.

◆ SetPrimitiveMode()

void RWGltf_GltfLatePrimitiveArray::SetPrimitiveMode ( RWGltf_GltfPrimitiveMode  theMode)
inline

Set type of primitive array.

Field Documentation

◆ myBox

Bnd_Box RWGltf_GltfLatePrimitiveArray::myBox
protected

bounding box

◆ myData

NCollection_Sequence<RWGltf_GltfPrimArrayData> RWGltf_GltfLatePrimitiveArray::myData
protected

◆ myId

TCollection_AsciiString RWGltf_GltfLatePrimitiveArray::myId
protected

entity id

◆ myMaterialCommon

Handle< RWGltf_MaterialCommon > RWGltf_GltfLatePrimitiveArray::myMaterialCommon
protected

common (obsolete) material

◆ myMaterialPbr

Handle< RWGltf_MaterialMetallicRoughness > RWGltf_GltfLatePrimitiveArray::myMaterialPbr
protected

PBR material.

◆ myName

TCollection_AsciiString RWGltf_GltfLatePrimitiveArray::myName
protected

entity name

◆ myPrimMode

RWGltf_GltfPrimitiveMode RWGltf_GltfLatePrimitiveArray::myPrimMode
protected

type of primitive array


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