Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
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..
 
occ::handle< VrmlConverter_DrawerDrawer () const
 Returns drawer object.
 
void SetDeflection (const double 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 :
 
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.
 
void SetTransparencyToMaterial (occ::handle< Vrml_Material > &aMaterial, const double aTransparency)
 
void SetShininessToMaterial (occ::handle< Vrml_Material > &aMaterial, const double aShininess)
 
void SetAmbientColorToMaterial (occ::handle< Vrml_Material > &aMaterial, const occ::handle< NCollection_HArray1< Quantity_Color > > &Color)
 
void SetDiffuseColorToMaterial (occ::handle< Vrml_Material > &aMaterial, const occ::handle< NCollection_HArray1< Quantity_Color > > &Color)
 
void SetSpecularColorToMaterial (occ::handle< Vrml_Material > &aMaterial, const occ::handle< NCollection_HArray1< Quantity_Color > > &Color)
 
void SetEmissiveColorToMaterial (occ::handle< Vrml_Material > &aMaterial, const occ::handle< NCollection_HArray1< Quantity_Color > > &Color)
 
occ::handle< Vrml_MaterialGetFrontMaterial () const
 
occ::handle< Vrml_MaterialGetPointsMaterial () const
 
occ::handle< Vrml_MaterialGetUisoMaterial () const
 
occ::handle< Vrml_MaterialGetVisoMaterial () const
 
occ::handle< Vrml_MaterialGetLineMaterial () const
 
occ::handle< Vrml_MaterialGetWireMaterial () const
 
occ::handle< Vrml_MaterialGetFreeBoundsMaterial () const
 
occ::handle< Vrml_MaterialGetUnfreeBoundsMaterial () const
 
bool Write (const TopoDS_Shape &aShape, const char *const aFile, const int aVersion=2) const
 Converts the shape aShape to VRML format of the passed version and writes it to the file identified by aFile.
 
bool WriteDoc (const occ::handle< TDocStd_Document > &theDoc, const char *const theFile, const double theScale) const
 Converts the document to VRML format of the passed version and writes it to the file identified by aFile.
 
bool Write (const TopoDS_Shape &aShape, Standard_OStream &theOStream, const int aVersion=2) const
 Converts the shape aShape to VRML format of the passed version and writes it to the given stream.
 
bool WriteDoc (const occ::handle< TDocStd_Document > &theDoc, Standard_OStream &theOStream, const double theScale) const
 Converts the document to VRML format of the passed version and writes it to the given stream.
 

Protected Member Functions

bool write_v1 (const TopoDS_Shape &aShape, Standard_OStream &theOStream) const
 Converts the shape aShape to VRML format of version 1.0 and writes it to the given stream using default parameters.
 
bool write_v2 (const TopoDS_Shape &aShape, Standard_OStream &theOStream) const
 Converts the shape aShape to VRML format of version 2.0 and writes it to the given stream 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()

occ::handle< VrmlConverter_Drawer > VrmlAPI_Writer::Drawer ( ) const

Returns drawer object.

◆ GetFreeBoundsMaterial()

occ::handle< Vrml_Material > VrmlAPI_Writer::GetFreeBoundsMaterial ( ) const

◆ GetFrontMaterial()

occ::handle< Vrml_Material > VrmlAPI_Writer::GetFrontMaterial ( ) const

◆ GetLineMaterial()

occ::handle< Vrml_Material > VrmlAPI_Writer::GetLineMaterial ( ) const

◆ GetPointsMaterial()

occ::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()

occ::handle< Vrml_Material > VrmlAPI_Writer::GetUisoMaterial ( ) const

◆ GetUnfreeBoundsMaterial()

occ::handle< Vrml_Material > VrmlAPI_Writer::GetUnfreeBoundsMaterial ( ) const

◆ GetVisoMaterial()

occ::handle< Vrml_Material > VrmlAPI_Writer::GetVisoMaterial ( ) const

◆ GetWireMaterial()

occ::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 ( occ::handle< Vrml_Material > & aMaterial,
const occ::handle< NCollection_HArray1< Quantity_Color > > & Color )
Deprecated

Call Vrml_Material::SetAmbientColor() directly instead.

("Call Vrml_Material::SetAmbientColor() directly instead")

◆ SetDeflection()

void VrmlAPI_Writer::SetDeflection ( const double 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 ( occ::handle< Vrml_Material > & aMaterial,
const occ::handle< NCollection_HArray1< Quantity_Color > > & Color )
Deprecated

Call Vrml_Material::SetDiffuseColor() directly instead.

("Call Vrml_Material::SetDiffuseColor() directly instead")

◆ SetEmissiveColorToMaterial()

void VrmlAPI_Writer::SetEmissiveColorToMaterial ( occ::handle< Vrml_Material > & aMaterial,
const occ::handle< NCollection_HArray1< Quantity_Color > > & Color )
Deprecated

Call Vrml_Material::SetEmissiveColor() directly instead.

("Call Vrml_Material::SetEmissiveColor() directly instead")

◆ 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 ( occ::handle< Vrml_Material > & aMaterial,
const double aShininess )
Deprecated

Call Vrml_Material::SetShininess() directly instead.

("Call Vrml_Material::SetShininess() directly instead")

◆ SetSpecularColorToMaterial()

void VrmlAPI_Writer::SetSpecularColorToMaterial ( occ::handle< Vrml_Material > & aMaterial,
const occ::handle< NCollection_HArray1< Quantity_Color > > & Color )
Deprecated

Call Vrml_Material::SetSpecularColor() directly instead.

("Call Vrml_Material::SetSpecularColor() directly instead")

◆ SetTransparencyToMaterial()

void VrmlAPI_Writer::SetTransparencyToMaterial ( occ::handle< Vrml_Material > & aMaterial,
const double aTransparency )
Deprecated

Call Vrml_Material::SetTransparency() directly instead.

("Call Vrml_Material::SetTransparency() directly instead")

◆ Write() [1/2]

bool VrmlAPI_Writer::Write ( const TopoDS_Shape & aShape,
const char *const aFile,
const int aVersion = 2 ) const

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

◆ Write() [2/2]

bool VrmlAPI_Writer::Write ( const TopoDS_Shape & aShape,
Standard_OStream & theOStream,
const int aVersion = 2 ) const

Converts the shape aShape to VRML format of the passed version and writes it to the given stream.

◆ write_v1()

bool VrmlAPI_Writer::write_v1 ( const TopoDS_Shape & aShape,
Standard_OStream & theOStream ) const
protected

Converts the shape aShape to VRML format of version 1.0 and writes it to the given stream using default parameters.

◆ write_v2()

bool VrmlAPI_Writer::write_v2 ( const TopoDS_Shape & aShape,
Standard_OStream & theOStream ) const
protected

Converts the shape aShape to VRML format of version 2.0 and writes it to the given stream using default parameters.

◆ WriteDoc() [1/2]

bool VrmlAPI_Writer::WriteDoc ( const occ::handle< TDocStd_Document > & theDoc,
const char *const theFile,
const double theScale ) const

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

◆ WriteDoc() [2/2]

bool VrmlAPI_Writer::WriteDoc ( const occ::handle< TDocStd_Document > & theDoc,
Standard_OStream & theOStream,
const double theScale ) const

Converts the document to VRML format of the passed version and writes it to the given stream.


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