Open CASCADE Technology 7.8.0
Public Member Functions | Protected Member Functions
VrmlAPI_Writer Class Reference

Creates and writes VRML files from Open CASCADE shapes. A VRML file can be written to an existing VRML file or to a new one. More...

#include <VrmlAPI_Writer.hxx>

Public Member Functions

 VrmlAPI_Writer ()
 Creates a writer object with default parameters.
 
void ResetToDefaults ()
 Resets all parameters (representation, deflection) to their default values..
 
Handle< VrmlConverter_DrawerDrawer () const
 Returns drawer object.
 
void SetDeflection (const Standard_Real aDef)
 Sets the deflection aDef of the mesh algorithm which is used to compute the shaded representation of the translated shape. The default value is -1. When the deflection value is less than 0, the deflection is calculated from the relative size of the shaped.
 
void SetRepresentation (const VrmlAPI_RepresentationOfShape aRep)
 Sets the representation of the shape aRep which is written to the VRML file. The three options are :
 
void SetTransparencyToMaterial (Handle< Vrml_Material > &aMaterial, const Standard_Real aTransparency)
 Set transparency to given material.
 
void SetShininessToMaterial (Handle< Vrml_Material > &aMaterial, const Standard_Real aShininess)
 
void SetAmbientColorToMaterial (Handle< Vrml_Material > &aMaterial, const Handle< Quantity_HArray1OfColor > &Color)
 
void SetDiffuseColorToMaterial (Handle< Vrml_Material > &aMaterial, const Handle< Quantity_HArray1OfColor > &Color)
 
void SetSpecularColorToMaterial (Handle< Vrml_Material > &aMaterial, const Handle< Quantity_HArray1OfColor > &Color)
 
void SetEmissiveColorToMaterial (Handle< Vrml_Material > &aMaterial, const Handle< Quantity_HArray1OfColor > &Color)
 
VrmlAPI_RepresentationOfShape GetRepresentation () const
 Returns the representation of the shape which is written to the VRML file. Types of representation are set through the VrmlAPI_RepresentationOfShape enumeration.
 
Handle< Vrml_MaterialGetFrontMaterial () const
 
Handle< Vrml_MaterialGetPointsMaterial () const
 
Handle< Vrml_MaterialGetUisoMaterial () const
 
Handle< Vrml_MaterialGetVisoMaterial () const
 
Handle< Vrml_MaterialGetLineMaterial () const
 
Handle< Vrml_MaterialGetWireMaterial () const
 
Handle< Vrml_MaterialGetFreeBoundsMaterial () const
 
Handle< Vrml_MaterialGetUnfreeBoundsMaterial () const
 
Standard_Boolean Write (const TopoDS_Shape &aShape, const Standard_CString aFile, const Standard_Integer aVersion=2) const
 Converts the shape aShape to VRML format of the passed version and writes it to the file identified by aFile.
 
Standard_Boolean WriteDoc (const Handle< TDocStd_Document > &theDoc, const Standard_CString theFile, const Standard_Real theScale) const
 Converts the document to VRML format of the passed version and writes it to the file identified by aFile.
 

Protected Member Functions

Standard_Boolean write_v1 (const TopoDS_Shape &aShape, const Standard_CString aFileName) const
 Converts the shape aShape to VRML format of version 1.0 and writes it to the file identified by aFileName using default parameters.
 
Standard_Boolean write_v2 (const TopoDS_Shape &aShape, const Standard_CString aFileName) const
 Converts the shape aShape to VRML format of version 2.0 and writes it to the file identified by aFileName using default parameters.
 

Detailed Description

Creates and writes VRML files from Open CASCADE shapes. A VRML file can be written to an existing VRML file or to a new one.

Constructor & Destructor Documentation

◆ VrmlAPI_Writer()

VrmlAPI_Writer::VrmlAPI_Writer ( )

Creates a writer object with default parameters.

Member Function Documentation

◆ Drawer()

Handle< VrmlConverter_Drawer > VrmlAPI_Writer::Drawer ( ) const

Returns drawer object.

◆ GetFreeBoundsMaterial()

Handle< Vrml_Material > VrmlAPI_Writer::GetFreeBoundsMaterial ( ) const

◆ GetFrontMaterial()

Handle< Vrml_Material > VrmlAPI_Writer::GetFrontMaterial ( ) const

◆ GetLineMaterial()

Handle< Vrml_Material > VrmlAPI_Writer::GetLineMaterial ( ) const

◆ GetPointsMaterial()

Handle< Vrml_Material > VrmlAPI_Writer::GetPointsMaterial ( ) const

◆ GetRepresentation()

VrmlAPI_RepresentationOfShape VrmlAPI_Writer::GetRepresentation ( ) const

Returns the representation of the shape which is written to the VRML file. Types of representation are set through the VrmlAPI_RepresentationOfShape enumeration.

◆ GetUisoMaterial()

Handle< Vrml_Material > VrmlAPI_Writer::GetUisoMaterial ( ) const

◆ GetUnfreeBoundsMaterial()

Handle< Vrml_Material > VrmlAPI_Writer::GetUnfreeBoundsMaterial ( ) const

◆ GetVisoMaterial()

Handle< Vrml_Material > VrmlAPI_Writer::GetVisoMaterial ( ) const

◆ GetWireMaterial()

Handle< Vrml_Material > VrmlAPI_Writer::GetWireMaterial ( ) const

◆ ResetToDefaults()

void VrmlAPI_Writer::ResetToDefaults ( )

Resets all parameters (representation, deflection) to their default values..

◆ SetAmbientColorToMaterial()

void VrmlAPI_Writer::SetAmbientColorToMaterial ( Handle< Vrml_Material > &  aMaterial,
const Handle< Quantity_HArray1OfColor > &  Color 
)

◆ SetDeflection()

void VrmlAPI_Writer::SetDeflection ( const Standard_Real  aDef)

Sets the deflection aDef of the mesh algorithm which is used to compute the shaded representation of the translated shape. The default value is -1. When the deflection value is less than 0, the deflection is calculated from the relative size of the shaped.

◆ SetDiffuseColorToMaterial()

void VrmlAPI_Writer::SetDiffuseColorToMaterial ( Handle< Vrml_Material > &  aMaterial,
const Handle< Quantity_HArray1OfColor > &  Color 
)

◆ SetEmissiveColorToMaterial()

void VrmlAPI_Writer::SetEmissiveColorToMaterial ( Handle< Vrml_Material > &  aMaterial,
const Handle< Quantity_HArray1OfColor > &  Color 
)

◆ SetRepresentation()

void VrmlAPI_Writer::SetRepresentation ( const VrmlAPI_RepresentationOfShape  aRep)

Sets the representation of the shape aRep which is written to the VRML file. The three options are :

  • shaded
  • wireframe
  • both shaded and wireframe (default) defined through the VrmlAPI_RepresentationOfShape enumeration.

◆ SetShininessToMaterial()

void VrmlAPI_Writer::SetShininessToMaterial ( Handle< Vrml_Material > &  aMaterial,
const Standard_Real  aShininess 
)

◆ SetSpecularColorToMaterial()

void VrmlAPI_Writer::SetSpecularColorToMaterial ( Handle< Vrml_Material > &  aMaterial,
const Handle< Quantity_HArray1OfColor > &  Color 
)

◆ SetTransparencyToMaterial()

void VrmlAPI_Writer::SetTransparencyToMaterial ( Handle< Vrml_Material > &  aMaterial,
const Standard_Real  aTransparency 
)

Set transparency to given material.

◆ Write()

Standard_Boolean VrmlAPI_Writer::Write ( const TopoDS_Shape aShape,
const Standard_CString  aFile,
const Standard_Integer  aVersion = 2 
) const

Converts the shape aShape to VRML format of the passed version and writes it to the file identified by aFile.

◆ write_v1()

Standard_Boolean VrmlAPI_Writer::write_v1 ( const TopoDS_Shape aShape,
const Standard_CString  aFileName 
) const
protected

Converts the shape aShape to VRML format of version 1.0 and writes it to the file identified by aFileName using default parameters.

◆ write_v2()

Standard_Boolean VrmlAPI_Writer::write_v2 ( const TopoDS_Shape aShape,
const Standard_CString  aFileName 
) const
protected

Converts the shape aShape to VRML format of version 2.0 and writes it to the file identified by aFileName using default parameters.

◆ WriteDoc()

Standard_Boolean VrmlAPI_Writer::WriteDoc ( const Handle< TDocStd_Document > &  theDoc,
const Standard_CString  theFile,
const Standard_Real  theScale 
) const

Converts the document to VRML format of the passed version and writes it to the file identified by aFile.


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