Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Data Structures | Public Member Functions | Protected Member Functions
VrmlData_ShapeConvert Class Reference

#include <VrmlData_ShapeConvert.hxx>

Data Structures

struct  ShapeData
 

Public Member Functions

 VrmlData_ShapeConvert (VrmlData_Scene &theScene, const double theScale=1.)
 
void AddShape (const TopoDS_Shape &theShape, const char *theName=nullptr)
 
void Convert (const bool theExtractFaces, const bool theExtractEdges, const double theDeflection=0.01, const double theDeflAngle=20. *M_PI/180.)
 
void ConvertDocument (const occ::handle< TDocStd_Document > &theDoc)
 

Protected Member Functions

occ::handle< VrmlData_GeometrytriToIndexedFaceSet (const occ::handle< Poly_Triangulation > &, const TopoDS_Face &, const occ::handle< VrmlData_Coordinate > &)
 
occ::handle< VrmlData_GeometrypolToIndexedLineSet (const occ::handle< Poly_Polygon3D > &)
 
occ::handle< VrmlData_AppearancedefaultMaterialFace () const
 
occ::handle< VrmlData_AppearancedefaultMaterialEdge () const
 
occ::handle< VrmlData_GeometrymakeTShapeNode (const TopoDS_Shape &theShape, const TopAbs_ShapeEnum theShapeType, TopLoc_Location &theLoc)
 
void addAssembly (const occ::handle< VrmlData_Group > &theParent, const TDF_Label &theLabel, const occ::handle< TDocStd_Document > &theDoc, const bool theNeedCreateGroup)
 
void addInstance (const occ::handle< VrmlData_Group > &theParent, const TDF_Label &theLabel, const occ::handle< TDocStd_Document > &theDoc)
 
void addShape (const occ::handle< VrmlData_Group > &theParent, const TDF_Label &theLabel, const occ::handle< TDocStd_Document > &theDoc)
 
occ::handle< VrmlData_AppearancemakeMaterialFromStyle (const XCAFPrs_Style &theStyle, const TDF_Label &theAttribLab) const
 

Detailed Description

Algorithm converting one shape or a set of shapes to VrmlData_Scene.

Constructor & Destructor Documentation

◆ VrmlData_ShapeConvert()

VrmlData_ShapeConvert::VrmlData_ShapeConvert ( VrmlData_Scene & theScene,
const double theScale = 1. )
inline

Constructor.

Parameters
theSceneScene receiving all Vrml data.
theScaleScale factor, considering that VRML standard specifies coordinates in meters. So if your data are in mm, you should provide theScale=0.001

Member Function Documentation

◆ addAssembly()

void VrmlData_ShapeConvert::addAssembly ( const occ::handle< VrmlData_Group > & theParent,
const TDF_Label & theLabel,
const occ::handle< TDocStd_Document > & theDoc,
const bool theNeedCreateGroup )
protected

◆ addInstance()

void VrmlData_ShapeConvert::addInstance ( const occ::handle< VrmlData_Group > & theParent,
const TDF_Label & theLabel,
const occ::handle< TDocStd_Document > & theDoc )
protected

◆ addShape()

void VrmlData_ShapeConvert::addShape ( const occ::handle< VrmlData_Group > & theParent,
const TDF_Label & theLabel,
const occ::handle< TDocStd_Document > & theDoc )
protected

◆ AddShape()

void VrmlData_ShapeConvert::AddShape ( const TopoDS_Shape & theShape,
const char * theName = nullptr )

Add one shape to the internal list, may be called several times with different shapes.

◆ Convert()

void VrmlData_ShapeConvert::Convert ( const bool theExtractFaces,
const bool theExtractEdges,
const double theDeflection = 0.01,
const double theDeflAngle = 20. *M_PI/180. )

Convert all accumulated shapes and store them in myScene. The internal data structures are cleared in the end of conversion.

Parameters
theExtractFacesIf True, converter extracst faces from the shapes.
theExtractEdgesIf True, converter extracts edges from the shapes.
theDeflectionDeflection for tessellation of geometrical lines/surfaces. Existing mesh is used if its deflection is smaller than the one given by this parameter.
theDeflAngleAngular deflection for tessellation of geometrical lines.

◆ ConvertDocument()

void VrmlData_ShapeConvert::ConvertDocument ( const occ::handle< TDocStd_Document > & theDoc)

Add all shapes start from given document with colors and names to the internal structure

◆ defaultMaterialEdge()

occ::handle< VrmlData_Appearance > VrmlData_ShapeConvert::defaultMaterialEdge ( ) const
protected

◆ defaultMaterialFace()

occ::handle< VrmlData_Appearance > VrmlData_ShapeConvert::defaultMaterialFace ( ) const
protected

◆ makeMaterialFromStyle()

occ::handle< VrmlData_Appearance > VrmlData_ShapeConvert::makeMaterialFromStyle ( const XCAFPrs_Style & theStyle,
const TDF_Label & theAttribLab ) const
protected

◆ makeTShapeNode()

occ::handle< VrmlData_Geometry > VrmlData_ShapeConvert::makeTShapeNode ( const TopoDS_Shape & theShape,
const TopAbs_ShapeEnum theShapeType,
TopLoc_Location & theLoc )
protected

◆ polToIndexedLineSet()

occ::handle< VrmlData_Geometry > VrmlData_ShapeConvert::polToIndexedLineSet ( const occ::handle< Poly_Polygon3D > & )
protected

◆ triToIndexedFaceSet()

occ::handle< VrmlData_Geometry > VrmlData_ShapeConvert::triToIndexedFaceSet ( const occ::handle< Poly_Triangulation > & ,
const TopoDS_Face & ,
const occ::handle< VrmlData_Coordinate > &  )
protected

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